├── .babelrc ├── .gitignore ├── .prettierrc ├── ReadMe.md ├── assets ├── assets.controller.js └── assets.route.js ├── index.js ├── package-lock.json ├── package.json ├── page ├── page.controller.js ├── page.modal.js ├── page.route.js └── page.services.js ├── project ├── project.controller.js ├── project.model.js ├── project.route.js └── project.service.js ├── public ├── css │ ├── fonts │ │ ├── main-fonts.eot │ │ ├── main-fonts.svg │ │ ├── main-fonts.ttf │ │ └── main-fonts.woff │ ├── lib │ │ ├── bootstrap.min.css │ │ └── grapes.min.css │ ├── main.css │ ├── main.css.map │ └── main.scss └── js │ ├── custom.js │ ├── lib │ ├── axios.min.js │ ├── bootstrap.min.js │ ├── grapes.min.js │ ├── grapesjs-blocks-basic.js │ └── popper.min.js │ └── main.js ├── render └── render.controller.js ├── server.js ├── ui ├── ui.controller.js └── ui.route.js └── views ├── 404.hbs ├── editor.hbs ├── home.hbs └── render.hbs /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["babel-preset-env"], 3 | "plugins": [ 4 | [ 5 | "transform-runtime", 6 | { 7 | "regenerator": true 8 | } 9 | ] 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | css/.DS_Store 3 | node_modules -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all", 4 | "printWidth": 100 5 | } 6 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | [Github Code](https://github.com/code-dexterous/grapesjs-example-html/tree/ab78eddf78362d373614130b6a2544f850938246) 2 | 3 | [Medium Blog](https://codedexterous.medium.com/create-your-own-webpge-website-builder-8d77097585f8) 4 | 5 | [Video Tutorial](https://www.youtube.com/c/CodeDexterous) 6 | -------------------------------------------------------------------------------- /assets/assets.controller.js: -------------------------------------------------------------------------------- 1 | export const loadAllAssets = async (req, res) => { 2 | const assets = [ 3 | { 4 | type: 'image', 5 | src: 'http://placehold.it/350x250/459ba8/fff/image2.jpg', 6 | height: 350, 7 | width: 250, 8 | }, 9 | { 10 | src: 'http://placehold.it/350x250/79c267/fff/image3.jpg', 11 | height: 350, 12 | width: 250, 13 | }, 14 | { 15 | src: 'http://placehold.it/350x250/79c267/fff/image3.jpg', 16 | height: 350, 17 | width: 250, 18 | }, 19 | ]; 20 | res.json(assets); 21 | }; 22 | -------------------------------------------------------------------------------- /assets/assets.route.js: -------------------------------------------------------------------------------- 1 | import express from 'express'; 2 | import { loadAllAssets } from './assets.controller'; 3 | 4 | const assetRoute = express.Router(); 5 | 6 | assetRoute.get('/', loadAllAssets); 7 | 8 | export default assetRoute; 9 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | require('dotenv').config(); 2 | require('babel-register'); 3 | require('./server'); 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Webpage Builder", 3 | "version": "1.0.0", 4 | "description": "[Github Code](https://github.com/vijayshukla30/grapesjs-example-html", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "start": "nodemon index.js" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/vijayshukla30/grapesjs-example-html.git" 13 | }, 14 | "keywords": [], 15 | "author": "", 16 | "license": "ISC", 17 | "bugs": { 18 | "url": "https://github.com/vijayshukla30/grapesjs-example-html/issues" 19 | }, 20 | "homepage": "https://github.com/vijayshukla30/grapesjs-example-html#readme", 21 | "devDependencies": { 22 | "babel-cli": "^6.26.0", 23 | "babel-core": "^6.26.3", 24 | "babel-loader": "^8.2.2", 25 | "babel-plugin-transform-runtime": "^6.23.0", 26 | "babel-preset-env": "^1.7.0", 27 | "nodemon": "^2.0.7" 28 | }, 29 | "dependencies": { 30 | "cors": "^2.8.5", 31 | "dotenv": "^8.2.0", 32 | "express": "^4.17.1", 33 | "hbs": "^4.1.1", 34 | "mongoose": "^5.12.2" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /page/page.controller.js: -------------------------------------------------------------------------------- 1 | import { 2 | createPage, 3 | deletePage, 4 | listPages, 5 | pageDetails, 6 | savePageContent, 7 | updatePage, 8 | } from './page.services'; 9 | 10 | export const create = async (req, res) => { 11 | const pageBody = req.body; 12 | const page = await createPage(pageBody); 13 | res.json(page); 14 | }; 15 | export const list = async (req, res) => { 16 | const pages = await listPages(); 17 | res.json(pages); 18 | }; 19 | export const details = async (req, res) => { 20 | const { pageId } = req.params; 21 | const details = await pageDetails(pageId); 22 | res.json(details); 23 | }; 24 | export const deletePageRecord = async (req, res) => { 25 | const { pageId } = req.params; 26 | const data = await deletePage(pageId); 27 | res.json(data); 28 | }; 29 | export const update = async (req, res) => { 30 | const { pageId } = req.params; 31 | const pageBody = req.body; 32 | const page = await updatePage(pageId, pageBody); 33 | res.json(page); 34 | }; 35 | export const changeContent = async (req, res) => { 36 | const { pageId } = req.params; 37 | const pageContent = await savePageContent(pageId, req.body); 38 | res.json(pageContent); 39 | }; 40 | export const loadContent = async (req, res) => { 41 | const { pageId } = req.params; 42 | res.header('Content-Type', 'application/json'); 43 | const pageData = await pageDetails(pageId); 44 | res.json(pageData.content); 45 | }; 46 | -------------------------------------------------------------------------------- /page/page.modal.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const { Schema } = mongoose; 3 | 4 | const Page = new mongoose.Schema( 5 | { 6 | name: { 7 | type: String, 8 | required: true, 9 | trim: true, 10 | maxlength: 25, 11 | }, 12 | slug: { 13 | type: String, 14 | required: true, 15 | }, 16 | content: Object, 17 | }, 18 | { 19 | timestamps: true, 20 | }, 21 | ); 22 | 23 | export default mongoose.model('Pages', Page); 24 | -------------------------------------------------------------------------------- /page/page.route.js: -------------------------------------------------------------------------------- 1 | import express from 'express'; 2 | import { 3 | changeContent, 4 | create, 5 | update, 6 | deletePageRecord, 7 | details, 8 | list, 9 | loadContent, 10 | } from './page.controller'; 11 | 12 | const pageRoute = express.Router(); 13 | pageRoute.post('/', create); 14 | pageRoute.post('/:pageId/content', changeContent); 15 | 16 | pageRoute.put('/:pageId', update); 17 | 18 | pageRoute.delete('/:pageId', deletePageRecord); 19 | 20 | pageRoute.get('/:pageId', details); 21 | pageRoute.get('/', list); 22 | pageRoute.get('/:pageId/content', loadContent); 23 | 24 | export default pageRoute; 25 | -------------------------------------------------------------------------------- /page/page.services.js: -------------------------------------------------------------------------------- 1 | import Pages from './page.modal'; 2 | 3 | export const createPage = async (pageBody) => { 4 | const slug = pageBody.name.toLowerCase().split(' ').join('-'); 5 | pageBody.slug = slug; 6 | const page = new Pages(pageBody); 7 | const pageResponse = await page.save(); 8 | return pageResponse; 9 | }; 10 | export const listPages = async () => { 11 | const pages = await Pages.find({}); 12 | return pages; 13 | }; 14 | export const deletePage = async (pageId) => {}; 15 | export const updatePage = async (pageId, pageBody) => {}; 16 | export const pageDetails = async (pageId) => { 17 | const pages = await Pages.findOne({ _id: pageId }); 18 | return pages; 19 | }; 20 | export const savePageContent = async (pageId, content) => { 21 | const pageUpdated = await Pages.findOneAndUpdate({ _id: pageId }, { content }); 22 | return pageUpdated; 23 | }; 24 | export const findPageById = async (pageId) => { 25 | const page = await Pages.findById(pageId); 26 | return page; 27 | }; 28 | -------------------------------------------------------------------------------- /project/project.controller.js: -------------------------------------------------------------------------------- 1 | import { createProject, findProject } from './project.service'; 2 | 3 | export const create = async (req, res, next) => { 4 | try { 5 | const response = await createProject(req.body); 6 | res.status(200).json(response); 7 | } catch (error) { 8 | console.error(error); 9 | res.status(400).send(error); 10 | } 11 | }; 12 | 13 | export const findAll = async (req, res, next) => { 14 | const projects = await findProject({}); 15 | res.status(200).json(projects); 16 | }; 17 | -------------------------------------------------------------------------------- /project/project.model.js: -------------------------------------------------------------------------------- 1 | const mongoose = require('mongoose'); 2 | const { Schema } = mongoose; 3 | const Project = new mongoose.Schema( 4 | { 5 | name: { 6 | type: String, 7 | required: true, 8 | trim: true, 9 | maxlength: 25, 10 | }, 11 | description: { 12 | type: String, 13 | }, 14 | logo: { 15 | type: String, 16 | }, 17 | }, 18 | { 19 | timestamps: true, 20 | }, 21 | ); 22 | 23 | export default mongoose.model('Projects', Project); 24 | -------------------------------------------------------------------------------- /project/project.route.js: -------------------------------------------------------------------------------- 1 | import express from 'express'; 2 | import { create, findAll } from './project.controller'; 3 | 4 | const projectRoute = express.Router(); 5 | projectRoute.post('/', create); 6 | projectRoute.get('/', findAll); 7 | export default projectRoute; 8 | -------------------------------------------------------------------------------- /project/project.service.js: -------------------------------------------------------------------------------- 1 | import Projects from './project.model'; 2 | 3 | export const createProject = async (body) => { 4 | const projects = await findProject({ name: body.name }); 5 | console.log('projects :>> ', projects); 6 | if (projects && projects.length > 0) { 7 | throw new Error(`Project with name: ${body.name} already exists`); 8 | } 9 | console.log('jdjdjdjdjdjdjdjdjdjjd'); 10 | const project = new Projects(body); 11 | console.log('project :>> ', project); 12 | return await project.save(); 13 | }; 14 | 15 | export const findProjectByUuid = async (projectId) => {}; 16 | export const findProject = async (query) => { 17 | const projects = await Projects.find(query); 18 | return projects; 19 | }; 20 | -------------------------------------------------------------------------------- /public/css/fonts/main-fonts.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-dexterous/grapesjs-example-html/81de41b3bfbb33cfaabd57c046e1109068582e78/public/css/fonts/main-fonts.eot -------------------------------------------------------------------------------- /public/css/fonts/main-fonts.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 29 | 34 | 35 | 42 | 51 | 55 | 58 | 63 | 68 | 73 | 78 | 83 | 88 | 93 | 98 | 103 | 108 | 113 | 118 | 123 | 128 | 133 | 138 | 143 | 148 | 153 | 154 | 155 | 186 | 196 | 197 | 199 | 200 | 202 | image/svg+xml 203 | 205 | 206 | 207 | 208 | 209 | 214 | 219 | 224 | 229 | 234 | 240 | 245 | 248 | 253 | 254 | 269 | 285 | 290 | Borders: 30pxCanvas: 1000x1000px 308 | 312 | 315 | 317 | 321 | 325 | 329 | 333 | 337 | 341 | 345 | 349 | 350 | 351 | 352 | 353 | 358 | 363 | 368 | 373 | 378 | 383 | 388 | 393 | 394 | 395 | -------------------------------------------------------------------------------- /public/css/fonts/main-fonts.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-dexterous/grapesjs-example-html/81de41b3bfbb33cfaabd57c046e1109068582e78/public/css/fonts/main-fonts.ttf -------------------------------------------------------------------------------- /public/css/fonts/main-fonts.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code-dexterous/grapesjs-example-html/81de41b3bfbb33cfaabd57c046e1109068582e78/public/css/fonts/main-fonts.woff -------------------------------------------------------------------------------- /public/css/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html { 7 | overflow: scroll; 8 | overflow-x: hidden; 9 | -ms-overflow-style: none; 10 | scrollbar-width: none; 11 | } 12 | 13 | ::-webkit-scrollbar { 14 | display: none; 15 | } 16 | 17 | .sidenav { 18 | position: fixed; 19 | top: 0; 20 | left: 0; 21 | width: 15%; 22 | height: 100vh; 23 | overflow: scroll; 24 | overflow-x: hidden; 25 | -ms-overflow-style: none; 26 | scrollbar-width: none; 27 | background-color: rgba(255, 255, 255, 0.95); 28 | -webkit-transition: 0.5s; 29 | transition: 0.5s; 30 | -webkit-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05); 31 | box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05); 32 | border: 1px solid rgba(0, 0, 0, 0.3); 33 | } 34 | 35 | .sidenav .logo { 36 | border-bottom: 1px solid rgba(0, 0, 0, 0.3); 37 | text-transform: uppercase; 38 | font-size: 20px; 39 | font-weight: 700; 40 | } 41 | 42 | .sidenav .pages { 43 | height: 100px; 44 | overflow: scroll; 45 | overflow-x: hidden; 46 | } 47 | 48 | .main-content { 49 | position: relative; 50 | width: 85%; 51 | left: 15%; 52 | } 53 | 54 | .main-content .navbar { 55 | padding: 0; 56 | } 57 | 58 | .main-content .navbar .container-fluid { 59 | padding: 0; 60 | } 61 | 62 | .main-content #editor { 63 | border: 2px solid rgba(0, 0, 0, 0.3); 64 | } 65 | 66 | .nav { 67 | -webkit-box-pack: justify; 68 | -ms-flex-pack: justify; 69 | justify-content: space-between; 70 | } 71 | 72 | .gjs-pn-panel { 73 | position: relative; 74 | } 75 | 76 | .gjs-cv-canvas { 77 | width: 100%; 78 | height: 100%; 79 | top: 0; 80 | } 81 | 82 | .tab-content { 83 | display: contents; 84 | } 85 | 86 | #block { 87 | height: 100%; 88 | } 89 | 90 | #block #blocks { 91 | height: 100%; 92 | } 93 | 94 | #block #blocks .gjs-blocks-c { 95 | -webkit-box-align: center; 96 | -ms-flex-align: center; 97 | align-items: center; 98 | -webkit-box-pack: center; 99 | -ms-flex-pack: center; 100 | justify-content: center; 101 | } 102 | 103 | #block #blocks .gjs-block { 104 | -webkit-box-pack: center; 105 | -ms-flex-pack: center; 106 | justify-content: center; 107 | } 108 | 109 | #block #blocks .gjs-block-label { 110 | display: none; 111 | } 112 | 113 | /* Theming */ 114 | .gjs-one-bg { 115 | background-color: #fcf6f5ff; 116 | } 117 | 118 | .gjs-two-color { 119 | color: #990011ff; 120 | } 121 | 122 | .gjs-three-bg { 123 | background-color: #990011ff; 124 | color: #fcf6f5ff; 125 | } 126 | 127 | .gjs-four-color, 128 | .gjs-four-color-h:hover { 129 | color: #990011ff; 130 | } 131 | 132 | .gjs-pn-btn { 133 | border: 1px solid #990011ff; 134 | } 135 | 136 | .btn, 137 | .nav-link, 138 | .modal-content, 139 | .form-control { 140 | border-radius: 0 !important; 141 | } 142 | 143 | .btn .fa { 144 | color: #990011ff; 145 | } 146 | 147 | .btn:hover .fa { 148 | color: #fcf6f5ff; 149 | } 150 | 151 | /** Error **/ 152 | .error .bg-body { 153 | min-height: 150px; 154 | max-height: 150px; 155 | display: -webkit-box; 156 | display: -ms-flexbox; 157 | display: flex; 158 | -webkit-box-align: center; 159 | -ms-flex-align: center; 160 | align-items: center; 161 | -webkit-box-pack: center; 162 | -ms-flex-pack: center; 163 | justify-content: center; 164 | } 165 | 166 | .error .bg-body .title { 167 | font-weight: 600; 168 | } 169 | 170 | .error .btn { 171 | border-radius: 40px !important; 172 | padding: 15px 20px; 173 | font-size: 14px; 174 | font-weight: 700; 175 | min-width: 150px; 176 | } 177 | /*# sourceMappingURL=main.css.map */ 178 | -------------------------------------------------------------------------------- /public/css/main.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "mappings": "AAAA,AAAA,IAAI,CAAC;EACH,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;CACX;;AACD,AAAA,IAAI,CAAC;EACH,QAAQ,EAAE,MAAM;EAChB,UAAU,EAAE,MAAM;EAClB,kBAAkB,EAAE,IAAI;EACxB,eAAe,EAAE,IAAI;CACtB;;AAED,AAAA,mBAAmB,CAAC;EAClB,OAAO,EAAE,IAAI;CACd;;AAED,AAAA,QAAQ,CAAC;EACP,QAAQ,EAAE,KAAK;EACf,GAAG,EAAE,CAAC;EACN,IAAI,EAAE,CAAC;EACP,KAAK,EAAE,GAAG;EACV,MAAM,EAAE,KAAK;EACb,QAAQ,EAAE,MAAM;EAChB,UAAU,EAAE,MAAM;EAClB,kBAAkB,EAAE,IAAI;EACxB,eAAe,EAAE,IAAI;EACrB,gBAAgB,EAAE,yBAAyB;EAC3C,UAAU,EAAE,IAAI;EAChB,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB;EAC7C,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,kBAAkB;CAYrC;;AAzBD,AAcE,QAdM,CAcN,KAAK,CAAC;EACJ,aAAa,EAAE,GAAG,CAAC,KAAK,CAAC,kBAAkB;EAC3C,cAAc,EAAE,SAAS;EACzB,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,GAAG;CACjB;;AAnBH,AAoBE,QApBM,CAoBN,MAAM,CAAC;EACL,MAAM,EAAE,KAAK;EACb,QAAQ,EAAE,MAAM;EAChB,UAAU,EAAE,MAAM;CACnB;;AAGH,AAAA,aAAa,CAAC;EACZ,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,GAAG;EACV,IAAI,EAAE,GAAG;CAYV;;AAfD,AAKE,aALW,CAKX,OAAO,CAAC;EACN,OAAO,EAAE,CAAC;CAIX;;AAVH,AAOI,aAPS,CAKX,OAAO,CAEL,gBAAgB,CAAC;EACf,OAAO,EAAE,CAAC;CACX;;AATL,AAYE,aAZW,CAYX,OAAO,CAAC;EACN,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,kBAAkB;CACrC;;AAGH,AAAA,IAAI,CAAC;EACH,eAAe,EAAE,aAAa;CAC/B;;AACD,AAAA,aAAa,CAAC;EACZ,QAAQ,EAAE,QAAQ;CACnB;;AAED,AAAA,cAAc,CAAC;EACb,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,GAAG,EAAE,CAAC;CACP;;AAED,AAAA,YAAY,CAAC;EACX,OAAO,EAAE,QAAQ;CAClB;;AAED,AAAA,MAAM,CAAC;EACL,MAAM,EAAE,IAAI;CAeb;;AAhBD,AAEE,MAFI,CAEJ,OAAO,CAAC;EACN,MAAM,EAAE,IAAI;CAYb;;AAfH,AAKI,MALE,CAEJ,OAAO,CAGL,aAAa,CAAC;EACZ,WAAW,EAAE,MAAM;EACnB,eAAe,EAAE,MAAM;CACxB;;AARL,AASI,MATE,CAEJ,OAAO,CAOL,UAAU,CAAC;EACT,eAAe,EAAE,MAAM;CACxB;;AAXL,AAYI,MAZE,CAEJ,OAAO,CAUL,gBAAgB,CAAC;EACf,OAAO,EAAE,IAAI;CACd;;AAIL,aAAa;AACb,AAAA,WAAW,CAAC;EACV,gBAAgB,EAAE,SAAS;CAC5B;;AAED,AAAA,cAAc,CAAC;EACb,KAAK,EAAE,SAAS;CACjB;;AAED,AAAA,aAAa,CAAC;EACZ,gBAAgB,EAAE,SAAS;EAC3B,KAAK,EAAE,SAAS;CACjB;;AAED,AAAA,eAAe;AACf,iBAAiB,AAAA,MAAM,CAAC;EACtB,KAAK,EAAE,SAAS;CACjB;;AAED,AAAA,WAAW,CAAC;EACV,MAAM,EAAE,mBAAmB;CAC5B;;AAID,AAAA,IAAI;AACJ,SAAS;AACT,cAAc;AACd,aAAa,CAAC;EACZ,aAAa,EAAE,YAAY;CAC5B;;AAED,AACE,IADE,CACF,GAAG,CAAC;EACF,KAAK,EAAE,SAAS;CACjB;;AAHH,AAKI,IALA,AAID,MAAM,CACL,GAAG,CAAC;EACF,KAAK,EAAE,SAAS;CACjB;;AAIL,aAAa;AACb,AACE,MADI,CACJ,QAAQ,CAAC;EACP,UAAU,EAAE,KAAK;EACjB,UAAU,EAAE,KAAK;EACjB,OAAO,EAAE,IAAI;EACb,WAAW,EAAE,MAAM;EACnB,eAAe,EAAE,MAAM;CAIxB;;AAVH,AAOI,MAPE,CACJ,QAAQ,CAMN,MAAM,CAAC;EACL,WAAW,EAAE,GAAG;CACjB;;AATL,AAWE,MAXI,CAWJ,IAAI,CAAC;EACH,aAAa,EAAE,eAAe;EAC9B,OAAO,EAAE,SAAS;EAClB,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,GAAG;EAChB,SAAS,EAAE,KAAK;CACjB", 4 | "sources": [ 5 | "main.scss" 6 | ], 7 | "names": [], 8 | "file": "main.css" 9 | } -------------------------------------------------------------------------------- /public/css/main.scss: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | html { 6 | overflow: scroll; 7 | overflow-x: hidden; 8 | -ms-overflow-style: none; 9 | scrollbar-width: none; 10 | } 11 | 12 | ::-webkit-scrollbar { 13 | display: none; 14 | } 15 | 16 | .sidenav { 17 | position: fixed; 18 | top: 0; 19 | left: 0; 20 | width: 15%; 21 | height: 100vh; 22 | overflow: scroll; 23 | overflow-x: hidden; 24 | -ms-overflow-style: none; 25 | scrollbar-width: none; 26 | background-color: rgba(255, 255, 255, 0.95); 27 | transition: 0.5s; 28 | box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05); 29 | border: 1px solid rgba(0, 0, 0, 0.3); 30 | .logo { 31 | border-bottom: 1px solid rgba(0, 0, 0, 0.3); 32 | text-transform: uppercase; 33 | font-size: 20px; 34 | font-weight: 700; 35 | } 36 | .pages { 37 | height: 100px; 38 | overflow: scroll; 39 | overflow-x: hidden; 40 | } 41 | } 42 | 43 | .main-content { 44 | position: relative; 45 | width: 85%; 46 | left: 15%; 47 | 48 | .navbar { 49 | padding: 0; 50 | .container-fluid { 51 | padding: 0; 52 | } 53 | } 54 | 55 | #editor { 56 | border: 2px solid rgba(0, 0, 0, 0.3); 57 | } 58 | } 59 | 60 | .nav { 61 | justify-content: space-between; 62 | } 63 | .gjs-pn-panel { 64 | position: relative; 65 | } 66 | 67 | .gjs-cv-canvas { 68 | width: 100%; 69 | height: 100%; 70 | top: 0; 71 | } 72 | 73 | .tab-content { 74 | display: contents; 75 | } 76 | 77 | #block { 78 | height: 100%; 79 | #blocks { 80 | height: 100%; 81 | 82 | .gjs-blocks-c { 83 | align-items: center; 84 | justify-content: center; 85 | } 86 | .gjs-block { 87 | justify-content: center; 88 | } 89 | .gjs-block-label { 90 | display: none; 91 | } 92 | } 93 | } 94 | 95 | /* Theming */ 96 | .gjs-one-bg { 97 | background-color: #fcf6f5ff; 98 | } 99 | 100 | .gjs-two-color { 101 | color: #990011ff; 102 | } 103 | 104 | .gjs-three-bg { 105 | background-color: #990011ff; 106 | color: #fcf6f5ff; 107 | } 108 | 109 | .gjs-four-color, 110 | .gjs-four-color-h:hover { 111 | color: #990011ff; 112 | } 113 | 114 | .gjs-pn-btn { 115 | border: 1px solid #990011ff; 116 | } 117 | 118 | // Customize Bootstrap CSS 119 | 120 | .btn, 121 | .nav-link, 122 | .modal-content, 123 | .form-control { 124 | border-radius: 0 !important; 125 | } 126 | 127 | .btn { 128 | .fa { 129 | color: #990011ff; 130 | } 131 | &:hover { 132 | .fa { 133 | color: #fcf6f5ff; 134 | } 135 | } 136 | } 137 | 138 | /** Error **/ 139 | .error { 140 | .bg-body { 141 | min-height: 150px; 142 | max-height: 150px; 143 | display: flex; 144 | align-items: center; 145 | justify-content: center; 146 | .title { 147 | font-weight: 600; 148 | } 149 | } 150 | .btn { 151 | border-radius: 40px !important; 152 | padding: 15px 20px; 153 | font-size: 14px; 154 | font-weight: 700; 155 | min-width: 150px; 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /public/js/custom.js: -------------------------------------------------------------------------------- 1 | function validatForm(e) { 2 | 'use strict'; 3 | e.preventDefault(); 4 | const forms = document.getElementById('create-page'); 5 | if (!forms.checkValidity()) { 6 | event.preventDefault(); 7 | event.stopPropagation(); 8 | forms.classList.add('was-validated'); 9 | return false; 10 | } 11 | 12 | return submitForm(); 13 | } 14 | 15 | function submitForm() { 16 | const nameField = document.getElementById('name'); 17 | const nameFieldValue = nameField.value; 18 | axios 19 | .post('/pages/', { name: nameFieldValue }) 20 | .then((response) => { 21 | alert(`Page ${nameFieldValue} created successfully`); 22 | window.location.href = '/'; 23 | }) 24 | .catch((err) => { 25 | alert('Failed: Page not created'); 26 | }); 27 | clearForm(); 28 | return true; 29 | } 30 | 31 | function clearForm() { 32 | /** 33 | * Get name field and reset it's value 34 | */ 35 | const nameField = document.getElementById('name'); 36 | nameField.value = ''; 37 | /** 38 | * Remove was-validated class from Form 39 | */ 40 | const forms = document.getElementById('create-page'); 41 | forms.classList.remove('was-validated'); 42 | } 43 | -------------------------------------------------------------------------------- /public/js/lib/axios.min.js: -------------------------------------------------------------------------------- 1 | /* axios v0.21.1 | (c) 2020 by Matt Zabriskie */ 2 | !(function (e, t) { 3 | 'object' == typeof exports && 'object' == typeof module 4 | ? (module.exports = t()) 5 | : 'function' == typeof define && define.amd 6 | ? define([], t) 7 | : 'object' == typeof exports 8 | ? (exports.axios = t()) 9 | : (e.axios = t()); 10 | })(this, function () { 11 | return (function (e) { 12 | function t(r) { 13 | if (n[r]) return n[r].exports; 14 | var o = (n[r] = { exports: {}, id: r, loaded: !1 }); 15 | return e[r].call(o.exports, o, o.exports, t), (o.loaded = !0), o.exports; 16 | } 17 | var n = {}; 18 | return (t.m = e), (t.c = n), (t.p = ''), t(0); 19 | })([ 20 | function (e, t, n) { 21 | e.exports = n(1); 22 | }, 23 | function (e, t, n) { 24 | 'use strict'; 25 | function r(e) { 26 | var t = new i(e), 27 | n = s(i.prototype.request, t); 28 | return o.extend(n, i.prototype, t), o.extend(n, t), n; 29 | } 30 | var o = n(2), 31 | s = n(3), 32 | i = n(4), 33 | a = n(22), 34 | u = n(10), 35 | c = r(u); 36 | (c.Axios = i), 37 | (c.create = function (e) { 38 | return r(a(c.defaults, e)); 39 | }), 40 | (c.Cancel = n(23)), 41 | (c.CancelToken = n(24)), 42 | (c.isCancel = n(9)), 43 | (c.all = function (e) { 44 | return Promise.all(e); 45 | }), 46 | (c.spread = n(25)), 47 | (c.isAxiosError = n(26)), 48 | (e.exports = c), 49 | (e.exports.default = c); 50 | }, 51 | function (e, t, n) { 52 | 'use strict'; 53 | function r(e) { 54 | return '[object Array]' === R.call(e); 55 | } 56 | function o(e) { 57 | return 'undefined' == typeof e; 58 | } 59 | function s(e) { 60 | return ( 61 | null !== e && 62 | !o(e) && 63 | null !== e.constructor && 64 | !o(e.constructor) && 65 | 'function' == typeof e.constructor.isBuffer && 66 | e.constructor.isBuffer(e) 67 | ); 68 | } 69 | function i(e) { 70 | return '[object ArrayBuffer]' === R.call(e); 71 | } 72 | function a(e) { 73 | return 'undefined' != typeof FormData && e instanceof FormData; 74 | } 75 | function u(e) { 76 | var t; 77 | return (t = 78 | 'undefined' != typeof ArrayBuffer && ArrayBuffer.isView 79 | ? ArrayBuffer.isView(e) 80 | : e && e.buffer && e.buffer instanceof ArrayBuffer); 81 | } 82 | function c(e) { 83 | return 'string' == typeof e; 84 | } 85 | function f(e) { 86 | return 'number' == typeof e; 87 | } 88 | function p(e) { 89 | return null !== e && 'object' == typeof e; 90 | } 91 | function d(e) { 92 | if ('[object Object]' !== R.call(e)) return !1; 93 | var t = Object.getPrototypeOf(e); 94 | return null === t || t === Object.prototype; 95 | } 96 | function l(e) { 97 | return '[object Date]' === R.call(e); 98 | } 99 | function h(e) { 100 | return '[object File]' === R.call(e); 101 | } 102 | function m(e) { 103 | return '[object Blob]' === R.call(e); 104 | } 105 | function y(e) { 106 | return '[object Function]' === R.call(e); 107 | } 108 | function g(e) { 109 | return p(e) && y(e.pipe); 110 | } 111 | function v(e) { 112 | return 'undefined' != typeof URLSearchParams && e instanceof URLSearchParams; 113 | } 114 | function x(e) { 115 | return e.replace(/^\s*/, '').replace(/\s*$/, ''); 116 | } 117 | function w() { 118 | return ( 119 | ('undefined' == typeof navigator || 120 | ('ReactNative' !== navigator.product && 121 | 'NativeScript' !== navigator.product && 122 | 'NS' !== navigator.product)) && 123 | 'undefined' != typeof window && 124 | 'undefined' != typeof document 125 | ); 126 | } 127 | function b(e, t) { 128 | if (null !== e && 'undefined' != typeof e) 129 | if (('object' != typeof e && (e = [e]), r(e))) 130 | for (var n = 0, o = e.length; n < o; n++) t.call(null, e[n], n, e); 131 | else 132 | for (var s in e) Object.prototype.hasOwnProperty.call(e, s) && t.call(null, e[s], s, e); 133 | } 134 | function E() { 135 | function e(e, n) { 136 | d(t[n]) && d(e) 137 | ? (t[n] = E(t[n], e)) 138 | : d(e) 139 | ? (t[n] = E({}, e)) 140 | : r(e) 141 | ? (t[n] = e.slice()) 142 | : (t[n] = e); 143 | } 144 | for (var t = {}, n = 0, o = arguments.length; n < o; n++) b(arguments[n], e); 145 | return t; 146 | } 147 | function j(e, t, n) { 148 | return ( 149 | b(t, function (t, r) { 150 | n && 'function' == typeof t ? (e[r] = S(t, n)) : (e[r] = t); 151 | }), 152 | e 153 | ); 154 | } 155 | function C(e) { 156 | return 65279 === e.charCodeAt(0) && (e = e.slice(1)), e; 157 | } 158 | var S = n(3), 159 | R = Object.prototype.toString; 160 | e.exports = { 161 | isArray: r, 162 | isArrayBuffer: i, 163 | isBuffer: s, 164 | isFormData: a, 165 | isArrayBufferView: u, 166 | isString: c, 167 | isNumber: f, 168 | isObject: p, 169 | isPlainObject: d, 170 | isUndefined: o, 171 | isDate: l, 172 | isFile: h, 173 | isBlob: m, 174 | isFunction: y, 175 | isStream: g, 176 | isURLSearchParams: v, 177 | isStandardBrowserEnv: w, 178 | forEach: b, 179 | merge: E, 180 | extend: j, 181 | trim: x, 182 | stripBOM: C, 183 | }; 184 | }, 185 | function (e, t) { 186 | 'use strict'; 187 | e.exports = function (e, t) { 188 | return function () { 189 | for (var n = new Array(arguments.length), r = 0; r < n.length; r++) n[r] = arguments[r]; 190 | return e.apply(t, n); 191 | }; 192 | }; 193 | }, 194 | function (e, t, n) { 195 | 'use strict'; 196 | function r(e) { 197 | (this.defaults = e), (this.interceptors = { request: new i(), response: new i() }); 198 | } 199 | var o = n(2), 200 | s = n(5), 201 | i = n(6), 202 | a = n(7), 203 | u = n(22); 204 | (r.prototype.request = function (e) { 205 | 'string' == typeof e ? ((e = arguments[1] || {}), (e.url = arguments[0])) : (e = e || {}), 206 | (e = u(this.defaults, e)), 207 | e.method 208 | ? (e.method = e.method.toLowerCase()) 209 | : this.defaults.method 210 | ? (e.method = this.defaults.method.toLowerCase()) 211 | : (e.method = 'get'); 212 | var t = [a, void 0], 213 | n = Promise.resolve(e); 214 | for ( 215 | this.interceptors.request.forEach(function (e) { 216 | t.unshift(e.fulfilled, e.rejected); 217 | }), 218 | this.interceptors.response.forEach(function (e) { 219 | t.push(e.fulfilled, e.rejected); 220 | }); 221 | t.length; 222 | 223 | ) 224 | n = n.then(t.shift(), t.shift()); 225 | return n; 226 | }), 227 | (r.prototype.getUri = function (e) { 228 | return ( 229 | (e = u(this.defaults, e)), s(e.url, e.params, e.paramsSerializer).replace(/^\?/, '') 230 | ); 231 | }), 232 | o.forEach(['delete', 'get', 'head', 'options'], function (e) { 233 | r.prototype[e] = function (t, n) { 234 | return this.request(u(n || {}, { method: e, url: t, data: (n || {}).data })); 235 | }; 236 | }), 237 | o.forEach(['post', 'put', 'patch'], function (e) { 238 | r.prototype[e] = function (t, n, r) { 239 | return this.request(u(r || {}, { method: e, url: t, data: n })); 240 | }; 241 | }), 242 | (e.exports = r); 243 | }, 244 | function (e, t, n) { 245 | 'use strict'; 246 | function r(e) { 247 | return encodeURIComponent(e) 248 | .replace(/%3A/gi, ':') 249 | .replace(/%24/g, '$') 250 | .replace(/%2C/gi, ',') 251 | .replace(/%20/g, '+') 252 | .replace(/%5B/gi, '[') 253 | .replace(/%5D/gi, ']'); 254 | } 255 | var o = n(2); 256 | e.exports = function (e, t, n) { 257 | if (!t) return e; 258 | var s; 259 | if (n) s = n(t); 260 | else if (o.isURLSearchParams(t)) s = t.toString(); 261 | else { 262 | var i = []; 263 | o.forEach(t, function (e, t) { 264 | null !== e && 265 | 'undefined' != typeof e && 266 | (o.isArray(e) ? (t += '[]') : (e = [e]), 267 | o.forEach(e, function (e) { 268 | o.isDate(e) ? (e = e.toISOString()) : o.isObject(e) && (e = JSON.stringify(e)), 269 | i.push(r(t) + '=' + r(e)); 270 | })); 271 | }), 272 | (s = i.join('&')); 273 | } 274 | if (s) { 275 | var a = e.indexOf('#'); 276 | a !== -1 && (e = e.slice(0, a)), (e += (e.indexOf('?') === -1 ? '?' : '&') + s); 277 | } 278 | return e; 279 | }; 280 | }, 281 | function (e, t, n) { 282 | 'use strict'; 283 | function r() { 284 | this.handlers = []; 285 | } 286 | var o = n(2); 287 | (r.prototype.use = function (e, t) { 288 | return this.handlers.push({ fulfilled: e, rejected: t }), this.handlers.length - 1; 289 | }), 290 | (r.prototype.eject = function (e) { 291 | this.handlers[e] && (this.handlers[e] = null); 292 | }), 293 | (r.prototype.forEach = function (e) { 294 | o.forEach(this.handlers, function (t) { 295 | null !== t && e(t); 296 | }); 297 | }), 298 | (e.exports = r); 299 | }, 300 | function (e, t, n) { 301 | 'use strict'; 302 | function r(e) { 303 | e.cancelToken && e.cancelToken.throwIfRequested(); 304 | } 305 | var o = n(2), 306 | s = n(8), 307 | i = n(9), 308 | a = n(10); 309 | e.exports = function (e) { 310 | r(e), 311 | (e.headers = e.headers || {}), 312 | (e.data = s(e.data, e.headers, e.transformRequest)), 313 | (e.headers = o.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers)), 314 | o.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function (t) { 315 | delete e.headers[t]; 316 | }); 317 | var t = e.adapter || a.adapter; 318 | return t(e).then( 319 | function (t) { 320 | return r(e), (t.data = s(t.data, t.headers, e.transformResponse)), t; 321 | }, 322 | function (t) { 323 | return ( 324 | i(t) || 325 | (r(e), 326 | t && 327 | t.response && 328 | (t.response.data = s(t.response.data, t.response.headers, e.transformResponse))), 329 | Promise.reject(t) 330 | ); 331 | }, 332 | ); 333 | }; 334 | }, 335 | function (e, t, n) { 336 | 'use strict'; 337 | var r = n(2); 338 | e.exports = function (e, t, n) { 339 | return ( 340 | r.forEach(n, function (n) { 341 | e = n(e, t); 342 | }), 343 | e 344 | ); 345 | }; 346 | }, 347 | function (e, t) { 348 | 'use strict'; 349 | e.exports = function (e) { 350 | return !(!e || !e.__CANCEL__); 351 | }; 352 | }, 353 | function (e, t, n) { 354 | 'use strict'; 355 | function r(e, t) { 356 | !s.isUndefined(e) && s.isUndefined(e['Content-Type']) && (e['Content-Type'] = t); 357 | } 358 | function o() { 359 | var e; 360 | return ( 361 | 'undefined' != typeof XMLHttpRequest 362 | ? (e = n(12)) 363 | : 'undefined' != typeof process && 364 | '[object process]' === Object.prototype.toString.call(process) && 365 | (e = n(12)), 366 | e 367 | ); 368 | } 369 | var s = n(2), 370 | i = n(11), 371 | a = { 'Content-Type': 'application/x-www-form-urlencoded' }, 372 | u = { 373 | adapter: o(), 374 | transformRequest: [ 375 | function (e, t) { 376 | return ( 377 | i(t, 'Accept'), 378 | i(t, 'Content-Type'), 379 | s.isFormData(e) || 380 | s.isArrayBuffer(e) || 381 | s.isBuffer(e) || 382 | s.isStream(e) || 383 | s.isFile(e) || 384 | s.isBlob(e) 385 | ? e 386 | : s.isArrayBufferView(e) 387 | ? e.buffer 388 | : s.isURLSearchParams(e) 389 | ? (r(t, 'application/x-www-form-urlencoded;charset=utf-8'), e.toString()) 390 | : s.isObject(e) 391 | ? (r(t, 'application/json;charset=utf-8'), JSON.stringify(e)) 392 | : e 393 | ); 394 | }, 395 | ], 396 | transformResponse: [ 397 | function (e) { 398 | if ('string' == typeof e) 399 | try { 400 | e = JSON.parse(e); 401 | } catch (e) {} 402 | return e; 403 | }, 404 | ], 405 | timeout: 0, 406 | xsrfCookieName: 'XSRF-TOKEN', 407 | xsrfHeaderName: 'X-XSRF-TOKEN', 408 | maxContentLength: -1, 409 | maxBodyLength: -1, 410 | validateStatus: function (e) { 411 | return e >= 200 && e < 300; 412 | }, 413 | }; 414 | (u.headers = { common: { Accept: 'application/json, text/plain, */*' } }), 415 | s.forEach(['delete', 'get', 'head'], function (e) { 416 | u.headers[e] = {}; 417 | }), 418 | s.forEach(['post', 'put', 'patch'], function (e) { 419 | u.headers[e] = s.merge(a); 420 | }), 421 | (e.exports = u); 422 | }, 423 | function (e, t, n) { 424 | 'use strict'; 425 | var r = n(2); 426 | e.exports = function (e, t) { 427 | r.forEach(e, function (n, r) { 428 | r !== t && r.toUpperCase() === t.toUpperCase() && ((e[t] = n), delete e[r]); 429 | }); 430 | }; 431 | }, 432 | function (e, t, n) { 433 | 'use strict'; 434 | var r = n(2), 435 | o = n(13), 436 | s = n(16), 437 | i = n(5), 438 | a = n(17), 439 | u = n(20), 440 | c = n(21), 441 | f = n(14); 442 | e.exports = function (e) { 443 | return new Promise(function (t, n) { 444 | var p = e.data, 445 | d = e.headers; 446 | r.isFormData(p) && delete d['Content-Type']; 447 | var l = new XMLHttpRequest(); 448 | if (e.auth) { 449 | var h = e.auth.username || '', 450 | m = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : ''; 451 | d.Authorization = 'Basic ' + btoa(h + ':' + m); 452 | } 453 | var y = a(e.baseURL, e.url); 454 | if ( 455 | (l.open(e.method.toUpperCase(), i(y, e.params, e.paramsSerializer), !0), 456 | (l.timeout = e.timeout), 457 | (l.onreadystatechange = function () { 458 | if ( 459 | l && 460 | 4 === l.readyState && 461 | (0 !== l.status || (l.responseURL && 0 === l.responseURL.indexOf('file:'))) 462 | ) { 463 | var r = 'getAllResponseHeaders' in l ? u(l.getAllResponseHeaders()) : null, 464 | s = e.responseType && 'text' !== e.responseType ? l.response : l.responseText, 465 | i = { 466 | data: s, 467 | status: l.status, 468 | statusText: l.statusText, 469 | headers: r, 470 | config: e, 471 | request: l, 472 | }; 473 | o(t, n, i), (l = null); 474 | } 475 | }), 476 | (l.onabort = function () { 477 | l && (n(f('Request aborted', e, 'ECONNABORTED', l)), (l = null)); 478 | }), 479 | (l.onerror = function () { 480 | n(f('Network Error', e, null, l)), (l = null); 481 | }), 482 | (l.ontimeout = function () { 483 | var t = 'timeout of ' + e.timeout + 'ms exceeded'; 484 | e.timeoutErrorMessage && (t = e.timeoutErrorMessage), 485 | n(f(t, e, 'ECONNABORTED', l)), 486 | (l = null); 487 | }), 488 | r.isStandardBrowserEnv()) 489 | ) { 490 | var g = 491 | (e.withCredentials || c(y)) && e.xsrfCookieName ? s.read(e.xsrfCookieName) : void 0; 492 | g && (d[e.xsrfHeaderName] = g); 493 | } 494 | if ( 495 | ('setRequestHeader' in l && 496 | r.forEach(d, function (e, t) { 497 | 'undefined' == typeof p && 'content-type' === t.toLowerCase() 498 | ? delete d[t] 499 | : l.setRequestHeader(t, e); 500 | }), 501 | r.isUndefined(e.withCredentials) || (l.withCredentials = !!e.withCredentials), 502 | e.responseType) 503 | ) 504 | try { 505 | l.responseType = e.responseType; 506 | } catch (t) { 507 | if ('json' !== e.responseType) throw t; 508 | } 509 | 'function' == typeof e.onDownloadProgress && 510 | l.addEventListener('progress', e.onDownloadProgress), 511 | 'function' == typeof e.onUploadProgress && 512 | l.upload && 513 | l.upload.addEventListener('progress', e.onUploadProgress), 514 | e.cancelToken && 515 | e.cancelToken.promise.then(function (e) { 516 | l && (l.abort(), n(e), (l = null)); 517 | }), 518 | p || (p = null), 519 | l.send(p); 520 | }); 521 | }; 522 | }, 523 | function (e, t, n) { 524 | 'use strict'; 525 | var r = n(14); 526 | e.exports = function (e, t, n) { 527 | var o = n.config.validateStatus; 528 | n.status && o && !o(n.status) 529 | ? t(r('Request failed with status code ' + n.status, n.config, null, n.request, n)) 530 | : e(n); 531 | }; 532 | }, 533 | function (e, t, n) { 534 | 'use strict'; 535 | var r = n(15); 536 | e.exports = function (e, t, n, o, s) { 537 | var i = new Error(e); 538 | return r(i, t, n, o, s); 539 | }; 540 | }, 541 | function (e, t) { 542 | 'use strict'; 543 | e.exports = function (e, t, n, r, o) { 544 | return ( 545 | (e.config = t), 546 | n && (e.code = n), 547 | (e.request = r), 548 | (e.response = o), 549 | (e.isAxiosError = !0), 550 | (e.toJSON = function () { 551 | return { 552 | message: this.message, 553 | name: this.name, 554 | description: this.description, 555 | number: this.number, 556 | fileName: this.fileName, 557 | lineNumber: this.lineNumber, 558 | columnNumber: this.columnNumber, 559 | stack: this.stack, 560 | config: this.config, 561 | code: this.code, 562 | }; 563 | }), 564 | e 565 | ); 566 | }; 567 | }, 568 | function (e, t, n) { 569 | 'use strict'; 570 | var r = n(2); 571 | e.exports = r.isStandardBrowserEnv() 572 | ? (function () { 573 | return { 574 | write: function (e, t, n, o, s, i) { 575 | var a = []; 576 | a.push(e + '=' + encodeURIComponent(t)), 577 | r.isNumber(n) && a.push('expires=' + new Date(n).toGMTString()), 578 | r.isString(o) && a.push('path=' + o), 579 | r.isString(s) && a.push('domain=' + s), 580 | i === !0 && a.push('secure'), 581 | (document.cookie = a.join('; ')); 582 | }, 583 | read: function (e) { 584 | var t = document.cookie.match(new RegExp('(^|;\\s*)(' + e + ')=([^;]*)')); 585 | return t ? decodeURIComponent(t[3]) : null; 586 | }, 587 | remove: function (e) { 588 | this.write(e, '', Date.now() - 864e5); 589 | }, 590 | }; 591 | })() 592 | : (function () { 593 | return { 594 | write: function () {}, 595 | read: function () { 596 | return null; 597 | }, 598 | remove: function () {}, 599 | }; 600 | })(); 601 | }, 602 | function (e, t, n) { 603 | 'use strict'; 604 | var r = n(18), 605 | o = n(19); 606 | e.exports = function (e, t) { 607 | return e && !r(t) ? o(e, t) : t; 608 | }; 609 | }, 610 | function (e, t) { 611 | 'use strict'; 612 | e.exports = function (e) { 613 | return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e); 614 | }; 615 | }, 616 | function (e, t) { 617 | 'use strict'; 618 | e.exports = function (e, t) { 619 | return t ? e.replace(/\/+$/, '') + '/' + t.replace(/^\/+/, '') : e; 620 | }; 621 | }, 622 | function (e, t, n) { 623 | 'use strict'; 624 | var r = n(2), 625 | o = [ 626 | 'age', 627 | 'authorization', 628 | 'content-length', 629 | 'content-type', 630 | 'etag', 631 | 'expires', 632 | 'from', 633 | 'host', 634 | 'if-modified-since', 635 | 'if-unmodified-since', 636 | 'last-modified', 637 | 'location', 638 | 'max-forwards', 639 | 'proxy-authorization', 640 | 'referer', 641 | 'retry-after', 642 | 'user-agent', 643 | ]; 644 | e.exports = function (e) { 645 | var t, 646 | n, 647 | s, 648 | i = {}; 649 | return e 650 | ? (r.forEach(e.split('\n'), function (e) { 651 | if ( 652 | ((s = e.indexOf(':')), 653 | (t = r.trim(e.substr(0, s)).toLowerCase()), 654 | (n = r.trim(e.substr(s + 1))), 655 | t) 656 | ) { 657 | if (i[t] && o.indexOf(t) >= 0) return; 658 | 'set-cookie' === t 659 | ? (i[t] = (i[t] ? i[t] : []).concat([n])) 660 | : (i[t] = i[t] ? i[t] + ', ' + n : n); 661 | } 662 | }), 663 | i) 664 | : i; 665 | }; 666 | }, 667 | function (e, t, n) { 668 | 'use strict'; 669 | var r = n(2); 670 | e.exports = r.isStandardBrowserEnv() 671 | ? (function () { 672 | function e(e) { 673 | var t = e; 674 | return ( 675 | n && (o.setAttribute('href', t), (t = o.href)), 676 | o.setAttribute('href', t), 677 | { 678 | href: o.href, 679 | protocol: o.protocol ? o.protocol.replace(/:$/, '') : '', 680 | host: o.host, 681 | search: o.search ? o.search.replace(/^\?/, '') : '', 682 | hash: o.hash ? o.hash.replace(/^#/, '') : '', 683 | hostname: o.hostname, 684 | port: o.port, 685 | pathname: '/' === o.pathname.charAt(0) ? o.pathname : '/' + o.pathname, 686 | } 687 | ); 688 | } 689 | var t, 690 | n = /(msie|trident)/i.test(navigator.userAgent), 691 | o = document.createElement('a'); 692 | return ( 693 | (t = e(window.location.href)), 694 | function (n) { 695 | var o = r.isString(n) ? e(n) : n; 696 | return o.protocol === t.protocol && o.host === t.host; 697 | } 698 | ); 699 | })() 700 | : (function () { 701 | return function () { 702 | return !0; 703 | }; 704 | })(); 705 | }, 706 | function (e, t, n) { 707 | 'use strict'; 708 | var r = n(2); 709 | e.exports = function (e, t) { 710 | function n(e, t) { 711 | return r.isPlainObject(e) && r.isPlainObject(t) 712 | ? r.merge(e, t) 713 | : r.isPlainObject(t) 714 | ? r.merge({}, t) 715 | : r.isArray(t) 716 | ? t.slice() 717 | : t; 718 | } 719 | function o(o) { 720 | r.isUndefined(t[o]) 721 | ? r.isUndefined(e[o]) || (s[o] = n(void 0, e[o])) 722 | : (s[o] = n(e[o], t[o])); 723 | } 724 | t = t || {}; 725 | var s = {}, 726 | i = ['url', 'method', 'data'], 727 | a = ['headers', 'auth', 'proxy', 'params'], 728 | u = [ 729 | 'baseURL', 730 | 'transformRequest', 731 | 'transformResponse', 732 | 'paramsSerializer', 733 | 'timeout', 734 | 'timeoutMessage', 735 | 'withCredentials', 736 | 'adapter', 737 | 'responseType', 738 | 'xsrfCookieName', 739 | 'xsrfHeaderName', 740 | 'onUploadProgress', 741 | 'onDownloadProgress', 742 | 'decompress', 743 | 'maxContentLength', 744 | 'maxBodyLength', 745 | 'maxRedirects', 746 | 'transport', 747 | 'httpAgent', 748 | 'httpsAgent', 749 | 'cancelToken', 750 | 'socketPath', 751 | 'responseEncoding', 752 | ], 753 | c = ['validateStatus']; 754 | r.forEach(i, function (e) { 755 | r.isUndefined(t[e]) || (s[e] = n(void 0, t[e])); 756 | }), 757 | r.forEach(a, o), 758 | r.forEach(u, function (o) { 759 | r.isUndefined(t[o]) 760 | ? r.isUndefined(e[o]) || (s[o] = n(void 0, e[o])) 761 | : (s[o] = n(void 0, t[o])); 762 | }), 763 | r.forEach(c, function (r) { 764 | r in t ? (s[r] = n(e[r], t[r])) : r in e && (s[r] = n(void 0, e[r])); 765 | }); 766 | var f = i.concat(a).concat(u).concat(c), 767 | p = Object.keys(e) 768 | .concat(Object.keys(t)) 769 | .filter(function (e) { 770 | return f.indexOf(e) === -1; 771 | }); 772 | return r.forEach(p, o), s; 773 | }; 774 | }, 775 | function (e, t) { 776 | 'use strict'; 777 | function n(e) { 778 | this.message = e; 779 | } 780 | (n.prototype.toString = function () { 781 | return 'Cancel' + (this.message ? ': ' + this.message : ''); 782 | }), 783 | (n.prototype.__CANCEL__ = !0), 784 | (e.exports = n); 785 | }, 786 | function (e, t, n) { 787 | 'use strict'; 788 | function r(e) { 789 | if ('function' != typeof e) throw new TypeError('executor must be a function.'); 790 | var t; 791 | this.promise = new Promise(function (e) { 792 | t = e; 793 | }); 794 | var n = this; 795 | e(function (e) { 796 | n.reason || ((n.reason = new o(e)), t(n.reason)); 797 | }); 798 | } 799 | var o = n(23); 800 | (r.prototype.throwIfRequested = function () { 801 | if (this.reason) throw this.reason; 802 | }), 803 | (r.source = function () { 804 | var e, 805 | t = new r(function (t) { 806 | e = t; 807 | }); 808 | return { token: t, cancel: e }; 809 | }), 810 | (e.exports = r); 811 | }, 812 | function (e, t) { 813 | 'use strict'; 814 | e.exports = function (e) { 815 | return function (t) { 816 | return e.apply(null, t); 817 | }; 818 | }; 819 | }, 820 | function (e, t) { 821 | 'use strict'; 822 | e.exports = function (e) { 823 | return 'object' == typeof e && e.isAxiosError === !0; 824 | }; 825 | }, 826 | ]); 827 | }); 828 | //# sourceMappingURL=axios.min.map 829 | -------------------------------------------------------------------------------- /public/js/lib/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v5.0.0-beta2 (https://getbootstrap.com/) 3 | * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 5 | */ 6 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e(t.Popper)}(this,(function(t){"use strict";function e(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var n=e(t);function i(t,e){for(var n=0;n0,i._pointerEvent=Boolean(window.PointerEvent),i._addEventListeners(),i}r(e,t);var n=e.prototype;return n.next=function(){this._isSliding||this._slide("next")},n.nextWhenVisible=function(){!document.hidden&&v(this._element)&&this.next()},n.prev=function(){this._isSliding||this._slide("prev")},n.pause=function(t){t||(this._isPaused=!0),Q(".carousel-item-next, .carousel-item-prev",this._element)&&(p(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},n.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config&&this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},n.to=function(t){var e=this;this._activeElement=Q(".active.carousel-item",this._element);var n=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)K.one(this._element,"slid.bs.carousel",(function(){return e.to(t)}));else{if(n===t)return this.pause(),void this.cycle();var i=t>n?"next":"prev";this._slide(i,this._items[t])}},n.dispose=function(){t.prototype.dispose.call(this),K.off(this._element,".bs.carousel"),this._items=null,this._config=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},n._getConfig=function(t){return t=s({},G,t),_("carousel",t,Z),t},n._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;this.touchDeltaX=0,e>0&&(E?this.next():this.prev()),e<0&&(E?this.prev():this.next())}},n._addEventListeners=function(){var t=this;this._config.keyboard&&K.on(this._element,"keydown.bs.carousel",(function(e){return t._keydown(e)})),"hover"===this._config.pause&&(K.on(this._element,"mouseenter.bs.carousel",(function(e){return t.pause(e)})),K.on(this._element,"mouseleave.bs.carousel",(function(e){return t.cycle(e)}))),this._config.touch&&this._touchSupported&&this._addTouchEventListeners()},n._addTouchEventListeners=function(){var t=this,e=function(e){!t._pointerEvent||"pen"!==e.pointerType&&"touch"!==e.pointerType?t._pointerEvent||(t.touchStartX=e.touches[0].clientX):t.touchStartX=e.clientX},n=function(e){!t._pointerEvent||"pen"!==e.pointerType&&"touch"!==e.pointerType||(t.touchDeltaX=e.clientX-t.touchStartX),t._handleSwipe(),"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(e){return t.cycle(e)}),500+t._config.interval))};q(".carousel-item img",this._element).forEach((function(t){K.on(t,"dragstart.bs.carousel",(function(t){return t.preventDefault()}))})),this._pointerEvent?(K.on(this._element,"pointerdown.bs.carousel",(function(t){return e(t)})),K.on(this._element,"pointerup.bs.carousel",(function(t){return n(t)})),this._element.classList.add("pointer-event")):(K.on(this._element,"touchstart.bs.carousel",(function(t){return e(t)})),K.on(this._element,"touchmove.bs.carousel",(function(e){return function(e){e.touches&&e.touches.length>1?t.touchDeltaX=0:t.touchDeltaX=e.touches[0].clientX-t.touchStartX}(e)})),K.on(this._element,"touchend.bs.carousel",(function(t){return n(t)})))},n._keydown=function(t){/input|textarea/i.test(t.target.tagName)||("ArrowLeft"===t.key?(t.preventDefault(),E?this.next():this.prev()):"ArrowRight"===t.key&&(t.preventDefault(),E?this.prev():this.next()))},n._getItemIndex=function(t){return this._items=t&&t.parentNode?q(".carousel-item",t.parentNode):[],this._items.indexOf(t)},n._getItemByDirection=function(t,e){var n="next"===t,i="prev"===t,o=this._getItemIndex(e),s=this._items.length-1;if((i&&0===o||n&&o===s)&&!this._config.wrap)return e;var r=(o+("prev"===t?-1:1))%this._items.length;return-1===r?this._items[this._items.length-1]:this._items[r]},n._triggerSlideEvent=function(t,e){var n=this._getItemIndex(t),i=this._getItemIndex(Q(".active.carousel-item",this._element));return K.trigger(this._element,"slide.bs.carousel",{relatedTarget:t,direction:e,from:i,to:n})},n._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var e=Q(".active",this._indicatorsElement);e.classList.remove("active"),e.removeAttribute("aria-current");for(var n=q("[data-bs-target]",this._indicatorsElement),i=0;i0)for(var i=0;i0&&s--,"ArrowDown"===t.key&&sdocument.documentElement.clientHeight;e||(this._element.style.overflowY="hidden"),this._element.classList.add("modal-static");var n=f(this._dialog);K.off(this._element,"transitionend"),K.one(this._element,"transitionend",(function(){t._element.classList.remove("modal-static"),e||(K.one(t._element,"transitionend",(function(){t._element.style.overflowY=""})),m(t._element,n))})),m(this._element,n),this._element.focus()}},n._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;(!this._isBodyOverflowing&&t&&!E||this._isBodyOverflowing&&!t&&E)&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),(this._isBodyOverflowing&&!t&&!E||!this._isBodyOverflowing&&t&&E)&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},n._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},n._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:[0,0],container:!1,fallbackPlacements:["top","right","bottom","left"],boundary:"clippingParents",customClass:"",sanitize:!0,sanitizeFn:null,allowList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},popperConfig:null},kt={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},Lt=function(e){function i(t,i){var o;if(void 0===n)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");return(o=e.call(this,t)||this)._isEnabled=!0,o._timeout=0,o._hoverState="",o._activeTrigger={},o._popper=null,o.config=o._getConfig(i),o.tip=null,o._setListeners(),o}r(i,e);var a=i.prototype;return a.enable=function(){this._isEnabled=!0},a.disable=function(){this._isEnabled=!1},a.toggleEnabled=function(){this._isEnabled=!this._isEnabled},a.toggle=function(t){if(this._isEnabled)if(t){var e=this._initializeOnDelegatedTarget(t);e._activeTrigger.click=!e._activeTrigger.click,e._isWithActiveTrigger()?e._enter(null,e):e._leave(null,e)}else{if(this.getTipElement().classList.contains("show"))return void this._leave(null,this);this._enter(null,this)}},a.dispose=function(){clearTimeout(this._timeout),K.off(this._element,this.constructor.EVENT_KEY),K.off(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler),this.tip&&this.tip.parentNode&&this.tip.parentNode.removeChild(this.tip),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.config=null,this.tip=null,e.prototype.dispose.call(this)},a.show=function(){var e=this;if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(this.isWithContent()&&this._isEnabled){var n=K.trigger(this._element,this.constructor.Event.SHOW),i=function t(e){if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){var n=e.getRootNode();return n instanceof ShadowRoot?n:null}return e instanceof ShadowRoot?e:e.parentNode?t(e.parentNode):null}(this._element),o=null===i?this._element.ownerDocument.documentElement.contains(this._element):i.contains(this._element);if(!n.defaultPrevented&&o){var s=this.getTipElement(),r=c(this.constructor.NAME);s.setAttribute("id",r),this._element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&s.classList.add("fade");var a="function"==typeof this.config.placement?this.config.placement.call(this,s,this._element):this.config.placement,l=this._getAttachment(a);this._addAttachmentClass(l);var u=this._getContainer();k(s,this.constructor.DATA_KEY,this),this._element.ownerDocument.documentElement.contains(this.tip)||u.appendChild(s),K.trigger(this._element,this.constructor.Event.INSERTED),this._popper=t.createPopper(this._element,s,this._getPopperConfig(l)),s.classList.add("show");var h,d,p="function"==typeof this.config.customClass?this.config.customClass():this.config.customClass;p&&(h=s.classList).add.apply(h,p.split(" ")),"ontouchstart"in document.documentElement&&(d=[]).concat.apply(d,document.body.children).forEach((function(t){K.on(t,"mouseover",(function(){}))}));var g=function(){var t=e._hoverState;e._hoverState=null,K.trigger(e._element,e.constructor.Event.SHOWN),"out"===t&&e._leave(null,e)};if(this.tip.classList.contains("fade")){var _=f(this.tip);K.one(this.tip,"transitionend",g),m(this.tip,_)}else g()}}},a.hide=function(){var t=this;if(this._popper){var e=this.getTipElement(),n=function(){"show"!==t._hoverState&&e.parentNode&&e.parentNode.removeChild(e),t._cleanTipClass(),t._element.removeAttribute("aria-describedby"),K.trigger(t._element,t.constructor.Event.HIDDEN),t._popper&&(t._popper.destroy(),t._popper=null)};if(!K.trigger(this._element,this.constructor.Event.HIDE).defaultPrevented){var i;if(e.classList.remove("show"),"ontouchstart"in document.documentElement&&(i=[]).concat.apply(i,document.body.children).forEach((function(t){return K.off(t,"mouseover",b)})),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,this.tip.classList.contains("fade")){var o=f(e);K.one(e,"transitionend",n),m(e,o)}else n();this._hoverState=""}}},a.update=function(){null!==this._popper&&this._popper.update()},a.isWithContent=function(){return Boolean(this.getTitle())},a.getTipElement=function(){if(this.tip)return this.tip;var t=document.createElement("div");return t.innerHTML=this.config.template,this.tip=t.children[0],this.tip},a.setContent=function(){var t=this.getTipElement();this.setElementContent(Q(".tooltip-inner",t),this.getTitle()),t.classList.remove("fade","show")},a.setElementContent=function(t,e){if(null!==t)return"object"==typeof e&&g(e)?(e.jquery&&(e=e[0]),void(this.config.html?e.parentNode!==t&&(t.innerHTML="",t.appendChild(e)):t.textContent=e.textContent)):void(this.config.html?(this.config.sanitize&&(e=bt(e,this.config.allowList,this.config.sanitizeFn)),t.innerHTML=e):t.textContent=e)},a.getTitle=function(){var t=this._element.getAttribute("data-bs-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this._element):this.config.title),t},a.updateAttachment=function(t){return"right"===t?"end":"left"===t?"start":t},a._initializeOnDelegatedTarget=function(t,e){var n=this.constructor.DATA_KEY;return(e=e||L(t.delegateTarget,n))||(e=new this.constructor(t.delegateTarget,this._getDelegateConfig()),k(t.delegateTarget,n,e)),e},a._getOffset=function(){var t=this,e=this.config.offset;return"string"==typeof e?e.split(",").map((function(t){return Number.parseInt(t,10)})):"function"==typeof e?function(n){return e(n,t._element)}:e},a._getPopperConfig=function(t){var e=this,n={placement:t,modifiers:[{name:"flip",options:{altBoundary:!0,fallbackPlacements:this.config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this.config.boundary}},{name:"arrow",options:{element:"."+this.constructor.NAME+"-arrow"}},{name:"onChange",enabled:!0,phase:"afterWrite",fn:function(t){return e._handlePopperPlacementChange(t)}}],onFirstUpdate:function(t){t.options.placement!==t.placement&&e._handlePopperPlacementChange(t)}};return s({},n,"function"==typeof this.config.popperConfig?this.config.popperConfig(n):this.config.popperConfig)},a._addAttachmentClass=function(t){this.getTipElement().classList.add("bs-tooltip-"+this.updateAttachment(t))},a._getContainer=function(){return!1===this.config.container?document.body:g(this.config.container)?this.config.container:Q(this.config.container)},a._getAttachment=function(t){return Tt[t.toUpperCase()]},a._setListeners=function(){var t=this;this.config.trigger.split(" ").forEach((function(e){if("click"===e)K.on(t._element,t.constructor.Event.CLICK,t.config.selector,(function(e){return t.toggle(e)}));else if("manual"!==e){var n="hover"===e?t.constructor.Event.MOUSEENTER:t.constructor.Event.FOCUSIN,i="hover"===e?t.constructor.Event.MOUSELEAVE:t.constructor.Event.FOCUSOUT;K.on(t._element,n,t.config.selector,(function(e){return t._enter(e)})),K.on(t._element,i,t.config.selector,(function(e){return t._leave(e)}))}})),this._hideModalHandler=function(){t._element&&t.hide()},K.on(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=s({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},a._fixTitle=function(){var t=this._element.getAttribute("title"),e=typeof this._element.getAttribute("data-bs-original-title");(t||"string"!==e)&&(this._element.setAttribute("data-bs-original-title",t||""),!t||this._element.getAttribute("aria-label")||this._element.textContent||this._element.setAttribute("aria-label",t),this._element.setAttribute("title",""))},a._enter=function(t,e){e=this._initializeOnDelegatedTarget(t,e),t&&(e._activeTrigger["focusin"===t.type?"focus":"hover"]=!0),e.getTipElement().classList.contains("show")||"show"===e._hoverState?e._hoverState="show":(clearTimeout(e._timeout),e._hoverState="show",e.config.delay&&e.config.delay.show?e._timeout=setTimeout((function(){"show"===e._hoverState&&e.show()}),e.config.delay.show):e.show())},a._leave=function(t,e){e=this._initializeOnDelegatedTarget(t,e),t&&(e._activeTrigger["focusout"===t.type?"focus":"hover"]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState="out",e.config.delay&&e.config.delay.hide?e._timeout=setTimeout((function(){"out"===e._hoverState&&e.hide()}),e.config.delay.hide):e.hide())},a._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},a._getConfig=function(t){var e=X.getDataAttributes(this._element);return Object.keys(e).forEach((function(t){wt.has(t)&&delete e[t]})),t&&"object"==typeof t.container&&t.container.jquery&&(t.container=t.container[0]),"number"==typeof(t=s({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),_("tooltip",t,this.constructor.DefaultType),t.sanitize&&(t.template=bt(t.template,t.allowList,t.sanitizeFn)),t},a._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},a._cleanTipClass=function(){var t=this.getTipElement(),e=t.getAttribute("class").match(yt);null!==e&&e.length>0&&e.map((function(t){return t.trim()})).forEach((function(e){return t.classList.remove(e)}))},a._handlePopperPlacementChange=function(t){var e=t.state;e&&(this.tip=e.elements.popper,this._cleanTipClass(),this._addAttachmentClass(this._getAttachment(e.placement)))},i.jQueryInterface=function(t){return this.each((function(){var e=L(this,"bs.tooltip"),n="object"==typeof t&&t;if((e||!/dispose|hide/.test(t))&&(e||(e=new i(this,n)),"string"==typeof t)){if(void 0===e[t])throw new TypeError('No method named "'+t+'"');e[t]()}}))},o(i,null,[{key:"Default",get:function(){return At}},{key:"NAME",get:function(){return"tooltip"}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return kt}},{key:"EVENT_KEY",get:function(){return".bs.tooltip"}},{key:"DefaultType",get:function(){return Et}}]),i}(W);T("tooltip",Lt);var Ct=new RegExp("(^|\\s)bs-popover\\S+","g"),Dt=s({},Lt.Default,{placement:"right",offset:[0,8],trigger:"click",content:"",template:''}),St=s({},Lt.DefaultType,{content:"(string|element|function)"}),Nt={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},Ot=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.isWithContent=function(){return this.getTitle()||this._getContent()},n.setContent=function(){var t=this.getTipElement();this.setElementContent(Q(".popover-header",t),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this._element)),this.setElementContent(Q(".popover-body",t),e),t.classList.remove("fade","show")},n._addAttachmentClass=function(t){this.getTipElement().classList.add("bs-popover-"+this.updateAttachment(t))},n._getContent=function(){return this._element.getAttribute("data-bs-content")||this.config.content},n._cleanTipClass=function(){var t=this.getTipElement(),e=t.getAttribute("class").match(Ct);null!==e&&e.length>0&&e.map((function(t){return t.trim()})).forEach((function(e){return t.classList.remove(e)}))},e.jQueryInterface=function(t){return this.each((function(){var n=L(this,"bs.popover"),i="object"==typeof t?t:null;if((n||!/dispose|hide/.test(t))&&(n||(n=new e(this,i),k(this,"bs.popover",n)),"string"==typeof t)){if(void 0===n[t])throw new TypeError('No method named "'+t+'"');n[t]()}}))},o(e,null,[{key:"Default",get:function(){return Dt}},{key:"NAME",get:function(){return"popover"}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return Nt}},{key:"EVENT_KEY",get:function(){return".bs.popover"}},{key:"DefaultType",get:function(){return St}}]),e}(Lt);T("popover",Ot);var It={offset:10,method:"auto",target:""},jt={offset:"number",method:"string",target:"(string|element)"},Pt=function(t){function e(e,n){var i;return(i=t.call(this,e)||this)._scrollElement="BODY"===e.tagName?window:e,i._config=i._getConfig(n),i._selector=i._config.target+" .nav-link, "+i._config.target+" .list-group-item, "+i._config.target+" .dropdown-item",i._offsets=[],i._targets=[],i._activeTarget=null,i._scrollHeight=0,K.on(i._scrollElement,"scroll.bs.scrollspy",(function(){return i._process()})),i.refresh(),i._process(),i}r(e,t);var n=e.prototype;return n.refresh=function(){var t=this,e=this._scrollElement===this._scrollElement.window?"offset":"position",n="auto"===this._config.method?e:this._config.method,i="position"===n?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),q(this._selector).map((function(t){var e=h(t),o=e?Q(e):null;if(o){var s=o.getBoundingClientRect();if(s.width||s.height)return[X[n](o).top+i,e]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t._offsets.push(e[0]),t._targets.push(e[1])}))},n.dispose=function(){t.prototype.dispose.call(this),K.off(this._scrollElement,".bs.scrollspy"),this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},n._getConfig=function(t){if("string"!=typeof(t=s({},It,"object"==typeof t&&t?t:{})).target&&g(t.target)){var e=t.target.id;e||(e=c("scrollspy"),t.target.id=e),t.target="#"+e}return _("scrollspy",t,jt),t},n._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},n._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},n._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},n._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;)this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&(void 0===this._offsets[o+1]||t li > .active":".active";e=(e=q(o,i))[e.length-1]}var s=e?K.trigger(e,"hide.bs.tab",{relatedTarget:this._element}):null;if(!(K.trigger(this._element,"show.bs.tab",{relatedTarget:e}).defaultPrevented||null!==s&&s.defaultPrevented)){this._activate(this._element,i);var r=function(){K.trigger(e,"hidden.bs.tab",{relatedTarget:t._element}),K.trigger(t._element,"shown.bs.tab",{relatedTarget:e})};n?this._activate(n,n.parentNode,r):r()}}},n._activate=function(t,e,n){var i=this,o=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?V(e,".active"):q(":scope > li > .active",e))[0],s=n&&o&&o.classList.contains("fade"),r=function(){return i._transitionComplete(t,o,n)};if(o&&s){var a=f(o);o.classList.remove("show"),K.one(o,"transitionend",r),m(o,a)}else r()},n._transitionComplete=function(t,e,n){if(e){e.classList.remove("active");var i=Q(":scope > .dropdown-menu .active",e.parentNode);i&&i.classList.remove("active"),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}t.classList.add("active"),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),y(t),t.classList.contains("fade")&&t.classList.add("show"),t.parentNode&&t.parentNode.classList.contains("dropdown-menu")&&(t.closest(".dropdown")&&q(".dropdown-toggle").forEach((function(t){return t.classList.add("active")})),t.setAttribute("aria-expanded",!0)),n&&n()},e.jQueryInterface=function(t){return this.each((function(){var n=L(this,"bs.tab")||new e(this);if("string"==typeof t){if(void 0===n[t])throw new TypeError('No method named "'+t+'"');n[t]()}}))},o(e,null,[{key:"DATA_KEY",get:function(){return"bs.tab"}}]),e}(W);K.on(document,"click.bs.tab.data-api",'[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',(function(t){t.preventDefault(),(L(this,"bs.tab")||new xt(this)).show()})),T("tab",xt);var Ht={animation:"boolean",autohide:"boolean",delay:"number"},Bt={animation:!0,autohide:!0,delay:5e3},Mt=function(t){function e(e,n){var i;return(i=t.call(this,e)||this)._config=i._getConfig(n),i._timeout=null,i._setListeners(),i}r(e,t);var n=e.prototype;return n.show=function(){var t=this;if(!K.trigger(this._element,"show.bs.toast").defaultPrevented){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");var e=function(){t._element.classList.remove("showing"),t._element.classList.add("show"),K.trigger(t._element,"shown.bs.toast"),t._config.autohide&&(t._timeout=setTimeout((function(){t.hide()}),t._config.delay))};if(this._element.classList.remove("hide"),y(this._element),this._element.classList.add("showing"),this._config.animation){var n=f(this._element);K.one(this._element,"transitionend",e),m(this._element,n)}else e()}},n.hide=function(){var t=this;if(this._element.classList.contains("show")&&!K.trigger(this._element,"hide.bs.toast").defaultPrevented){var e=function(){t._element.classList.add("hide"),K.trigger(t._element,"hidden.bs.toast")};if(this._element.classList.remove("show"),this._config.animation){var n=f(this._element);K.one(this._element,"transitionend",e),m(this._element,n)}else e()}},n.dispose=function(){this._clearTimeout(),this._element.classList.contains("show")&&this._element.classList.remove("show"),K.off(this._element,"click.dismiss.bs.toast"),t.prototype.dispose.call(this),this._config=null},n._getConfig=function(t){return t=s({},Bt,X.getDataAttributes(this._element),"object"==typeof t&&t?t:{}),_("toast",t,this.constructor.DefaultType),t},n._setListeners=function(){var t=this;K.on(this._element,"click.dismiss.bs.toast",'[data-bs-dismiss="toast"]',(function(){return t.hide()}))},n._clearTimeout=function(){clearTimeout(this._timeout),this._timeout=null},e.jQueryInterface=function(t){return this.each((function(){var n=L(this,"bs.toast");if(n||(n=new e(this,"object"==typeof t&&t)),"string"==typeof t){if(void 0===n[t])throw new TypeError('No method named "'+t+'"');n[t](this)}}))},o(e,null,[{key:"DefaultType",get:function(){return Ht}},{key:"Default",get:function(){return Bt}},{key:"DATA_KEY",get:function(){return"bs.toast"}}]),e}(W);return T("toast",Mt),{Alert:U,Button:F,Carousel:J,Collapse:nt,Dropdown:dt,Modal:gt,Popover:Ot,ScrollSpy:Pt,Tab:xt,Toast:Mt,Tooltip:Lt}})); 7 | //# sourceMappingURL=bootstrap.min.js.map -------------------------------------------------------------------------------- /public/js/lib/grapesjs-blocks-basic.js: -------------------------------------------------------------------------------- 1 | /*! grapesjs-blocks-basic - 0.1.11 */ 2 | !(function (e, t) { 3 | "object" == typeof exports && "object" == typeof module 4 | ? (module.exports = t(require("grapesjs"))) 5 | : "function" == typeof define && define.amd 6 | ? define(["grapesjs"], t) 7 | : "object" == typeof exports 8 | ? (exports["grapesjs-blocks-basic"] = t(require("grapesjs"))) 9 | : (e["grapesjs-blocks-basic"] = t(e.grapesjs)); 10 | })(this, function (e) { 11 | return (function (e) { 12 | function t(a) { 13 | if (n[a]) return n[a].exports; 14 | var l = (n[a] = { i: a, l: !1, exports: {} }); 15 | return e[a].call(l.exports, l, l.exports, t), (l.l = !0), l.exports; 16 | } 17 | var n = {}; 18 | return ( 19 | (t.m = e), 20 | (t.c = n), 21 | (t.d = function (e, n, a) { 22 | t.o(e, n) || 23 | Object.defineProperty(e, n, { 24 | configurable: !1, 25 | enumerable: !0, 26 | get: a, 27 | }); 28 | }), 29 | (t.n = function (e) { 30 | var n = 31 | e && e.__esModule 32 | ? function () { 33 | return e.default; 34 | } 35 | : function () { 36 | return e; 37 | }; 38 | return t.d(n, "a", n), n; 39 | }), 40 | (t.o = function (e, t) { 41 | return Object.prototype.hasOwnProperty.call(e, t); 42 | }), 43 | (t.p = ""), 44 | t((t.s = 0)) 45 | ); 46 | })([ 47 | function (e, t, n) { 48 | "use strict"; 49 | Object.defineProperty(t, "__esModule", { value: !0 }); 50 | var a = 51 | Object.assign || 52 | function (e) { 53 | for (var t = 1; t < arguments.length; t++) { 54 | var n = arguments[t]; 55 | for (var a in n) 56 | Object.prototype.hasOwnProperty.call(n, a) && (e[a] = n[a]); 57 | } 58 | return e; 59 | }, 60 | l = n(1), 61 | i = (function (e) { 62 | return e && e.__esModule ? e : { default: e }; 63 | })(l); 64 | t.default = i.default.plugins.add("gjs-blocks-basic", function (e) { 65 | var t = 66 | arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, 67 | l = a( 68 | { 69 | blocks: [ 70 | "column1", 71 | "column2", 72 | "column3", 73 | "column3-7", 74 | "text", 75 | "link", 76 | "image", 77 | "video", 78 | "map", 79 | ], 80 | flexGrid: 0, 81 | stylePrefix: "gjs-", 82 | addBasicStyle: !0, 83 | category: "Basic", 84 | labelColumn1: "1 Column", 85 | labelColumn2: "2 Columns", 86 | labelColumn3: "3 Columns", 87 | labelColumn37: "2 Columns 3/7", 88 | labelText: "Text", 89 | labelLink: "Link", 90 | labelImage: "Image", 91 | labelVideo: "Video", 92 | labelMap: "Map", 93 | rowHeight: 75, 94 | }, 95 | t 96 | ); 97 | n(2).default(e, l); 98 | }); 99 | }, 100 | function (t, n) { 101 | t.exports = e; 102 | }, 103 | function (e, t, n) { 104 | "use strict"; 105 | Object.defineProperty(t, "__esModule", { value: !0 }); 106 | var a = 107 | Object.assign || 108 | function (e) { 109 | for (var t = 1; t < arguments.length; t++) { 110 | var n = arguments[t]; 111 | for (var a in n) 112 | Object.prototype.hasOwnProperty.call(n, a) && (e[a] = n[a]); 113 | } 114 | return e; 115 | }; 116 | t.default = function (e) { 117 | var t = 118 | arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, 119 | n = t, 120 | l = e.BlockManager, 121 | i = n.blocks, 122 | o = n.stylePrefix, 123 | s = n.flexGrid, 124 | r = n.addBasicStyle, 125 | c = n.rowHeight, 126 | d = o + "row", 127 | u = o + "cell", 128 | b = s 129 | ? "\n ." + 130 | d + 131 | " {\n display: flex;\n justify-content: flex-start;\n align-items: stretch;\n flex-wrap: nowrap;\n padding: 10px;\n }\n @media (max-width: 768px) {\n ." + 132 | d + 133 | " {\n flex-wrap: wrap;\n }\n }" 134 | : "\n ." + 135 | d + 136 | " {\n display: table;\n padding: 10px;\n width: 100%;\n }\n @media (max-width: 768pxpx) {\n ." + 137 | o + 138 | "cell, ." + 139 | o + 140 | "cell30, ." + 141 | o + 142 | "cell70 {\n width: 100%;\n display: block;\n }\n }", 143 | f = s 144 | ? "\n ." + 145 | u + 146 | " {\n min-height: " + 147 | c + 148 | "px;\n flex-grow: 1;\n flex-basis: 100%;\n }" 149 | : "\n ." + 150 | u + 151 | " {\n width: 8%;\n display: table-cell;\n height: " + 152 | c + 153 | "px;\n }", 154 | g = "\n ." + o + "cell30 {\n width: 30%;\n }", 155 | p = "\n ." + o + "cell70 {\n width: 70%;\n }", 156 | y = { tl: 0, tc: 0, tr: 0, cl: 0, cr: 0, bl: 0, br: 0, minDim: 1 }, 157 | m = a({}, y, { cr: 1, bc: 0, currentUnit: 1, minDim: 1, step: 0.2 }); 158 | s && (m.keyWidth = "flex-basis"); 159 | var v = { 160 | class: d, 161 | "data-gjs-droppable": "." + u, 162 | "data-gjs-resizable": y, 163 | "data-gjs-name": "Row", 164 | }, 165 | x = { 166 | class: u, 167 | "data-gjs-draggable": "." + d, 168 | "data-gjs-resizable": m, 169 | "data-gjs-name": "Cell", 170 | }; 171 | s && 172 | ((x["data-gjs-unstylable"] = ["width"]), 173 | (x["data-gjs-stylable-require"] = ["flex-basis"])); 174 | var j = ["." + d, "." + u]; 175 | e.on("selector:add", function (e) { 176 | return j.indexOf(e.getFullName()) >= 0 && e.set("private", 1); 177 | }); 178 | var h = function (e) { 179 | var t = []; 180 | for (var n in e) { 181 | var a = e[n], 182 | l = a instanceof Array || a instanceof Object; 183 | (a = l ? JSON.stringify(a) : a), 184 | t.push(n + "=" + (l ? "'" + a + "'" : '"' + a + '"')); 185 | } 186 | return t.length ? " " + t.join(" ") : ""; 187 | }, 188 | w = function (e) { 189 | return i.indexOf(e) >= 0; 190 | }, 191 | k = h(v), 192 | O = h(x); 193 | w("column1") && 194 | l.add("column1", { 195 | label: n.labelColumn1, 196 | category: n.category, 197 | attributes: { class: "gjs-fonts gjs-f-b1" }, 198 | content: 199 | "\n \n \n " + 204 | (r 205 | ? "" 210 | : ""), 211 | }), 212 | w("column2") && 213 | l.add("column2", { 214 | label: n.labelColumn2, 215 | attributes: { class: "gjs-fonts gjs-f-b2" }, 216 | category: n.category, 217 | content: 218 | "\n \n \n \n " + 225 | (r 226 | ? "" 231 | : ""), 232 | }), 233 | w("column3") && 234 | l.add("column3", { 235 | label: n.labelColumn3, 236 | category: n.category, 237 | attributes: { class: "gjs-fonts gjs-f-b3" }, 238 | content: 239 | "\n \n \n \n \n " + 248 | (r 249 | ? "" 254 | : ""), 255 | }), 256 | w("column3-7") && 257 | l.add("column3-7", { 258 | label: n.labelColumn37, 259 | category: n.category, 260 | attributes: { class: "gjs-fonts gjs-f-b37" }, 261 | content: 262 | "\n \n \n \n ' + 273 | (r 274 | ? "" 283 | : ""), 284 | }), 285 | w("text") && 286 | l.add("text", { 287 | label: n.labelText, 288 | category: n.category, 289 | attributes: { class: "gjs-fonts gjs-f-text" }, 290 | content: { 291 | type: "text", 292 | content: "Insert your text here", 293 | style: { padding: "10px" }, 294 | activeOnRender: 1, 295 | }, 296 | }), 297 | w("link") && 298 | l.add("link", { 299 | label: n.labelLink, 300 | category: n.category, 301 | attributes: { class: "fa fa-link" }, 302 | content: { 303 | type: "link", 304 | content: "Link", 305 | style: { color: "#d983a6" }, 306 | }, 307 | }), 308 | w("image") && 309 | l.add("image", { 310 | label: n.labelImage, 311 | category: n.category, 312 | attributes: { class: "gjs-fonts gjs-f-image" }, 313 | content: { 314 | style: { color: "black" }, 315 | type: "image", 316 | activeOnRender: 1, 317 | }, 318 | }), 319 | w("video") && 320 | l.add("video", { 321 | label: n.labelVideo, 322 | category: n.category, 323 | attributes: { class: "fa fa-youtube-play" }, 324 | content: { 325 | type: "video", 326 | src: "img/video2.webm", 327 | style: { height: "350px", width: "615px" }, 328 | }, 329 | }), 330 | w("map") && 331 | l.add("map", { 332 | label: n.labelMap, 333 | category: n.category, 334 | attributes: { class: "fa fa-map-o" }, 335 | content: { type: "map", style: { height: "350px" } }, 336 | }); 337 | }; 338 | }, 339 | ]); 340 | }); 341 | -------------------------------------------------------------------------------- /public/js/lib/popper.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @popperjs/core v2.6.0 - MIT License 3 | */ 4 | 5 | "use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).Popper={})}(this,(function(e){function t(e){return{width:(e=e.getBoundingClientRect()).width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function n(e){return"[object Window]"!==e.toString()?(e=e.ownerDocument)&&e.defaultView||window:e}function r(e){return{scrollLeft:(e=n(e)).pageXOffset,scrollTop:e.pageYOffset}}function o(e){return e instanceof n(e).Element||e instanceof Element}function i(e){return e instanceof n(e).HTMLElement||e instanceof HTMLElement}function a(e){return e?(e.nodeName||"").toLowerCase():null}function s(e){return((o(e)?e.ownerDocument:e.document)||window.document).documentElement}function f(e){return t(s(e)).left+r(e).scrollLeft}function c(e){return n(e).getComputedStyle(e)}function p(e){return e=c(e),/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function l(e,o,c){void 0===c&&(c=!1);var l=s(o);e=t(e);var u=i(o),d={scrollLeft:0,scrollTop:0},m={x:0,y:0};return(u||!u&&!c)&&(("body"!==a(o)||p(l))&&(d=o!==n(o)&&i(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:r(o)),i(o)?((m=t(o)).x+=o.clientLeft,m.y+=o.clientTop):l&&(m.x=f(l))),{x:e.left+d.scrollLeft-m.x,y:e.top+d.scrollTop-m.y,width:e.width,height:e.height}}function u(e){return{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}function d(e){return"html"===a(e)?e:e.assignedSlot||e.parentNode||e.host||s(e)}function m(e,t){void 0===t&&(t=[]);var r=function e(t){return 0<=["html","body","#document"].indexOf(a(t))?t.ownerDocument.body:i(t)&&p(t)?t:e(d(t))}(e);e="body"===a(r);var o=n(r);return r=e?[o].concat(o.visualViewport||[],p(r)?r:[]):r,t=t.concat(r),e?t:t.concat(m(d(r)))}function h(e){if(!i(e)||"fixed"===c(e).position)return null;if(e=e.offsetParent){var t=s(e);if("body"===a(e)&&"static"===c(e).position&&"static"!==c(t).position)return t}return e}function g(e){for(var t=n(e),r=h(e);r&&0<=["table","td","th"].indexOf(a(r))&&"static"===c(r).position;)r=h(r);if(r&&"body"===a(r)&&"static"===c(r).position)return t;if(!r)e:{for(e=d(e);i(e)&&0>["html","body"].indexOf(a(e));){if("none"!==(r=c(e)).transform||"none"!==r.perspective||r.willChange&&"auto"!==r.willChange){r=e;break e}e=e.parentNode}r=null}return r||t}function v(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(o){n.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach((function(r){n.has(r)||(r=t.get(r))&&e(r)})),r.push(o)}(e)})),r}function b(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}function y(e){return e.split("-")[0]}function O(e,t){var r,o=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if((r=o)&&(r=o instanceof(r=n(o).ShadowRoot)||o instanceof ShadowRoot),r)do{if(t&&e.isSameNode(t))return!0;t=t.parentNode||t.host}while(t);return!1}function w(e){return Object.assign(Object.assign({},e),{},{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function x(e,o){if("viewport"===o){o=n(e);var a=s(e);o=o.visualViewport;var p=a.clientWidth;a=a.clientHeight;var l=0,u=0;o&&(p=o.width,a=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(l=o.offsetLeft,u=o.offsetTop)),e=w(e={width:p,height:a,x:l+f(e),y:u})}else i(o)?((e=t(o)).top+=o.clientTop,e.left+=o.clientLeft,e.bottom=e.top+o.clientHeight,e.right=e.left+o.clientWidth,e.width=o.clientWidth,e.height=o.clientHeight,e.x=e.left,e.y=e.top):(u=s(e),e=s(u),l=r(u),o=u.ownerDocument.body,p=Math.max(e.scrollWidth,e.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Math.max(e.scrollHeight,e.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),u=-l.scrollLeft+f(u),l=-l.scrollTop,"rtl"===c(o||e).direction&&(u+=Math.max(e.clientWidth,o?o.clientWidth:0)-p),e=w({width:p,height:a,x:u,y:l}));return e}function j(e,t,n){return t="clippingParents"===t?function(e){var t=m(d(e)),n=0<=["absolute","fixed"].indexOf(c(e).position)&&i(e)?g(e):e;return o(n)?t.filter((function(e){return o(e)&&O(e,n)&&"body"!==a(e)})):[]}(e):[].concat(t),(n=(n=[].concat(t,[n])).reduce((function(t,n){return n=x(e,n),t.top=Math.max(n.top,t.top),t.right=Math.min(n.right,t.right),t.bottom=Math.min(n.bottom,t.bottom),t.left=Math.max(n.left,t.left),t}),x(e,n[0]))).width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}function M(e){return 0<=["top","bottom"].indexOf(e)?"x":"y"}function E(e){var t=e.reference,n=e.element,r=(e=e.placement)?y(e):null;e=e?e.split("-")[1]:null;var o=t.x+t.width/2-n.width/2,i=t.y+t.height/2-n.height/2;switch(r){case"top":o={x:o,y:t.y-n.height};break;case"bottom":o={x:o,y:t.y+t.height};break;case"right":o={x:t.x+t.width,y:i};break;case"left":o={x:t.x-n.width,y:i};break;default:o={x:t.x,y:t.y}}if(null!=(r=r?M(r):null))switch(i="y"===r?"height":"width",e){case"start":o[r]-=t[i]/2-n[i]/2;break;case"end":o[r]+=t[i]/2-n[i]/2}return o}function D(e){return Object.assign(Object.assign({},{top:0,right:0,bottom:0,left:0}),e)}function P(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function L(e,n){void 0===n&&(n={});var r=n;n=void 0===(n=r.placement)?e.placement:n;var i=r.boundary,a=void 0===i?"clippingParents":i,f=void 0===(i=r.rootBoundary)?"viewport":i;i=void 0===(i=r.elementContext)?"popper":i;var c=r.altBoundary,p=void 0!==c&&c;r=D("number"!=typeof(r=void 0===(r=r.padding)?0:r)?r:P(r,T));var l=e.elements.reference;c=e.rects.popper,a=j(o(p=e.elements[p?"popper"===i?"reference":"popper":i])?p:p.contextElement||s(e.elements.popper),a,f),p=E({reference:f=t(l),element:c,strategy:"absolute",placement:n}),c=w(Object.assign(Object.assign({},c),p)),f="popper"===i?c:f;var u={top:a.top-f.top+r.top,bottom:f.bottom-a.bottom+r.bottom,left:a.left-f.left+r.left,right:f.right-a.right+r.right};if(e=e.modifiersData.offset,"popper"===i&&e){var d=e[n];Object.keys(u).forEach((function(e){var t=0<=["right","bottom"].indexOf(e)?1:-1,n=0<=["top","bottom"].indexOf(e)?"y":"x";u[e]+=d[n]*t}))}return u}function k(){for(var e=arguments.length,t=Array(e),n=0;n(v.devicePixelRatio||1)?"translate("+e+"px, "+l+"px)":"translate3d("+e+"px, "+l+"px, 0)",d)):Object.assign(Object.assign({},r),{},((t={})[h]=a?l+"px":"",t[m]=u?e+"px":"",t.transform="",t))}function A(e){return e.replace(/left|right|bottom|top/g,(function(e){return G[e]}))}function H(e){return e.replace(/start|end/g,(function(e){return J[e]}))}function R(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function S(e){return["top","right","bottom","left"].some((function(t){return 0<=e[t]}))}var T=["top","bottom","right","left"],q=T.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),C=[].concat(T,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),N="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),V={placement:"bottom",modifiers:[],strategy:"absolute"},I={passive:!0},_={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,o=(e=e.options).scroll,i=void 0===o||o,a=void 0===(e=e.resize)||e,s=n(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach((function(e){e.addEventListener("scroll",r.update,I)})),a&&s.addEventListener("resize",r.update,I),function(){i&&f.forEach((function(e){e.removeEventListener("scroll",r.update,I)})),a&&s.removeEventListener("resize",r.update,I)}},data:{}},U={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=E({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},z={top:"auto",right:"auto",bottom:"auto",left:"auto"},F={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options;e=void 0===(e=n.gpuAcceleration)||e;var r=n.adaptive;r=void 0===r||r,n=void 0===(n=n.roundOffsets)||n,e={placement:y(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e},null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign(Object.assign({},t.styles.popper),W(Object.assign(Object.assign({},e),{},{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:n})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign(Object.assign({},t.styles.arrow),W(Object.assign(Object.assign({},e),{},{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:n})))),t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-placement":t.placement})},data:{}},X={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];i(o)&&a(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{};e=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{}),i(r)&&a(r)&&(Object.assign(r.style,e),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},Y={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.name,r=void 0===(e=e.options.offset)?[0,0]:e,o=(e=C.reduce((function(e,n){var o=t.rects,i=y(n),a=0<=["left","top"].indexOf(i)?-1:1,s="function"==typeof r?r(Object.assign(Object.assign({},o),{},{placement:n})):r;return o=(o=s[0])||0,s=((s=s[1])||0)*a,i=0<=["left","right"].indexOf(i)?{x:s,y:o}:{x:o,y:s},e[n]=i,e}),{}))[t.placement],i=o.x;o=o.y,null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=o),t.modifiersData[n]=e}},G={left:"right",right:"left",bottom:"top",top:"bottom"},J={start:"end",end:"start"},K={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;if(e=e.name,!t.modifiersData[e]._skip){var r=n.mainAxis;r=void 0===r||r;var o=n.altAxis;o=void 0===o||o;var i=n.fallbackPlacements,a=n.padding,s=n.boundary,f=n.rootBoundary,c=n.altBoundary,p=n.flipVariations,l=void 0===p||p,u=n.allowedAutoPlacements;p=y(n=t.options.placement),i=i||(p!==n&&l?function(e){if("auto"===y(e))return[];var t=A(e);return[H(e),t,H(t)]}(n):[A(n)]);var d=[n].concat(i).reduce((function(e,n){return e.concat("auto"===y(n)?function(e,t){void 0===t&&(t={});var n=t.boundary,r=t.rootBoundary,o=t.padding,i=t.flipVariations,a=t.allowedAutoPlacements,s=void 0===a?C:a,f=t.placement.split("-")[1];0===(i=(t=f?i?q:q.filter((function(e){return e.split("-")[1]===f})):T).filter((function(e){return 0<=s.indexOf(e)}))).length&&(i=t);var c=i.reduce((function(t,i){return t[i]=L(e,{placement:i,boundary:n,rootBoundary:r,padding:o})[y(i)],t}),{});return Object.keys(c).sort((function(e,t){return c[e]-c[t]}))}(t,{placement:n,boundary:s,rootBoundary:f,padding:a,flipVariations:l,allowedAutoPlacements:u}):n)}),[]);n=t.rects.reference,i=t.rects.popper;var m=new Map;p=!0;for(var h=d[0],g=0;gi[x]&&(O=A(O)),x=A(O),w=[],r&&w.push(0>=j[b]),o&&w.push(0>=j[O],0>=j[x]),w.every((function(e){return e}))){h=v,p=!1;break}m.set(v,w)}if(p)for(r=function(e){var t=d.find((function(t){if(t=m.get(t))return t.slice(0,e).every((function(e){return e}))}));if(t)return h=t,"break"},o=l?3:1;0', 62 | command: 'sw-visibility', // Built-in command 63 | }, 64 | ], 65 | }, 66 | { 67 | id: 'panel-devices', 68 | el: '.panel__devices', 69 | buttons: [ 70 | { 71 | id: 'device-desktop', 72 | label: '', 73 | command: 'set-device-desktop', 74 | active: true, 75 | togglable: false, 76 | }, 77 | { 78 | id: 'device-mobile', 79 | label: '', 80 | command: 'set-device-mobile', 81 | togglable: false, 82 | }, 83 | ], 84 | }, 85 | ], 86 | }, 87 | deviceManager: { 88 | devices: [ 89 | { 90 | name: 'Desktop', 91 | width: '', 92 | }, 93 | { 94 | name: 'Mobile', 95 | width: '320px', 96 | widthMedia: '480px', 97 | }, 98 | ], 99 | }, 100 | plugins: ['gjs-blocks-basic'], 101 | pluginsOpts: { 102 | 'gjs-blocks-basic': {}, 103 | }, 104 | }); 105 | // Commands 106 | editor.Commands.add('set-device-desktop', { 107 | run: (editor) => editor.setDevice('Desktop'), 108 | }); 109 | editor.Commands.add('set-device-mobile', { 110 | run: (editor) => editor.setDevice('Mobile'), 111 | }); 112 | -------------------------------------------------------------------------------- /render/render.controller.js: -------------------------------------------------------------------------------- 1 | import { findPageById } from '../page/page.services'; 2 | 3 | const renderHtml = async (req, res, next) => { 4 | try { 5 | const { params } = req; 6 | const { pageId } = params; 7 | const page = await findPageById(pageId); 8 | if (!page) { 9 | res.render('404'); 10 | } 11 | const { content, name } = page; 12 | let html = content['mycustom-html']; 13 | 14 | const css = content['mycustom-css']; 15 | 16 | res.render('render', { html, css, name }); 17 | } catch (error) { 18 | res.render('404'); 19 | } 20 | }; 21 | 22 | export default renderHtml; 23 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | import express from 'express'; 2 | import mongoose from 'mongoose'; 3 | import cors from 'cors'; 4 | import path from 'path'; 5 | import uiRoute from './ui/ui.route'; 6 | import pageRoute from './page/page.route'; 7 | import assetRoute from './assets/assets.route'; 8 | import projectRoute from './project/project.route'; 9 | import renderHtml from './render/render.controller'; 10 | //Initialize App 11 | const app = express(); 12 | app.use(express.json()); 13 | const corsOptions = { 14 | origin: function (origin, callback) { 15 | callback(null, true); 16 | }, 17 | }; 18 | 19 | corsOptions.credentials = true; 20 | app.use(cors(corsOptions)); 21 | 22 | //HTML and Static file 23 | app.use('/resources', express.static(path.join(__dirname, 'public'))); 24 | app.set('views', `views`); 25 | app.set('view engine', 'hbs'); 26 | 27 | const mongoUri = 'mongodb://localhost:27017/webpage_builder'; 28 | mongoose.connect( 29 | mongoUri, 30 | { 31 | useCreateIndex: true, 32 | useFindAndModify: false, 33 | useNewUrlParser: true, 34 | useUnifiedTopology: true, 35 | }, 36 | (err) => { 37 | if (err) throw err; 38 | console.log('Connected to MongoDB'); 39 | }, 40 | ); 41 | app.use('/api/projects', projectRoute); 42 | app.use('/api/pages', pageRoute); 43 | app.use('/api/assets', assetRoute); 44 | app.use('/api/', uiRoute); 45 | app.get('/:pageId?', renderHtml); 46 | 47 | const PORT = process.env.APP_PORT || 8080; 48 | app.listen(PORT, () => { 49 | console.log(`server is running on port ${PORT}`); 50 | }); 51 | -------------------------------------------------------------------------------- /ui/ui.controller.js: -------------------------------------------------------------------------------- 1 | import { listPages } from '../page/page.services'; 2 | 3 | export const home = async (req, res) => { 4 | const pages = await listPages(); 5 | res.render('home', { title: 'Webpage Builder', pages }); 6 | }; 7 | 8 | export const editor = async (req, res) => { 9 | const pages = await listPages(); 10 | const selectedPage = pages.find((page) => page.id === req.params.pageId); 11 | res.render('editor', { title: 'Webpage Builder', pages, selectedPage }); 12 | }; 13 | -------------------------------------------------------------------------------- /ui/ui.route.js: -------------------------------------------------------------------------------- 1 | import express from 'express'; 2 | import { editor, home } from './ui.controller'; 3 | 4 | const uiRoute = express.Router(); 5 | 6 | uiRoute.get('/', home); 7 | uiRoute.get('/editor/:pageId', editor); 8 | uiRoute.all('*', (req, res) => { 9 | res.render('404'); 10 | }); 11 | 12 | export default uiRoute; 13 | -------------------------------------------------------------------------------- /views/404.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Page Not Found 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 404: Page not found 20 | 21 | 22 | 23 | 24 | Home 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /views/editor.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{title}} 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Code Dexterous 25 | 26 | 27 | 28 | 34 | 35 | Add Page 36 | 37 | 38 | 39 | Home 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | About 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | Contact Us 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 86 | 87 | 88 | 89 | 90 | 100 | 101 | 102 | 103 | 104 | 114 | 115 | 116 | 117 | 118 | 128 | 129 | 130 | 131 | 132 | 133 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 170 | 171 | 172 | 173 | 174 | Create Page 175 | 181 | 182 | 183 | 184 | Name 185 | 193 | 194 | Please provide a valid name. 195 | 196 | 197 | 198 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | -------------------------------------------------------------------------------- /views/home.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{title}} 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Create Page 19 | 20 | 21 | 22 | Name 23 | 31 | 32 | Please provide a valid name. 33 | 34 | 35 | 36 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | ID 57 | Name 58 | Slug 59 | Action 60 | 61 | 62 | 63 | 64 | {{#each pages}} 65 | 66 | {{this._id}} 67 | {{this.name}} 68 | {{this.slug}} 69 | 70 | Edit 71 | 72 | 73 | {{/each}} 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /views/render.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{name}} 7 | 8 | 9 | 10 | 14 | 15 | 16 | {{{html}}} 17 | 18 | 19 | 20 | 21 | 22 | --------------------------------------------------------------------------------