@innovastudio/contentbuilder 1.5.6 → 1.5.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- var ContentBuilder=function(){"use strict";class t{constructor(t){this.builder=t;const e=this.builder.util;this.util=e}getSnippetsHtml(){const t=this.util,e=this.builder.opts.snippetUrl,i=this.builder.opts.snippetPath;let n="[";for(let e=0;e<this.builder.opts.snippetCategories.length;e++)n+=`[${this.builder.opts.snippetCategories[e][0]},'${t.out(this.builder.opts.snippetCategories[e][1])}'],`;n+="]";const o=this.builder.opts.defaultSnippetCategory;return`\n <!DOCTYPE HTML>\n <html>\n \n <head>\n <meta charset="utf-8">\n <title></title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <script src="${e}"><\/script>\n <style>\n body {\n // background: #fff;\n background: ${this.builder.styleSnippetBackground};\n margin: 0;\n }\n\n .is-pop-close {\n display: flex;\n justify-content: center;\n align-items: center;\n border: none;\n background: transparent;\n z-index:10;width:30px;height:30px;position:absolute;\n top:2px;right:2px;box-sizing:border-box;padding:0;line-height:40px;font-size: 12px;text-align:center;cursor:pointer;\n }\n .is-pop-close:focus-visible {\n outline: ${this.builder.styleOutlineColor} 2px solid;\n }\n\n /*\n body.dark {\n background: #111;\n }\n .dark .is-categories {\n background: #333;\n }\n .dark .is-category-list a {\n background: #333;\n color: #fff;\n }\n .dark .is-category-list a.active {\n background: #525252;\n color: #fff;\n }\n .dark .is-category-list a:hover {\n color: #fff;\n }\n .dark .is-design-list>li img {\n opacity: 0.93;\n }\n .dark .is-more-categories {\n background: #333;\n }\n .dark .is-more-categories a {\n background: #333;\n color: #fff;\n }\n .dark .is-more-categories a:hover,\n .dark .is-more-categories a:focus {\n background: #4c4c4c;\n }\n .dark .is-more-categories a.active {\n background: #4c4c4c;\n }\n */\n\n \n .dark .is-design-list>li {\n outline: transparent 1px solid;\n }\n\n \n \n /* Scrollbar for modal */\n\n /* Darker color, because background for snippet thumbnails is always light. */\n .dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(78 78 78 / 62%) auto;\n }\n .dark *::-webkit-scrollbar {\n width: 12px;\n }\n .dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .dark *::-webkit-scrollbar-thumb {\n background-color:rgb(78 78 78 / 62%);\n } \n\n .colored-dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(100, 100, 100) auto;\n }\n .colored-dark *::-webkit-scrollbar {\n width: 12px;\n }\n .colored-dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored-dark *::-webkit-scrollbar-thumb {\n background-color:rgb(100, 100, 100);\n } \n\n .colored * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .colored *::-webkit-scrollbar {\n width: 12px;\n }\n .colored *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n\n .light * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .light *::-webkit-scrollbar {\n width: 12px;\n }\n .light *::-webkit-scrollbar-track {\n background: transparent;\n }\n .light *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n \n svg {\n fill: ${this.builder.styleSnippetColor};\n }\n\n .is-design-list {\n position: fixed;\n top: 0px;\n left: 0px;\n border-top: transparent 68px solid;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n padding: 0px 0px 30px 30px;\n box-sizing: border-box;\n overflow: auto;\n list-style: none;\n margin: 0;\n }\n \n .is-design-list>li {\n width: 250px;\n min-height:120px;\n position:relative;\n background: #fff;\n // background: ${this.builder.styleToolBackground};\n overflow: hidden;\n margin: 32px 40px 0 0;\n cursor: pointer;\n display: inline-block;\n outline: #ececec 1px solid;\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n }\n\n .is-design-list>li:focus-visible {\n outline: ${this.builder.styleOutlineColor} 2px solid;\n }\n\n .is-design-list>li img {\n box-shadow: none;\n opacity: 1;\n display: block;\n box-sizing: border-box;\n transition: all 0.2s ease-in-out;\n max-width: 400px;\n width: 100%\n }\n \n // .is-design-list>li:hover img {\n // opacity: 0.95;\n // }\n \n // .is-design-list>li:hover {\n // background: #999;\n // }\n .is-overlay {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n }\n .is-design-list>li .is-overlay:after {\n background: rgba(0, 0, 0, 0.02);\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n transition: all 0.3s ease-in-out;\n opacity: 0;\n }\n .is-design-list>li:hover .is-overlay:after,\n .is-design-list>li:focus .is-overlay:after {\n opacity: 0.9;\n }\n .dark .is-design-list>li .is-overlay:after {\n background: rgb(78 78 78 / 13%);\n }\n \n .is-category-list {\n position: relative;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 80px;\n box-sizing: border-box;\n z-index: 1;\n }\n \n .is-category-list>div {\n white-space: nowrap;\n padding: 0 30px;\n box-sizing: border-box;\n font-family: sans-serif;\n font-size: 10px;\n text-transform: uppercase;\n letter-spacing: 2px;\n // background: #f5f5f5;\n background: ${this.builder.styleSnippetTabsBackground};\n // box-shadow: 0 5px 8px rgb(0 0 0 / 4%);\n }\n \n .is-category-list a {\n display: inline-block;\n padding: 10px 20px;\n // background: #fefefe;\n // color: #000;\n background: ${this.builder.styleSnippetTabItemBackground};\n color: ${this.builder.styleSnippetTabItemColor};\n border-radius: 50px;\n \n margin: 0 12px 0 0;\n text-decoration: none;\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);\n transition: box-shadow ease 0.3s;\n }\n \n .is-category-list a:hover {\n /*background: #fafafa;*/\n background: ${this.builder.styleSnippetTabItemBackgroundHover};\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);\n // color: #000;\n color: ${this.builder.styleSnippetTabItemColor};\n }\n \n .is-category-list a.active {\n // background: #f5f5f5;\n background: ${this.builder.styleSnippetTabItemBackgroundActive};\n // color: #000;\n color: ${this.builder.styleSnippetTabItemColor};\n box-shadow: none;\n cursor: default;\n }\n\n .is-category-list a:focus-visible {\n outline: ${this.builder.styleOutlineColor} 2px solid;\n }\n \n .is-more-categories {\n display: none;\n position: absolute;\n width: 400px;\n box-sizing: border-box;\n padding: 0;\n z-index: 1;\n font-family: sans-serif;\n font-size: 10px;\n text-transform: uppercase;\n letter-spacing: 2px;\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);\n // background: #fff;\n background: ${this.builder.styleSnippetMoreItemBackground};\n }\n \n .is-more-categories a {\n width: 200px;\n float: left;\n display: block;\n box-sizing: border-box;\n padding: 12px 20px;\n // background: #fff;\n background: ${this.builder.styleSnippetMoreItemBackground};\n text-decoration: none;\n // color: #000;\n color: ${this.builder.styleSnippetMoreItemColor};\n line-height: 1.6;\n outline: none;\n }\n \n .is-more-categories a:hover,\n .is-more-categories a:focus {\n // background: #eee;\n background: ${this.builder.styleSnippetMoreItemBackgroundHover};\n }\n \n .is-more-categories a.active {\n // background: #eee;\n background: ${this.builder.styleSnippetMoreItemBackgroundActive};\n }\n \n .is-more-categories.active {\n display: block;\n }\n \n /* First Loading */\n /* .is-category-list {\n display: none;\n }\n \n .is-design-list {\n display: none;\n }\n \n .pace {\n -webkit-pointer-events: none;\n pointer-events: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n \n .pace-inactive {\n display: none;\n }\n \n .pace .pace-progress {\n background: #000000;\n position: fixed;\n z-index: 2000;\n top: 0;\n right: 100%;\n width: 100%;\n height: 2px;\n } */\n \n .is-more-categories>a:nth-child(0) {\n display: none\n }\n \n .is-more-categories>a:nth-child(1) {\n display: none\n }\n \n .is-more-categories>a:nth-child(2) {\n display: none\n }\n \n .is-more-categories>a:nth-child(3) {\n display: none\n }\n \n .is-more-categories>a:nth-child(4) {\n display: none\n }\n \n .is-more-categories>a:nth-child(5) {\n display: none\n }\n \n .is-more-categories>a:nth-child(6) {\n display: none\n }\n \n .is-more-categories>a:nth-child(7) {\n display: none\n }\n \n @media all and (max-width: 1212px) {\n .is-categories>a:nth-child(7):not(.more-snippets) {\n display: none\n }\n \n .is-more-categories>a:nth-child(7) {\n display: block\n }\n }\n \n @media all and (max-width: 1070px) {\n .is-categories>a:nth-child(6):not(.more-snippets) {\n display: none\n }\n \n .is-more-categories>a:nth-child(6) {\n display: block\n }\n }\n \n @media all and (max-width: 940px) {\n .is-categories>a:nth-child(5):not(.more-snippets) {\n display: none\n }\n \n .is-more-categories>a:nth-child(5) {\n display: block\n }\n }\n \n @media all and (max-width: 700px) {\n .is-categories>a:nth-child(4):not(.more-snippets) {\n display: none\n }\n \n .is-more-categories>a:nth-child(4) {\n display: block\n }\n }\n \n @media all and (max-width: 555px) {\n .is-categories>a:nth-child(3):not(.more-snippets) {\n display: none\n }\n \n .is-more-categories>a:nth-child(3) {\n display: block\n }\n }\n \n @media all and (max-width: 415px) {\n .is-categories>a:nth-child(2):not(.more-snippets) {\n display: none\n }\n \n .is-more-categories>a:nth-child(2) {\n display: block\n }\n }\n \n @media all and (max-width: 640px) {\n .is-more-categories a {\n width: 150px;\n padding: 10px 5px 10px 15px;\n font-size: 10px;\n }\n \n .is-more-categories {\n left: 0 !important;\n width: 100% !important;\n }\n }\n\n\n * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.2) auto;\n }\n *::-webkit-scrollbar {\n width: 12px;\n }\n *::-webkit-scrollbar-track {\n background: rgba(200, 200, 200, 0.2);\n }\n *::-webkit-scrollbar-thumb {\n background-color:rgba(0, 0, 0, 0.2); \n }\n </style>\n </head>\n \n <body${this.builder.styleDark?' class="dark"':""}${this.builder.styleColored?' class="colored"':""}${this.builder.styleColoredDark?' class="colored-dark"':""}${this.builder.styleLight?' class="light"':""}>\n\n <svg style="display:none">\n <defs>\n <symbol viewBox="0 0 512 512" id="ion-ios-close-empty">\n <path d="M340.2 160l-84.4 84.3-84-83.9-11.8 11.8 84 83.8-84 83.9 11.8 11.7 84-83.8 84.4 84.2 11.8-11.7-84.4-84.3 84.4-84.2z"></path>\n </symbol>\n </defs>\n </svg>\n \n <button class="is-pop-close" tabindex="-1">\n <svg class="is-icon-flex" style="width:30px;height:30px;">\n <use xlink:href="#ion-ios-close-empty"></use>\n </svg>\n </button>\n \n <div class="is-category-list">\n <div class="is-categories" style="position:fixed;top:0;left:0;right:0;height:68px;padding-top:17px;box-sizing:border-box;">\n </div>\n </div>\n\n <div class="is-more-categories" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n </div>\n \n <ul class="is-design-list" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n </ul>\n \n <script${this.builder.nonce?` nonce="${this.builder.nonce}"`:""}>\n \n var snippetPath = '${i}';\n var snippetCategories = ${n};\n var defaultSnippetCategory = ${o};\n\n ${void 0!==this.builder.slider&&null!==this.builder.slider?`\n var slider='${this.builder.slider}';`:"var slider=null;"};\n \n var numOfCat = snippetCategories.length;\n if (numOfCat <= 7) {\n document.querySelector('.is-more-categories').style.width = '200px';\n }\n \n var categorytabs = document.querySelector('.is-categories');\n categorytabs.innerHTML = '';\n let html_catselect = '';\n for (var i = 0; i < numOfCat; i++) {\n if (i < 7) {\n html_catselect += '<a href="" data-cat="' + snippetCategories[i][0] + '">' + parent._cb.out(snippetCategories[i][1]) + '</a>';\n }\n }\n html_catselect += '<a href="" class="more-snippets">' + parent._cb.out('More') + '</a>';\n categorytabs.innerHTML = html_catselect;\n \n var categorymore = document.querySelector('.is-more-categories');\n html_catselect = '';\n for (var i = 0; i < numOfCat; i++) {\n html_catselect += '<a href="" data-cat="' + snippetCategories[i][0] + '">' + parent._cb.out(snippetCategories[i][1]) + '</a>';\n }\n categorymore.innerHTML = html_catselect;\n \n // Show/hide "More" button\n if (numOfCat <= 7) {\n var bHasMore = false;\n \n const childNodes = categorymore.childNodes;\n let i = childNodes.length;\n while (i--) {\n if(childNodes[i].style.display === 'block') {\n bHasMore = true;\n }\n }\n var more = document.querySelector('.more-snippets');\n if (!bHasMore) more.style.display = 'none';\n else more.style.display = '';\n }\n \n var elms = categorytabs.querySelectorAll('a[data-cat="' + defaultSnippetCategory + '"]'); //.classList.add('active');\n Array.prototype.forEach.call(elms, function(elm){\n elm.classList.add('active');\n });\n elms = categorymore.querySelectorAll('a[data-cat="' + defaultSnippetCategory + '"]'); //.classList.add('active');\n Array.prototype.forEach.call(elms, function(elm){\n elm.classList.add('active');\n });\n\n\n document.addEventListener('keydown', function(e){\n if(e.keyCode === 27) { // escape key\n const moreCategories = document.querySelector('.is-more-categories');\n if(moreCategories.classList.contains('active')) {\n moreCategories.classList.remove('active');\n const activeTab = categorylist.querySelector('.more-snippets');\n activeTab.classList.remove('active');\n activeTab.focus();\n } else {\n const modal = parent.document.querySelector('.is-modal.snippets');\n removeClass(modal, 'active');\n }\n }\n });\n\n\n let categorylist = document.querySelector('.is-category-list');\n let designlist = document.querySelector('.is-design-list');\n\n const select = (elm) => {\n\n if(elm.classList.contains('active')) {\n return false;\n }\n \n var cat = elm.getAttribute('data-cat');\n if (cat) if(designlist.querySelectorAll('[data-cat="' + cat + '"]').length === 0) {\n\n for (let i = 0; i <snippets.length; i++) {\n \n var thumb = snippets[i].thumbnail;\n \n thumb = snippetPath + thumb; \n \n if (snippets[i].category === cat) {\n designlist.insertAdjacentHTML('beforeend', '<li role="button" tabindex="0" data-id="' + snippets[i].id + '" data-cat="' + snippets[i].category + '"><img src="' + thumb + '"><span class="is-overlay"></span></li>');\n \n var newitem = designlist.querySelector('[data-id="' + snippets[i].id + '"]');\n newitem.addEventListener('click', function(e){\n \n var snippetid = e.target.parentNode.getAttribute('data-id');\n addSnippet(snippetid);\n \n });\n\n newitem.addEventListener('keydown', (e)=>{\n if ((e.which === 9 && !e.shiftKey)) { // tab\n let last = false;\n if(e.target.nextElementSibling) {\n if(!e.target.nextElementSibling.classList.contains('active')) {\n last = true;\n }\n } else {\n last = true;\n }\n if(last) {\n e.preventDefault();\n let activeTab = categorylist.querySelector('.active');\n if(activeTab) activeTab.focus();\n else {\n activeTab = categorylist.querySelector('.more-snippets');\n activeTab.focus();\n }\n }\n }\n if ((e.which === 9 && e.shiftKey)) { // shift + tab\n let first = false;\n if(e.target.previousElementSibling) {\n if(!e.target.previousElementSibling.classList.contains('active')) {\n first = true;\n }\n } else {\n first = true;\n }\n if(first) {\n e.preventDefault();\n let activeTab = categorylist.querySelector('.active');\n if(activeTab) activeTab.focus();\n else {\n activeTab = categorylist.querySelector('.more-snippets');\n activeTab.focus();\n }\n }\n }\n });\n\n }\n \n } \n }\n \n if (cat) {\n // Hide all, show items from selected category\n var categorylist_items = categorylist.querySelectorAll('a'); \n Array.prototype.forEach.call(categorylist_items, function(elm){\n elm.className = elm.className.replace('active', '');\n });\n categorymore.className = categorymore.className.replace('active', ''); \n var categorymore_items = categorymore.querySelectorAll('a');\n Array.prototype.forEach.call(categorymore_items, function(elm){\n elm.className = elm.className.replace('active', '');\n });\n \n var items = designlist.querySelectorAll('li');\n Array.prototype.forEach.call(items, function(elm){\n elm.style.display = 'none';\n elm.classList.remove('active');\n });\n Array.prototype.forEach.call(items, function(elm){\n var catSplit = elm.getAttribute('data-cat').split(',');\n for (var j = 0; j < catSplit.length; j++) {\n if (catSplit[j] == cat) {\n elm.style.display = ''; // TODO: hide & show snippets => animated\n elm.classList.add('active');\n }\n }\n });\n \n } else {\n // show dropdown\n var more = document.querySelector('.more-snippets');\n var moreCategories = document.querySelector('.is-more-categories');\n \n var _width = moreCategories.offsetWidth;\n more.classList.add('active');\n moreCategories.classList.add('active');\n var top = more.getBoundingClientRect().top;\n var left = more.getBoundingClientRect().left;\n top = top + 50;\n moreCategories.style.top = top + 'px';\n moreCategories.style.left = left + 'px';\n }\n elm.classList.add('active');\n \n };\n\n let tabs = document.querySelectorAll('.is-categories a');\n Array.prototype.forEach.call(tabs, (tab) => {\n \n tab.addEventListener('keydown', (e)=>{\n e.preventDefault();\n \n if ((e.which === 39 && e.target.nextElementSibling)) { // arrow right key pressed\n e.target.nextElementSibling.focus();\n } else if ((e.which === 37 && e.target.previousElementSibling)) { // arrow left key pressed\n e.target.previousElementSibling.focus();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n select(e.target);\n } else if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n \n let moreCategories = document.querySelector('.is-more-categories');\n if(moreCategories.classList.contains('active')) {\n \n // Redirect to dropdown list\n let firstItem;\n let activeItem;\n let moreCategories = document.querySelector('.is-more-categories');\n let items = moreCategories.querySelectorAll('a');\n items.forEach(item=>{\n let display = window.getComputedStyle(item).getPropertyValue('display');\n if(display==='block') {\n item.classList.add('show');\n if(item.classList.contains('active')) {\n activeItem=item;\n }\n } else {\n item.classList.remove('show');\n }\n });\n firstItem = moreCategories.querySelector('.show');\n if(activeItem) {\n activeItem.focus();\n } else {\n firstItem.focus();\n }\n return;\n\n }\n\n // Redirect to tab content\n let inputs = [];\n let controls = designlist.querySelectorAll('.active');\n controls.forEach(control=>{\n inputs.push(control);\n });\n \n if(inputs.length===0) return;\n \n let firstInput = inputs[0];\n \n firstInput.focus();\n } else if(e.which === 40 && e.target.classList.contains('more-snippets')) { // down\n \n // Redirect to dropdown list\n let firstItem;\n let activeItem;\n let moreCategories = document.querySelector('.is-more-categories');\n let items = moreCategories.querySelectorAll('a');\n items.forEach(item=>{\n let display = window.getComputedStyle(item).getPropertyValue('display');\n if(display==='block') {\n item.classList.add('show');\n if(item.classList.contains('active')) {\n activeItem=item;\n }\n } else {\n item.classList.remove('show');\n }\n });\n firstItem = moreCategories.querySelector('.show');\n if(activeItem) {\n activeItem.focus();\n } else {\n firstItem.focus();\n }\n\n } \n\n \n });\n \n tab.addEventListener('click', (e)=>{\n e.preventDefault();\n\n e.target.focus();\n \n select(e.target);\n });\n \n });\n\n let dropdownItems = document.querySelectorAll('.is-more-categories a');\n Array.prototype.forEach.call(dropdownItems, (item) => {\n\n item.addEventListener('keydown', (e)=>{\n e.preventDefault();\n if(e.keyCode === 38 && e.target.previousElementSibling && window.getComputedStyle(e.target.previousElementSibling).getPropertyValue('display')==='block') { // up\n e.target.previousElementSibling.focus();\n } else if(e.keyCode === 40 && e.target.nextElementSibling && window.getComputedStyle(e.target.nextElementSibling).getPropertyValue('display')==='block') { // down\n e.target.nextElementSibling.focus();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n select(e.target);\n } else if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n \n // Redirect to tab content\n let inputs = [];\n let controls = designlist.querySelectorAll('.active');\n controls.forEach(control=>{\n inputs.push(control);\n });\n \n if(inputs.length===0) return;\n \n let firstInput = inputs[0];\n \n firstInput.focus();\n } \n \n });\n \n item.addEventListener('click', (e)=>{\n e.preventDefault();\n\n e.target.focus();\n \n select(e.target);\n });\n });\n\n\n \n var snippets = data_basic.snippets; //DATA\n\n if (slider !== null){\n if(slider==='slick') {\n //remove glide\n const predicate = (item) => (item.type!=='glide');\n snippets = snippets.filter(predicate);\n } else if(slider==='glide') {\n //remove slick\n const predicate = (item) => (item.type!=='slick');\n snippets = snippets.filter(predicate);\n } else if(slider==='all') {\n // Do Nothing\n } else {\n // remove all slider (if incorrect settings)\n const predicate = (item) => (item.type!=='glide' && item.type!=='slick');\n snippets = snippets.filter(predicate);\n }\n\n // for (let i = 0; i < snippets.length; i++) {\n // console.log(snippets[i].type)\n // }\n\n } else {\n // Backward compatible OR if slider param not set\n\n // Hide slider snippet if slick is not included\n var bHideSliderSnippet = true;\n if(parent._cb.win.jQuery) {\n if(parent._cb.win.jQuery.fn.slick) {\n bHideSliderSnippet = false;\n }\n }\n if(bHideSliderSnippet){\n const result = snippets.filter((item)=>{\n return item.type !== 'slick';\n });\n snippets = [...result];\n } \n\n if(!(parent._cb.win.Glide)){\n const result = snippets.filter((item)=>{\n return !(item.glide || item.type === 'glide');\n });\n snippets = [...result];\n }\n\n // for (let i = 0; i < snippets.length; i++) {\n // console.log(snippets[i].type)\n // }\n\n }\n \n\n for (let i = 0; i <snippets.length; i++) {\n \n snippets[i].id = i+1;\n var thumb = snippets[i].thumbnail;\n \n thumb = snippetPath + thumb;\n \n if (snippets[i].category === defaultSnippetCategory + '') {\n designlist.insertAdjacentHTML('beforeend', '<li class="active" role="button" tabindex="0" data-id="' + snippets[i].id + '" data-cat="' + snippets[i].category + '"><img src="' + thumb + '"><span class="is-overlay"></span></li>');\n \n var newitem = designlist.querySelector('[data-id="' + snippets[i].id + '"]');\n newitem.addEventListener('click', function(e){\n \n var snippetid = e.target.parentNode.getAttribute('data-id');\n addSnippet(snippetid);\n \n });\n \n newitem.addEventListener('keydown', (e)=>{\n\n if ((e.which === 9 && !e.shiftKey)) { // tab\n let last = false;\n if(e.target.nextElementSibling) {\n if(!e.target.nextElementSibling.classList.contains('active')) {\n last = true;\n }\n } else {\n last = true;\n }\n if(last) {\n e.preventDefault();\n let activeTab = categorylist.querySelector('.active');\n if(activeTab) activeTab.focus();\n else {\n activeTab = categorylist.querySelector('.more-snippets');\n activeTab.focus();\n }\n }\n }\n if ((e.which === 9 && e.shiftKey)) { // shift + tab\n let first = false;\n if(e.target.previousElementSibling) {\n if(!e.target.previousElementSibling.classList.contains('active')) {\n first = true;\n }\n } else {\n first = true;\n }\n if(first) {\n e.preventDefault();\n let activeTab = categorylist.querySelector('.active');\n if(activeTab) activeTab.focus();\n else {\n activeTab = categorylist.querySelector('.more-snippets');\n activeTab.focus();\n }\n }\n }\n });\n\n }\n\n }\n \n\n\n\n /*\n elms = categorymore.querySelectorAll('a');\n Array.prototype.forEach.call(elms, function(elm){\n \n elm.addEventListener('click', function(e){\n \n var cat = elm.getAttribute('data-cat');\n if(designlist.querySelectorAll('[data-cat="' + cat + '"]').length === 0) {\n \n for (let i = 0; i <snippets.length; i++) {\n \n var thumb = snippets[i].thumbnail;\n \n thumb = snippetPath + thumb;\n \n if (snippets[i].category === cat) {\n \n designlist.insertAdjacentHTML('beforeend', '<li role="button" tabindex="0" data-id="' + snippets[i].id + '" data-cat="' + snippets[i].category + '"><img src="' + thumb + '"><span class="is-overlay"></span></li>');\n \n var newitem = designlist.querySelector('[data-id="' + snippets[i].id + '"]');\n newitem.addEventListener('click', function(e){\n \n var snippetid = e.target.parentNode.getAttribute('data-id');\n addSnippet(snippetid);\n \n });\n }\n \n } \n }\n \n // Hide all, show items from selected category\n Array.prototype.forEach.call(elms, function(elm){\n elm.className = elm.className.replace('active', '');\n });\n categorymore.className = categorymore.className.replace('active', ''); // hide popup\n //var categorymore_items = categorymore.querySelectorAll('a');\n \n var categorylist = document.querySelector('.is-category-list');\n var categorylist_items = categorylist.querySelectorAll('a'); \n Array.prototype.forEach.call(categorylist_items, function(elm){\n elm.className = elm.className.replace('active', '');\n });\n \n var more = document.querySelector('.more-snippets');\n more.className = more.className.replace('active', '');\n \n var items = designlist.querySelectorAll('div');\n Array.prototype.forEach.call(items, function(elm){\n elm.style.display = 'none';\n elm.classList.remove('active');\n });\n Array.prototype.forEach.call(items, function(elm){\n var catSplit = elm.getAttribute('data-cat').split(',');\n for (var j = 0; j < catSplit.length; j++) {\n if (catSplit[j] == cat) {\n elm.style.display = '';\n elm.classList.add('active');\n }\n }\n });\n \n elm.classList.add('active');\n \n e.preventDefault();\n });\n \n });\n */\n \n var close = document.querySelector('.is-pop-close');\n close.addEventListener('click', function(e){\n var modal = parent.document.querySelector('.is-modal.snippets');\n removeClass(modal, 'active');\n });\n \n // Add document Click event\n document.addEventListener('click', function(e){\n e = e || window.event;\n var target = e.target || e.srcElement; \n \n if(parentsHasClass(target, 'more-snippets')) return;\n if(hasClass(target, 'more-snippets')) return;\n \n var more = document.querySelector('.more-snippets');\n var moreCategories = document.querySelector('.is-more-categories');\n \n more.className = more.className.replace('active', '');\n moreCategories.className = moreCategories.className.replace('active', '');\n });\n \n parent.document.addEventListener('click', function(e){\n var more = document.querySelector('.more-snippets');\n var moreCategories = document.querySelector('.is-more-categories');\n \n more.className = more.className.replace('active', '');\n moreCategories.className = moreCategories.className.replace('active', '');\n });\n \n function addSnippet(snippetid) {\n \n // TODO: var framework = parent._cb.opts.framework;\n var snippetPathReplace = parent._cb.opts.snippetPathReplace;\n var emailMode = parent._cb.opts.emailMode;\n \n // \n for (let i = 0; i <snippets.length; i++) {\n if(snippets[i].id + ''=== snippetid) {\n \n var html = snippets[i].html;\n var noedit = snippets[i].noedit;\n break;\n }\n }\n \n var bSnippet;\n if (html.indexOf('"row') === -1) {\n bSnippet = true; // Just snippet (without row/column grid)\n } else {\n bSnippet = false; // Snippet is wrapped in row/colum\n }\n if (emailMode) bSnippet = false;\n\n if(bSnippet) {\n var quickadd = parent._cb.builderStuff.querySelector('.quickadd');\n var mode = quickadd.getAttribute('data-mode');\n if(!mode) {\n // in case of using viewSnippets() to open the dialog (mode=null) => change to non snippet.\n html = '<div class="row">' +\n '<div class="column full">' +\n html +\n '</div>' +\n '</div>';\n bSnippet=false;\n }\n }\n \n // Convert snippet into your defined 12 columns grid \n var rowClass = parent._cb.opts.row; //row\n var colClass = parent._cb.opts.cols; //['col s1', 'col s2', 'col s3', 'col s4', 'col s5', 'col s6', 'col s7', 'col s8', 'col s9', 'col s10', 'col s11', 'col s12']\n if(rowClass!=='' && colClass.length===12){\n\n //html = html.replace(new RegExp('row clearfix', 'g'), rowClass);\n html = html.replace(new RegExp('row clearfix', 'g'), 'row'); // backward\n html = html.replace(new RegExp('"row', 'g'), '"' + rowClass);\n \n html = html.replace(new RegExp('column full', 'g'), colClass[11]);\n html = html.replace(new RegExp('column half', 'g'), colClass[5]);\n html = html.replace(new RegExp('column third', 'g'), colClass[3]);\n html = html.replace(new RegExp('column fourth', 'g'), colClass[2]);\n html = html.replace(new RegExp('column fifth', 'g'), colClass[1]);\n html = html.replace(new RegExp('column sixth', 'g'), colClass[1]);\n html = html.replace(new RegExp('column two-third', 'g'), colClass[7]);\n html = html.replace(new RegExp('column two-fourth', 'g'), colClass[8]);\n html = html.replace(new RegExp('column two-fifth', 'g'), colClass[9]);\n html = html.replace(new RegExp('column two-sixth', 'g'), colClass[9]);\n }\n \n html = html.replace(/{id}/g, makeid()); // Replace {id} with auto generated id (for custom code snippet)\n \n if(parent._cb.opts.onAdd){\n html = parent._cb.opts.onAdd(html);\n }\n\n if(snippetPathReplace.length>0) {\n if (snippetPathReplace[0] != '') {\n var regex = new RegExp(snippetPathReplace[0], 'g');\n html = html.replace(regex, snippetPathReplace[1]);\n\n /* for encoded replace, change / to %2F */\n var slash = new RegExp('/', 'g');\n var snippetPathReplace_0 = snippetPathReplace[0].replace(slash, '%2F');\n var snippetPathReplace_1 = snippetPathReplace[1].replace(slash, '%2F');\n regex = new RegExp(snippetPathReplace_0, 'g');\n html = html.replace(regex, snippetPathReplace_1);\n }\n }\n \n parent._cb.addSnippet(html, bSnippet, noedit);\n \n var modal = parent.document.querySelector('.is-modal.snippets');\n removeClass(modal, 'active');\n \n }\n \n function hasClass(element, classname) {\n if(!element) return false;\n return element.classList ? element.classList.contains(classname) : new RegExp('\\b'+ classname+'\\b').test(element.className);\n }\n \n function removeClass(element, classname) {\n if(!element) return;\n if(element.classList.length>0) {\n element.className = element.className.replace(classname, '');\n }\n }\n \n function parentsHasClass(element, classname) {\n while (element) {\n if(element.tagName === 'BODY' || element.tagName === 'HTML') return false;\n if(!element.classList) return false;\n if (element.classList.contains(classname)) {\n return true;\n }\n element = element.parentNode;\n }\n }\n \n function makeid() {//http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript\n var text = "";\n var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";\n for (var i = 0; i < 2; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n \n var text2 = "";\n var possible2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";\n for (var i = 0; i < 5; i++)\n text2 += possible2.charAt(Math.floor(Math.random() * possible2.length));\n \n return text + text2;\n }\n \n <\/script>\n \n </textarea>\n </body>\n \n </html>\n `}}const e=e=>{const i=e.util,n=e.builderStuff,o=e.dom;let s=n.querySelector(".quickadd");if(!s){const l=`<div class="is-pop quickadd arrow-right" style="z-index:10003;" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-pop-close" style="display:none;z-index:1;width:40px;height:40px;position:absolute;top:0px;right:0px;box-sizing:border-box;padding:0;line-height:40px;font-size: 12px;color:#777;text-align:center;cursor:pointer;"><svg class="is-icon-flex" style="width:40px;height:40px;"><use xlink:href="#ion-ios-close-empty"></use></svg></div>\n <div class="is-pop-tabs">\n <div class="is-pop-tab-item" data-value="left">${i.out("Add to Left")}</div>\n <div class="is-pop-tab-item active" data-value="right">${i.out("Add to Right")}</div>\n </div>\n <div style="padding:12px;display:flex;flex-direction:row;flex-flow: wrap;justify-content: center;align-items: center;">\n <button title="${i.out("Paragraph")}" class="add-paragraph"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#icon-align-full"></use></svg></span>${i.out("Paragraph")}</button>\n <button title="${i.out("Headline")}" class="add-headline"><span style="font-family:serif;display:block;margin:0 0 8px;font-size:11px;">H</span>${i.out("Headline")}</button>\n <button title="${i.out("Image")}" class="add-image"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex ion-image" style="width:14px;height:14px;"><use xlink:href="#ion-image"></use></svg></span>${i.out("Image")}</button>\n <button title="${i.out("List")}" class="add-list"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#icon-list-bullet"></use></svg></span>${i.out("List")}</button>\n <button title="${i.out("Heading 1")}" class="add-heading1"><span style="font-family:serif;display:block;margin:0 0 8px;">H1</span>${i.out("Heading 1")}</button>\n <button title="${i.out("Heading 2")}" class="add-heading2"><span style="font-family:serif;display:block;margin:0 0 8px;">H2</span>${i.out("Heading 2")}</button>\n <button title="${i.out("Heading 3")}" class="add-heading3"><span style="font-family:serif;display:block;margin:0 0 8px;">H3</span>${i.out("Heading 3")}</button>\n <button title="${i.out("Heading 4")}" class="add-heading4"><span style="font-family:serif;display:block;margin:0 0 8px;">H4</span>${i.out("Heading 4")}</button>\n <button title="${i.out("Quote")}" class="add-quote"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-quote"></use></svg></span>${i.out("Quote")}</button>\n <button style="display:none" title="${i.out("Preformatted")}" class="add-preformatted"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-code"></use></svg></span>${i.out("Preformatted")}</button>\n ${e.opts.emailMode?"":`<button title="${i.out("Button")}" class="add-button"><span style="display:block;margin:0 0 8px;"><span style="display:inline-block;border:#a1a1a1 1px solid;background:#f3f3f3;width:10px;height:4px;"></span></span>${i.out("Button")}</button>`}\n ${e.opts.emailMode?"":`<button title="${i.out("Two Button")}" class="add-twobutton"><span style="display:block;margin:0 0 8px;"><span style="display:inline-block;border:#a1a1a1 1px solid;background:#f3f3f3;width:10px;height:4px;"></span></span>${i.out("Two Button")}</button>`}\n <button title="${i.out("Map")}" class="add-map"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-location"></use></svg></use></svg></svg></span>${i.out("Map")}</button>\n <button title="${i.out("Youtube")}" class="add-youtube"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-social-youtube-outline"></use></svg></use></svg></svg></span>${i.out("Youtube")}</button>\n <button title="${i.out("Video")}" class="add-video"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-ios-play"></use></svg></use></svg></svg></span>${i.out("Video")}</button>\n <button style="display:none" title="${i.out("Audio")}" class="add-audio"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-volume-medium"></use></svg></use></svg></svg></span>${i.out("Audio")}</button>\n <button title="${i.out("Icon")}" class="add-icon"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-android-happy"></use></svg></use></svg></svg></span>${i.out("Icon")}</button>\n <button title="${i.out("SVG")}" class="add-svg"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-5px"><use xlink:href="#icon-svg"></use></svg></use></svg></svg></span>${i.out("SVG")}</button>\n <button title="${i.out("Table")}" class="add-table"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:15px;height:15px;"><use xlink:href="#icon-table"></use></svg></use></svg></svg></span>${i.out("Table")}</button>\n <button title="${i.out("Social Links")}" class="add-social"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-social-twitter"></use></svg></use></svg></svg></span>${i.out("Social Links")}</button>\n <button title="${i.out("HTML/JS")}" class="add-code"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#icon-code"></use></svg></use></svg></svg></span>${i.out("HTML/JS")}</button>\n <button title="${i.out("Spacer")}" class="add-spacer"><span style="display:block;margin:0 0 8px;"><span style="display:inline-block;background:#eee;width:30px;height:5px;"></span></span>${i.out("Spacer")}</button>\n <button style="display:none" title="${i.out("Line")}" class="add-line"><span style="display:block;margin:0 0 8px;"><span style="display:inline-block;background:#ddd;width:30px;height:2px;"></span></span>${i.out("Line")}</button>\n <div class="pop-separator"></div>\n <button title="${i.out("More...")}" class="add-more" style="flex-direction:initial;">${i.out("More...")}</button>\n </div>\n </div>\n `;o.appendHtml(n,l),s=n.querySelector(".quickadd");let a=s.querySelectorAll(".is-pop-tab-item");Array.prototype.forEach.call(a,(t=>{o.addEventListener(t,"click",(t=>{let e=s.querySelectorAll(".is-pop-tab-item");Array.prototype.forEach.call(e,(t=>{o.removeClass(t,"active")})),o.addClass(t.target,"active"),"left"===s.querySelector(".active").getAttribute("data-value")?s.setAttribute("data-mode","cell-left"):s.setAttribute("data-mode","cell-right")}))}));let r=s.querySelector(".add-paragraph");o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent("<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. \n Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, \n when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>",t)})),r=s.querySelector(".add-headline"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<div class="display">\n <h1>Headline Goes Here</h1>\n <p>Lorem Ipsum is simply dummy text</p>\n </div>',t)})),r=s.querySelector(".add-image"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");let n=`<img src="${e.opts.snippetPath}example.png" alt="" />`;e.opts.snippetSampleImage&&(n=`<img src="${e.opts.snippetSampleImage}" alt="" />`),i.addContent(n,t)})),r=s.querySelector(".add-heading1"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent("<h1>Heading 1 here</h1>",t)})),r=s.querySelector(".add-heading2"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent("<h2>Heading 2 here</h2>",t)})),r=s.querySelector(".add-heading3"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent("<h3>Heading 3 here</h3>",t)})),r=s.querySelector(".add-heading4"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent("<h4>Heading 4 here</h4>",t)})),r=s.querySelector(".add-preformatted"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent("<pre>Lorem Ipsum is simply dummy text of the printing and typesetting industry. \n Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, \n when an unknown printer took a galley of type and scrambled it to make a type specimen book.</pre>",t)})),r=s.querySelector(".add-list"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<ul style="list-style: initial;padding-left: 20px;">\n <li>Lorem Ipsum is simply dummy text</li>\n <li>Lorem Ipsum is simply dummy text</li>\n </ul>',t)})),r=s.querySelector(".add-quote"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('\n <div class="text-left">\n <i class="icon ion-quote size-28"></i>\n </div>\n <p class="size-21 leading-14">It\'s easy to use, customizable, and user-friendly. A truly amazing features.</p>\n ',t)})),r=s.querySelector(".add-button"),r&&o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");let n='<div>\n <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-14 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Read More</a>\n </div>';e.opts.emailMode&&(n='<div><a href="#" role="button" style="margin-top: ;margin-right: ;margin-bottom: ;margin-left: ;display: inline-block; text-decoration: none; transition: all 0.16s ease 0s; border-style: solid; cursor: pointer; background-color: rgb(220, 220, 220); color: rgb(0, 0, 0); border-color: rgb(220, 220, 220); border-width: 2px; border-radius: 0px; padding: 13px 28px; line-height: 21px; text-transform: uppercase; font-weight: 400; font-size: 14px; letter-spacing: 3px;">Read More</a></div>'),i.addContent(n,t)})),r=s.querySelector(".add-twobutton"),r&&o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");let n='<div>\n <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-14 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Read More</a>\n <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-14 rounded tracking-wide">Get Started</a>\n </div>';e.opts.emailMode&&(n='<div>\n <a href="#" role="button" style="margin-top: ;margin-right: ;margin-bottom: ;margin-left: ;display: inline-block; text-decoration: none; transition: all 0.16s ease 0s; border-style: solid; cursor: pointer; background-color: rgb(220, 220, 220); color: rgb(0, 0, 0); border-color: rgb(220, 220, 220); border-width: 2px; border-radius: 0px; padding: 13px 28px; line-height: 21px; text-transform: uppercase; font-weight: 400; font-size: 14px; letter-spacing: 3px;">Read More</a> &nbsp;\n <a href="#" role="button" style="display: inline-block; text-decoration: none; transition: all 0.16s ease 0s; border-style: solid; cursor: pointer; background-color: rgba(0, 0, 0, 0); border-color: rgb(53, 53, 53); border-width: 2px; border-radius: 0px; padding: 13px 28px; line-height: 21px; text-transform: uppercase; font-weight: 600; font-size: 14px; letter-spacing: 3px; color: rgb(53, 53, 53);">Get Started</a>\n </div>'),i.addContent(n,t)})),r=s.querySelector(".add-spacer"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<div class="spacer height-80"></div>',t)})),r=s.querySelector(".add-line"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent("<hr>",t)})),r=s.querySelector(".add-code"),o.addEventListener(r,"click",(()=>{let t='<div class="row"><div class="column full" data-noedit data-html="'+encodeURIComponent("<h1 id=\"{id}\">Lorem ipsum</h1><p>This is a code block. You can edit this block using the source dialog.</p><script>var docReady = function (fn) {var stateCheck = setInterval(function () {if (document.readyState !== \"complete\") return;clearInterval(stateCheck);try{fn()}catch(e){}}, 1);};docReady(function() {document.querySelector('#{id}').innerHTML ='<b>Hello World..!</b>';});<\/script>")+'"></div></div>',n=e.opts.snippetPathReplace,o=e.opts.row,s=e.opts.cols;if(""!==o&&12===s.length&&(t=t.replace(new RegExp("row clearfix","g"),"row"),t=t.replace(new RegExp('"row',"g"),'"'+o),t=t.replace(new RegExp("column full","g"),s[11]),t=t.replace(new RegExp("column half","g"),s[5]),t=t.replace(new RegExp("column third","g"),s[3]),t=t.replace(new RegExp("column fourth","g"),s[2]),t=t.replace(new RegExp("column fifth","g"),s[1]),t=t.replace(new RegExp("column sixth","g"),s[1]),t=t.replace(new RegExp("column two-third","g"),s[7]),t=t.replace(new RegExp("column two-fourth","g"),s[8]),t=t.replace(new RegExp("column two-fifth","g"),s[9]),t=t.replace(new RegExp("column two-sixth","g"),s[9])),t=t.replace(/{id}/g,i.makeId()),e.opts.onAdd&&(t=e.opts.onAdd(t)),n.length>0&&""!==n[0]){let e=new RegExp(n[0],"g");t=t.replace(e,n[1])}e.addSnippet(t,!1,!0)})),r=s.querySelector(".add-table"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<table class="default" style="border-collapse:collapse;width:100%;">\n <thead>\n <tr>\n <td style="vertical-align:top;"><br></td>\n <td style="vertical-align:top;"><br></td>\n </tr>\n </thead>\n <tr>\n <td style="vertical-align:top;"><br></td>\n <td style="vertical-align:top;"><br></td>\n </tr>\n </table>',t)})),r=s.querySelector(".add-icon"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<div style="text-align: center;">\n <i class="icon ion-android-alarm-clock size-80"></i>\n </div>',t)})),r=s.querySelector(".add-svg"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<div style="text-align: center;">\n <svg viewBox="0 0 259.25 969.39" xmlns="http://www.w3.org/2000/svg" style="fill: rgb(100 177 45); width: 150px; height: 150px;">\n <g>\n <path d="M184,17.61S101.39,318.78,98.85,334,69.62,463.64,67.08,517s-16.52,141,19.06,202,86.41,110.56,151.21,75S320,675.85,320,675.85s16.52-179.17-58.45-414.26S184,17.61,184,17.61Z" transform="translate(-62.25 -17.61)"></path>\n <path d="M190.34,179l-7.63,319s-28-17.79-30.49-24.15-20.34-26.68-20.34-26.68,15.25,36.85,20.34,40.66,26.68,34.31,26.68,34.31l-1.27,181.72,1.27,274.47s11.44,17.79,14,2.54,3.81-305,3.81-305,34.31-78.79,41.94-95.3,12.7-39.4,12.7-39.4-45.74,87.68-50.83,94-6.35-231.28-6.35-231.28,11.44,6.36,22.87-33,7.63-52.1,7.63-52.1-14,45.74-20.33,55.91S190.34,179,190.34,179Z" transform="translate(-62.25 -17.61)" style="fill:#ededed"></path>\n </g>\n </svg>\n </div>',t)})),r=s.querySelector(".add-social"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<div class="is-social" style="text-align: center;">\n <a href="https://twitter.com/"><i class="icon ion-social-twitter" style="margin-right: 1em"></i></a>\n <a href="https://www.facebook.com/"><i class="icon ion-social-facebook" style="margin-right: 1em"></i></a>\n <a href="mailto:you@example.com"><i class="icon ion-android-drafts"></i></a>\n </div>',t)})),r=s.querySelector(".add-map"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<div class="embed-responsive embed-responsive-16by9">\n <iframe width="100%" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" class="mg1" src="https://maps.google.com/maps?q=Melbourne,+Victoria,+Australia&amp;hl=en&amp;sll=-7.981898,112.626504&amp;sspn=0.009084,0.016512&amp;oq=melbourne&amp;hnear=Melbourne+Victoria,+Australia&amp;t=m&amp;z=10&amp;output=embed"></iframe>\n </div>',t)})),r=s.querySelector(".add-youtube"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<div class="embed-responsive embed-responsive-16by9">\n <iframe width="560" height="315" src="https://www.youtube.com/embed/P5yHEKqx86U?rel=0" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>\n </div>',t)})),r=s.querySelector(".add-video"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");let n=`<video style="width: 100%;" loop="" autoplay="">\n <source src="${e.opts.snippetPath}example.mp4" type="video/mp4"></video>`;e.opts.snippetSampleVideo&&(n=`<video style="width: 100%;" loop="" autoplay="">\n <source src="${e.opts.snippetSampleVideo}" type="video/mp4"></video>`),i.addContent(n,t)})),r=s.querySelector(".add-audio"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");let n=`<div style="display:flex;width:100%;position:relative;margin:15px 0;background:transparent;">\n <audio controls="" style="width:100%">\n <source src="${e.opts.snippetPath}example.mp3" type="audio/mpeg">\n Your browser does not support the audio element.\n </audio>\n </div>`;e.opts.snippetSampleAudio&&(n=`<div style="display:flex;width:100%;position:relative;margin:15px 0;background:transparent;">\n <audio controls="" style="width:100%">\n <source src="${e.opts.snippetSampleAudio}" type="audio/mpeg">\n Your browser does not support the audio element.\n </audio>\n </div>`),i.addContent(n,t)}));const c=new t(e);r=s.querySelector(".add-more"),o.addEventListener(r,"click",(()=>{let t=n.querySelector(".snippets");i.showModal(t,!1,null,!1);const e=t.querySelector("iframe");""===e.contentWindow.document.body.innerHTML&&(e.srcdoc=c.getSnippetsHtml()),i.hidePop(s)}))}return s};class i{constructor(t){this.builder=t,this.dom=this.builder.dom}cellSelected(){return this.builder.doc.querySelector(".cell-active")}rowSelected(){return this.builder.doc.querySelector(".row-active")}builderStuff(){return document.querySelector("#_cbhtml")}cellNext(t){const e=this.dom;let i=t.nextElementSibling;return i?e.hasClass(i,"is-row-tool")||e.hasClass(i,"is-col-tool")||e.hasClass(i,"is-rowadd-tool")||e.hasClass(i,"is-row-overlay")?null:i:null}out(t){if(this.builder){let e=this.builder.opts.lang[t];return e||(this.builder.checkLang&&console.log(t),t)}return t}showMessage(t,e,i){const n=this.dom;let o="";o=`<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-top: 15px;padding-bottom: 20px;max-width: 450px;">\n <div style="margin: 20px 0 30px;font-size: 17px;">${t}</div>\n <button title="${this.out("Ok")}" class="input-ok classic">${this.out("Ok")}</button>\n </div>\n </div>`;const s=this.builder.builderStuff;let l=s.querySelector(".modalmessage");l||(n.appendHtml(s,o),l=s.querySelector(".modalmessage")),this.showModal(l,!1,(()=>{l.parentNode.removeChild(l),i&&i()}));let a=l.querySelector(".modalmessage .input-ok");n.addEventListener(a,"click",(()=>{this.hideModal(l),l.parentNode&&l.parentNode.removeChild(l),i&&i()})),a.focus(),e&&a.classList.add("focus-outline")}showChoice(t,e,i){const n=this.dom;let o="";o=`<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-top: 15px;padding-bottom: 20px;max-width: 450px;">\n <div style="margin: 20px 0 30px;font-size: 17px;">${t}</div>\n\n <div style="display:flex;">\n <button title="${this.out("Cancel")}" class="input-cancel classic-secondary" style="width:100%;margin-right:4px;">${this.out("Cancel")}</button>\n <button title="${e}" class="input-ok classic-primary" style="width:100%">${e}</button>\n </div>\n </div>\n </div>`;const s=this.builder.builderStuff;let l=s.querySelector(".modalmessage");l||(n.appendHtml(s,o),l=s.querySelector(".modalmessage")),this.showModal(l,!1,(()=>{l.parentNode.removeChild(l),i(!1)}));let a=l.querySelector(".modalmessage .input-cancel");n.addEventListener(a,"click",(()=>{this.hideModal(l),l.parentNode.removeChild(l),i(!1)})),a.focus();let r=l.querySelector(".modalmessage .input-ok");n.addEventListener(r,"click",(()=>{this.hideModal(l),l.parentNode.removeChild(l),i(!0)}))}confirm(t,e,i,n,o){if(!this.builder.deleteConfirm&&!o)return void e(!0);const s=this.dom;let l="";l=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Delete")}" class="input-ok classic focus-warning">${this.out("Delete")}</button>\n </div>\n </div>`,i&&(l=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Cancel")}" class="input-cancel classic-secondary">${this.out("Cancel")}</button>\n <button title="${n}" class="input-ok classic-primary">${n}</button>\n </div>\n </div>`);const a=this.builder.builderStuff;let r=a.querySelector(".is-confirm");r||(s.appendHtml(a,l),r=a.querySelector(".is-confirm")),this.showModal(r,!1,(()=>{r.parentNode.removeChild(r),e(!1)}),!0);let c=r.querySelector(".is-confirm .input-ok");s.addEventListener(c,"click",(()=>{this.hideModal(r),r.parentNode.removeChild(r),e(!0)}));let u=r.querySelector(".is-confirm .input-cancel");s.addEventListener(u,"click",(t=>{this.hideModal(r),r.parentNode.removeChild(r),e(!1),t.preventDefault(),t.stopImmediatePropagation()})),c&&c.focus()}showRtePop(t,e,i){const n=this.dom;t.style.display="flex",e&&e(),n.removeClass(t,"deactive"),n.addClass(t,"active");const o=e=>{"input"===document.activeElement.tagName.toLowerCase()&&t.contains(document.activeElement)||t.contains(e.target)||i.contains(e.target)||e.target.closest(".pickcolormore")||(this.hideRtePop(t),t.removeEventListener("keydown",s),document.removeEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",o))},s=e=>{27===e.keyCode&&(this.hideRtePop(t),t.removeEventListener("keydown",s),document.removeEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",o))};t.addEventListener("keydown",s),document.addEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.addEventListener("click",o)}hideRtePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),e.addClass(t,"deactive")}clearAllEventListener(t){for(let e=0;e<10;e++)t.removeEventListener("keydown",this.handlePopKeyDown),document.removeEventListener("click",this.handlePopClickOut),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",this.handlePopClickOut)}showPop(t,e,i){const n=this.dom;let o=document.querySelectorAll(".is-pop.active");Array.prototype.forEach.call(o,(e=>{e!==t&&(e.style.display="",n.removeClass(e,"active"),e.setAttribute("aria-hidden",!0))})),this.clearAllEventListener(t),t.style.display="flex",n.addClass(t,"active"),t.setAttribute("aria-hidden",!1),this.setupTabKeys(t),t.focus({preventScroll:!0}),this.handlePopClickOut=n=>{t.contains(n.target)||i.contains(n.target)||(this.hidePop(t),e&&e())},this.handlePopKeyDown=i=>{27===i.keyCode&&(this.hidePop(t),e&&e())},t.addEventListener("keydown",this.handlePopKeyDown),document.addEventListener("click",this.handlePopClickOut),this.builder.iframeDocument&&this.builder.doc.addEventListener("click",this.handlePopClickOut)}hidePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),t.setAttribute("aria-hidden",!0),this.clearAllEventListener(t)}setupTabKeys(t){let e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0],n=e[e.length-1];n.addEventListener("keydown",(n=>{9!==n.which||n.shiftKey||(n.preventDefault(),e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])'),i=e[0],i.focus())})),i.addEventListener("keydown",(t=>{9===t.which&&t.shiftKey&&(t.preventDefault(),n.focus())}));t.querySelectorAll("iframe").forEach((t=>{t.addEventListener("focus",(()=>{const e=t.contentWindow.document.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0];i&&i.focus()}))}))}showModal(t,e,i,n,o){const s=this.dom;s.addClass(t,"active"),t.setAttribute("aria-hidden",!1),o&&(document.body.style.overflow="hidden");const l=e=>{if(27===e.keyCode){o&&(document.body.style.overflow=""),s.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",l);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",u),i&&i()}};t.addEventListener("keydown",l);let a=t.querySelector(".is-tab-content.active");a?(a.focus(),this.builder.tabs.setupTabKey(a)):(this.setupTabKeys(t),t.focus());let r=!1;if(this.builder?this.builder.opts.animateModal&&(r=!0,n||(r=!1)):n&&(r=!0),r&&this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.style.transform=`scale(${this.builder.opts.zoom-.02})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom-.02})`,t.style.MozTransform=`scale(${this.builder.opts.zoom-.02})`,t.setAttribute("scaled-down","1")}))}const c=t.querySelector(".is-modal-overlay");if(c&&c.parentNode.removeChild(c),!t.querySelector(".is-modal-overlay")){let n;if(n=e?'<div class="is-modal-overlay overlay-stay"></div>':'<div class="is-modal-overlay"></div>',t.insertAdjacentHTML("afterbegin",n),!e){let e=t.querySelector(".is-modal-overlay");s.addEventListener(e,"click",(()=>{o&&(document.body.style.overflow=""),this.hideModal(t),t.removeEventListener("keydown",l);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",u),i&&i()}))}}const u=()=>{o&&(document.body.style.overflow=""),s.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",l);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",u),i&&i()},d=t.querySelector(".is-modal-close");d&&s.addEventListener(d,"click",u)}_hideModal(t){let e=t.querySelector(".is-modal-overlay");e?e.classList.contains("overlay-stay")?(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1}))):e.click():(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1})))}hideModal(t){if(t.setAttribute("aria-hidden",!0),this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.getAttribute("scaled-down")&&(t.style.transform=`scale(${this.builder.opts.zoom})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom})`,t.style.MozTransform=`scale(${this.builder.opts.zoom})`,t.removeAttribute("scaled-down"))}))}this.dom.removeClass(t,"active"),t.style.display=""}refreshModuleLayout(t){let e;t.style.height?e=t.style.height:t.style.height=`${t.offsetHeight}px`,t.style.opacity=0;let i=decodeURIComponent(t.getAttribute("data-html"));i=i.replace(/{id}/g,this.builder.util.makeId()),t.innerHTML="";let n=document.createRange();n.setStart(t,0),t.appendChild(n.createContextualFragment(i));let o=t.querySelectorAll("[data-subblock]");var s=1;Array.prototype.forEach.call(o,(e=>{t.getAttribute("data-html-"+s)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+s)),e.contentEditable=!0),s++})),setTimeout((()=>{t.style.height=e||"",t.style.opacity=""}),100)}removeColClasses(t){t.classList.remove("full"),t.classList.remove("two-third"),t.classList.remove("two-fourth"),t.classList.remove("two-fifth"),t.classList.remove("two-sixth"),t.classList.remove("half"),t.classList.remove("third"),t.classList.remove("fourth"),t.classList.remove("fifth"),t.classList.remove("sixth"),t.classList.remove("seventh"),t.classList.remove("eighth"),t.classList.remove("ninth"),t.classList.remove("tenth"),t.classList.remove("eleventh"),t.classList.remove("twelfth")}getAllColumns(t){let e=[];const i=this.dom;return i.elementChildren(t).forEach((t=>{i.hasClass(t,"is-row-tool")||i.hasClass(t,"is-col-tool")||i.hasClass(t,"is-rowadd-tool")||i.hasClass(t,"is-row-overlay")||e.push(t)})),e}fixLayout(t){const e=this.dom;let i=!1,n=!1;if(Array.from(t.children).map((e=>{e.classList.contains("is-row-tool")||e.classList.contains("is-col-tool")||e.classList.contains("is-rowadd-tool")||(e.getAttribute("data-html")?(e.style.width||(e.style.width="50%",e.style.flex="0 0 auto"),1===this.getAllColumns(t).length&&(e.style.width="",e.style.flex="")):(e.style.width="",e.style.flex=""),e.classList.contains("sm-hidden")&&(i=!0),e.classList.contains("md-hidden")&&(n=!0))})),i?t.classList.add("sm-autofit"):t.classList.remove("sm-autofit"),n?t.classList.add("md-autofit"):t.classList.remove("md-autofit"),this.builder.useDefaultGrid){return e.elementChildren(t).forEach((t=>{e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay")||this.removeColClasses(t)})),void Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}let o=3;t.querySelector(".is-row-overlay")&&(o=4);const s=t.childElementCount-o,l=this.builder.opts.row;let a=this.builder.opts.cols;const r=this.builder.opts.colequal;if(r.length>0){return e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){for(let i=0;i<=a.length-1;i++)e.removeClass(t,a[i]);for(let i=0;i<=r.length-1;i++)if(r[i].length===s){e.addClass(t,r[i][0]);break}1===s&&e.addClass(t,a[a.length-1])}})),void Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}if(""!==l&&a.length>0){let i=0;e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){-1!==t.className.indexOf("col-md-")||(-1!==t.className.indexOf("col-sm-")?a=["col-sm-1","col-sm-2","col-sm-3","col-sm-4","col-sm-5","col-sm-6","col-sm-7","col-sm-8","col-sm-9","col-sm-10","col-sm-11","col-sm-12"]:-1!==t.className.indexOf("col-xs-")?a=["col-xs-1","col-xs-2","col-xs-3","col-xs-4","col-xs-5","col-xs-6","col-xs-7","col-xs-8","col-xs-9","col-xs-10","col-xs-11","col-xs-12"]:-1!==t.className.indexOf("col-lg-")?a=["col-lg-1","col-lg-2","col-lg-3","col-lg-4","col-lg-5","col-lg-6","col-lg-7","col-lg-8","col-lg-9","col-lg-10","col-lg-11","col-lg-12"]:-1!==t.className.indexOf("col-xl-")?a=["col-xl-1","col-xl-2","col-xl-3","col-xl-4","col-xl-5","col-xl-6","col-xl-7","col-xl-8","col-xl-9","col-xl-10","col-xl-11","col-xl-12"]:-1!==t.className.indexOf("col-xxl-")&&(a=["col-xxl-1","col-xxl-2","col-xxl-3","col-xxl-4","col-xxl-5","col-xxl-6","col-xxl-7","col-xxl-8","col-xxl-9","col-xxl-10","col-xxl-11","col-xxl-12"])),i++;for(var n=0;n<=a.length-1;n++)e.removeClass(t,a[n]);1===s&&e.addClass(t,a[11]),2===s&&e.addClass(t,a[5]),3===s&&e.addClass(t,a[3]),4===s&&e.addClass(t,a[2]),5===s&&(5===i?e.addClass(t,a[3]):e.addClass(t,a[1])),6===s&&e.addClass(t,a[1]),7===s&&(i>=6?e.addClass(t,a[0]):e.addClass(t,a[1])),8===s&&(i>=5?e.addClass(t,a[0]):e.addClass(t,a[1])),9===s&&(i>=4?e.addClass(t,a[0]):e.addClass(t,a[1])),10===s&&(i>=3?e.addClass(t,a[0]):e.addClass(t,a[1])),11===s&&(i>=2?e.addClass(t,a[0]):e.addClass(t,a[1])),12===s&&e.addClass(t,a[0])}}))}Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}addContent(t,e,i){const n=this.dom;this.builder.opts.onAdd&&(t=this.builder.opts.onAdd(t));const o=this.cellSelected();let s;if(o)s=o.parentNode;else{let t=this.builder.activeElement;if(t&&t.closest(".is-block"));else{if(s=this.builder.doc.querySelector(".row-active"),!s)return;e="row"}}if("cell"===e||"cell-left"===e||"cell-right"===e){let l=4;this.builder.maxColumns&&(l=this.builder.maxColumns);let a,r=3;if(s.querySelector(".is-row-overlay")&&(r=4),s.childElementCount>=l+r)return alert(this.out("You have reached the maximum number of columns")),!1;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){let e=this.builder.opts.cellFormat,i=e.indexOf("</");t=e.substring(0,i)+t+e.substring(i),a=this.createElementFromHTML(t)}else{a=o.cloneNode(!0),a.removeAttribute("data-noedit"),a.removeAttribute("data-protected"),a.removeAttribute("data-module"),a.removeAttribute("data-module-desc"),a.removeAttribute("data-dialog-width"),a.removeAttribute("data-html"),a.removeAttribute("data-settings");for(let t=1;t<=20;t++)a.removeAttribute("data-html-"+t);a.removeAttribute("data-noedit"),n.removeClass(a,"cell-active"),n.removeClass(a,"is-light-text"),n.removeClass(a,"is-dark-text"),n.removeClass(a,"padding-0"),n.removeClass(a,"p-0"),a.removeAttribute("data-click"),a.removeAttribute("style"),i&&a.setAttribute(i,""),a.innerHTML=t}s.insertBefore(a,o),"cell"!==e&&"cell-right"!==e||n.moveAfter(a,o);let c=this.builder.doc.querySelector(".builder-active");c&&this.builder.applyBehaviorOn(c),this.fixLayout(s),a.click()}if("row"===e){let e,o;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){e=this.htmlToElement(this.builder.opts.rowFormat);let s=this.builder.opts.cellFormat,l=s.indexOf("</");t=s.substring(0,l)+t+s.substring(l);let a=n.elementChildren(e);for(;a.length>0&&(a=a[0],n.elementChildren(a).length>0);)a=n.elementChildren(a);a.innerHTML=t,o=a.firstChild,i&&o.setAttribute(i,"")}else o=n.createElement("div"),n.addClass(o,this.builder.opts.cols[this.builder.opts.cols.length-1]),o.innerHTML=t,i&&o.setAttribute(i,""),e=n.createElement("div"),n.addClass(e,this.builder.opts.row),n.appendChild(e,o);s.parentNode.insertBefore(e,s),n.moveAfter(e,s);let l=this.builder.doc.querySelector(".builder-active");l&&this.builder.applyBehaviorOn(l),o.click()}if("elm"===e){let e=this.builder.activeElement;if(!e)return;this.builder.uo.saveForUndo();let i=e;i.insertAdjacentHTML("afterend",t);let n=this.builder.doc.querySelector(".builder-active");n&&this.builder.applyBehaviorOn(n);let o=i.nextElementSibling;if("img"===o.tagName.toLowerCase()){let t=setInterval((()=>{o.complete&&(o.click(),clearInterval(t))}),30)}else o.click();let s=this.builder.builderStuff.querySelector(".quickadd");this.hidePop(s)}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}htmlToElement(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild}addSnippet(t,e,i){this.builder.uo.saveForUndo();const n=this.dom;let o,s,l,a=!1;let r,c=this.builder.builderStuff.querySelector(".quickadd");if(r=c?c.getAttribute("data-mode"):"row",!e||"cell"!==r&&"cell-left"!==r&&"cell-right"!==r){if(e&&"row"===r){let e;if(l=document.createElement("div"),l.className=this.builder.opts.cols[this.builder.opts.cols.length-1],l.innerHTML=t,i&&l.setAttribute("data-noedit",""),o=document.createElement("div"),o.className=this.builder.opts.row,o.appendChild(l),s=this.builder.cellSelected(),s?e=s.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(a=!0)),a){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],o=n.elementChildren(i);e=o[o.length-1]}e.parentNode.insertBefore(o,e),n.moveAfter(o,e);let r=this.builder.doc.querySelector(".builder-active");r||(r=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(r),l.click(),o.className=o.className.replace("row-outline",""),this.builder.util.hideColumnTool()}else{if(e)return void(i?this.addContent(t,r,"data-noedit"):this.addContent(t,r));{var u=document.createElement("div");u.innerHTML=t;var d=u.querySelectorAll("[data-html]");if(Array.prototype.forEach.call(d,(e=>{t=(t=(t=decodeURIComponent(e.getAttribute("data-html"))).replace(/{id}/g,this.makeId())).replace(/<script>/g,""+(this.builder.nonce?`<script nonce="${this.builder.nonce}">`:"<script>"));for(var i=1;i<=20;i++)t=t.replace("[%HTML"+i+"%]",void 0===e.getAttribute("data-html-"+i)?"":decodeURIComponent(e.getAttribute("data-html-"+i)));e.innerHTML=t})),1===u.childNodes.length&&1===u.childNodes[0].childNodes.length&&("cell"===r||"cell-left"===r||"cell-right"===r)){const t=this.cellSelected();let e=t.parentNode,i=4;if(this.builder.maxColumns&&(i=this.builder.maxColumns),e.querySelector(".is-row-overlay")){if(e.childElementCount>=i+4)return alert(this.out("You have reached the maximum number of columns")),!1}else if(e.childElementCount>=i+3)return alert(this.out("You have reached the maximum number of columns")),!1;this.builder.uo.saveForUndo();let n=u.childNodes[0].childNodes[0];var b=document.createRange();t.parentNode.insertBefore(b.createContextualFragment(n.outerHTML),t),"cell"!==r&&"cell-right"!==r||(t.parentNode.insertBefore(t.previousElementSibling,t),t.parentNode.insertBefore(t,t.previousElementSibling));let o=this.builder.doc.querySelector(".builder-active");return o||(o=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(o),this.fixLayout(e),"cell"===r||"cell-right"===r?t.nextElementSibling.click():t.previousElementSibling.click(),this.builder.opts.onChange(),void this.builder.opts.onRender()}let e;if(s=this.builder.activeCol,s?e=s.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(a=!0)),a){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],o=n.elementChildren(i);e=o[o.length-1]}b=document.createRange(),e.parentNode.insertBefore(b.createContextualFragment(u.innerHTML),e.nextSibling),o=u.childNodes[0],o=e.nextElementSibling;let i=this.builder.doc.querySelector(".builder-active");i||(i=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(i),l=o.querySelector("div"),l&&l.click(),o.className=o.className.replace("row-outline",""),this.builder.util.hideColumnTool()}}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}else i?this.addContent(t,r,"data-noedit"):this.addContent(t,r)}clearActiveCell(){if(!this.builder.builderStuff)return;let t=this.builder.doc.getElementsByClassName("cell-active");for(;t.length;)t[0].classList.remove("cell-active");for(t=this.builder.doc.getElementsByClassName("row-outline");t.length;)t[0].classList.remove("row-outline");for(t=this.builder.doc.getElementsByClassName("row-active");t.length;)t[0].classList.remove("row-active");for(t=this.builder.doc.getElementsByClassName("builder-active");t.length;)t[0].classList.remove("builder-active");this.builder.activeCol=null,this.builder.dom.removeClass(this.builder.doc.body,"content-edit")}clearAfterUndoRedo(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const n=document.querySelector(".moveable-control-box");if(n&&(n.style.display="none"),this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null,this.builder.doc.querySelectorAll(".icon-active").forEach((t=>t.classList.remove("icon-active"))),this.builder.activeIcon=null,!this.builder.controlPanel){let i=e.querySelector(".is-rte-tool").querySelectorAll("button");Array.prototype.forEach.call(i,(e=>{t.removeClass(e,"on")})),i=e.querySelector(".is-elementrte-tool").querySelectorAll("button"),Array.prototype.forEach.call(i,(e=>{t.removeClass(e,"on")}))}let o=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(o,(t=>{t.style.display=""}))}hidePops(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}));let n=e.querySelectorAll(".is-pop.active");Array.prototype.forEach.call(n,(e=>{e.style.transition="all 200ms ease",setTimeout((()=>{e.style.opacity="0"}),10),setTimeout((()=>{e.style.display="",t.removeClass(e,"active"),e.style.opacity="",e.style.transition=""}),200)}));const o=document.querySelector(".moveable-control-box"),s=document.querySelector("#divImageResizer");o&&s&&!s.getAttribute("data-resizing")&&(o.style.display="none")}hideControls(){const t=this.dom;let e=this.builder.builderStuff.querySelectorAll(".is-tool");Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(e=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const i=document.querySelector(".moveable-control-box");i&&(i.style.display="none")}clearActiveElement(t){const e=this.dom,i=this.builder.builderStuff;this.builder.doc.querySelectorAll(".icon-active").forEach((t=>t.classList.remove("icon-active"))),this.builder.activeIcon=null;let n=this.builder.doc.querySelectorAll(".elm-inspected");Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"elm-inspected")})),this.builder.inspectedElement=null,n=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"elm-active")})),this.builder.activeElement=null,this.builder.doc.querySelector(".is-element-tool").style.display="";let o=this.builder.doc.querySelector("#divLinkTool");if(o&&(o.style.display=""),t&&!this.builder.controlPanel){let t=i.querySelector(".is-rte-tool");t&&(t.style.display="none");let e=i.querySelector(".is-elementrte-tool");e&&(e.style.display="flex");let n=i.querySelector(".rte-more-options");n&&(n.style.display="");let o=i.querySelector(".elementrte-more-options");o&&(o.style.display="");let s=e.querySelectorAll("button[data-align]");Array.prototype.forEach.call(s,(t=>{t.style.display="none"})),this.builder.rte.positionToolbar()}}clearPops(){const t=this.dom,e=this.builder.builderStuff;if(!e)return;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const n=document.querySelector(".moveable-control-box");n&&(n.style.display="none");let o=this.builder.doc.querySelectorAll(".ovl");Array.prototype.forEach.call(o,(t=>{t.style.display="block"}));let s=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(s,(e=>{e.style.display="",t.removeClass(e,"active"),e.setAttribute("aria-hidden",!0)})),this.builder.colTool.lockIndicator.style.display="",this.builder.resize&&this.builder.resize.destroy()}clearControls(){const t=this.dom,e=this.builder.builderStuff;if(!e)return;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const n=document.querySelector(".moveable-control-box");n&&(n.style.display="none"),this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null,this.builder.activeImage=null,this.builder.doc.querySelectorAll(".icon-active").forEach((t=>t.classList.remove("icon-active"))),this.builder.activeIcon=null;let o=this.builder.doc.querySelectorAll(".ovl");Array.prototype.forEach.call(o,(t=>{t.style.display="block"}));var s=e.querySelectorAll(".is-side.elementstyles");Array.prototype.forEach.call(s,(e=>{t.removeClass(e,"active")}));let l=this.builder.doc.querySelectorAll("[data-saveforundo]");if(Array.prototype.forEach.call(l,(t=>{t.removeAttribute("data-saveforundo")})),l=this.builder.doc.querySelectorAll(".elm-inspected"),Array.prototype.forEach.call(l,(e=>{t.removeClass(e,"elm-inspected")})),!this.builder.controlPanel&&"auto"===this.builder.toolbarDisplay){let t=e.querySelector(".is-rte-tool");t&&(t.style.display="none");let i=e.querySelector(".is-elementrte-tool");i&&(i.style.display="none");let n=e.querySelector(".rte-more-options");n&&(n.style.display="");let o=e.querySelector(".elementrte-more-options");o&&(o.style.display="")}if(l=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(l,(e=>{t.removeClass(e,"elm-active")})),!this.builder.controlPanel){let i=e.querySelectorAll(".is-rte-pop");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active"),t.removeClass(e,"deactive")}))}let a=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(a,(e=>{e.style.display="",t.removeClass(e,"active"),e.setAttribute("aria-hidden",!0)})),this.builder.colTool.lockIndicator.style.display="",this.builder.resize&&this.builder.resize.destroy()}makeId(){let t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<2;i++)t+=e.charAt(Math.floor(Math.random()*e.length));let i="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let t=0;t<5;t++)i+=n.charAt(Math.floor(Math.random()*n.length));return t+i}getSelection(){if(this.builder.dom.getSelectedBlocks().length>0)this.builder.selectionMulti=!0;else{this.builder.selectionMulti=!1;const t=this.builder.win.getSelection(),e=this.builder.dom.getElm();if(!e)return;if(e&&e.innerText===t.toString().trim()||""===t.toString().trim()){this.builder.selectionElm=e;let t=e.closest("a");this.builder.activeLink=t||null}else this.builder.selectionText=t,this.builder.activeLink=null}}saveSelection(){if(this.builder.win.getSelection){let t=this.builder.win.getSelection();if(t.getRangeAt&&t.rangeCount){let e=[];for(let i=0,n=t.rangeCount;i<n;++i)e.push(t.getRangeAt(i));return this.builder.selection=e,e}}else if(this.builder.doc.selection&&this.builder.doc.selection.createRange)return this.builder.selection=this.builder.doc.selection.createRange(),this.builder.doc.selection.createRange();return this.builder.selection=null,null}restoreSelection(){let t=this.builder.selection;if(t)if(this.builder.win.getSelection){let o=this.builder.win.getSelection();if(this.builder.doc.body.createTextRange){var e=this.builder.doc.body.createTextRange();e.collapse(),e.select()}else this.builder.win.getSelection?this.builder.win.getSelection().empty?this.builder.win.getSelection().empty():this.builder.win.getSelection().removeAllRanges&&this.builder.win.getSelection().removeAllRanges():this.builder.doc.selection&&this.builder.doc.selection.empty();for(var i=0,n=t.length;i<n;++i)o.addRange(t[i])}else this.builder.doc.selection&&t.select&&t.select()}cleanHTML(t,e){let i,n=t.replace(/(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g," "),o=new RegExp("\x3c!--(.*?)--\x3e","g");n=n.replace(o,""),i=e?new RegExp("<(/)*(meta|link|span|\\?xml:|st1:|o:|font)(.*?)>","gi"):new RegExp("<(/)*(meta|link|\\?xml:|st1:|o:|font)(.*?)>","gi"),n=n.replace(i,"");let s,l=["style","script","applet","embed","noframes","noscript"];for(let t=0;t<l.length;t++)i=new RegExp("<"+l[t]+".*?"+l[t]+"(.*?)>","gi"),n=n.replace(i,"");s=e?["style","start"]:["start"];for(let t=0;t<s.length;t++){let e=new RegExp(" "+s[t]+'="(.*?)"',"gi");n=n.replace(e,"")}return n=n.replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s/>]))[^>]*>/gi,""),n=n.replace(/<(\/?)s>/gi,"<$1strike>"),n=n.replace(/&nbsp;/gi," "),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\);/gi,""),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\)/gi,""),n}checkEmpty(){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{this.checkEmptyOn(t)}))}checkEmptyOn(t){const i=this.dom,n=i.elementChildren(t);let o=!0;if(n.forEach((t=>{i.hasClass(t,"row-add-initial")||i.hasClass(t,"dummy-space")||"link"!==t.tagName.toLowerCase()&&(o=!1)})),o){let n=t.querySelector(".row-add-initial");n||(t.innerHTML=`<button type="button" class="row-add-initial">${this.out("Empty")}<br><span class="block">${this.out("+ Click to add content")}</span></div>`,n=t.querySelector(".row-add-initial")),n.addEventListener("click",(()=>{this.clearActiveCell();const o=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(o,(t=>{i.removeClass(t,"builder-active")})),i.addClass(t,"builder-active"),i.addClass(n,"row-active");const s=e(this.builder);s.querySelector(".is-pop-tabs").style.display="none";const l=window.innerHeight,a=this.getElementPosition(n);let r=a.top,c=a.left,u=a.scaleX,d=a.scaleY;c+=n.offsetWidth*(u*this.builder.opts.zoom)/2-11,r-=n.offsetHeight-n.offsetHeight*d,s.style.display="flex",this.showPop(s,!1,n);const b=s.offsetWidth,h=s.offsetHeight;l-r>h?(r=r+n.offsetHeight*this.builder.opts.zoom-19,s.style.top=r+window.pageYOffset+27+"px",s.style.left=c-b/2+7+"px",i.removeClass(s,"arrow-bottom"),i.removeClass(s,"arrow-right"),i.removeClass(s,"arrow-left"),i.removeClass(s,"center"),i.addClass(s,"arrow-top"),i.addClass(s,"center")):(s.style.top=r+window.pageYOffset-h-8+"px",s.style.left=c-b/2+7+"px",i.removeClass(s,"arrow-top"),i.removeClass(s,"arrow-right"),i.removeClass(s,"arrow-left"),i.removeClass(s,"center"),i.addClass(s,"arrow-bottom"),i.addClass(s,"center")),s.setAttribute("data-mode","row")}))}else{let e=t.querySelector(".row-add-initial");e&&e.parentNode.removeChild(e)}}clearPreferences(){localStorage.removeItem("_theme"),localStorage.removeItem("_zoom"),localStorage.removeItem("_buildermode"),localStorage.removeItem("_editingtoolbar"),localStorage.removeItem("_editingtoolbardisplay"),localStorage.removeItem("_hidecelltool"),localStorage.removeItem("_rowtool"),localStorage.removeItem("_hideelementtool"),localStorage.removeItem("_hidesnippetaddtool"),localStorage.removeItem("_outlinemode"),localStorage.removeItem("_hiderowcoloutline"),localStorage.removeItem("_outlinestyle"),localStorage.removeItem("_hideelementhighlight"),localStorage.removeItem("_opensnippets"),localStorage.removeItem("_toolstyle"),localStorage.removeItem("_snippetssidebardisplay"),localStorage.removeItem("_htmlview"),localStorage.removeItem("_pasteresult"),localStorage.removeItem("_livepreview"),localStorage.removeItem("_dictation"),localStorage.removeItem("_mic"),localStorage.removeItem("_autosendcommand"),localStorage.removeItem("_disclaimershown"),localStorage.removeItem("_temp"),localStorage.removeItem("_top_p"),localStorage.removeItem("_autosend_delay"),localStorage.removeItem("_auto_editblock"),localStorage.removeItem("_command_lang"),localStorage.removeItem("_ai_panel_open"),localStorage.removeItem("_scrollableeditor"),localStorage.removeItem("_animatedsorting"),localStorage.removeItem("_addbuttonplace"),localStorage.removeItem("_hiderowtool"),localStorage.removeItem("_dragwithouthandle"),localStorage.removeItem("_advancedhtmleditor"),localStorage.removeItem("_hidecolhtmleditor"),localStorage.removeItem("_hiderowhtmleditor"),localStorage.removeItem("_sampleshown")}pasteHtmlAtCaret(t,e){var i,n;if(this.restoreSelection(),this.builder.dom.getElm().closest(".is-container"))if(this.builder.win.getSelection){if(!this.builder.activeCol)return;if((i=this.builder.win.getSelection()).getRangeAt&&i.rangeCount){(n=i.getRangeAt(0)).deleteContents();var o=this.builder.doc.createElement("div");o.innerHTML=t;for(var s,l,a=this.builder.doc.createDocumentFragment();s=o.firstChild;)l=a.appendChild(s);var r=a.firstChild;n.insertNode(a),l&&((n=n.cloneRange()).setStartAfter(l),e?n.setStartBefore(r):n.collapse(!0),i.removeAllRanges(),this.builder.isTouchSupport||i.addRange(n))}}else if((i=this.builder.doc.selection)&&"Control"!==i.type){if(!this.builder.activeCol)return;var c=i.createRange();c.collapse(!0),i.createRange().pasteHTML(t),e&&((n=i.createRange()).setEndPoint("StartToStart",c),this.builder.isTouchSupport||n.select())}}refreshModule(){let t=this.builder.activeModule;if(!t)return;let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}));let n=decodeURIComponent(t.getAttribute("data-html"));n=n.replace(/{id}/g,this.makeId()),t.innerHTML="";var o=document.createRange();o.setStart(t,0),t.appendChild(o.createContextualFragment(n)),i=t.querySelectorAll("[data-subblock]");var s=1;Array.prototype.forEach.call(i,(e=>{t.getAttribute("data-html-"+s)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+s))),s++})),this.repositionColumnTool(!0),this.builder.onRefreshTool&&this.builder.onRefreshTool()}repositionColumnTool(){let t=this.builder.activeCol;if(!t)return;let e=t.parentNode;if(t.parentNode||(e=this.rowSelected()),this.colTool=e.querySelector(".is-col-tool"),!this.colTool)return;t.parentNode||(this.colTool.style.display="none"),this.colTool.style.left=t.offsetLeft+"px";const i=this.builder.builderStuff.querySelector(".columnmore.active");if(i){const t=this.colTool.querySelector(".cell-more");i.classList.add("transition1"),setTimeout((()=>{const e=this.getElementPosition(t);let n=e.top,o=e.left;i.style.top=n+35+"px",i.style.left=o-7+"px",setTimeout((()=>{i.classList.remove("transition1")}),300)}),30)}}hideColumnTool(){this.builder.doc.querySelectorAll(".is-col-tool").forEach((t=>{t.style.display="none"}))}isTouchSupport(){return!!window.matchMedia("(pointer: coarse)").matches}detectIE(){return!!document.documentMode}LightenDarkenColor(t,e){var i=!1;"#"===t[0]&&(t=t.slice(1),i=!0);var n=parseInt(t,16),o=(n>>16)+e;o>255?o=255:o<0&&(o=0);var s=(n>>8&255)+e;s>255?s=255:s<0&&(s=0);var l=(255&n)+e;return l>255?l=255:l<0&&(l=0),(i?"#":"")+String("000000"+(l|s<<8|o<<16).toString(16)).slice(-6)}getUIStyles(){this.dom.appendHtml(this.builder.builderStuff,'\n <input type="text" class="style-helper-input" id="__style_helper_input" style="display:none;">\n <button class="style-helper-button-classic classic" style="display:none;"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <select class="style-helper-select" id="__style_helper_select" style="display:none;"><option value=""></option></select>\n\n <div class="style-helper modal-color"></div>\n <div class="style-helper modal-background"></div>\n <div class="style-helper button-pickcolor-border"></div>\n <div class="style-helper button-pickcolor-background"></div>\n\n <button class="style-helper base"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <div class="style-helper base on"></div>\n <div class="style-helper base hover"></div>\n\n <div class="style-helper snippet-color"></div>\n <div class="style-helper snippet-background"></div>\n <div class="style-helper snippet-tabs-background"></div>\n <div class="style-helper snippet-tab-item-background"></div>\n <div class="style-helper snippet-tab-item-background-active"></div>\n <div class="style-helper snippet-tab-item-background-hover"></div>\n <div class="style-helper snippet-tab-item-color"></div>\n\n <div class="style-helper snippet-more-item-background"></div>\n <div class="style-helper snippet-more-item-background-active"></div>\n <div class="style-helper snippet-more-item-background-hover"></div>\n <div class="style-helper snippet-more-item-color"></div>\n\n <div class="style-helper tabs-background"></div>\n <div class="style-helper tab-item-active-border-bottom"></div>\n <div class="style-helper tab-item-color"></div>\n <div class="style-helper tabs-more-background"></div>\n <div class="style-helper tabs-more-border"></div>\n <div class="style-helper tabs-more-item-color"></div>\n <div class="style-helper tabs-more-item-background-hover"></div>\n <div class="style-helper separator-color"></div>\n <div class="style-helper outline-color"></div>\n ');const t=(t,e)=>{const i=this.builder.builderStuff.querySelector(".style-helper"+t);return window.getComputedStyle(i,null).getPropertyValue(e)},e=this.builder.builderStuff.querySelector(".style-helper-input"),i=this.builder.builderStuff.querySelector(".style-helper-select"),n=this.builder.builderStuff.querySelector(".style-helper-button-classic");this.builder.styleModalColor=t(".modal-color","background-color"),this.builder.styleModalBackground=t(".modal-background","background-color"),this.builder.styleButtonPickColorBorder=t(".button-pickcolor-border","border"),this.builder.styleButtonPickColorBackground=t(".button-pickcolor-background","background-color"),this.builder.styleToolBackground=t(".base","background-color"),this.builder.styleButtonColor=t(".base","color"),this.builder.styleButtonSvgFill=(()=>{const t=this.builder.builderStuff.querySelector(".style-helper.base");return window.getComputedStyle(t.querySelector("svg"),null).getPropertyValue("fill")})(),this.builder.styleButtonBackgroundHover=t(".base.hover","background-color"),this.builder.styleSnippetColor=t(".snippet-color","background-color"),this.builder.styleSnippetBackground=t(".snippet-background","background-color"),this.builder.styleSnippetTabsBackground=t(".snippet-tabs-background","background-color"),this.builder.styleSnippetTabItemBackground=t(".snippet-tab-item-background","background-color"),this.builder.styleSnippetTabItemBackgroundActive=t(".snippet-tab-item-background-active","background-color"),this.builder.styleSnippetTabItemBackgroundHover=t(".snippet-tab-item-background-hover","background-color"),this.builder.styleSnippetTabItemColor=t(".snippet-tab-item-color","background-color"),this.builder.styleSnippetMoreItemBackground=t(".snippet-more-item-background","background-color"),this.builder.styleSnippetMoreItemBackgroundActive=t(".snippet-more-item-background-active","background-color"),this.builder.styleSnippetMoreItemBackgroundHover=t(".snippet-more-item-background-hover","background-color"),this.builder.styleSnippetMoreItemColor=t(".snippet-more-item-color","background-color"),this.builder.styleTabsBackground=t(".tabs-background","background-color"),this.builder.styleTabItemBorderBottomActive=t(".tab-item-active-border-bottom","border"),this.builder.styleTabItemColor=t(".tab-item-color","background-color"),this.builder.styleTabsMoreBackground=t(".tabs-more-background","background-color"),this.builder.styleTabsMoreBorder=t(".tabs-more-border","border"),this.builder.styleTabsMoreItemColor=t(".tabs-more-item-color","background-color"),this.builder.styleTabsMoreBackgroundHover=t(".tabs-more-item-background-hover","background-color"),this.builder.styleSeparatorColor=t(".separator-color","background-color"),this.builder.styleOutlineColor=t(".outline-color","background-color"),this.builder.styleSelectBackground=window.getComputedStyle(i,null).getPropertyValue("background-color"),this.builder.styleSelectColor=window.getComputedStyle(i,null).getPropertyValue("color"),this.builder.styleSelectOptionBackground=window.getComputedStyle(i.querySelector("option"),null).getPropertyValue("background-color"),this.builder.styleInputBackground=window.getComputedStyle(e,null).getPropertyValue("background-color"),this.builder.styleInputBorderBottom=window.getComputedStyle(e,null).getPropertyValue("border-bottom"),this.builder.styleInputColor=window.getComputedStyle(e,null).getPropertyValue("color"),this.builder.styleButtonClassicBackground=window.getComputedStyle(n,null).getPropertyValue("background-color"),this.builder.styleButtonClassicColor=window.getComputedStyle(n,null).getPropertyValue("color"),this.builder.styleButtonClassicBackgroundHover=this.getUIStyleValue(n,"hover","background-color"),this.builder.styleDark=!1,this.builder.styleColored=!1,this.builder.styleColoredDark=!1,this.builder.styleLight=!1,document.body.getAttribute("class")&&(-1!==document.body.getAttribute("class").indexOf("colored-dark")?this.builder.styleColoredDark=!0:-1!==document.body.getAttribute("class").indexOf("dark")?this.builder.styleDark=!0:-1!==document.body.getAttribute("class").indexOf("colored")?this.builder.styleColored=!0:-1!==document.body.getAttribute("class").indexOf("light")&&(this.builder.styleLight=!0))}getUIStyleValue(t,e,i){const n=this.dom;n.addClass(t,e);let o=window.getComputedStyle(t,null).getPropertyValue(i);return n.removeClass(t,e),o}getPageTemplate(t){let e="";return e=""===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"tailwind"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content-tailwind.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <link rel="stylesheet" href="[%PATH%]/assets/frameworks/tailwindcss/styles.css">\n \x3c!-- To build your own, please see: https://tailwindcss.com/docs/installation --\x3e\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"bootstrap"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n\n <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {margin: 140px auto; max-width: 800px; width:100%; padding:0 35px; box-sizing: border-box;}\n /* Bootstrap css adjustment to enable column drag to resize */\n .row > *,\n .column {\n max-width: unset !important;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"foundation"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation.min.css">\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation-float.min.css">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"[%CONTENT%]",e}getElementPosition(t){const e=this.builder.iframe;let i,n,o,s;if(this.builder.iframe){let l=document.querySelector(".is-content-view");l||(l=e.parentNode);const a=window.getComputedStyle(l).transform;if("none"!==a){const t=a.match(/matrix\(([0-9., -]+)\)/)[1].split(",");o=parseFloat(t[0]),s=parseFloat(t[3])}else o=1,s=1;const r=e.getBoundingClientRect();i=t.getBoundingClientRect().top*s+r.top,n=t.getBoundingClientRect().left*o+r.left}else i=t.getBoundingClientRect().top,n=t.getBoundingClientRect().left,o=1,s=1;return{top:i,left:n,scaleX:o,scaleY:s}}}class n{constructor(t){this.builder=t}getScale(t){let e=window.getComputedStyle(t).transform;if("none"===e)return 1;let i=e.split("(")[1];i=i.split(")")[0],i=i.split(",");let n=i[0],o=i[1];return Math.sqrt(n*n+o*o)}createElement(t){return document.createElement(t)}appendChild(t,e){t&&t.appendChild(e)}appendHtml(t,e){t&&t.insertAdjacentHTML("beforeend",e)}addEventListener(t,e,i){t&&t.addEventListener(e,i)}addClass(t,e){t&&(this.hasClass(t,e)||(0===t.classList.length?t.className=e:t.className=t.className+" "+e,t.className=t.className.replace(/ +/g," ")))}removeClass(t,e){if(t&&t.classList.length>0){let i,n,o,s,l=e.split(" ");for(i=0,o=l.length;i<o;++i){if(!l[i])continue;let e=l[i],o="",a=t.className.split(" ");for(n=0,s=a.length;n<s;++n)a[n]&&a[n]!==e&&(o+=a[n]+" ");t.className=o.trim()}""===t.className&&t.removeAttribute("class")}}removeClassesByPrefix(t,e){t.classList&&t.classList.forEach((i=>{0===i.indexOf(e)&&this.removeClass(t,i)}))}hasClass(t,e){return!!t&&(!!t.className&&(" "+t.className+" ").indexOf(" "+e+" ")>-1)}moveAfter(t,e){e.parentNode.insertBefore(t,e),e.parentNode.insertBefore(e,e.previousElementSibling)}elementChildren(t){const e=t.childNodes;let i=[],n=e.length;for(;n--;)1===e[n].nodeType&&i.unshift(e[n]);return i}getElementOffset(t){const e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset,left:e.left+window.pageXOffset,width:e.width,height:e.height}}parentsHasClass(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(this.hasClass(t,e))return!0;t=t.parentNode}}parentsHasId(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.id===e)return!0;t=t.parentNode}}parentsHasTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return!0;t=t.parentNode}}parentsHasAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return!0}catch(t){}t=t.parentNode}}getParentByTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return t;t=t.parentNode}}getParentByAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return t}catch(t){}t=t.parentNode}}parentsHasElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return!0}}getParentElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return t}}removeClasses(t,e){for(let i=0;i<t.length;i++)t[i].classList.remove(e)}removeAttributes(t,e){for(let i=0;i<t.length;i++)t[i].removeAttribute(e)}removeElements(t){Array.prototype.forEach.call(t,(t=>{t.parentNode.removeChild(t)}))}moveCursorToElement(t){var e,i;window.getSelection&&this.builder.doc.createRange?((i=this.builder.doc.createRange()).selectNodeContents(t),i.collapse(!1),(e=window.getSelection()).removeAllRanges(),e.addRange(i)):this.builder.doc.body.createTextRange&&((i=this.builder.doc.body.createTextRange()).moveToElementText(t),i.collapse(!1),i.select())}selectElementContents(t){var e=this.builder.doc.createRange();e.selectNodeContents(t);var i=this.builder.win.getSelection();i.removeAllRanges(),i.addRange(e)}getSelected(){if(this.builder.win.getSelection)return this.builder.win.getSelection().toString();if(this.builder.doc.getSelection)return this.builder.doc.getSelection().toString();var t=this.builder.doc.selection&&this.builder.doc.selection.createRange();return!!t.text&&t.text}checkEditable(){try{var t,e;return this.builder.win.getSelection?t=3===(e=this.builder.win.getSelection().getRangeAt(0).commonAncestorContainer).nodeType?e.parentNode:e:this.builder.doc.selection&&(e=this.builder.doc.selection.createRange(),t=this.builder.doc.selection.createRange().parentElement()),!!this.parentsHasAttribute(t,"contenteditable")}catch(t){return!1}}textSelection(){const t=this.getSelection().anchorNode;if(!t)return!1;return t.nodeType!==Node.TEXT_NODE&&t.nodeType!==Node.COMMENT_NODE?t:t.parentElement}getStyle(t,e){return window.getComputedStyle?window.getComputedStyle(t,null).getPropertyValue(e):t.style[e.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))]}observeElement(t,e,i,n=0){let o=Object.getPrototypeOf(t);if(Object.prototype.hasOwnProperty.call(o,e)){let s=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,{get:function(){return s.get.apply(this,arguments)},set:function(){let t=this[e];s.set.apply(this,arguments);let o=this[e];"function"==typeof i&&setTimeout(i.bind(this,t,o),n)}})}}baseName(t){if("string"==typeof t){var e=t.split(".");return e.splice(0,e.length-1).join(".")}}doFunction(t,e,i){if(e(t),i){let i=Array.prototype.slice.call(t.getElementsByTagName("*"));for(var n=0;n<i.length;n++)e(i[n])}}execCommand(t,e,i){const n=this.getSelectedBlocks();if(n.length>0)n.forEach((t=>{i(!0,t)}));else{const n=this.builder.win.getSelection(),o=this.getElm();if(!o)return void(i&&i(!1));let s;s=o&&o.innerText===n.toString().trim()||""===n.toString().trim()?this.updateSelection(t,e,o):this.replaceSelection(t,e,n,o),i&&i(!0,s)}}updateSelection(t,e,i){return i.style[t]=this.getStyleValue(i,t,e),this.checkStyleIfSameAsParent(i,t),this.cleanChildren(t,i),this.cleanUnusedSpan(i),i}replaceSelection(t,e,i,n){const o=i.getRangeAt(0),s=o.extractContents(),l=this.createSpan(n,t,e);return l.appendChild(s),this.cleanChildren(t,l),this.cleanUnusedSpan(l),o.insertNode(l),i.selectAllChildren(l),this.checkStyleIfSameAsParent(l,t),l}checkStyleIfSameAsParent(t,e){if(t.parentNode&&(t.parentNode.style[e]===t.style[e]||window.getComputedStyle(t.parentNode,null).getPropertyValue(e)===t.style[e])){t.style[e]="",""!==t.getAttribute("style")&&null!==t.style||t.removeAttribute("style");let i=0===t.attributes.length||1===t.attributes.length&&t.hasAttribute("data-keep");if("span"===t.nodeName.toLowerCase()&&i){const e=document.createTextNode(t.textContent);t.parentElement.replaceChild(e,t)}}}createSpan(t,e,i){const n=document.createElement("span");return n.style[e]=this.getStyleValue(t,e,i),n}findParentStyle(t,e){if("HTML"===t.nodeName.toUpperCase()||"BODY"===t.nodeName.toUpperCase())return null;if(!t.parentNode)return null;if(null!==t.style[e]&&void 0!==t.style[e]&&""!==t.style[e])return t;this.findParentStyle(t.parentNode,e)}getStyleValue(t,e,i){if("font-weight"===e||"font-style"===e||"text-decoration"===e||"text-transform"===e){let n,o=this.findParentStyle(t,e);if(o&&(n=o.style[e]),i===n){t.style[e]="";let o=window.getComputedStyle(t,null).getPropertyValue(e);t.style[e]=n,i=o}}return i}getParentBlock(t){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if("inline"!==this.getStyle(t,"display"))return t;t=t.parentNode}}execCommandClass(t,e,i=!0,n){const o=this.getSelectedBlocks();if(o.length>0)o.forEach((i=>{for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i)}));else{const o=this.builder.win.getSelection();let s=this.getElm();if(!s)return;const l=s&&s.innerText===o.toString().trim();(i||l||""===o.toString().trim())&&("block"===n&&"inline"===this.getStyle(s,"display")&&(s=this.getParentBlock(s)),this.updateSelectionClass(t,e,s))}}updateSelectionClass(t,e,i){for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}return""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i),i}cleanChildrenClass(t,e){if(!t.hasChildNodes())return;Array.from(t.children).map((t=>{for(let i=0;i<Object.keys(e).length;i++){let n=Object.values(e)[i];this.removeClass(t,n)}}));const i=Array.from(t.children).map((t=>this.cleanChildrenClass(t,e)));i&&i.length}getSelectedBlocks(){let t=!1,e=this.builder.win.getSelection(),i=[];if(!e.isCollapsed){let t=e.getRangeAt(0),n=t.commonAncestorContainer;const o=e=>{if(e.nodeType===Node.ELEMENT_NODE&&t.intersectsNode(e)&&i.push(e),e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)o(e.childNodes[t])};o(n),i.length>0&&i[0]===n&&i.shift()}let n=[];const o=["p","h1","h2","h3","h4","h5","h6","div","pre","td","th","li"];return i.forEach((e=>{const i=e.tagName.toLowerCase();o.includes(i)&&(t=!0,n.push(e))})),2===n.length&&n[0].innerText.trim()===e.toString().trim()&&n.pop(),t?n:[]}execCommandToggle(t,e,i){const n=this.getSelectedBlocks();if(n.length>0)n.forEach((n=>{if("fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t||this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t||this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)&&(t="uppercase"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n)}));else{const n=this.builder.win.getSelection(),o=this.getElm();if(!o)return;o&&o.innerText===n.toString().trim()||""===n.toString().trim()?this.updateSelectionToggle(t,e,i,o):this.replaceSelectionToggle(t,e,i,n,o)}}getElm(){const t=this.builder.win.getSelection();if(!t)return!1;const e=t.anchorNode;if(!e)return!1;return e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement}updateSelectionToggle(t,e,i,n){if("fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0);parseInt(window.getComputedStyle(n,null).getPropertyValue("font-weight"))>=500&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t?this.addClass(n,i.fontWeight.defaultNormal):this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t?this.addClass(n,i.fontStyle.normal):this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)&&(t="uppercase"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}return this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n),n}replaceSelectionToggle(t,e,i,n,o){const s=n.getRangeAt(0),l=s.extractContents(),a=document.createElement("span");if("fontWeight"===t){let t=!1;o.closest(`.${i.fontWeight.defaultBold}`)&&(t=!0,this.hasClass(o,i.fontWeight.defaultNormal)&&(t=!1));parseInt(window.getComputedStyle(o,null).getPropertyValue("font-weight"))>=500&&(t=!0),t?this.addClass(a,i.fontWeight.defaultNormal):this.addClass(a,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;o.closest(`.${i.fontStyle.italic}`)&&(t=!0,this.hasClass(o,i.fontStyle.normal)&&(t=!1)),t?this.addClass(a,i.fontStyle.normal):this.addClass(a,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;o.closest(`.${i.textDecoration.underline}`)&&(t=!0),t||this.addClass(a,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;o.closest(`.${i.textDecoration.linethrough}`)&&(t=!0),t||this.addClass(a,i.textDecoration.linethrough)}if("textTransform"===t){let t="";o.closest(`.${i.textTransform.uppercase}`)&&(t="uppercase"),this.removeClass(a,i.textTransform.uppercase),this.removeClass(a,i.textTransform.lowercase),this.removeClass(a,i.textTransform.capitalize),this.removeClass(a,i.textTransform.normal),""===t&&this.addClass(a,i.textTransform.uppercase)}if("extend"===t){let t=!1;o.closest(`.${i.extend[e]}`)&&(t=!0),t||this.addClass(a,i.extend[e])}return a.appendChild(l),this.cleanChildrenToggle(t,e,a,i),this.cleanUnusedSpan(a),s.insertNode(a),n.selectAllChildren(a),a}cleanChildrenToggle(t,e,i,n){if(!i.hasChildNodes())return;"fontWeight"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontWeight.thin),this.removeClass(t,n.fontWeight.extralight),this.removeClass(t,n.fontWeight.light),this.removeClass(t,n.fontWeight.normal),this.removeClass(t,n.fontWeight.medium),this.removeClass(t,n.fontWeight.semibold),this.removeClass(t,n.fontWeight.bold),this.removeClass(t,n.fontWeight.extrabold),this.removeClass(t,n.fontWeight.black)})),"fontStyle"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontStyle.italic),this.removeClass(t,n.fontStyle.normal)})),"textUnderline"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textLinethrough"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textTransform"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textTransform.uppercase),this.removeClass(t,n.textTransform.lowercase),this.removeClass(t,n.textTransform.capitalize),this.removeClass(t,n.textTransform.normal)})),"clean"===t&&Array.from(i.children).map((t=>{t.className="",t.style.cssText=""})),"extend"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.extend[e])}));const o=Array.from(i.children).map((i=>this.cleanChildrenToggle(t,e,i,n)));o&&o.length}getSelection(){return this.builder.win&&this.builder.win.getSelection?this.builder.win.getSelection():this.builder.doc&&this.builder.doc.getSelection?this.builder.doc.getSelection():this.builder.doc&&this.builder.doc.selection?this.builder.doc.selection.createRange().text:null}cleanChildren(t,e){if(!e.hasChildNodes())return;const i=Array.from(e.children).filter((e=>void 0!==e.style[t]&&""!==e.style[t.style]));i&&i.length>0&&i.forEach((e=>{e.style[t]="",""!==e.getAttribute("style")&&null!==e.style||e.removeAttribute("style")}));const n=Array.from(e.children).map((e=>this.cleanChildren(t,e)));n&&n.length}addCssClass(t,e,i){this.removeCssClasses(t,i),this.addClass(t,e)}removeCssClasses(t,e){for(let i=0;i<Object.keys(e).length;i++){const n=Object.values(e)[i];this.removeClass(t,n)}}removeEmptyStyle(t){if(!t.hasChildNodes())return;const e=Array.from(t.children).filter((t=>t.getAttribute("style")));e&&e.length>0&&e.forEach((t=>{""!==t.getAttribute("style").trim()&&null!==t.style||t.removeAttribute("style")}));const i=Array.from(t.children).map((t=>this.removeEmptyStyle(t)));i&&i.length}cleanClassSize(t,e){if(!t.hasChildNodes())return;const i=Array.from(t.children).filter((t=>this.hasClass(t,e)));i&&i.length>0&&i.forEach((t=>{this.removeClass(t,e)}));const n=Array.from(t.children).map((t=>this.cleanClassSize(t,e)));n&&n.length}removeFormat(){const t=this.getSelection();if(!t)return;const e=t.anchorNode;if(!e)return;const i=e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement;i&&i.innerText===t.toString().trim()||""===t.toString().trim()?this.cleanElement(i):this.cleanSelection(t)}cleanElement(t){t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)})),t.querySelectorAll("*").forEach((t=>{t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)}))})),this.cleanUnusedSpan(t)}cleanSelection(t){const e=t.getRangeAt(0),i=e.extractContents(),n=document.createElement("span");n.appendChild(i),e.insertNode(n),t.selectAllChildren(n),this.cleanElement(n)}cleanUnusedSpan(t){let e=t.querySelectorAll("span");const i=Array.prototype.filter;let n=i.call(e,(t=>0===t.attributes.length));n&&n.length>0&&n.forEach((t=>{t.outerHTML=t.innerHTML})),e=t.querySelectorAll("span"),i.call(e,(t=>{""===t.innerHTML&&t.parentNode.removeChild(t)})),e=t.querySelectorAll("span"),n=i.call(e,(t=>0===t.attributes.length)),n&&n.length>0&&this.cleanUnusedSpan(t)}contentReformat(t,e){this.replaceTag(t,"b",e.fontWeight.defaultBold),this.replaceTag(t,"i",e.fontStyle.italic),this.replaceTag(t,"u",e.textDecoration.underline),this.replaceTag(t,"strike",e.textDecoration.linethrough),this.replaceInline(t,"font-weight","normal",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","bold",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","600",e.fontWeight.semibold),this.replaceInline(t,"text-align","left",e.textAlign.left),this.replaceInline(t,"text-align","right",e.textAlign.right),this.replaceInline(t,"text-align","center",e.textAlign.center),this.replaceInline(t,"text-align","justify",e.textAlign.justify),this.replaceInline(t,"display","flex",e.display.flex),this.replaceInline(t,"justiify-content","flex-start",e.justifyContent.start),this.replaceInline(t,"justiify-content","flex-end",e.justifyContent.end),this.replaceInline(t,"justiify-content","center",e.justifyContent.center),this.replaceInline(t,"justiify-content","space-between",e.justifyContent.between),this.replaceInline(t,"flex-direction","column",e.flexDirection.column),this.replaceInline(t,"flex-direction","row",e.flexDirection.row),this.replaceInline(t,"align-items","flex-start",e.alignItems.start),this.replaceInline(t,"align-items","flex-end",e.alignItems.end),this.replaceInline(t,"align-items","center",e.alignItems.center),this.replaceInline(t,"text-transform","uppercase",e.textTransform.uppercase),this.replaceInline(t,"text-transform","lowercase",e.textTransform.lowercase),this.replaceInline(t,"text-transform","none",e.textTransform.normal),this.replaceInline(t,"line-height","1",e.leading.leading_10),this.replaceInline(t,"line-height","1.1",e.leading.leading_11),this.replaceInline(t,"line-height","1.2",e.leading.leading_12),this.replaceInline(t,"line-height","1.25",e.leading.leading_125),this.replaceInline(t,"line-height","1.3",e.leading.leading_13),this.replaceInline(t,"line-height","1.375",e.leading.leading_1375),this.replaceInline(t,"line-height","1.4",e.leading.leading_14),this.replaceInline(t,"line-height","1.5",e.leading.leading_15),this.replaceInline(t,"line-height","1.6",e.leading.leading_16),this.replaceInline(t,"line-height","1.625",e.leading.leading_1625),this.replaceInline(t,"line-height","1.7",e.leading.leading_17),this.replaceInline(t,"line-height","1.8",e.leading.leading_18),this.replaceInline(t,"line-height","1.9",e.leading.leading_19),this.replaceInline(t,"line-height","2",e.leading.leading_20),this.replaceInline(t,"line-height","2.1",e.leading.leading_21),this.replaceInline(t,"line-height","2.2",e.leading.leading_22)}replaceTag(t,e,i){let n=t.querySelectorAll(e);let o=Array.prototype.filter.call(n,(t=>0===t.attributes.length));o&&o.length>0&&o.forEach((t=>{const e=document.createElement("span");e.setAttribute("class",i),e.innerHTML=t.innerHTML,t.outerHTML=e.outerHTML}))}replaceInline(t,e,i,n){t.querySelectorAll("*").forEach((t=>{"justiify-content"===e?t.style.justifyContent===`${i}`&&(this.addClass(t,n),t.style.justifyContent=""):t.style[e]===`${i}`&&(this.addClass(t,n),t.style[e]="")}))}}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s={exports:{}},l={},a={exports:{}},r={},c={};function u(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function d(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function b(t,e){this.__indent_cache=new d(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new u(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.clone_empty=function(){var t=new u(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},u.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},u.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},u.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},u.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},u.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},u.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},u.prototype.is_empty=function(){return 0===this.__items.length},u.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},u.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},u.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},u.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},u.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},u.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},u.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},d.prototype.get_indent_size=function(t,e){var i=this.__base_string_length;return e=e||0,t<0&&(i=0),i+=t*this.__indent_size,i+=e},d.prototype.get_indent_string=function(t,e){var i=this.__base_string;return e=e||0,t<0&&(t=0,i=""),e+=t*this.__indent_size,this.__ensure_cache(e),i+=this.__cache[e]},d.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},d.prototype.__add_column=function(){var t=this.__cache.length,e=0,i="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,i=new Array(e+1).join(this.__indent_string)),t&&(i+=new Array(t+1).join(" ")),this.__cache.push(i)},b.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},b.prototype.get_line_number=function(){return this.__lines.length},b.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},b.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},b.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},b.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},b.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join("\n");return"\n"!==t&&(i=i.replace(/[\n]/g,t)),i},b.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},b.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},b.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},b.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},b.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},b.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},b.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},b.prototype.just_added_newline=function(){return this.current_line.is_empty()},b.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},b.prototype.ensure_empty_line_above=function(t,e){for(var i=this.__lines.length-2;i>=0;){var n=this.__lines[i];if(n.is_empty())break;if(0!==n.item(0).indexOf(t)&&n.item(-1)!==e){this.__lines.splice(i+1,0,new u(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},c.Output=b;var h={};h.Token=function(t,e,i,n){this.type=t,this.text=e,this.comments_before=null,this.newlines=i||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null};var p,m,g,f,v,y,x={};v="(?:\\\\u[0-9a-fA-F]{4}|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(g="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc")+"])",y="(?:\\\\u[0-9a-fA-F]{4}|["+(m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a")+g+(f="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f")+"])*",(p=x).identifier=new RegExp(v+y,"g"),p.identifierStart=new RegExp(v),p.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+g+f+"])+"),p.newline=/[\n\r\u2028\u2029]/,p.lineBreak=new RegExp("\r\n|"+p.newline.source),p.allLineBreaks=new RegExp(p.lineBreak.source,"g");var w={},S={};function k(t,e){this.raw_options=_(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function _(t,e){var i,n={};for(i in t=C(t))i!==e&&(n[i]=t[i]);if(e&&t[e])for(i in t[e])n[i]=t[e][i];return n}function C(t){var e,i={};for(e in t){i[e.replace(/-/g,"_")]=t[e]}return i}k.prototype._get_array=function(t,e){var i=this.raw_options[t],n=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(n=i.concat()):"string"==typeof i&&(n=i.split(/[^a-zA-Z0-9_\/\-]+/)),n},k.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},k.prototype._get_characters=function(t,e){var i=this.raw_options[t],n=e||"";return"string"==typeof i&&(n=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),n},k.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var n=parseInt(i,10);return isNaN(n)&&(n=e),n},k.prototype._get_selection=function(t,e,i){var n=this._get_selection_list(t,e,i);if(1!==n.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n[0]},k.prototype._get_selection_list=function(t,e,i){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(i=i||[e[0]],!this._is_valid_selection(i,e))throw new Error("Invalid Default Value!");var n=this._get_array(t,i);if(!this._is_valid_selection(n,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n},k.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},S.Options=k,S.normalizeOpts=C,S.mergeOpts=_;var E=S.Options,L=["before-newline","after-newline","preserve-newline"];function A(t){E.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var n=0;n<i.length;n++)"preserve-inline"===i[n]?this.brace_preserve_inline=!0:this.brace_style=i[n];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",L),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}A.prototype=new E,w.Options=A;var q={},T={},M=RegExp.prototype.hasOwnProperty("sticky");function O(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}O.prototype.restart=function(){this.__position=0},O.prototype.back=function(){this.__position>0&&(this.__position-=1)},O.prototype.hasNext=function(){return this.__position<this.__input_length},O.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},O.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},O.prototype.__match=function(t,e){t.lastIndex=e;var i=t.exec(this.__input);return!i||M&&t.sticky||i.index!==e&&(i=null),i},O.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},O.prototype.testChar=function(t,e){var i=this.peek(e);return t.lastIndex=0,null!==i&&t.test(i)},O.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},O.prototype.read=function(t,e,i){var n,o="";return t&&(n=this.match(t))&&(o+=n[0]),!e||!n&&t||(o+=this.readUntil(e,i)),o},O.prototype.readUntil=function(t,e){var i,n=this.__position;t.lastIndex=this.__position;var o=t.exec(this.__input);return o?(n=o.index,e&&(n+=o[0].length)):n=this.__input_length,i=this.__input.substring(this.__position,n),this.__position=n,i},O.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},O.prototype.get_regexp=function(t,e){var i=null,n="g";return e&&M&&(n="y"),"string"==typeof t&&""!==t?i=new RegExp(t,n):t&&(i=new RegExp(t.source,n)),i},O.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},O.prototype.peekUntilAfter=function(t){var e=this.__position,i=this.readUntilAfter(t);return this.__position=e,i},O.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},T.InputScanner=O;var R={},I={};function z(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}z.prototype.restart=function(){this.__position=0},z.prototype.isEmpty=function(){return 0===this.__tokens_length},z.prototype.hasNext=function(){return this.__position<this.__tokens_length},z.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},z.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},z.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},I.TokenStream=z;var B={},N={};function D(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}D.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},D.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},D.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},D.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},N.Pattern=D;var P=N.Pattern;function $(t,e){P.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}$.prototype=new P,$.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},$.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},$.prototype.matching=function(t,e){var i=this._create();return i.__set_whitespace_patterns(t,e),i._update(),i},$.prototype._create=function(){return new $(this._input,this)},$.prototype.__split=function(t,e){t.lastIndex=0;for(var i=0,n=[],o=t.exec(e);o;)n.push(e.substring(i,o.index)),i=o.index+o[0].length,o=t.exec(e);return i<e.length?n.push(e.substring(i,e.length)):n.push(""),n},B.WhitespacePattern=$;var H=T.InputScanner,F=h.Token,j=I.TokenStream,U=B.WhitespacePattern,W={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},G=function(t,e){this._input=new H(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new U(this._input)};G.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new j,this._reset();for(var e=new F(W.START,""),i=null,n=[],o=new j;e.type!==W.EOF;){for(t=this._get_next_token(e,i);this._is_comment(t);)o.add(t),t=this._get_next_token(e,i);o.isEmpty()||(t.comments_before=o,o=new j),t.parent=i,this._is_opening(t)?(n.push(i),i=t):i&&this._is_closing(t,i)&&(t.opened=i,i.closed=t,i=n.pop(),t.parent=i),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},G.prototype._is_first_token=function(){return this.__tokens.isEmpty()},G.prototype._reset=function(){},G.prototype._get_next_token=function(t,e){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(W.RAW,i):this._create_token(W.EOF,"")},G.prototype._is_comment=function(t){return!1},G.prototype._is_opening=function(t){return!1},G.prototype._is_closing=function(t,e){return!1},G.prototype._create_token=function(t,e){return new F(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},G.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},R.Tokenizer=G,R.TOKEN=W;var V={};function Y(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}Y.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},Y.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},V.Directives=Y;var X={},Z=N.Pattern,K={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function Q(t,e){Z.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},K),this._excluded=Object.assign({},K),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var i=new Z(t);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}Q.prototype=new Z,Q.prototype._create=function(){return new Q(this._input,this)},Q.prototype._update=function(){this.__set_templated_pattern()},Q.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},Q.prototype.read_options=function(t){var e=this._create();for(var i in K)e._disabled[i]=-1===t.templating.indexOf(i);return e._update(),e},Q.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},Q.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},Q.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},Q.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var i=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==i||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==i||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=(t=(t=t||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=(t=t||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=(t=(t=t||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return t},X.TemplatablePattern=Q;var J=T.InputScanner,tt=R.Tokenizer,et=R.TOKEN,it=V.Directives,nt=x,ot=N.Pattern,st=X.TemplatablePattern;function lt(t,e){return-1!==e.indexOf(t)}var at={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:et.START,RAW:et.RAW,EOF:et.EOF},rt=new it(/\/\*/,/\*\//),ct=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,ut=/[0-9]/,dt=/[^\d\.]/,bt=">>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),ht=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";ht=(ht="\\?\\.(?!\\d) "+(ht=ht.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var pt,mt=new RegExp(ht),gt="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),ft=gt.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),vt=new RegExp("^(?:"+ft.join("|")+")$"),yt=function(t,e){tt.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var i=new ot(this._input),n=new st(this._input).read_options(this._options);this.__patterns={template:n,identifier:n.starting_with(nt.identifier).matching(nt.identifierMatch),number:i.matching(ct),punct:i.matching(mt),comment:i.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:i.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:i.matching(/<!--/),html_comment_end:i.matching(/-->/),include:i.starting_with(/#include/).until_after(nt.lineBreak),shebang:i.starting_with(/#!/).until_after(nt.lineBreak),xml:i.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:n.until(/['\\\n\r\u2028\u2029]/),double_quote:n.until(/["\\\n\r\u2028\u2029]/),template_text:n.until(/[`\\$]/),template_expression:n.until(/[`}\\]/)}};(yt.prototype=new tt)._is_comment=function(t){return t.type===at.COMMENT||t.type===at.BLOCK_COMMENT||t.type===at.UNKNOWN},yt.prototype._is_opening=function(t){return t.type===at.START_BLOCK||t.type===at.START_EXPR},yt.prototype._is_closing=function(t,e){return(t.type===at.END_BLOCK||t.type===at.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},yt.prototype._reset=function(){pt=!1},yt.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(at.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_non_javascript(n))||this._read_string(n))||this._read_word(t))||this._read_singles(n))||this._read_comment(n))||this._read_regexp(n,t))||this._read_xml(n,t))||this._read_punctuation())||this._create_token(at.UNKNOWN,this._input.next())},yt.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(nt.allLineBreaks,"\n"),t.type!==at.DOT&&(t.type!==at.RESERVED||"set"!==t.text&&"get"!==t.text)&&vt.test(e)?"in"===e||"of"===e?this._create_token(at.OPERATOR,e):this._create_token(at.RESERVED,e):this._create_token(at.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(at.WORD,e):void 0},yt.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(at.START_EXPR,t):")"===t||"]"===t?e=this._create_token(at.END_EXPR,t):"{"===t?e=this._create_token(at.START_BLOCK,t):"}"===t?e=this._create_token(at.END_BLOCK,t):";"===t?e=this._create_token(at.SEMICOLON,t):"."===t&&dt.test(this._input.peek(1))?e=this._create_token(at.DOT,t):","===t&&(e=this._create_token(at.COMMA,t)),e&&this._input.next(),e},yt.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(at.EQUALS,t):"?."===t?this._create_token(at.DOT,t):this._create_token(at.OPERATOR,t)},yt.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read()))return this._create_token(at.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read())return this._create_token(at.UNKNOWN,e.trim()+"\n");t=this._input.next();var i="#";if(this._input.hasNext()&&this._input.testChar(ut)){do{i+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(i+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(i+="{}",this._input.next(),this._input.next())),this._create_token(at.WORD,i)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(nt.newline);)e+=this._input.next();return pt=!0,this._create_token(at.COMMENT,e)}}else if(pt&&"-"===t&&(e=this.__patterns.html_comment_end.read()))return pt=!1,this._create_token(at.COMMENT,e);return null},yt.prototype._read_comment=function(t){var e=null;if("/"===t){var i="";if("*"===this._input.peek(1)){i=this.__patterns.block_comment.read();var n=rt.get_directives(i);n&&"start"===n.ignore&&(i+=rt.readIgnored(this._input)),i=i.replace(nt.allLineBreaks,"\n"),(e=this._create_token(at.BLOCK_COMMENT,i)).directives=n}else"/"===this._input.peek(1)&&(i=this.__patterns.comment.read(),e=this._create_token(at.COMMENT,i))}return e},yt.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function(t){var e="",i=0,n=new J(t),o=null;for(;n.hasNext();)if((o=n.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=o[0]),"\\"===n.peek()){if(n.next(),"x"===n.peek())o=n.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==n.peek()){e+="\\",n.hasNext()&&(e+=n.next());continue}o=n.match(/u([0-9A-Fa-f]{4})/g)}if(!o)return t;if((i=parseInt(o[1],16))>126&&i<=255&&0===o[0].indexOf("x"))return t;if(i>=0&&i<32){e+="\\"+o[0];continue}e+=34===i||39===i||92===i?"\\"+String.fromCharCode(i):String.fromCharCode(i)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(nt.allLineBreaks,"\n"),this._create_token(at.STRING,e)}return null},yt.prototype._allow_regexp_or_xml=function(t){return t.type===at.RESERVED&&lt(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===at.END_EXPR&&")"===t.text&&t.opened.previous.type===at.RESERVED&&lt(t.opened.previous.text,["if","while","for"])||lt(t.type,[at.COMMENT,at.START_EXPR,at.START_BLOCK,at.START,at.END_BLOCK,at.OPERATOR,at.EQUALS,at.EOF,at.SEMICOLON,at.COMMA])},yt.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var i=this._input.next(),n=!1,o=!1;this._input.hasNext()&&(n||o||this._input.peek()!==t)&&!this._input.testChar(nt.newline);)i+=this._input.peek(),n?n=!1:(n="\\"===this._input.peek(),"["===this._input.peek()?o=!0:"]"===this._input.peek()&&(o=!1)),this._input.next();return this._input.peek()===t&&(i+=this._input.next(),i+=this._input.read(nt.identifier)),this._create_token(at.STRING,i)}return null},yt.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var i="",n=this.__patterns.xml.read_match();if(n){for(var o=n[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=0===o.indexOf("{"),l=0;n;){var a=!!n[1],r=n[2];if(!(!!n[n.length-1]||"![CDATA["===r.slice(0,8))&&(r===o||s&&r.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(a?--l:++l),i+=n[0],l<=0)break;n=this.__patterns.xml.read_match()}return n||(i+=this._input.match(/[\s\S]*/g)[0]),i=i.replace(nt.allLineBreaks,"\n"),this._create_token(at.STRING,i)}}return null},yt.prototype._read_string_recursive=function(t,e,i){var n,o;"'"===t?o=this.__patterns.single_quote:'"'===t?o=this.__patterns.double_quote:"`"===t?o=this.__patterns.template_text:"}"===t&&(o=this.__patterns.template_expression);for(var s=o.read(),l="";this._input.hasNext();){if((l=this._input.next())===t||!e&&nt.newline.test(l)){this._input.back();break}"\\"===l&&this._input.hasNext()?("x"===(n=this._input.peek())||"u"===n?this.has_char_escapes=!0:"\r"===n&&"\n"===this._input.peek(1)&&this._input.next(),l+=this._input.next()):i&&("${"===i&&"$"===l&&"{"===this._input.peek()&&(l+=this._input.next()),i===l&&(l+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(l+=this._input.next()))),s+=l+=o.read()}return s},q.Tokenizer=yt,q.TOKEN=at,q.positionable_operators=bt.slice(),q.line_starters=gt.slice();var xt=c.Output,wt=h.Token,St=x,kt=w.Options,_t=q.Tokenizer,Ct=q.line_starters,Et=q.positionable_operators,Lt=q.TOKEN;function At(t,e){return-1!==e.indexOf(t)}function qt(t,e){return t&&t.type===Lt.RESERVED&&t.text===e}function Tt(t,e){return t&&t.type===Lt.RESERVED&&At(t.text,e)}var Mt=["case","return","do","if","throw","else","await","break","continue","async"],Ot=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].replace(/-/g,"_")]=t[i];return e}(["before-newline","after-newline","preserve-newline"]),Rt=[Ot.before_newline,Ot.preserve_newline],It={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function zt(t,e){e.multiline_frame||e.mode===It.ForInitializer||e.mode===It.Conditional||t.remove_indent(e.start_line_index)}function Bt(t){return t===It.ArrayLiteral}function Nt(t){return At(t,[It.Expression,It.ForInitializer,It.Conditional])}function Dt(t,e){e=e||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new kt(e)}Dt.prototype.create_flags=function(t,e){var i=0;return t&&(i=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>i&&(i=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new wt(Lt.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:i,alignment:0,line_indent_level:t?t.line_indent_level:i,start_line_index:this._output.get_line_number(),ternary_depth:0}},Dt.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new xt(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(It.BlockStatement);var i=new _t(t,this._options);return this._tokens=i.tokenize(),t},Dt.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&St.lineBreak.test(t||"")&&(e=t.match(St.lineBreak)[0]));for(var i=this._tokens.next();i;)this.handle_token(i),this._last_last_text=this._flags.last_token.text,this._flags.last_token=i,i=this._tokens.next();return this._output.get_code(e)},Dt.prototype.handle_token=function(t,e){t.type===Lt.START_EXPR?this.handle_start_expr(t):t.type===Lt.END_EXPR?this.handle_end_expr(t):t.type===Lt.START_BLOCK?this.handle_start_block(t):t.type===Lt.END_BLOCK?this.handle_end_block(t):t.type===Lt.WORD||t.type===Lt.RESERVED?this.handle_word(t):t.type===Lt.SEMICOLON?this.handle_semicolon(t):t.type===Lt.STRING?this.handle_string(t):t.type===Lt.EQUALS?this.handle_equals(t):t.type===Lt.OPERATOR?this.handle_operator(t):t.type===Lt.COMMA?this.handle_comma(t):t.type===Lt.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===Lt.COMMENT?this.handle_comment(t,e):t.type===Lt.DOT?this.handle_dot(t):t.type===Lt.EOF?this.handle_eof(t):(t.type,Lt.UNKNOWN,this.handle_unknown(t,e))},Dt.prototype.handle_whitespace_and_comments=function(t,e){var i=t.newlines,n=this._options.keep_array_indentation&&Bt(this._flags.mode);if(t.comments_before)for(var o=t.comments_before.next();o;)this.handle_whitespace_and_comments(o,e),this.handle_token(o,e),o=t.comments_before.next();if(n)for(var s=0;s<i;s+=1)this.print_newline(s>0,e);else if(this._options.max_preserve_newlines&&i>this._options.max_preserve_newlines&&(i=this._options.max_preserve_newlines),this._options.preserve_newlines&&i>1){this.print_newline(!1,e);for(var l=1;l<i;l+=1)this.print_newline(!0,e)}};var Pt=["async","break","continue","return","throw","yield"];Dt.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var i=this._options.preserve_newlines&&t.newlines||e;if(At(this._flags.last_token.text,Et)||At(t.text,Et)){var n=At(this._flags.last_token.text,Et)&&At(this._options.operator_position,Rt)||At(t.text,Et);i=i&&n}if(i)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(Tt(this._flags.last_token,Pt))return;this._output.set_wrap_point()}}},Dt.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==Lt.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var i=this._tokens.peek();!(this._flags.mode!==It.Statement||this._flags.if_block&&qt(i,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},Dt.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&("["===t.text||Bt(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},Dt.prototype.print_token=function(t){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===Lt.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var e=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(e),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},Dt.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Dt.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Dt.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Dt.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===It.Statement&&zt(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Dt.prototype.start_of_object_property=function(){return this._flags.parent.mode===It.ObjectLiteral&&this._flags.mode===It.Statement&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||Tt(this._flags.last_token,["get","set"]))},Dt.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||Tt(this._flags.last_token,["var","let","const"])&&t.type===Lt.WORD)||qt(this._flags.last_token,"do"))||!(this._flags.parent.mode===It.ObjectLiteral&&this._flags.mode===It.Statement)&&Tt(this._flags.last_token,Pt)&&!t.newlines)||qt(this._flags.last_token,"else")&&!(qt(t,"if")&&!t.comments_before))||this._flags.last_token.type===Lt.END_EXPR&&(this._previous_flags.mode===It.ForInitializer||this._previous_flags.mode===It.Conditional))||this._flags.last_token.type===Lt.WORD&&this._flags.mode===It.BlockStatement&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==Lt.WORD&&t.type!==Lt.RESERVED)||this._flags.mode===It.ObjectLiteral&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||Tt(this._flags.last_token,["get","set"])))&&(this.set_mode(It.Statement),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,Tt(t,["do","for","if","while"])),!0)},Dt.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=It.Expression;if("["===t.text){if(this._flags.last_token.type===Lt.WORD||")"===this._flags.last_token.text)return Tt(this._flags.last_token,Ct)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=It.ArrayLiteral,Bt(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),At(this._flags.last_token.type,[Lt.START_EXPR,Lt.END_EXPR,Lt.WORD,Lt.OPERATOR,Lt.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===Lt.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=It.ForInitializer):At(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=It.Conditional):At(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(At(this._flags.last_token.text,Ct)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===Lt.EQUALS||this._flags.last_token.type===Lt.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===Lt.WORD){this._output.space_before_token=!1;var i=this._tokens.peek(-3);if(this._options.space_after_named_function&&i){var n=this._tokens.peek(-4);Tt(i,["async","function"])||"*"===i.text&&Tt(n,["async","function"])?this._output.space_before_token=!0:this._flags.mode===It.ObjectLiteral&&("{"!==i.text&&","!==i.text&&("*"!==i.text||"{"!==n.text&&","!==n.text)||(this._output.space_before_token=!0))}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===Lt.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(At(this._last_last_text,["function","yield"])||this._flags.mode===It.ObjectLiteral&&At(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===Lt.START_BLOCK?this.print_newline():this._flags.last_token.type!==Lt.END_EXPR&&this._flags.last_token.type!==Lt.START_EXPR&&this._flags.last_token.type!==Lt.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==Lt.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Dt.prototype.handle_end_expr=function(t){for(;this._flags.mode===It.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&Bt(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==Lt.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),zt(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===It.Conditional&&(this._previous_flags.mode=It.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},Dt.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),i=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===Lt.END_EXPR?(this.set_mode(It.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(It.BlockStatement):i&&(At(i.text,[":",","])&&At(e.type,[Lt.STRING,Lt.WORD,Lt.RESERVED])||At(e.text,["get","set","..."])&&At(i.type,[Lt.WORD,Lt.RESERVED]))?At(this._last_last_text,["class","interface"])?this.set_mode(It.BlockStatement):this.set_mode(It.ObjectLiteral):this._flags.last_token.type===Lt.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(It.BlockStatement):At(this._flags.last_token.type,[Lt.EQUALS,Lt.START_EXPR,Lt.COMMA,Lt.OPERATOR])||Tt(this._flags.last_token,["return","throw","import","default"])?this.set_mode(It.ObjectLiteral):this.set_mode(It.BlockStatement);var n=!e.comments_before&&"}"===e.text,o=n&&"function"===this._flags.last_word&&this._flags.last_token.type===Lt.END_EXPR;if(this._options.brace_preserve_inline){var s=0,l=null;this._flags.inline_frame=!0;do{if(s+=1,(l=this._tokens.peek(s-1)).newlines){this._flags.inline_frame=!1;break}}while(l.type!==Lt.EOF&&(l.type!==Lt.END_BLOCK||l.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==Lt.OPERATOR&&(o||this._flags.last_token.type===Lt.EQUALS||Tt(this._flags.last_token,Mt)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!Bt(this._previous_flags.mode)||this._flags.last_token.type!==Lt.START_EXPR&&this._flags.last_token.type!==Lt.COMMA||((this._flags.last_token.type===Lt.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===Lt.COMMA||this._flags.last_token.type===Lt.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==Lt.OPERATOR&&this._flags.last_token.type!==Lt.START_EXPR&&(this._flags.last_token.type!==Lt.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent(),n||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},Dt.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===It.Statement;)this.restore_mode();var e=this._flags.last_token.type===Lt.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(Bt(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},Dt.prototype.handle_word=function(t){if(t.type===Lt.RESERVED)if(At(t.text,["set","get"])&&this._flags.mode!==It.ObjectLiteral)t.type=Lt.WORD;else if("import"===t.text&&"("===this._tokens.peek().text)t.type=Lt.WORD;else if(At(t.text,["as","from"])&&!this._flags.import_block)t.type=Lt.WORD;else if(this._flags.mode===It.ObjectLiteral){":"===this._tokens.peek().text&&(t.type=Lt.WORD)}if(this.start_of_statement(t)?Tt(this._flags.last_token,["var","let","const"])&&t.type===Lt.WORD&&(this._flags.declaration_statement=!0):!t.newlines||Nt(this._flags.mode)||this._flags.last_token.type===Lt.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===Lt.EQUALS||!this._options.preserve_newlines&&Tt(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(qt(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&qt(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===It.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&Tt(t,["case","default"]))return this.print_newline(),this._flags.last_token.type!==Lt.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==Lt.COMMA&&this._flags.last_token.type!==Lt.START_EXPR&&this._flags.last_token.type!==Lt.EQUALS&&this._flags.last_token.type!==Lt.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),qt(t,"function"))return(At(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!At(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==Lt.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===Lt.RESERVED||this._flags.last_token.type===Lt.WORD?Tt(this._flags.last_token,["get","set","new","export"])||Tt(this._flags.last_token,Pt)||qt(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===Lt.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!Nt(this._flags.mode)&&!Bt(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._flags.last_token.type===Lt.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":Tt(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._flags.last_token.type===Lt.SEMICOLON&&this._flags.mode===It.BlockStatement?e="NEWLINE":this._flags.last_token.type===Lt.SEMICOLON&&Nt(this._flags.mode)?e="SPACE":this._flags.last_token.type===Lt.STRING?e="NEWLINE":this._flags.last_token.type===Lt.RESERVED||this._flags.last_token.type===Lt.WORD||"*"===this._flags.last_token.text&&(At(this._last_last_text,["function","yield"])||this._flags.mode===It.ObjectLiteral&&At(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===Lt.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===Lt.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),Tt(t,Ct)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),Tt(t,["else","catch","finally"]))?(this._flags.last_token.type!==Lt.END_BLOCK||this._previous_flags.mode!==It.BlockStatement||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?Tt(this._flags.last_token,Mt)||"declare"===this._flags.last_token.text&&Tt(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==Lt.END_EXPR?this._flags.last_token.type===Lt.START_EXPR&&Tt(t,["var","let","const"])||":"===this._flags.last_token.text||(qt(t,"if")&&qt(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):Tt(t,Ct)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&Bt(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==Lt.WORD&&t.previous.type!==Lt.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===Lt.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&qt(t,"from")&&(this._flags.import_block=!1))},Dt.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==It.Statement||this._flags.if_block&&qt(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},Dt.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==Lt.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===Lt.RESERVED||this._flags.last_token.type===Lt.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===Lt.COMMA||this._flags.last_token.type===Lt.START_EXPR||this._flags.last_token.type===Lt.EQUALS||this._flags.last_token.type===Lt.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==Lt.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},Dt.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},Dt.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(Nt(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===It.ObjectLiteral||this._flags.mode===It.Statement&&this._flags.parent.mode===It.ObjectLiteral?(this._flags.mode===It.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},Dt.prototype.handle_operator=function(t){var e="*"===t.text&&(Tt(this._flags.last_token,["function","yield"])||At(this._flags.last_token.type,[Lt.START_BLOCK,Lt.COMMA,Lt.END_BLOCK,Lt.SEMICOLON])),i=At(t.text,["-","+"])&&(At(this._flags.last_token.type,[Lt.START_BLOCK,Lt.START_EXPR,Lt.EQUALS,Lt.OPERATOR])||At(this._flags.last_token.text,Ct)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var n=!e;this.handle_whitespace_and_comments(t,n)}if(Tt(this._flags.last_token,Mt))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._flags.last_token.type!==Lt.DOT)if("::"!==t.text){if(this._flags.last_token.type===Lt.OPERATOR&&At(this._options.operator_position,Rt)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==Lt.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0);var o=!0,s=!0,l=!1;if(":"===t.text?0===this._flags.ternary_depth?o=!1:(this._flags.ternary_depth-=1,l=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!i&&!e&&this._options.preserve_newlines&&At(t.text,Et)){var a=":"===t.text,r=a&&l,c=a&&!l;switch(this._options.operator_position){case Ot.before_newline:return this._output.space_before_token=!c,this.print_token(t),a&&!r||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case Ot.after_newline:return this._output.space_before_token=!0,!a||r?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case Ot.preserve_newline:return c||this.allow_wrap_or_preserved_newline(t),o=!(this._output.just_added_newline()||c),this._output.space_before_token=o,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),o=!1;var u=this._tokens.peek();s=u&&At(u.type,[Lt.WORD,Lt.RESERVED])}else"..."===t.text?(this.allow_wrap_or_preserved_newline(t),o=this._flags.last_token.type===Lt.START_BLOCK,s=!1):(At(t.text,["--","++","!","~"])||i)&&(this._flags.last_token.type!==Lt.COMMA&&this._flags.last_token.type!==Lt.START_EXPR||this.allow_wrap_or_preserved_newline(t),o=!1,s=!1,!t.newlines||"--"!==t.text&&"++"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&Nt(this._flags.mode)&&(o=!0),this._flags.last_token.type===Lt.RESERVED?o=!0:this._flags.last_token.type===Lt.END_EXPR?o=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===Lt.OPERATOR&&(o=At(t.text,["--","-","++","+"])&&At(this._flags.last_token.text,["--","-","++","+"]),At(t.text,["+","-"])&&At(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==It.BlockStatement||this._flags.inline_frame)&&this._flags.mode!==It.Statement||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline());this._output.space_before_token=this._output.space_before_token||o,this.print_token(t),this._output.space_before_token=s}else this.print_token(t);else this.print_token(t)},Dt.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):St.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},Dt.prototype.print_block_commment=function(t,e){var i,n=function(t){for(var e=[],i=(t=t.replace(St.allLineBreaks,"\n")).indexOf("\n");-1!==i;)e.push(t.substring(0,i)),i=(t=t.substring(i+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),o=!1,s=!1,l=t.whitespace_before,a=l.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(o=function(t,e){for(var i=0;i<t.length;i++)if(t[i].trim().charAt(0)!==e)return!1;return!0}(n=n.slice(1),"*"),s=function(t,e){for(var i,n=0,o=t.length;n<o;n++)if((i=t[n])&&0!==i.indexOf(e))return!1;return!0}(n,l),o&&(this._flags.alignment=1),i=0;i<n.length;i++)o?(this.print_token_line_indentation(t),this._output.add_token(n[i].replace(/^\s+/g,""))):s&&n[i]?(this.print_token_line_indentation(t),this._output.add_token(n[i].substring(a))):(this._output.current_line.set_indent(-1),this._output.add_token(n[i])),this.print_newline(!1,e);this._flags.alignment=0}},Dt.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},Dt.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),Tt(this._flags.last_token,Mt)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(t)},Dt.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},Dt.prototype.handle_eof=function(t){for(;this._flags.mode===It.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t)},r.Beautifier=Dt;var $t=r.Beautifier,Ht=w.Options;a.exports=function(t,e){return new $t(t,e).beautify()},a.exports.defaultOptions=function(){return new Ht};var Ft={exports:{}},jt={},Ut={},Wt=S.Options;function Gt(t){Wt.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var n=0;n<i.length;n++)"expand"!==i[n]?this.brace_style="collapse":this.brace_style=i[n]}Gt.prototype=new Wt,Ut.Options=Gt;var Vt=Ut.Options,Yt=c.Output,Xt=T.InputScanner,Zt=new(0,V.Directives)(/\/\*/,/\*\//),Kt=/\r\n|[\r\n]/,Qt=/\r\n|[\r\n]/g,Jt=/\s/,te=/(?:\s|\n)+/g,ee=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,ie=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function ne(t,e){this._source_text=t||"",this._options=new Vt(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}ne.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},ne.prototype.eatWhitespace=function(t){for(var e=Jt.test(this._input.peek()),i=0;Jt.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(0===i||i<this._options.max_preserve_newlines)&&(i++,this._output.add_new_line(!0));return e},ne.prototype.foundNestedPseudoClass=function(){for(var t=0,e=1,i=this._input.peek(e);i;){if("{"===i)return!0;if("("===i)t+=1;else if(")"===i){if(0===t)return!1;t-=1}else if(";"===i||"}"===i)return!1;e++,i=this._input.peek(e)}return!1},ne.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},ne.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},ne.prototype.indent=function(){this._indentLevel++},ne.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},ne.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&Kt.test(t||"")&&(e=t.match(Kt)[0]));var i=(t=t.replace(Qt,"\n")).match(/^[\t ]*/)[0];this._output=new Yt(this._options,i),this._input=new Xt(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var n,o,s=0,l=!1,a=!1,r=!1,c=!1,u=!1,d=this._ch;n=""!==this._input.read(te),o=d,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),d=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var b=this._input.read(ee),h=Zt.get_directives(b);h&&"start"===h.ignore&&(b+=Zt.readIgnored(this._input)),this.print_string(b),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(ie)),this.eatWhitespace(!0);else if("@"===this._ch)if(this.preserveSingleSpace(n),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var p=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);p.match(/[ :]$/)&&(p=this.eatString(": ").replace(/\s$/,""),this.print_string(p),this._output.space_before_token=!0),"extend"===(p=p.replace(/\s$/,""))?c=!0:"import"===p&&(u=!0),p in this.NESTED_AT_RULE?(this._nestedLevel+=1,p in this.CONDITIONAL_GROUP_RULE&&(r=!0)):l||0!==s||-1===p.indexOf(":")||(a=!0,this.indent())}else"#"===this._ch&&"{"===this._input.peek()?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString("}"))):"{"===this._ch?(a&&(a=!1,this.outdent()),r?(r=!1,l=this._indentLevel>=this._nestedLevel):l=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&l&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):"}"===this._ch?(this.outdent(),this._output.add_new_line(),"{"===o&&this._output.trim(!0),u=!1,c=!1,a&&(this.outdent(),a=!1),this.print_string(this._ch),l=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0)):":"===this._ch?!l&&!r||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||c||0!==s?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),a||(a=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):'"'===this._ch||"'"===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):";"===this._ch?0===s?(a&&(this.outdent(),a=!1),c=!1,u=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):"("===this._ch?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),s++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),s&&(s--,this.outdent()))):(this.preserveSingleSpace(n),this.print_string(this._ch),this.eatWhitespace(),s++,this.indent()):")"===this._ch?(s&&(s--,this.outdent()),this.print_string(this._ch)):","===this._ch?(this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||a||0!==s||u||c?this._output.space_before_token=!0:this._output.add_new_line()):">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||a||0!==s?"]"===this._ch?this.print_string(this._ch):"["===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch)):"="===this._ch?(this.eatWhitespace(),this.print_string("="),Jt.test(this._ch)&&(this._ch="")):"!"!==this._ch||this._input.lookBack("\\")?(this.preserveSingleSpace(n),this.print_string(this._ch)):(this.print_string(" "),this.print_string(this._ch)):this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&Jt.test(this._ch)&&(this._ch=""));return this._output.get_code(e)},jt.Beautifier=ne;var oe=jt.Beautifier,se=Ut.Options;Ft.exports=function(t,e){return new oe(t,e).beautify()},Ft.exports.defaultOptions=function(){return new se};var le={exports:{}},ae={},re={},ce=S.Options;function ue(t){ce.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}ue.prototype=new ce,re.Options=ue;var de={},be=R.Tokenizer,he=R.TOKEN,pe=V.Directives,me=X.TemplatablePattern,ge=N.Pattern,fe={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:he.START,RAW:he.RAW,EOF:he.EOF},ve=new pe(/<\!--/,/-->/),ye=function(t,e){be.call(this,t,e),this._current_tag_name="";var i=new me(this._input).read_options(this._options),n=new ge(this._input);if(this.__patterns={word:i.until(/[\n\r\t <]/),single_quote:i.until_after(/'/),double_quote:i.until_after(/"/),attribute:i.until(/[\n\r\t =>]|\/>/),element_name:i.until(/[\n\r\t >\/]/),handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),handlebars_open:n.until(/[\n\r\t }]/),handlebars_raw_close:n.until(/}}/),comment:n.starting_with(/<!--/).until_after(/-->/),cdata:n.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:n.starting_with(/<!\[/).until_after(/]>/),processing:n.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var o=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=n.matching(o).until_after(o)}};(ye.prototype=new be)._is_comment=function(t){return!1},ye.prototype._is_opening=function(t){return t.type===fe.TAG_OPEN},ye.prototype._is_closing=function(t,e){return t.type===fe.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},ye.prototype._reset=function(){this._current_tag_name=""},ye.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(fe.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_open_handlebars(n,e))||this._read_attribute(n,t,e))||this._read_close(n,e))||this._read_raw_content(n,t,e))||this._read_content_word(n))||this._read_comment_or_cdata(n))||this._read_processing(n))||this._read_open(n,e))||this._create_token(fe.UNKNOWN,this._input.next())},ye.prototype._read_comment_or_cdata=function(t){var e=null,i=null,n=null;"<"===t&&("!"===this._input.peek(1)&&((i=this.__patterns.comment.read())?(n=ve.get_directives(i))&&"start"===n.ignore&&(i+=ve.readIgnored(this._input)):i=this.__patterns.cdata.read()),i&&((e=this._create_token(fe.COMMENT,i)).directives=n));return e},ye.prototype._read_processing=function(t){var e=null,i=null;if("<"===t){var n=this._input.peek(1);"!"!==n&&"?"!==n||(i=(i=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),i&&((e=this._create_token(fe.COMMENT,i)).directives=null)}return e},ye.prototype._read_open=function(t,e){var i=null,n=null;return e||"<"===t&&(i=this._input.next(),"/"===this._input.peek()&&(i+=this._input.next()),i+=this.__patterns.element_name.read(),n=this._create_token(fe.TAG_OPEN,i)),n},ye.prototype._read_open_handlebars=function(t,e){var i=null,n=null;return e||this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&("!"===this._input.peek(2)?(i=(i=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),n=this._create_token(fe.COMMENT,i)):(i=this.__patterns.handlebars_open.read(),n=this._create_token(fe.TAG_OPEN,i))),n},ye.prototype._read_close=function(t,e){var i=null,n=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(i=this._input.next(),"/"===t&&(i+=this._input.next()),n=this._create_token(fe.TAG_CLOSE,i)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),n=this._create_token(fe.TAG_CLOSE,"}}"))),n},ye.prototype._read_attribute=function(t,e,i){var n=null,o="";if(i&&"<"===i.text[0])if("="===t)n=this._create_token(fe.EQUALS,this._input.next());else if('"'===t||"'"===t){var s=this._input.next();s+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),n=this._create_token(fe.VALUE,s)}else(o=this.__patterns.attribute.read())&&(n=e.type===fe.EQUALS?this._create_token(fe.VALUE,o):this._create_token(fe.ATTRIBUTE,o));return n},ye.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},ye.prototype._read_raw_content=function(t,e,i){var n="";if(i&&"{"===i.text[0])n=this.__patterns.handlebars_raw_close.read();else if(e.type===fe.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var o=e.opened.text.substr(1).toLowerCase();if("script"===o||"style"===o){var s=this._read_comment_or_cdata(t);if(s)return s.type=fe.TEXT,s;n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(o)&&(n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig")))}return n?this._create_token(fe.TEXT,n):null},ye.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(fe.TEXT,e)},de.Tokenizer=ye,de.TOKEN=fe;var xe=re.Options,we=c.Output,Se=de.Tokenizer,ke=de.TOKEN,_e=/\r\n|[\r\n]/,Ce=/\r\n|[\r\n]/g,Ee=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new we(t,e)};Ee.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},Ee.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},Ee.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},Ee.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},Ee.prototype.print_preserved_newlines=function(t){var e=0;t.type!==ke.TEXT&&t.previous.type!==ke.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1);for(var i=0;i<e;i++)this.print_newline(i>0);return 0!==e},Ee.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},Ee.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},Ee.prototype.print_newline=function(t){this._output.add_new_line(t)},Ee.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},Ee.prototype.indent=function(){this.indent_level++},Ee.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};var Le=function(t,e){var i=null,n=null;return e.closed?("script"===t?i="text/javascript":"style"===t&&(i="text/css"),i=function(t){for(var e=null,i=t.next;i.type!==ke.EOF&&t.closed!==i;){if(i.type===ke.ATTRIBUTE&&"type"===i.text){i.next&&i.next.type===ke.EQUALS&&i.next.next&&i.next.next.type===ke.VALUE&&(e=i.next.next.text);break}i=i.next}return e}(e)||i,i.search("text/css")>-1?n="css":i.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?n="javascript":i.search(/(text|application|dojo)\/(x-)?(html)/)>-1?n="html":i.search(/test\/null/)>-1&&(n="null"),n):null};function Ae(t,e){return-1!==e.indexOf(t)}function qe(t,e,i){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=i||0,this.parser_token=e||null}function Te(t){this._printer=t,this._current_frame=null}function Me(t,e,i,n){this._source_text=t||"",e=e||{},this._js_beautify=i,this._css_beautify=n,this._tag_stack=null;var o=new xe(e,"html");this._options=o,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}Te.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},Te.prototype.record_tag=function(t){var e=new qe(this._current_frame,t,this._printer.indent_level);this._current_frame=e},Te.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},Te.prototype._get_frame=function(t,e){for(var i=this._current_frame;i&&-1===t.indexOf(i.tag);){if(e&&-1!==e.indexOf(i.tag)){i=null;break}i=i.parent}return i},Te.prototype.try_pop=function(t,e){var i=this._get_frame([t],e);return this._try_pop_frame(i)},Te.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},Me.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&_e.test(t)&&(e=t.match(_e)[0]));var i=(t=t.replace(Ce,"\n")).match(/^[\t ]*/)[0],n={text:"",type:""},o=new Oe,s=new Ee(this._options,i),l=new Se(t,this._options).tokenize();this._tag_stack=new Te(s);for(var a=null,r=l.next();r.type!==ke.EOF;)r.type===ke.TAG_OPEN||r.type===ke.COMMENT?o=a=this._handle_tag_open(s,r,o,n):r.type===ke.ATTRIBUTE||r.type===ke.EQUALS||r.type===ke.VALUE||r.type===ke.TEXT&&!o.tag_complete?a=this._handle_inside_tag(s,r,o,l):r.type===ke.TAG_CLOSE?a=this._handle_tag_close(s,r,o):r.type===ke.TEXT?a=this._handle_text(s,r,o):s.add_raw_token(r),n=a,r=l.next();return s._output.get_code(e)},Me.prototype._handle_tag_close=function(t,e,i){var n={text:e.text,type:e.type};return t.alignment_size=0,i.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted?t.add_raw_token(e):("<"===i.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!i.indent_content||i.is_unformatted||i.is_content_unformatted||(t.indent(),i.indent_content=!1),i.is_inline_element||i.is_unformatted||i.is_content_unformatted||t.set_wrap_point(),n},Me.prototype._handle_inside_tag=function(t,e,i,n){var o=i.has_wrapped_attrs,s={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted)t.add_raw_token(e);else if("{"===i.tag_start_char&&e.type===ke.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===ke.ATTRIBUTE?(t.set_space_before_token(!0),i.attr_count+=1):(e.type===ke.EQUALS||e.type===ke.VALUE&&e.previous.type===ke.EQUALS)&&t.set_space_before_token(!1),e.type===ke.ATTRIBUTE&&"<"===i.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),o=o||0!==e.newlines),this._is_wrap_attributes_force)){var l=i.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&1===i.attr_count){var a,r=!0,c=0;do{if((a=n.peek(c)).type===ke.ATTRIBUTE){r=!1;break}c+=1}while(c<4&&a.type!==ke.EOF&&a.type!==ke.TAG_CLOSE);l=!r}l&&(t.print_newline(!1),o=!0)}t.print_token(e),o=o||t.previous_token_wrapped(),i.has_wrapped_attrs=o}return s},Me.prototype._handle_text=function(t,e,i){var n={text:e.text,type:"TK_CONTENT"};return i.custom_beautifier_name?this._print_custom_beatifier_text(t,e,i):i.is_unformatted||i.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),n},Me.prototype._print_custom_beatifier_text=function(t,e,i){var n=this;if(""!==e.text){var o,s=e.text,l=1,a="",r="";"javascript"===i.custom_beautifier_name&&"function"==typeof this._js_beautify?o=this._js_beautify:"css"===i.custom_beautifier_name&&"function"==typeof this._css_beautify?o=this._css_beautify:"html"===i.custom_beautifier_name&&(o=function(t,e){return new Me(t,e,n._js_beautify,n._css_beautify).beautify()}),"keep"===this._options.indent_scripts?l=0:"separate"===this._options.indent_scripts&&(l=-t.indent_level);var c=t.get_full_indent(l);if(s=s.replace(/\n[ \t]*$/,""),"html"!==i.custom_beautifier_name&&"<"===s[0]&&s.match(/^(<!--|<!\[CDATA\[)/)){var u=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(s);if(!u)return void t.add_raw_token(e);a=c+u[1]+"\n",s=u[4],u[5]&&(r=c+u[5]),s=s.replace(/\n[ \t]*$/,""),(u[2]||-1!==u[3].indexOf("\n"))&&(u=u[3].match(/[ \t]+$/))&&(e.whitespace_before=u[0])}if(s)if(o){var d=function(){this.eol="\n"};d.prototype=this._options.raw_options,s=o(c+s,new d)}else{var b=e.whitespace_before;b&&(s=s.replace(new RegExp("\n("+b+")?","g"),"\n")),s=c+s.replace(/\n/g,"\n"+c)}a&&(s=s?a+s+"\n"+r:a+r),t.print_newline(!1),s&&(e.text=s,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},Me.prototype._handle_tag_open=function(t,e,i,n){var o=this._get_tag_open_token(e);return!i.is_unformatted&&!i.is_content_unformatted||i.is_empty_element||e.type!==ke.TAG_OPEN||0!==e.text.indexOf("</")?(t.traverse_whitespace(e),this._set_tag_position(t,e,o,i,n),o.is_inline_element||t.set_wrap_point(),t.print_token(e)):(t.add_raw_token(e),o.start_tag_token=this._tag_stack.try_pop(o.tag_name)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(o.alignment_size=e.text.length+1),o.tag_complete||o.is_unformatted||(t.alignment_size=o.alignment_size),o};var Oe=function(t,e){var i;(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",e)?(this.tag_start_char=e.text[0],this.text=e.text,"<"===this.tag_start_char?(i=e.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"","{{#>"===e.text&&">"===this.tag_check&&null!==e.next&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===ke.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0};Me.prototype._get_tag_open_token=function(t){var e=new Oe(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||Ae(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&Ae(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&Ae(e.tag_check,this._options.content_unformatted),e.is_inline_element=Ae(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},Me.prototype._set_tag_position=function(t,e,i,n,o){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i)&&(i.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(i),"script"!==i.tag_name&&"style"!==i.tag_name||i.is_unformatted||i.is_content_unformatted||(i.custom_beautifier_name=Le(i.tag_check,e)))),Ae(i.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),i.is_empty_element){if("{"===i.tag_start_char&&"else"===i.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===i.tag_name&&o.type===ke.TAG_CLOSE&&n.is_end_tag&&-1===i.text.indexOf("\n")||(i.is_inline_element||i.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i))}else if(i.is_end_tag){var s=!1;s=(s=i.start_tag_token&&i.start_tag_token.multiline_content)||!i.is_inline_element&&!(n.is_inline_element||n.is_unformatted)&&!(o.type===ke.TAG_CLOSE&&i.start_tag_token===n)&&"TK_CONTENT"!==o.type,(i.is_content_unformatted||i.is_unformatted)&&(s=!1),s&&t.print_newline(!1)}else i.indent_content=!i.custom_beautifier_name,"<"===i.tag_start_char&&("html"===i.tag_name?i.indent_content=this._options.indent_inner_html:"head"===i.tag_name?i.indent_content=this._options.indent_head_inner_html:"body"===i.tag_name&&(i.indent_content=this._options.indent_body_inner_html)),i.is_inline_element||i.is_unformatted||"TK_CONTENT"===o.type&&!i.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i)},Me.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var Re=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],Ie=["a","audio","del","ins","map","noscript","video"];Me.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=(e=e||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==Re.indexOf(t.tag_name)){var i=t.parent.parent;i&&-1!==Ie.indexOf(i.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?e=(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?e=(e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(e=(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},ae.Beautifier=Me;var ze=ae.Beautifier,Be=re.Options;le.exports=function(t,e,i,n){return new ze(t,e,i,n).beautify()},le.exports.defaultOptions=function(){return new Be};var Ne=a.exports,De=Ft.exports,Pe=le.exports;function $e(t,e,i,n){return Pe(t,e,i=i||Ne,n=n||De)}$e.defaultOptions=Pe.defaultOptions,l.js=Ne,l.css=De,l.html=$e,function(t){var e=l;e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,t.exports=function(t,e,i){var n=function(e,i){return t.js_beautify(e,i)};return n.js=t.js_beautify,n.css=e.css_beautify,n.html=i.html_beautify,n.js_beautify=t.js_beautify,n.css_beautify=e.css_beautify,n.html_beautify=i.html_beautify,n}(e,e,e)}(s);var He=s.exports;function Fe(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function je(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ue(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?je(Object(i),!0).forEach((function(e){Fe(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):je(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function We(t,e){if(null==t)return{};var i,n,o=function(t,e){if(null==t)return{};var i,n,o={},s=Object.keys(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||(o[i]=t[i]);return o}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(o[i]=t[i])}return o}function Ge(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Ve(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Ye(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Xe(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ye(Object(i),!0).forEach((function(e){Ve(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ye(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ze(t){return function e(){for(var i=this,n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return o.length>=t.length?t.apply(this,o):function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e.apply(i,[].concat(o,n))}}}function Ke(t){return{}.toString.call(t).includes("Object")}function Qe(t){return"function"==typeof t}var Je=Ze((function(t,e){throw new Error(t[e]||t.default)}))({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),ti={changes:function(t,e){return Ke(e)||Je("changeType"),Object.keys(e).some((function(e){return i=t,n=e,!Object.prototype.hasOwnProperty.call(i,n);var i,n}))&&Je("changeField"),e},selector:function(t){Qe(t)||Je("selectorType")},handler:function(t){Qe(t)||Ke(t)||Je("handlerType"),Ke(t)&&Object.values(t).some((function(t){return!Qe(t)}))&&Je("handlersType")},initial:function(t){var e;t||Je("initialIsRequired"),Ke(t)||Je("initialType"),e=t,Object.keys(e).length||Je("initialContent")}};function ei(t,e){return Qe(e)?e(t.current):e}function ii(t,e){return t.current=Xe(Xe({},t.current),e),e}function ni(t,e,i){return Qe(e)?e(t.current):Object.keys(i).forEach((function(i){var n;return null===(n=e[i])||void 0===n?void 0:n.call(e,t.current[i])})),i}var oi={create:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ti.initial(t),ti.handler(e);var i={current:t},n=Ze(ni)(i,e),o=Ze(ii)(i),s=Ze(ti.changes)(t),l=Ze(ei)(i);return[function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return ti.selector(t),t(i.current)},function(t){!function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}(n,o,s,l)(t)}]}};var si,li={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},ai=(si=function(t,e){throw new Error(t[e]||t.default)},function t(){for(var e=this,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return n.length>=si.length?si.apply(this,n):function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return t.apply(e,[].concat(n,o))}})(li),ri={config:function(t){var e;return t||ai("configIsRequired"),e=t,{}.toString.call(e).includes("Object")||ai("configType"),t.urls?(console.warn(li.deprecation),{paths:{vs:t.urls.monacoBase}}):t}};function ci(t,e){return Object.keys(e).forEach((function(i){e[i]instanceof Object&&t[i]&&Object.assign(e[i],ci(t[i],e[i]))})),Ue(Ue({},t),e)}var ui={type:"cancelation",msg:"operation is manually canceled"};function di(t){var e=!1,i=new Promise((function(i,n){t.then((function(t){return e?n(ui):i(t)})),t.catch(n)}));return i.cancel=function(){return e=!0},i}var bi,hi,pi=oi.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),mi=(hi=2,function(t){if(Array.isArray(t))return t}(bi=pi)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var i=[],n=!0,o=!1,s=void 0;try{for(var l,a=t[Symbol.iterator]();!(n=(l=a.next()).done)&&(i.push(l.value),!e||i.length!==e);n=!0);}catch(t){o=!0,s=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw s}}return i}}(bi,hi)||function(t,e){if(t){if("string"==typeof t)return Ge(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ge(t,e):void 0}}(bi,hi)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),gi=mi[0],fi=mi[1];function vi(t){return document.body.appendChild(t)}function yi(t){var e=gi((function(t){return{config:t.config,reject:t.reject}})),i=function(t){var e=document.createElement("script");return t&&(e.src=t),e}("".concat(e.config.paths.vs,"/loader.js"));return i.onload=function(){return t()},i.onerror=e.reject,i}function xi(){var t=gi((function(t){return{config:t.config,resolve:t.resolve,reject:t.reject}})),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],(function(e){wi(e),t.resolve(e)}),(function(e){t.reject(e)}))}function wi(t){gi().monaco||fi({monaco:t})}var Si=new Promise((function(t,e){return fi({resolve:t,reject:e})})),ki={config:function(t){var e=ri.config(t),i=e.monaco,n=We(e,["monaco"]);fi((function(t){return{config:ci(t.config,n),monaco:i}}))},init:function(){var t=gi((function(t){return{monaco:t.monaco,isInitialized:t.isInitialized,resolve:t.resolve}}));if(!t.isInitialized){if(fi({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),di(Si);if(window.monaco&&window.monaco.editor)return wi(window.monaco),t.resolve(window.monaco),di(Si);!function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}(vi,yi)(xi)}return di(Si)},__getMonacoInstance:function(){return gi((function(t){return t.monaco}))}};let _i={};class Ci{constructor(t){this.builder=t}renderPanel(){const t=this.builder.builderStuff,e=this.builder.util,i=this.builder.dom;let n=t.querySelector(".viewhtml");if(!n){const o=`<div class="is-modal viewhtml" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content">\n <textarea class="tabSupport" id="__tabsupport" style="width:100%;height:calc(100% - 50px);border:none;margin:0;box-sizing:border-box;"></textarea>\n <div class="is-modal-footer" style="border-top:1px solid ${this.builder.styleSeparatorColor};width:100%;height:50px;position:absolute;left:0;bottom:0;overflow:hidden;text-align:right">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlmonaco" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="width:${this.builder.blockCodeEditorWidth};max-width:${this.builder.blockCodeEditorMaxWidth};padding:0">\n <textarea id="__viewhtmlmonaco" style="position:absolute;display:none;"></textarea>\n <div class="input-code-editor" style="width:100%;height:${this.builder.blockCodeEditorHeight};"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlexternal" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="width:${this.builder.codeEditorWidth};max-width:${this.builder.codeEditorMaxWidth};padding:0">\n <div class="input-code-editor" id="__input_code_editor" style="width:100%;height:${this.builder.codeEditorHeight};"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n \n `;i.appendHtml(t,o),n=t.querySelector(".viewhtml");let s=t.querySelector(".viewhtmlmonaco"),l=t.querySelector(".viewhtmlexternal"),a=n.querySelector(".input-ok");i.addEventListener(a,"click",(()=>{this.applyHtml(n)})),a=n.querySelector(".input-cancel"),i.addEventListener(a,"click",(()=>{this.builder.hideModal(n)})),a=s.querySelector(".input-ok"),i.addEventListener(a,"click",(()=>{this.applyHtml(s)})),a=s.querySelector(".input-cancel"),i.addEventListener(a,"click",(()=>{this.builder.hideModal(s)})),a=l.querySelector(".input-ok"),i.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-ok");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(l)})),a=l.querySelector(".input-cancel"),i.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-cancel");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(l)}))}}applyHtml(t){const e=this.builder.util;let i=this.builder.codeEditorMode,n=this.builder.codeEditorArea;this.builder.uo.saveForUndo();let o=t.querySelector("textarea").value;if("code"===i){let i=this.builder.activeCodeBlock;i.setAttribute("data-html",encodeURIComponent(o)),o=o.replace(/{id}/g,e.makeId());for(let t=1;t<=20;t++)o=o.replace("[%HTML"+t+"%]",void 0===i.getAttribute("data-html-"+t)?"":decodeURIComponent(i.getAttribute("data-html-"+t)));i.innerHTML="";let n=document.createRange();n.setStart(i,0),i.appendChild(n.createContextualFragment(o));let s=this.builder.doc.querySelector(".builder-active");return s&&this.builder.applyBehaviorOn(s),this.builder.opts.onChange(),this.builder.opts.onRender(),this.builder.hideModal(t),void e.hideControls()}if(o=this.fromViewToActual(o),"cell"===i){e.cellSelected().innerHTML=o;let t=this.builder.doc.querySelector(".builder-active");t&&this.builder.applyBehaviorOn(t),this.builder.opts.onChange(),this.builder.opts.onRender()}if("row"===i){let t,i=e.cellSelected();if(t=i?i.parentNode:e.rowSelected(),!t)return;t.innerHTML=o;let n=this.builder.doc.querySelector(".builder-active");n&&this.builder.applyBehaviorOn(n),this.builder.opts.onChange(),this.builder.opts.onRender()}if("full"===i){if(this.builder.docContainer)return this.builder.loadHTML(o),e.clearControls(),void this.builder.hideModal(t);n.innerHTML="";let i=document.createRange();i.setStart(n,0),n.appendChild(i.createContextualFragment(o)),this.builder.applyBehaviorOn(n),this.builder.opts.onChange(),this.builder.opts.onRender(),e.clearActiveCell()}e.clearControls(),this.builder.hideModal(t)}viewHtmlExternal(){const t=this.builder.util,e=this.builder.builderStuff;this.renderPanel();const i=e.querySelector(".viewhtmlexternal");document.activeElement&&(this.elmFocus=document.activeElement),t.showModal(i,!0,(()=>{this.elmFocus&&this.elmFocus.focus()}),!1),i.querySelector(".input-code-editor").style.opacity=.01,this._viewHtmlExternal()}_viewHtmlExternal(){const t=this.builder.builderStuff,e=document.querySelector("textarea[data-source-active]");let i=t.querySelector(".viewhtmlexternal").querySelector(".input-code-editor");if(!i.querySelector(".monaco-editor"))return ki.init().then((t=>{this.builder.monaco=t,i.getAttribute("data-mode-id")||(this.builder.codeEditorExternal=t.editor.create(i,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,wordWrap:!0,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""})),this.builder.codeEditorExternal.onDidChangeModelContent((()=>{document.querySelector("textarea[data-source-active]").value=this.builder.codeEditorExternal.getModel().getValue()}))})),void setTimeout((()=>{this._viewHtmlExternal()}),100);const n=this.builder.monaco.editor.createModel(e.value,"html");this.builder.codeEditorExternal.setModel(n),i.style.opacity=""}view(t,e,i){this.renderPanel();const n=this.builder.util,o=this.builder.builderStuff;let s;s=this.builder.opts.htmlSyntaxHighlighting?o.querySelector(".viewhtmlmonaco"):o.querySelector(".viewhtml");let l=s.querySelector(".is-modal-content"),a=s.querySelector(".input-code-editor");a.style.opacity=.01,"full"===t?(l.style.width=this.builder.codeEditorWidth,l.style.maxWidth=this.builder.codeEditorMaxWidth,a.style.height=this.builder.codeEditorHeight):(l.style.width=this.builder.blockCodeEditorWidth,l.style.maxWidth=this.builder.blockCodeEditorMaxWidth,a.style.height=this.builder.blockCodeEditorHeight),n.showModal(s,!0,(()=>{i&&(i.removeAttribute("data-focus"),i.focus())})),i&&i.setAttribute("data-focus",!0),this._view(t,e)}_view(t,e){const i=this.builder.dom,n=this.builder.util,o=this.builder.builderStuff;let s;if(this.builder.opts.htmlSyntaxHighlighting){s=o.querySelector(".viewhtmlmonaco");let i=s.querySelector(".input-code-editor");if(!i.querySelector(".monaco-editor"))return ki.init().then((t=>{this.builder.monaco=t,i.getAttribute("data-mode-id")||(this.builder.codeEditor=t.editor.create(i,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,wordWrap:!0,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""}));let e=s.querySelector("textarea");this.builder.codeEditor.onDidChangeModelContent((()=>{e.value=this.builder.codeEditor.getModel().getValue()}))})),void setTimeout((()=>{this._view(t,e)}),100)}else s=o.querySelector(".viewhtml");let l=s.querySelector("textarea");if("cell"===t){const t=n.cellSelected();if(!t)return;let e=s.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,e.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1}if("row"===t){let t,e=n.cellSelected();if(t=e?e.parentNode:n.rowSelected(),!t)return;let o=s.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,o.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1,i.removeClass(t,"row-outline")}if("full"===t){if(e);else{const t=this.builder.doc.querySelectorAll(this.builder.opts.container);if(t.length>1){const i=n.cellSelected();e=i?i.parentNode.parentNode:t[0]}else e=t[0];if(""!==this.builder.opts.page){const t=this.builder.doc.querySelector(this.builder.opts.page);t&&(e=t)}}let t=s.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,this.builder.shortenHTML?t.value=this.readHtml(e,!0):t.value=this.readHtml(e,!1),this.builder.cleanHtmlFormatting=!1}if(this.builder.opts.htmlSyntaxHighlighting){const t=this.builder.monaco.editor.createModel(l.value,"html");this.builder.codeEditor.setModel(t)}let a=o.querySelector(".is-pop.columnmore");a&&(a.style.display="");let r=o.querySelector(".is-pop.rowmore");r&&(r.style.display=""),this.builder.codeEditorMode=t,this.builder.codeEditorArea=e,s.querySelector(".input-code-editor").style.opacity=""}fromViewToActual(t){for(var e in _i)t=t.replace(e,_i[e]);return t}readHtml(t,e,i,n){const o=this.builder.dom;if(this.builder.opts.absolutePath){let e=t.querySelectorAll("a");Array.prototype.forEach.call(e,(t=>{let e=t.href;t.setAttribute("href",e)}));let i=t.querySelectorAll("img");Array.prototype.forEach.call(i,(t=>{let e=t.src;t.setAttribute("src",e)}))}this.builder.cleanHtmlFormatting;const s=this.builder.util;let l,a=document.createElement("div");a.innerHTML=t.innerHTML;let r=a.querySelectorAll("[data-html]");if(Array.prototype.forEach.call(r,(t=>{let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{if(i.closest(".glide__slide--clone"))return;let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}))})),r=a.querySelectorAll("[data-html]"),Array.prototype.forEach.call(r,(t=>{let e=decodeURIComponent(t.getAttribute("data-html"));e=e.replace(/{id}/g,s.makeId()),t.innerHTML=e;let i=t.querySelectorAll("[data-subblock]");var n=1;Array.prototype.forEach.call(i,(e=>{e.innerHTML=void 0===t.getAttribute("data-html-"+n)?"":decodeURIComponent(t.getAttribute("data-html-"+n)),n++}))})),e&&(_i={},r=a.querySelectorAll("[data-html]"),Array.prototype.forEach.call(r,(t=>{let e=s.makeId();_i[e]=t.getAttribute("data-html"),t.setAttribute("data-html",e);for(let i=1;i<=20;i++)void 0!==t.getAttribute("data-html-"+i)&&(e=s.makeId(),_i[e]=t.getAttribute("data-html-"+i),t.getAttribute("data-html-"+i,e));void 0!==t.getAttribute("data-settings")&&(e=s.makeId(),_i[e]=t.getAttribute("data-settings"),t.getAttribute("data-settings",e))}))),this.builder.makeAbsolute){const t=t=>{let e=document.createElement("img");return e.src=t,e.setAttribute("data-absoluteurl",e.src),t=e.getAttribute("data-absoluteurl")},e=t=>{let e=document.createElement("img");e.src=t,e.setAttribute("data-absoluteurl",e.src),t=e.getAttribute("data-absoluteurl");let i=window.location.href.substring(0,window.location.href.lastIndexOf("/"));return t.replace(i,"[%PATH%]")},i=(e,i)=>{if(e.hasAttribute(i)){if("video"!==e.parentNode.tagName.toLowerCase()&&"audio"!==e.parentNode.tagName.toLowerCase())return;let n=e.getAttribute(i);n=t(n),e.setAttribute(i,`${n}`)}};let n=a.querySelectorAll("img");Array.prototype.forEach.call(n,(t=>{let e=t.src;t.setAttribute("src",e)})),a.querySelectorAll("*").forEach((n=>{if(n.style.backgroundImage){let t=n.style.backgroundImage;if(-1!==t.indexOf("url(")){let i=t.slice(4,-1).replace(/["']/g,"");i=e(i),n.style.backgroundImage=`url(${i})`}}if(i(n,"src"),i(n,"data-default"),i(n,"data-240"),i(n,"data-360"),i(n,"data-480"),i(n,"data-540"),i(n,"data-720"),i(n,"data-1080"),i(n,"data-1440"),i(n,"data-2160"),n.hasAttribute("href")&&"link"===n.tagName.toLowerCase()){let e=n.getAttribute("href");e=t(e),n.setAttribute("href",`${e}`)}}))}let c=a.querySelectorAll(".is-builder");Array.prototype.forEach.call(c,(t=>{t.style.transform="",t.style.WebkitTransform="",t.style.MozTransform="",t.removeAttribute("data-sort"),o.removeClass(t,"builder-active");o.elementChildren(t).forEach((t=>{o.elementChildren(t).forEach((t=>{t.style.cursor=""}))}))}));o.elementChildren(a).forEach((t=>{t.style.cursor="";o.elementChildren(t).forEach((t=>{t.style.cursor=""}))}));let u=a.querySelectorAll(".sortable-chosen");o.removeClasses(u,"sortable-chosen"),u=a.querySelectorAll(".sortable-ghost"),o.removeClasses(u,"sortable-ghost"),u=a.querySelectorAll(".elm-active"),o.removeClasses(u,"elm-active"),u=a.querySelectorAll(".icon-active"),o.removeClasses(u,"icon-active"),u=a.querySelectorAll(".elm-inspected"),o.removeClasses(u,"elm-inspected"),u=a.querySelectorAll(".cell-active"),o.removeClasses(u,"cell-active"),u=a.querySelectorAll(".row-active"),o.removeClasses(u,"row-active"),u=a.querySelectorAll(".row-outline"),o.removeClasses(u,"row-outline"),u=a.querySelectorAll(".is-builder"),o.removeClasses(u,"is-builder"),u=a.querySelectorAll(".row-outline"),o.removeClasses(u,"row-outline"),u=a.querySelectorAll("[data-click]"),o.removeAttributes(u,"data-click"),u=a.querySelectorAll("[contenteditable]"),o.removeAttributes(u,"contenteditable"),u=a.querySelectorAll("[draggridoutline]"),o.removeAttributes(u,"draggridoutline"),u=a.querySelectorAll("[between-blocks-left]"),o.removeAttributes(u,"between-blocks-left"),u=a.querySelectorAll("[between-blocks-center]"),o.removeAttributes(u,"between-blocks-center"),u=a.querySelectorAll("[hideelementhighlight]"),o.removeAttributes(u,"hideelementhighlight"),u=a.querySelectorAll("[data-module-active]"),o.removeAttributes(u,"data-module-active"),u=a.querySelectorAll("[draggable]"),o.removeAttributes(u,"draggable"),u=a.querySelectorAll("[data-animated]"),o.removeAttributes(u,"data-animated"),u=a.querySelectorAll("[data-saveforundo]"),o.removeAttributes(u,"data-saveforundo"),u=a.querySelectorAll("[hidesnippetaddtool]"),o.removeAttributes(u,"hidesnippetaddtool"),u=a.querySelectorAll("[gray]"),o.removeAttributes(u,"gray"),u=a.querySelectorAll("[rowoutline]"),o.removeAttributes(u,"rowoutline"),u=a.querySelectorAll("[hidecolumntool]"),o.removeAttributes(u,"hidecolumntool"),u=a.querySelectorAll("[grayoutline]"),o.removeAttributes(u,"grayoutline"),u=a.querySelectorAll("[hideoutline]"),o.removeAttributes(u,"hideoutline"),u=a.querySelectorAll("[leftrowtool]"),o.removeAttributes(u,"leftrowtool"),u=a.querySelectorAll("[minimal]"),o.removeAttributes(u,"minimal"),u=a.querySelectorAll("[clean]"),o.removeAttributes(u,"clean"),u=a.querySelectorAll("[grideditor]"),o.removeAttributes(u,"grideditor"),u=a.querySelectorAll("[gridoutline]"),o.removeAttributes(u,"gridoutline"),o.removeElements(a.querySelectorAll(".is-row-tool")),o.removeElements(a.querySelectorAll(".is-col-tool")),o.removeElements(a.querySelectorAll(".is-rowadd-tool")),o.removeElements(a.querySelectorAll(".ovl")),o.removeElements(a.querySelectorAll(".row-add-initial")),this.builder.cleanAOS&&(u=a.querySelectorAll(".aos-init"),o.removeClasses(u,"aos-init"),u=a.querySelectorAll(".aos-animate"),o.removeClasses(u,"aos-animate")),u=a.querySelectorAll(".skrollable"),o.removeClasses(u,"skrollable"),u=a.querySelectorAll(".skrollable-after"),o.removeClasses(u,"skrollable-after"),u=a.querySelectorAll(".skrollable-before"),o.removeClasses(u,"skrollable-before"),u=a.querySelectorAll(".skrollable-between"),o.removeClasses(u,"skrollable-between"),u=a.querySelectorAll(".is-inview"),o.removeClasses(u,"is-inview");let d=a.querySelectorAll('[class=""]');Array.prototype.forEach.call(d,(t=>{t.removeAttribute("class")}));let b=a.querySelectorAll(".is-row-overlay");Array.prototype.forEach.call(b,(t=>{t.hasAttribute("style")||t.parentNode.removeChild(t)})),o.removeEmptyStyle(a),u=a.querySelectorAll("[data-keep]"),o.removeAttributes(u,"data-keep");let h=a.querySelectorAll("a");if(Array.prototype.forEach.call(h,(t=>{"inline-block"===t.style.display&&1===t.parentNode.childElementCount&&"span"===t.parentNode.tagName.toLowerCase()&&(t.parentNode.outerHTML=t.parentNode.innerHTML)})),n){a.querySelectorAll("[data-html]").forEach((t=>{t.innerHTML=""}))}if(l="",i){let t=a.querySelectorAll(".is-dummy");o.removeElements(t),t=a.querySelectorAll("[data-scroll]"),o.removeAttributes(t,"data-scroll"),t=a.querySelectorAll("[data-scroll-once]"),o.removeAttributes(t,"data-scroll-once"),this.builder.shortenOutput&&(t=a.querySelectorAll("[data-noedit]"),o.removeAttributes(t,"data-noedit"),t=a.querySelectorAll("[data-module]"),o.removeAttributes(t,"data-module"),t=a.querySelectorAll("[data-module-desc]"),o.removeAttributes(t,"data-module-desc"),t=a.querySelectorAll("[data-dialog-width]"),o.removeAttributes(t,"data-dialog-width"),t=a.querySelectorAll("[data-dialog-height]"),o.removeAttributes(t,"data-dialog-height"),t=a.querySelectorAll("[data-html]"),o.removeAttributes(t,"data-html"),t=a.querySelectorAll("[data-settings]"),o.removeAttributes(t,"data-settings"),t=a.querySelectorAll("[data-html-1]"),o.removeAttributes(t,"data-html-1"),t=a.querySelectorAll("[data-html-2]"),o.removeAttributes(t,"data-html-2"),t=a.querySelectorAll("[data-html-3]"),o.removeAttributes(t,"data-html-3"),t=a.querySelectorAll("[data-html-4]"),o.removeAttributes(t,"data-html-4"),t=a.querySelectorAll("[data-html-5]"),o.removeAttributes(t,"data-html-5"),t=a.querySelectorAll("[data-html-6]"),o.removeAttributes(t,"data-html-6"),t=a.querySelectorAll("[data-html-7]"),o.removeAttributes(t,"data-html-7"),t=a.querySelectorAll("[data-html-8]"),o.removeAttributes(t,"data-html-8"),t=a.querySelectorAll("[data-html-9]"),o.removeAttributes(t,"data-html-9"),t=a.querySelectorAll("[data-html-10]"),o.removeAttributes(t,"data-html-10"),t=a.querySelectorAll("[data-html-12]"),o.removeAttributes(t,"data-html-12"),t=a.querySelectorAll("[data-html-13]"),o.removeAttributes(t,"data-html-13"),t=a.querySelectorAll("[data-html-14]"),o.removeAttributes(t,"data-html-14"),t=a.querySelectorAll("[data-html-15]"),o.removeAttributes(t,"data-html-15"),t=a.querySelectorAll("[data-html-16]"),o.removeAttributes(t,"data-html-16"),t=a.querySelectorAll("[data-html-17]"),o.removeAttributes(t,"data-html-17"),t=a.querySelectorAll("[data-html-18]"),o.removeAttributes(t,"data-html-18"),t=a.querySelectorAll("[data-html-19]"),o.removeAttributes(t,"data-html-19"),t=a.querySelectorAll("[data-html-20]"),o.removeAttributes(t,"data-html-20"),t=a.querySelectorAll("[data-html-21]"),o.removeAttributes(t,"data-html-21"),t=a.querySelectorAll("[data-html-21]"),o.removeAttributes(t,"data-html-21"),t=a.querySelectorAll("[data-html-22]"),o.removeAttributes(t,"data-html-22"),t=a.querySelectorAll("[data-html-23]"),o.removeAttributes(t,"data-html-23"),t=a.querySelectorAll("[data-html-24]"),o.removeAttributes(t,"data-html-24"),t=a.querySelectorAll("[data-html-25]"),o.removeAttributes(t,"data-html-25")),t=a.querySelectorAll("[data-bottom-top],[data-center],[data-center-bottom],[data-100-top],[data-50-top],[data-top],[data-top-bottom],[data-center-top],[data--300-bottom],[data--150-bottom],[data--50-bottom],[data-bottom],[data-100-bottom],[data-150-bottom],[data-400-bottom],[data--400-bottom],[data--200-bottom],[data--100-bottom],[data-50-bottom],[data-200-bottom],[data-300-bottom],[data-in],[data-in-150],[data-in-300],[data-cen--150],[data-cen],[data-cen-150],[data-out--300],[data-out--150],[data-out][data-t],[data-t-100],[data-t-200],[data-t-300],[data-t-400],[data-t-500],[data-t-600],[data-t-700],[data-t-800],[data-t-900],[data-t-1000],[data-t-1100],[data-t-1200],[data-t-1300],[data-t-1400],[data-t-1500],[data-t-1600],[data-t-1700],[data-t-1800],[data-t-1900],[data-t-2000],[data-t-2100],[data-t-2200],[data-t-2300],[data-t-2400],[data-t-2500],[data-t-2600],[data-t-2700],[data-t-2800]"),Array.prototype.forEach.call(t,(t=>{t.style.transition="",t.style.transform="",t.style.opacity=""})),t=a.querySelectorAll(".is-animated"),Array.prototype.forEach.call(t,(t=>{o.removeClass(t,"animated"),o.removeClass(t,"pulse"),o.removeClass(t,"bounceIn"),o.removeClass(t,"fadeIn"),o.removeClass(t,"fadeOut"),o.removeClass(t,"fadeInDown"),o.removeClass(t,"fadeInLeft"),o.removeClass(t,"fadeInRight"),o.removeClass(t,"fadeInUp"),o.removeClass(t,"flipInX"),o.removeClass(t,"flipInY"),o.removeClass(t,"slideInUp"),o.removeClass(t,"slideInDown"),o.removeClass(t,"slideInLeft"),o.removeClass(t,"slideInRight"),o.removeClass(t,"zoomIn"),t.style.animationDelay="",t.style.transitionDelay="",t.style.transitionDuration="",t.style.transitionTimingFunction="",t.style.transitionProperty=""}));let e=a.querySelectorAll('[style=""]');Array.prototype.forEach.call(e,(t=>{t.removeAttribute("style")})),t=a.querySelectorAll(".is-appeared"),Array.prototype.forEach.call(t,(t=>{o.removeClass(t,"is-appeared")})),t=a.querySelectorAll(".box-active"),Array.prototype.forEach.call(t,(t=>{o.removeClass(t,"box-active")})),t=a.querySelectorAll(".section-active"),Array.prototype.forEach.call(t,(t=>{o.removeClass(t,"section-active")})),t=a.querySelectorAll(".section-select"),Array.prototype.forEach.call(t,(t=>{o.removeClass(t,"section-select")})),t=a.querySelectorAll(".box-select"),Array.prototype.forEach.call(t,(t=>{o.removeClass(t,"box-select")})),t=a.querySelectorAll(".is-section-tool"),o.removeElements(t),t=a.querySelectorAll(".is-box-tool"),o.removeElements(t),t=a.querySelectorAll(".is-box-info"),o.removeElements(t),t=a.querySelectorAll(".is-section-info"),o.removeElements(t),t=a.querySelectorAll(".is-block .handle, .is-block .rotate-handle"),o.removeElements(t),t=a.querySelectorAll(".is-block"),Array.prototype.forEach.call(t,(t=>{o.removeClass(t,"active"),o.removeClass(t,"multi"),o.removeClass(t,"editable"),o.removeClass(t,"fluid"),o.removeClass(t,"cloned"),t.removeAttribute("data-fluid-val"),t.removeAttribute("data-fluid"),t.removeAttribute("data-prev")})),a.querySelectorAll(".is-block.clone").forEach((t=>t.parentNode.removeChild(t)));var p="",m="",g="";o.elementChildren(a).forEach((t=>{let e=t;if(o.hasClass(e,"is-section")){var i="";e.getAttribute("class")&&(i=' class="'+e.getAttribute("class")+'"');var n=e.cloneNode(!0),s=n.outerHTML;l+=s,-1===i.indexOf("is-static")?p+=s+"\n\n":m+=s+"\n\n"}else s=(n=e.cloneNode(!0)).outerHTML,l+=s,g+=s}));let i=document.querySelector("[data-contentbox]"),n=!1;i&&(n=i.settings.disableStaticSection),n||(l=p+m+g),l=a.innerHTML.trim(),l=l.replace(/<font/g,"<span").replace(/<\/font/g,"</span")}else{let t=a.querySelectorAll('[style=""]');Array.prototype.forEach.call(t,(t=>{t.removeAttribute("style")})),this.builder.shortenOutput&&(u=a.querySelectorAll("[data-noedit]"),o.removeAttributes(u,"data-noedit"),u=a.querySelectorAll("[data-module]"),o.removeAttributes(u,"data-module"),u=a.querySelectorAll("[data-module-desc]"),o.removeAttributes(u,"data-module-desc"),u=a.querySelectorAll("[data-dialog-width]"),o.removeAttributes(u,"data-dialog-width"),u=a.querySelectorAll("[data-dialog-height]"),o.removeAttributes(u,"data-dialog-height"),u=a.querySelectorAll("[data-html]"),o.removeAttributes(u,"data-html"),u=a.querySelectorAll("[data-settings]"),o.removeAttributes(u,"data-settings"),u=a.querySelectorAll("[data-html-1]"),o.removeAttributes(u,"data-html-1"),u=a.querySelectorAll("[data-html-2]"),o.removeAttributes(u,"data-html-2"),u=a.querySelectorAll("[data-html-3]"),o.removeAttributes(u,"data-html-3"),u=a.querySelectorAll("[data-html-4]"),o.removeAttributes(u,"data-html-4"),u=a.querySelectorAll("[data-html-5]"),o.removeAttributes(u,"data-html-5"),u=a.querySelectorAll("[data-html-6]"),o.removeAttributes(u,"data-html-6"),u=a.querySelectorAll("[data-html-7]"),o.removeAttributes(u,"data-html-7"),u=a.querySelectorAll("[data-html-8]"),o.removeAttributes(u,"data-html-8"),u=a.querySelectorAll("[data-html-9]"),o.removeAttributes(u,"data-html-9"),u=a.querySelectorAll("[data-html-10]"),o.removeAttributes(u,"data-html-10"),u=a.querySelectorAll("[data-html-12]"),o.removeAttributes(u,"data-html-12"),u=a.querySelectorAll("[data-html-13]"),o.removeAttributes(u,"data-html-13"),u=a.querySelectorAll("[data-html-14]"),o.removeAttributes(u,"data-html-14"),u=a.querySelectorAll("[data-html-15]"),o.removeAttributes(u,"data-html-15"),u=a.querySelectorAll("[data-html-16]"),o.removeAttributes(u,"data-html-16"),u=a.querySelectorAll("[data-html-17]"),o.removeAttributes(u,"data-html-17"),u=a.querySelectorAll("[data-html-18]"),o.removeAttributes(u,"data-html-18"),u=a.querySelectorAll("[data-html-19]"),o.removeAttributes(u,"data-html-19"),u=a.querySelectorAll("[data-html-20]"),o.removeAttributes(u,"data-html-20"),u=a.querySelectorAll("[data-html-21]"),o.removeAttributes(u,"data-html-21"),u=a.querySelectorAll("[data-html-21]"),o.removeAttributes(u,"data-html-21"),u=a.querySelectorAll("[data-html-22]"),o.removeAttributes(u,"data-html-22"),u=a.querySelectorAll("[data-html-23]"),o.removeAttributes(u,"data-html-23"),u=a.querySelectorAll("[data-html-24]"),o.removeAttributes(u,"data-html-24"),u=a.querySelectorAll("[data-html-25]"),o.removeAttributes(u,"data-html-25")),u=a.querySelectorAll(".is-block .handle, .is-block .rotate-handle"),o.removeElements(u),u=a.querySelectorAll(".is-block"),Array.prototype.forEach.call(u,(t=>{o.removeClass(t,"active"),o.removeClass(t,"multi"),o.removeClass(t,"editable"),o.removeClass(t,"fluid"),o.removeClass(t,"cloned"),t.removeAttribute("data-fluid-val"),t.removeAttribute("data-fluid"),t.removeAttribute("data-prev")})),a.querySelectorAll(".is-block.clone").forEach((t=>t.parentNode.removeChild(t))),l=a.innerHTML.trim(),l=l.replace(/<font/g,"<span").replace(/<\/font/g,"</span")}let f=He.html;return l=f(l),l=l.replace(/(\r\n|\r|\n){3,}/g,"$1\n"),l}beautify(t){return t=(t=(0,He.html)(t)).replace(/(\r\n|\r|\n){3,}/g,"$1\n")}}class Ei{constructor(t){this.builder=t;const e=this.builder.dom;this.dom=e,this.undoList=[]}readStyles(){if(this.builder.opts.undoContainerOnly)return"";let t,e,i="",n=this.builder.doc.getElementsByTagName("link");for(t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")&&(i+=n[t].outerHTML);for(n=this.builder.doc.getElementsByTagName("link"),t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")||-1!==e.indexOf("type-")&&(i+=n[t].outerHTML);return i}writeStyles(t){const e=this.dom;if(this.builder.opts.undoContainerOnly)return;let i,n,o=this.builder.doc.getElementsByTagName("link");for(i=0;i<o.length;i++)n=o[i].href.toLowerCase(),(-1!==n.indexOf("basetype-")||-1!==n.indexOf("type-"))&&o[i].parentNode.removeChild(o[i]);let s=this.builder.doc.getElementsByTagName("head")[0];e.appendHtml(s,t)}readHtml(){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly){if(this.builder.docContainer){return this.builder.doc.querySelector(this.builder.docContainer).innerHTML}{const t=this.builder.doc.querySelectorAll(this.builder.opts.container);let e="";return Array.prototype.forEach.call(t,(t=>{e+=t.innerHTML+"####|####"})),e=e.substr(0,e.length-9),e}}return this.builder.doc.querySelector(this.builder.opts.page).innerHTML}cleaning(t){const e=this.dom;let i=t.querySelectorAll(".is-builder");Array.prototype.forEach.call(i,(t=>{t.removeAttribute("data-sort")}));let n=t.querySelectorAll("[data-click]");e.removeAttributes(n,"data-click"),e.removeElements(t.querySelectorAll(".is-row-tool")),e.removeElements(t.querySelectorAll(".is-rowadd-tool")),e.removeElements(t.querySelectorAll(".is-col-tool")),e.removeElements(t.querySelectorAll(".ovl")),e.removeElements(t.querySelectorAll(".row-add-initial")),n=t.querySelectorAll(".is-block .handle, .is-block .rotate-handle"),e.removeElements(n),n=t.querySelectorAll(".is-block"),Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"active"),e.removeClass(t,"multi"),e.removeClass(t,"editable"),e.removeClass(t,"fluid"),e.removeClass(t,"cloned"),t.removeAttribute("data-fluid-val"),t.removeAttribute("data-fluid"),t.removeAttribute("data-prev")})),t.querySelectorAll(".is-block.clone").forEach((t=>t.parentNode.removeChild(t))),n=t.querySelectorAll(".is-section-tool"),e.removeElements(n)}writeHtml(t){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly)if(this.builder.docContainer){let e=this.builder.doc.querySelector(this.builder.docContainer),i=document.createRange();e.innerHTML="",e.appendChild(i.createContextualFragment(t)),this.cleaning(e)}else{const e=this.builder.doc.querySelectorAll(this.builder.opts.container);let i=0;Array.prototype.forEach.call(e,(e=>{var n=document.createRange();e.innerHTML="",e.appendChild(n.createContextualFragment(t.split("####|####")[i])),this.cleaning(e),this.builder.applyBehaviorOn(e),i++}))}else{let e=this.builder.doc.querySelector(this.builder.opts.page),i=document.createRange();e.innerHTML="",e.appendChild(i.createContextualFragment(t)),this.cleaning(e)}this.builder.opts.onRender()}saveForUndo(t){if(this.builder.onBeforeSaveForUndo&&this.builder.onBeforeSaveForUndo(),this.builder.undoRedoStyles){if(this.undoList[120]){let e=this.undoList[120][0].split("###$###")[1];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}}else if(this.undoList[120]){let e=this.undoList[120][0];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}if(this.builder.saveForUndoCheck=!0===t,this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=" "+this.readStyles()+"###$###"+this.readHtml();this.undoList[120]=[t,null]}else this.undoList[120]=[this.readHtml(),null]}doUndo(){const t=this.dom;if(!this.undoList[120])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[99]=this.undoList[100],this.undoList[100]=this.undoList[101],this.undoList[101]=this.undoList[102],this.undoList[102]=this.undoList[103],this.undoList[103]=this.undoList[104],this.undoList[104]=this.undoList[105],this.undoList[105]=this.undoList[106],this.undoList[106]=this.undoList[107],this.undoList[107]=this.undoList[108],this.undoList[108]=this.undoList[109],this.undoList[109]=this.undoList[110],this.undoList[110]=this.undoList[111],this.undoList[111]=this.undoList[112],this.undoList[112]=this.undoList[113],this.undoList[113]=this.undoList[114],this.undoList[114]=this.undoList[115],this.undoList[115]=this.undoList[116],this.undoList[116]=this.undoList[117],this.undoList[117]=this.undoList[118],this.undoList[118]=this.undoList[119],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[119]=[i,null],i=this.undoList[120][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[119]=[this.readHtml(),null];let t=this.undoList[120][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.opts.onChange(),this.undoList[120]=this.undoList[121],this.undoList[121]=this.undoList[122],this.undoList[122]=this.undoList[123],this.undoList[123]=this.undoList[124],this.undoList[124]=this.undoList[125],this.undoList[125]=this.undoList[126],this.undoList[126]=this.undoList[127],this.undoList[127]=this.undoList[128],this.undoList[128]=this.undoList[129],this.undoList[129]=this.undoList[130],this.undoList[130]=this.undoList[131],this.undoList[131]=this.undoList[132],this.undoList[132]=this.undoList[133],this.undoList[133]=this.undoList[134],this.undoList[134]=this.undoList[135],this.undoList[135]=this.undoList[136],this.undoList[136]=this.undoList[137],this.undoList[137]=this.undoList[138],this.undoList[138]=this.undoList[139],this.undoList[139]=this.undoList[140],this.undoList[140]=this.undoList[141];const e=new i(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let n=this.builder.doc.querySelector("[data-saveforundo]");if(n){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{n.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onUndo&&this.builder.opts.onUndo(),this.builder.undoRedoInProcess=!1}doRedo(){const t=this.dom;if(!this.undoList[119])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[141]=this.undoList[140],this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[120]=[i,null],i=this.undoList[119][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[120]=[this.readHtml(),null];let t=this.undoList[119][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.opts.onChange(),this.undoList[119]=this.undoList[118],this.undoList[118]=this.undoList[117],this.undoList[117]=this.undoList[116],this.undoList[116]=this.undoList[115],this.undoList[115]=this.undoList[114],this.undoList[114]=this.undoList[113],this.undoList[113]=this.undoList[112],this.undoList[112]=this.undoList[111],this.undoList[111]=this.undoList[110],this.undoList[110]=this.undoList[109],this.undoList[109]=this.undoList[108],this.undoList[108]=this.undoList[107],this.undoList[107]=this.undoList[106],this.undoList[106]=this.undoList[105],this.undoList[105]=this.undoList[104],this.undoList[104]=this.undoList[103],this.undoList[103]=this.undoList[102],this.undoList[102]=this.undoList[101],this.undoList[101]=this.undoList[100],this.undoList[100]=this.undoList[99],this.undoList[99]=null;const e=new i(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let n=this.builder.doc.querySelector("[data-saveforundo]");if(n){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{n.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onRedo&&this.builder.opts.onRedo(),this.builder.undoRedoInProcess=!1}}
1
+ var ContentBuilder=function(){"use strict";class t{constructor(t){this.builder=t;const e=this.builder.util;this.util=e}getSnippetsHtml(){const t=this.util,e=this.builder.opts.snippetUrl,i=this.builder.opts.snippetPath;let n="[";for(let e=0;e<this.builder.opts.snippetCategories.length;e++)n+=`[${this.builder.opts.snippetCategories[e][0]},'${t.out(this.builder.opts.snippetCategories[e][1])}'],`;n+="]";const o=this.builder.opts.defaultSnippetCategory;return`\n <!DOCTYPE HTML>\n <html>\n \n <head>\n <meta charset="utf-8">\n <title></title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <script src="${e}"><\/script>\n <style>\n body {\n // background: #fff;\n background: ${this.builder.styleSnippetBackground};\n margin: 0;\n }\n\n .is-pop-close {\n display: flex;\n justify-content: center;\n align-items: center;\n border: none;\n background: transparent;\n z-index:10;width:30px;height:30px;position:absolute;\n top:2px;right:2px;box-sizing:border-box;padding:0;line-height:40px;font-size: 12px;text-align:center;cursor:pointer;\n }\n .is-pop-close:focus-visible {\n outline: ${this.builder.styleOutlineColor} 2px solid;\n }\n\n /*\n body.dark {\n background: #111;\n }\n .dark .is-categories {\n background: #333;\n }\n .dark .is-category-list a {\n background: #333;\n color: #fff;\n }\n .dark .is-category-list a.active {\n background: #525252;\n color: #fff;\n }\n .dark .is-category-list a:hover {\n color: #fff;\n }\n .dark .is-design-list>li img {\n opacity: 0.93;\n }\n .dark .is-more-categories {\n background: #333;\n }\n .dark .is-more-categories a {\n background: #333;\n color: #fff;\n }\n .dark .is-more-categories a:hover,\n .dark .is-more-categories a:focus {\n background: #4c4c4c;\n }\n .dark .is-more-categories a.active {\n background: #4c4c4c;\n }\n */\n\n \n .dark .is-design-list>li {\n outline: transparent 1px solid;\n }\n\n \n \n /* Scrollbar for modal */\n\n /* Darker color, because background for snippet thumbnails is always light. */\n .dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(78 78 78 / 62%) auto;\n }\n .dark *::-webkit-scrollbar {\n width: 12px;\n }\n .dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .dark *::-webkit-scrollbar-thumb {\n background-color:rgb(78 78 78 / 62%);\n } \n\n .colored-dark * {\n scrollbar-width: thin;\n scrollbar-color: rgb(100, 100, 100) auto;\n }\n .colored-dark *::-webkit-scrollbar {\n width: 12px;\n }\n .colored-dark *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored-dark *::-webkit-scrollbar-thumb {\n background-color:rgb(100, 100, 100);\n } \n\n .colored * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .colored *::-webkit-scrollbar {\n width: 12px;\n }\n .colored *::-webkit-scrollbar-track {\n background: transparent;\n }\n .colored *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n\n .light * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.4) auto;\n }\n .light *::-webkit-scrollbar {\n width: 12px;\n }\n .light *::-webkit-scrollbar-track {\n background: transparent;\n }\n .light *::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.4);\n } \n \n svg {\n fill: ${this.builder.styleSnippetColor};\n }\n\n .is-design-list {\n position: fixed;\n top: 0px;\n left: 0px;\n border-top: transparent 68px solid;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n padding: 0px 0px 30px 30px;\n box-sizing: border-box;\n overflow: auto;\n list-style: none;\n margin: 0;\n }\n \n .is-design-list>li {\n width: 250px;\n min-height:120px;\n position:relative;\n background: #fff;\n // background: ${this.builder.styleToolBackground};\n overflow: hidden;\n margin: 32px 40px 0 0;\n cursor: pointer;\n display: inline-block;\n outline: #ececec 1px solid;\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);\n border-radius: 2px;\n }\n\n .is-design-list>li:focus-visible {\n outline: ${this.builder.styleOutlineColor} 2px solid;\n }\n\n .is-design-list>li img {\n box-shadow: none;\n opacity: 1;\n display: block;\n box-sizing: border-box;\n transition: all 0.2s ease-in-out;\n max-width: 400px;\n width: 100%\n }\n \n // .is-design-list>li:hover img {\n // opacity: 0.95;\n // }\n \n // .is-design-list>li:hover {\n // background: #999;\n // }\n .is-overlay {\n position:absolute;left:0px;top:0px;width:100%;height:100%;\n }\n .is-design-list>li .is-overlay:after {\n background: rgba(0, 0, 0, 0.02);\n position: absolute;\n content: "";\n display: block;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n transition: all 0.3s ease-in-out;\n opacity: 0;\n }\n .is-design-list>li:hover .is-overlay:after,\n .is-design-list>li:focus .is-overlay:after {\n opacity: 0.9;\n }\n .dark .is-design-list>li .is-overlay:after {\n background: rgb(78 78 78 / 13%);\n }\n \n .is-category-list {\n position: relative;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 80px;\n box-sizing: border-box;\n z-index: 1;\n }\n \n .is-category-list>div {\n white-space: nowrap;\n padding: 0 30px;\n box-sizing: border-box;\n font-family: sans-serif;\n font-size: 10px;\n text-transform: uppercase;\n letter-spacing: 2px;\n // background: #f5f5f5;\n background: ${this.builder.styleSnippetTabsBackground};\n // box-shadow: 0 5px 8px rgb(0 0 0 / 4%);\n }\n \n .is-category-list a {\n display: inline-block;\n padding: 10px 20px;\n // background: #fefefe;\n // color: #000;\n background: ${this.builder.styleSnippetTabItemBackground};\n color: ${this.builder.styleSnippetTabItemColor};\n border-radius: 50px;\n \n margin: 0 12px 0 0;\n text-decoration: none;\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);\n transition: box-shadow ease 0.3s;\n }\n \n .is-category-list a:hover {\n /*background: #fafafa;*/\n background: ${this.builder.styleSnippetTabItemBackgroundHover};\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);\n // color: #000;\n color: ${this.builder.styleSnippetTabItemColor};\n }\n \n .is-category-list a.active {\n // background: #f5f5f5;\n background: ${this.builder.styleSnippetTabItemBackgroundActive};\n // color: #000;\n color: ${this.builder.styleSnippetTabItemColor};\n box-shadow: none;\n cursor: default;\n }\n\n .is-category-list a:focus-visible {\n outline: ${this.builder.styleOutlineColor} 2px solid;\n }\n \n .is-more-categories {\n display: none;\n position: absolute;\n width: 400px;\n box-sizing: border-box;\n padding: 0;\n z-index: 1;\n font-family: sans-serif;\n font-size: 10px;\n text-transform: uppercase;\n letter-spacing: 2px;\n box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);\n // background: #fff;\n background: ${this.builder.styleSnippetMoreItemBackground};\n }\n \n .is-more-categories a {\n width: 200px;\n float: left;\n display: block;\n box-sizing: border-box;\n padding: 12px 20px;\n // background: #fff;\n background: ${this.builder.styleSnippetMoreItemBackground};\n text-decoration: none;\n // color: #000;\n color: ${this.builder.styleSnippetMoreItemColor};\n line-height: 1.6;\n outline: none;\n }\n \n .is-more-categories a:hover,\n .is-more-categories a:focus {\n // background: #eee;\n background: ${this.builder.styleSnippetMoreItemBackgroundHover};\n }\n \n .is-more-categories a.active {\n // background: #eee;\n background: ${this.builder.styleSnippetMoreItemBackgroundActive};\n }\n \n .is-more-categories.active {\n display: block;\n }\n \n /* First Loading */\n /* .is-category-list {\n display: none;\n }\n \n .is-design-list {\n display: none;\n }\n \n .pace {\n -webkit-pointer-events: none;\n pointer-events: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n }\n \n .pace-inactive {\n display: none;\n }\n \n .pace .pace-progress {\n background: #000000;\n position: fixed;\n z-index: 2000;\n top: 0;\n right: 100%;\n width: 100%;\n height: 2px;\n } */\n \n .is-more-categories>a:nth-child(0) {\n display: none\n }\n \n .is-more-categories>a:nth-child(1) {\n display: none\n }\n \n .is-more-categories>a:nth-child(2) {\n display: none\n }\n \n .is-more-categories>a:nth-child(3) {\n display: none\n }\n \n .is-more-categories>a:nth-child(4) {\n display: none\n }\n \n .is-more-categories>a:nth-child(5) {\n display: none\n }\n \n .is-more-categories>a:nth-child(6) {\n display: none\n }\n \n .is-more-categories>a:nth-child(7) {\n display: none\n }\n \n @media all and (max-width: 1212px) {\n .is-categories>a:nth-child(7):not(.more-snippets) {\n display: none\n }\n \n .is-more-categories>a:nth-child(7) {\n display: block\n }\n }\n \n @media all and (max-width: 1070px) {\n .is-categories>a:nth-child(6):not(.more-snippets) {\n display: none\n }\n \n .is-more-categories>a:nth-child(6) {\n display: block\n }\n }\n \n @media all and (max-width: 940px) {\n .is-categories>a:nth-child(5):not(.more-snippets) {\n display: none\n }\n \n .is-more-categories>a:nth-child(5) {\n display: block\n }\n }\n \n @media all and (max-width: 700px) {\n .is-categories>a:nth-child(4):not(.more-snippets) {\n display: none\n }\n \n .is-more-categories>a:nth-child(4) {\n display: block\n }\n }\n \n @media all and (max-width: 555px) {\n .is-categories>a:nth-child(3):not(.more-snippets) {\n display: none\n }\n \n .is-more-categories>a:nth-child(3) {\n display: block\n }\n }\n \n @media all and (max-width: 415px) {\n .is-categories>a:nth-child(2):not(.more-snippets) {\n display: none\n }\n \n .is-more-categories>a:nth-child(2) {\n display: block\n }\n }\n \n @media all and (max-width: 640px) {\n .is-more-categories a {\n width: 150px;\n padding: 10px 5px 10px 15px;\n font-size: 10px;\n }\n \n .is-more-categories {\n left: 0 !important;\n width: 100% !important;\n }\n }\n\n\n * {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.2) auto;\n }\n *::-webkit-scrollbar {\n width: 12px;\n }\n *::-webkit-scrollbar-track {\n background: rgba(200, 200, 200, 0.2);\n }\n *::-webkit-scrollbar-thumb {\n background-color:rgba(0, 0, 0, 0.2); \n }\n </style>\n </head>\n \n <body${this.builder.styleDark?' class="dark"':""}${this.builder.styleColored?' class="colored"':""}${this.builder.styleColoredDark?' class="colored-dark"':""}${this.builder.styleLight?' class="light"':""}>\n\n <svg style="display:none">\n <defs>\n <symbol viewBox="0 0 512 512" id="ion-ios-close-empty">\n <path d="M340.2 160l-84.4 84.3-84-83.9-11.8 11.8 84 83.8-84 83.9 11.8 11.7 84-83.8 84.4 84.2 11.8-11.7-84.4-84.3 84.4-84.2z"></path>\n </symbol>\n </defs>\n </svg>\n \n <button class="is-pop-close" tabindex="-1">\n <svg class="is-icon-flex" style="width:30px;height:30px;">\n <use xlink:href="#ion-ios-close-empty"></use>\n </svg>\n </button>\n \n <div class="is-category-list">\n <div class="is-categories" style="position:fixed;top:0;left:0;right:0;height:68px;padding-top:17px;box-sizing:border-box;">\n </div>\n </div>\n\n <div class="is-more-categories" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n </div>\n \n <ul class="is-design-list" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n </ul>\n \n <script${this.builder.nonce?` nonce="${this.builder.nonce}"`:""}>\n \n var snippetPath = '${i}';\n var snippetCategories = ${n};\n var defaultSnippetCategory = ${o};\n\n ${void 0!==this.builder.slider&&null!==this.builder.slider?`\n var slider='${this.builder.slider}';`:"var slider=null;"};\n \n var numOfCat = snippetCategories.length;\n if (numOfCat <= 7) {\n document.querySelector('.is-more-categories').style.width = '200px';\n }\n \n var categorytabs = document.querySelector('.is-categories');\n categorytabs.innerHTML = '';\n let html_catselect = '';\n for (var i = 0; i < numOfCat; i++) {\n if (i < 7) {\n html_catselect += '<a href="" data-cat="' + snippetCategories[i][0] + '">' + parent._cb.out(snippetCategories[i][1]) + '</a>';\n }\n }\n html_catselect += '<a href="" class="more-snippets">' + parent._cb.out('More') + '</a>';\n categorytabs.innerHTML = html_catselect;\n \n var categorymore = document.querySelector('.is-more-categories');\n html_catselect = '';\n for (var i = 0; i < numOfCat; i++) {\n html_catselect += '<a href="" data-cat="' + snippetCategories[i][0] + '">' + parent._cb.out(snippetCategories[i][1]) + '</a>';\n }\n categorymore.innerHTML = html_catselect;\n \n // Show/hide "More" button\n if (numOfCat <= 7) {\n var bHasMore = false;\n \n const childNodes = categorymore.childNodes;\n let i = childNodes.length;\n while (i--) {\n if(childNodes[i].style.display === 'block') {\n bHasMore = true;\n }\n }\n var more = document.querySelector('.more-snippets');\n if (!bHasMore) more.style.display = 'none';\n else more.style.display = '';\n }\n \n var elms = categorytabs.querySelectorAll('a[data-cat="' + defaultSnippetCategory + '"]'); //.classList.add('active');\n Array.prototype.forEach.call(elms, function(elm){\n elm.classList.add('active');\n });\n elms = categorymore.querySelectorAll('a[data-cat="' + defaultSnippetCategory + '"]'); //.classList.add('active');\n Array.prototype.forEach.call(elms, function(elm){\n elm.classList.add('active');\n });\n\n\n document.addEventListener('keydown', function(e){\n if(e.keyCode === 27) { // escape key\n const moreCategories = document.querySelector('.is-more-categories');\n if(moreCategories.classList.contains('active')) {\n moreCategories.classList.remove('active');\n const activeTab = categorylist.querySelector('.more-snippets');\n activeTab.classList.remove('active');\n activeTab.focus();\n } else {\n const modal = parent.document.querySelector('.is-modal.snippets');\n removeClass(modal, 'active');\n }\n }\n });\n\n\n let categorylist = document.querySelector('.is-category-list');\n let designlist = document.querySelector('.is-design-list');\n\n const select = (elm) => {\n\n if(elm.classList.contains('active')) {\n return false;\n }\n \n var cat = elm.getAttribute('data-cat');\n if (cat) if(designlist.querySelectorAll('[data-cat="' + cat + '"]').length === 0) {\n\n for (let i = 0; i <snippets.length; i++) {\n \n var thumb = snippets[i].thumbnail;\n \n thumb = snippetPath + thumb; \n \n if (snippets[i].category === cat) {\n designlist.insertAdjacentHTML('beforeend', '<li role="button" tabindex="0" data-id="' + snippets[i].id + '" data-cat="' + snippets[i].category + '"><img src="' + thumb + '"><span class="is-overlay"></span></li>');\n \n var newitem = designlist.querySelector('[data-id="' + snippets[i].id + '"]');\n newitem.addEventListener('click', function(e){\n \n var snippetid = e.target.parentNode.getAttribute('data-id');\n addSnippet(snippetid);\n \n });\n\n newitem.addEventListener('keydown', (e)=>{\n if ((e.which === 9 && !e.shiftKey)) { // tab\n let last = false;\n if(e.target.nextElementSibling) {\n if(!e.target.nextElementSibling.classList.contains('active')) {\n last = true;\n }\n } else {\n last = true;\n }\n if(last) {\n e.preventDefault();\n let activeTab = categorylist.querySelector('.active');\n if(activeTab) activeTab.focus();\n else {\n activeTab = categorylist.querySelector('.more-snippets');\n activeTab.focus();\n }\n }\n }\n if ((e.which === 9 && e.shiftKey)) { // shift + tab\n let first = false;\n if(e.target.previousElementSibling) {\n if(!e.target.previousElementSibling.classList.contains('active')) {\n first = true;\n }\n } else {\n first = true;\n }\n if(first) {\n e.preventDefault();\n let activeTab = categorylist.querySelector('.active');\n if(activeTab) activeTab.focus();\n else {\n activeTab = categorylist.querySelector('.more-snippets');\n activeTab.focus();\n }\n }\n }\n });\n\n }\n \n } \n }\n \n if (cat) {\n // Hide all, show items from selected category\n var categorylist_items = categorylist.querySelectorAll('a'); \n Array.prototype.forEach.call(categorylist_items, function(elm){\n elm.className = elm.className.replace('active', '');\n });\n categorymore.className = categorymore.className.replace('active', ''); \n var categorymore_items = categorymore.querySelectorAll('a');\n Array.prototype.forEach.call(categorymore_items, function(elm){\n elm.className = elm.className.replace('active', '');\n });\n \n var items = designlist.querySelectorAll('li');\n Array.prototype.forEach.call(items, function(elm){\n elm.style.display = 'none';\n elm.classList.remove('active');\n });\n Array.prototype.forEach.call(items, function(elm){\n var catSplit = elm.getAttribute('data-cat').split(',');\n for (var j = 0; j < catSplit.length; j++) {\n if (catSplit[j] == cat) {\n elm.style.display = ''; // TODO: hide & show snippets => animated\n elm.classList.add('active');\n }\n }\n });\n \n } else {\n // show dropdown\n var more = document.querySelector('.more-snippets');\n var moreCategories = document.querySelector('.is-more-categories');\n \n var _width = moreCategories.offsetWidth;\n more.classList.add('active');\n moreCategories.classList.add('active');\n var top = more.getBoundingClientRect().top;\n var left = more.getBoundingClientRect().left;\n top = top + 50;\n moreCategories.style.top = top + 'px';\n moreCategories.style.left = left + 'px';\n }\n elm.classList.add('active');\n \n };\n\n let tabs = document.querySelectorAll('.is-categories a');\n Array.prototype.forEach.call(tabs, (tab) => {\n \n tab.addEventListener('keydown', (e)=>{\n e.preventDefault();\n \n if ((e.which === 39 && e.target.nextElementSibling)) { // arrow right key pressed\n e.target.nextElementSibling.focus();\n } else if ((e.which === 37 && e.target.previousElementSibling)) { // arrow left key pressed\n e.target.previousElementSibling.focus();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n select(e.target);\n } else if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n \n let moreCategories = document.querySelector('.is-more-categories');\n if(moreCategories.classList.contains('active')) {\n \n // Redirect to dropdown list\n let firstItem;\n let activeItem;\n let moreCategories = document.querySelector('.is-more-categories');\n let items = moreCategories.querySelectorAll('a');\n items.forEach(item=>{\n let display = window.getComputedStyle(item).getPropertyValue('display');\n if(display==='block') {\n item.classList.add('show');\n if(item.classList.contains('active')) {\n activeItem=item;\n }\n } else {\n item.classList.remove('show');\n }\n });\n firstItem = moreCategories.querySelector('.show');\n if(activeItem) {\n activeItem.focus();\n } else {\n firstItem.focus();\n }\n return;\n\n }\n\n // Redirect to tab content\n let inputs = [];\n let controls = designlist.querySelectorAll('.active');\n controls.forEach(control=>{\n inputs.push(control);\n });\n \n if(inputs.length===0) return;\n \n let firstInput = inputs[0];\n \n firstInput.focus();\n } else if(e.which === 40 && e.target.classList.contains('more-snippets')) { // down\n \n // Redirect to dropdown list\n let firstItem;\n let activeItem;\n let moreCategories = document.querySelector('.is-more-categories');\n let items = moreCategories.querySelectorAll('a');\n items.forEach(item=>{\n let display = window.getComputedStyle(item).getPropertyValue('display');\n if(display==='block') {\n item.classList.add('show');\n if(item.classList.contains('active')) {\n activeItem=item;\n }\n } else {\n item.classList.remove('show');\n }\n });\n firstItem = moreCategories.querySelector('.show');\n if(activeItem) {\n activeItem.focus();\n } else {\n firstItem.focus();\n }\n\n } \n\n \n });\n \n tab.addEventListener('click', (e)=>{\n e.preventDefault();\n\n e.target.focus();\n \n select(e.target);\n });\n \n });\n\n let dropdownItems = document.querySelectorAll('.is-more-categories a');\n Array.prototype.forEach.call(dropdownItems, (item) => {\n\n item.addEventListener('keydown', (e)=>{\n e.preventDefault();\n if(e.keyCode === 38 && e.target.previousElementSibling && window.getComputedStyle(e.target.previousElementSibling).getPropertyValue('display')==='block') { // up\n e.target.previousElementSibling.focus();\n } else if(e.keyCode === 40 && e.target.nextElementSibling && window.getComputedStyle(e.target.nextElementSibling).getPropertyValue('display')==='block') { // down\n e.target.nextElementSibling.focus();\n } else if(e.keyCode === 13 || e.keyCode === 32) { // enter or spacebar key\n select(e.target);\n } else if ((e.which === 9 && !e.shiftKey)) { // tab key pressed\n \n // Redirect to tab content\n let inputs = [];\n let controls = designlist.querySelectorAll('.active');\n controls.forEach(control=>{\n inputs.push(control);\n });\n \n if(inputs.length===0) return;\n \n let firstInput = inputs[0];\n \n firstInput.focus();\n } \n \n });\n \n item.addEventListener('click', (e)=>{\n e.preventDefault();\n\n e.target.focus();\n \n select(e.target);\n });\n });\n\n\n \n var snippets = data_basic.snippets; //DATA\n\n if (slider !== null){\n if(slider==='slick') {\n //remove glide\n const predicate = (item) => (item.type!=='glide');\n snippets = snippets.filter(predicate);\n } else if(slider==='glide') {\n //remove slick\n const predicate = (item) => (item.type!=='slick');\n snippets = snippets.filter(predicate);\n } else if(slider==='all') {\n // Do Nothing\n } else {\n // remove all slider (if incorrect settings)\n const predicate = (item) => (item.type!=='glide' && item.type!=='slick');\n snippets = snippets.filter(predicate);\n }\n\n // for (let i = 0; i < snippets.length; i++) {\n // console.log(snippets[i].type)\n // }\n\n } else {\n // Backward compatible OR if slider param not set\n\n // Hide slider snippet if slick is not included\n var bHideSliderSnippet = true;\n if(parent._cb.win.jQuery) {\n if(parent._cb.win.jQuery.fn.slick) {\n bHideSliderSnippet = false;\n }\n }\n if(bHideSliderSnippet){\n const result = snippets.filter((item)=>{\n return item.type !== 'slick';\n });\n snippets = [...result];\n } \n\n if(!(parent._cb.win.Glide)){\n const result = snippets.filter((item)=>{\n return !(item.glide || item.type === 'glide');\n });\n snippets = [...result];\n }\n\n // for (let i = 0; i < snippets.length; i++) {\n // console.log(snippets[i].type)\n // }\n\n }\n \n\n for (let i = 0; i <snippets.length; i++) {\n \n snippets[i].id = i+1;\n var thumb = snippets[i].thumbnail;\n \n thumb = snippetPath + thumb;\n \n if (snippets[i].category === defaultSnippetCategory + '') {\n designlist.insertAdjacentHTML('beforeend', '<li class="active" role="button" tabindex="0" data-id="' + snippets[i].id + '" data-cat="' + snippets[i].category + '"><img src="' + thumb + '"><span class="is-overlay"></span></li>');\n \n var newitem = designlist.querySelector('[data-id="' + snippets[i].id + '"]');\n newitem.addEventListener('click', function(e){\n \n var snippetid = e.target.parentNode.getAttribute('data-id');\n addSnippet(snippetid);\n \n });\n \n newitem.addEventListener('keydown', (e)=>{\n\n if ((e.which === 9 && !e.shiftKey)) { // tab\n let last = false;\n if(e.target.nextElementSibling) {\n if(!e.target.nextElementSibling.classList.contains('active')) {\n last = true;\n }\n } else {\n last = true;\n }\n if(last) {\n e.preventDefault();\n let activeTab = categorylist.querySelector('.active');\n if(activeTab) activeTab.focus();\n else {\n activeTab = categorylist.querySelector('.more-snippets');\n activeTab.focus();\n }\n }\n }\n if ((e.which === 9 && e.shiftKey)) { // shift + tab\n let first = false;\n if(e.target.previousElementSibling) {\n if(!e.target.previousElementSibling.classList.contains('active')) {\n first = true;\n }\n } else {\n first = true;\n }\n if(first) {\n e.preventDefault();\n let activeTab = categorylist.querySelector('.active');\n if(activeTab) activeTab.focus();\n else {\n activeTab = categorylist.querySelector('.more-snippets');\n activeTab.focus();\n }\n }\n }\n });\n\n }\n\n }\n \n\n\n\n /*\n elms = categorymore.querySelectorAll('a');\n Array.prototype.forEach.call(elms, function(elm){\n \n elm.addEventListener('click', function(e){\n \n var cat = elm.getAttribute('data-cat');\n if(designlist.querySelectorAll('[data-cat="' + cat + '"]').length === 0) {\n \n for (let i = 0; i <snippets.length; i++) {\n \n var thumb = snippets[i].thumbnail;\n \n thumb = snippetPath + thumb;\n \n if (snippets[i].category === cat) {\n \n designlist.insertAdjacentHTML('beforeend', '<li role="button" tabindex="0" data-id="' + snippets[i].id + '" data-cat="' + snippets[i].category + '"><img src="' + thumb + '"><span class="is-overlay"></span></li>');\n \n var newitem = designlist.querySelector('[data-id="' + snippets[i].id + '"]');\n newitem.addEventListener('click', function(e){\n \n var snippetid = e.target.parentNode.getAttribute('data-id');\n addSnippet(snippetid);\n \n });\n }\n \n } \n }\n \n // Hide all, show items from selected category\n Array.prototype.forEach.call(elms, function(elm){\n elm.className = elm.className.replace('active', '');\n });\n categorymore.className = categorymore.className.replace('active', ''); // hide popup\n //var categorymore_items = categorymore.querySelectorAll('a');\n \n var categorylist = document.querySelector('.is-category-list');\n var categorylist_items = categorylist.querySelectorAll('a'); \n Array.prototype.forEach.call(categorylist_items, function(elm){\n elm.className = elm.className.replace('active', '');\n });\n \n var more = document.querySelector('.more-snippets');\n more.className = more.className.replace('active', '');\n \n var items = designlist.querySelectorAll('div');\n Array.prototype.forEach.call(items, function(elm){\n elm.style.display = 'none';\n elm.classList.remove('active');\n });\n Array.prototype.forEach.call(items, function(elm){\n var catSplit = elm.getAttribute('data-cat').split(',');\n for (var j = 0; j < catSplit.length; j++) {\n if (catSplit[j] == cat) {\n elm.style.display = '';\n elm.classList.add('active');\n }\n }\n });\n \n elm.classList.add('active');\n \n e.preventDefault();\n });\n \n });\n */\n \n var close = document.querySelector('.is-pop-close');\n close.addEventListener('click', function(e){\n var modal = parent.document.querySelector('.is-modal.snippets');\n removeClass(modal, 'active');\n });\n \n // Add document Click event\n document.addEventListener('click', function(e){\n e = e || window.event;\n var target = e.target || e.srcElement; \n \n if(parentsHasClass(target, 'more-snippets')) return;\n if(hasClass(target, 'more-snippets')) return;\n \n var more = document.querySelector('.more-snippets');\n var moreCategories = document.querySelector('.is-more-categories');\n \n more.className = more.className.replace('active', '');\n moreCategories.className = moreCategories.className.replace('active', '');\n });\n \n parent.document.addEventListener('click', function(e){\n var more = document.querySelector('.more-snippets');\n var moreCategories = document.querySelector('.is-more-categories');\n \n more.className = more.className.replace('active', '');\n moreCategories.className = moreCategories.className.replace('active', '');\n });\n \n function addSnippet(snippetid) {\n \n // TODO: var framework = parent._cb.opts.framework;\n var snippetPathReplace = parent._cb.opts.snippetPathReplace;\n var emailMode = parent._cb.opts.emailMode;\n \n // \n for (let i = 0; i <snippets.length; i++) {\n if(snippets[i].id + ''=== snippetid) {\n \n var html = snippets[i].html;\n var noedit = snippets[i].noedit;\n break;\n }\n }\n \n var bSnippet;\n if (html.indexOf('"row') === -1) {\n bSnippet = true; // Just snippet (without row/column grid)\n } else {\n bSnippet = false; // Snippet is wrapped in row/colum\n }\n if (emailMode) bSnippet = false;\n\n if(bSnippet) {\n var quickadd = parent._cb.builderStuff.querySelector('.quickadd');\n var mode = quickadd.getAttribute('data-mode');\n if(!mode) {\n // in case of using viewSnippets() to open the dialog (mode=null) => change to non snippet.\n html = '<div class="row">' +\n '<div class="column full">' +\n html +\n '</div>' +\n '</div>';\n bSnippet=false;\n }\n }\n \n // Convert snippet into your defined 12 columns grid \n var rowClass = parent._cb.opts.row; //row\n var colClass = parent._cb.opts.cols; //['col s1', 'col s2', 'col s3', 'col s4', 'col s5', 'col s6', 'col s7', 'col s8', 'col s9', 'col s10', 'col s11', 'col s12']\n if(rowClass!=='' && colClass.length===12){\n\n //html = html.replace(new RegExp('row clearfix', 'g'), rowClass);\n html = html.replace(new RegExp('row clearfix', 'g'), 'row'); // backward\n html = html.replace(new RegExp('"row', 'g'), '"' + rowClass);\n \n html = html.replace(new RegExp('column full', 'g'), colClass[11]);\n html = html.replace(new RegExp('column half', 'g'), colClass[5]);\n html = html.replace(new RegExp('column third', 'g'), colClass[3]);\n html = html.replace(new RegExp('column fourth', 'g'), colClass[2]);\n html = html.replace(new RegExp('column fifth', 'g'), colClass[1]);\n html = html.replace(new RegExp('column sixth', 'g'), colClass[1]);\n html = html.replace(new RegExp('column two-third', 'g'), colClass[7]);\n html = html.replace(new RegExp('column two-fourth', 'g'), colClass[8]);\n html = html.replace(new RegExp('column two-fifth', 'g'), colClass[9]);\n html = html.replace(new RegExp('column two-sixth', 'g'), colClass[9]);\n }\n \n html = html.replace(/{id}/g, makeid()); // Replace {id} with auto generated id (for custom code snippet)\n \n if(parent._cb.opts.onAdd){\n html = parent._cb.opts.onAdd(html);\n }\n\n if(snippetPathReplace.length>0) {\n if (snippetPathReplace[0] != '') {\n var regex = new RegExp(snippetPathReplace[0], 'g');\n html = html.replace(regex, snippetPathReplace[1]);\n\n /* for encoded replace, change / to %2F */\n var slash = new RegExp('/', 'g');\n var snippetPathReplace_0 = snippetPathReplace[0].replace(slash, '%2F');\n var snippetPathReplace_1 = snippetPathReplace[1].replace(slash, '%2F');\n regex = new RegExp(snippetPathReplace_0, 'g');\n html = html.replace(regex, snippetPathReplace_1);\n }\n }\n \n parent._cb.addSnippet(html, bSnippet, noedit);\n \n var modal = parent.document.querySelector('.is-modal.snippets');\n removeClass(modal, 'active');\n \n }\n \n function hasClass(element, classname) {\n if(!element) return false;\n return element.classList ? element.classList.contains(classname) : new RegExp('\\b'+ classname+'\\b').test(element.className);\n }\n \n function removeClass(element, classname) {\n if(!element) return;\n if(element.classList.length>0) {\n element.className = element.className.replace(classname, '');\n }\n }\n \n function parentsHasClass(element, classname) {\n while (element) {\n if(element.tagName === 'BODY' || element.tagName === 'HTML') return false;\n if(!element.classList) return false;\n if (element.classList.contains(classname)) {\n return true;\n }\n element = element.parentNode;\n }\n }\n \n function makeid() {//http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript\n var text = "";\n var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";\n for (var i = 0; i < 2; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n \n var text2 = "";\n var possible2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";\n for (var i = 0; i < 5; i++)\n text2 += possible2.charAt(Math.floor(Math.random() * possible2.length));\n \n return text + text2;\n }\n \n <\/script>\n \n </textarea>\n </body>\n \n </html>\n `}}const e=e=>{const i=e.util,n=e.builderStuff,o=e.dom;let s=n.querySelector(".quickadd");if(!s){const l=`<div class="is-pop quickadd arrow-right" style="z-index:10003;" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-pop-close" style="display:none;z-index:1;width:40px;height:40px;position:absolute;top:0px;right:0px;box-sizing:border-box;padding:0;line-height:40px;font-size: 12px;color:#777;text-align:center;cursor:pointer;"><svg class="is-icon-flex" style="width:40px;height:40px;"><use xlink:href="#ion-ios-close-empty"></use></svg></div>\n <div class="is-pop-tabs">\n <div class="is-pop-tab-item" data-value="left">${i.out("Add to Left")}</div>\n <div class="is-pop-tab-item active" data-value="right">${i.out("Add to Right")}</div>\n </div>\n <div style="padding:12px;display:flex;flex-direction:row;flex-flow: wrap;justify-content: center;align-items: center;">\n <button title="${i.out("Paragraph")}" class="add-paragraph"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#icon-align-full"></use></svg></span>${i.out("Paragraph")}</button>\n <button title="${i.out("Headline")}" class="add-headline"><span style="font-family:serif;display:block;margin:0 0 8px;font-size:11px;">H</span>${i.out("Headline")}</button>\n <button title="${i.out("Image")}" class="add-image"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex ion-image" style="width:14px;height:14px;"><use xlink:href="#ion-image"></use></svg></span>${i.out("Image")}</button>\n <button title="${i.out("List")}" class="add-list"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#icon-list-bullet"></use></svg></span>${i.out("List")}</button>\n <button title="${i.out("Heading 1")}" class="add-heading1"><span style="font-family:serif;display:block;margin:0 0 8px;">H1</span>${i.out("Heading 1")}</button>\n <button title="${i.out("Heading 2")}" class="add-heading2"><span style="font-family:serif;display:block;margin:0 0 8px;">H2</span>${i.out("Heading 2")}</button>\n <button title="${i.out("Heading 3")}" class="add-heading3"><span style="font-family:serif;display:block;margin:0 0 8px;">H3</span>${i.out("Heading 3")}</button>\n <button title="${i.out("Heading 4")}" class="add-heading4"><span style="font-family:serif;display:block;margin:0 0 8px;">H4</span>${i.out("Heading 4")}</button>\n <button title="${i.out("Quote")}" class="add-quote"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-quote"></use></svg></span>${i.out("Quote")}</button>\n <button style="display:none" title="${i.out("Preformatted")}" class="add-preformatted"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-code"></use></svg></span>${i.out("Preformatted")}</button>\n ${e.opts.emailMode?"":`<button title="${i.out("Button")}" class="add-button"><span style="display:block;margin:0 0 8px;"><span style="display:inline-block;border:#a1a1a1 1px solid;background:#f3f3f3;width:10px;height:4px;"></span></span>${i.out("Button")}</button>`}\n ${e.opts.emailMode?"":`<button title="${i.out("Two Button")}" class="add-twobutton"><span style="display:block;margin:0 0 8px;"><span style="display:inline-block;border:#a1a1a1 1px solid;background:#f3f3f3;width:10px;height:4px;"></span></span>${i.out("Two Button")}</button>`}\n <button title="${i.out("Map")}" class="add-map"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-location"></use></svg></use></svg></svg></span>${i.out("Map")}</button>\n <button title="${i.out("Youtube")}" class="add-youtube"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-social-youtube-outline"></use></svg></use></svg></svg></span>${i.out("Youtube")}</button>\n <button title="${i.out("Video")}" class="add-video"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-ios-play"></use></svg></use></svg></svg></span>${i.out("Video")}</button>\n <button style="display:none" title="${i.out("Audio")}" class="add-audio"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-volume-medium"></use></svg></use></svg></svg></span>${i.out("Audio")}</button>\n <button title="${i.out("Icon")}" class="add-icon"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-android-happy"></use></svg></use></svg></svg></span>${i.out("Icon")}</button>\n <button title="${i.out("SVG")}" class="add-svg"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-5px"><use xlink:href="#icon-svg"></use></svg></use></svg></svg></span>${i.out("SVG")}</button>\n <button title="${i.out("Table")}" class="add-table"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:15px;height:15px;"><use xlink:href="#icon-table"></use></svg></use></svg></svg></span>${i.out("Table")}</button>\n <button title="${i.out("Social Links")}" class="add-social"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-social-twitter"></use></svg></use></svg></svg></span>${i.out("Social Links")}</button>\n <button title="${i.out("HTML/JS")}" class="add-code"><span style="display:block;margin:0 0 8px;"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#icon-code"></use></svg></use></svg></svg></span>${i.out("HTML/JS")}</button>\n <button title="${i.out("Spacer")}" class="add-spacer"><span style="display:block;margin:0 0 8px;"><span style="display:inline-block;background:#eee;width:30px;height:5px;"></span></span>${i.out("Spacer")}</button>\n <button style="display:none" title="${i.out("Line")}" class="add-line"><span style="display:block;margin:0 0 8px;"><span style="display:inline-block;background:#ddd;width:30px;height:2px;"></span></span>${i.out("Line")}</button>\n <div class="pop-separator"></div>\n <button title="${i.out("More...")}" class="add-more" style="flex-direction:initial;">${i.out("More...")}</button>\n </div>\n </div>\n `;o.appendHtml(n,l),s=n.querySelector(".quickadd");let a=s.querySelectorAll(".is-pop-tab-item");Array.prototype.forEach.call(a,(t=>{o.addEventListener(t,"click",(t=>{let e=s.querySelectorAll(".is-pop-tab-item");Array.prototype.forEach.call(e,(t=>{o.removeClass(t,"active")})),o.addClass(t.target,"active"),"left"===s.querySelector(".active").getAttribute("data-value")?s.setAttribute("data-mode","cell-left"):s.setAttribute("data-mode","cell-right")}))}));let r=s.querySelector(".add-paragraph");o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent("<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. \n Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, \n when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>",t)})),r=s.querySelector(".add-headline"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<div class="display">\n <h1>Headline Goes Here</h1>\n <p>Lorem Ipsum is simply dummy text</p>\n </div>',t)})),r=s.querySelector(".add-image"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");let n=`<img src="${e.opts.snippetPath}example.png" alt="" />`;e.opts.snippetSampleImage&&(n=`<img src="${e.opts.snippetSampleImage}" alt="" />`),i.addContent(n,t)})),r=s.querySelector(".add-heading1"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent("<h1>Heading 1 here</h1>",t)})),r=s.querySelector(".add-heading2"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent("<h2>Heading 2 here</h2>",t)})),r=s.querySelector(".add-heading3"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent("<h3>Heading 3 here</h3>",t)})),r=s.querySelector(".add-heading4"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent("<h4>Heading 4 here</h4>",t)})),r=s.querySelector(".add-preformatted"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent("<pre>Lorem Ipsum is simply dummy text of the printing and typesetting industry. \n Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, \n when an unknown printer took a galley of type and scrambled it to make a type specimen book.</pre>",t)})),r=s.querySelector(".add-list"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<ul style="list-style: initial;padding-left: 20px;">\n <li>Lorem Ipsum is simply dummy text</li>\n <li>Lorem Ipsum is simply dummy text</li>\n </ul>',t)})),r=s.querySelector(".add-quote"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('\n <div class="text-left">\n <i class="icon ion-quote size-28"></i>\n </div>\n <p class="size-21 leading-14">It\'s easy to use, customizable, and user-friendly. A truly amazing features.</p>\n ',t)})),r=s.querySelector(".add-button"),r&&o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");let n='<div>\n <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-14 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Read More</a>\n </div>';e.opts.emailMode&&(n='<div><a href="#" role="button" style="margin-top: ;margin-right: ;margin-bottom: ;margin-left: ;display: inline-block; text-decoration: none; transition: all 0.16s ease 0s; border-style: solid; cursor: pointer; background-color: rgb(220, 220, 220); color: rgb(0, 0, 0); border-color: rgb(220, 220, 220); border-width: 2px; border-radius: 0px; padding: 13px 28px; line-height: 21px; text-transform: uppercase; font-weight: 400; font-size: 14px; letter-spacing: 3px;">Read More</a></div>'),i.addContent(n,t)})),r=s.querySelector(".add-twobutton"),r&&o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");let n='<div>\n <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-14 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Read More</a>\n <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-14 rounded tracking-wide">Get Started</a>\n </div>';e.opts.emailMode&&(n='<div>\n <a href="#" role="button" style="margin-top: ;margin-right: ;margin-bottom: ;margin-left: ;display: inline-block; text-decoration: none; transition: all 0.16s ease 0s; border-style: solid; cursor: pointer; background-color: rgb(220, 220, 220); color: rgb(0, 0, 0); border-color: rgb(220, 220, 220); border-width: 2px; border-radius: 0px; padding: 13px 28px; line-height: 21px; text-transform: uppercase; font-weight: 400; font-size: 14px; letter-spacing: 3px;">Read More</a> &nbsp;\n <a href="#" role="button" style="display: inline-block; text-decoration: none; transition: all 0.16s ease 0s; border-style: solid; cursor: pointer; background-color: rgba(0, 0, 0, 0); border-color: rgb(53, 53, 53); border-width: 2px; border-radius: 0px; padding: 13px 28px; line-height: 21px; text-transform: uppercase; font-weight: 600; font-size: 14px; letter-spacing: 3px; color: rgb(53, 53, 53);">Get Started</a>\n </div>'),i.addContent(n,t)})),r=s.querySelector(".add-spacer"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<div class="spacer height-80"></div>',t)})),r=s.querySelector(".add-line"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent("<hr>",t)})),r=s.querySelector(".add-code"),o.addEventListener(r,"click",(()=>{let t='<div class="row"><div class="column full" data-noedit data-html="'+encodeURIComponent("<h1 id=\"{id}\">Lorem ipsum</h1><p>This is a code block. You can edit this block using the source dialog.</p><script>var docReady = function (fn) {var stateCheck = setInterval(function () {if (document.readyState !== \"complete\") return;clearInterval(stateCheck);try{fn()}catch(e){}}, 1);};docReady(function() {document.querySelector('#{id}').innerHTML ='<b>Hello World..!</b>';});<\/script>")+'"></div></div>',n=e.opts.snippetPathReplace,o=e.opts.row,s=e.opts.cols;if(""!==o&&12===s.length&&(t=t.replace(new RegExp("row clearfix","g"),"row"),t=t.replace(new RegExp('"row',"g"),'"'+o),t=t.replace(new RegExp("column full","g"),s[11]),t=t.replace(new RegExp("column half","g"),s[5]),t=t.replace(new RegExp("column third","g"),s[3]),t=t.replace(new RegExp("column fourth","g"),s[2]),t=t.replace(new RegExp("column fifth","g"),s[1]),t=t.replace(new RegExp("column sixth","g"),s[1]),t=t.replace(new RegExp("column two-third","g"),s[7]),t=t.replace(new RegExp("column two-fourth","g"),s[8]),t=t.replace(new RegExp("column two-fifth","g"),s[9]),t=t.replace(new RegExp("column two-sixth","g"),s[9])),t=t.replace(/{id}/g,i.makeId()),e.opts.onAdd&&(t=e.opts.onAdd(t)),n.length>0&&""!==n[0]){let e=new RegExp(n[0],"g");t=t.replace(e,n[1])}e.addSnippet(t,!1,!0)})),r=s.querySelector(".add-table"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<table class="default" style="border-collapse:collapse;width:100%;">\n <thead>\n <tr>\n <td style="vertical-align:top;"><br></td>\n <td style="vertical-align:top;"><br></td>\n </tr>\n </thead>\n <tr>\n <td style="vertical-align:top;"><br></td>\n <td style="vertical-align:top;"><br></td>\n </tr>\n </table>',t)})),r=s.querySelector(".add-icon"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<div style="text-align: center;">\n <i class="icon ion-android-alarm-clock size-80"></i>\n </div>',t)})),r=s.querySelector(".add-svg"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<div style="text-align: center;">\n <svg viewBox="0 0 259.25 969.39" xmlns="http://www.w3.org/2000/svg" style="fill: rgb(100 177 45); width: 150px; height: 150px;">\n <g>\n <path d="M184,17.61S101.39,318.78,98.85,334,69.62,463.64,67.08,517s-16.52,141,19.06,202,86.41,110.56,151.21,75S320,675.85,320,675.85s16.52-179.17-58.45-414.26S184,17.61,184,17.61Z" transform="translate(-62.25 -17.61)"></path>\n <path d="M190.34,179l-7.63,319s-28-17.79-30.49-24.15-20.34-26.68-20.34-26.68,15.25,36.85,20.34,40.66,26.68,34.31,26.68,34.31l-1.27,181.72,1.27,274.47s11.44,17.79,14,2.54,3.81-305,3.81-305,34.31-78.79,41.94-95.3,12.7-39.4,12.7-39.4-45.74,87.68-50.83,94-6.35-231.28-6.35-231.28,11.44,6.36,22.87-33,7.63-52.1,7.63-52.1-14,45.74-20.33,55.91S190.34,179,190.34,179Z" transform="translate(-62.25 -17.61)" style="fill:#ededed"></path>\n </g>\n </svg>\n </div>',t)})),r=s.querySelector(".add-social"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('\n <div class="is-social text-left">\n <a href="https://twitter.com/"><i class="bi bi-twitter-x"></i></a>\n <a href="https://www.facebook.com/"><i class="bi bi-facebook"></i></a>\n <a href="https://www.instagram.com/" title=""><i class="icon bi bi-instagram"></i></a>\n </div>\n ',t)})),r=s.querySelector(".add-map"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<div class="embed-responsive embed-responsive-16by9">\n <iframe width="100%" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" class="mg1" src="https://maps.google.com/maps?q=Melbourne,+Victoria,+Australia&amp;hl=en&amp;sll=-7.981898,112.626504&amp;sspn=0.009084,0.016512&amp;oq=melbourne&amp;hnear=Melbourne+Victoria,+Australia&amp;t=m&amp;z=10&amp;output=embed"></iframe>\n </div>',t)})),r=s.querySelector(".add-youtube"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");i.addContent('<div class="embed-responsive embed-responsive-16by9">\n <iframe width="560" height="315" src="https://www.youtube.com/embed/P5yHEKqx86U?rel=0" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>\n </div>',t)})),r=s.querySelector(".add-video"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");let n=`<video style="width: 100%;" loop="" autoplay="">\n <source src="${e.opts.snippetPath}example.mp4" type="video/mp4"></video>`;e.opts.snippetSampleVideo&&(n=`<video style="width: 100%;" loop="" autoplay="">\n <source src="${e.opts.snippetSampleVideo}" type="video/mp4"></video>`),i.addContent(n,t)})),r=s.querySelector(".add-audio"),o.addEventListener(r,"click",(()=>{const t=s.getAttribute("data-mode");let n=`<div style="display:flex;width:100%;position:relative;margin:15px 0;background:transparent;">\n <audio controls="" style="width:100%">\n <source src="${e.opts.snippetPath}example.mp3" type="audio/mpeg">\n Your browser does not support the audio element.\n </audio>\n </div>`;e.opts.snippetSampleAudio&&(n=`<div style="display:flex;width:100%;position:relative;margin:15px 0;background:transparent;">\n <audio controls="" style="width:100%">\n <source src="${e.opts.snippetSampleAudio}" type="audio/mpeg">\n Your browser does not support the audio element.\n </audio>\n </div>`),i.addContent(n,t)}));const c=new t(e);r=s.querySelector(".add-more"),o.addEventListener(r,"click",(()=>{let t=n.querySelector(".snippets");i.showModal(t,!1,null,!1);const e=t.querySelector("iframe");""===e.contentWindow.document.body.innerHTML&&(e.srcdoc=c.getSnippetsHtml()),i.hidePop(s)}))}return s};class i{constructor(t){this.builder=t,this.dom=this.builder.dom}cellSelected(){return this.builder.doc.querySelector(".cell-active")}rowSelected(){return this.builder.doc.querySelector(".row-active")}builderStuff(){return document.querySelector("#_cbhtml")}cellNext(t){const e=this.dom;let i=t.nextElementSibling;return i?e.hasClass(i,"is-row-tool")||e.hasClass(i,"is-col-tool")||e.hasClass(i,"is-rowadd-tool")||e.hasClass(i,"is-row-overlay")?null:i:null}out(t){if(this.builder){let e=this.builder.opts.lang[t];return e||(this.builder.checkLang&&console.log(t),t)}return t}showMessage(t,e,i){const n=this.dom;let o="";o=`<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-top: 15px;padding-bottom: 20px;max-width: 450px;">\n <div style="margin: 20px 0 30px;font-size: 17px;">${t}</div>\n <button title="${this.out("Ok")}" class="input-ok classic">${this.out("Ok")}</button>\n </div>\n </div>`;const s=this.builder.builderStuff;let l=s.querySelector(".modalmessage");l||(n.appendHtml(s,o),l=s.querySelector(".modalmessage")),this.showModal(l,!1,(()=>{l.parentNode.removeChild(l),i&&i()}));let a=l.querySelector(".modalmessage .input-ok");n.addEventListener(a,"click",(()=>{this.hideModal(l),l.parentNode&&l.parentNode.removeChild(l),i&&i()})),a.focus(),e&&a.classList.add("focus-outline")}showChoice(t,e,i){const n=this.dom;let o="";o=`<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-top: 15px;padding-bottom: 20px;max-width: 450px;">\n <div style="margin: 20px 0 30px;font-size: 17px;">${t}</div>\n\n <div style="display:flex;">\n <button title="${this.out("Cancel")}" class="input-cancel classic-secondary" style="width:100%;margin-right:4px;">${this.out("Cancel")}</button>\n <button title="${e}" class="input-ok classic-primary" style="width:100%">${e}</button>\n </div>\n </div>\n </div>`;const s=this.builder.builderStuff;let l=s.querySelector(".modalmessage");l||(n.appendHtml(s,o),l=s.querySelector(".modalmessage")),this.showModal(l,!1,(()=>{l.parentNode.removeChild(l),i(!1)}));let a=l.querySelector(".modalmessage .input-cancel");n.addEventListener(a,"click",(()=>{this.hideModal(l),l.parentNode.removeChild(l),i(!1)})),a.focus();let r=l.querySelector(".modalmessage .input-ok");n.addEventListener(r,"click",(()=>{this.hideModal(l),l.parentNode.removeChild(l),i(!0)}))}confirm(t,e,i,n,o){if(!this.builder.deleteConfirm&&!o)return void e(!0);const s=this.dom;let l="";l=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Delete")}" class="input-ok classic focus-warning">${this.out("Delete")}</button>\n </div>\n </div>`,i&&(l=`<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="padding-bottom:20px;">\n <div style="margin: 20px 0 30px;font-size: 14px;">${t}</div>\n <button title="${this.out("Cancel")}" class="input-cancel classic-secondary">${this.out("Cancel")}</button>\n <button title="${n}" class="input-ok classic-primary">${n}</button>\n </div>\n </div>`);const a=this.builder.builderStuff;let r=a.querySelector(".is-confirm");r||(s.appendHtml(a,l),r=a.querySelector(".is-confirm")),this.showModal(r,!1,(()=>{r.parentNode.removeChild(r),e(!1)}),!0);let c=r.querySelector(".is-confirm .input-ok");s.addEventListener(c,"click",(()=>{this.hideModal(r),r.parentNode.removeChild(r),e(!0)}));let u=r.querySelector(".is-confirm .input-cancel");s.addEventListener(u,"click",(t=>{this.hideModal(r),r.parentNode.removeChild(r),e(!1),t.preventDefault(),t.stopImmediatePropagation()})),c&&c.focus()}showRtePop(t,e,i){const n=this.dom;t.style.display="flex",e&&e(),n.removeClass(t,"deactive"),n.addClass(t,"active");const o=e=>{"input"===document.activeElement.tagName.toLowerCase()&&t.contains(document.activeElement)||t.contains(e.target)||i.contains(e.target)||e.target.closest(".pickcolormore")||(this.hideRtePop(t),t.removeEventListener("keydown",s),document.removeEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",o))},s=e=>{27===e.keyCode&&(this.hideRtePop(t),t.removeEventListener("keydown",s),document.removeEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",o))};t.addEventListener("keydown",s),document.addEventListener("click",o),this.builder.iframeDocument&&this.builder.doc.addEventListener("click",o)}hideRtePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),e.addClass(t,"deactive")}clearAllEventListener(t){for(let e=0;e<10;e++)t.removeEventListener("keydown",this.handlePopKeyDown),document.removeEventListener("click",this.handlePopClickOut),this.builder.iframeDocument&&this.builder.doc.removeEventListener("click",this.handlePopClickOut)}showPop(t,e,i){const n=this.dom;let o=document.querySelectorAll(".is-pop.active");Array.prototype.forEach.call(o,(e=>{e!==t&&(e.style.display="",n.removeClass(e,"active"),e.setAttribute("aria-hidden",!0))})),this.clearAllEventListener(t),t.style.display="flex",n.addClass(t,"active"),t.setAttribute("aria-hidden",!1),this.setupTabKeys(t),t.focus({preventScroll:!0}),this.handlePopClickOut=n=>{t.contains(n.target)||i.contains(n.target)||(this.hidePop(t),e&&e())},this.handlePopKeyDown=i=>{27===i.keyCode&&(this.hidePop(t),e&&e())},t.addEventListener("keydown",this.handlePopKeyDown),document.addEventListener("click",this.handlePopClickOut),this.builder.iframeDocument&&this.builder.doc.addEventListener("click",this.handlePopClickOut)}hidePop(t){const e=this.dom;t.style.display="",e.removeClass(t,"active"),t.setAttribute("aria-hidden",!0),this.clearAllEventListener(t)}setupTabKeys(t){let e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0],n=e[e.length-1];n.addEventListener("keydown",(n=>{9!==n.which||n.shiftKey||(n.preventDefault(),e=t.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])'),i=e[0],i.focus())})),i.addEventListener("keydown",(t=>{9===t.which&&t.shiftKey&&(t.preventDefault(),n.focus())}));t.querySelectorAll("iframe").forEach((t=>{t.addEventListener("focus",(()=>{const e=t.contentWindow.document.querySelectorAll('a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([tabindex="-1"]), iframe, object, embed, *[tabindex]:not([tabindex="-1"])');if(0===e.length)return;let i=e[0];i&&i.focus()}))}))}showModal(t,e,i,n,o){const s=this.dom;s.addClass(t,"active"),t.setAttribute("aria-hidden",!1),o&&(document.body.style.overflow="hidden");const l=e=>{if(27===e.keyCode){o&&(document.body.style.overflow=""),s.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",l);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",u),i&&i()}};t.addEventListener("keydown",l);let a=t.querySelector(".is-tab-content.active");a?(a.focus(),this.builder.tabs.setupTabKey(a)):(this.setupTabKeys(t),t.focus());let r=!1;if(this.builder?this.builder.opts.animateModal&&(r=!0,n||(r=!1)):n&&(r=!0),r&&this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.style.transform=`scale(${this.builder.opts.zoom-.02})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom-.02})`,t.style.MozTransform=`scale(${this.builder.opts.zoom-.02})`,t.setAttribute("scaled-down","1")}))}const c=t.querySelector(".is-modal-overlay");if(c&&c.parentNode.removeChild(c),!t.querySelector(".is-modal-overlay")){let n;if(n=e?'<div class="is-modal-overlay overlay-stay"></div>':'<div class="is-modal-overlay"></div>',t.insertAdjacentHTML("afterbegin",n),!e){let e=t.querySelector(".is-modal-overlay");s.addEventListener(e,"click",(()=>{o&&(document.body.style.overflow=""),this.hideModal(t),t.removeEventListener("keydown",l);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",u),i&&i()}))}}const u=()=>{o&&(document.body.style.overflow=""),s.hasClass(t,"active")&&this.hideModal(t),t.removeEventListener("keydown",l);const e=t.querySelector(".is-modal-close");e&&e.removeEventListener("click",u),i&&i()},d=t.querySelector(".is-modal-close");d&&s.addEventListener(d,"click",u)}_hideModal(t){let e=t.querySelector(".is-modal-overlay");e?e.classList.contains("overlay-stay")?(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1}))):e.click():(this.hideModal(t),t.dispatchEvent(new KeyboardEvent("keydown",{key:"e",keyCode:27,code:"KeyE",which:27,shiftKey:!1,ctrlKey:!1,metaKey:!1})))}hideModal(t){if(t.setAttribute("aria-hidden",!0),this.builder){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{t.getAttribute("scaled-down")&&(t.style.transform=`scale(${this.builder.opts.zoom})`,t.style.WebkitTransform=`scale(${this.builder.opts.zoom})`,t.style.MozTransform=`scale(${this.builder.opts.zoom})`,t.removeAttribute("scaled-down"))}))}this.dom.removeClass(t,"active"),t.style.display=""}refreshModuleLayout(t){let e;t.style.height?e=t.style.height:t.style.height=`${t.offsetHeight}px`,t.style.opacity=0;let i=decodeURIComponent(t.getAttribute("data-html"));i=i.replace(/{id}/g,this.builder.util.makeId()),t.innerHTML="";let n=document.createRange();n.setStart(t,0),t.appendChild(n.createContextualFragment(i));let o=t.querySelectorAll("[data-subblock]");var s=1;Array.prototype.forEach.call(o,(e=>{t.getAttribute("data-html-"+s)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+s)),e.contentEditable=!0),s++})),setTimeout((()=>{t.style.height=e||"",t.style.opacity=""}),100)}removeColClasses(t){t.classList.remove("full"),t.classList.remove("two-third"),t.classList.remove("two-fourth"),t.classList.remove("two-fifth"),t.classList.remove("two-sixth"),t.classList.remove("half"),t.classList.remove("third"),t.classList.remove("fourth"),t.classList.remove("fifth"),t.classList.remove("sixth"),t.classList.remove("seventh"),t.classList.remove("eighth"),t.classList.remove("ninth"),t.classList.remove("tenth"),t.classList.remove("eleventh"),t.classList.remove("twelfth")}getAllColumns(t){let e=[];const i=this.dom;return i.elementChildren(t).forEach((t=>{i.hasClass(t,"is-row-tool")||i.hasClass(t,"is-col-tool")||i.hasClass(t,"is-rowadd-tool")||i.hasClass(t,"is-row-overlay")||e.push(t)})),e}fixLayout(t){const e=this.dom;let i=!1,n=!1;if(Array.from(t.children).map((e=>{e.classList.contains("is-row-tool")||e.classList.contains("is-col-tool")||e.classList.contains("is-rowadd-tool")||(e.getAttribute("data-html")?(e.style.width||(e.style.width="50%",e.style.flex="0 0 auto"),1===this.getAllColumns(t).length&&(e.style.width="",e.style.flex="")):(e.style.width="",e.style.flex=""),e.classList.contains("sm-hidden")&&(i=!0),e.classList.contains("md-hidden")&&(n=!0))})),i?t.classList.add("sm-autofit"):t.classList.remove("sm-autofit"),n?t.classList.add("md-autofit"):t.classList.remove("md-autofit"),this.builder.useDefaultGrid){return e.elementChildren(t).forEach((t=>{e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay")||this.removeColClasses(t)})),void Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}let o=3;t.querySelector(".is-row-overlay")&&(o=4);const s=t.childElementCount-o,l=this.builder.opts.row;let a=this.builder.opts.cols;const r=this.builder.opts.colequal;if(r.length>0){return e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){for(let i=0;i<=a.length-1;i++)e.removeClass(t,a[i]);for(let i=0;i<=r.length-1;i++)if(r[i].length===s){e.addClass(t,r[i][0]);break}1===s&&e.addClass(t,a[a.length-1])}})),void Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}if(""!==l&&a.length>0){let i=0;e.elementChildren(t).forEach((t=>{if(!(e.hasClass(t,"is-row-tool")||e.hasClass(t,"is-col-tool")||e.hasClass(t,"is-rowadd-tool")||e.hasClass(t,"is-row-overlay"))){-1!==t.className.indexOf("col-md-")||(-1!==t.className.indexOf("col-sm-")?a=["col-sm-1","col-sm-2","col-sm-3","col-sm-4","col-sm-5","col-sm-6","col-sm-7","col-sm-8","col-sm-9","col-sm-10","col-sm-11","col-sm-12"]:-1!==t.className.indexOf("col-xs-")?a=["col-xs-1","col-xs-2","col-xs-3","col-xs-4","col-xs-5","col-xs-6","col-xs-7","col-xs-8","col-xs-9","col-xs-10","col-xs-11","col-xs-12"]:-1!==t.className.indexOf("col-lg-")?a=["col-lg-1","col-lg-2","col-lg-3","col-lg-4","col-lg-5","col-lg-6","col-lg-7","col-lg-8","col-lg-9","col-lg-10","col-lg-11","col-lg-12"]:-1!==t.className.indexOf("col-xl-")?a=["col-xl-1","col-xl-2","col-xl-3","col-xl-4","col-xl-5","col-xl-6","col-xl-7","col-xl-8","col-xl-9","col-xl-10","col-xl-11","col-xl-12"]:-1!==t.className.indexOf("col-xxl-")&&(a=["col-xxl-1","col-xxl-2","col-xxl-3","col-xxl-4","col-xxl-5","col-xxl-6","col-xxl-7","col-xxl-8","col-xxl-9","col-xxl-10","col-xxl-11","col-xxl-12"])),i++;for(var n=0;n<=a.length-1;n++)e.removeClass(t,a[n]);1===s&&e.addClass(t,a[11]),2===s&&e.addClass(t,a[5]),3===s&&e.addClass(t,a[3]),4===s&&e.addClass(t,a[2]),5===s&&(5===i?e.addClass(t,a[3]):e.addClass(t,a[1])),6===s&&e.addClass(t,a[1]),7===s&&(i>=6?e.addClass(t,a[0]):e.addClass(t,a[1])),8===s&&(i>=5?e.addClass(t,a[0]):e.addClass(t,a[1])),9===s&&(i>=4?e.addClass(t,a[0]):e.addClass(t,a[1])),10===s&&(i>=3?e.addClass(t,a[0]):e.addClass(t,a[1])),11===s&&(i>=2?e.addClass(t,a[0]):e.addClass(t,a[1])),12===s&&e.addClass(t,a[0])}}))}Array.from(t.children).map((t=>{t.classList.contains("is-row-tool")||t.classList.contains("is-rowadd-tool")||t.classList.contains("is-col-tool")||t.getAttribute("data-module")&&this.refreshModuleLayout(t)}))}addContent(t,e,i){const n=this.dom;this.builder.opts.onAdd&&(t=this.builder.opts.onAdd(t));const o=this.cellSelected();let s;if(o)s=o.parentNode;else{let t=this.builder.activeElement;if(t&&t.closest(".is-block"));else{if(s=this.builder.doc.querySelector(".row-active"),!s)return;e="row"}}if("cell"===e||"cell-left"===e||"cell-right"===e){let l=4;this.builder.maxColumns&&(l=this.builder.maxColumns);let a,r=3;if(s.querySelector(".is-row-overlay")&&(r=4),s.childElementCount>=l+r)return alert(this.out("You have reached the maximum number of columns")),!1;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){let e=this.builder.opts.cellFormat,i=e.indexOf("</");t=e.substring(0,i)+t+e.substring(i),a=this.createElementFromHTML(t)}else{a=o.cloneNode(!0),a.removeAttribute("data-noedit"),a.removeAttribute("data-protected"),a.removeAttribute("data-module"),a.removeAttribute("data-module-desc"),a.removeAttribute("data-dialog-width"),a.removeAttribute("data-html"),a.removeAttribute("data-settings");for(let t=1;t<=20;t++)a.removeAttribute("data-html-"+t);a.removeAttribute("data-noedit"),n.removeClass(a,"cell-active"),n.removeClass(a,"is-light-text"),n.removeClass(a,"is-dark-text"),n.removeClass(a,"padding-0"),n.removeClass(a,"p-0"),a.removeAttribute("data-click"),a.removeAttribute("style"),i&&a.setAttribute(i,""),a.innerHTML=t}s.insertBefore(a,o),"cell"!==e&&"cell-right"!==e||n.moveAfter(a,o);let c=this.builder.doc.querySelector(".builder-active");c&&this.builder.applyBehaviorOn(c),this.fixLayout(s),a.click()}if("row"===e){let e,o;if(this.builder.uo.saveForUndo(),""===this.builder.opts.row){e=this.htmlToElement(this.builder.opts.rowFormat);let s=this.builder.opts.cellFormat,l=s.indexOf("</");t=s.substring(0,l)+t+s.substring(l);let a=n.elementChildren(e);for(;a.length>0&&(a=a[0],n.elementChildren(a).length>0);)a=n.elementChildren(a);a.innerHTML=t,o=a.firstChild,i&&o.setAttribute(i,"")}else o=n.createElement("div"),n.addClass(o,this.builder.opts.cols[this.builder.opts.cols.length-1]),o.innerHTML=t,i&&o.setAttribute(i,""),e=n.createElement("div"),n.addClass(e,this.builder.opts.row),n.appendChild(e,o);s.parentNode.insertBefore(e,s),n.moveAfter(e,s);let l=this.builder.doc.querySelector(".builder-active");l&&this.builder.applyBehaviorOn(l),o.click()}if("elm"===e){let e=this.builder.activeElement;if(!e)return;this.builder.uo.saveForUndo();let i=e;i.insertAdjacentHTML("afterend",t);let n=this.builder.doc.querySelector(".builder-active");n&&this.builder.applyBehaviorOn(n);let o=i.nextElementSibling;if("img"===o.tagName.toLowerCase()){let t=setInterval((()=>{o.complete&&(o.click(),clearInterval(t))}),30)}else o.click();let s=this.builder.builderStuff.querySelector(".quickadd");this.hidePop(s)}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}htmlToElement(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild}addSnippet(t,e,i){this.builder.uo.saveForUndo();const n=this.dom;let o,s,l,a=!1;let r,c=this.builder.builderStuff.querySelector(".quickadd");if(r=c?c.getAttribute("data-mode"):"row",!e||"cell"!==r&&"cell-left"!==r&&"cell-right"!==r){if(e&&"row"===r){let e;if(l=document.createElement("div"),l.className=this.builder.opts.cols[this.builder.opts.cols.length-1],l.innerHTML=t,i&&l.setAttribute("data-noedit",""),o=document.createElement("div"),o.className=this.builder.opts.row,o.appendChild(l),s=this.builder.cellSelected(),s?e=s.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(a=!0)),a){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],o=n.elementChildren(i);e=o[o.length-1]}e.parentNode.insertBefore(o,e),n.moveAfter(o,e);let r=this.builder.doc.querySelector(".builder-active");r||(r=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(r),l.click(),o.className=o.className.replace("row-outline",""),this.builder.util.hideColumnTool()}else{if(e)return void(i?this.addContent(t,r,"data-noedit"):this.addContent(t,r));{var u=document.createElement("div");u.innerHTML=t;var d=u.querySelectorAll("[data-html]");if(Array.prototype.forEach.call(d,(e=>{t=(t=(t=decodeURIComponent(e.getAttribute("data-html"))).replace(/{id}/g,this.makeId())).replace(/<script>/g,""+(this.builder.nonce?`<script nonce="${this.builder.nonce}">`:"<script>"));for(var i=1;i<=20;i++)t=t.replace("[%HTML"+i+"%]",void 0===e.getAttribute("data-html-"+i)?"":decodeURIComponent(e.getAttribute("data-html-"+i)));e.innerHTML=t})),1===u.childNodes.length&&1===u.childNodes[0].childNodes.length&&("cell"===r||"cell-left"===r||"cell-right"===r)){const t=this.cellSelected();let e=t.parentNode,i=4;if(this.builder.maxColumns&&(i=this.builder.maxColumns),e.querySelector(".is-row-overlay")){if(e.childElementCount>=i+4)return alert(this.out("You have reached the maximum number of columns")),!1}else if(e.childElementCount>=i+3)return alert(this.out("You have reached the maximum number of columns")),!1;this.builder.uo.saveForUndo();let n=u.childNodes[0].childNodes[0];var b=document.createRange();t.parentNode.insertBefore(b.createContextualFragment(n.outerHTML),t),"cell"!==r&&"cell-right"!==r||(t.parentNode.insertBefore(t.previousElementSibling,t),t.parentNode.insertBefore(t,t.previousElementSibling));let o=this.builder.doc.querySelector(".builder-active");return o||(o=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(o),this.fixLayout(e),"cell"===r||"cell-right"===r?t.nextElementSibling.click():t.previousElementSibling.click(),this.builder.opts.onChange(),void this.builder.opts.onRender()}let e;if(s=this.builder.activeCol,s?e=s.parentNode:(e=this.builder.doc.querySelector(".row-active"),e||(a=!0)),a){const t=this.builder.doc.querySelectorAll(".is-builder"),i=t[t.length-1],o=n.elementChildren(i);e=o[o.length-1]}b=document.createRange(),e.parentNode.insertBefore(b.createContextualFragment(u.innerHTML),e.nextSibling),o=u.childNodes[0],o=e.nextElementSibling;let i=this.builder.doc.querySelector(".builder-active");i||(i=this.builder.doc.querySelector(".is-builder")),this.builder.applyBehaviorOn(i),l=o.querySelector("div"),l&&l.click(),o.className=o.className.replace("row-outline",""),this.builder.util.hideColumnTool()}}if(this.builder.useCssClasses){let t=this.builder.doc.querySelector(".builder-active");t&&n.contentReformat(t,this.builder.cssClasses)}this.builder.opts.onChange(),this.builder.opts.onRender()}else i?this.addContent(t,r,"data-noedit"):this.addContent(t,r)}clearActiveCell(){if(!this.builder.builderStuff)return;let t=this.builder.doc.getElementsByClassName("cell-active");for(;t.length;)t[0].classList.remove("cell-active");for(t=this.builder.doc.getElementsByClassName("row-outline");t.length;)t[0].classList.remove("row-outline");for(t=this.builder.doc.getElementsByClassName("row-active");t.length;)t[0].classList.remove("row-active");for(t=this.builder.doc.getElementsByClassName("builder-active");t.length;)t[0].classList.remove("builder-active");this.builder.activeCol=null,this.builder.dom.removeClass(this.builder.doc.body,"content-edit")}clearAfterUndoRedo(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const n=document.querySelector(".moveable-control-box");if(n&&(n.style.display="none"),this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null,this.builder.doc.querySelectorAll(".icon-active").forEach((t=>t.classList.remove("icon-active"))),this.builder.activeIcon=null,!this.builder.controlPanel){let i=e.querySelector(".is-rte-tool").querySelectorAll("button");Array.prototype.forEach.call(i,(e=>{t.removeClass(e,"on")})),i=e.querySelector(".is-elementrte-tool").querySelectorAll("button"),Array.prototype.forEach.call(i,(e=>{t.removeClass(e,"on")}))}let o=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(o,(t=>{t.style.display=""}))}hidePops(){const t=this.dom,e=this.builder.builderStuff;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}));let n=e.querySelectorAll(".is-pop.active");Array.prototype.forEach.call(n,(e=>{e.style.transition="all 200ms ease",setTimeout((()=>{e.style.opacity="0"}),10),setTimeout((()=>{e.style.display="",t.removeClass(e,"active"),e.style.opacity="",e.style.transition=""}),200)}));const o=document.querySelector(".moveable-control-box"),s=document.querySelector("#divImageResizer");o&&s&&!s.getAttribute("data-resizing")&&(o.style.display="none")}hideControls(){const t=this.dom;let e=this.builder.builderStuff.querySelectorAll(".is-tool");Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(e=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(e,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const i=document.querySelector(".moveable-control-box");i&&(i.style.display="none")}clearActiveElement(t){const e=this.dom,i=this.builder.builderStuff;this.builder.doc.querySelectorAll(".icon-active").forEach((t=>t.classList.remove("icon-active"))),this.builder.activeIcon=null;let n=this.builder.doc.querySelectorAll(".elm-inspected");Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"elm-inspected")})),this.builder.inspectedElement=null,n=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"elm-active")})),this.builder.activeElement=null,this.builder.doc.querySelector(".is-element-tool").style.display="";let o=this.builder.doc.querySelector("#divLinkTool");if(o&&(o.style.display=""),t&&!this.builder.controlPanel){let t=i.querySelector(".is-rte-tool");t&&(t.style.display="none");let e=i.querySelector(".is-elementrte-tool");e&&(e.style.display="flex");let n=i.querySelector(".rte-more-options");n&&(n.style.display="");let o=i.querySelector(".elementrte-more-options");o&&(o.style.display="");let s=e.querySelectorAll("button[data-align]");Array.prototype.forEach.call(s,(t=>{t.style.display="none"})),this.builder.rte.positionToolbar()}}clearPops(){const t=this.dom,e=this.builder.builderStuff;if(!e)return;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const n=document.querySelector(".moveable-control-box");n&&(n.style.display="none");let o=this.builder.doc.querySelectorAll(".ovl");Array.prototype.forEach.call(o,(t=>{t.style.display="block"}));let s=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(s,(e=>{e.style.display="",t.removeClass(e,"active"),e.setAttribute("aria-hidden",!0)})),this.builder.colTool.lockIndicator.style.display="",this.builder.resize&&this.builder.resize.destroy()}clearControls(){const t=this.dom,e=this.builder.builderStuff;if(!e)return;let i=e.querySelectorAll(".is-tool");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")})),this.builder.iframe&&(i=this.builder.contentStuff.querySelectorAll(".is-tool"),Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active")}))),this.builder.moveable&&this.builder.moveable.updateRect();const n=document.querySelector(".moveable-control-box");n&&(n.style.display="none"),this.builder.activeSpacer=null,this.builder.activeCodeBlock=null,this.builder.activeLink=null,this.builder.activeLinkButton=null,this.builder.activeButton=null,this.builder.activeIframe=null,this.builder.activeTd=null,this.builder.activeTable=null,this.builder.activeModule=null,this.builder.activeImage=null,this.builder.doc.querySelectorAll(".icon-active").forEach((t=>t.classList.remove("icon-active"))),this.builder.activeIcon=null;let o=this.builder.doc.querySelectorAll(".ovl");Array.prototype.forEach.call(o,(t=>{t.style.display="block"}));var s=e.querySelectorAll(".is-side.elementstyles");Array.prototype.forEach.call(s,(e=>{t.removeClass(e,"active")}));let l=this.builder.doc.querySelectorAll("[data-saveforundo]");if(Array.prototype.forEach.call(l,(t=>{t.removeAttribute("data-saveforundo")})),l=this.builder.doc.querySelectorAll(".elm-inspected"),Array.prototype.forEach.call(l,(e=>{t.removeClass(e,"elm-inspected")})),!this.builder.controlPanel&&"auto"===this.builder.toolbarDisplay){let t=e.querySelector(".is-rte-tool");t&&(t.style.display="none");let i=e.querySelector(".is-elementrte-tool");i&&(i.style.display="none");let n=e.querySelector(".rte-more-options");n&&(n.style.display="");let o=e.querySelector(".elementrte-more-options");o&&(o.style.display="")}if(l=this.builder.doc.querySelectorAll(".elm-active"),Array.prototype.forEach.call(l,(e=>{t.removeClass(e,"elm-active")})),!this.builder.controlPanel){let i=e.querySelectorAll(".is-rte-pop");Array.prototype.forEach.call(i,(e=>{e.style.display="",t.removeClass(e,"active"),t.removeClass(e,"deactive")}))}let a=e.querySelectorAll(".is-pop");Array.prototype.forEach.call(a,(e=>{e.style.display="",t.removeClass(e,"active"),e.setAttribute("aria-hidden",!0)})),this.builder.colTool.lockIndicator.style.display="",this.builder.resize&&this.builder.resize.destroy()}makeId(){let t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let i=0;i<2;i++)t+=e.charAt(Math.floor(Math.random()*e.length));let i="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let t=0;t<5;t++)i+=n.charAt(Math.floor(Math.random()*n.length));return t+i}getSelection(){if(this.builder.dom.getSelectedBlocks().length>0)this.builder.selectionMulti=!0;else{this.builder.selectionMulti=!1;const t=this.builder.win.getSelection(),e=this.builder.dom.getElm();if(!e)return;if(e&&e.innerText===t.toString().trim()||""===t.toString().trim()){this.builder.selectionElm=e;let t=e.closest("a");this.builder.activeLink=t||null}else this.builder.selectionText=t,this.builder.activeLink=null}}saveSelection(){if(this.builder.win.getSelection){let t=this.builder.win.getSelection();if(t.getRangeAt&&t.rangeCount){let e=[];for(let i=0,n=t.rangeCount;i<n;++i)e.push(t.getRangeAt(i));return this.builder.selection=e,e}}else if(this.builder.doc.selection&&this.builder.doc.selection.createRange)return this.builder.selection=this.builder.doc.selection.createRange(),this.builder.doc.selection.createRange();return this.builder.selection=null,null}restoreSelection(){let t=this.builder.selection;if(t)if(this.builder.win.getSelection){let o=this.builder.win.getSelection();if(this.builder.doc.body.createTextRange){var e=this.builder.doc.body.createTextRange();e.collapse(),e.select()}else this.builder.win.getSelection?this.builder.win.getSelection().empty?this.builder.win.getSelection().empty():this.builder.win.getSelection().removeAllRanges&&this.builder.win.getSelection().removeAllRanges():this.builder.doc.selection&&this.builder.doc.selection.empty();for(var i=0,n=t.length;i<n;++i)o.addRange(t[i])}else this.builder.doc.selection&&t.select&&t.select()}cleanHTML(t,e){let i,n=t.replace(/(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g," "),o=new RegExp("\x3c!--(.*?)--\x3e","g");n=n.replace(o,""),i=e?new RegExp("<(/)*(meta|link|span|\\?xml:|st1:|o:|font)(.*?)>","gi"):new RegExp("<(/)*(meta|link|\\?xml:|st1:|o:|font)(.*?)>","gi"),n=n.replace(i,"");let s,l=["style","script","applet","embed","noframes","noscript"];for(let t=0;t<l.length;t++)i=new RegExp("<"+l[t]+".*?"+l[t]+"(.*?)>","gi"),n=n.replace(i,"");s=e?["style","start"]:["start"];for(let t=0;t<s.length;t++){let e=new RegExp(" "+s[t]+'="(.*?)"',"gi");n=n.replace(e,"")}return n=n.replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s/>]))[^>]*>/gi,""),n=n.replace(/<(\/?)s>/gi,"<$1strike>"),n=n.replace(/&nbsp;/gi," "),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\);/gi,""),n=n.replace(/background-color: rgba\(200, 200, 201, 0.11\)/gi,""),n}checkEmpty(){const t=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(t,(t=>{this.checkEmptyOn(t)}))}checkEmptyOn(t){const i=this.dom,n=i.elementChildren(t);let o=!0;if(n.forEach((t=>{i.hasClass(t,"row-add-initial")||i.hasClass(t,"dummy-space")||"link"!==t.tagName.toLowerCase()&&(o=!1)})),o){let n=t.querySelector(".row-add-initial");n||(t.innerHTML=`<button type="button" class="row-add-initial">${this.out("Empty")}<br><span class="block">${this.out("+ Click to add content")}</span></div>`,n=t.querySelector(".row-add-initial")),n.addEventListener("click",(()=>{this.clearActiveCell();const o=this.builder.doc.querySelectorAll(this.builder.opts.container);Array.prototype.forEach.call(o,(t=>{i.removeClass(t,"builder-active")})),i.addClass(t,"builder-active"),i.addClass(n,"row-active");const s=e(this.builder);s.querySelector(".is-pop-tabs").style.display="none";const l=window.innerHeight,a=this.getElementPosition(n);let r=a.top,c=a.left,u=a.scaleX,d=a.scaleY;c+=n.offsetWidth*(u*this.builder.opts.zoom)/2-11,r-=n.offsetHeight-n.offsetHeight*d,s.style.display="flex",this.showPop(s,!1,n);const b=s.offsetWidth,h=s.offsetHeight;l-r>h?(r=r+n.offsetHeight*this.builder.opts.zoom-19,s.style.top=r+window.pageYOffset+27+"px",s.style.left=c-b/2+7+"px",i.removeClass(s,"arrow-bottom"),i.removeClass(s,"arrow-right"),i.removeClass(s,"arrow-left"),i.removeClass(s,"center"),i.addClass(s,"arrow-top"),i.addClass(s,"center")):(s.style.top=r+window.pageYOffset-h-8+"px",s.style.left=c-b/2+7+"px",i.removeClass(s,"arrow-top"),i.removeClass(s,"arrow-right"),i.removeClass(s,"arrow-left"),i.removeClass(s,"center"),i.addClass(s,"arrow-bottom"),i.addClass(s,"center")),s.setAttribute("data-mode","row")}))}else{let e=t.querySelector(".row-add-initial");e&&e.parentNode.removeChild(e)}}clearPreferences(){localStorage.removeItem("_theme"),localStorage.removeItem("_zoom"),localStorage.removeItem("_buildermode"),localStorage.removeItem("_editingtoolbar"),localStorage.removeItem("_editingtoolbardisplay"),localStorage.removeItem("_hidecelltool"),localStorage.removeItem("_rowtool"),localStorage.removeItem("_hideelementtool"),localStorage.removeItem("_hidesnippetaddtool"),localStorage.removeItem("_outlinemode"),localStorage.removeItem("_hiderowcoloutline"),localStorage.removeItem("_outlinestyle"),localStorage.removeItem("_hideelementhighlight"),localStorage.removeItem("_opensnippets"),localStorage.removeItem("_toolstyle"),localStorage.removeItem("_snippetssidebardisplay"),localStorage.removeItem("_htmlview"),localStorage.removeItem("_pasteresult"),localStorage.removeItem("_livepreview"),localStorage.removeItem("_dictation"),localStorage.removeItem("_mic"),localStorage.removeItem("_autosendcommand"),localStorage.removeItem("_disclaimershown"),localStorage.removeItem("_temp"),localStorage.removeItem("_top_p"),localStorage.removeItem("_autosend_delay"),localStorage.removeItem("_auto_editblock"),localStorage.removeItem("_command_lang"),localStorage.removeItem("_ai_panel_open"),localStorage.removeItem("_scrollableeditor"),localStorage.removeItem("_animatedsorting"),localStorage.removeItem("_addbuttonplace"),localStorage.removeItem("_hiderowtool"),localStorage.removeItem("_dragwithouthandle"),localStorage.removeItem("_advancedhtmleditor"),localStorage.removeItem("_hidecolhtmleditor"),localStorage.removeItem("_hiderowhtmleditor"),localStorage.removeItem("_sampleshown")}pasteHtmlAtCaret(t,e){var i,n;if(this.restoreSelection(),this.builder.dom.getElm().closest(".is-container"))if(this.builder.win.getSelection){if(!this.builder.activeCol)return;if((i=this.builder.win.getSelection()).getRangeAt&&i.rangeCount){(n=i.getRangeAt(0)).deleteContents();var o=this.builder.doc.createElement("div");o.innerHTML=t;for(var s,l,a=this.builder.doc.createDocumentFragment();s=o.firstChild;)l=a.appendChild(s);var r=a.firstChild;n.insertNode(a),l&&((n=n.cloneRange()).setStartAfter(l),e?n.setStartBefore(r):n.collapse(!0),i.removeAllRanges(),this.builder.isTouchSupport||i.addRange(n))}}else if((i=this.builder.doc.selection)&&"Control"!==i.type){if(!this.builder.activeCol)return;var c=i.createRange();c.collapse(!0),i.createRange().pasteHTML(t),e&&((n=i.createRange()).setEndPoint("StartToStart",c),this.builder.isTouchSupport||n.select())}}refreshModule(){let t=this.builder.activeModule;if(!t)return;let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}));let n=decodeURIComponent(t.getAttribute("data-html"));n=n.replace(/{id}/g,this.makeId()),t.innerHTML="";var o=document.createRange();o.setStart(t,0),t.appendChild(o.createContextualFragment(n)),i=t.querySelectorAll("[data-subblock]");var s=1;Array.prototype.forEach.call(i,(e=>{t.getAttribute("data-html-"+s)&&(e.innerHTML=decodeURIComponent(t.getAttribute("data-html-"+s))),s++})),this.repositionColumnTool(!0),this.builder.onRefreshTool&&this.builder.onRefreshTool()}repositionColumnTool(){let t=this.builder.activeCol;if(!t)return;let e=t.parentNode;if(t.parentNode||(e=this.rowSelected()),this.colTool=e.querySelector(".is-col-tool"),!this.colTool)return;t.parentNode||(this.colTool.style.display="none"),this.colTool.style.left=t.offsetLeft+"px";const i=this.builder.builderStuff.querySelector(".columnmore.active");if(i){const t=this.colTool.querySelector(".cell-more");i.classList.add("transition1"),setTimeout((()=>{const e=this.getElementPosition(t);let n=e.top,o=e.left;i.style.top=n+35+"px",i.style.left=o-7+"px",setTimeout((()=>{i.classList.remove("transition1")}),300)}),30)}}hideColumnTool(){this.builder.doc.querySelectorAll(".is-col-tool").forEach((t=>{t.style.display="none"}))}isTouchSupport(){return!!window.matchMedia("(pointer: coarse)").matches}detectIE(){return!!document.documentMode}LightenDarkenColor(t,e){var i=!1;"#"===t[0]&&(t=t.slice(1),i=!0);var n=parseInt(t,16),o=(n>>16)+e;o>255?o=255:o<0&&(o=0);var s=(n>>8&255)+e;s>255?s=255:s<0&&(s=0);var l=(255&n)+e;return l>255?l=255:l<0&&(l=0),(i?"#":"")+String("000000"+(l|s<<8|o<<16).toString(16)).slice(-6)}getUIStyles(){this.dom.appendHtml(this.builder.builderStuff,'\n <input type="text" class="style-helper-input" id="__style_helper_input" style="display:none;">\n <button class="style-helper-button-classic classic" style="display:none;"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <select class="style-helper-select" id="__style_helper_select" style="display:none;"><option value=""></option></select>\n\n <div class="style-helper modal-color"></div>\n <div class="style-helper modal-background"></div>\n <div class="style-helper button-pickcolor-border"></div>\n <div class="style-helper button-pickcolor-background"></div>\n\n <button class="style-helper base"><svg><use xlink:href="#ion-code-working"></use></svg></button>\n <div class="style-helper base on"></div>\n <div class="style-helper base hover"></div>\n\n <div class="style-helper snippet-color"></div>\n <div class="style-helper snippet-background"></div>\n <div class="style-helper snippet-tabs-background"></div>\n <div class="style-helper snippet-tab-item-background"></div>\n <div class="style-helper snippet-tab-item-background-active"></div>\n <div class="style-helper snippet-tab-item-background-hover"></div>\n <div class="style-helper snippet-tab-item-color"></div>\n\n <div class="style-helper snippet-more-item-background"></div>\n <div class="style-helper snippet-more-item-background-active"></div>\n <div class="style-helper snippet-more-item-background-hover"></div>\n <div class="style-helper snippet-more-item-color"></div>\n\n <div class="style-helper tabs-background"></div>\n <div class="style-helper tab-item-active-border-bottom"></div>\n <div class="style-helper tab-item-color"></div>\n <div class="style-helper tabs-more-background"></div>\n <div class="style-helper tabs-more-border"></div>\n <div class="style-helper tabs-more-item-color"></div>\n <div class="style-helper tabs-more-item-background-hover"></div>\n <div class="style-helper separator-color"></div>\n <div class="style-helper outline-color"></div>\n ');const t=(t,e)=>{const i=this.builder.builderStuff.querySelector(".style-helper"+t);return window.getComputedStyle(i,null).getPropertyValue(e)},e=this.builder.builderStuff.querySelector(".style-helper-input"),i=this.builder.builderStuff.querySelector(".style-helper-select"),n=this.builder.builderStuff.querySelector(".style-helper-button-classic");this.builder.styleModalColor=t(".modal-color","background-color"),this.builder.styleModalBackground=t(".modal-background","background-color"),this.builder.styleButtonPickColorBorder=t(".button-pickcolor-border","border"),this.builder.styleButtonPickColorBackground=t(".button-pickcolor-background","background-color"),this.builder.styleToolBackground=t(".base","background-color"),this.builder.styleButtonColor=t(".base","color"),this.builder.styleButtonSvgFill=(()=>{const t=this.builder.builderStuff.querySelector(".style-helper.base");return window.getComputedStyle(t.querySelector("svg"),null).getPropertyValue("fill")})(),this.builder.styleButtonBackgroundHover=t(".base.hover","background-color"),this.builder.styleSnippetColor=t(".snippet-color","background-color"),this.builder.styleSnippetBackground=t(".snippet-background","background-color"),this.builder.styleSnippetTabsBackground=t(".snippet-tabs-background","background-color"),this.builder.styleSnippetTabItemBackground=t(".snippet-tab-item-background","background-color"),this.builder.styleSnippetTabItemBackgroundActive=t(".snippet-tab-item-background-active","background-color"),this.builder.styleSnippetTabItemBackgroundHover=t(".snippet-tab-item-background-hover","background-color"),this.builder.styleSnippetTabItemColor=t(".snippet-tab-item-color","background-color"),this.builder.styleSnippetMoreItemBackground=t(".snippet-more-item-background","background-color"),this.builder.styleSnippetMoreItemBackgroundActive=t(".snippet-more-item-background-active","background-color"),this.builder.styleSnippetMoreItemBackgroundHover=t(".snippet-more-item-background-hover","background-color"),this.builder.styleSnippetMoreItemColor=t(".snippet-more-item-color","background-color"),this.builder.styleTabsBackground=t(".tabs-background","background-color"),this.builder.styleTabItemBorderBottomActive=t(".tab-item-active-border-bottom","border"),this.builder.styleTabItemColor=t(".tab-item-color","background-color"),this.builder.styleTabsMoreBackground=t(".tabs-more-background","background-color"),this.builder.styleTabsMoreBorder=t(".tabs-more-border","border"),this.builder.styleTabsMoreItemColor=t(".tabs-more-item-color","background-color"),this.builder.styleTabsMoreBackgroundHover=t(".tabs-more-item-background-hover","background-color"),this.builder.styleSeparatorColor=t(".separator-color","background-color"),this.builder.styleOutlineColor=t(".outline-color","background-color"),this.builder.styleSelectBackground=window.getComputedStyle(i,null).getPropertyValue("background-color"),this.builder.styleSelectColor=window.getComputedStyle(i,null).getPropertyValue("color"),this.builder.styleSelectOptionBackground=window.getComputedStyle(i.querySelector("option"),null).getPropertyValue("background-color"),this.builder.styleInputBackground=window.getComputedStyle(e,null).getPropertyValue("background-color"),this.builder.styleInputBorderBottom=window.getComputedStyle(e,null).getPropertyValue("border-bottom"),this.builder.styleInputColor=window.getComputedStyle(e,null).getPropertyValue("color"),this.builder.styleButtonClassicBackground=window.getComputedStyle(n,null).getPropertyValue("background-color"),this.builder.styleButtonClassicColor=window.getComputedStyle(n,null).getPropertyValue("color"),this.builder.styleButtonClassicBackgroundHover=this.getUIStyleValue(n,"hover","background-color"),this.builder.styleDark=!1,this.builder.styleColored=!1,this.builder.styleColoredDark=!1,this.builder.styleLight=!1,document.body.getAttribute("class")&&(-1!==document.body.getAttribute("class").indexOf("colored-dark")?this.builder.styleColoredDark=!0:-1!==document.body.getAttribute("class").indexOf("dark")?this.builder.styleDark=!0:-1!==document.body.getAttribute("class").indexOf("colored")?this.builder.styleColored=!0:-1!==document.body.getAttribute("class").indexOf("light")&&(this.builder.styleLight=!0))}getUIStyleValue(t,e,i){const n=this.dom;n.addClass(t,e);let o=window.getComputedStyle(t,null).getPropertyValue(i);return n.removeClass(t,e),o}getPageTemplate(t){let e="";return e=""===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"tailwind"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content-tailwind.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <link rel="stylesheet" href="[%PATH%]/assets/frameworks/tailwindcss/styles.css">\n \x3c!-- To build your own, please see: https://tailwindcss.com/docs/installation --\x3e\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"bootstrap"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n\n <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {margin: 140px auto; max-width: 800px; width:100%; padding:0 35px; box-sizing: border-box;}\n /* Bootstrap css adjustment to enable column drag to resize */\n .row > *,\n .column {\n max-width: unset !important;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"foundation"===t?'\n <!DOCTYPE html>\n <html lang="en">\n <head>\n <meta charset="utf-8">\n <title>Page</title>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <meta name="description" content="">\n <link rel="shortcut icon" href="#">\n\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation.min.css">\n <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation-float.min.css">\n \n <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet">\n \n <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet">\n <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet">\n <script src="[%PATH%]/assets/scripts/glide/glide.js"><\/script>\n \n <style>\n .container {\n margin: 150px auto 0;\n max-width: 800px;\n width: 100%;\n padding: 0 20px;\n box-sizing: border-box;\n }\n </style>\n </head>\n <body>\n \n <div class="container">\n [%CONTENT%]\n </div>\n \n </body>\n </html>\n ':"[%CONTENT%]",e}getElementPosition(t){const e=this.builder.iframe;let i,n,o,s;if(this.builder.iframe){let l=document.querySelector(".is-content-view");l||(l=e.parentNode);const a=window.getComputedStyle(l).transform;if("none"!==a){const t=a.match(/matrix\(([0-9., -]+)\)/)[1].split(",");o=parseFloat(t[0]),s=parseFloat(t[3])}else o=1,s=1;const r=e.getBoundingClientRect();i=t.getBoundingClientRect().top*s+r.top,n=t.getBoundingClientRect().left*o+r.left}else i=t.getBoundingClientRect().top,n=t.getBoundingClientRect().left,o=1,s=1;return{top:i,left:n,scaleX:o,scaleY:s}}}class n{constructor(t){this.builder=t}getScale(t){let e=window.getComputedStyle(t).transform;if("none"===e)return 1;let i=e.split("(")[1];i=i.split(")")[0],i=i.split(",");let n=i[0],o=i[1];return Math.sqrt(n*n+o*o)}createElement(t){return document.createElement(t)}appendChild(t,e){t&&t.appendChild(e)}appendHtml(t,e){t&&t.insertAdjacentHTML("beforeend",e)}addEventListener(t,e,i){t&&t.addEventListener(e,i)}addClass(t,e){t&&(this.hasClass(t,e)||(0===t.classList.length?t.className=e:t.className=t.className+" "+e,t.className=t.className.replace(/ +/g," ")))}removeClass(t,e){if(t&&t.classList.length>0){let i,n,o,s,l=e.split(" ");for(i=0,o=l.length;i<o;++i){if(!l[i])continue;let e=l[i],o="",a=t.className.split(" ");for(n=0,s=a.length;n<s;++n)a[n]&&a[n]!==e&&(o+=a[n]+" ");t.className=o.trim()}""===t.className&&t.removeAttribute("class")}}removeClassesByPrefix(t,e){t.classList&&t.classList.forEach((i=>{0===i.indexOf(e)&&this.removeClass(t,i)}))}hasClass(t,e){return!!t&&(!!t.className&&(" "+t.className+" ").indexOf(" "+e+" ")>-1)}moveAfter(t,e){e.parentNode.insertBefore(t,e),e.parentNode.insertBefore(e,e.previousElementSibling)}elementChildren(t){const e=t.childNodes;let i=[],n=e.length;for(;n--;)1===e[n].nodeType&&i.unshift(e[n]);return i}getElementOffset(t){const e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset,left:e.left+window.pageXOffset,width:e.width,height:e.height}}parentsHasClass(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(this.hasClass(t,e))return!0;t=t.parentNode}}parentsHasId(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.id===e)return!0;t=t.parentNode}}parentsHasTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return!0;t=t.parentNode}}parentsHasAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return!0}catch(t){}t=t.parentNode}}getParentByTag(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(t.tagName.toLowerCase()===e.toLowerCase())return t;t=t.parentNode}}getParentByAttribute(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;try{if(t.hasAttribute(e))return t}catch(t){}t=t.parentNode}}parentsHasElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return!0}}getParentElement(t,e){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if(!(t=t.parentNode))return!1;if(!t.tagName)return!1;if(t.tagName.toLowerCase()===e)return t}}removeClasses(t,e){for(let i=0;i<t.length;i++)t[i].classList.remove(e)}removeAttributes(t,e){for(let i=0;i<t.length;i++)t[i].removeAttribute(e)}removeElements(t){Array.prototype.forEach.call(t,(t=>{t.parentNode.removeChild(t)}))}moveCursorToElement(t){var e,i;window.getSelection&&this.builder.doc.createRange?((i=this.builder.doc.createRange()).selectNodeContents(t),i.collapse(!1),(e=window.getSelection()).removeAllRanges(),e.addRange(i)):this.builder.doc.body.createTextRange&&((i=this.builder.doc.body.createTextRange()).moveToElementText(t),i.collapse(!1),i.select())}selectElementContents(t){var e=this.builder.doc.createRange();e.selectNodeContents(t);var i=this.builder.win.getSelection();i.removeAllRanges(),i.addRange(e)}getSelected(){if(this.builder.win.getSelection)return this.builder.win.getSelection().toString();if(this.builder.doc.getSelection)return this.builder.doc.getSelection().toString();var t=this.builder.doc.selection&&this.builder.doc.selection.createRange();return!!t.text&&t.text}checkEditable(){try{var t,e;return this.builder.win.getSelection?t=3===(e=this.builder.win.getSelection().getRangeAt(0).commonAncestorContainer).nodeType?e.parentNode:e:this.builder.doc.selection&&(e=this.builder.doc.selection.createRange(),t=this.builder.doc.selection.createRange().parentElement()),!!this.parentsHasAttribute(t,"contenteditable")}catch(t){return!1}}textSelection(){const t=this.getSelection().anchorNode;if(!t)return!1;return t.nodeType!==Node.TEXT_NODE&&t.nodeType!==Node.COMMENT_NODE?t:t.parentElement}getStyle(t,e){return window.getComputedStyle?window.getComputedStyle(t,null).getPropertyValue(e):t.style[e.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))]}observeElement(t,e,i,n=0){let o=Object.getPrototypeOf(t);if(Object.prototype.hasOwnProperty.call(o,e)){let s=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,{get:function(){return s.get.apply(this,arguments)},set:function(){let t=this[e];s.set.apply(this,arguments);let o=this[e];"function"==typeof i&&setTimeout(i.bind(this,t,o),n)}})}}baseName(t){if("string"==typeof t){var e=t.split(".");return e.splice(0,e.length-1).join(".")}}doFunction(t,e,i){if(e(t),i){let i=Array.prototype.slice.call(t.getElementsByTagName("*"));for(var n=0;n<i.length;n++)e(i[n])}}execCommand(t,e,i){const n=this.getSelectedBlocks();if(n.length>0)n.forEach((t=>{i(!0,t)}));else{const n=this.builder.win.getSelection(),o=this.getElm();if(!o)return void(i&&i(!1));let s;s=o&&o.innerText===n.toString().trim()||""===n.toString().trim()?this.updateSelection(t,e,o):this.replaceSelection(t,e,n,o),i&&i(!0,s)}}updateSelection(t,e,i){return i.style[t]=this.getStyleValue(i,t,e),this.checkStyleIfSameAsParent(i,t),this.cleanChildren(t,i),this.cleanUnusedSpan(i),i}replaceSelection(t,e,i,n){const o=i.getRangeAt(0),s=o.extractContents(),l=this.createSpan(n,t,e);return l.appendChild(s),this.cleanChildren(t,l),this.cleanUnusedSpan(l),o.insertNode(l),i.selectAllChildren(l),this.checkStyleIfSameAsParent(l,t),l}checkStyleIfSameAsParent(t,e){if(t.parentNode&&(t.parentNode.style[e]===t.style[e]||window.getComputedStyle(t.parentNode,null).getPropertyValue(e)===t.style[e])){t.style[e]="",""!==t.getAttribute("style")&&null!==t.style||t.removeAttribute("style");let i=0===t.attributes.length||1===t.attributes.length&&t.hasAttribute("data-keep");if("span"===t.nodeName.toLowerCase()&&i){const e=document.createTextNode(t.textContent);t.parentElement.replaceChild(e,t)}}}createSpan(t,e,i){const n=document.createElement("span");return n.style[e]=this.getStyleValue(t,e,i),n}findParentStyle(t,e){if("HTML"===t.nodeName.toUpperCase()||"BODY"===t.nodeName.toUpperCase())return null;if(!t.parentNode)return null;if(null!==t.style[e]&&void 0!==t.style[e]&&""!==t.style[e])return t;this.findParentStyle(t.parentNode,e)}getStyleValue(t,e,i){if("font-weight"===e||"font-style"===e||"text-decoration"===e||"text-transform"===e){let n,o=this.findParentStyle(t,e);if(o&&(n=o.style[e]),i===n){t.style[e]="";let o=window.getComputedStyle(t,null).getPropertyValue(e);t.style[e]=n,i=o}}return i}getParentBlock(t){for(;t;){if(!t.tagName)return!1;if("BODY"===t.tagName||"HTML"===t.tagName)return!1;if("inline"!==this.getStyle(t,"display"))return t;t=t.parentNode}}execCommandClass(t,e,i=!0,n){const o=this.getSelectedBlocks();if(o.length>0)o.forEach((i=>{for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i)}));else{const o=this.builder.win.getSelection();let s=this.getElm();if(!s)return;const l=s&&s.innerText===o.toString().trim();(i||l||""===o.toString().trim())&&("block"===n&&"inline"===this.getStyle(s,"display")&&(s=this.getParentBlock(s)),this.updateSelectionClass(t,e,s))}}updateSelectionClass(t,e,i){for(let t=0;t<Object.keys(e).length;t++){let n=Object.values(e)[t];this.removeClass(i,n)}return""!==t&&this.addClass(i,t),this.cleanChildrenClass(i,e),this.cleanUnusedSpan(i),i}cleanChildrenClass(t,e){if(!t.hasChildNodes())return;Array.from(t.children).map((t=>{for(let i=0;i<Object.keys(e).length;i++){let n=Object.values(e)[i];this.removeClass(t,n)}}));const i=Array.from(t.children).map((t=>this.cleanChildrenClass(t,e)));i&&i.length}getSelectedBlocks(){let t=!1,e=this.builder.win.getSelection(),i=[];if(!e.isCollapsed){let t=e.getRangeAt(0),n=t.commonAncestorContainer;const o=e=>{if(e.nodeType===Node.ELEMENT_NODE&&t.intersectsNode(e)&&i.push(e),e.childNodes.length>0)for(let t=0;t<e.childNodes.length;t++)o(e.childNodes[t])};o(n),i.length>0&&i[0]===n&&i.shift()}let n=[];const o=["p","h1","h2","h3","h4","h5","h6","div","pre","td","th","li"];return i.forEach((e=>{const i=e.tagName.toLowerCase();o.includes(i)&&(t=!0,n.push(e))})),2===n.length&&n[0].innerText.trim()===e.toString().trim()&&n.pop(),t?n:[]}execCommandToggle(t,e,i){const n=this.getSelectedBlocks();if(n.length>0)n.forEach((n=>{if("fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t||this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t||this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t||this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)&&(t="uppercase"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n)}));else{const n=this.builder.win.getSelection(),o=this.getElm();if(!o)return;o&&o.innerText===n.toString().trim()||""===n.toString().trim()?this.updateSelectionToggle(t,e,i,o):this.replaceSelectionToggle(t,e,i,n,o)}}getElm(){const t=this.builder.win.getSelection();if(!t)return!1;const e=t.anchorNode;if(!e)return!1;return e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement}updateSelectionToggle(t,e,i,n){if("fontWeight"===t){let t=!1;this.hasClass(n,i.fontWeight.defaultBold)&&(t=!0);parseInt(window.getComputedStyle(n,null).getPropertyValue("font-weight"))>=500&&(t=!0),this.removeClass(n,i.fontWeight.thin),this.removeClass(n,i.fontWeight.extralight),this.removeClass(n,i.fontWeight.light),this.removeClass(n,i.fontWeight.normal),this.removeClass(n,i.fontWeight.medium),this.removeClass(n,i.fontWeight.semibold),this.removeClass(n,i.fontWeight.bold),this.removeClass(n,i.fontWeight.extrabold),this.removeClass(n,i.fontWeight.black),t?this.addClass(n,i.fontWeight.defaultNormal):this.addClass(n,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;this.hasClass(n,i.fontStyle.italic)&&(t=!0),this.removeClass(n,i.fontStyle.italic),this.removeClass(n,i.fontStyle.normal),t?this.addClass(n,i.fontStyle.normal):this.addClass(n,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;this.hasClass(n,i.textDecoration.underline)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;this.hasClass(n,i.textDecoration.linethrough)&&(t=!0),this.removeClass(n,i.textDecoration.underline),this.removeClass(n,i.textDecoration.linethrough),this.removeClass(n,i.textDecoration.normal),t?this.addClass(n,i.textDecoration.normal):this.addClass(n,i.textDecoration.linethrough)}if("textTransform"===t){let t="";this.hasClass(n,i.textTransform.uppercase)&&(t="uppercase"),this.removeClass(n,i.textTransform.uppercase),this.removeClass(n,i.textTransform.lowercase),this.removeClass(n,i.textTransform.capitalize),this.removeClass(n,i.textTransform.normal),""===t&&this.addClass(n,i.textTransform.uppercase)}if("clean"===t&&(n.className="",n.style.cssText=""),"extend"===t){let t=!1;this.hasClass(n,i.extend[e])&&(t=!0),t?this.removeClass(n,i.extend[e]):this.addClass(n,i.extend[e])}return this.cleanChildrenToggle(t,e,n,i),this.cleanUnusedSpan(n),n}replaceSelectionToggle(t,e,i,n,o){const s=n.getRangeAt(0),l=s.extractContents(),a=document.createElement("span");if("fontWeight"===t){let t=!1;o.closest(`.${i.fontWeight.defaultBold}`)&&(t=!0,this.hasClass(o,i.fontWeight.defaultNormal)&&(t=!1));parseInt(window.getComputedStyle(o,null).getPropertyValue("font-weight"))>=500&&(t=!0),t?this.addClass(a,i.fontWeight.defaultNormal):this.addClass(a,i.fontWeight.defaultBold)}if("fontStyle"===t){let t=!1;o.closest(`.${i.fontStyle.italic}`)&&(t=!0,this.hasClass(o,i.fontStyle.normal)&&(t=!1)),t?this.addClass(a,i.fontStyle.normal):this.addClass(a,i.fontStyle.italic)}if("textUnderline"===t){let t=!1;o.closest(`.${i.textDecoration.underline}`)&&(t=!0),t||this.addClass(a,i.textDecoration.underline)}if("textLinethrough"===t){let t=!1;o.closest(`.${i.textDecoration.linethrough}`)&&(t=!0),t||this.addClass(a,i.textDecoration.linethrough)}if("textTransform"===t){let t="";o.closest(`.${i.textTransform.uppercase}`)&&(t="uppercase"),this.removeClass(a,i.textTransform.uppercase),this.removeClass(a,i.textTransform.lowercase),this.removeClass(a,i.textTransform.capitalize),this.removeClass(a,i.textTransform.normal),""===t&&this.addClass(a,i.textTransform.uppercase)}if("extend"===t){let t=!1;o.closest(`.${i.extend[e]}`)&&(t=!0),t||this.addClass(a,i.extend[e])}return a.appendChild(l),this.cleanChildrenToggle(t,e,a,i),this.cleanUnusedSpan(a),s.insertNode(a),n.selectAllChildren(a),a}cleanChildrenToggle(t,e,i,n){if(!i.hasChildNodes())return;"fontWeight"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontWeight.thin),this.removeClass(t,n.fontWeight.extralight),this.removeClass(t,n.fontWeight.light),this.removeClass(t,n.fontWeight.normal),this.removeClass(t,n.fontWeight.medium),this.removeClass(t,n.fontWeight.semibold),this.removeClass(t,n.fontWeight.bold),this.removeClass(t,n.fontWeight.extrabold),this.removeClass(t,n.fontWeight.black)})),"fontStyle"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.fontStyle.italic),this.removeClass(t,n.fontStyle.normal)})),"textUnderline"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textLinethrough"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textDecoration.underline),this.removeClass(t,n.textDecoration.linethrough),this.removeClass(t,n.textDecoration.normal)})),"textTransform"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.textTransform.uppercase),this.removeClass(t,n.textTransform.lowercase),this.removeClass(t,n.textTransform.capitalize),this.removeClass(t,n.textTransform.normal)})),"clean"===t&&Array.from(i.children).map((t=>{t.className="",t.style.cssText=""})),"extend"===t&&Array.from(i.children).map((t=>{this.removeClass(t,n.extend[e])}));const o=Array.from(i.children).map((i=>this.cleanChildrenToggle(t,e,i,n)));o&&o.length}getSelection(){return this.builder.win&&this.builder.win.getSelection?this.builder.win.getSelection():this.builder.doc&&this.builder.doc.getSelection?this.builder.doc.getSelection():this.builder.doc&&this.builder.doc.selection?this.builder.doc.selection.createRange().text:null}cleanChildren(t,e){if(!e.hasChildNodes())return;const i=Array.from(e.children).filter((e=>void 0!==e.style[t]&&""!==e.style[t.style]));i&&i.length>0&&i.forEach((e=>{e.style[t]="",""!==e.getAttribute("style")&&null!==e.style||e.removeAttribute("style")}));const n=Array.from(e.children).map((e=>this.cleanChildren(t,e)));n&&n.length}addCssClass(t,e,i){this.removeCssClasses(t,i),this.addClass(t,e)}removeCssClasses(t,e){for(let i=0;i<Object.keys(e).length;i++){const n=Object.values(e)[i];this.removeClass(t,n)}}removeEmptyStyle(t){if(!t.hasChildNodes())return;const e=Array.from(t.children).filter((t=>t.getAttribute("style")));e&&e.length>0&&e.forEach((t=>{""!==t.getAttribute("style").trim()&&null!==t.style||t.removeAttribute("style")}));const i=Array.from(t.children).map((t=>this.removeEmptyStyle(t)));i&&i.length}cleanClassSize(t,e){if(!t.hasChildNodes())return;const i=Array.from(t.children).filter((t=>this.hasClass(t,e)));i&&i.length>0&&i.forEach((t=>{this.removeClass(t,e)}));const n=Array.from(t.children).map((t=>this.cleanClassSize(t,e)));n&&n.length}removeFormat(){const t=this.getSelection();if(!t)return;const e=t.anchorNode;if(!e)return;const i=e.nodeType!==Node.TEXT_NODE&&e.nodeType!==Node.COMMENT_NODE?e:e.parentElement;i&&i.innerText===t.toString().trim()||""===t.toString().trim()?this.cleanElement(i):this.cleanSelection(t)}cleanElement(t){t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)})),t.querySelectorAll("*").forEach((t=>{t.style.fontWeight="",t.style.fontStyle="",t.style.textDecoration="",t.style.textTransform="",t.style.fontFamily="",t.style.fontSize="",t.style.color="",t.style.backgroundColor="",t.classList.forEach((e=>{-1!==e.indexOf("size-")&&this.removeClass(t,e)}))})),this.cleanUnusedSpan(t)}cleanSelection(t){const e=t.getRangeAt(0),i=e.extractContents(),n=document.createElement("span");n.appendChild(i),e.insertNode(n),t.selectAllChildren(n),this.cleanElement(n)}cleanUnusedSpan(t){let e=t.querySelectorAll("span");const i=Array.prototype.filter;let n=i.call(e,(t=>0===t.attributes.length));n&&n.length>0&&n.forEach((t=>{t.outerHTML=t.innerHTML})),e=t.querySelectorAll("span"),i.call(e,(t=>{""===t.innerHTML&&t.parentNode.removeChild(t)})),e=t.querySelectorAll("span"),n=i.call(e,(t=>0===t.attributes.length)),n&&n.length>0&&this.cleanUnusedSpan(t)}contentReformat(t,e){this.replaceTag(t,"b",e.fontWeight.defaultBold),this.replaceTag(t,"i",e.fontStyle.italic),this.replaceTag(t,"u",e.textDecoration.underline),this.replaceTag(t,"strike",e.textDecoration.linethrough),this.replaceInline(t,"font-weight","normal",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","bold",e.fontWeight.defaultBold),this.replaceInline(t,"font-weight","600",e.fontWeight.semibold),this.replaceInline(t,"text-align","left",e.textAlign.left),this.replaceInline(t,"text-align","right",e.textAlign.right),this.replaceInline(t,"text-align","center",e.textAlign.center),this.replaceInline(t,"text-align","justify",e.textAlign.justify),this.replaceInline(t,"display","flex",e.display.flex),this.replaceInline(t,"justiify-content","flex-start",e.justifyContent.start),this.replaceInline(t,"justiify-content","flex-end",e.justifyContent.end),this.replaceInline(t,"justiify-content","center",e.justifyContent.center),this.replaceInline(t,"justiify-content","space-between",e.justifyContent.between),this.replaceInline(t,"flex-direction","column",e.flexDirection.column),this.replaceInline(t,"flex-direction","row",e.flexDirection.row),this.replaceInline(t,"align-items","flex-start",e.alignItems.start),this.replaceInline(t,"align-items","flex-end",e.alignItems.end),this.replaceInline(t,"align-items","center",e.alignItems.center),this.replaceInline(t,"text-transform","uppercase",e.textTransform.uppercase),this.replaceInline(t,"text-transform","lowercase",e.textTransform.lowercase),this.replaceInline(t,"text-transform","none",e.textTransform.normal),this.replaceInline(t,"line-height","1",e.leading.leading_10),this.replaceInline(t,"line-height","1.1",e.leading.leading_11),this.replaceInline(t,"line-height","1.2",e.leading.leading_12),this.replaceInline(t,"line-height","1.25",e.leading.leading_125),this.replaceInline(t,"line-height","1.3",e.leading.leading_13),this.replaceInline(t,"line-height","1.375",e.leading.leading_1375),this.replaceInline(t,"line-height","1.4",e.leading.leading_14),this.replaceInline(t,"line-height","1.5",e.leading.leading_15),this.replaceInline(t,"line-height","1.6",e.leading.leading_16),this.replaceInline(t,"line-height","1.625",e.leading.leading_1625),this.replaceInline(t,"line-height","1.7",e.leading.leading_17),this.replaceInline(t,"line-height","1.8",e.leading.leading_18),this.replaceInline(t,"line-height","1.9",e.leading.leading_19),this.replaceInline(t,"line-height","2",e.leading.leading_20),this.replaceInline(t,"line-height","2.1",e.leading.leading_21),this.replaceInline(t,"line-height","2.2",e.leading.leading_22)}replaceTag(t,e,i){let n=t.querySelectorAll(e);let o=Array.prototype.filter.call(n,(t=>0===t.attributes.length));o&&o.length>0&&o.forEach((t=>{const e=document.createElement("span");e.setAttribute("class",i),e.innerHTML=t.innerHTML,t.outerHTML=e.outerHTML}))}replaceInline(t,e,i,n){t.querySelectorAll("*").forEach((t=>{"justiify-content"===e?t.style.justifyContent===`${i}`&&(this.addClass(t,n),t.style.justifyContent=""):t.style[e]===`${i}`&&(this.addClass(t,n),t.style[e]="")}))}}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},s={exports:{}},l={},a={exports:{}},r={},c={};function u(t){this.__parent=t,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function d(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",t.indent_level>0&&(e=new Array(t.indent_level+1).join(this.__indent_string)),this.__base_string=e,this.__base_string_length=e.length}function b(t,e){this.__indent_cache=new d(t,e),this.raw=!1,this._end_with_newline=t.end_with_newline,this.indent_size=t.indent_size,this.wrap_line_length=t.wrap_line_length,this.indent_empty_lines=t.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new u(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.clone_empty=function(){var t=new u(this.__parent);return t.set_indent(this.__indent_count,this.__alignment_count),t},u.prototype.item=function(t){return t<0?this.__items[this.__items.length+t]:this.__items[t]},u.prototype.has_match=function(t){for(var e=this.__items.length-1;e>=0;e--)if(this.__items[e].match(t))return!0;return!1},u.prototype.set_indent=function(t,e){this.is_empty()&&(this.__indent_count=t||0,this.__alignment_count=e||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},u.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},u.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},u.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),t.__character_count-=1),!0}return!1},u.prototype.is_empty=function(){return 0===this.__items.length},u.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},u.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},u.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},u.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},u.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},u.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},u.prototype.toString=function(){var t="";return this.is_empty()?this.__parent.indent_empty_lines&&(t=this.__parent.get_indent_string(this.__indent_count)):(t=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),t+=this.__items.join("")),t},d.prototype.get_indent_size=function(t,e){var i=this.__base_string_length;return e=e||0,t<0&&(i=0),i+=t*this.__indent_size,i+=e},d.prototype.get_indent_string=function(t,e){var i=this.__base_string;return e=e||0,t<0&&(t=0,i=""),e+=t*this.__indent_size,this.__ensure_cache(e),i+=this.__cache[e]},d.prototype.__ensure_cache=function(t){for(;t>=this.__cache.length;)this.__add_column()},d.prototype.__add_column=function(){var t=this.__cache.length,e=0,i="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,i=new Array(e+1).join(this.__indent_string)),t&&(i+=new Array(t+1).join(" ")),this.__cache.push(i)},b.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},b.prototype.get_line_number=function(){return this.__lines.length},b.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},b.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},b.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},b.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},b.prototype.get_code=function(t){this.trim(!0);var e=this.current_line.pop();e&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join("\n");return"\n"!==t&&(i=i.replace(/[\n]/g,t)),i},b.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},b.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),this.__lines.length>1?(this.current_line.set_indent(t,e),!0):(this.current_line.set_indent(),!1)},b.prototype.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},b.prototype.add_token=function(t){this.__add_space_before_token(),this.current_line.push(t),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},b.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},b.prototype.remove_indent=function(t){for(var e=this.__lines.length;t<e;)this.__lines[t]._remove_indent(),t++;this.current_line._remove_wrap_indent()},b.prototype.trim=function(t){for(t=void 0!==t&&t,this.current_line.trim();t&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},b.prototype.just_added_newline=function(){return this.current_line.is_empty()},b.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},b.prototype.ensure_empty_line_above=function(t,e){for(var i=this.__lines.length-2;i>=0;){var n=this.__lines[i];if(n.is_empty())break;if(0!==n.item(0).indexOf(t)&&n.item(-1)!==e){this.__lines.splice(i+1,0,new u(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},c.Output=b;var h={};h.Token=function(t,e,i,n){this.type=t,this.text=e,this.comments_before=null,this.newlines=i||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null};var p,m,g,f,v,y,x={};v="(?:\\\\u[0-9a-fA-F]{4}|[\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a"+(g="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc")+"])",y="(?:\\\\u[0-9a-fA-F]{4}|["+(m="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a")+g+(f="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f")+"])*",(p=x).identifier=new RegExp(v+y,"g"),p.identifierStart=new RegExp(v),p.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+m+g+f+"])+"),p.newline=/[\n\r\u2028\u2029]/,p.lineBreak=new RegExp("\r\n|"+p.newline.source),p.allLineBreaks=new RegExp(p.lineBreak.source,"g");var w={},S={};function k(t,e){this.raw_options=_(t,e),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}function _(t,e){var i,n={};for(i in t=C(t))i!==e&&(n[i]=t[i]);if(e&&t[e])for(i in t[e])n[i]=t[e][i];return n}function C(t){var e,i={};for(e in t){i[e.replace(/-/g,"_")]=t[e]}return i}k.prototype._get_array=function(t,e){var i=this.raw_options[t],n=e||[];return"object"==typeof i?null!==i&&"function"==typeof i.concat&&(n=i.concat()):"string"==typeof i&&(n=i.split(/[^a-zA-Z0-9_\/\-]+/)),n},k.prototype._get_boolean=function(t,e){var i=this.raw_options[t];return void 0===i?!!e:!!i},k.prototype._get_characters=function(t,e){var i=this.raw_options[t],n=e||"";return"string"==typeof i&&(n=i.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),n},k.prototype._get_number=function(t,e){var i=this.raw_options[t];e=parseInt(e,10),isNaN(e)&&(e=0);var n=parseInt(i,10);return isNaN(n)&&(n=e),n},k.prototype._get_selection=function(t,e,i){var n=this._get_selection_list(t,e,i);if(1!==n.length)throw new Error("Invalid Option Value: The option '"+t+"' can only be one of the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n[0]},k.prototype._get_selection_list=function(t,e,i){if(!e||0===e.length)throw new Error("Selection list cannot be empty.");if(i=i||[e[0]],!this._is_valid_selection(i,e))throw new Error("Invalid Default Value!");var n=this._get_array(t,i);if(!this._is_valid_selection(n,e))throw new Error("Invalid Option Value: The option '"+t+"' can contain only the following values:\n"+e+"\nYou passed in: '"+this.raw_options[t]+"'");return n},k.prototype._is_valid_selection=function(t,e){return t.length&&e.length&&!t.some((function(t){return-1===e.indexOf(t)}))},S.Options=k,S.normalizeOpts=C,S.mergeOpts=_;var E=S.Options,L=["before-newline","after-newline","preserve-newline"];function A(t){E.call(this,t,"js");var e=this.raw_options.brace_style||null;"expand-strict"===e?this.raw_options.brace_style="expand":"collapse-preserve-inline"===e?this.raw_options.brace_style="collapse,preserve-inline":void 0!==this.raw_options.braces_on_own_line&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var n=0;n<i.length;n++)"preserve-inline"===i[n]?this.brace_preserve_inline=!0:this.brace_style=i[n];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",L),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}A.prototype=new E,w.Options=A;var q={},T={},M=RegExp.prototype.hasOwnProperty("sticky");function O(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}O.prototype.restart=function(){this.__position=0},O.prototype.back=function(){this.__position>0&&(this.__position-=1)},O.prototype.hasNext=function(){return this.__position<this.__input_length},O.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__input.charAt(this.__position),this.__position+=1),t},O.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__input_length&&(e=this.__input.charAt(t)),e},O.prototype.__match=function(t,e){t.lastIndex=e;var i=t.exec(this.__input);return!i||M&&t.sticky||i.index!==e&&(i=null),i},O.prototype.test=function(t,e){return e=e||0,(e+=this.__position)>=0&&e<this.__input_length&&!!this.__match(t,e)},O.prototype.testChar=function(t,e){var i=this.peek(e);return t.lastIndex=0,null!==i&&t.test(i)},O.prototype.match=function(t){var e=this.__match(t,this.__position);return e?this.__position+=e[0].length:e=null,e},O.prototype.read=function(t,e,i){var n,o="";return t&&(n=this.match(t))&&(o+=n[0]),!e||!n&&t||(o+=this.readUntil(e,i)),o},O.prototype.readUntil=function(t,e){var i,n=this.__position;t.lastIndex=this.__position;var o=t.exec(this.__input);return o?(n=o.index,e&&(n+=o[0].length)):n=this.__input_length,i=this.__input.substring(this.__position,n),this.__position=n,i},O.prototype.readUntilAfter=function(t){return this.readUntil(t,!0)},O.prototype.get_regexp=function(t,e){var i=null,n="g";return e&&M&&(n="y"),"string"==typeof t&&""!==t?i=new RegExp(t,n):t&&(i=new RegExp(t.source,n)),i},O.prototype.get_literal_regexp=function(t){return RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},O.prototype.peekUntilAfter=function(t){var e=this.__position,i=this.readUntilAfter(t);return this.__position=e,i},O.prototype.lookBack=function(t){var e=this.__position-1;return e>=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},T.InputScanner=O;var R={},I={};function z(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}z.prototype.restart=function(){this.__position=0},z.prototype.isEmpty=function(){return 0===this.__tokens_length},z.prototype.hasNext=function(){return this.__position<this.__tokens_length},z.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},z.prototype.peek=function(t){var e=null;return t=t||0,(t+=this.__position)>=0&&t<this.__tokens_length&&(e=this.__tokens[t]),e},z.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},I.TokenStream=z;var B={},N={};function D(t,e){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,e&&(this._starting_pattern=this._input.get_regexp(e._starting_pattern,!0),this._match_pattern=this._input.get_regexp(e._match_pattern,!0),this._until_pattern=this._input.get_regexp(e._until_pattern),this._until_after=e._until_after)}D.prototype.read=function(){var t=this._input.read(this._starting_pattern);return this._starting_pattern&&!t||(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(t){var e=this._create();return e._until_after=!0,e._until_pattern=this._input.get_regexp(t),e._update(),e},D.prototype.until=function(t){var e=this._create();return e._until_after=!1,e._until_pattern=this._input.get_regexp(t),e._update(),e},D.prototype.starting_with=function(t){var e=this._create();return e._starting_pattern=this._input.get_regexp(t,!0),e._update(),e},D.prototype.matching=function(t){var e=this._create();return e._match_pattern=this._input.get_regexp(t,!0),e._update(),e},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},N.Pattern=D;var P=N.Pattern;function $(t,e){P.call(this,t,e),e?this._line_regexp=this._input.get_regexp(e._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}$.prototype=new P,$.prototype.__set_whitespace_patterns=function(t,e){t+="\\t ",e+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+e+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+e+"]")},$.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(" "===t)this.whitespace_before_token=" ";else if(t){var e=this.__split(this._newline_regexp,t);this.newline_count=e.length-1,this.whitespace_before_token=e[this.newline_count]}return t},$.prototype.matching=function(t,e){var i=this._create();return i.__set_whitespace_patterns(t,e),i._update(),i},$.prototype._create=function(){return new $(this._input,this)},$.prototype.__split=function(t,e){t.lastIndex=0;for(var i=0,n=[],o=t.exec(e);o;)n.push(e.substring(i,o.index)),i=o.index+o[0].length,o=t.exec(e);return i<e.length?n.push(e.substring(i,e.length)):n.push(""),n},B.WhitespacePattern=$;var H=T.InputScanner,F=h.Token,j=I.TokenStream,U=B.WhitespacePattern,W={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},G=function(t,e){this._input=new H(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new U(this._input)};G.prototype.tokenize=function(){var t;this._input.restart(),this.__tokens=new j,this._reset();for(var e=new F(W.START,""),i=null,n=[],o=new j;e.type!==W.EOF;){for(t=this._get_next_token(e,i);this._is_comment(t);)o.add(t),t=this._get_next_token(e,i);o.isEmpty()||(t.comments_before=o,o=new j),t.parent=i,this._is_opening(t)?(n.push(i),i=t):i&&this._is_closing(t,i)&&(t.opened=i,i.closed=t,i=n.pop(),t.parent=i),t.previous=e,e.next=t,this.__tokens.add(t),e=t}return this.__tokens},G.prototype._is_first_token=function(){return this.__tokens.isEmpty()},G.prototype._reset=function(){},G.prototype._get_next_token=function(t,e){this._readWhitespace();var i=this._input.read(/.+/g);return i?this._create_token(W.RAW,i):this._create_token(W.EOF,"")},G.prototype._is_comment=function(t){return!1},G.prototype._is_opening=function(t){return!1},G.prototype._is_closing=function(t,e){return!1},G.prototype._create_token=function(t,e){return new F(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},G.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},R.Tokenizer=G,R.TOKEN=W;var V={};function Y(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}Y.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var e={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)e[i[1]]=i[2],i=this.__directive_pattern.exec(t);return e},Y.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},V.Directives=Y;var X={},Z=N.Pattern,K={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function Q(t,e){Z.call(this,t,e),this.__template_pattern=null,this._disabled=Object.assign({},K),this._excluded=Object.assign({},K),e&&(this.__template_pattern=this._input.get_regexp(e.__template_pattern),this._excluded=Object.assign(this._excluded,e._excluded),this._disabled=Object.assign(this._disabled,e._disabled));var i=new Z(t);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}Q.prototype=new Z,Q.prototype._create=function(){return new Q(this._input,this)},Q.prototype._update=function(){this.__set_templated_pattern()},Q.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},Q.prototype.read_options=function(t){var e=this._create();for(var i in K)e._disabled[i]=-1===t.templating.indexOf(i);return e._update(),e},Q.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},Q.prototype.read=function(){var t="";t=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern);for(var e=this._read_template();e;)this._match_pattern?e+=this._input.read(this._match_pattern):e+=this._input.readUntil(this.__template_pattern),t+=e,e=this._read_template();return this._until_after&&(t+=this._input.readUntilAfter(this._until_pattern)),t},Q.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},Q.prototype._read_template=function(){var t="",e=this._input.peek();if("<"===e){var i=this._input.peek(1);this._disabled.php||this._excluded.php||"?"!==i||(t=t||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==i||(t=t||this.__patterns.erb.read())}else"{"===e&&(this._disabled.handlebars||this._excluded.handlebars||(t=(t=(t=t||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(t=t||this.__patterns.django_value.read()),this._excluded.django||(t=(t=t||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(t=(t=(t=t||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read()));return t},X.TemplatablePattern=Q;var J=T.InputScanner,tt=R.Tokenizer,et=R.TOKEN,it=V.Directives,nt=x,ot=N.Pattern,st=X.TemplatablePattern;function lt(t,e){return-1!==e.indexOf(t)}var at={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:et.START,RAW:et.RAW,EOF:et.EOF},rt=new it(/\/\*/,/\*\//),ct=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,ut=/[0-9]/,dt=/[^\d\.]/,bt=">>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),ht=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";ht=(ht="\\?\\.(?!\\d) "+(ht=ht.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|");var pt,mt=new RegExp(ht),gt="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),ft=gt.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),vt=new RegExp("^(?:"+ft.join("|")+")$"),yt=function(t,e){tt.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var i=new ot(this._input),n=new st(this._input).read_options(this._options);this.__patterns={template:n,identifier:n.starting_with(nt.identifier).matching(nt.identifierMatch),number:i.matching(ct),punct:i.matching(mt),comment:i.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:i.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:i.matching(/<!--/),html_comment_end:i.matching(/-->/),include:i.starting_with(/#include/).until_after(nt.lineBreak),shebang:i.starting_with(/#!/).until_after(nt.lineBreak),xml:i.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:n.until(/['\\\n\r\u2028\u2029]/),double_quote:n.until(/["\\\n\r\u2028\u2029]/),template_text:n.until(/[`\\$]/),template_expression:n.until(/[`}\\]/)}};(yt.prototype=new tt)._is_comment=function(t){return t.type===at.COMMENT||t.type===at.BLOCK_COMMENT||t.type===at.UNKNOWN},yt.prototype._is_opening=function(t){return t.type===at.START_BLOCK||t.type===at.START_EXPR},yt.prototype._is_closing=function(t,e){return(t.type===at.END_BLOCK||t.type===at.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},yt.prototype._reset=function(){pt=!1},yt.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(at.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_non_javascript(n))||this._read_string(n))||this._read_word(t))||this._read_singles(n))||this._read_comment(n))||this._read_regexp(n,t))||this._read_xml(n,t))||this._read_punctuation())||this._create_token(at.UNKNOWN,this._input.next())},yt.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(nt.allLineBreaks,"\n"),t.type!==at.DOT&&(t.type!==at.RESERVED||"set"!==t.text&&"get"!==t.text)&&vt.test(e)?"in"===e||"of"===e?this._create_token(at.OPERATOR,e):this._create_token(at.RESERVED,e):this._create_token(at.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(at.WORD,e):void 0},yt.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(at.START_EXPR,t):")"===t||"]"===t?e=this._create_token(at.END_EXPR,t):"{"===t?e=this._create_token(at.START_BLOCK,t):"}"===t?e=this._create_token(at.END_BLOCK,t):";"===t?e=this._create_token(at.SEMICOLON,t):"."===t&&dt.test(this._input.peek(1))?e=this._create_token(at.DOT,t):","===t&&(e=this._create_token(at.COMMA,t)),e&&this._input.next(),e},yt.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(at.EQUALS,t):"?."===t?this._create_token(at.DOT,t):this._create_token(at.OPERATOR,t)},yt.prototype._read_non_javascript=function(t){var e="";if("#"===t){if(this._is_first_token()&&(e=this.__patterns.shebang.read()))return this._create_token(at.UNKNOWN,e.trim()+"\n");if(e=this.__patterns.include.read())return this._create_token(at.UNKNOWN,e.trim()+"\n");t=this._input.next();var i="#";if(this._input.hasNext()&&this._input.testChar(ut)){do{i+=t=this._input.next()}while(this._input.hasNext()&&"#"!==t&&"="!==t);return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(i+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(i+="{}",this._input.next(),this._input.next())),this._create_token(at.WORD,i)}this._input.back()}else if("<"===t&&this._is_first_token()){if(e=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(nt.newline);)e+=this._input.next();return pt=!0,this._create_token(at.COMMENT,e)}}else if(pt&&"-"===t&&(e=this.__patterns.html_comment_end.read()))return pt=!1,this._create_token(at.COMMENT,e);return null},yt.prototype._read_comment=function(t){var e=null;if("/"===t){var i="";if("*"===this._input.peek(1)){i=this.__patterns.block_comment.read();var n=rt.get_directives(i);n&&"start"===n.ignore&&(i+=rt.readIgnored(this._input)),i=i.replace(nt.allLineBreaks,"\n"),(e=this._create_token(at.BLOCK_COMMENT,i)).directives=n}else"/"===this._input.peek(1)&&(i=this.__patterns.comment.read(),e=this._create_token(at.COMMENT,i))}return e},yt.prototype._read_string=function(t){if("`"===t||"'"===t||'"'===t){var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function(t){var e="",i=0,n=new J(t),o=null;for(;n.hasNext();)if((o=n.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=o[0]),"\\"===n.peek()){if(n.next(),"x"===n.peek())o=n.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==n.peek()){e+="\\",n.hasNext()&&(e+=n.next());continue}o=n.match(/u([0-9A-Fa-f]{4})/g)}if(!o)return t;if((i=parseInt(o[1],16))>126&&i<=255&&0===o[0].indexOf("x"))return t;if(i>=0&&i<32){e+="\\"+o[0];continue}e+=34===i||39===i||92===i?"\\"+String.fromCharCode(i):String.fromCharCode(i)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(nt.allLineBreaks,"\n"),this._create_token(at.STRING,e)}return null},yt.prototype._allow_regexp_or_xml=function(t){return t.type===at.RESERVED&&lt(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===at.END_EXPR&&")"===t.text&&t.opened.previous.type===at.RESERVED&&lt(t.opened.previous.text,["if","while","for"])||lt(t.type,[at.COMMENT,at.START_EXPR,at.START_BLOCK,at.START,at.END_BLOCK,at.OPERATOR,at.EQUALS,at.EOF,at.SEMICOLON,at.COMMA])},yt.prototype._read_regexp=function(t,e){if("/"===t&&this._allow_regexp_or_xml(e)){for(var i=this._input.next(),n=!1,o=!1;this._input.hasNext()&&(n||o||this._input.peek()!==t)&&!this._input.testChar(nt.newline);)i+=this._input.peek(),n?n=!1:(n="\\"===this._input.peek(),"["===this._input.peek()?o=!0:"]"===this._input.peek()&&(o=!1)),this._input.next();return this._input.peek()===t&&(i+=this._input.next(),i+=this._input.read(nt.identifier)),this._create_token(at.STRING,i)}return null},yt.prototype._read_xml=function(t,e){if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)){var i="",n=this.__patterns.xml.read_match();if(n){for(var o=n[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),s=0===o.indexOf("{"),l=0;n;){var a=!!n[1],r=n[2];if(!(!!n[n.length-1]||"![CDATA["===r.slice(0,8))&&(r===o||s&&r.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(a?--l:++l),i+=n[0],l<=0)break;n=this.__patterns.xml.read_match()}return n||(i+=this._input.match(/[\s\S]*/g)[0]),i=i.replace(nt.allLineBreaks,"\n"),this._create_token(at.STRING,i)}}return null},yt.prototype._read_string_recursive=function(t,e,i){var n,o;"'"===t?o=this.__patterns.single_quote:'"'===t?o=this.__patterns.double_quote:"`"===t?o=this.__patterns.template_text:"}"===t&&(o=this.__patterns.template_expression);for(var s=o.read(),l="";this._input.hasNext();){if((l=this._input.next())===t||!e&&nt.newline.test(l)){this._input.back();break}"\\"===l&&this._input.hasNext()?("x"===(n=this._input.peek())||"u"===n?this.has_char_escapes=!0:"\r"===n&&"\n"===this._input.peek(1)&&this._input.next(),l+=this._input.next()):i&&("${"===i&&"$"===l&&"{"===this._input.peek()&&(l+=this._input.next()),i===l&&(l+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(l+=this._input.next()))),s+=l+=o.read()}return s},q.Tokenizer=yt,q.TOKEN=at,q.positionable_operators=bt.slice(),q.line_starters=gt.slice();var xt=c.Output,wt=h.Token,St=x,kt=w.Options,_t=q.Tokenizer,Ct=q.line_starters,Et=q.positionable_operators,Lt=q.TOKEN;function At(t,e){return-1!==e.indexOf(t)}function qt(t,e){return t&&t.type===Lt.RESERVED&&t.text===e}function Tt(t,e){return t&&t.type===Lt.RESERVED&&At(t.text,e)}var Mt=["case","return","do","if","throw","else","await","break","continue","async"],Ot=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].replace(/-/g,"_")]=t[i];return e}(["before-newline","after-newline","preserve-newline"]),Rt=[Ot.before_newline,Ot.preserve_newline],It={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function zt(t,e){e.multiline_frame||e.mode===It.ForInitializer||e.mode===It.Conditional||t.remove_indent(e.start_line_index)}function Bt(t){return t===It.ArrayLiteral}function Nt(t){return At(t,[It.Expression,It.ForInitializer,It.Conditional])}function Dt(t,e){e=e||{},this._source_text=t||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new kt(e)}Dt.prototype.create_flags=function(t,e){var i=0;return t&&(i=t.indentation_level,!this._output.just_added_newline()&&t.line_indent_level>i&&(i=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new wt(Lt.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:i,alignment:0,line_indent_level:t?t.line_indent_level:i,start_line_index:this._output.get_line_number(),ternary_depth:0}},Dt.prototype._reset=function(t){var e=t.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new xt(this._options,e),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(It.BlockStatement);var i=new _t(t,this._options);return this._tokens=i.tokenize(),t},Dt.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._reset(this._source_text),e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&St.lineBreak.test(t||"")&&(e=t.match(St.lineBreak)[0]));for(var i=this._tokens.next();i;)this.handle_token(i),this._last_last_text=this._flags.last_token.text,this._flags.last_token=i,i=this._tokens.next();return this._output.get_code(e)},Dt.prototype.handle_token=function(t,e){t.type===Lt.START_EXPR?this.handle_start_expr(t):t.type===Lt.END_EXPR?this.handle_end_expr(t):t.type===Lt.START_BLOCK?this.handle_start_block(t):t.type===Lt.END_BLOCK?this.handle_end_block(t):t.type===Lt.WORD||t.type===Lt.RESERVED?this.handle_word(t):t.type===Lt.SEMICOLON?this.handle_semicolon(t):t.type===Lt.STRING?this.handle_string(t):t.type===Lt.EQUALS?this.handle_equals(t):t.type===Lt.OPERATOR?this.handle_operator(t):t.type===Lt.COMMA?this.handle_comma(t):t.type===Lt.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===Lt.COMMENT?this.handle_comment(t,e):t.type===Lt.DOT?this.handle_dot(t):t.type===Lt.EOF?this.handle_eof(t):(t.type,Lt.UNKNOWN,this.handle_unknown(t,e))},Dt.prototype.handle_whitespace_and_comments=function(t,e){var i=t.newlines,n=this._options.keep_array_indentation&&Bt(this._flags.mode);if(t.comments_before)for(var o=t.comments_before.next();o;)this.handle_whitespace_and_comments(o,e),this.handle_token(o,e),o=t.comments_before.next();if(n)for(var s=0;s<i;s+=1)this.print_newline(s>0,e);else if(this._options.max_preserve_newlines&&i>this._options.max_preserve_newlines&&(i=this._options.max_preserve_newlines),this._options.preserve_newlines&&i>1){this.print_newline(!1,e);for(var l=1;l<i;l+=1)this.print_newline(!0,e)}};var Pt=["async","break","continue","return","throw","yield"];Dt.prototype.allow_wrap_or_preserved_newline=function(t,e){if(e=void 0!==e&&e,!this._output.just_added_newline()){var i=this._options.preserve_newlines&&t.newlines||e;if(At(this._flags.last_token.text,Et)||At(t.text,Et)){var n=At(this._flags.last_token.text,Et)&&At(this._options.operator_position,Rt)||At(t.text,Et);i=i&&n}if(i)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(Tt(this._flags.last_token,Pt))return;this._output.set_wrap_point()}}},Dt.prototype.print_newline=function(t,e){if(!e&&";"!==this._flags.last_token.text&&","!==this._flags.last_token.text&&"="!==this._flags.last_token.text&&(this._flags.last_token.type!==Lt.OPERATOR||"--"===this._flags.last_token.text||"++"===this._flags.last_token.text))for(var i=this._tokens.peek();!(this._flags.mode!==It.Statement||this._flags.if_block&&qt(i,"else")||this._flags.do_block);)this.restore_mode();this._output.add_new_line(t)&&(this._flags.multiline_frame=!0)},Dt.prototype.print_token_line_indentation=function(t){this._output.just_added_newline()&&(this._options.keep_array_indentation&&t.newlines&&("["===t.text||Bt(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(t.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},Dt.prototype.print_token=function(t){if(this._output.raw)this._output.add_raw_token(t);else{if(this._options.comma_first&&t.previous&&t.previous.type===Lt.COMMA&&this._output.just_added_newline()&&","===this._output.previous_line.last()){var e=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(e),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(t),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(t),this._output.non_breaking_space=!0,this._output.add_token(t.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)}},Dt.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Dt.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Dt.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},Dt.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===It.Statement&&zt(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},Dt.prototype.start_of_object_property=function(){return this._flags.parent.mode===It.ObjectLiteral&&this._flags.mode===It.Statement&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||Tt(this._flags.last_token,["get","set"]))},Dt.prototype.start_of_statement=function(t){var e=!1;return!!(e=(e=(e=(e=(e=(e=(e=e||Tt(this._flags.last_token,["var","let","const"])&&t.type===Lt.WORD)||qt(this._flags.last_token,"do"))||!(this._flags.parent.mode===It.ObjectLiteral&&this._flags.mode===It.Statement)&&Tt(this._flags.last_token,Pt)&&!t.newlines)||qt(this._flags.last_token,"else")&&!(qt(t,"if")&&!t.comments_before))||this._flags.last_token.type===Lt.END_EXPR&&(this._previous_flags.mode===It.ForInitializer||this._previous_flags.mode===It.Conditional))||this._flags.last_token.type===Lt.WORD&&this._flags.mode===It.BlockStatement&&!this._flags.in_case&&!("--"===t.text||"++"===t.text)&&"function"!==this._last_last_text&&t.type!==Lt.WORD&&t.type!==Lt.RESERVED)||this._flags.mode===It.ObjectLiteral&&(":"===this._flags.last_token.text&&0===this._flags.ternary_depth||Tt(this._flags.last_token,["get","set"])))&&(this.set_mode(It.Statement),this.indent(),this.handle_whitespace_and_comments(t,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t,Tt(t,["do","for","if","while"])),!0)},Dt.prototype.handle_start_expr=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t);var e=It.Expression;if("["===t.text){if(this._flags.last_token.type===Lt.WORD||")"===this._flags.last_token.text)return Tt(this._flags.last_token,Ct)&&(this._output.space_before_token=!0),this.print_token(t),this.set_mode(e),this.indent(),void(this._options.space_in_paren&&(this._output.space_before_token=!0));e=It.ArrayLiteral,Bt(this._flags.mode)&&("["!==this._flags.last_token.text&&(","!==this._flags.last_token.text||"]"!==this._last_last_text&&"}"!==this._last_last_text)||this._options.keep_array_indentation||this.print_newline()),At(this._flags.last_token.type,[Lt.START_EXPR,Lt.END_EXPR,Lt.WORD,Lt.OPERATOR,Lt.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===Lt.RESERVED)"for"===this._flags.last_token.text?(this._output.space_before_token=this._options.space_before_conditional,e=It.ForInitializer):At(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,e=It.Conditional):At(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:"import"===this._flags.last_token.text&&""===t.whitespace_before?this._output.space_before_token=!1:(At(this._flags.last_token.text,Ct)||"catch"===this._flags.last_token.text)&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===Lt.EQUALS||this._flags.last_token.type===Lt.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t);else if(this._flags.last_token.type===Lt.WORD){this._output.space_before_token=!1;var i=this._tokens.peek(-3);if(this._options.space_after_named_function&&i){var n=this._tokens.peek(-4);Tt(i,["async","function"])||"*"===i.text&&Tt(n,["async","function"])?this._output.space_before_token=!0:this._flags.mode===It.ObjectLiteral&&("{"!==i.text&&","!==i.text&&("*"!==i.text||"{"!==n.text&&","!==n.text)||(this._output.space_before_token=!0))}}else this.allow_wrap_or_preserved_newline(t);(this._flags.last_token.type===Lt.RESERVED&&("function"===this._flags.last_word||"typeof"===this._flags.last_word)||"*"===this._flags.last_token.text&&(At(this._last_last_text,["function","yield"])||this._flags.mode===It.ObjectLiteral&&At(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}";"===this._flags.last_token.text||this._flags.last_token.type===Lt.START_BLOCK?this.print_newline():this._flags.last_token.type!==Lt.END_EXPR&&this._flags.last_token.type!==Lt.START_EXPR&&this._flags.last_token.type!==Lt.END_BLOCK&&"."!==this._flags.last_token.text&&this._flags.last_token.type!==Lt.COMMA||this.allow_wrap_or_preserved_newline(t,t.newlines),this.print_token(t),this.set_mode(e),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},Dt.prototype.handle_end_expr=function(t){for(;this._flags.mode===It.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(t,"]"===t.text&&Bt(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type!==Lt.START_EXPR||this._options.space_in_empty_paren?this._output.space_before_token=!0:(this._output.trim(),this._output.space_before_token=!1)),this.deindent(),this.print_token(t),this.restore_mode(),zt(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===It.Conditional&&(this._previous_flags.mode=It.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},Dt.prototype.handle_start_block=function(t){this.handle_whitespace_and_comments(t);var e=this._tokens.peek(),i=this._tokens.peek(1);"switch"===this._flags.last_word&&this._flags.last_token.type===Lt.END_EXPR?(this.set_mode(It.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(It.BlockStatement):i&&(At(i.text,[":",","])&&At(e.type,[Lt.STRING,Lt.WORD,Lt.RESERVED])||At(e.text,["get","set","..."])&&At(i.type,[Lt.WORD,Lt.RESERVED]))?At(this._last_last_text,["class","interface"])?this.set_mode(It.BlockStatement):this.set_mode(It.ObjectLiteral):this._flags.last_token.type===Lt.OPERATOR&&"=>"===this._flags.last_token.text?this.set_mode(It.BlockStatement):At(this._flags.last_token.type,[Lt.EQUALS,Lt.START_EXPR,Lt.COMMA,Lt.OPERATOR])||Tt(this._flags.last_token,["return","throw","import","default"])?this.set_mode(It.ObjectLiteral):this.set_mode(It.BlockStatement);var n=!e.comments_before&&"}"===e.text,o=n&&"function"===this._flags.last_word&&this._flags.last_token.type===Lt.END_EXPR;if(this._options.brace_preserve_inline){var s=0,l=null;this._flags.inline_frame=!0;do{if(s+=1,(l=this._tokens.peek(s-1)).newlines){this._flags.inline_frame=!1;break}}while(l.type!==Lt.EOF&&(l.type!==Lt.END_BLOCK||l.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==Lt.OPERATOR&&(o||this._flags.last_token.type===Lt.EQUALS||Tt(this._flags.last_token,Mt)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!Bt(this._previous_flags.mode)||this._flags.last_token.type!==Lt.START_EXPR&&this._flags.last_token.type!==Lt.COMMA||((this._flags.last_token.type===Lt.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===Lt.COMMA||this._flags.last_token.type===Lt.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==Lt.OPERATOR&&this._flags.last_token.type!==Lt.START_EXPR&&(this._flags.last_token.type!==Lt.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent(),n||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},Dt.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===It.Statement;)this.restore_mode();var e=this._flags.last_token.type===Lt.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(Bt(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},Dt.prototype.handle_word=function(t){if(t.type===Lt.RESERVED)if(At(t.text,["set","get"])&&this._flags.mode!==It.ObjectLiteral)t.type=Lt.WORD;else if("import"===t.text&&"("===this._tokens.peek().text)t.type=Lt.WORD;else if(At(t.text,["as","from"])&&!this._flags.import_block)t.type=Lt.WORD;else if(this._flags.mode===It.ObjectLiteral){":"===this._tokens.peek().text&&(t.type=Lt.WORD)}if(this.start_of_statement(t)?Tt(this._flags.last_token,["var","let","const"])&&t.type===Lt.WORD&&(this._flags.declaration_statement=!0):!t.newlines||Nt(this._flags.mode)||this._flags.last_token.type===Lt.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===Lt.EQUALS||!this._options.preserve_newlines&&Tt(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(qt(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&qt(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===It.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&Tt(t,["case","default"]))return this.print_newline(),this._flags.last_token.type!==Lt.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0);if(this._flags.last_token.type!==Lt.COMMA&&this._flags.last_token.type!==Lt.START_EXPR&&this._flags.last_token.type!==Lt.EQUALS&&this._flags.last_token.type!==Lt.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),qt(t,"function"))return(At(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!At(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==Lt.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===Lt.RESERVED||this._flags.last_token.type===Lt.WORD?Tt(this._flags.last_token,["get","set","new","export"])||Tt(this._flags.last_token,Pt)||qt(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===Lt.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:(this._flags.multiline_frame||!Nt(this._flags.mode)&&!Bt(this._flags.mode))&&this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text);var e="NONE";(this._flags.last_token.type===Lt.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":Tt(t,["else","catch","finally","from"])?"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):e="NEWLINE":this._flags.last_token.type===Lt.SEMICOLON&&this._flags.mode===It.BlockStatement?e="NEWLINE":this._flags.last_token.type===Lt.SEMICOLON&&Nt(this._flags.mode)?e="SPACE":this._flags.last_token.type===Lt.STRING?e="NEWLINE":this._flags.last_token.type===Lt.RESERVED||this._flags.last_token.type===Lt.WORD||"*"===this._flags.last_token.text&&(At(this._last_last_text,["function","yield"])||this._flags.mode===It.ObjectLiteral&&At(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===Lt.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===Lt.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),Tt(t,Ct)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),Tt(t,["else","catch","finally"]))?(this._flags.last_token.type!==Lt.END_BLOCK||this._previous_flags.mode!==It.BlockStatement||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?Tt(this._flags.last_token,Mt)||"declare"===this._flags.last_token.text&&Tt(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==Lt.END_EXPR?this._flags.last_token.type===Lt.START_EXPR&&Tt(t,["var","let","const"])||":"===this._flags.last_token.text||(qt(t,"if")&&qt(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):Tt(t,Ct)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&Bt(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0);!t.previous||t.previous.type!==Lt.WORD&&t.previous.type!==Lt.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,t.type===Lt.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&qt(t,"from")&&(this._flags.import_block=!1))},Dt.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==It.Statement||this._flags.if_block&&qt(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},Dt.prototype.handle_string=function(t){(!t.text.startsWith("`")||0!==t.newlines||""!==t.whitespace_before||")"!==t.previous.text&&this._flags.last_token.type!==Lt.WORD)&&(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===Lt.RESERVED||this._flags.last_token.type===Lt.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===Lt.COMMA||this._flags.last_token.type===Lt.START_EXPR||this._flags.last_token.type===Lt.EQUALS||this._flags.last_token.type===Lt.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==Lt.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},Dt.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},Dt.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(Nt(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===It.ObjectLiteral||this._flags.mode===It.Statement&&this._flags.parent.mode===It.ObjectLiteral?(this._flags.mode===It.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},Dt.prototype.handle_operator=function(t){var e="*"===t.text&&(Tt(this._flags.last_token,["function","yield"])||At(this._flags.last_token.type,[Lt.START_BLOCK,Lt.COMMA,Lt.END_BLOCK,Lt.SEMICOLON])),i=At(t.text,["-","+"])&&(At(this._flags.last_token.type,[Lt.START_BLOCK,Lt.START_EXPR,Lt.EQUALS,Lt.OPERATOR])||At(this._flags.last_token.text,Ct)||","===this._flags.last_token.text);if(this.start_of_statement(t));else{var n=!e;this.handle_whitespace_and_comments(t,n)}if(Tt(this._flags.last_token,Mt))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._flags.last_token.type!==Lt.DOT)if("::"!==t.text){if(this._flags.last_token.type===Lt.OPERATOR&&At(this._options.operator_position,Rt)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==Lt.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0);var o=!0,s=!0,l=!1;if(":"===t.text?0===this._flags.ternary_depth?o=!1:(this._flags.ternary_depth-=1,l=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!i&&!e&&this._options.preserve_newlines&&At(t.text,Et)){var a=":"===t.text,r=a&&l,c=a&&!l;switch(this._options.operator_position){case Ot.before_newline:return this._output.space_before_token=!c,this.print_token(t),a&&!r||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case Ot.after_newline:return this._output.space_before_token=!0,!a||r?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case Ot.preserve_newline:return c||this.allow_wrap_or_preserved_newline(t),o=!(this._output.just_added_newline()||c),this._output.space_before_token=o,this.print_token(t),void(this._output.space_before_token=!0)}}if(e){this.allow_wrap_or_preserved_newline(t),o=!1;var u=this._tokens.peek();s=u&&At(u.type,[Lt.WORD,Lt.RESERVED])}else"..."===t.text?(this.allow_wrap_or_preserved_newline(t),o=this._flags.last_token.type===Lt.START_BLOCK,s=!1):(At(t.text,["--","++","!","~"])||i)&&(this._flags.last_token.type!==Lt.COMMA&&this._flags.last_token.type!==Lt.START_EXPR||this.allow_wrap_or_preserved_newline(t),o=!1,s=!1,!t.newlines||"--"!==t.text&&"++"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&Nt(this._flags.mode)&&(o=!0),this._flags.last_token.type===Lt.RESERVED?o=!0:this._flags.last_token.type===Lt.END_EXPR?o=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===Lt.OPERATOR&&(o=At(t.text,["--","-","++","+"])&&At(this._flags.last_token.text,["--","-","++","+"]),At(t.text,["+","-"])&&At(this._flags.last_token.text,["--","++"])&&(s=!0)),(this._flags.mode!==It.BlockStatement||this._flags.inline_frame)&&this._flags.mode!==It.Statement||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline());this._output.space_before_token=this._output.space_before_token||o,this.print_token(t),this._output.space_before_token=s}else this.print_token(t);else this.print_token(t)},Dt.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):St.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},Dt.prototype.print_block_commment=function(t,e){var i,n=function(t){for(var e=[],i=(t=t.replace(St.allLineBreaks,"\n")).indexOf("\n");-1!==i;)e.push(t.substring(0,i)),i=(t=t.substring(i+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),o=!1,s=!1,l=t.whitespace_before,a=l.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(n[0]),this.print_newline(!1,e),n.length>1){for(o=function(t,e){for(var i=0;i<t.length;i++)if(t[i].trim().charAt(0)!==e)return!1;return!0}(n=n.slice(1),"*"),s=function(t,e){for(var i,n=0,o=t.length;n<o;n++)if((i=t[n])&&0!==i.indexOf(e))return!1;return!0}(n,l),o&&(this._flags.alignment=1),i=0;i<n.length;i++)o?(this.print_token_line_indentation(t),this._output.add_token(n[i].replace(/^\s+/g,""))):s&&n[i]?(this.print_token_line_indentation(t),this._output.add_token(n[i].substring(a))):(this._output.current_line.set_indent(-1),this._output.add_token(n[i])),this.print_newline(!1,e);this._flags.alignment=0}},Dt.prototype.handle_comment=function(t,e){t.newlines?this.print_newline(!1,e):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(t),this.print_newline(!1,e)},Dt.prototype.handle_dot=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t,!0),Tt(this._flags.last_token,Mt)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(t,")"===this._flags.last_token.text&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(t)},Dt.prototype.handle_unknown=function(t,e){this.print_token(t),"\n"===t.text[t.text.length-1]&&this.print_newline(!1,e)},Dt.prototype.handle_eof=function(t){for(;this._flags.mode===It.Statement;)this.restore_mode();this.handle_whitespace_and_comments(t)},r.Beautifier=Dt;var $t=r.Beautifier,Ht=w.Options;a.exports=function(t,e){return new $t(t,e).beautify()},a.exports.defaultOptions=function(){return new Ht};var Ft={exports:{}},jt={},Ut={},Wt=S.Options;function Gt(t){Wt.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var e=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||e;var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var n=0;n<i.length;n++)"expand"!==i[n]?this.brace_style="collapse":this.brace_style=i[n]}Gt.prototype=new Wt,Ut.Options=Gt;var Vt=Ut.Options,Yt=c.Output,Xt=T.InputScanner,Zt=new(0,V.Directives)(/\/\*/,/\*\//),Kt=/\r\n|[\r\n]/,Qt=/\r\n|[\r\n]/g,Jt=/\s/,te=/(?:\s|\n)+/g,ee=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,ie=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function ne(t,e){this._source_text=t||"",this._options=new Vt(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}ne.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},ne.prototype.eatWhitespace=function(t){for(var e=Jt.test(this._input.peek()),i=0;Jt.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(0===i||i<this._options.max_preserve_newlines)&&(i++,this._output.add_new_line(!0));return e},ne.prototype.foundNestedPseudoClass=function(){for(var t=0,e=1,i=this._input.peek(e);i;){if("{"===i)return!0;if("("===i)t+=1;else if(")"===i){if(0===t)return!1;t-=1}else if(";"===i||"}"===i)return!1;e++,i=this._input.peek(e)}return!1},ne.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},ne.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},ne.prototype.indent=function(){this._indentLevel++},ne.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},ne.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===e&&(e="\n",t&&Kt.test(t||"")&&(e=t.match(Kt)[0]));var i=(t=t.replace(Qt,"\n")).match(/^[\t ]*/)[0];this._output=new Yt(this._options,i),this._input=new Xt(t),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var n,o,s=0,l=!1,a=!1,r=!1,c=!1,u=!1,d=this._ch;n=""!==this._input.read(te),o=d,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),d=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var b=this._input.read(ee),h=Zt.get_directives(b);h&&"start"===h.ignore&&(b+=Zt.readIgnored(this._input)),this.print_string(b),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(ie)),this.eatWhitespace(!0);else if("@"===this._ch)if(this.preserveSingleSpace(n),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var p=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);p.match(/[ :]$/)&&(p=this.eatString(": ").replace(/\s$/,""),this.print_string(p),this._output.space_before_token=!0),"extend"===(p=p.replace(/\s$/,""))?c=!0:"import"===p&&(u=!0),p in this.NESTED_AT_RULE?(this._nestedLevel+=1,p in this.CONDITIONAL_GROUP_RULE&&(r=!0)):l||0!==s||-1===p.indexOf(":")||(a=!0,this.indent())}else"#"===this._ch&&"{"===this._input.peek()?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString("}"))):"{"===this._ch?(a&&(a=!1,this.outdent()),r?(r=!1,l=this._indentLevel>=this._nestedLevel):l=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&l&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):"}"===this._ch?(this.outdent(),this._output.add_new_line(),"{"===o&&this._output.trim(!0),u=!1,c=!1,a&&(this.outdent(),a=!1),this.print_string(this._ch),l=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0)):":"===this._ch?!l&&!r||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||c||0!==s?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),a||(a=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):'"'===this._ch||"'"===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):";"===this._ch?0===s?(a&&(this.outdent(),a=!1),c=!1,u=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):"("===this._ch?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),s++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),s&&(s--,this.outdent()))):(this.preserveSingleSpace(n),this.print_string(this._ch),this.eatWhitespace(),s++,this.indent()):")"===this._ch?(s&&(s--,this.outdent()),this.print_string(this._ch)):","===this._ch?(this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||a||0!==s||u||c?this._output.space_before_token=!0:this._output.add_new_line()):">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||a||0!==s?"]"===this._ch?this.print_string(this._ch):"["===this._ch?(this.preserveSingleSpace(n),this.print_string(this._ch)):"="===this._ch?(this.eatWhitespace(),this.print_string("="),Jt.test(this._ch)&&(this._ch="")):"!"!==this._ch||this._input.lookBack("\\")?(this.preserveSingleSpace(n),this.print_string(this._ch)):(this.print_string(" "),this.print_string(this._ch)):this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&Jt.test(this._ch)&&(this._ch=""));return this._output.get_code(e)},jt.Beautifier=ne;var oe=jt.Beautifier,se=Ut.Options;Ft.exports=function(t,e){return new oe(t,e).beautify()},Ft.exports.defaultOptions=function(){return new se};var le={exports:{}},ae={},re={},ce=S.Options;function ue(t){ce.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}ue.prototype=new ce,re.Options=ue;var de={},be=R.Tokenizer,he=R.TOKEN,pe=V.Directives,me=X.TemplatablePattern,ge=N.Pattern,fe={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:he.START,RAW:he.RAW,EOF:he.EOF},ve=new pe(/<\!--/,/-->/),ye=function(t,e){be.call(this,t,e),this._current_tag_name="";var i=new me(this._input).read_options(this._options),n=new ge(this._input);if(this.__patterns={word:i.until(/[\n\r\t <]/),single_quote:i.until_after(/'/),double_quote:i.until_after(/"/),attribute:i.until(/[\n\r\t =>]|\/>/),element_name:i.until(/[\n\r\t >\/]/),handlebars_comment:n.starting_with(/{{!--/).until_after(/--}}/),handlebars:n.starting_with(/{{/).until_after(/}}/),handlebars_open:n.until(/[\n\r\t }]/),handlebars_raw_close:n.until(/}}/),comment:n.starting_with(/<!--/).until_after(/-->/),cdata:n.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:n.starting_with(/<!\[/).until_after(/]>/),processing:n.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var o=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=n.matching(o).until_after(o)}};(ye.prototype=new be)._is_comment=function(t){return!1},ye.prototype._is_opening=function(t){return t.type===fe.TAG_OPEN},ye.prototype._is_closing=function(t,e){return t.type===fe.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},ye.prototype._reset=function(){this._current_tag_name=""},ye.prototype._get_next_token=function(t,e){var i=null;this._readWhitespace();var n=this._input.peek();return null===n?this._create_token(fe.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_open_handlebars(n,e))||this._read_attribute(n,t,e))||this._read_close(n,e))||this._read_raw_content(n,t,e))||this._read_content_word(n))||this._read_comment_or_cdata(n))||this._read_processing(n))||this._read_open(n,e))||this._create_token(fe.UNKNOWN,this._input.next())},ye.prototype._read_comment_or_cdata=function(t){var e=null,i=null,n=null;"<"===t&&("!"===this._input.peek(1)&&((i=this.__patterns.comment.read())?(n=ve.get_directives(i))&&"start"===n.ignore&&(i+=ve.readIgnored(this._input)):i=this.__patterns.cdata.read()),i&&((e=this._create_token(fe.COMMENT,i)).directives=n));return e},ye.prototype._read_processing=function(t){var e=null,i=null;if("<"===t){var n=this._input.peek(1);"!"!==n&&"?"!==n||(i=(i=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),i&&((e=this._create_token(fe.COMMENT,i)).directives=null)}return e},ye.prototype._read_open=function(t,e){var i=null,n=null;return e||"<"===t&&(i=this._input.next(),"/"===this._input.peek()&&(i+=this._input.next()),i+=this.__patterns.element_name.read(),n=this._create_token(fe.TAG_OPEN,i)),n},ye.prototype._read_open_handlebars=function(t,e){var i=null,n=null;return e||this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&("!"===this._input.peek(2)?(i=(i=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),n=this._create_token(fe.COMMENT,i)):(i=this.__patterns.handlebars_open.read(),n=this._create_token(fe.TAG_OPEN,i))),n},ye.prototype._read_close=function(t,e){var i=null,n=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(i=this._input.next(),"/"===t&&(i+=this._input.next()),n=this._create_token(fe.TAG_CLOSE,i)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),n=this._create_token(fe.TAG_CLOSE,"}}"))),n},ye.prototype._read_attribute=function(t,e,i){var n=null,o="";if(i&&"<"===i.text[0])if("="===t)n=this._create_token(fe.EQUALS,this._input.next());else if('"'===t||"'"===t){var s=this._input.next();s+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),n=this._create_token(fe.VALUE,s)}else(o=this.__patterns.attribute.read())&&(n=e.type===fe.EQUALS?this._create_token(fe.VALUE,o):this._create_token(fe.ATTRIBUTE,o));return n},ye.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},ye.prototype._read_raw_content=function(t,e,i){var n="";if(i&&"{"===i.text[0])n=this.__patterns.handlebars_raw_close.read();else if(e.type===fe.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0]){var o=e.opened.text.substr(1).toLowerCase();if("script"===o||"style"===o){var s=this._read_comment_or_cdata(t);if(s)return s.type=fe.TEXT,s;n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(o)&&(n=this._input.readUntil(new RegExp("</"+o+"[\\n\\r\\t ]*?>","ig")))}return n?this._create_token(fe.TEXT,n):null},ye.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e||(e=this.__patterns.word.read()),e)return this._create_token(fe.TEXT,e)},de.Tokenizer=ye,de.TOKEN=fe;var xe=re.Options,we=c.Output,Se=de.Tokenizer,ke=de.TOKEN,_e=/\r\n|[\r\n]/,Ce=/\r\n|[\r\n]/g,Ee=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new we(t,e)};Ee.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},Ee.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},Ee.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},Ee.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},Ee.prototype.print_preserved_newlines=function(t){var e=0;t.type!==ke.TEXT&&t.previous.type!==ke.TEXT&&(e=t.newlines?1:0),this.preserve_newlines&&(e=t.newlines<this.max_preserve_newlines+1?t.newlines:this.max_preserve_newlines+1);for(var i=0;i<e;i++)this.print_newline(i>0);return 0!==e},Ee.prototype.traverse_whitespace=function(t){return!(!t.whitespace_before&&!t.newlines)&&(this.print_preserved_newlines(t)||(this._output.space_before_token=!0),!0)},Ee.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},Ee.prototype.print_newline=function(t){this._output.add_new_line(t)},Ee.prototype.print_token=function(t){t.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(t.text))},Ee.prototype.indent=function(){this.indent_level++},Ee.prototype.get_full_indent=function(t){return(t=this.indent_level+(t||0))<1?"":this._output.get_indent_string(t)};var Le=function(t,e){var i=null,n=null;return e.closed?("script"===t?i="text/javascript":"style"===t&&(i="text/css"),i=function(t){for(var e=null,i=t.next;i.type!==ke.EOF&&t.closed!==i;){if(i.type===ke.ATTRIBUTE&&"type"===i.text){i.next&&i.next.type===ke.EQUALS&&i.next.next&&i.next.next.type===ke.VALUE&&(e=i.next.next.text);break}i=i.next}return e}(e)||i,i.search("text/css")>-1?n="css":i.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?n="javascript":i.search(/(text|application|dojo)\/(x-)?(html)/)>-1?n="html":i.search(/test\/null/)>-1&&(n="null"),n):null};function Ae(t,e){return-1!==e.indexOf(t)}function qe(t,e,i){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=i||0,this.parser_token=e||null}function Te(t){this._printer=t,this._current_frame=null}function Me(t,e,i,n){this._source_text=t||"",e=e||{},this._js_beautify=i,this._css_beautify=n,this._tag_stack=null;var o=new xe(e,"html");this._options=o,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}Te.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},Te.prototype.record_tag=function(t){var e=new qe(this._current_frame,t,this._printer.indent_level);this._current_frame=e},Te.prototype._try_pop_frame=function(t){var e=null;return t&&(e=t.parser_token,this._printer.indent_level=t.indent_level,this._current_frame=t.parent),e},Te.prototype._get_frame=function(t,e){for(var i=this._current_frame;i&&-1===t.indexOf(i.tag);){if(e&&-1!==e.indexOf(i.tag)){i=null;break}i=i.parent}return i},Te.prototype.try_pop=function(t,e){var i=this._get_frame([t],e);return this._try_pop_frame(i)},Te.prototype.indent_to_tag=function(t){var e=this._get_frame(t);e&&(this._printer.indent_level=e.indent_level)},Me.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var t=this._source_text,e=this._options.eol;"auto"===this._options.eol&&(e="\n",t&&_e.test(t)&&(e=t.match(_e)[0]));var i=(t=t.replace(Ce,"\n")).match(/^[\t ]*/)[0],n={text:"",type:""},o=new Oe,s=new Ee(this._options,i),l=new Se(t,this._options).tokenize();this._tag_stack=new Te(s);for(var a=null,r=l.next();r.type!==ke.EOF;)r.type===ke.TAG_OPEN||r.type===ke.COMMENT?o=a=this._handle_tag_open(s,r,o,n):r.type===ke.ATTRIBUTE||r.type===ke.EQUALS||r.type===ke.VALUE||r.type===ke.TEXT&&!o.tag_complete?a=this._handle_inside_tag(s,r,o,l):r.type===ke.TAG_CLOSE?a=this._handle_tag_close(s,r,o):r.type===ke.TEXT?a=this._handle_text(s,r,o):s.add_raw_token(r),n=a,r=l.next();return s._output.get_code(e)},Me.prototype._handle_tag_close=function(t,e,i){var n={text:e.text,type:e.type};return t.alignment_size=0,i.tag_complete=!0,t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted?t.add_raw_token(e):("<"===i.tag_start_char&&(t.set_space_before_token("/"===e.text[0],!0),this._is_wrap_attributes_force_expand_multiline&&i.has_wrapped_attrs&&t.print_newline(!1)),t.print_token(e)),!i.indent_content||i.is_unformatted||i.is_content_unformatted||(t.indent(),i.indent_content=!1),i.is_inline_element||i.is_unformatted||i.is_content_unformatted||t.set_wrap_point(),n},Me.prototype._handle_inside_tag=function(t,e,i,n){var o=i.has_wrapped_attrs,s={text:e.text,type:e.type};if(t.set_space_before_token(e.newlines||""!==e.whitespace_before,!0),i.is_unformatted)t.add_raw_token(e);else if("{"===i.tag_start_char&&e.type===ke.TEXT)t.print_preserved_newlines(e)?(e.newlines=0,t.add_raw_token(e)):t.print_token(e);else{if(e.type===ke.ATTRIBUTE?(t.set_space_before_token(!0),i.attr_count+=1):(e.type===ke.EQUALS||e.type===ke.VALUE&&e.previous.type===ke.EQUALS)&&t.set_space_before_token(!1),e.type===ke.ATTRIBUTE&&"<"===i.tag_start_char&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(t.traverse_whitespace(e),o=o||0!==e.newlines),this._is_wrap_attributes_force)){var l=i.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&1===i.attr_count){var a,r=!0,c=0;do{if((a=n.peek(c)).type===ke.ATTRIBUTE){r=!1;break}c+=1}while(c<4&&a.type!==ke.EOF&&a.type!==ke.TAG_CLOSE);l=!r}l&&(t.print_newline(!1),o=!0)}t.print_token(e),o=o||t.previous_token_wrapped(),i.has_wrapped_attrs=o}return s},Me.prototype._handle_text=function(t,e,i){var n={text:e.text,type:"TK_CONTENT"};return i.custom_beautifier_name?this._print_custom_beatifier_text(t,e,i):i.is_unformatted||i.is_content_unformatted?t.add_raw_token(e):(t.traverse_whitespace(e),t.print_token(e)),n},Me.prototype._print_custom_beatifier_text=function(t,e,i){var n=this;if(""!==e.text){var o,s=e.text,l=1,a="",r="";"javascript"===i.custom_beautifier_name&&"function"==typeof this._js_beautify?o=this._js_beautify:"css"===i.custom_beautifier_name&&"function"==typeof this._css_beautify?o=this._css_beautify:"html"===i.custom_beautifier_name&&(o=function(t,e){return new Me(t,e,n._js_beautify,n._css_beautify).beautify()}),"keep"===this._options.indent_scripts?l=0:"separate"===this._options.indent_scripts&&(l=-t.indent_level);var c=t.get_full_indent(l);if(s=s.replace(/\n[ \t]*$/,""),"html"!==i.custom_beautifier_name&&"<"===s[0]&&s.match(/^(<!--|<!\[CDATA\[)/)){var u=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(s);if(!u)return void t.add_raw_token(e);a=c+u[1]+"\n",s=u[4],u[5]&&(r=c+u[5]),s=s.replace(/\n[ \t]*$/,""),(u[2]||-1!==u[3].indexOf("\n"))&&(u=u[3].match(/[ \t]+$/))&&(e.whitespace_before=u[0])}if(s)if(o){var d=function(){this.eol="\n"};d.prototype=this._options.raw_options,s=o(c+s,new d)}else{var b=e.whitespace_before;b&&(s=s.replace(new RegExp("\n("+b+")?","g"),"\n")),s=c+s.replace(/\n/g,"\n"+c)}a&&(s=s?a+s+"\n"+r:a+r),t.print_newline(!1),s&&(e.text=s,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},Me.prototype._handle_tag_open=function(t,e,i,n){var o=this._get_tag_open_token(e);return!i.is_unformatted&&!i.is_content_unformatted||i.is_empty_element||e.type!==ke.TAG_OPEN||0!==e.text.indexOf("</")?(t.traverse_whitespace(e),this._set_tag_position(t,e,o,i,n),o.is_inline_element||t.set_wrap_point(),t.print_token(e)):(t.add_raw_token(e),o.start_tag_token=this._tag_stack.try_pop(o.tag_name)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(o.alignment_size=e.text.length+1),o.tag_complete||o.is_unformatted||(t.alignment_size=o.alignment_size),o};var Oe=function(t,e){var i;(this.parent=t||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",e)?(this.tag_start_char=e.text[0],this.text=e.text,"<"===this.tag_start_char?(i=e.text.match(/^<([^\s>]*)/),this.tag_check=i?i[1]:""):(i=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=i?i[1]:"","{{#>"===e.text&&">"===this.tag_check&&null!==e.next&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===ke.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0};Me.prototype._get_tag_open_token=function(t){var e=new Oe(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||Ae(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&Ae(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&Ae(e.tag_check,this._options.content_unformatted),e.is_inline_element=Ae(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},Me.prototype._set_tag_position=function(t,e,i,n,o){if(i.is_empty_element||(i.is_end_tag?i.start_tag_token=this._tag_stack.try_pop(i.tag_name):(this._do_optional_end_element(i)&&(i.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(i),"script"!==i.tag_name&&"style"!==i.tag_name||i.is_unformatted||i.is_content_unformatted||(i.custom_beautifier_name=Le(i.tag_check,e)))),Ae(i.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),i.is_empty_element){if("{"===i.tag_start_char&&"else"===i.tag_check)this._tag_stack.indent_to_tag(["if","unless","each"]),i.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1);"!--"===i.tag_name&&o.type===ke.TAG_CLOSE&&n.is_end_tag&&-1===i.text.indexOf("\n")||(i.is_inline_element||i.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i))}else if(i.is_end_tag){var s=!1;s=(s=i.start_tag_token&&i.start_tag_token.multiline_content)||!i.is_inline_element&&!(n.is_inline_element||n.is_unformatted)&&!(o.type===ke.TAG_CLOSE&&i.start_tag_token===n)&&"TK_CONTENT"!==o.type,(i.is_content_unformatted||i.is_unformatted)&&(s=!1),s&&t.print_newline(!1)}else i.indent_content=!i.custom_beautifier_name,"<"===i.tag_start_char&&("html"===i.tag_name?i.indent_content=this._options.indent_inner_html:"head"===i.tag_name?i.indent_content=this._options.indent_head_inner_html:"body"===i.tag_name&&(i.indent_content=this._options.indent_body_inner_html)),i.is_inline_element||i.is_unformatted||"TK_CONTENT"===o.type&&!i.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,i)},Me.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)};var Re=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],Ie=["a","audio","del","ins","map","noscript","video"];Me.prototype._do_optional_end_element=function(t){var e=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent){if("body"===t.tag_name)e=e||this._tag_stack.try_pop("head");else if("li"===t.tag_name)e=e||this._tag_stack.try_pop("li",["ol","ul"]);else if("dd"===t.tag_name||"dt"===t.tag_name)e=(e=e||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]);else if("p"===t.parent.tag_name&&-1!==Re.indexOf(t.tag_name)){var i=t.parent.parent;i&&-1!==Ie.indexOf(i.tag_name)||(e=e||this._tag_stack.try_pop("p"))}else"rp"===t.tag_name||"rt"===t.tag_name?e=(e=e||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?e=e||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?e=e||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?e=e||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?e=(e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?e=(e=(e=e||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(e=(e=e||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return t.parent=this._tag_stack.get_parser_token(),e}},ae.Beautifier=Me;var ze=ae.Beautifier,Be=re.Options;le.exports=function(t,e,i,n){return new ze(t,e,i,n).beautify()},le.exports.defaultOptions=function(){return new Be};var Ne=a.exports,De=Ft.exports,Pe=le.exports;function $e(t,e,i,n){return Pe(t,e,i=i||Ne,n=n||De)}$e.defaultOptions=Pe.defaultOptions,l.js=Ne,l.css=De,l.html=$e,function(t){var e=l;e.js_beautify=e.js,e.css_beautify=e.css,e.html_beautify=e.html,t.exports=function(t,e,i){var n=function(e,i){return t.js_beautify(e,i)};return n.js=t.js_beautify,n.css=e.css_beautify,n.html=i.html_beautify,n.js_beautify=t.js_beautify,n.css_beautify=e.css_beautify,n.html_beautify=i.html_beautify,n}(e,e,e)}(s);var He=s.exports;function Fe(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function je(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ue(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?je(Object(i),!0).forEach((function(e){Fe(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):je(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function We(t,e){if(null==t)return{};var i,n,o=function(t,e){if(null==t)return{};var i,n,o={},s=Object.keys(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||(o[i]=t[i]);return o}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)i=s[n],e.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(o[i]=t[i])}return o}function Ge(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Ve(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Ye(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Xe(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ye(Object(i),!0).forEach((function(e){Ve(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ye(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ze(t){return function e(){for(var i=this,n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return o.length>=t.length?t.apply(this,o):function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e.apply(i,[].concat(o,n))}}}function Ke(t){return{}.toString.call(t).includes("Object")}function Qe(t){return"function"==typeof t}var Je=Ze((function(t,e){throw new Error(t[e]||t.default)}))({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),ti={changes:function(t,e){return Ke(e)||Je("changeType"),Object.keys(e).some((function(e){return i=t,n=e,!Object.prototype.hasOwnProperty.call(i,n);var i,n}))&&Je("changeField"),e},selector:function(t){Qe(t)||Je("selectorType")},handler:function(t){Qe(t)||Ke(t)||Je("handlerType"),Ke(t)&&Object.values(t).some((function(t){return!Qe(t)}))&&Je("handlersType")},initial:function(t){var e;t||Je("initialIsRequired"),Ke(t)||Je("initialType"),e=t,Object.keys(e).length||Je("initialContent")}};function ei(t,e){return Qe(e)?e(t.current):e}function ii(t,e){return t.current=Xe(Xe({},t.current),e),e}function ni(t,e,i){return Qe(e)?e(t.current):Object.keys(i).forEach((function(i){var n;return null===(n=e[i])||void 0===n?void 0:n.call(e,t.current[i])})),i}var oi={create:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ti.initial(t),ti.handler(e);var i={current:t},n=Ze(ni)(i,e),o=Ze(ii)(i),s=Ze(ti.changes)(t),l=Ze(ei)(i);return[function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return ti.selector(t),t(i.current)},function(t){!function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}(n,o,s,l)(t)}]}};var si,li={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},ai=(si=function(t,e){throw new Error(t[e]||t.default)},function t(){for(var e=this,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return n.length>=si.length?si.apply(this,n):function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return t.apply(e,[].concat(n,o))}})(li),ri={config:function(t){var e;return t||ai("configIsRequired"),e=t,{}.toString.call(e).includes("Object")||ai("configType"),t.urls?(console.warn(li.deprecation),{paths:{vs:t.urls.monacoBase}}):t}};function ci(t,e){return Object.keys(e).forEach((function(i){e[i]instanceof Object&&t[i]&&Object.assign(e[i],ci(t[i],e[i]))})),Ue(Ue({},t),e)}var ui={type:"cancelation",msg:"operation is manually canceled"};function di(t){var e=!1,i=new Promise((function(i,n){t.then((function(t){return e?n(ui):i(t)})),t.catch(n)}));return i.cancel=function(){return e=!0},i}var bi,hi,pi=oi.create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.33.0/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}),mi=(hi=2,function(t){if(Array.isArray(t))return t}(bi=pi)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var i=[],n=!0,o=!1,s=void 0;try{for(var l,a=t[Symbol.iterator]();!(n=(l=a.next()).done)&&(i.push(l.value),!e||i.length!==e);n=!0);}catch(t){o=!0,s=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw s}}return i}}(bi,hi)||function(t,e){if(t){if("string"==typeof t)return Ge(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ge(t,e):void 0}}(bi,hi)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),gi=mi[0],fi=mi[1];function vi(t){return document.body.appendChild(t)}function yi(t){var e=gi((function(t){return{config:t.config,reject:t.reject}})),i=function(t){var e=document.createElement("script");return t&&(e.src=t),e}("".concat(e.config.paths.vs,"/loader.js"));return i.onload=function(){return t()},i.onerror=e.reject,i}function xi(){var t=gi((function(t){return{config:t.config,resolve:t.resolve,reject:t.reject}})),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],(function(e){wi(e),t.resolve(e)}),(function(e){t.reject(e)}))}function wi(t){gi().monaco||fi({monaco:t})}var Si=new Promise((function(t,e){return fi({resolve:t,reject:e})})),ki={config:function(t){var e=ri.config(t),i=e.monaco,n=We(e,["monaco"]);fi((function(t){return{config:ci(t.config,n),monaco:i}}))},init:function(){var t=gi((function(t){return{monaco:t.monaco,isInitialized:t.isInitialized,resolve:t.resolve}}));if(!t.isInitialized){if(fi({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),di(Si);if(window.monaco&&window.monaco.editor)return wi(window.monaco),t.resolve(window.monaco),di(Si);!function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduceRight((function(t,e){return e(t)}),t)}}(vi,yi)(xi)}return di(Si)},__getMonacoInstance:function(){return gi((function(t){return t.monaco}))}};let _i={};class Ci{constructor(t){this.builder=t}renderPanel(){const t=this.builder.builderStuff,e=this.builder.util,i=this.builder.dom;let n=t.querySelector(".viewhtml");if(!n){const o=`<div class="is-modal viewhtml" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content">\n <textarea class="tabSupport" id="__tabsupport" style="width:100%;height:calc(100% - 50px);border:none;margin:0;box-sizing:border-box;"></textarea>\n <div class="is-modal-footer" style="border-top:1px solid ${this.builder.styleSeparatorColor};width:100%;height:50px;position:absolute;left:0;bottom:0;overflow:hidden;text-align:right">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlmonaco" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="width:${this.builder.blockCodeEditorWidth};max-width:${this.builder.blockCodeEditorMaxWidth};padding:0">\n <textarea id="__viewhtmlmonaco" style="position:absolute;display:none;"></textarea>\n <div class="input-code-editor" style="width:100%;height:${this.builder.blockCodeEditorHeight};"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n\n <div class="is-modal viewhtmlexternal" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">\n <div class="is-modal-content" style="width:${this.builder.codeEditorWidth};max-width:${this.builder.codeEditorMaxWidth};padding:0">\n <div class="input-code-editor" id="__input_code_editor" style="width:100%;height:${this.builder.codeEditorHeight};"></div>\n <div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">\n <button title="${e.out("Cancel")}" class="input-cancel classic-secondary">${e.out("Cancel")}</button>\n <button title="${e.out("Ok")}" class="input-ok classic-primary">${e.out("Ok")}</button>\n </div>\n </div>\n </div>\n \n `;i.appendHtml(t,o),n=t.querySelector(".viewhtml");let s=t.querySelector(".viewhtmlmonaco"),l=t.querySelector(".viewhtmlexternal"),a=n.querySelector(".input-ok");i.addEventListener(a,"click",(()=>{this.applyHtml(n)})),a=n.querySelector(".input-cancel"),i.addEventListener(a,"click",(()=>{this.builder.hideModal(n)})),a=s.querySelector(".input-ok"),i.addEventListener(a,"click",(()=>{this.applyHtml(s)})),a=s.querySelector(".input-cancel"),i.addEventListener(a,"click",(()=>{this.builder.hideModal(s)})),a=l.querySelector(".input-ok"),i.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-ok");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(l)})),a=l.querySelector(".input-cancel"),i.addEventListener(a,"click",(()=>{const t=document.querySelector("textarea[data-source-active]"),e=t.getAttribute("data-source-cancel");t.removeAttribute("data-source-active"),t.removeAttribute("data-source-ok"),t.removeAttribute("data-source-cancel"),document.querySelector(e).click(),this.builder.hideModal(l)}))}}applyHtml(t){const e=this.builder.util;let i=this.builder.codeEditorMode,n=this.builder.codeEditorArea;this.builder.uo.saveForUndo();let o=t.querySelector("textarea").value;if("code"===i){let i=this.builder.activeCodeBlock;i.setAttribute("data-html",encodeURIComponent(o)),o=o.replace(/{id}/g,e.makeId());for(let t=1;t<=20;t++)o=o.replace("[%HTML"+t+"%]",void 0===i.getAttribute("data-html-"+t)?"":decodeURIComponent(i.getAttribute("data-html-"+t)));i.innerHTML="";let n=document.createRange();n.setStart(i,0),i.appendChild(n.createContextualFragment(o));let s=this.builder.doc.querySelector(".builder-active");return s&&this.builder.applyBehaviorOn(s),this.builder.opts.onChange(),this.builder.opts.onRender(),this.builder.hideModal(t),void e.hideControls()}if(o=this.fromViewToActual(o),"cell"===i){e.cellSelected().innerHTML=o;let t=this.builder.doc.querySelector(".builder-active");t&&this.builder.applyBehaviorOn(t),this.builder.opts.onChange(),this.builder.opts.onRender()}if("row"===i){let t,i=e.cellSelected();if(t=i?i.parentNode:e.rowSelected(),!t)return;t.innerHTML=o;let n=this.builder.doc.querySelector(".builder-active");n&&this.builder.applyBehaviorOn(n),this.builder.opts.onChange(),this.builder.opts.onRender()}if("full"===i){if(this.builder.docContainer)return this.builder.loadHTML(o),e.clearControls(),void this.builder.hideModal(t);n.innerHTML="";let i=document.createRange();i.setStart(n,0),n.appendChild(i.createContextualFragment(o)),this.builder.applyBehaviorOn(n),this.builder.opts.onChange(),this.builder.opts.onRender(),e.clearActiveCell()}e.clearControls(),this.builder.hideModal(t)}viewHtmlExternal(){const t=this.builder.util,e=this.builder.builderStuff;this.renderPanel();const i=e.querySelector(".viewhtmlexternal");document.activeElement&&(this.elmFocus=document.activeElement),t.showModal(i,!0,(()=>{this.elmFocus&&this.elmFocus.focus()}),!1),i.querySelector(".input-code-editor").style.opacity=.01,this._viewHtmlExternal()}_viewHtmlExternal(){const t=this.builder.builderStuff,e=document.querySelector("textarea[data-source-active]");let i=t.querySelector(".viewhtmlexternal").querySelector(".input-code-editor");if(!i.querySelector(".monaco-editor"))return ki.init().then((t=>{this.builder.monaco=t,i.getAttribute("data-mode-id")||(this.builder.codeEditorExternal=t.editor.create(i,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,wordWrap:!0,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""})),this.builder.codeEditorExternal.onDidChangeModelContent((()=>{document.querySelector("textarea[data-source-active]").value=this.builder.codeEditorExternal.getModel().getValue()}))})),void setTimeout((()=>{this._viewHtmlExternal()}),100);const n=this.builder.monaco.editor.createModel(e.value,"html");this.builder.codeEditorExternal.setModel(n),i.style.opacity=""}view(t,e,i){this.renderPanel();const n=this.builder.util,o=this.builder.builderStuff;let s;s=this.builder.opts.htmlSyntaxHighlighting?o.querySelector(".viewhtmlmonaco"):o.querySelector(".viewhtml");let l=s.querySelector(".is-modal-content"),a=s.querySelector(".input-code-editor");a.style.opacity=.01,"full"===t?(l.style.width=this.builder.codeEditorWidth,l.style.maxWidth=this.builder.codeEditorMaxWidth,a.style.height=this.builder.codeEditorHeight):(l.style.width=this.builder.blockCodeEditorWidth,l.style.maxWidth=this.builder.blockCodeEditorMaxWidth,a.style.height=this.builder.blockCodeEditorHeight),n.showModal(s,!0,(()=>{i&&(i.removeAttribute("data-focus"),i.focus())})),i&&i.setAttribute("data-focus",!0),this._view(t,e)}_view(t,e){const i=this.builder.dom,n=this.builder.util,o=this.builder.builderStuff;let s;if(this.builder.opts.htmlSyntaxHighlighting){s=o.querySelector(".viewhtmlmonaco");let i=s.querySelector(".input-code-editor");if(!i.querySelector(".monaco-editor"))return ki.init().then((t=>{this.builder.monaco=t,i.getAttribute("data-mode-id")||(this.builder.codeEditor=t.editor.create(i,{value:"",minimap:{enabled:!1},automaticLayout:!0,contextmenu:!1,fontSize:13,wordWrap:!0,scrollbar:{useShadows:!1,vertical:"visible",horizontal:"visible",horizontalScrollbarSize:12,verticalScrollbarSize:12},language:"html",theme:this.builder.styleDark||this.builder.styleColoredDark?"vs-dark":""}));let e=s.querySelector("textarea");this.builder.codeEditor.onDidChangeModelContent((()=>{e.value=this.builder.codeEditor.getModel().getValue()}))})),void setTimeout((()=>{this._view(t,e)}),100)}else s=o.querySelector(".viewhtml");let l=s.querySelector("textarea");if("cell"===t){const t=n.cellSelected();if(!t)return;let e=s.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,e.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1}if("row"===t){let t,e=n.cellSelected();if(t=e?e.parentNode:n.rowSelected(),!t)return;let o=s.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,o.value=this.readHtml(t,!0),this.builder.cleanHtmlFormatting=!1,i.removeClass(t,"row-outline")}if("full"===t){if(e);else{const t=this.builder.doc.querySelectorAll(this.builder.opts.container);if(t.length>1){const i=n.cellSelected();e=i?i.parentNode.parentNode:t[0]}else e=t[0];if(""!==this.builder.opts.page){const t=this.builder.doc.querySelector(this.builder.opts.page);t&&(e=t)}}let t=s.querySelector("textarea");this.builder.cleanHtmlFormatting=!0,this.builder.shortenHTML?t.value=this.readHtml(e,!0):t.value=this.readHtml(e,!1),this.builder.cleanHtmlFormatting=!1}if(this.builder.opts.htmlSyntaxHighlighting){const t=this.builder.monaco.editor.createModel(l.value,"html");this.builder.codeEditor.setModel(t)}let a=o.querySelector(".is-pop.columnmore");a&&(a.style.display="");let r=o.querySelector(".is-pop.rowmore");r&&(r.style.display=""),this.builder.codeEditorMode=t,this.builder.codeEditorArea=e,s.querySelector(".input-code-editor").style.opacity=""}fromViewToActual(t){for(var e in _i)t=t.replace(e,_i[e]);return t}readHtml(t,e,i,n){const o=this.builder.dom;if(this.builder.opts.absolutePath){let e=t.querySelectorAll("a");Array.prototype.forEach.call(e,(t=>{let e=t.href;t.setAttribute("href",e)}));let i=t.querySelectorAll("img");Array.prototype.forEach.call(i,(t=>{let e=t.src;t.setAttribute("src",e)}))}this.builder.cleanHtmlFormatting;const s=this.builder.util;let l,a=document.createElement("div");a.innerHTML=t.innerHTML;let r=a.querySelectorAll("[data-html]");if(Array.prototype.forEach.call(r,(t=>{let e=1,i=t.querySelectorAll("[data-subblock]");Array.prototype.forEach.call(i,(i=>{if(i.closest(".glide__slide--clone"))return;let n=i.innerHTML;t.setAttribute("data-html-"+e,encodeURIComponent(n)),e++}))})),r=a.querySelectorAll("[data-html]"),Array.prototype.forEach.call(r,(t=>{let e=decodeURIComponent(t.getAttribute("data-html"));e=e.replace(/{id}/g,s.makeId()),t.innerHTML=e;let i=t.querySelectorAll("[data-subblock]");var n=1;Array.prototype.forEach.call(i,(e=>{e.innerHTML=void 0===t.getAttribute("data-html-"+n)?"":decodeURIComponent(t.getAttribute("data-html-"+n)),n++}))})),e&&(_i={},r=a.querySelectorAll("[data-html]"),Array.prototype.forEach.call(r,(t=>{let e=s.makeId();_i[e]=t.getAttribute("data-html"),t.setAttribute("data-html",e);for(let i=1;i<=20;i++)void 0!==t.getAttribute("data-html-"+i)&&(e=s.makeId(),_i[e]=t.getAttribute("data-html-"+i),t.getAttribute("data-html-"+i,e));void 0!==t.getAttribute("data-settings")&&(e=s.makeId(),_i[e]=t.getAttribute("data-settings"),t.getAttribute("data-settings",e))}))),this.builder.makeAbsolute){const t=t=>{let e=document.createElement("img");return e.src=t,e.setAttribute("data-absoluteurl",e.src),t=e.getAttribute("data-absoluteurl")},e=t=>{let e=document.createElement("img");e.src=t,e.setAttribute("data-absoluteurl",e.src),t=e.getAttribute("data-absoluteurl");let i=window.location.href.substring(0,window.location.href.lastIndexOf("/"));return t.replace(i,"[%PATH%]")},i=(e,i)=>{if(e.hasAttribute(i)){if("video"!==e.parentNode.tagName.toLowerCase()&&"audio"!==e.parentNode.tagName.toLowerCase())return;let n=e.getAttribute(i);n=t(n),e.setAttribute(i,`${n}`)}};let n=a.querySelectorAll("img");Array.prototype.forEach.call(n,(t=>{let e=t.src;t.setAttribute("src",e)})),a.querySelectorAll("*").forEach((n=>{if(n.style.backgroundImage){let t=n.style.backgroundImage;if(-1!==t.indexOf("url(")){let i=t.slice(4,-1).replace(/["']/g,"");i=e(i),n.style.backgroundImage=`url(${i})`}}if(i(n,"src"),i(n,"data-default"),i(n,"data-240"),i(n,"data-360"),i(n,"data-480"),i(n,"data-540"),i(n,"data-720"),i(n,"data-1080"),i(n,"data-1440"),i(n,"data-2160"),n.hasAttribute("href")&&"link"===n.tagName.toLowerCase()){let e=n.getAttribute("href");e=t(e),n.setAttribute("href",`${e}`)}}))}let c=a.querySelectorAll(".is-builder");Array.prototype.forEach.call(c,(t=>{t.style.transform="",t.style.WebkitTransform="",t.style.MozTransform="",t.removeAttribute("data-sort"),o.removeClass(t,"builder-active");o.elementChildren(t).forEach((t=>{o.elementChildren(t).forEach((t=>{t.style.cursor=""}))}))}));o.elementChildren(a).forEach((t=>{t.style.cursor="";o.elementChildren(t).forEach((t=>{t.style.cursor=""}))}));let u=a.querySelectorAll(".sortable-chosen");o.removeClasses(u,"sortable-chosen"),u=a.querySelectorAll(".sortable-ghost"),o.removeClasses(u,"sortable-ghost"),u=a.querySelectorAll(".elm-active"),o.removeClasses(u,"elm-active"),u=a.querySelectorAll(".icon-active"),o.removeClasses(u,"icon-active"),u=a.querySelectorAll(".elm-inspected"),o.removeClasses(u,"elm-inspected"),u=a.querySelectorAll(".cell-active"),o.removeClasses(u,"cell-active"),u=a.querySelectorAll(".row-active"),o.removeClasses(u,"row-active"),u=a.querySelectorAll(".row-outline"),o.removeClasses(u,"row-outline"),u=a.querySelectorAll(".is-builder"),o.removeClasses(u,"is-builder"),u=a.querySelectorAll(".row-outline"),o.removeClasses(u,"row-outline"),u=a.querySelectorAll("[data-click]"),o.removeAttributes(u,"data-click"),u=a.querySelectorAll("[contenteditable]"),o.removeAttributes(u,"contenteditable"),u=a.querySelectorAll("[draggridoutline]"),o.removeAttributes(u,"draggridoutline"),u=a.querySelectorAll("[between-blocks-left]"),o.removeAttributes(u,"between-blocks-left"),u=a.querySelectorAll("[between-blocks-center]"),o.removeAttributes(u,"between-blocks-center"),u=a.querySelectorAll("[hideelementhighlight]"),o.removeAttributes(u,"hideelementhighlight"),u=a.querySelectorAll("[data-module-active]"),o.removeAttributes(u,"data-module-active"),u=a.querySelectorAll("[draggable]"),o.removeAttributes(u,"draggable"),u=a.querySelectorAll("[data-animated]"),o.removeAttributes(u,"data-animated"),u=a.querySelectorAll("[data-saveforundo]"),o.removeAttributes(u,"data-saveforundo"),u=a.querySelectorAll("[hidesnippetaddtool]"),o.removeAttributes(u,"hidesnippetaddtool"),u=a.querySelectorAll("[gray]"),o.removeAttributes(u,"gray"),u=a.querySelectorAll("[rowoutline]"),o.removeAttributes(u,"rowoutline"),u=a.querySelectorAll("[hidecolumntool]"),o.removeAttributes(u,"hidecolumntool"),u=a.querySelectorAll("[grayoutline]"),o.removeAttributes(u,"grayoutline"),u=a.querySelectorAll("[hideoutline]"),o.removeAttributes(u,"hideoutline"),u=a.querySelectorAll("[leftrowtool]"),o.removeAttributes(u,"leftrowtool"),u=a.querySelectorAll("[minimal]"),o.removeAttributes(u,"minimal"),u=a.querySelectorAll("[clean]"),o.removeAttributes(u,"clean"),u=a.querySelectorAll("[grideditor]"),o.removeAttributes(u,"grideditor"),u=a.querySelectorAll("[gridoutline]"),o.removeAttributes(u,"gridoutline"),o.removeElements(a.querySelectorAll(".is-row-tool")),o.removeElements(a.querySelectorAll(".is-col-tool")),o.removeElements(a.querySelectorAll(".is-rowadd-tool")),o.removeElements(a.querySelectorAll(".ovl")),o.removeElements(a.querySelectorAll(".row-add-initial")),this.builder.cleanAOS&&(u=a.querySelectorAll(".aos-init"),o.removeClasses(u,"aos-init"),u=a.querySelectorAll(".aos-animate"),o.removeClasses(u,"aos-animate")),u=a.querySelectorAll(".skrollable"),o.removeClasses(u,"skrollable"),u=a.querySelectorAll(".skrollable-after"),o.removeClasses(u,"skrollable-after"),u=a.querySelectorAll(".skrollable-before"),o.removeClasses(u,"skrollable-before"),u=a.querySelectorAll(".skrollable-between"),o.removeClasses(u,"skrollable-between"),u=a.querySelectorAll(".is-inview"),o.removeClasses(u,"is-inview");let d=a.querySelectorAll('[class=""]');Array.prototype.forEach.call(d,(t=>{t.removeAttribute("class")}));let b=a.querySelectorAll(".is-row-overlay");Array.prototype.forEach.call(b,(t=>{t.hasAttribute("style")||t.parentNode.removeChild(t)})),o.removeEmptyStyle(a),u=a.querySelectorAll("[data-keep]"),o.removeAttributes(u,"data-keep");let h=a.querySelectorAll("a");if(Array.prototype.forEach.call(h,(t=>{"inline-block"===t.style.display&&1===t.parentNode.childElementCount&&"span"===t.parentNode.tagName.toLowerCase()&&(t.parentNode.outerHTML=t.parentNode.innerHTML)})),n){a.querySelectorAll("[data-html]").forEach((t=>{t.innerHTML=""}))}if(l="",i){let t=a.querySelectorAll(".is-dummy");o.removeElements(t),t=a.querySelectorAll("[data-scroll]"),o.removeAttributes(t,"data-scroll"),t=a.querySelectorAll("[data-scroll-once]"),o.removeAttributes(t,"data-scroll-once"),this.builder.shortenOutput&&(t=a.querySelectorAll("[data-noedit]"),o.removeAttributes(t,"data-noedit"),t=a.querySelectorAll("[data-module]"),o.removeAttributes(t,"data-module"),t=a.querySelectorAll("[data-module-desc]"),o.removeAttributes(t,"data-module-desc"),t=a.querySelectorAll("[data-dialog-width]"),o.removeAttributes(t,"data-dialog-width"),t=a.querySelectorAll("[data-dialog-height]"),o.removeAttributes(t,"data-dialog-height"),t=a.querySelectorAll("[data-html]"),o.removeAttributes(t,"data-html"),t=a.querySelectorAll("[data-settings]"),o.removeAttributes(t,"data-settings"),t=a.querySelectorAll("[data-html-1]"),o.removeAttributes(t,"data-html-1"),t=a.querySelectorAll("[data-html-2]"),o.removeAttributes(t,"data-html-2"),t=a.querySelectorAll("[data-html-3]"),o.removeAttributes(t,"data-html-3"),t=a.querySelectorAll("[data-html-4]"),o.removeAttributes(t,"data-html-4"),t=a.querySelectorAll("[data-html-5]"),o.removeAttributes(t,"data-html-5"),t=a.querySelectorAll("[data-html-6]"),o.removeAttributes(t,"data-html-6"),t=a.querySelectorAll("[data-html-7]"),o.removeAttributes(t,"data-html-7"),t=a.querySelectorAll("[data-html-8]"),o.removeAttributes(t,"data-html-8"),t=a.querySelectorAll("[data-html-9]"),o.removeAttributes(t,"data-html-9"),t=a.querySelectorAll("[data-html-10]"),o.removeAttributes(t,"data-html-10"),t=a.querySelectorAll("[data-html-12]"),o.removeAttributes(t,"data-html-12"),t=a.querySelectorAll("[data-html-13]"),o.removeAttributes(t,"data-html-13"),t=a.querySelectorAll("[data-html-14]"),o.removeAttributes(t,"data-html-14"),t=a.querySelectorAll("[data-html-15]"),o.removeAttributes(t,"data-html-15"),t=a.querySelectorAll("[data-html-16]"),o.removeAttributes(t,"data-html-16"),t=a.querySelectorAll("[data-html-17]"),o.removeAttributes(t,"data-html-17"),t=a.querySelectorAll("[data-html-18]"),o.removeAttributes(t,"data-html-18"),t=a.querySelectorAll("[data-html-19]"),o.removeAttributes(t,"data-html-19"),t=a.querySelectorAll("[data-html-20]"),o.removeAttributes(t,"data-html-20"),t=a.querySelectorAll("[data-html-21]"),o.removeAttributes(t,"data-html-21"),t=a.querySelectorAll("[data-html-21]"),o.removeAttributes(t,"data-html-21"),t=a.querySelectorAll("[data-html-22]"),o.removeAttributes(t,"data-html-22"),t=a.querySelectorAll("[data-html-23]"),o.removeAttributes(t,"data-html-23"),t=a.querySelectorAll("[data-html-24]"),o.removeAttributes(t,"data-html-24"),t=a.querySelectorAll("[data-html-25]"),o.removeAttributes(t,"data-html-25")),t=a.querySelectorAll("[data-bottom-top],[data-center],[data-center-bottom],[data-100-top],[data-50-top],[data-top],[data-top-bottom],[data-center-top],[data--300-bottom],[data--150-bottom],[data--50-bottom],[data-bottom],[data-100-bottom],[data-150-bottom],[data-400-bottom],[data--400-bottom],[data--200-bottom],[data--100-bottom],[data-50-bottom],[data-200-bottom],[data-300-bottom],[data-in],[data-in-150],[data-in-300],[data-cen--150],[data-cen],[data-cen-150],[data-out--300],[data-out--150],[data-out][data-t],[data-t-100],[data-t-200],[data-t-300],[data-t-400],[data-t-500],[data-t-600],[data-t-700],[data-t-800],[data-t-900],[data-t-1000],[data-t-1100],[data-t-1200],[data-t-1300],[data-t-1400],[data-t-1500],[data-t-1600],[data-t-1700],[data-t-1800],[data-t-1900],[data-t-2000],[data-t-2100],[data-t-2200],[data-t-2300],[data-t-2400],[data-t-2500],[data-t-2600],[data-t-2700],[data-t-2800]"),Array.prototype.forEach.call(t,(t=>{t.style.transition="",t.style.transform="",t.style.opacity=""})),t=a.querySelectorAll(".is-animated"),Array.prototype.forEach.call(t,(t=>{o.removeClass(t,"animated"),o.removeClass(t,"pulse"),o.removeClass(t,"bounceIn"),o.removeClass(t,"fadeIn"),o.removeClass(t,"fadeOut"),o.removeClass(t,"fadeInDown"),o.removeClass(t,"fadeInLeft"),o.removeClass(t,"fadeInRight"),o.removeClass(t,"fadeInUp"),o.removeClass(t,"flipInX"),o.removeClass(t,"flipInY"),o.removeClass(t,"slideInUp"),o.removeClass(t,"slideInDown"),o.removeClass(t,"slideInLeft"),o.removeClass(t,"slideInRight"),o.removeClass(t,"zoomIn"),t.style.animationDelay="",t.style.transitionDelay="",t.style.transitionDuration="",t.style.transitionTimingFunction="",t.style.transitionProperty=""}));let e=a.querySelectorAll('[style=""]');Array.prototype.forEach.call(e,(t=>{t.removeAttribute("style")})),t=a.querySelectorAll(".is-appeared"),Array.prototype.forEach.call(t,(t=>{o.removeClass(t,"is-appeared")})),t=a.querySelectorAll(".box-active"),Array.prototype.forEach.call(t,(t=>{o.removeClass(t,"box-active")})),t=a.querySelectorAll(".section-active"),Array.prototype.forEach.call(t,(t=>{o.removeClass(t,"section-active")})),t=a.querySelectorAll(".section-select"),Array.prototype.forEach.call(t,(t=>{o.removeClass(t,"section-select")})),t=a.querySelectorAll(".box-select"),Array.prototype.forEach.call(t,(t=>{o.removeClass(t,"box-select")})),t=a.querySelectorAll(".is-section-tool"),o.removeElements(t),t=a.querySelectorAll(".is-box-tool"),o.removeElements(t),t=a.querySelectorAll(".is-box-info"),o.removeElements(t),t=a.querySelectorAll(".is-section-info"),o.removeElements(t),t=a.querySelectorAll(".is-block .handle, .is-block .rotate-handle"),o.removeElements(t),t=a.querySelectorAll(".is-block"),Array.prototype.forEach.call(t,(t=>{o.removeClass(t,"active"),o.removeClass(t,"multi"),o.removeClass(t,"editable"),o.removeClass(t,"fluid"),o.removeClass(t,"cloned"),t.removeAttribute("data-fluid-val"),t.removeAttribute("data-fluid"),t.removeAttribute("data-prev")})),a.querySelectorAll(".is-block.clone").forEach((t=>t.parentNode.removeChild(t)));var p="",m="",g="";o.elementChildren(a).forEach((t=>{let e=t;if(o.hasClass(e,"is-section")){var i="";e.getAttribute("class")&&(i=' class="'+e.getAttribute("class")+'"');var n=e.cloneNode(!0),s=n.outerHTML;l+=s,-1===i.indexOf("is-static")?p+=s+"\n\n":m+=s+"\n\n"}else s=(n=e.cloneNode(!0)).outerHTML,l+=s,g+=s}));let i=document.querySelector("[data-contentbox]"),n=!1;i&&(n=i.settings.disableStaticSection),n||(l=p+m+g),l=a.innerHTML.trim(),l=l.replace(/<font/g,"<span").replace(/<\/font/g,"</span")}else{let t=a.querySelectorAll('[style=""]');Array.prototype.forEach.call(t,(t=>{t.removeAttribute("style")})),this.builder.shortenOutput&&(u=a.querySelectorAll("[data-noedit]"),o.removeAttributes(u,"data-noedit"),u=a.querySelectorAll("[data-module]"),o.removeAttributes(u,"data-module"),u=a.querySelectorAll("[data-module-desc]"),o.removeAttributes(u,"data-module-desc"),u=a.querySelectorAll("[data-dialog-width]"),o.removeAttributes(u,"data-dialog-width"),u=a.querySelectorAll("[data-dialog-height]"),o.removeAttributes(u,"data-dialog-height"),u=a.querySelectorAll("[data-html]"),o.removeAttributes(u,"data-html"),u=a.querySelectorAll("[data-settings]"),o.removeAttributes(u,"data-settings"),u=a.querySelectorAll("[data-html-1]"),o.removeAttributes(u,"data-html-1"),u=a.querySelectorAll("[data-html-2]"),o.removeAttributes(u,"data-html-2"),u=a.querySelectorAll("[data-html-3]"),o.removeAttributes(u,"data-html-3"),u=a.querySelectorAll("[data-html-4]"),o.removeAttributes(u,"data-html-4"),u=a.querySelectorAll("[data-html-5]"),o.removeAttributes(u,"data-html-5"),u=a.querySelectorAll("[data-html-6]"),o.removeAttributes(u,"data-html-6"),u=a.querySelectorAll("[data-html-7]"),o.removeAttributes(u,"data-html-7"),u=a.querySelectorAll("[data-html-8]"),o.removeAttributes(u,"data-html-8"),u=a.querySelectorAll("[data-html-9]"),o.removeAttributes(u,"data-html-9"),u=a.querySelectorAll("[data-html-10]"),o.removeAttributes(u,"data-html-10"),u=a.querySelectorAll("[data-html-12]"),o.removeAttributes(u,"data-html-12"),u=a.querySelectorAll("[data-html-13]"),o.removeAttributes(u,"data-html-13"),u=a.querySelectorAll("[data-html-14]"),o.removeAttributes(u,"data-html-14"),u=a.querySelectorAll("[data-html-15]"),o.removeAttributes(u,"data-html-15"),u=a.querySelectorAll("[data-html-16]"),o.removeAttributes(u,"data-html-16"),u=a.querySelectorAll("[data-html-17]"),o.removeAttributes(u,"data-html-17"),u=a.querySelectorAll("[data-html-18]"),o.removeAttributes(u,"data-html-18"),u=a.querySelectorAll("[data-html-19]"),o.removeAttributes(u,"data-html-19"),u=a.querySelectorAll("[data-html-20]"),o.removeAttributes(u,"data-html-20"),u=a.querySelectorAll("[data-html-21]"),o.removeAttributes(u,"data-html-21"),u=a.querySelectorAll("[data-html-21]"),o.removeAttributes(u,"data-html-21"),u=a.querySelectorAll("[data-html-22]"),o.removeAttributes(u,"data-html-22"),u=a.querySelectorAll("[data-html-23]"),o.removeAttributes(u,"data-html-23"),u=a.querySelectorAll("[data-html-24]"),o.removeAttributes(u,"data-html-24"),u=a.querySelectorAll("[data-html-25]"),o.removeAttributes(u,"data-html-25")),u=a.querySelectorAll(".is-block .handle, .is-block .rotate-handle"),o.removeElements(u),u=a.querySelectorAll(".is-block"),Array.prototype.forEach.call(u,(t=>{o.removeClass(t,"active"),o.removeClass(t,"multi"),o.removeClass(t,"editable"),o.removeClass(t,"fluid"),o.removeClass(t,"cloned"),t.removeAttribute("data-fluid-val"),t.removeAttribute("data-fluid"),t.removeAttribute("data-prev")})),a.querySelectorAll(".is-block.clone").forEach((t=>t.parentNode.removeChild(t))),l=a.innerHTML.trim(),l=l.replace(/<font/g,"<span").replace(/<\/font/g,"</span")}let f=He.html;return l=f(l),l=l.replace(/(\r\n|\r|\n){3,}/g,"$1\n"),l}beautify(t){return t=(t=(0,He.html)(t)).replace(/(\r\n|\r|\n){3,}/g,"$1\n")}}class Ei{constructor(t){this.builder=t;const e=this.builder.dom;this.dom=e,this.undoList=[]}readStyles(){if(this.builder.opts.undoContainerOnly)return"";let t,e,i="",n=this.builder.doc.getElementsByTagName("link");for(t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")&&(i+=n[t].outerHTML);for(n=this.builder.doc.getElementsByTagName("link"),t=0;t<n.length;t++)e=n[t].href.toLowerCase(),-1!==e.indexOf("basetype-")||-1!==e.indexOf("type-")&&(i+=n[t].outerHTML);return i}writeStyles(t){const e=this.dom;if(this.builder.opts.undoContainerOnly)return;let i,n,o=this.builder.doc.getElementsByTagName("link");for(i=0;i<o.length;i++)n=o[i].href.toLowerCase(),(-1!==n.indexOf("basetype-")||-1!==n.indexOf("type-"))&&o[i].parentNode.removeChild(o[i]);let s=this.builder.doc.getElementsByTagName("head")[0];e.appendHtml(s,t)}readHtml(){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly){if(this.builder.docContainer){return this.builder.doc.querySelector(this.builder.docContainer).innerHTML}{const t=this.builder.doc.querySelectorAll(this.builder.opts.container);let e="";return Array.prototype.forEach.call(t,(t=>{e+=t.innerHTML+"####|####"})),e=e.substr(0,e.length-9),e}}return this.builder.doc.querySelector(this.builder.opts.page).innerHTML}cleaning(t){const e=this.dom;let i=t.querySelectorAll(".is-builder");Array.prototype.forEach.call(i,(t=>{t.removeAttribute("data-sort")}));let n=t.querySelectorAll("[data-click]");e.removeAttributes(n,"data-click"),e.removeElements(t.querySelectorAll(".is-row-tool")),e.removeElements(t.querySelectorAll(".is-rowadd-tool")),e.removeElements(t.querySelectorAll(".is-col-tool")),e.removeElements(t.querySelectorAll(".ovl")),e.removeElements(t.querySelectorAll(".row-add-initial")),n=t.querySelectorAll(".is-block .handle, .is-block .rotate-handle"),e.removeElements(n),n=t.querySelectorAll(".is-block"),Array.prototype.forEach.call(n,(t=>{e.removeClass(t,"active"),e.removeClass(t,"multi"),e.removeClass(t,"editable"),e.removeClass(t,"fluid"),e.removeClass(t,"cloned"),t.removeAttribute("data-fluid-val"),t.removeAttribute("data-fluid"),t.removeAttribute("data-prev")})),t.querySelectorAll(".is-block.clone").forEach((t=>t.parentNode.removeChild(t))),n=t.querySelectorAll(".is-section-tool"),e.removeElements(n)}writeHtml(t){if(""===this.builder.opts.page||this.builder.opts.undoContainerOnly)if(this.builder.docContainer){let e=this.builder.doc.querySelector(this.builder.docContainer),i=document.createRange();e.innerHTML="",e.appendChild(i.createContextualFragment(t)),this.cleaning(e)}else{const e=this.builder.doc.querySelectorAll(this.builder.opts.container);let i=0;Array.prototype.forEach.call(e,(e=>{var n=document.createRange();e.innerHTML="",e.appendChild(n.createContextualFragment(t.split("####|####")[i])),this.cleaning(e),this.builder.applyBehaviorOn(e),i++}))}else{let e=this.builder.doc.querySelector(this.builder.opts.page),i=document.createRange();e.innerHTML="",e.appendChild(i.createContextualFragment(t)),this.cleaning(e)}this.builder.opts.onRender()}saveForUndo(t){if(this.builder.onBeforeSaveForUndo&&this.builder.onBeforeSaveForUndo(),this.builder.undoRedoStyles){if(this.undoList[120]){let e=this.undoList[120][0].split("###$###")[1];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}}else if(this.undoList[120]){let e=this.undoList[120][0];if(this.builder.saveForUndoCheck&&e===this.readHtml())return void(this.builder.saveForUndoCheck=!0===t)}if(this.builder.saveForUndoCheck=!0===t,this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=" "+this.readStyles()+"###$###"+this.readHtml();this.undoList[120]=[t,null]}else this.undoList[120]=[this.readHtml(),null]}doUndo(){const t=this.dom;if(!this.undoList[120])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[99]=this.undoList[100],this.undoList[100]=this.undoList[101],this.undoList[101]=this.undoList[102],this.undoList[102]=this.undoList[103],this.undoList[103]=this.undoList[104],this.undoList[104]=this.undoList[105],this.undoList[105]=this.undoList[106],this.undoList[106]=this.undoList[107],this.undoList[107]=this.undoList[108],this.undoList[108]=this.undoList[109],this.undoList[109]=this.undoList[110],this.undoList[110]=this.undoList[111],this.undoList[111]=this.undoList[112],this.undoList[112]=this.undoList[113],this.undoList[113]=this.undoList[114],this.undoList[114]=this.undoList[115],this.undoList[115]=this.undoList[116],this.undoList[116]=this.undoList[117],this.undoList[117]=this.undoList[118],this.undoList[118]=this.undoList[119],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[119]=[i,null],i=this.undoList[120][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[119]=[this.readHtml(),null];let t=this.undoList[120][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.opts.onChange(),this.undoList[120]=this.undoList[121],this.undoList[121]=this.undoList[122],this.undoList[122]=this.undoList[123],this.undoList[123]=this.undoList[124],this.undoList[124]=this.undoList[125],this.undoList[125]=this.undoList[126],this.undoList[126]=this.undoList[127],this.undoList[127]=this.undoList[128],this.undoList[128]=this.undoList[129],this.undoList[129]=this.undoList[130],this.undoList[130]=this.undoList[131],this.undoList[131]=this.undoList[132],this.undoList[132]=this.undoList[133],this.undoList[133]=this.undoList[134],this.undoList[134]=this.undoList[135],this.undoList[135]=this.undoList[136],this.undoList[136]=this.undoList[137],this.undoList[137]=this.undoList[138],this.undoList[138]=this.undoList[139],this.undoList[139]=this.undoList[140],this.undoList[140]=this.undoList[141];const e=new i(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let n=this.builder.doc.querySelector("[data-saveforundo]");if(n){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{n.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onUndo&&this.builder.opts.onUndo(),this.builder.undoRedoInProcess=!1}doRedo(){const t=this.dom;if(!this.undoList[119])return;if(!0===this.builder.undoRedoInProcess)return;if(this.builder.undoRedoInProcess=!0,this.undoList[141]=this.undoList[140],this.undoList[140]=this.undoList[139],this.undoList[139]=this.undoList[138],this.undoList[138]=this.undoList[137],this.undoList[137]=this.undoList[136],this.undoList[136]=this.undoList[135],this.undoList[135]=this.undoList[134],this.undoList[134]=this.undoList[133],this.undoList[133]=this.undoList[132],this.undoList[132]=this.undoList[131],this.undoList[131]=this.undoList[130],this.undoList[130]=this.undoList[129],this.undoList[129]=this.undoList[128],this.undoList[128]=this.undoList[127],this.undoList[127]=this.undoList[126],this.undoList[126]=this.undoList[125],this.undoList[125]=this.undoList[124],this.undoList[124]=this.undoList[123],this.undoList[123]=this.undoList[122],this.undoList[122]=this.undoList[121],this.undoList[121]=this.undoList[120],this.builder.undoRedoStyles){let t=this.readStyles(),e=this.readHtml(),i=" "+t+"###$###"+e;this.undoList[120]=[i,null],i=this.undoList[119][0],t=i.split("###$###")[0].trim(),e=i.split("###$###")[1],this.writeStyles(t),this.writeHtml(e)}else{this.undoList[120]=[this.readHtml(),null];let t=this.undoList[119][0];this.writeHtml(t)}this.builder.applyBehavior(),this.builder.opts.onChange(),this.undoList[119]=this.undoList[118],this.undoList[118]=this.undoList[117],this.undoList[117]=this.undoList[116],this.undoList[116]=this.undoList[115],this.undoList[115]=this.undoList[114],this.undoList[114]=this.undoList[113],this.undoList[113]=this.undoList[112],this.undoList[112]=this.undoList[111],this.undoList[111]=this.undoList[110],this.undoList[110]=this.undoList[109],this.undoList[109]=this.undoList[108],this.undoList[108]=this.undoList[107],this.undoList[107]=this.undoList[106],this.undoList[106]=this.undoList[105],this.undoList[105]=this.undoList[104],this.undoList[104]=this.undoList[103],this.undoList[103]=this.undoList[102],this.undoList[102]=this.undoList[101],this.undoList[101]=this.undoList[100],this.undoList[100]=this.undoList[99],this.undoList[99]=null;const e=new i(this.builder);e.clearActiveCell(),e.clearAfterUndoRedo();let n=this.builder.doc.querySelector("[data-saveforundo]");if(n){let e=document.querySelector(".is-side.elementstyles");t.addClass(e,"active"),setTimeout((()=>{n.click()}),700)}else{let e=document.querySelector(".is-side.elementstyles");t.removeClass(e,"active")}this.builder.opts.onRedo&&this.builder.opts.onRedo(),this.builder.undoRedoInProcess=!1}}
2
2
  /*!
3
3
  Ionicons
4
4
  License: MIT