Mosaico switched from master to v0.17.5 Added workaround for Chrome - after save, images in Mosaico disappear
348 lines
246 KiB
JavaScript
348 lines
246 KiB
JavaScript
/**
|
||
* Mosaico - OpenSource Email Template Editor - v0.17.5 - 2019-05-18
|
||
* Licensed under the GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.en.html)
|
||
*
|
||
* Copyright (c) 2019 Stefano Bagnara
|
||
*/
|
||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Mosaico = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
||
var templateSystem=require("../src/js/bindings/choose-template.js");document.addEventListener("DOMContentLoaded",function(e){templateSystem.addTemplate("array","\x3c!-- ko foreach: $data --\x3e\x3c!-- ko block: $data --\x3e\x3c!-- /ko --\x3e\x3c!-- /ko --\x3e"),templateSystem.addTemplate("block-show","\x3c!-- ko block: $data, scrollIntoView: $root.selectedBlock() === $data --\x3e\x3c!-- /ko --\x3e"),templateSystem.addTemplate("block-wysiwyg",'<div class="editable block" data-drop-content="Drop here" data-bind="attr: { \'data-drop-content\': $root.t(\'Drop here\') }, click: function(obj, evt) { $root.selectBlock(obj); return true }, clickBubble: false, css: { selected: $root.selectedBlock() === $data }, scrollIntoView: $root.selectedBlock() === $data"> <div class="mo-blockselectionhelper"></div> <div class="tools" data-bind="tooltips: {}"> \x3c!-- ko if: typeof $index != \'undefined\' --\x3e <div title="Drag this handle to move the block" data-bind="attr: { title: $root.t(\'Drag this handle to move the block\') }" class="tool handle"><i class="fa fa-fw fa-sort"></i></div> \x3c!-- ko if: $index() > 0 --\x3e <div title="Move this block upside" data-bind="attr: { title: $root.t(\'Move this block upside\') }" class="tool moveup"><i class="fa fa-fw fa-sort-asc" data-bind=\'click: $root.moveBlock.bind($element, $index, $parent, true)\'></i></div> \x3c!-- /ko --\x3e \x3c!-- ko if: $index() < $parent.blocks().length -1 --\x3e <div title="Move this block downside" data-bind="attr: { title: $root.t(\'Move this block downside\') }" class="tool movedown"><i class="fa fa-fw fa-sort-desc" data-bind=\'click: $root.moveBlock.bind($element, $index, $parent, false)\'></i></div> \x3c!-- /ko --\x3e <div title="Delete block" class="tool delete" data-bind="attr: { title: $root.t(\'Delete block\') }, click: $root.removeBlock.bind($element, $rawData, $parent)"><i class="fa fa-fw fa-trash-o"></i></div> <div title="Duplicate block" class="tool clone" data-bind="attr: { title: $root.t(\'Duplicate block\') }, click: $root.duplicateBlock.bind($element, $index, $parent)"><i class="fa fa-fw fa-files-o"></i></div> \x3c!-- /ko --\x3e \x3c!-- ko if: typeof $data._nextVariant != \'undefined\' --\x3e<div title="Switch block variant" class="tool variant" data-bind="attr: { title: $root.t(\'Switch block variant\') }, click: $data._nextVariant"><i class="fa fa-fw fa-magic"></i></div>\x3c!-- /ko --\x3e </div> \x3c!-- ko block: $data --\x3e\x3c!-- /ko --\x3e</div>'),templateSystem.addTemplate("blocks-show","\x3c!-- ko template: { name: 'block-show', foreach: blocks } --\x3e\x3c!-- /ko --\x3e"),templateSystem.addTemplate("blocks-wysiwyg","<div class=\"sortable-blocks-edit\" data-drop-content=\"Drop here\" data-empty-content=\"Drop here blocks from the Blocks tab\" data-bind=\"attr: { 'data-drop-content': $root.t('Drop here'), 'data-empty-content': $root.t('Drop here blocks from the "Blocks" tab') }, css: { 'empty': ko.utils.unwrapObservable(blocks).length == 0 }, extsortable: { connectClass: 'sortable-blocks-edit', template: 'block-wysiwyg', data: blocks, dragging: $root.dragging, beforeMove: $root.startMultiple, afterMove: $root.stopMultiple, options: { handle: '.handle', placeholder: $root.placeholderHelper } }\"></div>"),templateSystem.addTemplate("customstyle",'<div class="customStyleHelp" data-bind="html: $root.t(\'Customized block.<ul><li>In this status changes to properties will be specific to the current block (instead of being global to all blocks in the same section)</li><li>A <span class="customStyled"><span>"small cube" </span></span> icon beside the property will mark the customization. By clicking this icon the property value will be reverted to the value defined for the section.</li></ul>\')">Customized block.<ul><li>In this status changes to properties will be specific to the current block (instead of being global to all blocks in the same section)</li><li>A <span class="customStyled"><span>"small cube" </span></span> icon beside the property will mark the customization. By clicking this icon the property value will be reverted to the value defined for the section.</li></ul></div>'),templateSystem.addTemplate("empty",""),templateSystem.addTemplate("error",'[<div style="background-color: #fff0f0" data-bind="text: ko.toJS($data)"></div>]'),templateSystem.addTemplate("gallery-images",'<div data-bind="foreach: items.currentPageData"> <div class="draggable-item" data-bind="if: typeof thumbnailUrl != \'undefined\'"> <div class="draggable image" data-bind="click: $root.addImage, extdraggable: { data: $data, dropContainer: \'#main-wysiwyg-area\', dragging: $root.draggingImage, \'options\': { \'appendTo\': \'#page\' } }, style: { backgroundImage: \'url(\\\'\' + thumbnailUrl + \'\\\')\' }"> <img title="Drag this image and drop it on any template image placeholder" style="display: block;" data-bind="tooltips: {}, attr: { src: thumbnailUrl, \'title\': $root.t(\'Drag this image and drop it on any template image placeholder\') }"/> </div> </div></div>\x3c!-- ko if: items.pageCount() > 1 --\x3e<div class="galleryPager" data-bind="buttonset: {}"> <a href="javascript:void(0)" data-bind="click: items.moveFirst, button: { disabled: items.currentPage() == 1, icons: { primary: \'fa fa-fast-backward\' }, text: false }">First</a> <a href="javascript:void(0)" data-bind="click: items.movePrevious, button: { disabled: items.currentPage() == 1, icons: { primary: \'fa fa-backward\' }, text: false }">Previous</a> <span data-bind="button: { disabled: true, text: true, label: \' \'+$root.t(\'__current__ of __total__\', { current: items.currentPage(), total: items.pageCount() })+\' \' }"> X of Y </span> <a href="javascript:void(0)" data-bind="click: items.moveNext, button: { disabled: items.currentPage() == items.pageCount(), icons: { primary: \'fa fa-forward\' }, text: false }">Next</a> <a href="javascript:void(0)" data-bind="click: items.moveLast, button: { disabled: items.currentPage() == items.pageCount(), icons: { primary: \'fa fa-fast-forward\' }, text: false }">Last</a></div>\x3c!-- /ko --\x3e'),templateSystem.addTemplate("img-wysiwyg",'<table tabfocus="0" cellspacing="0" cellpadding="0" data-drop-content="Drop here" data-bind="style: _stylebind, click: function(obj, evt) { $root.selectItem(_item, _data); return true; }, clickBubble: false, fudroppable: { activeClass: \'ui-state-highlight\', hoverClass: \'ui-state-draghover\' }, extdroppable: { options: { accept: \'.image\', activeClass: \'ui-state-highlight\', hoverClass: \'ui-state-draghover\' }, data: _src, dragged: $root.fileToImage }, css: { selecteditem: $root.isSelectedItem(_item) }, scrollIntoView: $root.isSelectedItem(_item), attr: { \'data-drop-content\': $root.t(\'Drop here\'), width: _width, height: _height, align: _align }" class="img-wysiwyg selectable-img" style="display: table;"><tr><td class="uploadzone"> <div class="mo-imgselectionhelper"></div> <div class="mo-uploadzone"></div> <div class="img-size" data-bind="text: _size">size</div> <div class="midtools" data-bind="tooltips: {}"> \x3c!-- ko if: _src() != \'\' --\x3e <div title="Remove image" class="tool delete" data-bind="attr: { title: $root.t(\'Remove image\') }, click: _src.bind(_src, \'\'), clickBubble: false"><i class="fa fa-fw fa-trash-o"></i></div> \x3c!-- ko if: typeof $root.editImage !== \'undefined\' --\x3e <div title="Open the image editing tool" class="tool edit" data-bind="attr: { title: $root.t(\'Open the image editing tool\') }, click: $root.editImage.bind($element, _src), clickBubble: false"><i class="fa fa-fw fa-pencil"></i></div> \x3c!-- /ko --\x3e \x3c!-- /ko --\x3e \x3c!-- ko if: _src() == \'\' --\x3e <div title="Upload a new image" data-bind="attr: { title: $root.t(\'Upload a new image\') }" class="tool upload" style="position: relative; overflow: hidden;"><i class="fa fa-fw fa-upload"></i> <input class="fileupload nofile" type="file" name="files[]" data-bind="fileupload: { data: _src, onerror: $root.notifier.error, onfile: $root.loadImage, canvasPreview: true }" style="z-index: 20; position: absolute; top: 0; left: 0; right: 0; bottom: 0; min-width: 100%; min-height: 100%; font-size: 999px; text-align: right; filter: alpha(opacity=0); opacity: 0; outline: none; cursor: inherit; display: block"> </div> \x3c!-- ko if: typeof $root.selectImage !== \'undefined\' --\x3e <div title="Select from gallery" class="tool gallery" data-bind="attr: { title: $root.t(\'Select from gallery\') }, click: $root.selectImage.bind($element, _src), clickBubble: true"><i class="fa fa-fw fa-picture-o"></i></div> \x3c!-- /ko --\x3e \x3c!-- /ko --\x3e </div> \x3c!-- ko template: _template --\x3e\x3c!-- /ko --\x3e \x3c!-- ko if: _src() == \'\' --\x3e \x3c!-- <img style="display: block;" class="imgplaceholder" width="200" src="" alt="Insert an image here" data-bind="wysiwygSrc: { src: _src.preloaded, placeholder: _placeholdersrc, width: _width, height: _height, method: _method }" /> --\x3e <span class="fileuploadtext" style="text-align: center; display: -ms-flexbox; display: flex; align-items: center; flex-align: center; justify-content: center; padding: 1em; position: absolute; top: 0; left: 0; right: 0; bottom: 0;"><span class="textMiddle" style=" text-shadow: 1px 1px 0 #FFFFFF, 0 0 10px #FFFFFF; font-weight: bold;" data-bind="text: $root.t(\'Drop an image here\')">Drop an image here</span></span> \x3c!-- /ko --\x3e \x3c!-- ko if: _src() != \'\' --\x3e \x3c!-- <img style="display: block;" width="200" src="" data-bind="preloader: _src, wysiwygSrc: { src: _src.preloaded, placeholder: _placeholdersrc, width: _width, height: _height, method: _method }" /> --\x3e \x3c!-- /ko --\x3e \x3c!-- pulsante per la cancellazione --\x3e <div title="Drop an image here or click the upload button" data-bind="attr: { title: $root.t(\'Drop an image here or click the upload button\') }, tooltips: {}" class="workzone" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden;"> \x3c!-- ko if: _src.preloaded && _src() != _src.preloaded() --\x3ePRELOADING....\x3c!-- /ko --\x3e \x3c!-- ko if: _src() != \'\' --\x3e <input class="fileupload withfile" type="file" name="files[]" data-bind="fileupload: { data: _src, onerror: $root.notifier.error, onfile: $root.galleryRecent.unshift.bind($root.galleryRecent), canvasPreview: true }" style="z-index: -20; position: absolute; top: 0; left: 0; right: 0; bottom: 0; min-width: 100%; min-height: 100%; font-zie: 999px; text-align: right; filter: alpha(opacity=0); opacity: 0; outline: none; cursor: inherit; display: block"> \x3c!-- /ko --\x3e <div class="progress" style="opacity: .5; width: 80%; margin-left: 10%; position: absolute; bottom: 30%; height: 20px; border: 2px solid black;"> <div class="progress-bar progress-bar-success" style="height: 20px; background-color: black; "></div> </div> </div></table>'),templateSystem.addTemplate("main",'<div id="page" style="display: none;" data-bind="visible: true, css: { withToolbox: $root.showToolbox, withPreviewFrame: showPreviewFrame }"> <div id="main-edit-area" data-bind="click: function(obj, evt) { $root.selectBlock(null); return true; }, clickBubble: false"> \x3c!-- ko withProperties: { templateMode: \'wysiwyg\', templateModeFallback: \'show\' } --\x3e <div id="main-wysiwyg-area" data-bind="wysiwygScrollfix: true, scrollable: true, fudroppable: { active: draggingImage }, css: { isdragging: dragging, isdraggingimg: draggingImage }, block: content"></div> \x3c!-- /ko --\x3e </div> <div id="toolbar" class="mo" data-bind="tooltips: {}"> \x3c!-- ko if: typeof $root.undo != \'undefined\' --\x3e <span data-bind="buttonset: { }" class="leftButtons"> <a title="Undo last operation" href="javascript:void(0)" data-bind="attr: { title: $root.t(\'Undo last operation\') }, click: $root.undo.execute, clickBubble: false, button: { disabled: !$root.undo.enabled(), icons: { primary: \'fa fa-reply\' }, label: $root.undo.name, text: true }">UNDO</a> <a title="Redo last operation" href="javascript:void(0)" data-bind="attr: { title: $root.t(\'Redo last operation\') }, click: $root.redo.execute, clickBubble: false, button: { disabled: !$root.redo.enabled(), icons: { primary: \'fa fa-share\' }, label: $root.redo.name, text: true }">REDO</a> </span> \x3c!-- ko if: $root.debug --\x3e <a href="javascript:void(0)" data-bind="click: $root.undoReset, clickBubble: false, button: { disabled: !$root.undo.enabled() && !$root.redo.enabled(), label: \'reset\', text: true }">RESET</a> \x3c!-- /ko --\x3e \x3c!-- /ko --\x3e <span> <input id="showGallery" type="checkbox" data-bind="checked: $root.showGallery, button: { refreshOn: $root.showGallery, icons: { primary: \'fa fa-fw fa-picture-o\', secondary: null }, text: true, label: $root.t(\'Gallery\') }"><label title="Show image gallery" for="showGallery" data-bind="attr: { title: $root.t(\'Show image gallery\') }">show gallery</label></input> </span> <input id="previewFrameToggle" type="checkbox" data-bind="checked: $root.showPreviewFrame, button: { refreshOn: $root.showPreviewFrame, icons: { primary: \'fa fa-fw fa-tablet\', secondary: null }, text: false, label: $root.t(\'Preview\') }"><label title="Show live preview" for="previewFrameToggle" data-bind="attr: { title: $root.t(\'Show live preview\') }">PREVIEW</label></input> \x3c!-- ko if: $root.debug --\x3e <a href="javascript:void(0)" data-bind="click: $root.export, clickBubble: false, button: { label: \'export\', text: true }">EXPORT</a> <input type="checkbox" data-bind="checked: $root.debug" /> debug <a href="javascript:void(0)" data-bind="click: $root.loadDefaultBlocks, clickBubble: false, button: { icons: { primary: \'fa fa-fw fa-upload\' }, label: \'Default\', text: true }">LOAD BLOCKS</a> [<a id="subscriptionsCount" href="javascript:viewModel.loopSubscriptionsCount()">subs</a>] \x3c!-- /ko --\x3e <span data-bind="visible: false"> <input type="checkbox" data-bind="checked: $root.showToolbox" /> toolbox </span> <div class="rightButtons"> \x3c!-- ko if: typeof $root.save !== \'undefined\' --\x3e <a title="Save template" href="javascript:void(0)" data-bind="attr: { title: $root.t(\'Save template\') }, click: $root.save.execute, clickBubble: false, button: { disabled: !$root.save.enabled(), icons: { primary: \'fa fa-fw fa-cloud-upload\' }, label: $root.t($root.save.name), text: true }">SALVA</a> \x3c!-- /ko --\x3e \x3c!-- ko if: typeof $root.test !== \'undefined\' --\x3e <a title="Show preview and send test" href="javascript:void(0)" data-bind="attr: { title: $root.t(\'Show preview and send test\') }, click: $root.test.execute, clickBubble: false, button: { disabled: !$root.test.enabled(), icons: { primary: \'fa fa-fw fa-paper-plane\' }, label: $root.t($root.test.name), text: true }">TEST</a> \x3c!-- /ko --\x3e \x3c!-- ko if: typeof $root.download !== \'undefined\' --\x3e <form id="downloadForm" action="#" method="POST"> <input type="hidden" name="action" value="download" /> <input type="hidden" name="filename" value="email.html" /> <input type="hidden" name="html" id="downloadHtmlTextarea" /> <a title="Download template" href="javascript:void(0)" data-bind="attr: { title: $root.t(\'Download template\') }, click: $root.download.execute, clickBubble: false, button: { disabled: !$root.download.enabled(), icons: { primary: \'fa fa-fw fa-download\' }, label: $root.t($root.download.name), text: true }">DOWNLOAD</a> </form> \x3c!-- /ko --\x3e </div> </div> \x3c!-- ko if: $root.showToolbox --\x3e <div id="main-toolbox" class="mo" data-bind="scrollable: true, withProperties: { templateMode: \'edit\' }"> <div data-bind="template: { name: \'toolbox\' }"></div> </div> \x3c!-- /ko --\x3e <div id="main-preview" class="mo" data-bind="scrollable: true, if: $root.showPreviewFrame"> <div id="preview-toolbar"> <div data-bind="visible: $root.showPreviewFrame, buttonset: { }" style="display: inline-block"> <input id="previewLarge" type="radio" name="previewMode" value="large" data-bind="checked: $root.previewMode, button: { text: false, label: \'large\', icons: { primary: \'fa fa-fw fa-desktop\' } }" /> <label for="previewLarge" title="Large screen" data-bind="attr: { title: $root.t(\'Large screen\') }">Large screen</label> <input id="previewDesktop" type="radio" name="previewMode" value="desktop" data-bind="checked: $root.previewMode, button: { text: false, label: \'desktop\', icons: { primary: \'fa fa-fw fa-tablet\' } }" /> <label for="previewDesktop" title="Tablet" data-bind="attr: { title: $root.t(\'Tablet\') }">Tablet</label> <input id="previewMobile" type="radio" name="previewMode" value="mobile" data-bind="checked: $root.previewMode, button: { text: false, label: \'mobile\', icons: { primary: \'fa fa-fw fa-mobile\' } }" /> <label for="previewMobile" title="Smartphone" data-bind="attr: { title: $root.t(\'Smartphone\') }">Smartphone</label> </div> </div> <div id="frame-container" data-bind="css: { desktop: $root.previewMode() == \'desktop\', mobile: $root.previewMode() == \'mobile\', large: $root.previewMode() == \'large\' }"> <iframe data-bind="bindIframe: $data"></iframe> </div> </div> <div class="mo" id="mo-body"></div> <div id="incompatible-template" title="Saved model is obsolete" style="display: none" data-bind="attr: { title: $root.t(\'Saved model is obsolete\') }, html: $root.t(\'<p>The saved model has been created with a previous, non completely compatible version, of the template</p><p>Some content or style in the model <b>COULD BE LOST</b> if you will <b>save</b></p><p>Contact us for more informations!</p>\')"> Incompatible template </div> <div id="fake-image-editor" title="Fake image editor" style="display: none" data-bind="attr: { title: $root.t(\'Fake image editor\') }, html: $root.t(\'<p>Fake image editor</p>\')"> <p>Fake image editor</p> </div></div>\x3c!-- ko if: $root.logoPath --\x3e<div id="loading" class="loading" style="display: block; width: 300px; text-align: center; height: 32px; position: absolute; top:0; bottom: 0; left: 0; right: 0; margin: auto;" data-bind="attr: { style: \'position: absolute; top: 5px; left: 6px; z-index: 150;\'}, css: { loading: false }"> <a href="/" data-bind="attr: { href: $root.logoUrl, alt: $root.logoAlt }"><img data-bind="attr: { src: $root.logoPath }" width="32" height="32" alt="mosaico" border="0" /></a> <div style="opacity: 0" data-bind="visible: false">Oppps... !!</div></div>\x3c!-- /ko --\x3e'),templateSystem.addTemplate("toolbox",'<div id="tooltabs" class="tabs_horizontal button_color" data-bind="tabs: { active: $root.selectedTool }"> <ul> <li data-bind="tooltips: {}"><a title="Blocks ready to be added to the template" data-local="true" href="#toolblocks" data-bind="attr: { title: $root.t(\'Blocks ready to be added to the template\') }"><i class="fa fa-fw fa-cubes"></i> <span data-bind="html: $root.t(\'Blocks\')">Blocks</span></a></li> <li data-bind="tooltips: {}"><a title="Edit content options" href="#toolcontents" data-local="true" data-bind="attr: { title: $root.t(\'Edit content options\') }"><i class="fa fa-fw fa-pencil"></i> <span data-bind="html: $root.t(\'Content\')">Content</span></a></li> <li data-bind="tooltips: {}"><a title="Edit style options" href="#toolstyles" data-local="true" data-bind="attr: { title: $root.t(\'Edit style options\') }"><i class="fa fa-fw fa-paint-brush"></i> <span data-bind="html: $root.t(\'Style\')">Style</span></a></li> </ul> <div id="toolblocks" data-bind="scrollable: true"> <div class="block-list" data-bind="foreach: blockDefs" style="text-align: center"> <div class="draggable-item" data-bind="withProperties: { templateMode: \'show\' }"> <div class="block" data-bind="extdraggable: { connectClass: \'sortable-blocks-edit\', data: $data, dropContainer: \'#main-wysiwyg-area\', dragging: $root.dragging, \'options\': { handle: \'.handle\', distance: 10, \'appendTo\': \'#page\' } }, click: $root.addBlock" style="position: relative;"> <div title="Click or drag to add this block to the template" class="handle" data-bind="attr: { title: $root.t(\'Click or drag to add this block to the template\') }, tooltips: {}"></div> <img data-bind="attr: { alt: $root.t(\'Block __name__\', { name: ko.utils.unwrapObservable(type) }), src: $root.templatePath(\'edres/\'+ko.utils.unwrapObservable(type)+\'.png\') }" alt="Block __name__" /> </div> <a href="javascript:void(0)" class="addblockbutton" data-bind="click: $root.addBlock, button: { label: $root.t(\'Add\') }">Add</a> </div> </div> </div> <div id="toolcontents" data-bind="scrollable: true"> \x3c!-- ko if: $root.selectedBlock() !== null --\x3e <div data-bind="block: $root.selectedBlock"></div> \x3c!-- /ko --\x3e \x3c!-- ko if: $root.selectedBlock() == null --\x3e <div class="noSelectedBlock" data-bind="text: $root.t(\'By clicking on message parts you will select a block and content options, if any, will show here\')">By clicking on message parts you will select a block and content options, if any, will show here</div> \x3c!-- /ko --\x3e \x3c!-- ko block: content --\x3e\x3c!-- /ko --\x3e </div> <div id="toolstyles" data-bind="scrollable: true, withProperties: { templateMode: \'styler\' }"> \x3c!-- ko if: typeof $root.content().theme === \'undefined\' || typeof $root.content().theme().scheme === \'undefined\' || $root.content().theme().scheme() === \'custom\' --\x3e \x3c!-- ko if: $root.selectedBlock() !== null --\x3e <div data-bind="block: $root.selectedBlock, css: { workLocal: $root.selectedBlock().customStyle, workGlobal: typeof $root.selectedBlock().customStyle === \'undefined\' || !$root.selectedBlock().customStyle() }"></div> \x3c!-- /ko --\x3e \x3c!-- ko if: $root.selectedBlock() == null --\x3e <div class="noSelectedBlock" data-bind="text: $root.t(\'By clicking on message parts you will select a block and style options, if available, will show here\')">By clicking on message parts you will select a block and style options, if available, will show here</div> \x3c!-- /ko --\x3e <div class="workGlobalContent"> \x3c!-- ko block: content --\x3e\x3c!-- /ko --\x3e </div> \x3c!-- /ko --\x3e </div></div> <div id="toolimages" class="slidebar" data-bind="scrollable: true, css: { hidden: $root.showGallery() === false }"> <div class="close" data-bind="click: $root.showGallery.bind($element, false);">X</div> <span class="pane-title" data-bind="text: $root.t(\'Gallery:\')">Gallery:</span> <div data-drop-content="Drop here" class="img-dropzone pane uploadzone" data-bind="attr: { \'data-drop-content\': $root.t(\'Drop here\') }, fudroppable: { activeClass: \'ui-state-highlight\', hoverClass: \'ui-state-draghover\' }"> <div class="mo-uploadzone" style="position: relative; padding: 2em; border: 2px dotted #808080"> <input class="fileupload" type="file" multiple name="files[]" data-bind="fileupload: { onerror: $root.notifier.error, onfile: $root.loadImage }" style="z-index: 10; position: absolute; top: 0; left: 0; right: 0; bottom: 0; min-width: 100%; min-height: 100%; font-zie: 999px; text-align: right; filter: alpha(opacity=0); opacity: 0; outline: none; cursor: inherit; display: block"> <span data-bind="text: $root.t(\'Click or drag files here\')">Click or drag files here</span> <div class="workzone" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden;"> <div class="progress" style="opacity: .5; width: 80%; margin-left: 10%; position: absolute; bottom: 30%; height: 20px; border: 2px solid black;"> <div class="progress-bar progress-bar-success" style="height: 20px; background-color: black; "></div> </div> </div> </div> </div> \x3c!-- ko if: $root.showGallery() --\x3e <div id="toolimagestab" class="tabs_horizontal" data-bind="tabs: { active: $root.selectedImageTab }"> <ul> <li data-bind="tooltips: {}"><a title="Session images" data-local="true" href="#toolimagesrecent" data-bind="attr: { title: $root.t(\'Session images\') }, text: $root.t(\'Recents\')">Recents</a></li> <li data-bind="tooltips: {}"><a title="Remote gallery" data-local="true" href="#toolimagesgallery" data-bind="attr: { title: $root.t(\'Remote gallery\') }, text: $root.t(\'Gallery\')">Gallery</a></li> </ul> <div id="toolimagesrecent"> \x3c!-- ko if: galleryRecent().length == 0 --\x3e<div class="galleryEmpty" data-bind="text: $root.t(\'No images uploaded, yet\')">No images uploaded, yet</div>\x3c!-- /ko --\x3e \x3c!-- ko template: {name: \'gallery-images\', data: { items: galleryRecent } } --\x3e# recent gallery #\x3c!-- /ko --\x3e </div> <div id="toolimagesgallery" style="text-align: center"> \x3c!-- ko if: $root.galleryLoaded() === false --\x3e<a class="loadbutton" title="Show images from the gallery" href="javascript:void(0)" data-bind="attr: { title: $root.t(\'Show images from the gallery\') }, click: $root.loadGallery, button: { disabled: $root.galleryLoaded, icons: { primary: \'fa fa-fw fa-picture-o\' }, label: $root.galleryLoaded() == \'loading\' ? $root.t(\'Loading...\') : $root.t(\'Load gallery\'), text: true }"># load gally #</a>\x3c!-- /ko --\x3e \x3c!-- ko if: $root.galleryLoaded() === \'loading\' --\x3e<div class="galleryEmpty" data-bind="text: $root.t(\'Loading gallery...\')">Loading gallery...</div>\x3c!-- /ko --\x3e \x3c!-- ko if: $root.galleryLoaded() === 0 --\x3e<div class="galleryEmpty" data-bind="text: $root.t(\'The gallery is empty\')">The gallery is empty</div>\x3c!-- /ko --\x3e \x3c!-- ko template: {name: \'gallery-images\', data: { items: galleryRemote } } --\x3e# remote gallery #\x3c!-- /ko --\x3e </div> </div> \x3c!-- /ko --\x3e</div><div id="tooldebug" class="slidebar" data-bind="css: { hidden: $root.debug() === false }"> <div class="close" data-bind="click: $root.debug.bind($element, false);">X</div> \x3c!-- ko if: $root.debug --\x3e Content: <pre data-bind=\'text: ko.toJSON(content, null, 2)\' style="overflow: auto; height: 20%"></pre> BlockDefs: <pre data-bind=\'text: ko.toJSON(blockDefs, null, 2)\' style="overflow: auto; height: 20%"></pre> \x3c!-- /ko --\x3e <a href="javascript:void(0)" data-bind="click: $root.exportHTMLtoTextarea.bind($element, \'#outputhtml\'); clickBubble: false, button: { text: true, label:\'Generate\' }">Output</a> <a href="javascript:void(0)" data-bind="click: $root.exportJSONtoTextarea.bind($element, \'#outputhtml\'); clickBubble: false, button: { text: true, label:\'Export\' }">Export</a> <a href="javascript:void(0)" data-bind="click: $root.importJSONfromTextarea.bind($element, \'#outputhtml\'); clickBubble: false, button: { text: true, label:\'Import\' }">Import</a> <textarea id="outputhtml" rows="10" style="width: 100%;"></textarea></div><div id="tooltheme" class="ui-widget slidebar" data-bind="css: { hidden: $root.showTheme() === false }"> <div class="close" data-bind="click: $root.showTheme.bind($element, false);">X</div> \x3c!-- ko withProperties: { templateMode: \'styler\' } --\x3e \x3c!-- ko if: $root.showTheme --\x3e \x3c!-- ko block: $root.content().theme --\x3e\x3c!-- /ko --\x3e \x3c!-- /ko --\x3e \x3c!-- /ko --\x3e</div>')});
|
||
|
||
},{"../src/js/bindings/choose-template.js":31}],2:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";function compare(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function isBuffer(e){return global.Buffer&&"function"==typeof global.Buffer.isBuffer?global.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var util=require("util/"),hasOwn=Object.prototype.hasOwnProperty,pSlice=Array.prototype.slice,functionsHaveNames="foo"===function(){}.name;function pToString(e){return Object.prototype.toString.call(e)}function isView(e){return!isBuffer(e)&&("function"==typeof global.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var assert=module.exports=ok,regex=/\s*function\s+([^\(\s]*)\s*/;function getName(e){if(util.isFunction(e)){if(functionsHaveNames)return e.name;var t=e.toString().match(regex);return t&&t[1]}}function truncate(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function inspect(e){if(functionsHaveNames||!util.isFunction(e))return util.inspect(e);var t=getName(e);return"[Function"+(t?": "+t:"")+"]"}function getMessage(e){return truncate(inspect(e.actual),128)+" "+e.operator+" "+truncate(inspect(e.expected),128)}function fail(e,t,r,n,i){throw new assert.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function ok(e,t){e||fail(e,!0,t,"==",assert.ok)}function _deepEqual(e,t,r,n){if(e===t)return!0;if(isBuffer(e)&&isBuffer(t))return 0===compare(e,t);if(util.isDate(e)&&util.isDate(t))return e.getTime()===t.getTime();if(util.isRegExp(e)&&util.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(isView(e)&&isView(t)&&pToString(e)===pToString(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===compare(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(isBuffer(e)!==isBuffer(t))return!1;var i=(n=n||{actual:[],expected:[]}).actual.indexOf(e);return-1!==i&&i===n.expected.indexOf(t)||(n.actual.push(e),n.expected.push(t),objEquiv(e,t,r,n))}return r?e===t:e==t}function isArguments(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function objEquiv(e,t,r,n){if(null==e||null==t)return!1;if(util.isPrimitive(e)||util.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=isArguments(e),a=isArguments(t);if(i&&!a||!i&&a)return!1;if(i)return _deepEqual(e=pSlice.call(e),t=pSlice.call(t),r);var s,u,o=objectKeys(e),f=objectKeys(t);if(o.length!==f.length)return!1;for(o.sort(),f.sort(),u=o.length-1;u>=0;u--)if(o[u]!==f[u])return!1;for(u=o.length-1;u>=0;u--)if(!_deepEqual(e[s=o[u]],t[s],r,n))return!1;return!0}function notDeepStrictEqual(e,t,r){_deepEqual(e,t,!0)&&fail(e,t,r,"notDeepStrictEqual",notDeepStrictEqual)}function expectedException(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _tryBlock(e){var t;try{e()}catch(e){t=e}return t}function _throws(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=_tryBlock(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&fail(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!e&&i&&!r;if((!e&&util.isError(i)&&a&&expectedException(i,r)||s)&&fail(i,r,"Got unwanted exception"+n),e&&i&&r&&!expectedException(i,r)||!e&&i)throw i}assert.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=getMessage(this),this.generatedMessage=!0);var t=e.stackStartFunction||fail;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=getName(t),a=n.indexOf("\n"+i);if(a>=0){var s=n.indexOf("\n",a+1);n=n.substring(s+1)}this.stack=n}}},util.inherits(assert.AssertionError,Error),assert.fail=fail,assert.ok=ok,assert.equal=function(e,t,r){e!=t&&fail(e,t,r,"==",assert.equal)},assert.notEqual=function(e,t,r){e==t&&fail(e,t,r,"!=",assert.notEqual)},assert.deepEqual=function(e,t,r){_deepEqual(e,t,!1)||fail(e,t,r,"deepEqual",assert.deepEqual)},assert.deepStrictEqual=function(e,t,r){_deepEqual(e,t,!0)||fail(e,t,r,"deepStrictEqual",assert.deepStrictEqual)},assert.notDeepEqual=function(e,t,r){_deepEqual(e,t,!1)&&fail(e,t,r,"notDeepEqual",assert.notDeepEqual)},assert.notDeepStrictEqual=notDeepStrictEqual,assert.strictEqual=function(e,t,r){e!==t&&fail(e,t,r,"===",assert.strictEqual)},assert.notStrictEqual=function(e,t,r){e===t&&fail(e,t,r,"!==",assert.notStrictEqual)},assert.throws=function(e,t,r){_throws(!0,e,t,r)},assert.doesNotThrow=function(e,t,r){_throws(!1,e,t,r)},assert.ifError=function(e){if(e)throw e};var objectKeys=Object.keys||function(e){var t=[];for(var r in e)hasOwn.call(e,r)&&t.push(r);return t};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"util/":5}],3:[function(require,module,exports){
|
||
"function"==typeof Object.create?module.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(t,e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t};
|
||
|
||
},{}],4:[function(require,module,exports){
|
||
module.exports=function(o){return o&&"object"==typeof o&&"function"==typeof o.copy&&"function"==typeof o.fill&&"function"==typeof o.readUInt8};
|
||
|
||
},{}],5:[function(require,module,exports){
|
||
(function (process,global){
|
||
var formatRegExp=/%[sdj%]/g;exports.format=function(e){if(!isString(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(inspect(arguments[t]));return r.join(" ")}t=1;for(var n=arguments,i=n.length,o=String(e).replace(formatRegExp,function(e){if("%%"===e)return"%";if(t>=i)return e;switch(e){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch(e){return"[Circular]"}default:return e}}),s=n[t];t<i;s=n[++t])isNull(s)||!isObject(s)?o+=" "+s:o+=" "+inspect(s);return o},exports.deprecate=function(e,r){if(isUndefined(global.process))return function(){return exports.deprecate(e,r).apply(this,arguments)};if(!0===process.noDeprecation)return e;var t=!1;return function(){if(!t){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),t=!0}return e.apply(this,arguments)}};var debugEnviron,debugs={};function inspect(e,r){var t={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),isBoolean(r)?t.showHidden=r:r&&exports._extend(t,r),isUndefined(t.showHidden)&&(t.showHidden=!1),isUndefined(t.depth)&&(t.depth=2),isUndefined(t.colors)&&(t.colors=!1),isUndefined(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=stylizeWithColor),formatValue(t,e,t.depth)}function stylizeWithColor(e,r){var t=inspect.styles[r];return t?"["+inspect.colors[t][0]+"m"+e+"["+inspect.colors[t][1]+"m":e}function stylizeNoColor(e,r){return e}function arrayToHash(e){var r={};return e.forEach(function(e,t){r[e]=!0}),r}function formatValue(e,r,t){if(e.customInspect&&r&&isFunction(r.inspect)&&r.inspect!==exports.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(t,e);return isString(n)||(n=formatValue(e,n,t)),n}var i=formatPrimitive(e,r);if(i)return i;var o=Object.keys(r),s=arrayToHash(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),isError(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return formatError(r);if(0===o.length){if(isFunction(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(isRegExp(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(isDate(r))return e.stylize(Date.prototype.toString.call(r),"date");if(isError(r))return formatError(r)}var c,a="",l=!1,p=["{","}"];(isArray(r)&&(l=!0,p=["[","]"]),isFunction(r))&&(a=" [Function"+(r.name?": "+r.name:"")+"]");return isRegExp(r)&&(a=" "+RegExp.prototype.toString.call(r)),isDate(r)&&(a=" "+Date.prototype.toUTCString.call(r)),isError(r)&&(a=" "+formatError(r)),0!==o.length||l&&0!=r.length?t<0?isRegExp(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=l?formatArray(e,r,t,s,o):o.map(function(n){return formatProperty(e,r,t,s,n,l)}),e.seen.pop(),reduceToSingleString(c,a,p)):p[0]+a+p[1]}function formatPrimitive(e,r){if(isUndefined(r))return e.stylize("undefined","undefined");if(isString(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}return isNumber(r)?e.stylize(""+r,"number"):isBoolean(r)?e.stylize(""+r,"boolean"):isNull(r)?e.stylize("null","null"):void 0}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(e,r,t,n,i){for(var o=[],s=0,u=r.length;s<u;++s)hasOwnProperty(r,String(s))?o.push(formatProperty(e,r,t,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(formatProperty(e,r,t,n,i,!0))}),o}function formatProperty(e,r,t,n,i,o){var s,u,c;if((c=Object.getOwnPropertyDescriptor(r,i)||{value:r[i]}).get?u=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(u=e.stylize("[Setter]","special")),hasOwnProperty(n,i)||(s="["+i+"]"),u||(e.seen.indexOf(c.value)<0?(u=isNull(t)?formatValue(e,c.value,null):formatValue(e,c.value,t-1)).indexOf("\n")>-1&&(u=o?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n")):u=e.stylize("[Circular]","special")),isUndefined(s)){if(o&&i.match(/^\d+$/))return u;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+u}function reduceToSingleString(e,r,t){return e.reduce(function(e,r){return 0,r.indexOf("\n")>=0&&0,e+r.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?t[0]+(""===r?"":r+"\n ")+" "+e.join(",\n ")+" "+t[1]:t[0]+r+" "+e.join(", ")+" "+t[1]}function isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNullOrUndefined(e){return null==e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isSymbol(e){return"symbol"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"==typeof e&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"==typeof e}function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return e<10?"0"+e.toString(10):e.toString(10)}exports.debuglog=function(e){if(isUndefined(debugEnviron)&&(debugEnviron=process.env.NODE_DEBUG||""),e=e.toUpperCase(),!debugs[e])if(new RegExp("\\b"+e+"\\b","i").test(debugEnviron)){var r=process.pid;debugs[e]=function(){var t=exports.format.apply(exports,arguments);console.error("%s %d: %s",e,r,t)}}else debugs[e]=function(){};return debugs[e]},exports.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=require("./support/isBuffer");var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var e=new Date,r=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(":");return[e.getDate(),months[e.getMonth()],r].join(" ")}function hasOwnProperty(e,r){return Object.prototype.hasOwnProperty.call(e,r)}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))},exports.inherits=require("inherits"),exports._extend=function(e,r){if(!r||!isObject(r))return e;for(var t=Object.keys(r),n=t.length;n--;)e[t[n]]=r[t[n]];return e};
|
||
|
||
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"./support/isBuffer":4,"_process":22,"inherits":3}],6:[function(require,module,exports){
|
||
(function (global){
|
||
var console,util=require("util"),assert=require("assert"),now=require("date-now"),slice=Array.prototype.slice,times={};console="undefined"!=typeof global&&global.console?global.console:"undefined"!=typeof window&&window.console?window.console:{};for(var functions=[[log,"log"],[info,"info"],[warn,"warn"],[error,"error"],[time,"time"],[timeEnd,"timeEnd"],[trace,"trace"],[dir,"dir"],[consoleAssert,"assert"]],i=0;i<functions.length;i++){var tuple=functions[i],f=tuple[0],name=tuple[1];console[name]||(console[name]=f)}function log(){}function info(){console.log.apply(console,arguments)}function warn(){console.log.apply(console,arguments)}function error(){console.warn.apply(console,arguments)}function time(o){times[o]=now()}function timeEnd(o){var e=times[o];if(!e)throw new Error("No such label: "+o);var n=now()-e;console.log(o+": "+n+"ms")}function trace(){var o=new Error;o.name="Trace",o.message=util.format.apply(null,arguments),console.error(o.stack)}function dir(o){console.log(util.inspect(o)+"\n")}function consoleAssert(o){if(!o){var e=slice.call(arguments,1);assert.ok(!1,util.format.apply(null,e))}}module.exports=console;
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"assert":2,"date-now":7,"util":27}],7:[function(require,module,exports){
|
||
function now(){return(new Date).getTime()}module.exports=now;
|
||
|
||
},{}],8:[function(require,module,exports){
|
||
!function(t,e){var o=0,i=window.navigator.userAgent,s=i.indexOf("MSIE ")>0,f=s?"-ie":"",n=!s&&(/mozilla/.test(i.toLowerCase())&&!/webkit/.test(i.toLowerCase())),c=[],a=["ffffff","000000","eeece1","1f497d","4f81bd","c0504d","9bbb59","8064a2","4bacc6","f79646"],r=["f2f2f2","7f7f7f","ddd9c3","c6d9f0","dbe5f1","f2dcdb","ebf1dd","e5e0ec","dbeef3","fdeada","d8d8d8","595959","c4bd97","8db3e2","b8cce4","e5b9b7","d7e3bc","ccc1d9","b7dde8","fbd5b5","bfbfbf","3f3f3f","938953","548dd4","95b3d7","d99694","c3d69b","b2a2c7","92cddc","fac08f","a5a5a5","262626","494429","17365d","366092","953734","76923c","5f497a","31859b","e36c09","7f7f7f","0c0c0c","1d1b10","0f243e","244061","632423","4f6128","3f3151","205867","974806"],l=["c00000","ff0000","ffc000","ffff00","92d050","00b050","00b0f0","0070c0","002060","7030a0"],h=[["003366","336699","3366cc","003399","000099","0000cc","000066"],["006666","006699","0099cc","0066cc","0033cc","0000ff","3333ff","333399"],["669999","009999","33cccc","00ccff","0099ff","0066ff","3366ff","3333cc","666699"],["339966","00cc99","00ffcc","00ffff","33ccff","3399ff","6699ff","6666ff","6600ff","6600cc"],["339933","00cc66","00ff99","66ffcc","66ffff","66ccff","99ccff","9999ff","9966ff","9933ff","9900ff"],["006600","00cc00","00ff00","66ff99","99ffcc","ccffff","ccccff","cc99ff","cc66ff","cc33ff","cc00ff","9900cc"],["003300","009933","33cc33","66ff66","99ff99","ccffcc","ffffff","ffccff","ff99ff","ff66ff","ff00ff","cc00cc","660066"],["333300","009900","66ff33","99ff66","ccff99","ffffcc","ffcccc","ff99cc","ff66cc","ff33cc","cc0099","993399"],["336600","669900","99ff33","ccff66","ffff99","ffcc99","ff9999","ff6699","ff3399","cc3399","990099"],["666633","99cc00","ccff33","ffff66","ffcc66","ff9966","ff6666","ff0066","d60094","993366"],["a58800","cccc00","ffff00","ffcc00","ff9933","ff6600","ff0033","cc0066","660033"],["996633","cc9900","ff9900","cc6600","ff3300","ff0000","cc0000","990033"],["663300","996600","cc3300","993300","990000","800000","993333"]],d=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},p=function(t){return d(Number(t))},v=function(t){var e=d(t);return e+e+e},u=function(t){if(t.length>10){var e=1+t.indexOf("("),o=t.indexOf(")"),i=t.substring(e,o).split(",");return["#",p(i[0]),p(i[1]),p(i[2])].join("")}return t};t.widget("evol.colorpicker",{version:"3.3.2",options:{color:null,customTheme:null,showOn:"both",hideButton:!1,displayIndicator:!0,transparentColor:!1,history:!0,defaultPalette:"theme",strings:"Theme Colors,Standard Colors,Web Colors,Theme Colors,Back to Palette,History,No history yet."},_active:!1,_create:function(){var e=this;switch(this._paletteIdx="theme"==this.options.defaultPalette?1:2,this._id="evo-cp"+o++,this._enabled=!0,this.options.showOn=this.options.hideButton?"focus":this.options.showOn,this.element.get(0).tagName){case"INPUT":var i=this.options.color,c=this.element,a=("focus"===this.options.showOn?"":"evo-pointer ")+"evo-colorind"+(n?"-ff":f)+(this.options.hideButton?" evo-hidden-button":""),r="";this._isPopup=!0,this._palette=null;var l=c.val();null!==i?i!=l&&c.val(i).change():""!==l&&(i=this.options.color=l),"#0000ffff"===i?a+=" evo-transparent":r=null!==i?"background-color:"+i:"",c.addClass("colorPicker "+this._id).wrap('<div style="width:'+(this.options.hideButton?this.element.width():this.element.width()+32)+"px;"+(s?"margin-bottom:-21px;":"")+(n?"padding:1px 0;":"")+'" class="evo-cp-wrap"></div>').after('<div class="'+a+'" style="'+r+'"></div>').on("keyup onpaste",function(o){var i=t(this).val();i!=e.options.color&&e._setValue(i,!0)});var h=this.options.showOn;"both"!==h&&"focus"!==h||c.on("focus",function(){e.showPalette()}),"both"!==h&&"button"!==h||c.next().on("click",function(t){return t.stopPropagation(),e.showPalette(),!1});break;default:this._isPopup=!1,this._palette=this.element.html(this._paletteHTML()).attr("aria-haspopup","true"),this._bindColors()}if(this.options.history&&(i&&this._add2History(i),this.options.initialHistory)){var d=this.options.initialHistory;for(var p in d)this._add2History(d[p])}},_paletteHTML:function(){var t=this._paletteIdx=Math.abs(this._paletteIdx),e=this.options,o=e.strings.split(","),i='<div class="evo-pop'+f+' ui-widget ui-widget-content ui-corner-all"'+(this._isPopup?' style="position:absolute"':"")+"><span>"+this["_paletteHTML"+t]()+'</span><div class="evo-more"><a href="javascript:void(0)">'+o[1+t]+"</a>";return e.history&&(i+='<a href="javascript:void(0)" class="evo-hist">'+o[5]+"</a>"),i+="</div>",e.displayIndicator&&(i+=this._colorIndHTML(this.options.color)+this._colorIndHTML("")),i+="</div>"},_colorIndHTML:function(t){var e=s?"evo-colorbox-ie ":"",o="";return t?"#0000ffff"===t?e+="evo-transparent":o="background-color:"+t:o="display:none",'<div class="evo-color" style="float:left"><div style="'+o+'" class="'+e+'"></div><span>'+(t||"")+"</span></div>"},_paletteHTML1:function(){var t,e=this.options,o=e.strings.split(","),i='<td style="background-color:',n=s?'"><div style="width:2px;"></div></td>':'"><span/></td>',c='<tr><th colspan="10" class="ui-widget-content">',h='<table class="evo-palette'+f+'">'+c+o[0]+"</th></tr><tr>";if(e.customTheme)for(t=0,ml=e.customTheme.length;t<ml;t++)h+=i+e.customTheme[t]+n;else{for(i+="#",t=0;t<10;t++)h+=i+a[t]+n;for(h+="</tr>",s||(h+='<tr><th colspan="10"></th></tr>'),h+='<tr class="top">',t=0;t<10;t++)h+=i+r[t]+n;for(var d=1;d<4;d++)for(h+='</tr><tr class="in">',t=0;t<10;t++)h+=i+r[10*d+t]+n;for(h+='</tr><tr class="bottom">',t=40;t<50;t++)h+=i+r[t]+n;for(h+="</tr>"+c,e.transparentColor&&(h+='<div class="evo-transparent evo-tr-box"></div>'),h+=o[1]+"</th></tr><tr>",t=0;t<10;t++)h+=i+l[t]+n}return h+="</tr></table>"},_paletteHTML2:function(){for(var t,e,o='<td style="background-color:#',i=s?'"><div style="width:5px;"></div></td>':'"><span/></td>',n='<table class="evo-palette2'+f+'"><tr>',c='<div class="evo-palcenter">',a=0,r=h.length;a<r;a++){c+=n;var l=h[a];for(t=0,e=l.length;t<e;t++)c+=o+l[t]+i;c+="</tr></table>"}c+='<div class="evo-sep"/>';var d="";for(c+=n,t=255;t>10;t-=10)c+=o+v(t)+i,d+=o+v(t-=10)+i;return c+="</tr></table>"+n+d+"</tr></table></div>"},_switchPalette:function(e){if(this._enabled){var o,i,s,f=this.options,n=f.strings.split(",");if(t(e).hasClass("evo-hist")){var a='<table class="evo-palette"><tr><th class="ui-widget-content">'+n[5]+'</th></tr></tr></table><div class="evo-cHist">';if(0===c.length)a+="<p> "+n[6]+"</p>";else for(var r=c.length-1;r>-1;r--)9===c[r].length?f.transparentColor&&(a+='<div class="evo-transparent"></div>'):a+='<div style="background-color:'+c[r]+'"></div>';a+="</div>",o=-this._paletteIdx,i=a,s=n[4]}else this._paletteIdx<0?(o=-this._paletteIdx,this._palette.find(".evo-hist").show()):o=2==this._paletteIdx?1:2,i=this["_paletteHTML"+o](),s=n[o+1],this._paletteIdx=o;this._paletteIdx=o;var l=this._palette.find(".evo-more").prev().html(i).end().children().eq(0).html(s);o<0&&l.next().hide()}},_downOrUpPositioning:function(){for(var t=this.element,e=0;null!==t&&e<100;){if("visible"!=t.css("overflow")){var o=this._palette.offset().top+this._palette.height(),i=t.offset().top+t.height(),s=this._palette.offset().top-this._palette.height()-this.element.outerHeight(),f=t.offset().top;o>i&&s>f?this._palette.css({bottom:this.element.outerHeight()+"px"}):this._palette.css({bottom:"auto"});break}if("HTML"==t[0].tagName)break;t=t.offsetParent(),e++}},showPalette:function(){if(this._enabled&&(this._active=!0,t(".colorPicker").not("."+this._id).colorpicker("hidePalette"),null===this._palette)){this._palette=this.element.next().after(this._paletteHTML()).next().on("click",function(t){return t.stopPropagation(),!1}),this._bindColors();var e=this;this._isPopup&&(this._downOrUpPositioning(),t(document.body).on("click."+e._id,function(t){t.target!=e.element.get(0)&&e.hidePalette()}).on("keyup."+e._id,function(t){27===t.keyCode&&e.hidePalette()}))}return this},hidePalette:function(){if(this._isPopup&&this._palette){t(document.body).off("click."+this._id);var e=this;this._palette.off("mouseover click","td,.evo-transparent").fadeOut(function(){e._palette.remove(),e._palette=e._cTxt=null}).find(".evo-more a").off("click")}return this},_bindColors:function(){var e=this,o=this.options,i=this._palette.find("div.evo-color"),s=o.history?"td,.evo-cHist>div":"td";o.transparentColor&&(s+=",.evo-transparent"),this._cTxt1=i.eq(0).children().eq(0),this._cTxt2=i.eq(1).children().eq(0),this._palette.on("click",s,function(o){if(e._enabled){var i=t(this);e._setValue(i.hasClass("evo-transparent")?"#0000ffff":u(i.attr("style").substring(17))),e._active=!1}}).on("mouseover",s,function(o){if(e._enabled){var i=t(this),s=i.hasClass("evo-transparent")?"#0000ffff":u(i.attr("style").substring(17));e.options.displayIndicator&&e._setColorInd(s,2),e._active&&e.element.trigger("mouseover.color",s)}}).find(".evo-more a").on("click",function(){return e._switchPalette(this),!1})},val:function(t){return void 0===t?this.options.color:(this._setValue(t),this)},_setValue:function(t,e){t=t.replace(/ /g,""),this.options.color=t,this._isPopup?(e||this.hidePalette(),this._setBoxColor(this.element.val(t).change().next(),t)):this._setColorInd(t,1),this.options.history&&this._paletteIdx>0&&this._add2History(t),this.element.trigger("change.color",t)},_setColorInd:function(t,e){var o=this["_cTxt"+e];this._setBoxColor(o,t),o.next().html(t)},_setBoxColor:function(t,e){"#0000ffff"===e?t.addClass("evo-transparent").removeAttr("style"):t.removeClass("evo-transparent").attr("style","background-color:"+e)},_setOption:function(t,e){"color"==t?this._setValue(e,!0):this.options[t]=e},_add2History:function(t){for(var e=c.length,o=0;o<e;o++)if(t==c[o])return;e>27&&c.shift(),c.push(t)},clear:function(){this.hidePalette().val("")},enable:function(){var t=this.element;return this._isPopup?t.removeAttr("disabled"):t.css({opacity:"1","pointer-events":"auto"}),"focus"!==this.options.showOn&&this.element.next().addClass("evo-pointer"),t.removeAttr("aria-disabled"),this._enabled=!0,this},disable:function(){var t=this.element;return this._isPopup?t.attr("disabled","disabled"):(this.hidePalette(),t.css({opacity:"0.3","pointer-events":"none"})),"focus"!==this.options.showOn&&this.element.next().removeClass("evo-pointer"),t.attr("aria-disabled","true"),this._enabled=!1,this},isDisabled:function(){return!this._enabled},destroy:function(){t(document.body).off("click."+this._id),this._palette&&(this._palette.off("mouseover click","td,.evo-cHist>div,.evo-transparent").find(".evo-more a").off("click"),this._isPopup&&this._palette.remove(),this._palette=this._cTxt=null),this._isPopup&&this.element.next().off("click").remove().end().off("focus").unwrap(),this.element.removeClass("colorPicker "+this.id).empty(),t.Widget.prototype.destroy.call(this)}})}(jQuery);
|
||
|
||
},{}],9:[function(require,module,exports){
|
||
"function"==typeof Object.create?module.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(t,e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t};
|
||
|
||
},{}],10:[function(require,module,exports){
|
||
!function(e){"use strict";var r=function(e,r){var t=new Error(e+" at character "+r);throw t.index=r,t.description=e,t},t={"-":!0,"!":!0,"~":!0,"+":!0},n={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},o=function(e){var r,t=0;for(var n in e)(r=n.length)>t&&e.hasOwnProperty(n)&&(t=r);return t},i=o(t),a=o(n),u={true:!0,false:!1,null:null},s=function(e){return n[e]||0},p=function(e,r,t){return{type:"||"===e||"&&"===e?"LogicalExpression":"BinaryExpression",operator:e,left:r,right:t}},f=function(e){return e>=48&&e<=57},c=function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=128&&!n[String.fromCharCode(e)]},l=function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e>=128&&!n[String.fromCharCode(e)]},h=function(e){for(var o,h,d=0,v=e.charAt,x=e.charCodeAt,y=function(r){return v.call(e,r)},m=function(r){return x.call(e,r)},g=e.length,b=function(){for(var e=m(d);32===e||9===e||10===e||13===e;)e=m(++d)},E=function(){var e,t,n=w();return b(),63!==m(d)?n:(d++,(e=E())||r("Expected expression",d),b(),58===m(d)?(d++,(t=E())||r("Expected expression",d),{type:"ConditionalExpression",test:n,consequent:e,alternate:t}):void r("Expected :",d))},C=function(){b();for(var r=e.substr(d,a),t=r.length;t>0;){if(n.hasOwnProperty(r)&&(!c(m(d))||d+r.length<e.length&&!l(m(d+r.length))))return d+=t,r;r=r.substr(0,--t)}return!1},w=function(){var e,t,n,o,i,a,u,f;if(a=O(),!(t=C()))return a;for(i={value:t,prec:s(t)},(u=O())||r("Expected expression after "+t,d),o=[a,i,u];(t=C())&&0!==(n=s(t));){for(i={value:t,prec:n};o.length>2&&n<=o[o.length-2].prec;)u=o.pop(),t=o.pop().value,a=o.pop(),e=p(t,a,u),o.push(e);(e=O())||r("Expected expression after "+t,d),o.push(i,e)}for(e=o[f=o.length-1];f>1;)e=p(o[f-1].value,o[f-2],e),f-=2;return e},O=function(){var r,n,o;if(b(),r=m(d),f(r)||46===r)return U();if(39===r||34===r)return k();if(91===r)return S();for(o=(n=e.substr(d,i)).length;o>0;){if(t.hasOwnProperty(n)&&(!c(m(d))||d+n.length<e.length&&!l(m(d+n.length))))return d+=o,{type:"UnaryExpression",operator:n,argument:O(),prefix:!0};n=n.substr(0,--o)}return!(!c(r)&&40!==r)&&A()},U=function(){for(var e,t,n="";f(m(d));)n+=y(d++);if(46===m(d))for(n+=y(d++);f(m(d));)n+=y(d++);if("e"===(e=y(d))||"E"===e){for(n+=y(d++),"+"!==(e=y(d))&&"-"!==e||(n+=y(d++));f(m(d));)n+=y(d++);f(m(d-1))||r("Expected exponent ("+n+y(d)+")",d)}return t=m(d),c(t)?r("Variable names cannot start with a number ("+n+y(d)+")",d):46===t&&r("Unexpected period",d),{type:"Literal",value:parseFloat(n),raw:n}},k=function(){for(var e,t="",n=y(d++),o=!1;d<g;){if((e=y(d++))===n){o=!0;break}if("\\"===e)switch(e=y(d++)){case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+="\t";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=e}else t+=e}return o||r('Unclosed quote after "'+t+'"',d),{type:"Literal",value:t,raw:n+t+n}},L=function(){var t,n=m(d),o=d;for(c(n)?d++:r("Unexpected "+y(d),d);d<g&&(n=m(d),l(n));)d++;return t=e.slice(o,d),u.hasOwnProperty(t)?{type:"Literal",value:u[t],raw:t}:"this"===t?{type:"ThisExpression"}:{type:"Identifier",name:t}},j=function(e){for(var t,n,o=[],i=!1;d<g;){if(b(),(t=m(d))===e){i=!0,d++;break}44===t?d++:((n=E())&&"Compound"!==n.type||r("Expected comma",d),o.push(n))}return i||r("Expected "+String.fromCharCode(e),d),o},A=function(){var e,t;for(t=40===(e=m(d))?P():L(),b(),e=m(d);46===e||91===e||40===e;)d++,46===e?(b(),t={type:"MemberExpression",computed:!1,object:t,property:L()}):91===e?(t={type:"MemberExpression",computed:!0,object:t,property:E()},b(),93!==(e=m(d))&&r("Unclosed [",d),d++):40===e&&(t={type:"CallExpression",arguments:j(41),callee:t}),b(),e=m(d);return t},P=function(){d++;var e=E();if(b(),41===m(d))return d++,e;r("Unclosed (",d)},S=function(){return d++,{type:"ArrayExpression",elements:j(93)}},B=[];d<g;)59===(o=m(d))||44===o?d++:(h=E())?B.push(h):d<g&&r('Unexpected "'+y(d)+'"',d);return 1===B.length?B[0]:{type:"Compound",body:B}};if(h.version="0.3.4",h.toString=function(){return"JavaScript Expression Parser (JSEP) v"+h.version},h.addUnaryOp=function(e){return i=Math.max(e.length,i),t[e]=!0,this},h.addBinaryOp=function(e,r){return a=Math.max(e.length,a),n[e]=r,this},h.addLiteral=function(e,r){return u[e]=r,this},h.removeUnaryOp=function(e){return delete t[e],e.length===i&&(i=o(t)),this},h.removeAllUnaryOps=function(){return t={},i=0,this},h.removeBinaryOp=function(e){return delete n[e],e.length===a&&(a=o(n)),this},h.removeAllBinaryOps=function(){return n={},a=0,this},h.removeLiteral=function(e){return delete u[e],this},h.removeAllLiterals=function(){return u={},this},"undefined"==typeof exports){var d=e.jsep;e.jsep=h,h.noConflict=function(){return e.jsep===h&&(e.jsep=d),h}}else"undefined"!=typeof module&&module.exports?exports=module.exports=h:exports.parse=h}(this);
|
||
|
||
},{}],11:[function(require,module,exports){
|
||
"use strict";var utils=require("./utils");module.exports=function(e){function t(t,n,s){s=s||{};var a=utils.parseCSS(n),o=[],i="style";if(s.styleAttributeName&&(i=s.styleAttributeName),a.forEach(function(n){for(var a,l=n[0],u=n[1],p=new utils.Selector(l),c=p.parsed(),f=function(e){if(0===e.length)return;var t=e[e.length-1].pseudos;if(!t)return;for(var n=0;n<t.length;n++)if(r(t[n]))return t[n].name}(c),d=0;d<c.length;++d){var v=c[d];if(v.pseudos)for(var m=0;m<v.pseudos.length;++m){var y=v.pseudos[m];if(e.ignoredPseudos.indexOf(y.name)>=0)return}}if(f){var h=c[c.length-1],g=h.pseudos;h.pseudos=function(e){return e.filter(function(e){return!r(e)})}(h.pseudos),l=c.toString(),h.pseudos=g}try{a=t(l)}catch(e){return}a.each(function(){var r=this;if(!(r.name&&e.nonVisualElements.indexOf(r.name.toUpperCase())>=0)){if(f){var n="pseudo"+f,a=r[n];a||((a=r[n]=t("<span />").get(0)).pseudoElementType=f,a.pseudoElementParent=r,r[n]=a),r=a}if(!r.styleProps){if(r.styleProps={},t(r).attr(i)){var l="* { "+t(r).attr(i)+" } ";c(utils.parseCSS(l)[0][1],new utils.Selector("<style>",!0))}o.push(r)}c(u,p)}function c(t,n){for(var a=0,o=t.length;a<o;a++)if("property"==t[a].type){var i=t[a].name,l=t[a].value,u=null!==t[a].value.match(/!important$/);u&&!s.preserveImportant&&(l=l.replace(/\s*!important$/,""));var p=[t[a].position.start.line,t[a].position.start.col],c=new utils.Property(i,l,n,u?2:0,p),f=r.styleProps[i];e.excludedProperties.indexOf(i)<0&&(f&&f.compare(c)===c||!f)&&(f&&f.selector!==n?delete r.styleProps[i]:f&&(c.nextProp=f),r.styleProps[i]=c)}}})}),o.forEach(function(e){Object.keys(e.styleProps).length;var r=[];Object.keys(e.styleProps).forEach(function(t){for(var n=e.styleProps[t];void 0!==n;)r.push(n),n=n.nextProp}),r.sort(function(e,t){return e.compareFunc(t)});var n=r.filter(function(e){return"content"!==e.prop}).map(function(e){return e.prop+": "+e.value.replace(/["]/g,"'")+";"}).join(" ");n&&t(e).attr(i,n)}),s.inlinePseudoElements&&o.forEach(function(e){if(e.pseudoElementType&&e.styleProps.content){var r=function(e){if("none"===e||"normal"===e)return"";var t=e.match(/^\s*url\s*\(\s*(.*?)\s*\)\s*$/i);if(t){var r=t[1].replace(/^['"]|['"]$/g,"");return{img:r}}return e=(e=e.slice(1,e.length-1)).replace(/\\/g,"")}(e.styleProps.content.value);r.img?(e.name="img",t(e).attr("src",r.img)):t(e).text(r);var n=e.pseudoElementParent;"before"===e.pseudoElementType?t(n).prepend(e):t(n).append(e)}}),s.applyWidthAttributes&&o.forEach(function(e){p(e,"width")}),s.applyHeightAttributes&&o.forEach(function(e){p(e,"height")}),s.applyAttributesTableElements&&o.forEach(function(r){if(!r.name)return;var n=r.name.toUpperCase(),s=Object.keys(e.styleToAttribute);if(e.tableElements.indexOf(n)>-1)for(var a in r.styleProps)if(s.indexOf(r.styleProps[a].prop)>-1){var o=e.styleToAttribute[r.styleProps[a].prop],i=r.styleProps[a].value;if("background"===o&&(i=c(i)),/(linear|radial)-gradient\(/i.test(i))continue;t(r).attr(o,i)}}),s.insertPreservedExtraCss&&s.extraCss){var l=utils.getPreservedText(s.extraCss,{mediaQueries:s.preserveMediaQueries,fontFaces:s.preserveFontFaces,keyFrames:s.preserveKeyFrames});if(l){var u=null;!0!==s.insertPreservedExtraCss?u=t(s.insertPreservedExtraCss):((u=t("head")).length||(u=t("body")),u.length||(u=t.root())),u.first().append("<style>"+l+"</style>")}}function p(r,n){if(r.name){var s=r.name.toUpperCase();if(e[n+"Elements"].indexOf(s)>-1)for(var a in r.styleProps)if(r.styleProps[a].prop===n){if(r.styleProps[a].value.match(/px/)){var o=r.styleProps[a].value.replace("px","");return void t(r).attr(n,o)}if(e.tableElements.indexOf(s)>-1&&r.styleProps[a].value.match(/\%/))return void t(r).attr(n,r.styleProps[a].value)}}}function c(e){return 0!==e.indexOf("url(")?e:e.replace(/^url\((["'])?([^"']+)\1\)$/,"$2")}}function r(e){return"before"===e.name||"after"===e.name}return e.ignoredPseudos=["hover","active","focus","visited","link"],e.widthElements=["TABLE","TD","TH","IMG"],e.heightElements=["TABLE","TD","TH","IMG"],e.tableElements=["TABLE","TH","TR","TD","CAPTION","COLGROUP","COL","THEAD","TBODY","TFOOT"],e.nonVisualElements=["HEAD","TITLE","BASE","LINK","STYLE","META","SCRIPT","NOSCRIPT"],e.styleToAttribute={"background-color":"bgcolor","background-image":"background","text-align":"align","vertical-align":"valign"},e.excludedProperties=[],e.juiceDocument=function(r,n){n=utils.getDefaultOptions(n);var s=function(t,r){return function(t,r){var n,s,a,o=[];return t("style").each(function(){if(1===(n=(a=this).childNodes).length){if(s=n[0].data,r.applyStyleTags&&void 0===t(a).attr("data-embed")&&o.push(s),r.removeStyleTags&&void 0===t(a).attr("data-embed")){var i=utils.getPreservedText(a.childNodes[0].nodeValue,{mediaQueries:r.preserveMediaQueries,fontFaces:r.preserveFontFaces,keyFrames:r.preserveKeyFrames,pseudos:e.ignoredPseudos});i?a.childNodes[0].nodeValue=i:t(a).remove()}t(a).removeAttr("data-embed")}}),o}(t,r).join("\n")}(r,n);return s+="\n"+n.extraCss,t(r,s,n),r},e.inlineDocument=t,e};
|
||
|
||
},{"./utils":14}],12:[function(require,module,exports){
|
||
"use strict";module.exports=exports=Property;var utils=require("./utils");function Property(t,r,i,p,o){this.prop=t,this.value=r,this.selector=i,this.priority=p||0,this.additionalPriority=o||[]}Property.prototype.compareFunc=function(t){var r=[];r.push.apply(r,this.selector.specificity()),r.push.apply(r,this.additionalPriority),r[0]+=this.priority;var i=[];return i.push.apply(i,t.selector.specificity()),i.push.apply(i,t.additionalPriority),i[0]+=t.priority,utils.compareFunc(r,i)},Property.prototype.compare=function(t){return 1===this.compareFunc(t)?this:t},Property.prototype.toString=function(){return this.prop+": "+this.value.replace(/['"]+/g,"")+";"};
|
||
|
||
},{"./utils":14}],13:[function(require,module,exports){
|
||
"use strict";var parser=require("slick/parser");function Selector(t,e){this.text=t,this.spec=void 0,this.styleAttribute=e||!1}function parse(t){try{return parser(t)[0]}catch(t){return[]}}module.exports=exports=Selector,Selector.prototype.parsed=function(){return this.tokens||(this.tokens=parse(this.text)),this.tokens},Selector.prototype.specificity=function(){var t=this.styleAttribute;return this.spec||(this.spec=function e(r,s){var i=s||parse(r);var a=[t?1:0,0,0,0];var n=[];for(var o=0;o<i.length;o++){var c=i[o],h=c.pseudos;if(c.id&&a[1]++,c.attributes&&(a[2]+=c.attributes.length),c.classList&&(a[2]+=c.classList.length),c.tag&&"*"!==c.tag&&a[3]++,h){a[3]+=h.length;for(var p=0;p<h.length;p++)"not"===h[p].name&&(n.push(h[p].value),a[3]--)}}for(var u=n.length;u--;)for(var l=e(n[u]),v=4;v--;)a[v]+=l[v];return a}(this.text,this.parsed())),this.spec};
|
||
|
||
},{"slick/parser":23}],14:[function(require,module,exports){
|
||
"use strict";var mensch=require("mensch"),own={}.hasOwnProperty,Selector=require("./selector"),Property=require("./property");exports.Selector=Selector,exports.Property=Property,exports.extract=function(e){for(var t=0,r=[],s="",n=0,o=e.length;n<o;n++){var p=e.charAt(n);t?("]"!==p&&")"!==p||t--,s+=p):","===p?(r.push(s),s=""):("["!==p&&"("!==p||t++,(s.length||","!==p&&"\n"!==p&&" "!==p)&&(s+=p))}return s.length&&r.push(s),r},exports.parseCSS=function(e){for(var t=mensch.parse(e,{position:!0,comments:!0}),r=void 0!==t.stylesheet&&t.stylesheet.rules?t.stylesheet.rules:[],s=[],n=0,o=r.length;n<o;n++)if("rule"==r[n].type)for(var p=r[n],i=p.selectors,u=0,a=i.length;u<a;u++)s.push([i[u],p.declarations]);return s},exports.getPreservedText=function(e,t){for(var r=mensch.parse(e,{position:!0,comments:!0}),s=void 0!==r.stylesheet&&r.stylesheet.rules?r.stylesheet.rules:[],n=[],o=s.length-1;o>=0;o--)(t.fontFaces&&"font-face"===s[o].type||t.mediaQueries&&"media"===s[o].type||t.keyFrames&&"keyframes"===s[o].type||t.pseudos&&s[o].selectors&&this.matchesPseudo(s[o].selectors[0],t.pseudos))&&n.unshift(mensch.stringify({stylesheet:{rules:[s[o]]}},{comments:!1,indentation:" "})),s[o].position.start;return 0!==n.length&&"\n"+n.join("\n")+"\n"},exports.normalizeLineEndings=function(e){return e.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n")},exports.matchesPseudo=function(e,t){return t.find(function(t){return e.indexOf(t)>-1})},exports.compareFunc=function(e,t){for(var r=Math.min(e.length,t.length),s=0;s<r;s++)if(e[s]!==t[s])return e[s]>t[s]?1:-1;return e.length-t.length},exports.compare=function(e,t){return 1==exports.compareFunc(e,t)?e:t},exports.extend=function(e,t){for(var r in t)own.call(t,r)&&(e[r]=t[r]);return e},exports.getDefaultOptions=function(e){var t=exports.extend({extraCss:"",insertPreservedExtraCss:!0,applyStyleTags:!0,removeStyleTags:!0,preserveMediaQueries:!0,preserveFontFaces:!0,preserveKeyFrames:!0,preservePseudos:!0,applyWidthAttributes:!0,applyHeightAttributes:!0,applyAttributesTableElements:!0,url:""},e);return t.webResources=t.webResources||{},t};
|
||
|
||
},{"./property":12,"./selector":13,"mensch":17}],15:[function(require,module,exports){
|
||
(function (global){
|
||
!function(e){if("function"==typeof define&&define.amd)define(["knockout","jquery","jquery-ui/ui/widgets/sortable","jquery-ui/ui/widgets/draggable","jquery-ui/ui/widgets/droppable"],e);else if("function"==typeof require&&"object"==typeof exports&&"object"==typeof module){var n="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,t="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null;"undefined"!=typeof window?window.jQuery.ui.sortable:"undefined"!=typeof global&&global.jQuery.ui.sortable,"undefined"!=typeof window?window.jQuery.ui.draggable:"undefined"!=typeof global&&global.jQuery.ui.draggable,"undefined"!=typeof window?window.jQuery.ui.droppable:"undefined"!=typeof global&&global.jQuery.ui.droppable,e(n,t)}else e(window.ko,window.jQuery)}(function(e,n){var t="ko_sortItem",o=e.utils.unwrapObservable,i=e.utils.domData.get,a=e.utils.domData.set,d=n.ui&&n.ui.version,r=d&&d.indexOf("1.6.")&&d.indexOf("1.7.")&&(d.indexOf("1.8.")||"1.8.24"===d),s=function(n,o){e.utils.arrayForEach(n,function(e){1===e.nodeType&&(a(e,t,o),a(e,"ko_parentList",i(e.parentNode,"ko_sortList")))})},l=function(n,t){var i,a={},d=o(n())||{};return d.data?(a[t]=d.data,a.name=d.template):a[t]=n(),e.utils.arrayForEach(["afterAdd","afterRender","as","beforeRemove","includeDestroyed","templateEngine","templateOptions","nodes"],function(n){d.hasOwnProperty(n)?a[n]=d[n]:e.bindingHandlers.sortable.hasOwnProperty(n)&&(a[n]=e.bindingHandlers.sortable[n])}),"foreach"===t&&(a.afterRender?(i=a.afterRender,a.afterRender=function(e,n){s.call(n,e,n),i.call(n,e,n)}):a.afterRender=s),a},u=function(e,n){var t=o(n);if(t)for(var i=0;i<e;i++)t[i]&&o(t[i]._destroy)&&e++;return e};e.bindingHandlers.sortable={init:function(d,s,c,p,f){var b,g,m=n(d),v=o(s())||{},y=l(s,"foreach"),h={};!function(t,o){var i,a;o?(a=document.getElementById(o))&&(i=new e.templateSources.domElement(a)).text(n.trim(i.text())):n(t).contents().each(function(){this&&1!==this.nodeType&&t.removeChild(this)})}(d,y.name),n.extend(!0,h,e.bindingHandlers.sortable),v.options&&h.options&&(e.utils.extend(h.options,v.options),delete v.options),e.utils.extend(h,v),h.connectClass&&(e.isObservable(h.allowDrop)||"function"==typeof h.allowDrop)?e.computed({read:function(){var n=o(h.allowDrop),t="function"==typeof n?n.call(this,y.foreach):n;e.utils.toggleDomNodeCssClass(d,h.connectClass,t)},disposeWhenNodeIsRemoved:d},this):e.utils.toggleDomNodeCssClass(d,h.connectClass,h.allowDrop),e.bindingHandlers.template.init(d,function(){return y},c,p,f),b=h.options.start,g=h.options.update,h.options.helper||(h.options.helper=function(e,t){return t.is("tr")&&t.children().each(function(){n(this).width(n(this).width())}),t});var w=setTimeout(function(){var s,l=h.options.receive;m.sortable(e.utils.extend(h.options,{start:function(n,t){var o=t.item[0];a(o,"ko_sourceIndex",e.utils.arrayIndexOf(t.item.parent().children(),o)),t.item.find("input:focus").change(),b&&b.apply(this,arguments)},receive:function(e,n){"function"==typeof l&&l.call(this,e,n),(s=i(n.item[0],"ko_dragItem"))&&(s.clone&&(s=s.clone()),h.dragged&&(s=h.dragged.call(this,s,e,n)||s))},update:function(d,l){var c,p,f,b,m,v=l.item[0],w=l.item.parent()[0],D=i(v,t)||s;if(D||n(v).remove(),s=null,D&&this===w||!r&&n.contains(this,w)){if(c=i(v,"ko_parentList"),f=i(v,"ko_sourceIndex"),p=i(v.parentNode,"ko_sortList"),b=e.utils.arrayIndexOf(l.item.parent().children(),v),y.includeDestroyed||(f=u(f,c),b=u(b,p)),(h.beforeMove||h.afterMove)&&(m={item:D,sourceParent:c,sourceParentNode:c&&l.sender||v.parentNode,sourceIndex:f,targetParent:p,targetIndex:b,cancelDrop:!1},h.beforeMove&&h.beforeMove.call(this,m,d,l)),c?n(c===p?this:l.sender||this).sortable("cancel"):n(v).remove(),m&&m.cancelDrop)return;if(h.hasOwnProperty("strategyMove")&&!1!==h.strategyMove){if(b>=0)if(c)if(c!==p)c.splice(f,1),p.splice(b,0,D),a(v,t,null),l.item.remove();else{var k=o(c);c.valueWillMutate&&c.valueWillMutate(),k.splice(f,1),k.splice(b,0,D),c.valueHasMutated&&c.valueHasMutated()}else p.splice(b,0,D),a(v,t,null),l.item.remove()}else b>=0&&(c&&(c.splice(f,1),e.processAllDeferredBindingUpdates&&e.processAllDeferredBindingUpdates(),e.options&&e.options.deferUpdates&&e.tasks.runEarly()),p.splice(b,0,D)),a(v,t,null);e.processAllDeferredBindingUpdates&&e.processAllDeferredBindingUpdates(),h.afterMove&&h.afterMove.call(this,m,d,l)}g&&g.apply(this,arguments)},connectWith:!!h.connectClass&&"."+h.connectClass})),void 0!==h.isEnabled&&e.computed({read:function(){m.sortable(o(h.isEnabled)?"enable":"disable")},disposeWhenNodeIsRemoved:d})},0);return e.utils.domNodeDisposal.addDisposeCallback(d,function(){(m.data("ui-sortable")||m.data("sortable"))&&m.sortable("destroy"),e.utils.toggleDomNodeCssClass(d,h.connectClass,!1),clearTimeout(w)}),{controlsDescendantBindings:!0}},update:function(n,t,o,i,d){var r=l(t,"foreach");a(n,"ko_sortList",r.foreach),e.bindingHandlers.template.update(n,function(){return r},o,i,d)},connectClass:"ko_container",allowDrop:!0,afterMove:null,beforeMove:null,options:{}},e.bindingHandlers.draggable={init:function(t,i,d,r,s){var u=o(i())||{},c=u.options||{},p=e.utils.extend({},e.bindingHandlers.draggable.options),f=l(i,"data"),b=u.connectClass||e.bindingHandlers.draggable.connectClass,g=void 0!==u.isEnabled?u.isEnabled:e.bindingHandlers.draggable.isEnabled;return u="data"in u?u.data:u,a(t,"ko_dragItem",u),e.utils.extend(p,c),p.connectToSortable=!!b&&"."+b,n(t).draggable(p),void 0!==g&&e.computed({read:function(){n(t).draggable(o(g)?"enable":"disable")},disposeWhenNodeIsRemoved:t}),e.utils.domNodeDisposal.addDisposeCallback(t,function(){n(t).draggable("destroy")}),e.bindingHandlers.template.init(t,function(){return f},d,r,s)},update:function(n,t,o,i,a){var d=l(t,"data");return e.bindingHandlers.template.update(n,function(){return d},o,i,a)},connectClass:e.bindingHandlers.sortable.connectClass,options:{helper:"clone"}},e.bindingHandlers.droppable={init:function(a,d,r,s,l){var u=o(d())||{},c=u.options||{},p=e.utils.extend({},e.bindingHandlers.droppable.options),f=void 0!==u.isEnabled?u.isEnabled:e.bindingHandlers.droppable.isEnabled;e.utils.extend(p,c),u="data"in u?u.data:d(),p.drop=function(e,n){var o=i(n.draggable[0],"ko_dragItem")||i(n.draggable[0],t);u(o)},n(a).droppable(p),void 0!==f&&e.computed({read:function(){n(a).droppable(o(f)?"enable":"disable")},disposeWhenNodeIsRemoved:a}),e.utils.domNodeDisposal.addDisposeCallback(a,function(){n(a).droppable("destroy")})},options:{accept:"*"}}});
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{}],16:[function(require,module,exports){
|
||
(function (global){
|
||
!function(e){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?e("undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null):"function"==typeof define&&define.amd?define(["knockout"],e):e(window.ko)}(function(e){e.subscribable.fn.watch=function(t,a,n,o){var r=typeof t;return"boolean"===r||"undefined"===r?e.watch(this,{enabled:!1!==t}):"function"!==r||e.isSubscribable(t)?e.watch(t,a,n,o||this):e.watch(this,a||{},t,o||this),this},e.watch=function(t,a,n,o){function r(l,c,f,u,s,b){if(l&&0!==a.depth&&(-1===a.depth||f.length<(a.depth||1))){if(a.watchedOnly&&!l.watchable&&l!=t)return;if(!1!==a.enabled&&!0!==a.enabled||(l.watchable=a.enabled),!1===l.watchable)return;!0===a.seal&&(l.watchable=!1);var d=typeof l;if("object"===d||"function"===d){if(l._watcher===o)return;if(a.hide&&e.utils.arrayIndexOf(a.hide,l)>-1)return;var h=[].concat(f,c&&c!==t?c:[]);if("function"!==d){if("[object Object]"===Object.prototype.toString.call(l))e.utils.objectForEach(l,function(t,n){if(n=a.getter?a.getter.call(o,h,l,t):n){if(a.wrap){var i=Object.prototype.toString.call(n);"[object Function]"!==i&&"[object Object]"!==i&&(a.beforeWrap&&!1===a.beforeWrap.call(o,h,l,n)||(n=l[t]="[object Array]"===i?e.observableArray(n):e.observable(n)))}a.unloop&&(n._watcher=u?void 0:o);var c=r(n,s?null:l,h,u,null,t);a.tagFields&&void 0===n._fieldName&&(c||"parentsOnly"!==a.tagFields&&"function"==typeof n||"object"==typeof n)&&(n._fieldName=t)}});else if(!0!==a.hideArrays)for(var p=0;p<l.length;p++)r(l[p],s?null:l,h,u);return!0}if("function"==typeof l.notifySubscribers&&n){if(!0===a.enabled&&!1===l.watchable)return;if(u||!a.beforeWatch||!1!==a.beforeWatch.call(o,h,l,b)){var y="function"==typeof l.pop;if(u?i(l):function(t,i,l,c){i?t.subscribe(function(i){var f;!1===a.splitArrayChanges&&void 0!==(f=n.call(o,l,t,i))&&o(f),e.utils.arrayForEach(i,function(e){if(!1!==a.splitArrayChanges){var i=n.call(o,l,t,e);void 0!==i&&o(i)}e.moved||(!1===a.async?r(e.value,c?null:t,l,"deleted"===e.status):setTimeout(function(){r(e.value,c?null:t,l,"deleted"===e.status)}))})},void 0,"arrayChange")._watcher=o:(t.subscribe(function(){if(!1!==t.watchable){var e=n.call(o,l,t);void 0!==e&&o(e),a.mutable&&"object"==typeof t()&&(!1===a.async?r(t(),c?null:t,l,!1,!0):setTimeout(function(){r(t(),c?null:t,l,!1,!0)}))}},null,"change")._watcher=o,(a.oldValues>0||a.mutable)&&(t.subscribe(function(e){if(a.oldValues>0){var n=t.oldValues?t.oldValues:t.oldValues=[];for(n.unshift(e);n.length>a.oldValues;)n.pop()}a.mutable&&"object"==typeof e&&r(e,c?null:t,l,!0,!0)},null,"beforeChange")._watcher=o))}(l,y,h,s),y)return r(l(),s?null:l,h,u,!0),!0;if(!0!==a.hideWrappedValues)return r(l(),s?null:l,h,u,!0)}}}}}function i(e){var t=e[l];if(!t)throw"Subscriptions field (."+l+") not defined for observable child "+(e._fieldName||"");if(t.change)for(n=t.change.length-1;n>=0;n--)t.change[n]._watcher===o&&t.change[n].dispose();if(t.beforeChange&&(a.mutable||a.oldValues>0))for(n=t.beforeChange.length-1;n>=0;n--)t.beforeChange[n]._watcher===o&&t.beforeChange[n].dispose();if(t.arrayChange)for(var n=t.arrayChange.length-1;n>=0;n--)t.arrayChange[n]._watcher===o&&t.arrayChange[n].dispose()}var l;switch("function"==typeof a&&(o=o||n,n=a,a={}),o=o||this,"function"==typeof e.subscription||e.version){case!0:l="_subscriptions";break;case"3.0.0":l="F";break;case"3.1.0":l="H";break;case"3.2.0":l="M";break;case"3.3.0":l="G";break;case"3.4.0":case"3.4.1":l="K";break;case"3.4.2":l="F";break;case"3.5.0-beta":l="S";break;default:throw"Unsupported Knockout version. Only v3.0.0 to v3.5.0-beta are supported when minified. Current version is "+e.version}return"function"!=typeof t||e.isSubscribable(t)?(r(t,null,[]),{dispose:function(){r(t,null,[],!0)}}):e.computed(t,n,a)}}),window.foo="1.4.0";
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{}],17:[function(require,module,exports){
|
||
module.exports={lex:require("./lib/lexer"),parse:require("./lib/parser"),stringify:require("./lib/stringify")};
|
||
|
||
},{"./lib/lexer":19,"./lib/parser":20,"./lib/stringify":21}],18:[function(require,module,exports){
|
||
(function (process){
|
||
function debug(e){return _debug.bind(null,e)}function _debug(e){var n=[].slice.call(arguments,1);n.unshift("["+e+"]"),process.stderr.write(n.join(" ")+"\n")}exports=module.exports=debug;
|
||
|
||
}).call(this,require('_process'))
|
||
|
||
},{"_process":22}],19:[function(require,module,exports){
|
||
var DEBUG=!1,TIMER=!1,debug=require("./debug")("lex");function lex(e){var a,r,s="",t=0,c=-1,n=0,l=1,o="before-selector",u=[o],i={},b=[],f=["media","keyframes",{name:"-webkit-keyframes",type:"keyframes",prefix:"-webkit-"},{name:"-moz-keyframes",type:"keyframes",prefix:"-moz-"},{name:"-ms-keyframes",type:"keyframes",prefix:"-ms-"},{name:"-o-keyframes",type:"keyframes",prefix:"-o-"},"font-face",{name:"import",state:"before-at-value"},{name:"charset",state:"before-at-value"},"supports","viewport",{name:"namespace",state:"before-at-value"},"document",{name:"-moz-document",type:"document",prefix:"-moz-"},"page"];function m(e){return e?u[u.length-1-e]:o}function g(a){var r=c+1;return a===e.slice(r,r+a.length)}function v(a){var r=e.slice(c).indexOf(a);return r>0&&r}function k(e){return e===p(1)}function p(a){return e[c+(a||1)]}function d(){var e=u.pop();return o=u[u.length-1],e}function h(e){return o=e,u.push(o),u.length}function w(e){var a=o;return u[u.length-1]=o=e,a}function y(a){if(1==(a||1))"\n"==e[c]?(l++,t=1):t++,c++;else{var r=e.slice(c,c+a).split("\n");r.length>1&&(l+=r.length-1,t=1),t+=r[r.length-1].length,c+=a}}function x(){i.end={line:l,col:t},DEBUG&&debug("addToken:",JSON.stringify(i,null,2)),b.push(i),s="",i={}}function E(e){i={type:e,start:{line:l,col:t}}}for(TIMER&&(a=Date.now());y(),r=e[c];)switch(DEBUG&&debug(r,m()),r){case" ":switch(m()){case"selector":case"value":case"value-paren":case"at-group":case"at-value":case"comment":case"double-string":case"single-string":s+=r}break;case"\n":case"\t":case"\r":case"\f":switch(m()){case"value":case"value-paren":case"at-group":case"comment":case"single-string":case"double-string":case"selector":s+=r;break;case"at-value":"\n"===r&&(i.value=s.trim(),x(),d())}break;case":":switch(m()){case"name":i.name=s.trim(),s="",w("before-value");break;case"before-selector":s+=r,E("selector"),h("selector");break;case"before-value":w("value"),s+=r;break;default:s+=r}break;case";":switch(m()){case"name":case"before-value":case"value":s.trim().length>0&&(i.value=s.trim(),x()),w("before-name");break;case"value-paren":s+=r;break;case"at-value":i.value=s.trim(),x(),d();break;case"before-name":break;default:s+=r}break;case"{":switch(m()){case"selector":if("\\"===p(-1)){s+=r;break}i.text=s.trim(),x(),w("before-name"),n+=1;break;case"at-group":switch(i.name=s.trim(),i.type){case"font-face":case"viewport":case"page":h("before-name");break;default:h("before-selector")}x(),n+=1;break;case"name":case"at-rule":i.name=s.trim(),x(),h("before-name"),n+=1;break;case"comment":case"double-string":case"single-string":s+=r;break;case"before-value":w("value"),s+=r}break;case"}":switch(m()){case"before-name":case"name":case"before-value":case"value":s&&(i.value=s.trim()),i.name&&i.value&&x(),E("end"),x(),d(),"at-group"===m()&&(E("at-group-end"),x(),d()),n>0&&(n-=1);break;case"at-group":case"before-selector":case"selector":if("\\"===p(-1)){s+=r;break}n>0&&"at-group"===m(1)&&(E("at-group-end"),x()),n>1&&d(),n>0&&(n-=1);break;case"double-string":case"single-string":case"comment":s+=r}break;case'"':case"'":switch(m()){case"double-string":'"'===r&&"\\"!==p(-1)&&d();break;case"single-string":"'"===r&&"\\"!==p(-1)&&d();break;case"before-at-value":w("at-value"),h('"'===r?"double-string":"single-string");break;case"before-value":w("value"),h('"'===r?"double-string":"single-string");break;case"comment":break;default:"\\"!==p(-1)&&h('"'===r?"double-string":"single-string")}s+=r;break;case"/":switch(m()){case"comment":case"double-string":case"single-string":s+=r;break;case"before-value":case"selector":case"name":case"value":if(k("*")){var D=v("*/");D&&y(D+1)}else"before-value"==m()&&w("value"),s+=r;break;default:k("*")?(E("comment"),h("comment"),y()):s+=r}break;case"*":switch(m()){case"comment":k("/")?(i.text=s,y(),x(),d()):s+=r;break;case"before-selector":s+=r,E("selector"),h("selector");break;case"before-value":w("value"),s+=r;break;default:s+=r}break;case"@":switch(m()){case"comment":case"double-string":case"single-string":s+=r;break;case"before-value":w("value"),s+=r;break;default:for(var z,T,B=!1,G=0,I=f.length;!B&&G<I;++G)g(z=(T=f[G]).name||T)&&(B=!0,E(z),h(T.state||"at-group"),y(z.length),T.prefix&&(i.prefix=T.prefix),T.type&&(i.type=T.type));B||(s+=r)}break;case"(":switch(m()){case"value":h("value-paren");break;case"before-value":w("value")}s+=r;break;case")":switch(m()){case"value-paren":d();break;case"before-value":w("value")}s+=r;break;default:switch(m()){case"before-selector":E("selector"),h("selector");break;case"before-name":E("property"),w("name");break;case"before-value":w("value");break;case"before-at-value":w("at-value")}s+=r}return TIMER&&debug("ran in",Date.now()-a+"ms"),b}exports=module.exports=lex;
|
||
|
||
},{"./debug":18}],20:[function(require,module,exports){
|
||
var _comments,_depth,_position,_tokens,DEBUG=!1,TIMER=!1,debug=require("./debug")("parse"),lex=require("./lexer");function parse(e,r){var t,s;r||(r={}),_comments=!!r.comments,_position=!!r.position,_depth=0,_tokens=Array.isArray(e)?e.slice():lex(e);var n,a=[];for(TIMER&&(t=Date.now());n=next();)(s=parseToken(n))&&a.push(s);return TIMER&&debug("ran in",Date.now()-t+"ms"),{type:"stylesheet",stylesheet:{rules:a}}}function astNode(e,r){var t;r||(r={});for(var s=["type","name","value"],n={},a=0;a<s.length;++a)e[t=s[a]]&&(n[t]=r[t]||e[t]);for(s=Object.keys(r),a=0;a<s.length;++a)n[t=s[a]]||(n[t]=r[t]);return _position&&(n.position={start:e.start,end:e.end}),DEBUG&&debug("astNode:",JSON.stringify(n,null,2)),n}function next(){var e=_tokens.shift();return DEBUG&&debug("next:",JSON.stringify(e,null,2)),e}function parseAtGroup(e){_depth+=1;var r={};switch(e.type){case"font-face":case"viewport":r.declarations=parseDeclarations();break;case"page":r.prefix=e.prefix,r.declarations=parseDeclarations();break;default:r.prefix=e.prefix,r.rules=parseRules()}return astNode(e,r)}function parseAtImport(e){return astNode(e)}function parseCharset(e){return astNode(e)}function parseComment(e){return astNode(e,{text:e.text})}function parseNamespace(e){return astNode(e)}function parseProperty(e){return astNode(e)}function parseSelector(e){return astNode(e,{type:"rule",selectors:e.text.split(",").map(function(e){return e.trim()}),declarations:parseDeclarations(e)})}function parseToken(e){switch(e.type){case"property":return parseProperty(e);case"selector":return parseSelector(e);case"at-group-end":return void(_depth-=1);case"media":case"keyframes":return parseAtGroup(e);case"comment":if(_comments)return parseComment(e);break;case"charset":return parseCharset(e);case"import":return parseAtImport(e);case"namespace":return parseNamespace(e);case"font-face":case"supports":case"viewport":case"document":case"page":return parseAtGroup(e)}DEBUG&&debug("parseToken: unexpected token:",JSON.stringify(e))}function parseTokensWhile(e){for(var r,t,s=[];(t=next())&&e&&e(t);)(r=parseToken(t))&&s.push(r);return t&&"end"!==t.type&&_tokens.unshift(t),s}function parseDeclarations(){return parseTokensWhile(function(e){return"property"===e.type||"comment"===e.type})}function parseRules(){return parseTokensWhile(function(){return _depth})}exports=module.exports=parse;
|
||
|
||
},{"./debug":18,"./lexer":19}],21:[function(require,module,exports){
|
||
var _comments,_compress,_indentation,_n,_s,DEBUG=!1,TIMER=!1,debug=require("./debug")("stringify");function stringify(e,n){var t;n||(n={}),_indentation=n.indentation||"",_compress=!!n.compress,_comments=!!n.comments,_compress?_n=_s="":(_n="\n",_s=" "),TIMER&&(t=Date.now());var r=reduce(e.stylesheet.rules,stringifyNode).join("\n").trim();return TIMER&&debug("ran in",Date.now()-t+"ms"),r}function indent(e){if(this.level||(this.level=1),!e)return _compress?"":Array(this.level).join(_indentation||"");this.level+=e}function stringifyAtRule(e){return"@"+e.type+" "+e.value+";"+_n}function stringifyAtGroup(e){var n="",t=e.prefix||"";e.name&&(n=" "+e.name);var r="page"!==e.type;return"@"+t+e.type+n+_s+stringifyBlock(e,r)+_n}function stringifyComment(e){return _comments?"/*"+(e.text||"")+"*/"+_n:""}function stringifyRule(e){var n;return e.selectors?n=e.selectors.join(","+_n):(n="@"+e.type,n+=e.name?" "+e.name:""),indent()+n+_s+stringifyBlock(e)+_n}function reduce(e,n){return e.reduce(function(e,t){var r="comment"===t.type?stringifyComment(t):n(t);return r&&e.push(r),e},[])}function stringifyBlock(e,n){var t=e.declarations,r=stringifyDeclaration;return e.rules&&(t=e.rules,r=stringifyRule),(t=stringifyChildren(t,r))&&(t=_n+t+(n?"":_n)),"{"+t+indent()+"}"}function stringifyChildren(e,n){if(!e)return"";indent(1);var t=reduce(e,n);return indent(-1),t.length?t.join(_n):""}function stringifyDeclaration(e){if("property"===e.type)return stringifyProperty(e);DEBUG&&debug("stringifyDeclaration: unexpected node:",JSON.stringify(e))}function stringifyNode(e){switch(e.type){case"rule":return stringifyRule(e);case"media":case"keyframes":return stringifyAtGroup(e);case"comment":return stringifyComment(e);case"import":case"charset":case"namespace":return stringifyAtRule(e);case"font-face":case"supports":case"viewport":case"document":case"page":return stringifyAtGroup(e)}DEBUG&&debug("stringifyNode: unexpected node: "+JSON.stringify(e))}function stringifyProperty(e){var n=e.name?e.name+":"+_s:"";return indent()+n+e.value+";"}exports=module.exports=stringify;
|
||
|
||
},{"./debug":18}],22:[function(require,module,exports){
|
||
var cachedSetTimeout,cachedClearTimeout,process=module.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};
|
||
|
||
},{}],23:[function(require,module,exports){
|
||
"use strict";var escapeRe=/([-.*+?^${}()|[\]\/\\])/g,unescapeRe=/\\/g,escape=function(e){return(e+"").replace(escapeRe,"\\$1")},unescape=function(e){return(e+"").replace(unescapeRe,"")},slickRe=RegExp("^(?:\\s*(,)\\s*|\\s*(<combinator>+)\\s*|(\\s+)|(<unicode>+|\\*)|\\#(<unicode>+)|\\.(<unicode>+)|\\[\\s*(<unicode1>+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(<unicode>+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(/<combinator>/,"["+escape(">+~`!@$%^&={}\\;</")+"]").replace(/<unicode>/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(/<unicode1>/g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")),Part=function(e){this.combinator=e||" ",this.tag="*"};Part.prototype.toString=function(){if(!this.raw){var e,s,t="";if(t+=this.tag||"*",this.id&&(t+="#"+this.id),this.classes&&(t+="."+this.classList.join(".")),this.attributes)for(e=0;s=this.attributes[e++];)t+="["+s.name+(s.operator?s.operator+'"'+s.value+'"':"")+"]";if(this.pseudos)for(e=0;s=this.pseudos[e++];)t+=":"+s.name,s.value&&(t+="("+s.value+")");this.raw=t}return this.raw};var Expression=function(){this.length=0};Expression.prototype.toString=function(){if(!this.raw){for(var e,s="",t=0;e=this[t++];)1!==t&&(s+=" ")," "!==e.combinator&&(s+=e.combinator+" "),s+=e;this.raw=s}return this.raw};var replacer=function(e,s,t,a,r,i,n,c,u,o,p,l,h,f,g,d){var v,w;if((s||!this.length)&&(v=this[this.length++]=new Expression,s))return"";if(v||(v=this[this.length-1]),(t||a||!v.length)&&(w=v[v.length++]=new Part(t)),w||(w=v[v.length-1]),r)w.tag=unescape(r);else if(i)w.id=unescape(i);else if(n){var m=unescape(n),b=w.classes||(w.classes={});if(!b[m]){b[m]=escape(n);var x=w.classList||(w.classList=[]);x.push(m),x.sort()}}else h?(d=d||g,(w.pseudos||(w.pseudos=[])).push({type:1==l.length?"class":"element",name:unescape(h),escapedName:escape(h),value:d?unescape(d):null,escapedValue:d?escape(d):null})):c&&(p=p?escape(p):null,(w.attributes||(w.attributes=[])).push({operator:u,name:unescape(c),escapedName:escape(c),value:p?unescape(p):null,escapedValue:p?escape(p):null}));return""},Expressions=function(e){this.length=0;for(var s,t=this,a=e;e;){if((s=e.replace(slickRe,function(){return replacer.apply(t,arguments)}))===e)throw new Error(a+" is an invalid expression");e=s}};Expressions.prototype.toString=function(){if(!this.raw){for(var e,s=[],t=0;e=this[t++];)s.push(e);this.raw=s.join(", ")}return this.raw};var cache={},parse=function(e){return null==e?null:(e=(""+e).replace(/^\s+|\s+$/g,""),cache[e]||(cache[e]=new Expressions(e)))};module.exports=parse;
|
||
|
||
},{}],24:[function(require,module,exports){
|
||
!function(t){var e=/^\s+/,r=/\s+$/,n=0,a=t.round,i=t.min,s=t.max,o=t.random;function f(o,h){if(h=h||{},(o=o||"")instanceof f)return o;if(!(this instanceof f))return new f(o,h);var u=function(n){var a={r:0,g:0,b:0},o=1,f=null,h=null,u=null,l=!1,c=!1;"string"==typeof n&&(n=function(t){t=t.replace(e,"").replace(r,"").toLowerCase();var n,a=!1;if(H[t])t=H[t],a=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(n=O.rgb.exec(t))return{r:n[1],g:n[2],b:n[3]};if(n=O.rgba.exec(t))return{r:n[1],g:n[2],b:n[3],a:n[4]};if(n=O.hsl.exec(t))return{h:n[1],s:n[2],l:n[3]};if(n=O.hsla.exec(t))return{h:n[1],s:n[2],l:n[3],a:n[4]};if(n=O.hsv.exec(t))return{h:n[1],s:n[2],v:n[3]};if(n=O.hsva.exec(t))return{h:n[1],s:n[2],v:n[3],a:n[4]};if(n=O.hex8.exec(t))return{r:M(n[1]),g:M(n[2]),b:M(n[3]),a:z(n[4]),format:a?"name":"hex8"};if(n=O.hex6.exec(t))return{r:M(n[1]),g:M(n[2]),b:M(n[3]),format:a?"name":"hex"};if(n=O.hex4.exec(t))return{r:M(n[1]+""+n[1]),g:M(n[2]+""+n[2]),b:M(n[3]+""+n[3]),a:z(n[4]+""+n[4]),format:a?"name":"hex8"};if(n=O.hex3.exec(t))return{r:M(n[1]+""+n[1]),g:M(n[2]+""+n[2]),b:M(n[3]+""+n[3]),format:a?"name":"hex"};return!1}(n));"object"==typeof n&&(P(n.r)&&P(n.g)&&P(n.b)?(g=n.r,b=n.g,d=n.b,a={r:255*C(g,255),g:255*C(b,255),b:255*C(d,255)},l=!0,c="%"===String(n.r).substr(-1)?"prgb":"rgb"):P(n.h)&&P(n.s)&&P(n.v)?(f=L(n.s),h=L(n.v),a=function(e,r,n){e=6*C(e,360),r=C(r,100),n=C(n,100);var a=t.floor(e),i=e-a,s=n*(1-r),o=n*(1-i*r),f=n*(1-(1-i)*r),h=a%6;return{r:255*[n,o,s,s,f,n][h],g:255*[f,n,n,o,s,s][h],b:255*[s,s,f,n,n,o][h]}}(n.h,f,h),l=!0,c="hsv"):P(n.h)&&P(n.s)&&P(n.l)&&(f=L(n.s),u=L(n.l),a=function(t,e,r){var n,a,i;function s(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=C(t,360),e=C(e,100),r=C(r,100),0===e)n=a=i=r;else{var o=r<.5?r*(1+e):r+e-r*e,f=2*r-o;n=s(f,o,t+1/3),a=s(f,o,t),i=s(f,o,t-1/3)}return{r:255*n,g:255*a,b:255*i}}(n.h,f,u),l=!0,c="hsl"),n.hasOwnProperty("a")&&(o=n.a));var g,b,d;return o=F(o),{ok:l,format:n.format||c,r:i(255,s(a.r,0)),g:i(255,s(a.g,0)),b:i(255,s(a.b,0)),a:o}}(o);this._originalInput=o,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=h.format||u.format,this._gradientType=h.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=n++}function h(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,a,o=s(t,e,r),f=i(t,e,r),h=(o+f)/2;if(o==f)n=a=0;else{var u=o-f;switch(a=h>.5?u/(2-o-f):u/(o+f),o){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:a,l:h}}function u(t,e,r){t=C(t,255),e=C(e,255),r=C(r,255);var n,a,o=s(t,e,r),f=i(t,e,r),h=o,u=o-f;if(a=0===o?0:u/o,o==f)n=0;else{switch(o){case t:n=(e-r)/u+(e<r?6:0);break;case e:n=(r-t)/u+2;break;case r:n=(t-e)/u+4}n/=6}return{h:n,s:a,v:h}}function l(t,e,r,n){var i=[I(a(t).toString(16)),I(a(e).toString(16)),I(a(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function c(t,e,r,n){return[I(N(n)),I(a(t).toString(16)),I(a(e).toString(16)),I(a(r).toString(16))].join("")}function g(t,e){e=0===e?0:e||10;var r=f(t).toHsl();return r.s-=e/100,r.s=q(r.s),f(r)}function b(t,e){e=0===e?0:e||10;var r=f(t).toHsl();return r.s+=e/100,r.s=q(r.s),f(r)}function d(t){return f(t).desaturate(100)}function _(t,e){e=0===e?0:e||10;var r=f(t).toHsl();return r.l+=e/100,r.l=q(r.l),f(r)}function p(t,e){e=0===e?0:e||10;var r=f(t).toRgb();return r.r=s(0,i(255,r.r-a(-e/100*255))),r.g=s(0,i(255,r.g-a(-e/100*255))),r.b=s(0,i(255,r.b-a(-e/100*255))),f(r)}function m(t,e){e=0===e?0:e||10;var r=f(t).toHsl();return r.l-=e/100,r.l=q(r.l),f(r)}function v(t,e){var r=f(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,f(r)}function y(t){var e=f(t).toHsl();return e.h=(e.h+180)%360,f(e)}function A(t){var e=f(t).toHsl(),r=e.h;return[f(t),f({h:(r+120)%360,s:e.s,l:e.l}),f({h:(r+240)%360,s:e.s,l:e.l})]}function x(t){var e=f(t).toHsl(),r=e.h;return[f(t),f({h:(r+90)%360,s:e.s,l:e.l}),f({h:(r+180)%360,s:e.s,l:e.l}),f({h:(r+270)%360,s:e.s,l:e.l})]}function k(t){var e=f(t).toHsl(),r=e.h;return[f(t),f({h:(r+72)%360,s:e.s,l:e.l}),f({h:(r+216)%360,s:e.s,l:e.l})]}function w(t,e,r){e=e||6,r=r||30;var n=f(t).toHsl(),a=360/r,i=[f(t)];for(n.h=(n.h-(a*e>>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(f(n));return i}function S(t,e){e=e||6;for(var r=f(t).toHsv(),n=r.h,a=r.s,i=r.v,s=[],o=1/e;e--;)s.push(f({h:n,s:a,v:i})),i=(i+o)%1;return s}f.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var e,r,n,a=this.toRgb();return e=a.r/255,r=a.g/255,n=a.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=F(t),this._roundA=a(100*this._a)/100,this},toHsv:function(){var t=u(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=u(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=h(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=h(this._r,this._g,this._b),e=a(360*t.h),r=a(100*t.s),n=a(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return l(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var s=[I(a(t).toString(16)),I(a(e).toString(16)),I(a(r).toString(16)),I(N(n))];if(i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1))return s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0);return s.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*C(this._r,255))+"%",g:a(100*C(this._g,255))+"%",b:a(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%)":"rgba("+a(100*C(this._r,255))+"%, "+a(100*C(this._g,255))+"%, "+a(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(R[l(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+c(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var a=f(t);r="#"+c(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return f(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(_,arguments)},brighten:function(){return this._applyModification(p,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(d,arguments)},spin:function(){return this._applyModification(v,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(w,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(S,arguments)},splitcomplement:function(){return this._applyCombination(k,arguments)},triad:function(){return this._applyCombination(A,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},f.fromRatio=function(t,e){if("object"==typeof t){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:L(t[n]));t=r}return f(t,e)},f.equals=function(t,e){return!(!t||!e)&&f(t).toRgbString()==f(e).toRgbString()},f.random=function(){return f.fromRatio({r:o(),g:o(),b:o()})},f.mix=function(t,e,r){r=0===r?0:r||50;var n=f(t).toRgb(),a=f(e).toRgb(),i=r/100;return f({r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a})},f.readability=function(e,r){var n=f(e),a=f(r);return(t.max(n.getLuminance(),a.getLuminance())+.05)/(t.min(n.getLuminance(),a.getLuminance())+.05)},f.isReadable=function(t,e,r){var n,a,i=f.readability(t,e);switch(a=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},f.mostReadable=function(t,e,r){var n,a,i,s,o=null,h=0;a=(r=r||{}).includeFallbackColors,i=r.level,s=r.size;for(var u=0;u<e.length;u++)(n=f.readability(t,e[u]))>h&&(h=n,o=f(e[u]));return f.isReadable(t,o,{level:i,size:s})||!a?o:(r.includeFallbackColors=!1,f.mostReadable(t,["#fff","#000"],r))};var H=f.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},R=f.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(H);function F(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function C(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=i(r,s(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function q(t){return i(1,s(0,t))}function M(t){return parseInt(t,16)}function I(t){return 1==t.length?"0"+t:""+t}function L(t){return t<=1&&(t=100*t+"%"),t}function N(e){return t.round(255*parseFloat(e)).toString(16)}function z(t){return M(t)/255}var E,T,j,O=(T="[\\s|\\(]+("+(E="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+E+")[,|\\s]+("+E+")\\s*\\)?",j="[\\s|\\(]+("+E+")[,|\\s]+("+E+")[,|\\s]+("+E+")[,|\\s]+("+E+")\\s*\\)?",{CSS_UNIT:new RegExp(E),rgb:new RegExp("rgb"+T),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+T),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+T),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function P(t){return!!O.CSS_UNIT.exec(t)}"undefined"!=typeof module&&module.exports?module.exports=f:"function"==typeof define&&define.amd?define(function(){return f}):window.tinycolor=f}(Math);
|
||
|
||
},{}],25:[function(require,module,exports){
|
||
(function (global){
|
||
!function(e){e(["jquery"],function(e){return function(){var t,n,o,s=0,i={error:"error",info:"info",success:"success",warning:"warning"},a={clear:function(n,o){var s=u();t||r(s);l(n,s,o)||function(n){for(var o=t.children(),s=o.length-1;s>=0;s--)l(e(o[s]),n)}(s)},remove:function(n){var o=u();t||r(o);if(n&&0===e(":focus",n).length)return void p(n);t.children().length&&t.remove()},error:function(e,t,n){return d({type:i.error,iconClass:u().iconClasses.error,message:e,optionsOverride:n,title:t})},getContainer:r,info:function(e,t,n){return d({type:i.info,iconClass:u().iconClasses.info,message:e,optionsOverride:n,title:t})},options:{},subscribe:function(e){n=e},success:function(e,t,n){return d({type:i.success,iconClass:u().iconClasses.success,message:e,optionsOverride:n,title:t})},version:"2.1.4",warning:function(e,t,n){return d({type:i.warning,iconClass:u().iconClasses.warning,message:e,optionsOverride:n,title:t})}};return a;function r(n,o){return n||(n=u()),(t=e("#"+n.containerId)).length?t:(o&&(t=function(n){return(t=e("<div/>").attr("id",n.containerId).addClass(n.positionClass)).appendTo(e(n.target)),t}(n)),t)}function l(t,n,o){var s=!(!o||!o.force)&&o.force;return!(!t||!s&&0!==e(":focus",t).length)&&(t[n.hideMethod]({duration:n.hideDuration,easing:n.hideEasing,complete:function(){p(t)}}),!0)}function c(e){n&&n(e)}function d(n){var i=u(),a=n.iconClass||i.iconClass;if(void 0!==n.optionsOverride&&(i=e.extend(i,n.optionsOverride),a=n.optionsOverride.iconClass||a),!function(e,t){if(e.preventDuplicates){if(t.message===o)return!0;o=t.message}return!1}(i,n)){s++,t=r(i,!0);var l=null,d=e("<div/>"),f=e("<div/>"),g=e("<div/>"),m=e("<div/>"),h=e(i.closeHtml),v={intervalId:null,hideEta:null,maxHideTime:null},C={toastId:s,state:"visible",startTime:new Date,options:i,map:n};return n.iconClass&&d.addClass(i.toastClass).addClass(a),function(){if(n.title){var e=n.title;i.escapeHtml&&(e=w(n.title)),f.append(e).addClass(i.titleClass),d.append(f)}}(),function(){if(n.message){var e=n.message;i.escapeHtml&&(e=w(n.message)),g.append(e).addClass(i.messageClass),d.append(g)}}(),i.closeButton&&(h.addClass(i.closeClass).attr("role","button"),d.prepend(h)),i.progressBar&&(m.addClass(i.progressClass),d.prepend(m)),i.rtl&&d.addClass("rtl"),i.newestOnTop?t.prepend(d):t.append(d),function(){var e="";switch(n.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}d.attr("aria-live",e)}(),d.hide(),d[i.showMethod]({duration:i.showDuration,easing:i.showEasing,complete:i.onShown}),i.timeOut>0&&(l=setTimeout(T,i.timeOut),v.maxHideTime=parseFloat(i.timeOut),v.hideEta=(new Date).getTime()+v.maxHideTime,i.progressBar&&(v.intervalId=setInterval(D,10))),function(){i.closeOnHover&&d.hover(O,b);!i.onclick&&i.tapToDismiss&&d.click(T);i.closeButton&&h&&h.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&!0!==e.cancelBubble&&(e.cancelBubble=!0),i.onCloseClick&&i.onCloseClick(e),T(!0)});i.onclick&&d.click(function(e){i.onclick(e),T()})}(),c(C),i.debug&&console&&console.log(C),d}function w(e){return null==e&&(e=""),e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function T(t){var n=t&&!1!==i.closeMethod?i.closeMethod:i.hideMethod,o=t&&!1!==i.closeDuration?i.closeDuration:i.hideDuration,s=t&&!1!==i.closeEasing?i.closeEasing:i.hideEasing;if(!e(":focus",d).length||t)return clearTimeout(v.intervalId),d[n]({duration:o,easing:s,complete:function(){p(d),clearTimeout(l),i.onHidden&&"hidden"!==C.state&&i.onHidden(),C.state="hidden",C.endTime=new Date,c(C)}})}function b(){(i.timeOut>0||i.extendedTimeOut>0)&&(l=setTimeout(T,i.extendedTimeOut),v.maxHideTime=parseFloat(i.extendedTimeOut),v.hideEta=(new Date).getTime()+v.maxHideTime)}function O(){clearTimeout(l),v.hideEta=0,d.stop(!0,!0)[i.showMethod]({duration:i.showDuration,easing:i.showEasing})}function D(){var e=(v.hideEta-(new Date).getTime())/v.maxHideTime*100;m.width(e+"%")}}function u(){return e.extend({},{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'<button type="button">×</button>',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1},a.options)}function p(e){t||(t=r()),e.is(":visible")||(e.remove(),e=null,0===t.children().length&&(t.remove(),o=void 0))}}()})}("function"==typeof define&&define.amd?define:function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t("undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null):window.toastr=t(window.jQuery)});
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{}],26:[function(require,module,exports){
|
||
module.exports=function(o){return o&&"object"==typeof o&&"function"==typeof o.copy&&"function"==typeof o.fill&&"function"==typeof o.readUInt8};
|
||
|
||
},{}],27:[function(require,module,exports){
|
||
(function (process,global){
|
||
var formatRegExp=/%[sdj%]/g;exports.format=function(e){if(!isString(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(inspect(arguments[t]));return r.join(" ")}t=1;for(var n=arguments,i=n.length,o=String(e).replace(formatRegExp,function(e){if("%%"===e)return"%";if(t>=i)return e;switch(e){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch(e){return"[Circular]"}default:return e}}),s=n[t];t<i;s=n[++t])isNull(s)||!isObject(s)?o+=" "+s:o+=" "+inspect(s);return o},exports.deprecate=function(e,r){if(isUndefined(global.process))return function(){return exports.deprecate(e,r).apply(this,arguments)};if(!0===process.noDeprecation)return e;var t=!1;return function(){if(!t){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),t=!0}return e.apply(this,arguments)}};var debugEnviron,debugs={};function inspect(e,r){var t={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),isBoolean(r)?t.showHidden=r:r&&exports._extend(t,r),isUndefined(t.showHidden)&&(t.showHidden=!1),isUndefined(t.depth)&&(t.depth=2),isUndefined(t.colors)&&(t.colors=!1),isUndefined(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=stylizeWithColor),formatValue(t,e,t.depth)}function stylizeWithColor(e,r){var t=inspect.styles[r];return t?"["+inspect.colors[t][0]+"m"+e+"["+inspect.colors[t][1]+"m":e}function stylizeNoColor(e,r){return e}function arrayToHash(e){var r={};return e.forEach(function(e,t){r[e]=!0}),r}function formatValue(e,r,t){if(e.customInspect&&r&&isFunction(r.inspect)&&r.inspect!==exports.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(t,e);return isString(n)||(n=formatValue(e,n,t)),n}var i=formatPrimitive(e,r);if(i)return i;var o=Object.keys(r),s=arrayToHash(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),isError(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return formatError(r);if(0===o.length){if(isFunction(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(isRegExp(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(isDate(r))return e.stylize(Date.prototype.toString.call(r),"date");if(isError(r))return formatError(r)}var c,a="",l=!1,p=["{","}"];(isArray(r)&&(l=!0,p=["[","]"]),isFunction(r))&&(a=" [Function"+(r.name?": "+r.name:"")+"]");return isRegExp(r)&&(a=" "+RegExp.prototype.toString.call(r)),isDate(r)&&(a=" "+Date.prototype.toUTCString.call(r)),isError(r)&&(a=" "+formatError(r)),0!==o.length||l&&0!=r.length?t<0?isRegExp(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=l?formatArray(e,r,t,s,o):o.map(function(n){return formatProperty(e,r,t,s,n,l)}),e.seen.pop(),reduceToSingleString(c,a,p)):p[0]+a+p[1]}function formatPrimitive(e,r){if(isUndefined(r))return e.stylize("undefined","undefined");if(isString(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}return isNumber(r)?e.stylize(""+r,"number"):isBoolean(r)?e.stylize(""+r,"boolean"):isNull(r)?e.stylize("null","null"):void 0}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(e,r,t,n,i){for(var o=[],s=0,u=r.length;s<u;++s)hasOwnProperty(r,String(s))?o.push(formatProperty(e,r,t,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(formatProperty(e,r,t,n,i,!0))}),o}function formatProperty(e,r,t,n,i,o){var s,u,c;if((c=Object.getOwnPropertyDescriptor(r,i)||{value:r[i]}).get?u=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(u=e.stylize("[Setter]","special")),hasOwnProperty(n,i)||(s="["+i+"]"),u||(e.seen.indexOf(c.value)<0?(u=isNull(t)?formatValue(e,c.value,null):formatValue(e,c.value,t-1)).indexOf("\n")>-1&&(u=o?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n")):u=e.stylize("[Circular]","special")),isUndefined(s)){if(o&&i.match(/^\d+$/))return u;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+u}function reduceToSingleString(e,r,t){return e.reduce(function(e,r){return 0,r.indexOf("\n")>=0&&0,e+r.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?t[0]+(""===r?"":r+"\n ")+" "+e.join(",\n ")+" "+t[1]:t[0]+r+" "+e.join(", ")+" "+t[1]}function isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNullOrUndefined(e){return null==e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isSymbol(e){return"symbol"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"==typeof e&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"==typeof e}function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return e<10?"0"+e.toString(10):e.toString(10)}exports.debuglog=function(e){if(isUndefined(debugEnviron)&&(debugEnviron=process.env.NODE_DEBUG||""),e=e.toUpperCase(),!debugs[e])if(new RegExp("\\b"+e+"\\b","i").test(debugEnviron)){var r=process.pid;debugs[e]=function(){var t=exports.format.apply(exports,arguments);console.error("%s %d: %s",e,r,t)}}else debugs[e]=function(){};return debugs[e]},exports.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=require("./support/isBuffer");var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var e=new Date,r=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(":");return[e.getDate(),months[e.getMonth()],r].join(" ")}function hasOwnProperty(e,r){return Object.prototype.hasOwnProperty.call(e,r)}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))},exports.inherits=require("inherits"),exports._extend=function(e,r){if(!r||!isObject(r))return e;for(var t=Object.keys(r),n=t.length;n--;)e[t[n]]=r[t[n]];return e};
|
||
|
||
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"./support/isBuffer":26,"_process":22,"inherits":9}],28:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var templateLoader=require("./template-loader.js"),console=require("console-browserify"),ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,$="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null;require("./ko-bindings.js");var performanceAwareCaller=require("./timed-call.js").timedCall,addUndoStackExtensionMaker=require("./undomanager/undomain.js"),colorPlugin=require("./ext/color.js"),utilPlugin=require("./ext/util.js"),inlinerPlugin=require("./ext/inliner.js"),localStorageLoader=require("./ext/localstorage.js");if(void 0===ko)throw"Cannot find knockout.js library!";if(void 0===$)throw"Cannot find jquery library!";function _canonicalize(e){var i=global.document.createElement("div");return i.innerHTML="<a></a>",i.firstChild.href=e,i.innerHTML=i.innerHTML,i.firstChild.href}function _appendUrlParameters(e,i){var n=-1==e.indexOf("?")?"?":"&",a=e;for(var t in i)i.hasOwnProperty(t)&&(a+=n+t+"="+encodeURIComponent(i[t]),n="&");return a}var applyBindingOptions=function(e,i){i.bindingHandlers.wysiwygSrc.convertedUrl=function(i,n,a,t){var o=e.imgProcessorBackend?e.imgProcessorBackend:"./upload",r=o.match(/^(https?:\/\/[^\/]*\/).*$/),l=i.match(/^(https?:\/\/[^\/]*\/).*$/);if(null===r||null!==l&&r[1]==l[1])return o.indexOf("?"),_appendUrlParameters(o,{src:i,method:n,params:a+","+t});console.log("Cannot apply backend image resizing to non-local resources ",i,n,a,t,r,l);var d={method:n,width:a};return null!==t&&(d.height=t),_appendUrlParameters(i,d)},i.bindingHandlers.wysiwygSrc.placeholderUrl=function(i,n,a){return _appendUrlParameters(e.imgProcessorBackend?e.imgProcessorBackend:"./upload",{method:"placeholder",params:i+","+n})},e&&e.tinymceConfig&&(i.bindingHandlers.wysiwyg.standardOptions=e.tinymceConfig),e&&e.tinymceConfigFull&&(i.bindingHandlers.wysiwyg.fullOptions=e.tinymceConfigFull)},start=function(e,i,n,a,t){templateLoader.fixPageEvents();var o=[function(i){e&&e.strings&&(i.t=function(n,a){var t=e.strings[n];return void 0===t&&(console.warn("Missing translation string for",n,": using default string"),t=n),i.tt(t,a)})},addUndoStackExtensionMaker(performanceAwareCaller),colorPlugin,utilPlugin,inlinerPlugin];if(void 0!==t)for(var r=0;r<t.length;r++)o.push(t[r]);o.push(function(i){var n={messages:{unknownError:i.t("Unknown error"),uploadedBytes:i.t("Uploaded bytes exceed file size"),maxNumberOfFiles:i.t("Maximum number of files exceeded"),acceptFileTypes:i.t("File type not allowed"),maxFileSize:i.t("File is too large"),minFileSize:i.t("File is too small"),post_max_size:i.t("The uploaded file exceeds the post_max_size directive in php.ini"),max_file_size:i.t("File is too big"),min_file_size:i.t("File is too small"),accept_file_types:i.t("Filetype not allowed"),max_number_of_files:i.t("Maximum number of files exceeded"),max_width:i.t("Image exceeds maximum width"),min_width:i.t("Image requires a minimum width"),max_height:i.t("Image exceeds maximum height"),min_height:i.t("Image requires a minimum height"),abort:i.t("File upload aborted"),image_resize:i.t("Failed to resize image"),generic:i.t("Unexpected upload error")}};e&&e.fileuploadConfig&&(n=$.extend(!0,n,e.fileuploadConfig)),ko.bindingHandlers.fileupload.extendOptions=n});var l=e.fileuploadConfig?e.fileuploadConfig.url:"/upload/";applyBindingOptions(e,ko),$("\x3c!-- ko template: 'main' --\x3e\x3c!-- /ko --\x3e").appendTo(global.document.body),void 0===i&&void 0!==n&&(i=n.template),templateLoader.load(performanceAwareCaller,i,n,a,o,l)},initFromLocalStorage=function(e,i,n){try{var a=localStorageLoader(i,e.emailProcessorBackend),t=void 0!==n?n:[];t.push(a.extension);var o=_canonicalize(a.metadata.template);start(e,o,a.metadata,a.model,t)}catch(e){console.error("TODO not found ",i,e)}},init=function(e,i){var n=global.location.hash?global.location.href.split("#")[1]:void 0;if(e&&(e.template||e.data))if(e.data){var a="string"==typeof a?JSON.parse(e.data):e.data;start(e,void 0,a.metadata,a.content,i)}else start(e,e.template,void 0,void 0,i);else if(n&&7==n.length)initFromLocalStorage(e,n,i);else{if(!n)return!1;start(e,_canonicalize(n),void 0,void 0,i)}return!0};module.exports={isCompatible:templateLoader.isCompatible,init:init,start:start};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"./ext/color.js":61,"./ext/inliner.js":62,"./ext/localstorage.js":63,"./ext/util.js":64,"./ko-bindings.js":65,"./template-loader.js":66,"./timed-call.js":67,"./undomanager/undomain.js":68,"console-browserify":6}],29:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,console=require("console-browserify"),addScriptTemplate=function(e,t,n){var o=e.createElement("script");return o.setAttribute("type","text/html"),o.setAttribute("id",t),o.text=n,e.body.appendChild(o),o};ko.bindingHandlers.bindIframe={tpl:'<!DOCTYPE html>\r\n<html>\r\n<head>\r\n</head>\r\n<body><div data-bind="block: content"></div></body>\r\n</html>\r\n',init:function(e,t){!function(n){try{var o=e.contentDocument;o.open(),o.write(ko.bindingHandlers.bindIframe.tpl),o.close();try{var r=o.body;if(r){for(var i=e.contentWindow.parent.document.getElementsByTagName("script"),d=0;d<i.length;d++)"text/html"==i[d].getAttribute("type")&&i[d].getAttribute("id")&&addScriptTemplate(o,i[d].getAttribute("id"),i[d].innerHTML);var a=o.getElementsByTagName("HTML");ko.utils.domNodeDisposal.addDisposeCallback(e,function(){ko.cleanNode(a[0]||r)}),ko.applyBindings(t(),a[0]||r)}else console.log("no iframedoc",n)}catch(e){throw console.log("error reading iframe.body",e,n),e}}catch(e){throw console.log("error reading iframe contentDocument",e,n),e}}("first call")}};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],30:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,console=require("console-browserify");ko.bindingHandlers.withProperties={init:function(e,n,o,t,l){var a=l.createChildContext(l.$rawData,null,function(e){ko.utils.extend(e,n())});return ko.applyBindingsToDescendants(a,e),{controlsDescendantBindings:!0}}},ko.virtualElements.allowedBindings.withProperties=!0,ko.bindingHandlers.log={init:function(e,n,o,t,l){console.log("log",n())}},ko.bindingHandlers.block={templateExists:function(e){return!!global.document.getElementById(e)},_chooseTemplate:function(e,n,o,t){var l=n+"-"+o;if(ko.bindingHandlers.block.templateExists(l))return l;if(null!=t)return ko.bindingHandlers.block._chooseTemplate(e,n,t);var a=e?"array":"object-"+o;if(ko.bindingHandlers.block.templateExists(a))return a;throw"cannot find template for "+l+"/"+a},_displayMode:function(e,n){var o=void 0!==e.type?ko.utils.unwrapObservable(e.type):"notablock-"+typeof e,t=void 0!==e.splice,l=n.templateMode?n.templateMode:"show";return ko.bindingHandlers.block._chooseTemplate(t,o,l,n.templateModeFallback)},_makeTemplateValueAccessor:function(e,n){return function(){var o,t,l=e(),a=ko.utils.peekObservable(l);if(!a||"object"!=typeof a.data&&"function"!=typeof a.data)o=l;else if(o=a.data,void 0!==a.template){var i=ko.utils.unwrapObservable(a.template),r=n.templateMode?n.templateMode:"show";t=ko.bindingHandlers.block._chooseTemplate(!1,i,r,n.templateModeFallback)}var s=ko.utils.unwrapObservable(o);if(ko.isObservable(s)&&console.log("doubleObservable",s),void 0===t)if(void 0===o)t="empty";else try{t=ko.bindingHandlers.block._displayMode(s,n)}catch(e){throw console.log(e,s,n.$data,n.templateMode),e}return{name:t,data:o,templateEngine:ko.nativeTemplateEngine.instance}}},init:function(e,n,o,t,l){void 0===n()&&console.log("found a null block: check ending commas in arrays defs in IE");var a=ko.bindingHandlers.block._makeTemplateValueAccessor(n,l);return ko.bindingHandlers.template.init(e,a)},update:function(e,n,o,t,l){var a=ko.bindingHandlers.block._makeTemplateValueAccessor(n,l);return ko.bindingHandlers.template.update(e,a,o,t,l)}},ko.expressionRewriting.bindingRewriteValidators.block=!1,ko.virtualElements.allowedBindings.block=!0;
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],31:[function(require,module,exports){
|
||
"use strict";module.exports=require("./string-template.js");
|
||
|
||
},{"./string-template.js":46}],32:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";require("evol-colorpicker");var $="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,kojqui="undefined"!=typeof window?window.kojqui:"undefined"!=typeof global?global.kojqui:null,ColorPicker=function(){kojqui.BindingHandler.call(this,"colorpicker")};ColorPicker.prototype=kojqui.utils.createObject(kojqui.BindingHandler.prototype),ColorPicker.prototype.constructor=ColorPicker,ColorPicker.prototype.init=function(o,e,i){var r=e(),n=r.color,l=ko.computed({read:n,write:n,disposeWhenNodeIsRemoved:o});ko.bindingHandlers.value.init(o,function(){return l},i);var t=function(o,e){void 0!==e&&l(e)};$(o).on("change.color",t),ko.computed({read:function(){var e={color:ko.utils.unwrapObservable(l),showOn:"button"};for(var i in r)"color"!==i&&r.hasOwnProperty(i)&&(e[i]=ko.utils.unwrapObservable(r[i]));$(o).colorpicker(e)},disposeWhenNodeIsRemoved:o}),ko.utils.domNodeDisposal.addDisposeCallback(o,function(){$(o).off("change.color",t),$(o).colorpicker("destroy")})},kojqui.utils.register(ColorPicker);
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"evol-colorpicker":8}],33:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null;ko.bindingHandlers.cssText={update:function(e,n,t){var o=ko.utils.unwrapObservable(n());try{e.innerText=o}catch(n){e.styleSheet||(e.innerHTML="a{}"),e.styleSheet.cssText=o}}};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{}],34:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,$="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,console=require("console-browserify");ko.bindingHandlers.focusable={focus:function(){},blur:function(){},init:function(o){ko.utils.domNodeDisposal.addDisposeCallback(o,function(){$(o).off("focusin",ko.bindingHandlers.focusable.focus),$(o).off("focusout",ko.bindingHandlers.focusable.blur)}),$(o).on("focusin",ko.bindingHandlers.focusable.focus),$(o).on("focusout",ko.bindingHandlers.focusable.blur)}},ko.bindingHandlers.scrollable={scroll:function(){},init:function(o){ko.utils.domNodeDisposal.addDisposeCallback(o,function(){$(o).off("scroll",ko.bindingHandlers.scrollable.scroll)}),$(o).on("scroll",ko.bindingHandlers.scrollable.scroll)}};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],35:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var $="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null;!function(e,o){e.utils.unwrapObservable;var n=e.utils.domData.get;e.utils.domData.set,e.bindingHandlers.extdroppable={init:function(t,d,a,l,i){var s,p=o(t),r=e.utils.unwrapObservable(d())||{},u={};o.extend(!0,u,e.bindingHandlers.extdroppable),r.data?(r.options&&u.options&&(e.utils.extend(u.options,r.options),delete r.options),e.utils.extend(u,r)):u.data=r,s=u.options.drop,p.droppable(e.utils.extend(u.options,{drop:function(e,o){var t=o.draggable[0],d=n(t,"ko_sortItem")||n(t,"ko_dragItem");d&&(d.clone&&(d=d.clone()),u.dragged&&(d=u.dragged.call(this,d,e,o)||d),u.data&&u.data(d)),s&&s.apply(this,arguments)}})),void 0!==u.isEnabled&&e.computed({read:function(){p.droppable(e.utils.unwrapObservable(u.isEnabled)?"enable":"disable")},disposeWhenNodeIsRemoved:t})},update:function(e,o,n,t,d){},targetIndex:null,afterMove:null,beforeMove:null,options:{}}}(ko,$);
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{}],36:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null;ko.extenders.paging=function(e,n){var t=ko.observable(n||10),o=ko.observable(1);return e.pageSize=ko.computed({read:t,write:function(e){t(e>0?e:10)}}),e.currentPage=ko.computed({read:o,write:function(n){n>e.pageCount()?o(e.pageCount()):o(n<=0?1:n)}}),e.pageCount=ko.computed(function(){return Math.ceil(e().length/e.pageSize())||1}),e.currentPageData=ko.computed(function(){var n=t(),r=o(),u=n*(r-1),a=n*r;return e().slice(u,a)}),e.moveFirst=function(){e.currentPage(1)},e.movePrevious=function(){e.currentPage(e.currentPage()-1)},e.moveNext=function(){e.currentPage(e.currentPage()+1)},e.moveLast=function(){e.currentPage(e.pageCount())},e};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{}],37:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var $="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,sortable="undefined"!=typeof window?window.jQuery.ui.sortable:"undefined"!=typeof global?global.jQuery.ui.sortable:null,draggable="undefined"!=typeof window?window.jQuery.ui.draggable:"undefined"!=typeof global?global.jQuery.ui.draggable:null,console=require("console-browserify");if(require("knockout-sortable"),void 0===sortable)throw"Cannot find jquery-ui sortable widget dependency!";if(void 0===draggable)throw"Cannot find jquery-ui sortable widget dependency!";var isDraggingHelper=function(e,n){e()?n.type==e()+"stop"&&e(!1):"dragstart"!=n.type&&"sortstart"!=n.type||e(n.type.substring(0,4))},makeExtendedValueAccessor=function(e){return function(){var n=e();ko.utils.peekObservable(n),ko.utils.unwrapObservable(n),"undefined"==n.options&&(n.options={});var o=n.options.start;n.options.start=function(e,r){if(void 0!==n.dragging&&ko.isWritableObservable(n.dragging)&&isDraggingHelper(n.dragging,e),void 0!==n.dropContainer&&(n.scrollInterval=global.setInterval(function(){var e=$(n.dropContainer).scrollTop();$(n.dropContainer).scrollTop(e+n.adding)},20)),void 0!==o)return o(e,r)};var r=n.options.stop;n.options.stop=function(e,o){if(void 0!==n.dragging&&ko.isWritableObservable(n.dragging)&&isDraggingHelper(n.dragging,e),void 0!==n.dropContainer&&global.clearInterval(n.scrollInterval),void 0!==r)return r(e,o)};var i=n.options.drag;return n.options.drag=function(e,o){if(void 0!==n.dropContainer){var r=e.pageY-$(n.dropContainer).offset().top,t=r-$(n.dropContainer).height();n.adding=r<-20?-20:r<0?-10:r<10?-5:t>20?20:t>0?10:t>-10?5:0}if(void 0!==i)return i(e,o)},n}};ko.bindingHandlers.extsortable={init:function(e,n,o,r,i){return ko.bindingHandlers.sortable.init(e,makeExtendedValueAccessor(n),o,r,i)},update:function(e,n,o,r,i){return ko.bindingHandlers.sortable.update(e,makeExtendedValueAccessor(n),o,r,i)}},ko.bindingHandlers.extdraggable={init:function(e,n,o,r,i){return ko.bindingHandlers.draggable.init(e,makeExtendedValueAccessor(n),o,r,i)},update:function(e,n,o,r,i){return ko.bindingHandlers.draggable.update(e,makeExtendedValueAccessor(n),o,r,i)}};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6,"knockout-sortable":15}],38:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var $="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,console=require("console-browserify");ko.bindingHandlers.fudroppable={init:function(e,i){var o=i()||{},r={},l=function(e,i,o,r,l,a){e[i]?global.clearTimeout(e[i]):(void 0!==r&&o.classList.add(r),ko.isWriteableObservable(l)&&!l()&&l(!0));var s=function(){e[i]=null,void 0!==r&&o.classList.remove(r),ko.isWriteableObservable(l)&&l()&&l(!1)};"dragleave"==a.type?s():e[i]=global.setTimeout(s,500)};(o.active||o.activeClass)&&ko.utils.registerEventHandler(global,"dragover",l.bind(void 0,r,"activeTimeout",e,o.activeClass,o.active)),o.hoverClass&&ko.utils.registerEventHandler(e,"dragover dragenter dragleave",l.bind(void 0,r,"hoverTimeout",e,o.hoverClass,void 0))}},ko.bindingHandlers.fileupload={extendOptions:{},remoteFilePreprocessor:function(e){return e},init:function(e,i){ko.utils.domNodeDisposal.addDisposeCallback(e,function(){$(e).fileupload("destroy")}),!("WebkitAppearance"in global.document.documentElement.style)||"webkitNbspMode"in global.document.documentElement.style||"StyleMedia"in global?$(e).attr("title",""):$(e).attr("title"," ")},update:function(e,i){var o=i()||{},r=$(e),l=r.parents(".uploadzone"),a=o.data;o.data=void 0;var s=o.canvasPreview;ko.utils.extend(o,{url:"/upload/",dataType:"json",dropZone:l.find(".mo-uploadzone")[0],autoUpload:!0,acceptFileTypes:/(\.|\/)(gif|jpe?g|png)$/i,maxFileSize:1048576,disableImageResize:/Android(?!.*Chrome)|Opera/.test(global.navigator.userAgent),previewMaxWidth:200,previewMaxHeight:200,previewCrop:!1,replaceFileInput:!1,messages:{unknownError:"Unknown error",uploadedBytes:"Uploaded bytes exceed file size",maxNumberOfFiles:"Maximum number of files exceeded",acceptFileTypes:"File type not allowed",maxFileSize:"File is too large",minFileSize:"File is too small",post_max_size:"The uploaded file exceeds the post_max_size directive in php.ini",max_file_size:"File is too big",min_file_size:"File is too small",accept_file_types:"Filetype not allowed",max_number_of_files:"Maximum number of files exceeded",max_width:"Image exceeds maximum width",min_width:"Image requires a minimum width",max_height:"Image exceeds maximum height",min_height:"Image requires a minimum height",abort:"File upload aborted",image_resize:"Failed to resize image",generic:"Unexpected upload error"}}),ko.utils.extend(o,ko.bindingHandlers.fileupload.extendOptions);var n=0,t="",d=function(){0==--n&&(a&&a(t),t="",s&&(l.find("img").show(),l.find("canvas").remove()),l.removeClass("uploading"),l.find(".progress-bar").css("width",0))},u=function(e){if("object"==typeof o.messages&&null!==o.messages){var i=e.match(/^([^ ]+)(.*)$/);if(i&&void 0!==o.messages[i[1]])return o.messages[i[1]]+i[2]}return e};r.fileupload(o);for(var p=["fileuploadadd","fileuploadprocessalways","fileuploadprogressall","fileuploaddone","fileuploadfail"],f=function(e,i){if("fileuploadadd"==e.type&&n++,"fileuploadfail"==e.type&&(console.log("fileuploadfail",e,i),o.onerror&&(""===i.errorThrown&&"error"==i.textStatus?o.onerror(u("generic")):o.onerror(u("generic ("+i.errorThrown+")"))),d()),"fileuploaddone"==e.type)if(void 0!==i.result.files[0].url){if(o.onfile)for(var r=0;r<i.result.files.length;r++)i.result.files[r]=ko.bindingHandlers.fileupload.remoteFilePreprocessor(i.result.files[r]),o.onfile(i.result.files[r]);if(""===t&&(t=i.result.files[0].url),s){var a=new Image;a.onload=d,a.onerror=d,a.src=i.result.files[0].url}else d()}else void 0!==i.result.files[0].error?(console.log("remote error",e,i),o.onerror&&o.onerror(u(i.result.files[0].error)),d()):(console.log("unexpected error",e,i),o.onerror&&o.onerror(u("generic (Unexpected Error retrieving uploaded file)")),d());if("fileuploadprocessalways"==e.type){var p=i.index,f=i.files[p];if(f.preview&&0===p&&0===l.find("canvas").length){if(s){var m=$(f.preview).css("width","100%");l.find("img").hide(),l.prepend(m)}l.addClass("uploading"),l.find(".progress-bar").css("width",0)}f.error&&(o.onerror&&o.onerror(u(f.error)),d())}if("fileuploadprogressall"==e.type){var g=parseInt(i.loaded/i.total*100,10);l.find(".progress-bar").css("width",g+"%")}},m=p.length-1;m>=0;m--){var g=p[m];r.on(g,f)}$.support.fileInput||r.prop("disabled",!0).parent().addClass("disabled")}};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],39:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var beforeSubscriptionProp,afterSubscriptionProp,ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,console=require("console-browserify");if(ko.bindingHandlers.ifSubs={cloneNodes:function(o,e){for(var i=0,n=o.length,r=[];i<n;i++){var s=o[i].cloneNode(!0);r.push(e?ko.cleanNode(s):s)}return r},init:function(o,e,i,n,r){var s,t,u=e();return void 0===u.data.subsCount&&ko.extenders.subscriptionsCount(u.data),ko.computed(function(){var i,n,b=ko.utils.unwrapObservable(e().data.subsCount),p=!t;n=-(void 0!==e().gutter?e().gutter:1),i=b+(s?n:0)>=ko.utils.unwrapObservable(u.threshold),void 0!==e().not&&e().not&&(i=!i),(p||i!==s)&&(p&&ko.computedContext.getDependenciesCount()&&(t=ko.bindingHandlers.ifSubs.cloneNodes(ko.virtualElements.childNodes(o),!0)),i?(p||ko.virtualElements.setDomNodeChildren(o,ko.bindingHandlers.ifSubs.cloneNodes(t)),ko.applyBindingsToDescendants(r,o)):ko.virtualElements.emptyNode(o),s=i)},null,{disposeWhenNodeIsRemoved:o}),{controlsDescendantBindings:!0}}},ko.virtualElements.allowedBindings.ifSubs=!0,"function"==typeof ko.subscription&&void 0!==ko.isWritableObservable)beforeSubscriptionProp="beforeSubscriptionAdd",afterSubscriptionProp="afterSubscriptionRemove";else if("3.2.0"==ko.version)beforeSubscriptionProp="va",afterSubscriptionProp="nb";else if("3.3.0"==ko.version)beforeSubscriptionProp="ja",afterSubscriptionProp="ua";else if("3.4.0"==ko.version)beforeSubscriptionProp="sa",afterSubscriptionProp="Ia";else if("3.4.1"==ko.version)beforeSubscriptionProp="sa",afterSubscriptionProp="Ia";else if("3.4.2"==ko.version)beforeSubscriptionProp="ua",afterSubscriptionProp="Ka";else{if("3.5.0-beta"!=ko.version)throw"Unsupported minimized Knockout version "+ko.version+" (supported DEBUG or minimized 3.2.0 ... 3.5.0-beta)";beforeSubscriptionProp="Pa",afterSubscriptionProp="ab"}ko.extenders.subscriptionsCount=function(o,e,i){if(void 0===o.subsCount){o.subsCount=ko.observable(o.getSubscriptionsCount()).extend({notify:"always"});var n=o[beforeSubscriptionProp],r=o[afterSubscriptionProp];o[beforeSubscriptionProp]=function(r){n&&n.call(o,r);var s=o.getSubscriptionsCount()+1;void 0!==e&&s!=e&&void 0!==i&&s!=i||o.subsCount(s)},o[afterSubscriptionProp]=function(n){r&&r.call(o,n);var s=o.getSubscriptionsCount();void 0!==e&&s!=e&&void 0!==i&&s!=i||o.subsCount(s)}}else console.log("already applied subscriptionCount to observable");return null};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],40:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var $="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,spinner="undefined"!=typeof window?window.jQuery.ui.spinner:"undefined"!=typeof global?global.jQuery.ui.spinner:null,console=require("console-browserify");if(void 0===spinner)throw"Cannot find jquery-ui spinner widget dependency!";$.widget("ui.spinner",spinner,{_adjustValue:function(n){this._super(n);var e=this.options;return n=parseFloat(n.toFixed(this._precision())),null!==e.max&&n>e.max?e.max:null!==e.min&&n<e.min?e.min:n}});
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],41:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var $="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,console=require("console-browserify"),tabs="undefined"!=typeof window?window.jQuery.ui.tabs:"undefined"!=typeof global?global.jQuery.ui.tabs:null;if(void 0===tabs)throw"Cannot find jquery-ui tabs widget dependency!";$.widget("ui.tabs",tabs,{_isLocal:function(e){return"true"==e.getAttribute("data-local")||this._superApply(arguments)}});
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],42:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null;ko.bindingHandlers.preloader={init:function(e,o){var d=o();if(void 0===d.preloaded){d.preloaded=ko.observable("");var n=function(e){if(e!=d.preloaded())if(""!==e){var o=new Image;o.onload=function(){d.preloaded(e)},o.onerror=function(){d.preloaded(e)},o.src=e}else d.preloaded(e)};d.subscribe(n),n(d())}}};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{}],43:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";function pushTemplate(e,t){var n=global.document.createElement("script");n.setAttribute("type","text/html"),n.setAttribute("id",e),n.text=t,global.document.body.appendChild(n)}function removeTemplate(e){var t=global.document.getElementById(e);t&&t.parentNode.removeChild(t)}function init(){}function getTemplateContent(e){var t=global.document.getElementById(e);return t?t.innerHTML:void 0}module.exports={init:init,addTemplate:pushTemplate,removeTemplate:removeTemplate,getTemplateContent:getTemplateContent};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{}],44:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var timeout,ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,$="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,console=require("console-browserify"),tinymce="undefined"!=typeof window?window.tinymce:"undefined"!=typeof global?global.tinymce:null,render=function(){if(timeout=void 0,void 0!==tinymce.activeEditor&&null!==tinymce.activeEditor&&void 0!==tinymce.activeEditor.theme&&null!==tinymce.activeEditor.theme&&void 0!==tinymce.activeEditor.theme.panel&&null!==tinymce.activeEditor.theme.panel){(void 0!==tinymce.activeEditor.theme.panel._visible&&tinymce.activeEditor.theme.panel._visible&&tinymce.activeEditor.theme.panel._fixed||void 0!==tinymce.activeEditor.theme.panel.state&&tinymce.activeEditor.theme.panel.state.get("visible")&&tinymce.activeEditor.theme.panel.state.get("fixed"))&&tinymce.activeEditor.theme.panel.fixed(!1);var e=void 0!==tinymce.activeEditor.bodyElement?tinymce.activeEditor.bodyElement:tinymce.activeEditor.dom.settings.root_element;null!==e&&void 0!==e.classList&&e.classList.contains("mce-edit-focus")&&(tinymce.activeEditor.nodeChanged(),tinymce.activeEditor.theme.panel.visible(!0),tinymce.activeEditor.theme.panel.layoutRect().y<=40&&tinymce.activeEditor.theme.panel.moveBy(0,40-tinymce.activeEditor.theme.panel.layoutRect().y))}};ko.bindingHandlers.wysiwygScrollfix={scroll:function(e){timeout&&global.clearTimeout(timeout),timeout=global.setTimeout(render,50)},init:function(e){ko.utils.domNodeDisposal.addDisposeCallback(e,function(){$(e).off("scroll",ko.bindingHandlers.wysiwygScrollfix.scroll)}),$(e).on("scroll",ko.bindingHandlers.wysiwygScrollfix.scroll)}};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],45:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var $="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,console=require("console-browserify"),_scrollIntoView=function(o,e,l,n){var i=l.scrollTop(),t=i-n-(e?20:-20);if(void 0!==l[0].nodeType){var r={scrollTop:Math.round(t)+"px"},s=Math.round(Math.abs(t-i));l.stop().animate(r,s)}else l.scrollTop(t)};ko.bindingHandlers.scrollIntoView={update:function(o,e,l,n,i){if(ko.utils.unwrapObservable(e()))try{for(;8===o.nodeType;)o=o.nextSibling;if(8!==o.nodeType){var t,r=$(o).scrollParent(),s=!1;9==r[0].nodeType?(r=$(r[0].defaultView),t=0,s=!0):t=r.offset().top;var a=r.height(),d=r.scrollTop(),c=t+a,f=$(o),w=f.offset().top;s&&(w-=d);var p=f.height(),u=w+p;w>t&&w+p<c||(p<a?(w<t&&_scrollIntoView(o,!0,r,t-w),u>c&&_scrollIntoView(o,!1,r,c-u)):(w<t&&u<c&&_scrollIntoView(o,!1,r,c-u),w>t&&u>c&&_scrollIntoView(o,!0,r,t-w)))}}catch(o){console.log("TODO exception scrolling into view",o)}}},ko.virtualElements.allowedBindings.scrollIntoView=!0;
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],46:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,origTemplateSystem=require("./script-template.js"),templates={};function createStringTemplateEngine(e){var t=e.makeTemplateSource;return e.makeTemplateSource=function(e){return void 0!==templates[e]?new ko.templateSources.stringTemplate(e,templates[e]):t(e)},e}function pushTemplate(e,t){templates[e]=t}function removeTemplate(e){void 0!==templates[e]?templates[e]=void 0:origTemplateSystem.removeTemplate(e)}function init(){ko.setTemplateEngine(createStringTemplateEngine(new ko.nativeTemplateEngine))}function getTemplateContent(e){return void 0!==templates[e]?templates[e]:origTemplateSystem.getTemplateContent(e)}ko.templateSources.stringTemplate=function(e,t){this.templateName=e,this.template=t,this._data={}},ko.utils.extend(ko.templateSources.stringTemplate.prototype,{data:function(e,t){if(1===arguments.length)return this._data[e];this._data[e]=t},text:function(e){if(0===arguments.length)return this.template;this.template=e}}),module.exports={init:init,addTemplate:pushTemplate,removeTemplate:removeTemplate,getTemplateContent:getTemplateContent};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"./script-template.js":43}],47:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,$="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,kojqui="undefined"!=typeof window?window.kojqui:"undefined"!=typeof global?global.kojqui:null,console=require("console-browserify"),extendValueAccessor=function(o,n){return function(){return ko.utils.extend(n,o()),n}},options={show:{delay:500},track:!0,items:'[title][title!=""][title!=" "]'};ko.bindingHandlers.tooltips={init:function(o,n,i,e,t){if(void 0!==$.fn.tooltip&&void 0!==ko.bindingHandlers.tooltip)return ko.bindingHandlers.tooltip.init(o,extendValueAccessor(n,options),i,e,t)},update:function(o,n,i,e,t){if(void 0!==$.fn.tooltip&&void 0!==ko.bindingHandlers.tooltip)return ko.bindingHandlers.tooltip.update(o,extendValueAccessor(n,options),i,e,t)}};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],48:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,console=require("console-browserify");ko.bindingHandlers.validatedValue={init:function(e,n,i){var o=n;if(void 0!==e.pattern){var t=new RegExp("^(?:"+e.pattern+")$"),a=ko.computed({read:function(){var i=ko.utils.unwrapObservable(n());return null===i||""===i||t.test(i)?e.classList.remove("invalid"):e.classList.add("invalid"),i},write:ko.isWriteableObservable(n())&&function(i){ko.selectExtensions.writeValue(e,i);var o=ko.selectExtensions.readValue(e);n()(o)},disposeWhenNodeIsRemoved:e});o=function(){return a}}ko.bindingHandlers.value.init(e,o,i)}},ko.expressionRewriting._twoWayBindings.validatedValue=!0;
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],49:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,console=require("console-browserify");ko.bindingHandlers.uniqueId={currentIndex:0,init:function(e,n){var t=ko.utils.unwrapObservable(n())||{};if(""===t.id()){var i,l,r;r="ko_"+(void 0!==t.type?ko.utils.unwrapObservable(t.type):"block");do{i=r+"_"+ ++ko.bindingHandlers.uniqueId.currentIndex,l=global.document.getElementById(i)}while(l);t.id(i)}}},ko.virtualElements.allowedBindings.uniqueId=!0,ko.bindingHandlers.virtualAttr={update:function(e,n){8!==e.nodeType&&ko.bindingHandlers.attr.update(e,n)}},ko.virtualElements.allowedBindings.virtualAttr=!0,ko.bindingHandlers.virtualAttrStyle={update:function(e,n,t,i,l){if(8!==e.nodeType){var r=["style"];(void 0===l.templateMode||"wysiwyg"!=l.templateMode)&&r.push("replacedstyle");for(var o=ko.utils.unwrapObservable(n()),d=0;d<r.length;d++){var a=r[d];!1===o||null==o?e.removeAttribute(a):e.setAttribute(a,o.toString())}}}},ko.virtualElements.allowedBindings.virtualAttrStyle=!0,ko.bindingHandlers.virtualStyle={update:function(e,n){8!==e.nodeType&&ko.bindingHandlers.style.update(e,n)}},ko.virtualElements.allowedBindings.virtualStyle=!0,ko.bindingHandlers.virtualHtml={init:ko.bindingHandlers.html.init,update:function(e,n){if(8===e.nodeType){var t=ko.utils.unwrapObservable(n());if(ko.virtualElements.emptyNode(e),null!=t){"string"!=typeof t&&(t=t.toString());var i=ko.utils.parseHtmlFragment(t);if(i)for(var l=e.nextSibling,r=0,o=i.length;r<o;r++)l.parentNode.insertBefore(i[r],l)}}else ko.bindingHandlers.html.update(e,n);return{controlsDescendantBindings:!0}}},ko.virtualElements.allowedBindings.virtualHtml=!0;
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],50:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var tinymce="undefined"!=typeof window?window.tinymce:"undefined"!=typeof global?global.tinymce:null,$="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,console=require("console-browserify");require("./eventable.js"),ko.bindingHandlers.wysiwygOrHtml={init:function(e,i,n,t,o){return void 0===o.templateMode||"wysiwyg"!=o.templateMode?ko.bindingHandlers.virtualHtml.init():ko.bindingHandlers.wysiwyg.init(e,i,n,t,o)},update:function(e,i,n,t,o){if(void 0===o.templateMode||"wysiwyg"!=o.templateMode)return ko.bindingHandlers.virtualHtml.update(e,i,n,t,o)}},ko.virtualElements.allowedBindings.wysiwygOrHtml=!0,ko.bindingHandlers.wysiwygHref={init:function(e,i,n,t,o){8!==e.nodeType&&(i(),void 0===o.templateMode||"wysiwyg"!=o.templateMode?e.setAttribute("target","_new"):void 0!==n().wysiwygOrHtml?e.setAttribute("href","javascript:void(0)"):(e.removeAttribute("href"),e.setAttribute("disabledhref","#")))},update:function(e,i,n,t,o){if(8!==e.nodeType){var l=void 0===o.templateMode||"wysiwyg"!=o.templateMode,s=ko.utils.unwrapObservable(i());l&&(!1===s||null==s?e.removeAttribute("href"):e.setAttribute("href",s.toString()))}}},ko.virtualElements.allowedBindings.wysiwygHref=!0,ko.bindingHandlers.wysiwygSrc={convertedUrl:function(e,i,n,t){var o=-1==e.indexOf("?")?"?":"&";return e+o+"method="+i+"&width="+n+(null!==t?"&height="+t:"")},placeholderUrl:function(e,i,n){},update:function(e,i,n,t,o){var l=ko.utils.unwrapObservable(i()),s=ko.utils.unwrapObservable(l.src),r=ko.utils.unwrapObservable(l.placeholder),a=ko.utils.unwrapObservable(l.width),d=ko.utils.unwrapObservable(l.height);if(!1===s||null==s||""===s)"object"==typeof r&&null!==r?e.setAttribute("src",ko.bindingHandlers.wysiwygSrc.placeholderUrl(r.width,r.height,r.text)):e.removeAttribute("src");else{var g=ko.utils.unwrapObservable(l.method);g||(g=a>0&&d>0?"cover":"resize");var u=ko.bindingHandlers.wysiwygSrc.convertedUrl(s.toString(),g,a,d);e.setAttribute("src",u)}null!=a?e.setAttribute("width",a):e.removeAttribute("width"),null!=d?e.setAttribute("height",d):e.removeAttribute("height")}},ko.bindingHandlers.wysiwygId={init:function(e,i,n,t,o){void 0===o.templateMode||"wysiwyg"!=o.templateMode||e.setAttribute("id",ko.utils.unwrapObservable(i()))},update:function(e,i,n,t,o){void 0===o.templateMode||"wysiwyg"!=o.templateMode||e.setAttribute("id",ko.utils.unwrapObservable(i()))}},ko.virtualElements.allowedBindings.wysiwygId=!0,ko.bindingHandlers.wysiwygClick={init:function(e,i,n,t,o){void 0===o.templateMode||"wysiwyg"!=o.templateMode||ko.bindingHandlers.click.init(e,i,n,t,o)}},ko.virtualElements.allowedBindings.wysiwygClick=!0,ko.bindingHandlers.wysiwygCss={update:function(e,i,n,t,o){void 0===o.templateMode||"wysiwyg"!=o.templateMode||ko.bindingHandlers.css.update(e,i,n,t,o)}},ko.virtualElements.allowedBindings.wysiwygCss=!0,ko.bindingHandlers.wysiwygImg={makeTemplateValueAccessor:function(e,i){return function(){var n=void 0!==i.templateMode&&"wysiwyg"==i.templateMode,t=e(),o=ko.utils.peekObservable(t);return ko.utils.unwrapObservable(t),{name:n?o._editTemplate:o._template,templateEngine:ko.nativeTemplateEngine.instance}}},init:function(e,i,n,t,o){return ko.bindingHandlers.template.init(e,ko.bindingHandlers.wysiwygImg.makeTemplateValueAccessor(i,o))},update:function(e,i,n,t,o){return o=o.extend(i()),ko.bindingHandlers.template.update(e,ko.bindingHandlers.wysiwygImg.makeTemplateValueAccessor(i,o),n,t,o)}},ko.virtualElements.allowedBindings.wysiwygImg=!0;var _catchingFire=function(e,i){try{return this.originalFire.apply(this,arguments)}catch(i){console.warn("Cought tinymce exception while firing editor event",e,i)}};ko.bindingHandlers.wysiwyg={debug:!1,getContentOptions:{format:"raw"},useTarget:!1,currentIndex:0,standardOptions:{},initializingClass:"wysiwyg-loading",removeSelectionOnBlur:!0,emptyClass:void 0,fullOptions:{toolbar1:"bold italic forecolor backcolor hr styleselect removeformat | link unlink | pastetext code",plugins:["link hr paste lists textcolor code"]},init:function(e,i,n,t,o){ko.bindingHandlers.focusable.init(e);var l,s=ko.bindingHandlers.wysiwyg.debug&&"function"==typeof console.debug;ko.bindingHandlers.wysiwyg.useTarget?l="@target_"+ ++ko.bindingHandlers.wysiwyg.currentIndex:(l=e.getAttribute("id"))||(l="wysiwyg_"+ ++ko.bindingHandlers.wysiwyg.currentIndex,e.setAttribute("id",l)),ko.bindingHandlers.wysiwyg.initializingClass&&e.classList.add(ko.bindingHandlers.wysiwyg.initializingClass),ko.utils.domNodeDisposal.addDisposeCallback(e,function(){s&&console.debug("Editor for selector",l,"is being removed..."),tinymce.remove("#"+e.getAttribute("id")),s&&console.debug("Editor for selector",l,"has been removed.")});var r=i();if(!ko.isObservable(r))throw"Wysiwyg binding called with non observable";if(8===e.nodeType)throw"Wysiwyg binding called on virtual node, ignoring...."+e.innerHTML;var a,d="DIV"==e.tagName||"TD"==e.tagName,g=!1,u=!1,w={inline:!0,hidden_input:!1,plugins:["paste"],toolbar1:"bold italic",toolbar2:"",preview_styles:!1,paste_as_text:!0,language:"en",schema:"html5",extended_valid_elements:"strong/b,em/i,*[*]",menubar:!1,skin:"gray-flat",forced_root_block:d?"p":"",init_instance_callback:function(i){if(s&&console.debug("Editor for selector",l,"is now initialized."),ko.bindingHandlers.wysiwyg.initializingClass&&e.classList.remove(ko.bindingHandlers.wysiwyg.initializingClass),"function"==typeof console.debug){var n=e.currentStyle?e.currentStyle.display:global.getComputedStyle(e,null).display;"inline"==n&&console.debug("Initializing an editor on an inline element: please note that while it may work, this is unsupported because of a multitude of browser issues",e.tagName,n,l)}},setup:function(i){s&&console.debug("Editor for selector",l,"is now in the setup phase.");var n=function(){0==(e.textContent||e.innerText||"").trim().length?e.classList.add(ko.bindingHandlers.wysiwyg.emptyClass):e.classList.remove(ko.bindingHandlers.wysiwyg.emptyClass)};i.on("change redo undo",function(){if(!g)try{u=!0,r(i.getContent(ko.bindingHandlers.wysiwyg.getContentOptions))}catch(e){console.warn("Unexpected error setting content value for",l,e)}finally{u=!1}ko.bindingHandlers.wysiwyg.emptyClass&&n()}),ko.bindingHandlers.wysiwyg.emptyClass&&i.on("keyup",function(){n()}),i.on("focus",function(){i.nodeChanged(),i.getElement().click()}),ko.bindingHandlers.wysiwyg.removeSelectionOnBlur&&i.on("blur",function(e){global.getSelection().removeAllRanges()}),i.on("BeforeSetContent",function(e){e.initial&&(e.format="raw")}),void 0===i.originalFire&&(i.originalFire=i.fire,i.fire=_catchingFire),a=i}};return ko.bindingHandlers.wysiwyg.useTarget?w.target=e:w.selector="#"+l,ko.utils.extend(w,ko.bindingHandlers.wysiwyg.standardOptions),d&&ko.utils.extend(w,ko.bindingHandlers.wysiwyg.fullOptions),global.setTimeout(function(){s&&console.debug("Editor for selector",l,"is being inizialized ...");var e=tinymce.init(w);s&&console.debug("Editor for selector",l,"init has just been called returning",e),e.then(function(){s&&console.debug("Editor for selector",l,"init promise has resolved.")},function(e){console.log("Editor for selector",l,"init promise has failed.",e)})}),ko.computed(function(){var n=ko.utils.unwrapObservable(i());if(!u){try{g=!0,void 0!==a?a.setContent(n,{format:"raw"}):ko.utils.setHtml(e,n)}catch(e){console.warn("Exception setting content to editable element",typeof a,e)}g=!1}},null,{disposeWhenNodeIsRemoved:e}),{controlsDescendantBindings:!0}}};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"./eventable.js":34,"console-browserify":6}],51:[function(require,module,exports){
|
||
"use strict";var console=require("console-browserify"),checkModel=function(e,o,t,n,l){var i,f,r,a=0;if(void 0===l&&(l=!1),void 0!==o&&"function"==typeof o.splice)for(i={},f=0;f<o.length;f++)i[o[f].type]=o[f];else i=o;for(var p in e)if(e.hasOwnProperty(p))if(r=void 0!==n?n+"."+p:p,t.hasOwnProperty(p))if(typeof t[p]!=typeof e[p])null!==t[p]&&null!==e[p]&&("string"==typeof t[p]?String(e[p])!=e[p]&&(console.log("TODO Different type 1 ",r,typeof t[p],typeof e[p],t[p],e[p]),a=Math.max(a,2)):"number"==typeof t[p]?Number(e[p])!=e[p]&&(console.log("TODO Different type 2 ",r,typeof t[p],typeof e[p],t[p],e[p]),a=Math.max(a,2)):(console.log("TODO Different type 3 ",r,typeof t[p],typeof e[p],t[p],e[p]),a=Math.max(a,2)));else if("object"==typeof e[p])if(null!==e[p])if(void 0!==e[p].splice){if(e[p].length>0)if(t[p].length>0){var c=0;for(f=0;f<t[p].length;f++)if("string"==typeof t[p][f].type){for(;c<e[p].length&&e[p][c].type!==t[p][f].type;)console.log("ignoring ",r,e[p][c].type," block type in reference not found in model"),c++;if(c>=e[p].length){console.log("WARN cannot find ",r,t[p][f].type," block in reference"),a=Math.max(a,2);break}a=Math.max(a,checkModel(e[p][c],void 0,t[p][f],r+"["+f+"."+t[p][f].type+"]"))}}else for(f=0;f<e[p].length;f++)"string"!=typeof e[p][f].type?(console.log("TODO found an object with no type",r,e[p][f]),a=Math.max(a,2)):i.hasOwnProperty(e[p][f].type)?a=Math.max(a,checkModel(i[e[p][f].type],i,e[p][f],r+"["+f+"."+e[p][f].type+"]")):(console.warn("TODO the model uses a block type not defined by the template. REMOVING IT!!",r,e[p][f]),e[p].splice(f,1),f--,a=Math.max(a,2))}else null===t[p]?l?(console.log("WARN Null object in model ",r,"instead of",e[p],"deleting it"),a=Math.max(a,2),delete e[p]):(console.log("INFO Null object in model ",r,"instead of",e[p],"cloning it from the reference"),a=Math.max(a,1),t[p]=e[p]):a=Math.max(a,checkModel(e[p],i,t[p],r,l));else null!==t[p]&&(console.log("TODO Null in reference but not null in model",r,t[p]),a=Math.max(a,2));else"string"!=typeof e[p]&&"boolean"!=typeof e[p]&&"number"!=typeof e[p]&&(console.log("TODO unsupported type",r,typeof e[p]),a=Math.max(a,2));else l?(console.warn("WARN Property ",r,"found in model is not defined by template: removing it!"),a=Math.max(a,2),delete e[p]):(console.log("INFO Property ",r,"missing in model, cloning from reference!"),a=Math.max(a,1),t[p]=e[p]);return l||(a=Math.max(a,checkModel(t,o,e,void 0!==n?n+"!R":"!R",!0))),a};module.exports=checkModel;
|
||
|
||
},{"console-browserify":6}],52:[function(require,module,exports){
|
||
"use strict";var converterUtils=require("./utils.js"),cssParse=require("mensch/lib/parser.js"),console=require("console-browserify"),domutils=require("./domutils.js"),_declarationValueLookup=function(e,t,r){for(var l=e.length-1;l>=0;l--)if("property"==e[l].type&&e[l].name==t)return _declarationValueUrlPrefixer(e[l].value,r);return null},_propToCamelCase=function(e){return e.replace(/-([a-z])/g,function(e,t,r,l){return t.toUpperCase()})},_declarationValueUrlPrefixer=function(e,t){return e.match(/url\(.*\)/)?e.replace(/(url\()([^\)]*)(\))/g,function(e,r,l,i){var n=l.trim(),o=l.trim().charAt(0);"'"==o||'"'==o?n=n.substr(1,n.length-2):o="";var a=t(n);return null!==a?r+o+a+o+i:e}):e},elaborateDeclarations=function(e,t,r,l,i,n,o){var a="object"==typeof n&&null!==n?n:{},u=null,s=0;void 0===t&&(t=cssParse("#{\n"+e+"}",{comments:!0,position:!0}).stylesheet.rules[0].declarations,s=1);for(var d=t.length-1;d>=0;d--)if("property"==t[d].type)if(!0===o&&"display"==t[d].name&&"none"==t[d].value)null===u&&(u=e),u=converterUtils.removeStyle(u,t[d].position.start,t[d].position.end,s,0,0,"");else{var v=t[d].name.match(/^-ko-(bind-|attr-)?([a-z0-9-]*?)(-if|-ifnot)?$/);if(null!==v){null===u&&void 0!==e&&(u=e);var c,f,m,p="attr-"==v[1],y="bind-"==v[1],h=v[2],b="-if"==v[3]||"-ifnot"==v[3];if(b){if(c=t[d].name.substr(0,t[d].name.length-v[3].length),null===_declarationValueLookup(t,c,r))throw"Unable to find declaration "+c+" for "+t[d].name}else{if((p||y)&&void 0===i&&void 0!==e)throw"Attributes and bind declarations are only allowed in inline styles!";var S,g=!0;if(p?(m=domutils.getAttribute(i,h),g=!1,S="virtualAttr"):y?(S=null,"text"==h?void 0!==i?m=domutils.getInnerText(i):g=!1:"html"==h&&void 0!==i?m=domutils.getInnerHtml(i):g=!1):((g=void 0!==e)&&(m=_declarationValueLookup(t,h,r)),S="virtualStyle"),g&&null===m)throw console.error("Cannot find default value for",t[d].name,t),"Cannot find default value for "+t[d].name+": "+t[d].value+" in "+i+" ("+typeof e+"/"+h+")";var w=m,U=y||p?-1!=h.indexOf("-")?"'"+h+"'":h:_propToCamelCase(h);try{f=converterUtils.expressionBinding(t[d].value,l,w)}catch(e){throw console.error("Model ensure path failed",e.stack,"name",t[d].name,"value",t[d].value,"default",m,"element",i),e}null!==S&&void 0===a[S]&&(a[S]={}),"virtualAttr"==S&&"href"==U&&(S=null,U="wysiwygHref",null!=i&&domutils.removeAttribute(i,"href"));var x=_declarationValueLookup(t,t[d].name+"-if",r),A=!1;if(null===x)x=_declarationValueLookup(t,t[d].name+"-ifnot",r),A=!0;else if(null!==_declarationValueLookup(t,t[d].name+"-ifnot",r))throw"Unexpected error: cannot use both -if and -ifnot property conditions";if(null!==x)try{f=(A?"!":"")+"("+converterUtils.conditionBinding(x,l)+") ? "+f+" : null"}catch(e){throw console.error("Unable to deal with -ko style binding condition",x,t[d].name),e}null!==S?a[S][U]=f:a[U]=f}if(null!==u)try{if(null!=i)u=converterUtils.removeStyle(u,t[d].position.start,t[d].position.end,s,0,0,"");else{var _="";b||(_=h+": \x3c!-- ko text: "+f+" --\x3e"+m+"\x3c!-- /ko --\x3e"),u=converterUtils.removeStyle(u,t[d].position.start,t[d].position.end,s,0,0,_)}}catch(e){throw console.warn("Remove style failed",e,"name",t[d]),e}}else{var k=_declarationValueUrlPrefixer(t[d].value,r);if(k!=t[d].value&&(null===u&&void 0!==e&&(u=e),null!==u))try{u=converterUtils.removeStyle(u,t[d].position.start,t[d].position.end,s,0,0,t[d].name+": "+k)}catch(e){throw console.log("Remove style failed replacing url",e,"name",t[d]),e}var C=_propToCamelCase(t[d].name),V="virtualAttrStyle",P=void 0!==a.virtualStyle?a.virtualStyle[C]:void 0,j=" ";void 0===a[V]&&(a[V]="''",j=""),void 0!==P?(a[V]="'"+t[d].name+": '+("+P+")+';"+j+"'+"+a[V],delete a.virtualStyle[C]):a[V]="'"+t[d].name+": "+converterUtils.addSlashes(k)+";"+j+"'+"+a[V]}}if(null!=i){for(var z in a.virtualStyle)if(a.virtualStyle.hasOwnProperty(z))throw console.log("Unexpected virtualStyle binding after conversion to virtualAttr.style",z,a.virtualStyle[z],e),"Unexpected virtualStyle binding after conversion to virtualAttr.style for "+z;delete a.virtualStyle;var L=domutils.getAttribute(i,"data-bind"),q=(null!==L?L+", ":"")+_bindingSerializer(a);""==q?domutils.removeAttribute(i,"data-bind"):domutils.setAttribute(i,"data-bind",q)}if(void 0===e){var O=!1;for(var T in a.virtualStyle)if(a.virtualStyle.hasOwnProperty(T)){O=!0;break}if(O){if(void 0!==a.virtualAttrStyle){var B=a.virtualAttrStyle;delete a.virtualAttrStyle,a.virtualAttrStyle=B}}else delete a.virtualStyle;return _bindingSerializer(a)}return u},_bindingSerializer=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&("object"==typeof e[r]?t.push(r+": { "+_bindingSerializer(e[r])+" }"):t.push(r+": "+e[r]));return t.reverse().join(", ")};module.exports=elaborateDeclarations;
|
||
|
||
},{"./domutils.js":53,"./utils.js":59,"console-browserify":6,"mensch/lib/parser.js":20}],53:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var $="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null;function _extend(e,t){if(t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var objExtend=function(e,t){return"function"==typeof $.extend?$.extend(!0,e,t):_extend(e,JSON.parse(JSON.stringify(t)))},getAttribute=function(e,t){var n=$(e).attr(t);return void 0===n&&(n=null),n},setAttribute=function(e,t,n){$(e).attr(t,n)},removeAttribute=function(e,t){$(e).removeAttr(t)},getInnerText=function(e){return $(e).text()},getInnerHtml=function(e){return $(e).html()},getLowerTagName=function(e){return""===e.tagName&&"string"==typeof e.name?e.name.toLowerCase():""!==e.tagName?e.tagName.toLowerCase():$(e).prop("tagName").toLowerCase()},setContent=function(e,t){$(e).html(t)},replaceHtml=function(e,t){$(e).replaceWith(t)},removeElements=function(e,t){t&&void 0!==e.detach&&e.detach(),e.remove()};module.exports={getAttribute:getAttribute,setAttribute:setAttribute,removeAttribute:removeAttribute,getInnerText:getInnerText,getInnerHtml:getInnerHtml,getLowerTagName:getLowerTagName,setContent:setContent,replaceHtml:replaceHtml,removeElements:removeElements,objExtend:objExtend};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{}],54:[function(require,module,exports){
|
||
"use strict";var console=require("console-browserify"),elaborateDeclarations=require("./declarations.js"),utils=require("./utils.js"),modelDef=require("./model.js"),_getOptionsObject=function(e){for(var t=e.split("|"),o={},i=0;i<t.length;i++){var l=t[i].split("=");o[l[0].trim()]=l.length>1?l[1].trim():l[0].trim()}return o},_filterProps=function(e,t,o){var i=[];for(var l in e)if(!l.match(/^customStyle$/)&&!l.match(/^_/)&&e.hasOwnProperty(l)){var a=null!==e[l]&&void 0!==e[l]._category&&"style"==e[l]._category;"id"==l||"type"==l||l.match(/Blocks$/)||("styler"==t?(a||o>0)&&i.push(l):"edit"==t?null!==e[l]&&void 0!==e[l]._category&&"content"==e[l]._category&&(void 0===e[l]._context||"block"!=e[l]._context)&&i.push(l):void 0===t&&i.push(l))}return i},_propInput=function(e,t,o,i,l){var a,n="";if(null!==e&&void 0!==e._widget&&(a=e._widget),void 0===a)throw"Unknown data type for "+t;var s="focusable: true";if("edit"==i&&(s+=", event: { focus: function(ui, event) { $($element).click(); } } "),n+='<label class="data-'+a+'"'+("boolean"==a?" data-bind=\"event: { mousedown: function(ui, evt) { if (evt.button == 0) { var input = $($element).find('input'); var ch = input.prop('checked'); setTimeout(function() { input.click(); input.prop('checked', !ch); input.trigger('change'); }, 0); } } }, click: function(ui, evt) { evt.preventDefault(); }, clickBubble: false\"":"")+">",void 0!==l&&void 0!==l[a]){var d=l[a],r={};if(void 0!==d.parameters)for(var c in d.parameters)d.parameters.hasOwnProperty(c)&&void 0!==e["_"+c]&&(r[c]=e["_"+c]);n+=d.html(o,s,r)}else if("boolean"==a)n+='<input type="checkbox" value="nothing" data-bind="checked: '+o+", "+s+'" />',n+='<span class="checkbox-replacer" ></span>';else if("color"==a)n+='<input size="7" type="text" data-bind="colorpicker: { color: '+o+", strings: $root.t('Theme Colors,Standard Colors,Web Colors,Theme Colors,Back to Palette,History,No history yet.') }, , "+s+'" />';else if("select"==a){if(void 0!==e._options){var p=_getOptionsObject(e._options);for(var v in n+='<select data-bind="value: '+o+", "+s+'">',p)p.hasOwnProperty(v)&&(n+='<option value="'+v+"\" data-bind=\"text: $root.ut('template', '"+utils.addSlashes(p[v])+"')\">"+p[v]+"</option>");n+="</select>"}}else if("font"==a)n+='<select type="text" data-bind="value: '+o+", "+s+'">',n+='<optgroup label="Sans-Serif Fonts">',n+='<option value="Arial,Helvetica,sans-serif">Arial</option>',n+="<option value=\"'Comic Sans MS',cursive,sans-serif\">Comic Sans MS</option>",n+='<option value="Impact,Charcoal,sans-serif">Impact</option>',n+="<option value=\"'Trebuchet MS',Helvetica,sans-serif\">Trebuchet MS</option>",n+='<option value="Verdana,Geneva,sans-serif">Verdana</option>',n+="</optgroup>",n+='<optgroup label="Serif Fonts">',n+='<option value="Georgia,serif">Georgia</option>',n+="<option value=\"'Times New Roman',Times,serif\">Times New Roman</option>",n+="</optgroup>",n+='<optgroup label="Monospace Fonts">',n+="<option value=\"'Courier New',Courier,monospace\">Courier New</option>",n+="</optgroup>",n+="</select>";else if("url"==a)n+='<div class="ui-textbutton">',n+='<input class="ui-textbutton-input" size="7" type="url" pattern="(mailto:.+@.+|https?://.+\\..+|\\[.*\\].*)" value="nothing" data-bind="css: { withButton: typeof $root.linkDialog !== \'undefined\' }, validatedValue: '+o+", "+s+'" />',n+="<a class=\"ui-textbutton-button\" data-bind=\"visible: typeof $root.linkDialog !== 'undefined', click: typeof $root.linkDialog !== 'undefined' ? $root.linkDialog.bind($element.previousSibling) : false, button: { icons: { primary: 'fa fa-fw fa-ellipsis-h' }, label: 'Opzioni', text: false }\">Opzioni</a>",n+="</div>";else if("integer"==a){var u=0,b=1e3;null!==e&&void 0!==e._max&&(b=e._max),null!==e&&void 0!==e._min&&(u=e._min);var h=b-u>=100?10:1;n+='<input class="number-spinner" size="7" step="'+h+'" type="number" value="-1" data-bind="spinner: { min: '+u+", max: "+b+", page: "+5*h+", value: "+o+" }, valueUpdate: ['change', 'spin'], "+s+'" />'}else n+='<input size="7" type="text" value="nothing" data-bind="value: '+o+", "+s+'" />';return n+"</label>"},_getGlobalStyleProp=function(e,t,o,i){var l;return"object"==typeof t&&null!==t&&void 0===t._widget||void 0!==o&&void 0!==i&&i.length>0&&"object"==typeof e&&void 0!==e[i]&&(l=e[i]),l},_propEditor=function(e,t,o,i,l,a,n,s,d,r,c,p,v,u,b){if(void 0===d&&(d=0),void 0!==n&&"object"==typeof i&&null!==i&&void 0===i._usecount)return"function"==typeof console.debug&&console.debug("Ignoring",a,"property because it is not used by the template","prop:",n,"type:",s,"level:",d,e._templateName),"";var h,f=void 0!==p?n+"._defaultComputed":n,m="",g=f,_=1,y=1;if("object"==typeof i&&null!==i&&void 0===i._widget||void 0===p&&(_+=1),void 0===p&&void 0!==r&&(y+=r),void 0!==n&&v&&(m+="\x3c!-- ko ifSubs: { data: "+g+", threshold: "+y+", gutter: "+_+" } --\x3e"),void 0===n||null!==i&&void 0!==i._name||console.log("Missing label for property ",n),void 0===n&&null!==i&&void 0===i._name&&"theme"!==i.type&&console.log("Missing label for object ",i.type),"object"==typeof i&&null!==i&&void 0===i._widget){var k=_filterProps(i,s,d),x="styler"==s&&null!==i&&void 0!==i.customStyle&&void 0!==p,S="",w="";void 0!==n&&"edit"==s&&(S=", click: function(obj, evt) { $root.selectItem("+n+", $data); return false }, clickBubble: false, css: { selecteditem: $root.isSelectedItem("+n+") }, scrollIntoView: $root.isSelectedItem("+n+"), ",w+=" selectable"),x&&(w+=" supportsCustomStyles"),m+='<div class="objEdit level'+d+w+'" data-bind="tooltips: {}'+S+'">';var $,j,D,B=null!==i&&void 0!==i._name?i._name:void 0!==n?"["+n+"]":"";if(x){var E="Stile";null!=l&&void 0!==l._name?E=l._name:console.log("Missing label for theme section ",n,null!==i?i.type:"-"),B="<span class=\"blockSelectionMethod\" data-bind=\"text: customStyle() ? $root.ut('template', '"+utils.addSlashes(B)+"') : $root.ut('template', '"+utils.addSlashes(E)+"')\">Block</span>"}else B="<span data-bind=\"text: $root.ut('template', '"+utils.addSlashes(B)+"')\">"+B+"</span>";m+="<span"+(h=null!==i&&void 0!==i._help?' title="'+utils.addSlashes(i._help)+"\" data-bind=\"attr: { title: $root.ut('template', '"+utils.addSlashes(i._help)+"') }\"":"")+' class="objLabel level'+d+'">'+B+"</span>","edit"==s&&void 0!==i._blockDescription&&(m+="<div class=\"blockDescription\" data-bind=\"html: $root.ut('template', '"+utils.addSlashes(i._blockDescription)+"')\">"+i._blockDescription+"</div>"),x&&(m+='<label class="data-boolean blockCheck" data-bind="tooltips: { }">',m+='<input type="checkbox" value="nothing" data-bind="focusable: true, checked: customStyle" />',m+='<span title="Switch between global and block level styles editing" data-bind="attr: { title: $root.t(\'Switch between global and block level styles editing\') }" class="checkbox-replacer checkbox-replacer-onoff"></span>',m+="</label>",m+="\x3c!-- ko template: { name: 'customstyle', if: customStyle } --\x3e\x3c!-- /ko --\x3e"),void 0!==n&&(m+="\x3c!-- ko with: "+n+" --\x3e",1==d&&void 0!==n&&void 0!==i._previewBindings&&void 0!==e&&(void 0!==u&&(m+='\x3c!-- ko with: $root.content() --\x3e<div class="objPreview" data-bind="'+u+'"></div>\x3c!-- /ko --\x3e'),void 0!==b&&(m+='\x3c!-- ko with: $parent --\x3e<div class="objPreview" data-bind="'+b+'"></div>\x3c!-- /ko --\x3e'),m+='<div class="objPreview"><div class="objPreviewInner" data-bind="'+elaborateDeclarations(void 0,i._previewBindings,o,e.bind(this,a+"."))+'"></div></div>')),0===d&&void 0!==i._previewBindings&&($=elaborateDeclarations(void 0,i._previewBindings,o,e.bind(this,a.length>0?a+".":"")));var C,I=m.length;for(j=0;j<k.length;j++)D=a.length>0?a+"."+k[j]:k[j],"object"==typeof i[k[j]]&&null!==i[k[j]]&&void 0===i[k[j]]._widget||(C=void 0,0===d&&"theme"==k[j]?m+=_propEditor(e,t,o,i[k[j]],void 0,D,k[j],s,0,r,void 0,void 0,v,u):(C=_getGlobalStyleProp(c,i[k[j]],k[j],D),m+=_propEditor(e,t,o,i[k[j]],void 0,D,k[j],s,d+1,r,c,C,v,u,$)));for(j=0;j<k.length;j++)D=a.length>0?a+"."+k[j]:k[j],"object"==typeof i[k[j]]&&null!==i[k[j]]&&void 0===i[k[j]]._widget&&(C=void 0,0===d&&"theme"==k[j]?m+=_propEditor(e,t,o,i[k[j]],void 0,D,k[j],s,0,r,void 0,void 0,v,u):(C=_getGlobalStyleProp(c,i[k[j]],k[j],D),m+=_propEditor(e,t,o,i[k[j]],void 0,D,k[j],s,d+1,r,c,C,v,u,$)));if(0==m.length-I){if("object"==typeof i&&null!==i&&"template"==i._context)return"";m+='<div class="objEmpty" data-bind="html: $root.t(\'Selected element has no editable properties\')">Selected element has no editable properties</div>'}void 0!==n&&(m+="\x3c!-- /ko --\x3e"),m+="</div>"}else{var P=!0;if(void 0===c&&(P=!1),null===i||"object"!=typeof i||void 0!==i._widget){var M=[];void 0!==p&&M.push("css: { notnull: "+n+"() !== null }"),(h=null!==i&&void 0!==i._help?' title="'+utils.addSlashes(i._help)+"\" data-bind=\"attr: { title: $root.ut('template', '"+utils.addSlashes(i._help)+"') }\"":"").length>0&&M.push("tooltips: {}"),m+='<div class="propEditor '+(P?"checkboxes":"")+'"'+(M.length>0?'data-bind="'+utils.addSlashes(M.join())+'"':"")+">";var T=null!==i&&void 0!==i._name?i._name:void 0!==n?"["+n+"]":"";m+="<span"+h+' class="propLabel">'+(T="<span data-bind=\"text: $root.ut('template', '"+utils.addSlashes(T)+"')\">"+T+"</span>")+"</span>",m+='<div class="propInput '+(void 0!==c?"local":"")+'" data-bind="css: { default: '+n+'() === null }">',m+=_propInput(i,n,f,s,t),m+="</div>",void 0!==p&&(m+='<div class="propInput global" data-bind="css: { overridden: '+n+'() !== null }">',m+=_propInput(i,n,p,s,t),m+="</div>",P&&(m+='<div class="propCheck"><label data-bind="tooltips: {}"><input type="checkbox" data-bind="focusable: true, click: function(evt, obj) { $root.localGlobalSwitch('+n+", "+p+"); return true; }, checked: "+n+'() !== null">',m+='<span class="checkbox-replacer" data-bind="css: { checked: '+n+"() !== null }, attr: { title: $root.t('This style is specific for this block: click here to remove the custom style and revert to the theme value') }\"></span>",m+="</label></div>")),m+="</div>"}else m+=null===i||"object"!=typeof i?'<div class="propEditor unknown">[A|'+n+"|"+typeof i+"]</div>":'<div class="propEditor unknown">[B|'+n+"|"+typeof i+"]</div>"}return void 0!==n&&v&&(m+="\x3c!-- /ko --\x3e",m+="\x3c!-- ko ifSubs: { not: true, data: "+g+", threshold: "+y+", gutter: 0 } --\x3e",m+='<span class="label notused">('+n+")</span>",m+="\x3c!-- /ko --\x3e"),m},createBlockEditor=function(e,t,o,i,l,a,n,s,d,r,c,p){void 0===c&&(c=!0);var v,u=modelDef.getDef(e,a),b=modelDef.getDef(e,l);void 0!==b._previewBindings&&"thaeme"!=a&&"styler"==n&&(v=elaborateDeclarations(void 0,b._previewBindings,i,modelDef.getBindValue.bind(void 0,e,o,l,l,"")));var h,f=void 0!==r&&r?e[a]._globalStyles:void 0,m=void 0!==r&&r?e[a]._globalStyle:void 0;void 0!==m&&(h=modelDef.getDef(e,"theme")[m.replace(/^(\$theme|_theme_)\./,"")]);var g=modelDef.getBindValue.bind(void 0,e,o,l,a);g._templateName=a;var _='<div class="editor">';_+='<div class="blockType'+(void 0!==f?" withdefaults":"")+'">'+u.type+"</div>";var y=_propEditor(g,t,i,u,h,"",void 0,n,p,d,f,m,c,v);y.length>0&&(_+=y),s(_+="</div>",a,n)},createBlockEditors=function(e,t,o,i,l,a,n,s){createBlockEditor(e,t,o,i,l,a,"edit",n,s),createBlockEditor(e,t,o,i,l,a,"styler",n,s,!0)},generateEditors=function(e,t,o,i,l){var a,n=e._defs,s=e.templateName,d=e._blocks,r=[];for(a=0;a<d.length;a++)void 0!==d[a].container&&r.push(modelDef.generateModel(n,d[a].block)),createBlockEditors(n,t,void 0,o,d[a].root,d[a].block,i,l);return void 0!==n.theme&&createBlockEditor(n,t,void 0,o,s,"theme","styler",i,void 0,!1,!1,-1),r};module.exports=generateEditors;
|
||
|
||
},{"./declarations.js":52,"./model.js":56,"./utils.js":59,"console-browserify":6}],55:[function(require,module,exports){
|
||
"use strict";var modelDef=require("./model.js"),wrappedResultModel=function(e){var r=e._defs,t=e.templateName,l=modelDef.getDef(r,t),a=modelDef.generateResultModel(e);return require("./wrapper.js")(a,l,r)},translateTemplate=function(){var e=require("./parser.js");return e.apply(e,arguments)},generateEditors=function(){var e=require("./editor.js");return e.apply(e,arguments)},checkModel=function(){var e=require("./checkmodel.js");return e.apply(e,arguments)};module.exports={translateTemplate:translateTemplate,wrappedResultModel:wrappedResultModel,generateResultModel:modelDef.generateResultModel,generateEditors:generateEditors,checkModel:checkModel};
|
||
|
||
},{"./checkmodel.js":51,"./editor.js":54,"./model.js":56,"./parser.js":57,"./wrapper.js":60}],56:[function(require,module,exports){
|
||
"use strict";var objExtend=require("./domutils.js").objExtend,console=require("console-browserify"),_valueSet=function(e,t,o,l){var r=o.indexOf(".");if(-1==r)if(void 0===t[o])console.log("Undefined prop "+o+" while setting value "+l+" in model._valueSet");else if(null===t[o])"object"==typeof l&&null!==l&&void 0===l.push&&console.log("nullpropobjectvalue",o,l),t[o]=l;else if("object"==typeof t[o]&&"function"==typeof t[o].push){var n;if("string"==typeof l){var i=l.match(/^\[(.*)\]$/);if(null===i)throw"Unexpected default value for array property "+o+": "+l;n=i[1].split(",")}else{if("object"!=typeof l||void 0===l.push)throw"Unexpected default value for array property "+o+": "+l+" typeof "+typeof l;n=l}for(var a=[],d=0;d<n.length;d++)"@"==n[d].substr(0,1)?a.push(_generateModel(e,n[d].substr(1))):n[d].length>0&&a.push(n[d]);t[o]=a}else"string"==typeof t[o]||"boolean"==typeof t[o]?t[o]=l:"object"==typeof t[o]&&null!==t[o]&&void 0!==t[o]._widget?("object"==typeof l&&null!==l&&console.log("objectvalue",o,t[o]._widget,l),t[o]=l):console.log("setting",typeof t[o],t[o],o,l);else{var f=o.substr(0,r);_valueSet(e,t[f],o.substr(r+1),l)}},_modelCreateOrUpdateBlockDef=function(e,t,o,l){if(void 0!==e[t]&&e[t]._initialized&&!e[t]._writeable)throw console.log("_modelCreateOrUpdateBlockDef",e,t,o,l),"Trying to alter non writeable model: "+t+" / "+o;if(void 0===e[t]&&(e[t]={_writeable:!0},void 0===l&&(l={}),void 0===l.category&&void 0===e[t]._category&&(t.match(/(^t|.T)heme$/)||t.match(/(^s|.S)tyle$/)||t.match(/(^c|.C)olor$/)||t.match(/(^r|.R)adius$/)?l.category="style":l.category="content")),void 0!==l){if(void 0!==l.name&&(e[t]._name=l.name),void 0!==l.themeOverride&&(e[t]._themeOverride=l.themeOverride),void 0!==l.globalStyle){e[t]._globalStyle=l.globalStyle;var r=l.globalStyle.replace(/^(\$theme|_theme_)\./,""),n=r.indexOf("."),i=-1!=n?r.substr(0,n):r;_modelCreateOrUpdateBlockDef(e,"theme",i),(void 0===e[t]._themeOverride||e[t]._themeOverride)&&_modelCreateOrUpdateBlockDef(e,t,"customStyle=false")}void 0!==l.contextName&&(e[t]._context=l.contextName,"block"==l.contextName&&void 0===e[t]._globalStyle&&(e[t]._globalStyle="_theme_.bodyTheme",_modelCreateOrUpdateBlockDef(e,"theme","bodyTheme"),(void 0===e[t]._themeOverride||e[t]._themeOverride)&&_modelCreateOrUpdateBlockDef(e,t,"customStyle=false"))),void 0!==l.extend&&(e[t].type=l.extend)}for(var a in l)l.hasOwnProperty(a)&&void 0!==l[a]&&-1==["name","extend","contextName","globalStyle","themeOverride"].indexOf(a)&&(e[t]["_"+a]=l[a]);void 0!==o&&o.length>0&&(e[t]._props=void 0!==e[t]._props&&e[t]._props.length>0?e[t]._props+" "+o:o)},_removePrefix=function(e){var t=e.match(/^[^A-Z]+([A-Z])(.*)$/);return null!==t?t[1].toLowerCase()+t[2]:null},_generateModelFromDef=function(e,t){var o={};for(var l in e)if(!l.match(/^_.*/)&&e.hasOwnProperty(l)){var r=e[l];if("object"==typeof r&&null!==r&&void 0!==r._complex&&r._complex)o[l]=_generateModelFromDef(r,t);else if("type"==l)o[l]=r;else{if("object"!=typeof r)throw console.error("Unexpected model def",l,r,e),"Unexpected model def ["+l+"]="+r;o[l]=null}}if(void 0!==e._defaultValues){var n=e._defaultValues;for(var i in n)n.hasOwnProperty(i)&&_valueSet(t,o,i,n[i])}return o},_generateModel=function(e,t){var o=_getModelDef(e,t,!1,!0);return _generateModelFromDef(o,e)},_getDef=function(e,t){return _getModelDef(e,t,!1,!0)},_getModelDef=function(e,t,o,l){if(void 0===e[t]){if(-1!=t.indexOf(" "))return null;var r=_removePrefix(t);return null!==r?_getModelDef(e,r,o,l):null}var n=e[t];if("object"!=typeof n)throw"Block definition must be an object: found "+n+" for "+t;if(void 0===n._initialized){if(void 0===n.type&&(-1==t.indexOf(" ")?n.type=t:n.type=t.substr(t.indexOf(" ")+1)),n.type!=t&&void 0===n._widget){var i=_getModelDef(e,n.type,!0);n=objExtend(i,n),e[t]=n}else void 0===n._widget&&void 0===n._props&&n._complex;n._writeable=!0,n._initialized=!0}if(void 0!==n._props){var a=n._props;if((a=a.split(" ")).length>0&&void 0===n._writeable)throw console.error("Altering a non writable object ",t,a,n),"Altering a non writable object: "+t+" def: "+a;void 0===n._processedDefs&&(n._processedDefs={}),void 0===n._globalStyles&&(n._globalStyles={}),void 0===n._defaultValues&&(n._defaultValues={});for(var d=0;d<a.length;d++){var f=a[d];if(0!==f.length){var s=f,u=null,c=f.match(/^([^=\[\]]+)(\[\])?(=?)(.*)$/);if(null!==c&&(f=c[1],"[]"==c[2]&&(void 0===n[f]&&(n[f]=[]),u=[]),"="==c[3]&&(u=f.match(/(^v|V)isible$/)?"true"==String(c[4]).toLowerCase():f.match(/^customStyle$/)?"true"==String(c[4]).toLowerCase():c[4])),null!==u&&void 0===n._defaultValues[f]&&(n._defaultValues[f]=u),void 0===n[f]){var _=_getModelDef(e,t+" "+f,!0);null===_&&(_=_getModelDef(e,f,!0)),n[f]=_}n._processedDefs[f]=s,n._complex=!0}}delete n._props}if(o)return n._writeable=!1,objExtend({},n);if(l)return n._writeable=!1,n;if(void 0===n._writeable||!1===n._writeable)throw"Retrieving non writeable object definition: "+t;return n},_increaseUseCount=function(e,t){if(e){if(void 0===t._usecount)throw console.error("ERROR trying to bind an unused property while readonly",t),"ERROR trying to bind an unused property"}else void 0===t._usecount&&(t._usecount=0),t._usecount++},ensureGlobalStyle=function(e,t,o,l,r,n,i,a){var d=o(n,i,a);if(void 0===e[l]._globalStyles[r]){if(t)throw"Cannot find _globalStyle for "+r+" in "+l+"!";(-1!=r.indexOf(".")||"object"==typeof e[l][r]&&void 0!==e[l][r]._widget)&&(e[l]._globalStyles[r]=d)}else if(e[l]._globalStyles[r]!=d)throw"Unexpected conflicting globalStyle [2] for "+l+"/"+r+": old="+e[l]._globalStyles[r]+" new="+d},modelEnsurePathAndGetBindValue=function(e,t,o,l,r,n,i,a,d,f){var s,u,c;if("$"==i.substr(0,1)){console.warn("DEPRECATED $ in bindingProvider: ",i,r);var _=i.indexOf(".");if(-1==_)throw"Unexpected fullPath: "+i+"/"+n+"/"+r+"/"+a+"/"+d;if(s=i.substr(1,_-1),c=i.substr(_+1),"theme"!=s)throw"Unexpected $ sequence: "+s+" in "+i;var v=c.indexOf(".");u="$root.content().theme()."+(s=c.substr(0,v))+"()."+(c=c.substr(v+1)).replace(new RegExp("\\.","g"),"().")}else if("#"==i.substr(0,1))console.warn("DEPRECATED # in bindingProvider: ",i,r),s=l,u="$root.content()."+(c=i.substr(1)).replace(new RegExp("\\.","g"),"().");else if("_theme_."==i.substr(0,8)){var p=i.indexOf(".",8);u="$root.content().theme()."+(s=i.substr(8,p-8))+"()."+(c=i.substr(p+1)).replace(new RegExp("\\.","g"),"().")}else"_root_."==i.substr(0,7)?(s=l,u="$root.content()."+(c=i.substr(7)).replace(new RegExp("\\.","g"),"().")):(s=r,c=n+i,u=i.replace(new RegExp("\\.","g"),"()."));if(void 0===t[s])throw"Cannot find model def for ["+s+"]";var g,b=c.indexOf("."),h=-1==b?c:c.substr(0,b);if(-1!=s.indexOf("-"))throw console.error("ERROR cannot use - for block names",s),"ERROR unexpected char in block name: "+s;if(-1!=h.indexOf("-"))throw console.error("ERROR cannot use - for property names",h),"ERROR unexpected char in property name: "+s;if(e)return void 0!==t[s]._globalStyle&&void 0!==t[s][h]&&"style"==t[s][h]._category&&(u+="._defaultComputed"),u;if(e){if(void 0!==a)throw"Cannot use defaultValue in readonly mode!";if(d)throw"Cannot use overrideDefault in readonly mode for "+s+"/"+c+"/"+d+"!";if(void 0!==f)throw"Cannot set category for "+s+"/"+c+"/"+f+" in readonly mode!";g=_getModelDef(t,s,!1,!0)}else!1===t[s]._writeable&&console.log("TODO debug use cases for this condition",s,c),g=_getModelDef(t,s,!1===t[s]._writeable);if(null===g)throw"Unexpected model for ["+s+"]";if(void 0===g[h]){if(e)throw"Cannot find path "+h+" for "+s+"!";_modelCreateOrUpdateBlockDef(t,s,h),g=_getModelDef(t,s,!1)}void 0!==t[s]._globalStyle&&void 0!==t[s][h]&&null!==t[s][h]&&"style"==t[s][h]._category&&(u+="._defaultComputed");var y=g;try{if(_increaseUseCount(e,y),-1!=b){var m=c;do{var w=m.substr(0,b);if(void 0===y[w])throw"Found an unexpected prop "+w+" for model "+s+" for "+c;y=y[w],_increaseUseCount(e,y),b=(m=m.substr(b+1)).indexOf(".")}while(-1!=b);if(void 0===y[m]||null===y[m])throw"Found an unexpected path termination "+m+" for model "+s+" for "+c;y=y[m]}else y=y[c];if(null==y)throw"Unexpected null model for "+s+"/"+n+"/"+i;void 0!==f&&(y._category=f),_increaseUseCount(e,y)}catch(e){throw console.error("TODO ERROR Property lookup exception",e,s,c,r,i,t),e}if(void 0!==t[s]._globalStyle&&"object"==typeof t[s][h]&&null!==t[s][h]&&void 0!==t[s][h]._category&&"style"==t[s][h]._category){var x=modelEnsurePathAndGetBindValue.bind(void 0,e,t,o,l,r,""),O=-1!=c.indexOf(".")?c.substr(c.indexOf(".")):"";if(-1!=O.indexOf(".",1))throw"TODO unsupported object nesting! "+c;var D=t[s]._globalStyle+"."+h;"object"==typeof t[s][h]&&null!==t[s][h]&&void 0!==t[s][h]._globalStyle&&(D=t[s][h]._globalStyle),ensureGlobalStyle(t,e,x,s,h,D,void 0,!1);var S=D+O;if(void 0===a&&null!==t[s]._defaultValues[c]&&(a=t[s]._defaultValues[c]),ensureGlobalStyle(t,e,x,s,c,S,a,d),void 0!==a){if(e)throw console.error("Cannot set a new theme default value",S.substr(7),a,"while in readonly mode"),"Cannot set a new theme default value ("+a+") for "+S.substr(7)+" while in readonly mode!";o("default",S.substr(7),a)}a=null}if(void 0!==a)if(void 0===t[s]._defaultValues[c]||void 0!==d&&d){if(e)throw"Cannot set new _defaultValues [1] for "+c+" in "+s+"!";t[s]._defaultValues[c]=a}else if(null===a){if(e&&null!==t[s]._defaultValues[c])throw"Cannot set new _defaultValues [2] for "+c+" in "+s+"!";t[s]._defaultValues[c]=null}else if(t[s]._defaultValues[c]!=a)throw console.error("TODO error!!! Trying to set a new default value for "+s+" "+c+" while it already exists (current: "+t[s]._defaultValues[c]+", new: "+a+")"),"Trying to set a new default value for "+s+" "+c+" while it already exists (current: "+t[s].defaultValues[c]+", new: "+a+")";return u},generateResultModel=function(e){var t=e._defs,o=e.templateName,l=_generateModel(t,o);return void 0!==t.theme&&(l.theme=_generateModel(t,"theme")),l};module.exports={ensurePathAndGetBindValue:modelEnsurePathAndGetBindValue.bind(void 0,!1),getBindValue:modelEnsurePathAndGetBindValue.bind(void 0,!0),generateModel:_generateModel,generateResultModel:generateResultModel,getDef:_getDef,createOrUpdateBlockDef:_modelCreateOrUpdateBlockDef};
|
||
|
||
},{"./domutils.js":53,"console-browserify":6}],57:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var $="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,console=require("console-browserify"),converterUtils=require("./utils.js"),elaborateDeclarations=require("./declarations.js"),processStylesheetRules=require("./stylesheet.js"),modelDef=require("./model.js"),domutils=require("./domutils.js"),wrapElementWithCondition=function(e,t,o){var a=domutils.getAttribute(t,e);try{var i=converterUtils.conditionBinding(a,o);$(t).before("\x3c!-- ko if: "+i+" --\x3e"),$(t).after("\x3c!-- /ko --\x3e"),domutils.removeAttribute(t,e)}catch(o){throw console.warn("Model ensure path failed in if/variant",t,a,e),o}},replacedAttributes=function(e,t){domutils.setAttribute(e,t,domutils.getAttribute(e,"replaced"+t))},processStyle=function(e,t,o,a){var i,r=domutils.getAttribute(e,"replacedstyle"),l=null;a&&(i={uniqueId:"$data",attr:{id:"id"}});var d=null!==domutils.getAttribute(e,"data-ko-display");null===(l=elaborateDeclarations(r,void 0,t,o,e,i,d))?l=r:domutils.removeAttribute(e,"replacedstyle"),null!==l&&(l.trim().length>0?domutils.setAttribute(e,"style",l):domutils.removeAttribute(e,"style"))},_fixRelativePath=function(e,t,o,a){var i=t(domutils.getAttribute(a,e));null!==i&&domutils.setAttribute(a,e,i)},processBlock=function(e,t,o,a,i,r,l,d,s,c){try{var n;if("block"==r)n=domutils.getAttribute(e,"data-ko-block"),domutils.removeAttribute(e,"data-ko-block");else{if("template"!=r)throw"Unexpected context name while processing block: "+r;n=l}$("[data-ko-remove]",e).remove();for(var u=$("[data-ko-block]",e).replaceWith("<replacedblock>"),m=["href","src","data-ko-placeholder-src","background"],h=0;h<m.length;h++){var p=_fixRelativePath.bind(void 0,m[h],i);$("["+m[h]+"]",e).each(p)}var b=domutils.getAttribute(e,"data-ko-properties");null===b&&(b=""),$("[data-ko-properties]",e).each(function(e,t){b.length>0&&(b+=" "),b+=domutils.getAttribute(t,"data-ko-properties"),domutils.removeAttribute(t,"data-ko-properties")}),modelDef.createOrUpdateBlockDef(t,n,b,{contextName:r});var v=modelDef.ensurePathAndGetBindValue.bind(void 0,t,o,l,n,"");"block"==r&&v("id",""),$("style",e).each(function(e,a){var r=domutils.getInnerHtml(a),d=modelDef.createOrUpdateBlockDef.bind(void 0,t),s=modelDef.ensurePathAndGetBindValue.bind(void 0,t,o,l),u=processStylesheetRules(r,void 0,s,d,o,i,l,n);if(u!=r)if(""!==u.trim()){var m=c(u);domutils.setAttribute(a,"data-bind","template: { name: '"+m+"' }"),domutils.setContent(a,"")}else domutils.removeElements($(a))}),processStyle(e,i,v,s);for(var f=["data-ko-display","data-ko-editable","data-ko-wrap","href"],k=0;k<f.length;k++)if(domutils.getAttribute(e,f[k]))throw console.warn("ERROR: Unsupported "+f[k]+" used together with data-ko-block",e),"ERROR: Unsupported "+f[k]+" used together with data-ko-block";return $("[data-ko-link]",e).each(function(e,t){var o=domutils.getAttribute(t,"data-ko-link"),a=domutils.getAttribute(t,"replacedstyle");null==a&&(a=""),a=""!==a?"-ko-attr-href: @"+o+"; "+a:"-ko-attr-href: @"+o,domutils.setAttribute(t,"replacedstyle",a),domutils.setAttribute(t,"data-ko-wrap",o),domutils.removeAttribute(t,"data-ko-link")}),$("[replacedstyle]",e).each(function(e,t){processStyle(t,i,v,!1)}),$("[replacedhttp-equiv]",e).each(function(e,t){replacedAttributes(t,"http-equiv")}),$("[data-ko-display]",e).each(function(e,t){wrapElementWithCondition("data-ko-display",t,v)}),$("[data-ko-editable]",e).each(function(e,t){var o,a,i,r,l,d,s=domutils.getAttribute(t,"data-ko-editable");if(s.lastIndexOf(".")>0){var n=s.substr(0,s.lastIndexOf("."));l=v(n)}else l=v(s);if(d="wysiwygClick: function(obj, evt) { $root.selectItem("+l+", $data); return false }, clickBubble: false, wysiwygCss: { selecteditem: $root.isSelectedItem("+l+") }, scrollIntoView: $root.isSelectedItem("+l+")","img"!=domutils.getLowerTagName(t)){a=domutils.getInnerHtml(t);var u=v(s,a,!0,"wysiwyg");if(o="",domutils.getAttribute(t,"id")||(o+="wysiwygId: id()+'_"+s.replace(".","_")+"', "),void 0!==d&&(o+=d+", "),o+="wysiwygOrHtml: "+u,"td"==domutils.getLowerTagName(t)){var m=$('<div data-ko-wrap="false" style="width: 100%; height: 100%"></div>')[0];domutils.setAttribute(m,"data-bind",o);var h=domutils.getInnerHtml($("<div></div>").append(m));domutils.setContent(t,h)}else r=(null!==(i=domutils.getAttribute(t,"data-bind"))?i+", ":"")+o,domutils.setAttribute(t,"data-bind",r),domutils.setContent(t,"");domutils.removeAttribute(t,"data-ko-editable")}else{var p=domutils.getAttribute(t,"width");if(""===p&&(p=null),null===p)throw console.error("ERROR: data-ko-editable images must declare a WIDTH attribute!",t),"ERROR: data-ko-editable images must declare a WIDTH attribute!";var b=domutils.getAttribute(t,"height");""===b&&(b=null);var f=domutils.getAttribute(t,"align"),k=(i=domutils.getAttribute(t,"data-bind"))&&i.match(/virtualAttr: {[^}]* height: ([^,}]*)[,}]/);k&&(b=k[1]);var g=i&&i.match(/virtualAttr: {[^}]* width: ([^,}]*)[,}]/);g&&(p=g[1]);var w,A,y="";(a=domutils.getAttribute(t,"data-ko-placeholder-src"))?y=domutils.getAttribute(t,"src"):a=domutils.getAttribute(t,"src"),p&&b?w=p+"+'x'+"+b:b?p||(w="'h'+"+b+"+''"):w="'w'+"+p+"+''";var x=b||domutils.getAttribute(t,"data-ko-placeholder-height"),_=p||domutils.getAttribute(t,"data-ko-placeholder-width");if(domutils.removeAttribute(t,"src"),domutils.removeAttribute(t,"data-ko-editable"),domutils.removeAttribute(t,"data-ko-placeholder-height"),domutils.removeAttribute(t,"data-ko-placeholder-width"),domutils.removeAttribute(t,"data-ko-placeholder-src"),a&&(A="{ width: "+_+", height: "+x+", text: "+w+"}"),!_||!x)throw console.error("IMG data-ko-editable must declare width and height attributes, or their placeholder counterparts data-ko-placeholder-width/data-ko-placeholder-height",t),"ERROR: IMG data-ko-editable MUST declare width and height attributes, or their placeholder counterparts data-ko-placeholder-width/data-ko-placeholder-height";var D=v(s,y,!1,"wysiwyg");r=(null!==i?i+", ":"")+(o="wysiwygSrc: { width: "+p+", height: "+b+", src: "+D+", placeholder: "+A+" }"),domutils.setAttribute(t,"data-bind",r);var I=c(t),R="{ width: "+p;"left"==f?R+=", float: 'left'":"right"==f?R+=", float: 'right'":"center"==f&&("function"==typeof console.debug?console.debug("Ignoring align=center on an img tag: we don't know how to emulate this alignment in the editor!"):"top"==f?R+=", verticalAlign: 'top'":"middle"==f?R+=", verticalAlign: 'middle'":"bottom"==f&&(R+=", verticalAlign: 'bottom'")),R+="}",$(t).before("\x3c!-- ko wysiwygImg: { _data: $data, _item: "+l+", _template: '"+I+"', _editTemplate: 'img-wysiwyg', _src: "+D+", _width: "+p+", _height: "+b+", _align: "+(null===f?void 0:"'"+f+"'")+", _size: "+w+", _method: "+void 0+", _placeholdersrc: "+A+", _stylebind: "+R+" } --\x3e"),$(t).after("\x3c!-- /ko --\x3e")}}),$("[href]",e).each(function(e,t){var o=domutils.getAttribute(t,"href"),a="wysiwygHref: '"+converterUtils.addSlashes(o)+"'",i=domutils.getAttribute(t,"data-bind"),r=(null!==i?i+", ":"")+a;domutils.setAttribute(t,"data-bind",r)}),$("replacedblock",e).each(function(e,r){var s=u[e],m=processBlock(s,t,o,a,i,"block",n,d,!0,c),h=modelDef.ensurePathAndGetBindValue(t,o,l,n,"",m);$(r).before("\x3c!-- ko block: { data: "+converterUtils.addSlashes(h)+", template: 'block' } --\x3e"),$(r).after("\x3c!-- /ko --\x3e"),$(r).remove()}),$($("[data-ko-wrap]",e).get().reverse(),e).each(function(e,t){var o=domutils.getAttribute(t,"data-ko-wrap");if(void 0===o||""===o||"true"===o)throw"Unsupported empty value for data-ko-wrap: use false value if you want to always remove the tag";var a,i,r=converterUtils.conditionBinding(o,v),l=domutils.getAttribute(t,"data-bind");if(""!==l&&null!==l&&l.match(/(block|wysiwygOrHtml):/)){var d="\x3c!-- ko "+l+" --\x3e"+domutils.getInnerHtml(t)+"\x3c!-- /ko --\x3e";a=c(d),domutils.removeAttribute(t,"data-ko-wrap"),i=c(t),domutils.replaceHtml(t,"\x3c!-- ko template: /* special */ (typeof templateMode != 'undefined' && templateMode == 'wysiwyg') || "+r+" ? '"+i+"' : '"+a+"' --\x3e\x3c!-- /ko --\x3e")}else a=c(domutils.getInnerHtml(t)),domutils.removeAttribute(t,"data-ko-wrap"),domutils.setContent(t,"\x3c!-- ko template: '"+a+"' --\x3e\x3c!-- /ko --\x3e"),i=c(t),domutils.replaceHtml(t,"\x3c!-- ko template: (typeof templateMode != 'undefined' && templateMode == 'wysiwyg') || "+r+" ? '"+i+"' : '"+a+"' --\x3e\x3c!-- /ko --\x3e")}),c(e,n,"show"),a(l,n,r,d),n}catch(t){throw console.error("Exception while parsing the template",t,e),t}};function conditional_replace(e){return e.replace(/<!--\[if ([^\]]*)\]>((?:(?!--)[\s\S])*?)<!\[endif\]-->/g,function(e,t,o){var a="\x3c!-- cc:start --\x3e";a+=o.replace(/<([A-Za-z:]+)/g,"\x3c!-- cc:bo:$1 --\x3e<cc").replace(/<\/([A-Za-z:]+)>/g,"\x3c!-- cc:bc:$1 --\x3e</cc>\x3c!-- cc:ac:$1 --\x3e").replace(/\/>/g,"/>\x3c!-- cc:sc --\x3e"),a+="\x3c!-- cc:end --\x3e";var i='<replacedcc condition="'+t+'" style="display: none">';return(i+=$("<div>").append($(a)).html().replace(/^<!-- cc:start -->/,"").replace(/<!-- cc:end -->$/,""))+"</replacedcc>"})}var translateTemplate=function(e,t,o,a){var i={},r=conditional_replace(t.replace(/(<[^>]+\s)(style|http-equiv)(="[^"]*"[^>]*>)/gi,function(e,t,o,a){return t+"replaced"+o+a})),l="function"==typeof $.parseHTML?$($.parseHTML(r,!1)):$(r),d=l[0],s=[],c=function(e,t,o,a){s.push({root:e,block:t,context:o,container:a})},n=function(e,t,o){if(void 0===i.themes&&(i.themes={}),void 0===i.themes[e]&&(i.themes[e]={}),void 0===i.themes[e][t]||null===i.themes[e][t])i.themes[e][t]=o;else if(null!=o){var a=i.themes[e][t];a!=o&&console.log("Error setting a new default for property "+t+" in theme "+e+". old:"+a+" new:"+o+"!")}},u=$("[data-ko-container]",l),m={};u.each(function(e,t){var o=domutils.getAttribute(t,"data-ko-container")+"Blocks";domutils.removeAttribute(t,"data-ko-container"),domutils.setAttribute(t,"data-bind","block: "+o);var a=$("> [data-ko-block]",t);domutils.removeElements(a,!0),m[o]=a}),modelDef.createOrUpdateBlockDef(i,"id"),modelDef.createOrUpdateBlockDef(i,"bodyTheme"),modelDef.createOrUpdateBlockDef(i,"blocks","blocks[]"),modelDef.createOrUpdateBlockDef(i,"text"),processBlock(d,i,n,c,o,"template",e,void 0,!1,a);var h=function(t,r,l){processBlock(l,i,n,c,o,"block",e,t,!0,a)};for(var p in m)if(m.hasOwnProperty(p)){var b=m[p],v=p;modelDef.ensurePathAndGetBindValue(i,n,e,e,"",v+".blocks","[]"),b.each(h.bind(void 0,v))}var f={_defs:i,templateName:e,_blocks:s};return void 0!==i[e]._version&&(f.version=i[e]._version),f};module.exports=translateTemplate;
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"./declarations.js":52,"./domutils.js":53,"./model.js":56,"./stylesheet.js":58,"./utils.js":59,"console-browserify":6}],58:[function(require,module,exports){
|
||
"use strict";var cssParse=require("mensch/lib/parser.js"),console=require("console-browserify"),converterUtils=require("./utils.js"),elaborateDeclarations=require("./declarations.js"),_removeOptionalQuotes=function(e){return"'"!=e[0]&&'"'!=e[0]||e[e.length-1]!=e[0]?e:e.substr(1,e.length-2).replace(/\\([\s\S])/gm,"$1")},_processStyleSheetRules_processBlockDef=function(e,t){for(var o,s,r,l=0;l<t.length;l++)if("rule"==t[l].type){for(var n=t[l].selectors,i=!1,a=!1,c=0;c<n.length;c++)n[c].match(/:preview$/)?a=!0:i=!0;if(a&&i)throw console.log("cannot mix selectors type (:preview and declarations) in @supports -ko-blockdefs ",n),"Cannot mix selectors type (:preview and declarations) in @supports -ko-blockdefs";if(!a&&!i)throw console.log("cannot find known selectors in @supports -ko-blockdefs ",n),"Cannot find known selectors in @supports -ko-blockdefs";if(i){o="",s={},r=t[l].declarations;for(var p,u=0;u<r.length;u++)"property"==r[u].type&&(p=_removeOptionalQuotes(r[u].value),"label"==r[u].name?s.name=p:"context"==r[u].name?s.contextName=p:"properties"==r[u].name?o=p:"theme"==r[u].name?s.globalStyle="_theme_."+p:"themeOverride"==r[u].name?s.themeOverride="true"==String(p).toLowerCase():s[r[u].name]=p);for(var d=0;d<n.length;d++)e(n[d],o,s)}if(a)for(var f=0;f<n.length;f++)e(n[f].substr(0,n[f].indexOf(":")),void 0,{previewBindings:t[l].declarations})}},processStylesheetRules=function(e,t,o,s,r,l,n,i){var a,c=e,p=null;if(void 0===t){var u=cssParse(e,{comments:!0,position:!0});if("stylesheet"!=u.type||void 0===u.stylesheet)throw console.log("unable to process styleSheet",u),"Unable to parse stylesheet";t=u.stylesheet.rules}for(var d=t.length-1;d>=0;d--){if("supports"==t[d].type&&"-ko-blockdefs"==t[d].name)_processStyleSheetRules_processBlockDef(s,t[d].rules),c=converterUtils.removeStyle(c,t[d].position.start,p,0,0,0,"");else if("media"==t[d].type||"supports"==t[d].type)c=processStylesheetRules(c,t[d].rules,o,s,r,l,n,i);else if("comment"==t[d].type);else if("rule"==t[d].type){for(var f=t[d].selectors,h="",m=null,v=0;v<f.length;v++){h.length>0&&(h+=", ");var y=f[v].match(/\[data-ko-block=([^ ]*)\]/);if(null!==y){if(null!==m&&m!=y[1])throw"Found multiple block-match attribute selectors: cannot translate it ("+m+" vs "+y[1]+")";m=y[1]}h+="\x3c!-- ko text: templateMode =='wysiwyg' ? '#main-wysiwyg-area ' : '' --\x3e\x3c!-- /ko --\x3e"+f[v]}if(m){var k="\x3c!-- ko foreach: $root.findObjectsOfType($data, '"+m+"') --\x3e",x=p,g=" ";t[d].declarations.length>0&&(t[d].declarations[0].position.start.line!=t[d].position.end.line&&(g="\n"+new Array(t[d].position.start.col).join(" ")),x=t[d].declarations[t[d].declarations.length-1].position.end),null===x?c+=g+"\x3c!-- /ko --\x3e":c=x==p?converterUtils.removeStyle(c,x,p,0,0,0,g+"\x3c!-- /ko --\x3e"):converterUtils.removeStyle(c,x,p,0,0,0,g+"}"+g+"\x3c!-- /ko --\x3e"),h=k+g+h.replace(new RegExp("\\[data-ko-block="+m+"\\]","g"),"\x3c!-- ko text: '#'+id() --\x3e"+m+"\x3c!-- /ko --\x3e"),s(m,"",{contextName:"block"})}var b=m||i;a=o.bind(this,b,"");var w=elaborateDeclarations(c,t[d].declarations,l,a);null!==w&&(c=w),c=converterUtils.removeStyle(c,t[d].position.start,t[d].position.end,0,0,0,h)}else console.log("Unknown rule type",t[d].type,"while parsing <style> rules");p=t[d].position.start}return c};module.exports=processStylesheetRules;
|
||
|
||
},{"./declarations.js":52,"./utils.js":59,"console-browserify":6,"mensch/lib/parser.js":20}],59:[function(require,module,exports){
|
||
"use strict";var console=require("console-browserify"),jsep=require("jsep");jsep.addBinaryOp("or",1),jsep.addBinaryOp("and",2),jsep.addBinaryOp("eq",6),jsep.addBinaryOp("neq",6),jsep.addBinaryOp("lt",7),jsep.addBinaryOp("lte",7),jsep.addBinaryOp("gt",7),jsep.addBinaryOp("gte",7);var addSlashes=function(e){return e.replace(/[\\"'\r\n\t\v\f\b]/g,"\\$&").replace(/\u0000/g,"\\0")},removeStyle=function(e,r,n,t,o,i,a){for(var s=e.split("\n"),p=o,l=i,u=1+t;u<r.line;u++)p+=s[u-1-t].length+1;if(p+=r.col,null!==n){for(var d=1+t;d<n.line;d++)l+=s[d-1-t].length+1;l+=n.col}else l+=e.length+1;return e.substr(0,p-1)+a+e.substr(l-1)},expressionGenerator=function(e,r,n){return function e(r,n,t,o){if(void 0===t&&(t=!0),void 0!==o&&"Identifier"!==r.type&&"MemberExpression"!==r.type&&"function"==typeof console.debug&&console.debug("Cannot apply default value to variable when using expressions"),"BinaryExpression"===r.type||"LogicalExpression"===r.type)return"("+e(r.left,n,t)+" "+function(e){switch(e){case"or":return"||";case"and":return"&&";case"lt":return"<";case"lte":return"<=";case"gt":return">";case"gte":return">=";case"eq":return"==";case"neq":return"!=";default:return e}}(r.operator)+" "+e(r.right,n,t)+")";if("CallExpression"===r.type){var i=r.arguments.map(function(r){return e(r,n,t)});return e(r.callee,n,t)+"("+i.join(", ")+")"}if("UnaryExpression"===r.type)return r.operator+e(r.argument,n,t);if("MemberExpression"==r.type&&r.computed)throw"Unexpected computed member expression";if("MemberExpression"!=r.type||r.computed){if("Literal"===r.type)return r.raw;if("Identifier"===r.type){var a=r.name;return t?n(a,o)+"()":a}if("ConditionalExpression"===r.type)return"("+e(r.test,n,t)+" ? "+e(r.consequent,n,t)+" : "+e(r.alternate,n,t)+")";throw"Compound"===r.type?"Syntax error in expression: operator expected after "+e(r.body[0],n,!1):"Found an unsupported expression type: "+r.type}var s=e(r.object,n,!1)+"."+e(r.property,n,!1);return t&&"Math"!==r.object.name&&"Color"!==r.object.name&&"Util"!==r.object.name?n(s,o)+"()":s}(e,r,void 0,n)},expressionBinding=function(e,r,n){var t;if(null!=n){var o=e.trim().replace(/@\[([^\]]+)\]|@([a-zA-Z0-9\._]+)\b/g,"###var###");if("###var###"==(o=o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")))t=[null,n];else if(o="^"+o.replace(/###var###/g,"(.+)")+"$",!(t=n.trim().match(new RegExp(o))))throw console.log("Cannot find matches",t,"for",n,e,o,e),"Cannot find default value for "+e+" in "+n}try{var i=0,a="'"+e.replace(/@\[([^\]]+)\]|@([a-zA-Z0-9\._]+)\b|(')/g,function(e,n,o,a){if(a)return"\\"+a;i++;var s,p=n||o;if(t&&(void 0!==t[i]?s=t[i].trim():console.log("ABZZZ Cannot find default value for",p,"in",t,"as",i)),n){var l=jsep(n);return"'+"+expressionGenerator(l,r,s)+"+'"}return"'+"+r(p,s)+"()+'"})+"'";return a=a.replace(/(^|[^\\])''\+/g,"$1").replace(/\+''/g,""),0===i&&"false"!==a&&"true"!==a&&console.error("Unexpected expression with no valid @variable references",e),a}catch(r){throw"Exception parsing expression "+e+" "+r}},conditionBinding=function(e,r){var n=jsep(e);return expressionGenerator(n,r)};module.exports={addSlashes:addSlashes,removeStyle:removeStyle,conditionBinding:conditionBinding,expressionBinding:expressionBinding};
|
||
|
||
},{"console-browserify":6,"jsep":10}],60:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,console=require("console-browserify");function wrap(e){var t=typeof e;if("object"===t&&(e?e.constructor==Date?t="date":"[object Array]"==Object.prototype.toString.call(e)&&(t="array"):t="null"),"array"==t){var n=ko.observableArray();if(!e||0===e.length)return n;for(var o=0,r=e.length;o<r;++o)n.push(wrap(e[o]));return n}if("object"==t){var a={};for(var i in e){var l=e[i];a[i]=wrap(l)}return ko.observable(a)}if("function"==t)return e;var s=ko.observable();return s(e),s}var _getOptionsObjectKeys=function(e){for(var t=e.split("|"),n=[],o=0;o<t.length;o++){var r=t[o].split("=");n.push(r[0].trim())}return n},_makeComputed=function(e,t,n,o,r,a){return ko.computed({read:function(){var n=e();if(null===n){var i=ko.utils.unwrapObservable(o);return void 0===i||"custom"==i?ko.utils.unwrapObservable(t):a[i][r]}return n},write:function(i){var l,s=ko.utils.unwrapObservable(o);if(l=void 0===s||"custom"==s?ko.utils.peekObservable(t):a[s][r],n)e(i==l?null:i);else{var u=ko.utils.peekObservable(e);i==l&&null===u||e(i)}}})},_nextVariantFunction=function(e,t,n){for(var o=e.utils.unwrapObservable(t),r=0;r<n.length&&e.utils.peekObservable(n[r])!=o;r++);r==n.length&&(console.warn("Didn't find a variant!",t,o,n),r=n.length-1);var a=r+1;a==n.length&&(a=0),t(e.utils.peekObservable(n[a]))},_getVariants=function(e){var t=e._variant;if("object"!=typeof e[t]||void 0===e[t]._widget||"string"!=typeof e[t]._options&&"boolean"!==e[t]._widget)throw console.error("Unexpected variant declaration",t,e[t]),"Unexpected variant declaration: cannot find property "+t+" or its _options string and it is not a boolean";return"string"==typeof e[t]._options?_getOptionsObjectKeys(e[t]._options):[!0,!1]},_makeComputedFunction=function(e,t,n,o,r,a,i){if(void 0===e){if(void 0===o.utils.unwrapObservable(i).type)throw console.log("TODO ERROR Found a non-typed def ",e,i),"Found a non-typed def "+e;var l=o.utils.unwrapObservable(o.utils.unwrapObservable(i).type);"object"!=typeof(e=t[l])&&console.log("TODO ERROR Found a non-object def ",e,"for",l)}void 0===r&&void 0!==a&&a&&(r=i);var s="$root.content().",u=e._globalStyles;if(void 0!==u)for(var p in u)if(u.hasOwnProperty(p)){var b,c,v,d="$root.content().theme().scheme";if(u[p].substr(0,s.length)!=s)throw"UNEXPECTED globalStyle path ("+u[p]+") outside selfPath ("+s+")";v=u[p].substr(s.length),c=r,d.substr(0,s.length)==s?b=d.substr(s.length):(console.log("IS THIS CORRECT?",d,s),b=d);for(var f=c,h=v.split("()."),_="",g=!0,k=0;k<h.length;k++)c=o.utils.unwrapObservable(c)[h[k]],g?"theme"==h[k]&&(g=!1):(_.length>0&&(_+="."),_+=h[k]);for(var w=b.split("()."),m=0;m<w.length;m++)f=o.utils.unwrapObservable(f)[w[m]];for(var O=p.split("."),y=i,R=0;R<O.length;R++)y=o.utils.unwrapObservable(y)[O[R]];if(!o.isObservable(y))throw"Unexpected non observable target "+p+"/"+_;y._defaultComputed=_makeComputed(y,c,!0,f,_,n)}if(void 0!==e._variant){for(var F=e._variant.split("."),S=i,j=o.utils.unwrapObservable(i),C=0;C<F.length;C++)S=o.utils.unwrapObservable(S)[F[C]];if(void 0!==S._defaultComputed&&(console.log("Found variant on a style property: beware variants should be only used on content properties because they don't match the theme fallback behaviour",e._variant),S=S._defaultComputed),void 0===S)throw console.log("ERROR looking for variant target",e._variant,i),"ERROR looking for variant target "+e._variant;j._nextVariant=_nextVariantFunction.bind(S,o,S,_getVariants(e))}for(var x in e)if(e.hasOwnProperty(x)){var P=e[x];if("object"==typeof P&&null!==P&&void 0!==P._context&&"block"==P._context){var B=r[x](),E=_makeComputedFunction(t[x],t,n,o,r,a,B);i[x](E)}else if("object"==typeof P&&null!==P&&"blocks"==P.type){for(var D,I,T,A=r[x](),V=A.blocks(),U=0;U<V.length;U++)D=o.utils.unwrapObservable(V[U]),I=o.utils.unwrapObservable(D.type),T=_makeComputedFunction(t[I],t,n,o,r,a,D),V[U](T);var W=A.blocks;_augmentBlocksObservable(W,_blockInstrumentFunction.bind(A,void 0,t,n,o,void 0,r,a)),r[x]._wrap=_makeBlocksWrap.bind(r[x],W._instrumentBlock),r[x]._unwrap=_unwrap.bind(r[x])}}return i},_augmentBlocksObservable=function(e,t){e._instrumentBlock=t,void 0===e.origPush&&(e.origPush=e.push,e.push=_makePush.bind(e),e.origSplice=e.splice,e.splice=_makeSplice.bind(e))},_makeBlocksWrap=function(e,t){var n=ko.toJS(t),o=n.blocks;n.blocks=[];var r=wrap(n)();_augmentBlocksObservable(r.blocks,e);for(var a=0;a<o.length;a++){var i=ko.toJS(o[a]);i.id="block_"+a,r.blocks.push(i)}this(r)},_makePush=function(){if(arguments.length>1)throw"Array push with multiple arguments not implemented";if(arguments.length>0&&ko.isObservable(arguments[0])&&("function"==typeof arguments[0]._unwrap?arguments[0]=arguments[0]._unwrap():console.log("WARN: pushing observable with no _unwrap function (TODO remove me, expected condition)")),ko.isObservable(arguments[0]))return this.origPush.apply(this,arguments);var e=this._instrumentBlock(arguments[0]);return this.origPush.apply(this,[e])},_makeSplice=function(){if(arguments.length>3)throw"Array splice with multiple objects not implemented";if(arguments.length>2&&ko.isObservable(arguments[2])&&("function"==typeof arguments[2]._unwrap?arguments[2]=arguments[2]._unwrap():console.log("WARN: splicing observable with no _unwrap function (TODO remove me, expected condition)")),arguments.length>2&&!ko.isObservable(arguments[2])){var e=this._instrumentBlock(arguments[2]);return this.origSplice.apply(this,[arguments[0],arguments[1],e])}return this.origSplice.apply(this,arguments)},_blockInstrumentFunction=function(e,t,n,o,r,a,i,l){void 0===r&&(r=l);var s=wrap(r);return s(_makeComputedFunction(e,t,n,o,a,i,s())),s._unwrap=_unwrap.bind(s),s},_wrap=function(e,t){this(ko.utils.unwrapObservable(e(ko,t,void 0,!0)))},_unwrap=function(){return ko.toJS(this)},_modelInstrument=function(e,t,n){var o=_blockInstrumentFunction.bind(void 0,t,n,n.themes),r=o(ko,e,void 0,!0);return r._wrap=_wrap.bind(r,o),r._unwrap=_unwrap.bind(r),r};module.exports=_modelInstrument;
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],61:[function(require,module,exports){
|
||
(function (global){
|
||
var tinycolor=require("tinycolor2");function Color(t){this.getBrightness=function(n){return t(n).getBrightness()},this.isLight=function(n){return t(n).isLight()},this.isDark=function(n){return t(n).isDark()},this.getLuminance=function(n){return t(n).getLuminance()},this.lighten=function(n,i){return t(n).lighten(i).toHexString()},this.brighten=function(n,i){return t(n).brighten(i).toHexString()},this.darken=function(n,i){return t(n).darken(i).toHexString()},this.desaturate=function(n,i){return t(n).desaturate(i).toHexString()},this.saturate=function(n,i){return t(n).saturate(i).toHexString()},this.greyscale=function(n){return t(n).greyscale().toHexString()},this.spin=function(n,i){return t(n).spin(i).toHexString()},this.complement=function(n){return t(n).complement().toHexString()},this.mix=t.mix,this.readability=t.readability,this.isReadable=t.isReadable,this.mostReadable=t.mostReadable}var colorPlugin=function(t){global.Color=new Color(tinycolor)};module.exports=colorPlugin;
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"tinycolor2":24}],62:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var console=require("console-browserify"),$="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,inlineDocument=require("juice/lib/inline")({}).inlineDocument,inlinerPlugin=function(e){e.inline=function(e){$("[style]:not([replacedstyle])",e).each(function(e,n){var i=$(n);i.attr("replacedstyle",i.attr("style"))});var n=[];$('style[data-inline="true"]',e).each(function(e,i){var t=$(i).html();t=(t=t.replace(/<!-- ko ((?!--).)*? -->/g,"")).replace(/<!-- \/ko -->/g,""),n.push(t),$(i).removeAttr("data-inline")});var i=n.join("\n"),t=function(n,i){return void 0===i&&(i=e),$(n,i)};t.root=function(){return $(":root",e)},inlineDocument(t,i,{styleAttributeName:"replacedstyle"})}};module.exports=inlinerPlugin;
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6,"juice/lib/inline":11}],63:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var console=require("console-browserify"),ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,$="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,lsLoader=function(e,t){var a=global.localStorage.getItem("metadata-"+e);if(null!==a){var o,l=global.localStorage.getItem("template-"+e);null!==l&&(o=JSON.parse(l));var n=JSON.parse(a);return{metadata:n,model:o,extension:lsCommandPluginFactory(n,t)}}throw"Cannot find stored data for "+e},lsCommandPluginFactory=function(e,t){return function(e,a,o){var l={name:"Save",enabled:ko.observable(!0),execute:function(){l.enabled(!1),o.metadata.changed=Date.now(),void 0===o.metadata.key&&(console.warn("Unable to find key in metadata object...",o.metadata),o.metadata.key=e),global.localStorage.setItem("metadata-"+e,o.exportMetadata()),global.localStorage.setItem("template-"+e,o.exportJSON()),l.enabled(!0)}},n={name:"Test",enabled:ko.observable(!0)},r={name:"Download",enabled:ko.observable(!0)};n.execute=function(){n.enabled(!1);var l=global.localStorage.getItem("testemail");if(null!==l&&"null"!=l||(l=o.t("Insert here the recipient email address")),"function"!=typeof global.prompt)global.alert(o.t("This feature is not supported by your browser")),n.enabled(!0);else if(null!=(l=global.prompt(o.t("Test email address"),l))&&l.match(/@/)){global.localStorage.setItem("testemail",l);var r=t||"/dl/",d=$.post(r,{action:"email",rcpt:l,subject:"[test] "+e+" - "+a,html:o.exportHTML()},null,"html");d.fail(function(){console.log("fail",arguments),o.notifier.error(o.t("Unexpected error talking to server: contact us!"))}),d.success(function(){console.log("success",arguments),o.notifier.success(o.t("Test email sent..."))}),d.always(function(){n.enabled(!0)})}else global.alert(o.t("Invalid email address")),n.enabled(!0)},r.execute=function(){r.enabled(!1),o.notifier.info(o.t("Downloading...")),o.exportHTMLtoTextarea("#downloadHtmlTextarea");var e=t||"/dl/";global.document.getElementById("downloadForm").setAttribute("action",e),global.document.getElementById("downloadForm").submit(),r.enabled(!0)},o.save=l,o.test=n,o.download=r}.bind(void 0,e.key,e.name)};module.exports=lsLoader;
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],64:[function(require,module,exports){
|
||
(function (global){
|
||
var utilPlugin=function(e){global.Util={decodeURI:decodeURI,encodeURI:encodeURI,decodeURIComponent:decodeURIComponent,encodeURIComponent:encodeURIComponent}};module.exports=utilPlugin;
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{}],65:[function(require,module,exports){
|
||
"use strict";require("knockout-sortable"),require("./bindings/jqueryui-spinner.js"),require("./bindings/jqueryui-tabs.js"),require("./bindings/colorpicker.js"),require("./bindings/blocks.js"),require("./bindings/csstext.js"),require("./bindings/bind-iframe.js"),require("./bindings/extdroppable.js"),require("./bindings/preloader.js"),require("./bindings/fileupload.js"),require("./bindings/virtuals.js"),require("./bindings/wysiwygs.js"),require("./bindings/scrollfix.js"),require("./bindings/if-subs.js"),require("./bindings/extsortables.js"),require("./bindings/eventable.js"),require("./bindings/tooltips.js"),require("./bindings/extender-pagination.js"),require("./bindings/validated-value.js"),require("./bindings/scrollintoview.js");
|
||
|
||
},{"./bindings/bind-iframe.js":29,"./bindings/blocks.js":30,"./bindings/colorpicker.js":32,"./bindings/csstext.js":33,"./bindings/eventable.js":34,"./bindings/extdroppable.js":35,"./bindings/extender-pagination.js":36,"./bindings/extsortables.js":37,"./bindings/fileupload.js":38,"./bindings/if-subs.js":39,"./bindings/jqueryui-spinner.js":40,"./bindings/jqueryui-tabs.js":41,"./bindings/preloader.js":42,"./bindings/scrollfix.js":44,"./bindings/scrollintoview.js":45,"./bindings/tooltips.js":47,"./bindings/validated-value.js":48,"./bindings/virtuals.js":49,"./bindings/wysiwygs.js":50,"knockout-sortable":15}],66:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var $="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,kojqui="undefined"!=typeof window?window.kojqui:"undefined"!=typeof global?global.kojqui:null,templateConverter=require("./converter/main.js"),console=require("console-browserify"),initializeViewmodel=require("./viewmodel.js"),templateSystem=require("./bindings/choose-template.js");if(!$.ui.version.match(/^1\.11\..*$/))throw"Usupported jQuery UI version detected: "+$.ui.version+" (we only support 1.11.*)";var pluginsCall=function(e,t,n,o){var i,a,r,d,l;l=[],void 0!==o&&o?(i=e.length-1,a=0,r=-1):(i=0,a=e.length-1,r=1);for(var s=i;s!=a+r;s+=r)void 0!==e[s][t]&&void 0!==(d=e[s][t].apply(e[s],n))&&l.push(d);return l},origDisposeCallback=ko.utils.domNodeDisposal.addDisposeCallback;ko.utils.domNodeDisposal.addDisposeCallback=function(e,t){origDisposeCallback(e,function(e){try{t(e)}catch(e){"function"==typeof console.debug&&console.debug("Caught unexpected dispose callback exception",e)}})};var bindingPluginMaker=function(e){return{viewModel:function(t){try{e("applyBindings",ko.applyBindings.bind(void 0,t))}catch(e){throw console.warn(e,e.stack),e}},dispose:function(){try{e("unapplyBindings",ko.cleanNode.bind(this,global.document.body))}catch(e){throw console.warn(e,e.stack),e}}}},templateCreator=function(e,t,n,o){var i=n;for(void 0!==n&&void 0!==o&&("object"==typeof t&&"replacedhtml"==t.tagName.toLowerCase()||(i+="-"+o));null==i||e.exists(i);)i="anonymous-"+Math.floor(1e5*Math.random()+1);if("object"==typeof t&&"replacedhtml"==t.tagName.toLowerCase()){var a=$(t),r=$("replacedhead",a),d=$("replacedbody",a);e.adder(i+"-head",r.html()||""),e.adder(i+"-show",d.html()||""),e.adder(i+"-preview",a.html()),e.adder(i+"-wysiwyg",a.html()),r.children().detach(),r.html("\x3c!-- ko block: content --\x3e\x3c!-- /ko --\x3e"),r.before("\x3c!-- ko withProperties: { templateMode: 'head' } --\x3e"),r.after("\x3c!-- /ko --\x3e"),d.html("\x3c!-- ko block: content --\x3e\x3c!-- /ko --\x3e"),e.adder(i+"-iframe",a[0].outerHTML)}else"object"==typeof t?e.adder(i,t.outerHTML):e.adder(i,t);return i};function _viewModelPluginInstance(e){var t;return{viewModel:function(n){t=e(n)},init:function(){void 0!==t&&void 0!==t.init&&t.init()},dispose:function(){void 0!==t&&void 0!==t.dispose&&t.dispose()}}}var _templateUrlConverter=function(e,t){return t.match(/^[^\/]*:/)||t.match(/^\//)||t.match(/^\[/)||t.match(/^#?$/)?null:e+t},templateLoader=function(e,t,n,o,i,a){var r="string"==typeof t?t:n.template,d="./",l=r.lastIndexOf("/");-1!=l&&(d=r.substr(0,l+1));var s,c=_templateUrlConverter.bind(void 0,d);s=void 0===n?{template:r,name:"No name",created:Date.now()}:n,$.get(r,function(t){templateCompiler(e,c,"template",t,o,s,i,a).init()})},templateCompiler=function(e,t,n,o,i,a,r,d){var l=o.match(/^([\S\s]*)([<]html[^>]*>[\S\s]*<\/html>)([\S\s]*)$/i);if(null===l)throw"Unable to find <html> opening and closing tags in the template";var s=l[1],c={"<html":0,"<head":0,"<body":0,"</html":0,"</body":0,"</head":0},u=l[2].replace(/(<\/?)(html|head|body)([^>]*>)/gi,function(e,t,n,o){return c[(t+n).toLowerCase()]+=1,t+"replaced"+n+o});for(var m in c)if(c.hasOwnProperty(m)&&1!=c[m]){if(0===c[m])throw"ERROR: missing mandatory element "+m+">";if(c[m]>1)throw"ERROR: multiple element "+m+"> occourences are not supported (found "+c[m]+" occourences)"}var p=l[3],b=[],h=[];if(void 0!==r)for(var v=0;v<r.length;v++)"function"==typeof r[v]?h.push(_viewModelPluginInstance(r[v])):h.push(r[v]);var g=[],f={adder:function(e,t){if("string"!=typeof t)throw"Template system: cannot create new template "+e;var n=t.match(/(data)?-ko-[^ =:]*/g);n&&console.error("ERROR: found unexpected -ko- attribute in compiled template",e,", you probably mispelled it:",n),templateSystem.addTemplate(e,t),g.push(e)},exists:function(e){return void 0!==templateSystem.getTemplateContent(e)},dispose:function(){for(var e=g.length-1;e>=0;e--)templateSystem.removeTemplate(g[e])}};ko.bindingHandlers.block.templateExists=f.exists;for(var y=templateCreator.bind(void 0,f),w=e("translateTemplate",templateConverter.translateTemplate.bind(void 0,n,u,t,y)),k=e("generateModel",templateConverter.wrappedResultModel.bind(void 0,w)),C={},x=pluginsCall(h,"widget",[$,ko,kojqui]),S=0;S<x.length;S++)C[x[S].widget]=x[S];b.push.apply(b,e("generateEditors",templateConverter.generateEditors.bind(void 0,w,C,t,y,"+$root.contentListeners()")));var E=!1;if(null!=i){var M;M="string"==typeof i?ko.utils.parseJson(i):i,2==e("checkModel",templateConverter.checkModel.bind(void 0,k._unwrap(),b,M))&&(console.error("Trying to compile an incompatible template version!",k._unwrap(),b,M),E=!0);try{k._wrap(M)}catch(e){console.error("Unable to inject model content!",e),E=!0}}var T=s+templateSystem.getTemplateContent(n+"-iframe").replace(/(<\/?)replaced(html|head|body)([^>]*>)/gi,function(e,t,n,o){return t+n+o})+p,D=ko.bindingHandlers.bindIframe.tpl;ko.bindingHandlers.bindIframe.tpl=T;var I={dispose:function(){ko.bindingHandlers.bindIframe.tpl=D}};h.push(I),h.push(f);var L=e("initializeViewmodel",initializeViewmodel.bind(this,k,b,t,d));return L.metadata=a,void 0!==L.metadata.editorversion&&"0.17.5"!==L.metadata.editorversion&&console.log("The model being loaded has been created with a different editor version",L.metadata.editorversion,"runtime:","0.17.5"),L.metadata.editorversion="0.17.5",void 0!==w.version&&(void 0!==L.metadata.templateversion&&L.metadata.templateversion!==w.version&&console.log("The model being loaded has been created with a different template version",L.metadata.templateversion,"runtime:",w.version),L.metadata.templateversion=w.version),templateSystem.init(),h.push(bindingPluginMaker(e)),pluginsCall(h,"viewModel",[L]),E&&$("#incompatible-template").dialog({modal:!0,appendTo:"#mo-body",buttons:{Ok:function(){$(this).dialog("close")}}}),{model:L,init:function(){pluginsCall(h,"init",void 0,!0)},dispose:function(){pluginsCall(h,"dispose",void 0,!0)}}},checkFeature=function(e,t){if(!t())throw console.warn("Missing required browser feature",e),"Missing required browser feature: "+e},isCompatible=function(e){try{return checkFeature("matchMedia",function(){return void 0!==global.matchMedia}),checkFeature("XMLHttpRequest 2",function(){return"XMLHttpRequest"in global&&"withCredentials"in new global.XMLHttpRequest}),checkFeature("ES5 strict",function(){return function(){return void 0===this}()}),checkFeature("CSS borderRadius",function(){return void 0!==global.document.body.style.borderRadius}),checkFeature("CSS boxShadow",function(){return void 0!==global.document.body.style.boxShadow}),checkFeature("CSS boxSizing",function(){return void 0!==global.document.body.style.boxSizing}),checkFeature("CSS backgroundSize",function(){return void 0!==global.document.body.style.backgroundSize}),checkFeature("CSS backgroundOrigin",function(){return void 0!==global.document.body.style.backgroundOrigin}),checkBadBrowserExtensions(),!0}catch(t){if(e)throw t;return!1}},checkBadBrowserExtensions=function(){var e="checkbadbrowsersframe",t=ko.bindingHandlers.bindIframe.tpl;ko.bindingHandlers.bindIframe.tpl='<!DOCTYPE html>\r\n<html>\r\n<head><title>A</title>\r\n</head>\r\n<body><p style="color: blue" align="right" data-bind="style: { color: \'red\' }">B</p><div data-bind="text: content"></div></body>\r\n</html>\r\n',$("body").append('<iframe id="'+e+'" data-bind="bindIframe: $data"></iframe>');var n=global.document.getElementById(e);ko.applyBindings({content:"dummy content"},n);var o=n.contentWindow.document.doctype,i="<!DOCTYPE "+o.name+(o.publicId?' PUBLIC "'+o.publicId+'"':"")+(!o.publicId&&o.systemId?" SYSTEM":"")+(o.systemId?' "'+o.systemId+'"':"")+">\n"+n.contentWindow.document.documentElement.outerHTML;ko.cleanNode(n),ko.removeNode(n),ko.bindingHandlers.bindIframe.tpl=t;var a='<!DOCTYPE html>\n<html><head><title>A</title>\n</head>\n<body><p align="right" style="color: red;" data-bind="style: { color: \'red\' }">B</p><div data-bind="text: content">dummy content</div>\n\n</body></html>',r='<!DOCTYPE html>\n<html><head><title>A</title>\n</head>\n<body><p style="color: red;" data-bind="style: { color: \'red\' }" align="right">B</p><div data-bind="text: content">dummy content</div>\n\n</body></html>',d='<!DOCTYPE html>\n<html><head><title>A</title>\n</head>\n<body><p style="color: red;" align="right" data-bind="style: { color: \'red\' }">B</p><div data-bind="text: content">dummy content</div>\n\n</body></html>';if(a!==i&&r!==i&&d!==i)throw console.info("BadBrowser.FrameContentCheck",i.length,a.length,r.length,d.length,i==a,i==r,i==d),console.warn("Detected incompatible/misbehaving browser, probably introduced by a bad browser extension."),console.warn(i),"Detected misbehaving browser/extension: unexpected frame content."},fixPageEvents=function(){global.addEventListener&&(global.addEventListener("drag",function(e){(e=e||global.event).preventDefault()},!1),global.addEventListener("dragstart",function(e){(e=e||global.event).preventDefault()},!1),global.addEventListener("dragover",function(e){(e=e||global.event).preventDefault()},!1),global.addEventListener("drop",function(e){(e=e||global.event).preventDefault()},!1),global.document.body.addEventListener("drop",function(e){e.preventDefault()},!1)),global.document.ondragstart&&(global.document.ondragstart=function(){return!1})};module.exports={compile:templateCompiler,load:templateLoader,isCompatible:isCompatible,fixPageEvents:fixPageEvents};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"./bindings/choose-template.js":31,"./converter/main.js":55,"./viewmodel.js":71,"console-browserify":6}],67:[function(require,module,exports){
|
||
"use strict";var console=require("console-browserify"),_call=function(e){return e()},logs=[],_timedCall=function(e,o){var t,l=(new Date).getTime();"object"==typeof console&&console.time&&console.time(e),t=_call(o),"object"==typeof console&&console.time&&console.timeEnd(e);var n=(new Date).getTime()-l;return"object"!=typeof console||console.time||"function"==typeof console.debug&&console.debug(e,"took",n,"ms"),logs.push({name:e,time:n}),logs.length>100&&logs.unshift(),t};module.exports={timedCall:_timedCall,logs:logs};
|
||
|
||
},{"console-browserify":6}],68:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,undoManager=require("./undomanager.js"),undoserializer=require("./undoserializer.js"),addUndoStackExtensionMaker=function(e){return function(n){n.contentListeners(n.contentListeners()+2);var o=undoManager(n.content,{levels:100,undoLabel:ko.computed(function(){return n.t("Undo (#COUNT#)")}),redoLabel:ko.computed(function(){return n.t("Redo")})});return n.undo=o.undoCommand,n.undo.execute=e.bind(n,"undo",n.undo.execute),n.redo=o.redoCommand,n.redo.execute=e.bind(n,"redo",n.redo.execute),n.undoReset=e.bind(n,"undoReset",o.reset),n.setUndoModeMerge=o.setModeMerge,n.setUndoModeOnce=o.setModeOnce,o.setModeIgnore(),o.setUndoActionMaker(undoserializer.makeUndoAction.bind(void 0,n.content)),undoserializer.watchEnabled(!0),{pause:function(){o.setModeIgnore()},run:function(){o.setModeOnce()},init:function(){o.setModeOnce()},dispose:function(){n.contentListeners(n.contentListeners()-2),undoserializer.watchEnabled(!1),o.dispose()}}}};module.exports=addUndoStackExtensionMaker;
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"./undomanager.js":69,"./undoserializer.js":70}],69:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,reactor=require("ko-reactor/dist/ko-reactor.min.js"),console=require("console-browserify"),undoManager=function(e,o){var n,t=ko.observableArray(),i=ko.observableArray(),r=0,d=0,l={levels:100,undoLabel:"undo (#COUNT#)",redoLabel:"redo (#COUNT#)"};o="object"==typeof o?ko.utils.extend(l,o):l;var u=function(e){1==r?a(e,i):2==r?a(e,t):0==r&&(a(e,t),i.removeAll())},a=function(e,t){if(t().length>0){var i=(d=e,void 0!==(r=t()[t().length-1]).mergedAction?r.mergedAction(d):null);if(null!==i)return void(t()[t().length-1]=i)}var r,d;t().length>=o.levels&&t.shift(),n=t,t.push(e)},c=function(e,o,t){return{name:ko.computed(function(){return ko.utils.unwrapObservable(e).replace(/#COUNT#/,t().length)}),enabled:ko.computed(function(){return 0!==t().length}),execute:function(){var e=t.pop();if(e){var i=r;r=o;var l=d;d=3,e(),s(n),d=l,r=i}return!0}}},s=function(e){if(void 0===e)throw"Unexpected operation: stack cleaner called with undefined stack";e().length>0&&void 0!==e()[e().length-1].mergedAction&&delete e()[e().length-1].mergedAction},f=function(e,o){var n=function(e,o){e(),o()}.bind(void 0,e,o);return void 0!==e.mergedAction&&(n.mergedAction=e.mergedAction),n},m=function(e,o,n){if(void 0!==o)e(o);else{if(!n)throw"Unexpected condition: no item and no child.oldValues!";if("deleted"==n.status)e.splice(n.index,0,n.value);else{if("added"!=n.status)throw"Unsupported item.status: "+n.status;e.splice(n.index,1)}}},v=function(e,o,n,t,i){return e.bind(void 0,n,t,i)},g=("function"==typeof reactor?reactor:ko.watch)(e,{depth:-1,oldValues:1,mutable:!0,tagFields:!0},function(e,o,n){var t=void 0!==o.oldValues?o.oldValues[0]:void 0,i=v(m,e,o,t,n);1!=d&&(3==d?void 0!==i&&(i.mergedAction=function(e){return void 0!==e.mergeMe&&e.mergeMe?f(e,this):null},i.mergeMe=!0):void 0!==i&&(o.oldValues&&2==d&&(i.mergedAction=function(e,o,n){return"object"==typeof n.mergeableAction&&e==n.mergeableAction.child?this:null}.bind(i,o,n),i.mergeableAction={child:o,item:n}),n&&"deleted"==n.status?i.mergedAction=function(e,o,n){return"object"==typeof n.mergeableMove&&o.value==n.mergeableMove.item.value?f(n,this):null}.bind(i,o,n):n&&"added"==n.status?i.mergeableMove={child:o,item:n}:n&&console.warn("Unsupported item.status",n.status)),void 0!==i&&u(i))},{});return{push:u,undoCommand:c(o.undoLabel,1,t),redoCommand:c(o.redoLabel,2,i),reset:function(){t.removeAll(),i.removeAll()},setModeOnce:function(){d=2,s(t)},setModeMerge:function(){d=3,s(t)},setModeNormal:function(){d=0,s(t)},setModeIgnore:function(){d=1,s(t)},setUndoActionMaker:function(e){v=e},dispose:function(){g.dispose()}}};module.exports=undoManager;
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6,"ko-reactor/dist/ko-reactor.min.js":16}],70:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var listener,watchEnabled,ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,console=require("console-browserify"),_reference=function(e,n){for(var t,o,r=0,a=e;r<n.length;)switch(n.charAt(r)){case"(":")"==n.charAt(r+1)&&(a=a()),r+=2;break;case"[":o=n.indexOf("]",r),a=a[n.substring(r+1,o)],r=o+1;break;case".":-1==(t=n.indexOf("(",r))&&(t=n.length),-1==(o=n.indexOf("[",r))&&(o=n.length),o=Math.min(t,o),a=a[n.substring(r+1,o)],r=o}return a},_getPath=function(e,n){for(var t,o="",r=0;r<=e.length;r++)if(t=r<e.length?e[r]:n,ko.isObservable(t)&&(o+="()"),void 0!==t._fieldName)o+="."+t._fieldName;else{if(!(r>0&&"function"==typeof e[r-1].pop))throw console.error("Unexpected parent with no _fieldName and no parent array",r,e),"Unexpected parent with no _fieldName and no parent array";var a=ko.isObservable(e[r-1])?ko.utils.peekObservable(e[r-1]):e[r-1],i=ko.utils.arrayIndexOf(a,t);if(-1==i)throw console.error("Unexpected object not found in parent array",a,t,r,e.length,ko.toJS(a),ko.utils.unwrapObservable(t)),"Unexpected object not found in parent array";o+="["+i+"]"}return o},makeDereferencedUndoAction=function(e,n,t,o,r){e(_reference(n,t),o,r)},_setListener=function(e){listener=e},makeUndoActionDereferenced=function(e,n,t,o,r,a){try{var i=_getPath(t,o);if("object"!=typeof r&&"function"!=typeof r||(r=ko.toJS(r)),void 0===a||"object"!=typeof a.value&&"function"!=typeof a.value||(a=ko.toJS(a)),void 0!==listener)try{listener(i,o,r,a)}catch(e){console.log("Undoserializer ignoring exception in listener callback")}return makeDereferencedUndoAction.bind(void 0,n,e,i,r,a)}catch(e){console.error("Exception processing undo",e,t,o,a)}},_watchEnabled=function(e){if(void 0===e)return watchEnabled;watchEnabled=e};module.exports={dereference:_getPath,reference:_reference,makeUndoAction:makeUndoActionDereferenced,setListener:_setListener,watchEnabled:_watchEnabled};
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"console-browserify":6}],71:[function(require,module,exports){
|
||
(function (global){
|
||
"use strict";var $="undefined"!=typeof window?window.jQuery:"undefined"!=typeof global?global.jQuery:null,ko="undefined"!=typeof window?window.ko:"undefined"!=typeof global?global.ko:null,console=require("console-browserify"),performanceAwareCaller=require("./timed-call.js").timedCall,toastr=require("toastr");function initializeEditor(e,o,t,l){var r={galleryRecent:ko.observableArray([]).extend({paging:16}),galleryRemote:ko.observableArray([]).extend({paging:16}),selectedBlock:ko.observable(null),selectedItem:ko.observable(null),selectedTool:ko.observable(0),selectedImageTab:ko.observable(0),dragging:ko.observable(!1),draggingImage:ko.observable(!1),galleryLoaded:ko.observable(!1),showPreviewFrame:ko.observable(!1),previewMode:ko.observable("mobile"),showToolbox:ko.observable(!0),showTheme:ko.observable(!1),showGallery:ko.observable(!1),debug:ko.observable(!1),contentListeners:ko.observable(0),logoPath:"rs/img/mosaico32.png",logoUrl:".",logoAlt:"mosaico"};return r.content=e,r.blockDefs=o,r.notifier=toastr,r.tt=function(e,o){if(void 0!==o)for(var t in o)o.hasOwnProperty(t)&&(e=e.replace(new RegExp("__"+t+"__","g"),o[t]));return e},r.t=r.tt,r.ut=function(e,o){return o},r.templatePath=t,r.remoteUrlProcessor=function(e){return e},r.remoteFileProcessor=function(e){return void 0!==e.url&&(e.url=r.remoteUrlProcessor(e.url)),void 0!==e.thumbnailUrl&&(e.thumbnailUrl=r.remoteUrlProcessor(e.thumbnailUrl)),e},r.loadGallery=function(){r.galleryLoaded("loading");var e=l||"/upload/";$.getJSON(e,function(e){for(var o=0;o<e.files.length;o++)e.files[o]=r.remoteFileProcessor(e.files[o]);r.galleryLoaded(e.files.length),r.galleryRemote(e.files.reverse())}).fail(function(){r.galleryLoaded(!1),r.notifier.error(r.t("Unexpected error listing files"))})},r.fileToImage=function(e,o,t){return e.url},r.removeBlock=function(e,o){ko.utils.unwrapObservable(r.selectedBlock)==ko.utils.unwrapObservable(e)&&r.selectBlock(null,!0);var t=o.blocks.remove(e);return r.notifier.info(r.t("Block removed: use undo button to restore it...")),t},r.duplicateBlock=function(e,o){var t=ko.utils.unwrapObservable(e),l=ko.toJS(ko.utils.unwrapObservable(o.blocks)[t]);void 0!==l.id&&(l.id=""),o.blocks.splice(t+1,0,l)},r.moveBlock=function(e,o,t){var l=ko.utils.unwrapObservable(e),n=ko.utils.unwrapObservable(o.blocks);if(t&&l>0||!t&&l<n.length-1){var a=l+(t?-1:1),i=n[a];r.startMultiple(),o.blocks.splice(a,1),o.blocks.splice(l,0,i),r.stopMultiple()}},r.loadDefaultBlocks=function(){var e=ko.toJS(r.content().mainBlocks);e.blocks=[];for(var o=ko.utils.unwrapObservable(r.blockDefs),t=0;t<o.length;t++){var l=ko.toJS(o[t]);l.id="block_"+t,e.blocks.push(l)}performanceAwareCaller("setMainBlocks",r.content().mainBlocks._wrap.bind(r.content().mainBlocks,e))},r.addImage=function(e){var o=$("#main-wysiwyg-area .selectable-img.selecteditem");return 1==o.length&&"object"==typeof e&&void 0!==e.url&&(ko.contextFor(o[0])._src(e.url),!0)},r.addBlock=function(e,o){var t,l,n=r.selectedBlock();if(null!==n)for(var a=r.content().mainBlocks().blocks().length-1;a>=0;a--)if(r.content().mainBlocks().blocks()[a]()==n){t=a;break}void 0!==t?(l=t+1,r.content().mainBlocks().blocks.splice(l,0,e),r.notifier.info(r.t("New block added after the selected one (__pos__)",{pos:l}))):(r.content().mainBlocks().blocks.push(e),l=r.content().mainBlocks().blocks().length-1,r.notifier.info(r.t("New block added at the model bottom (__pos__)",{pos:l})));var i=r.content().mainBlocks().blocks()[l]();return r.selectBlock(i,!0),!1},r.findObjectsOfType=function(e,o){var t=[],l=ko.utils.unwrapObservable(e);for(var r in l)if(l.hasOwnProperty(r)){var n=ko.utils.unwrapObservable(l[r]);if(r.match(/Blocks$/))for(var a=ko.utils.unwrapObservable(n.blocks),i=0;i<a.length;i++){var c=ko.utils.unwrapObservable(a[i]);null!==o&&ko.utils.unwrapObservable(c.type)!=o||t.push(c)}else"object"==typeof n&&null!==n&&(null!==o&&ko.utils.unwrapObservable(n.type)!=o||t.push(n))}return t},r.placeholderHelper={element:function(e){return $(e[0].outerHTML).removeClass("ui-draggable").addClass("sortable-placeholder").css("display","block").css("position","relative").css("width","100%").css("height","auto").css("opacity",".8")[0]},update:function(e,o){}},r.startMultiple=function(){void 0!==r.setUndoModeMerge&&r.setUndoModeMerge()},r.stopMultiple=function(){void 0!==r.setUndoModeOnce&&r.setUndoModeOnce()},r.localGlobalSwitch=function(e,o){var t=e();return e(null===t?o():null),!1},r.selectItem=function(e,o,t){var l=ko.utils.peekObservable(e);return void 0!==t&&r.selectBlock(t,!1,!0),l!=o&&(e(o),null!==o&&0===r.selectedTool()&&r.selectedTool(1)),!1}.bind(r,r.selectedItem),r.isSelectedItem=function(e){return r.selectedItem()==e},r.selectBlock=function(e,o,t,l){var n=ko.utils.peekObservable(e);l||r.selectItem(null),n!=o&&(e(o),r.showGallery(!1),null===o||t||0!==r.selectedTool()||r.selectedTool(1))}.bind(r,r.selectedBlock),r.countSubscriptions=function(e,o){var t=0;for(var l in e)if(e.hasOwnProperty(l)){var n=e[l];if(ko.isObservable(n)&&(void 0!==n._defaultComputed&&(void 0!==o&&console.log(o+"/"+l+"/_",n._defaultComputed.getSubscriptionsCount()),t+=n._defaultComputed.getSubscriptionsCount()),void 0!==o&&console.log(o+"/"+l+"/-",n.getSubscriptionsCount()),t+=n.getSubscriptionsCount(),n=ko.utils.unwrapObservable(n)),"object"==typeof n&&null!==n){var a=r.countSubscriptions(n,void 0!==o?o+"/"+l+"@":void 0);void 0!==o&&console.log(o+"/"+l+"@",a),t+=a}}return t},r.loopSubscriptionsCount=function(){var e=r.countSubscriptions(r.content());global.document.getElementById("subscriptionsCount").innerHTML=e,global.setTimeout(r.loopSubscriptionsCount,1e3)},r.export=function(){return performanceAwareCaller("exportHTML",r.exportHTML)},r.exportHTML=function(){var e="exportframe";$("body").append('<iframe id="'+e+'" data-bind="bindIframe: $data"></iframe>');var o=global.document.getElementById(e);ko.applyBindings(r,o),ko.cleanNode(o),r.inline&&r.inline(o.contentWindow.document);var t=o.contentWindow.document.doctype,l="<!DOCTYPE "+t.name+(t.publicId?' PUBLIC "'+t.publicId+'"':"")+(!t.publicId&&t.systemId?" SYSTEM":"")+(t.systemId?' "'+t.systemId+'"':"")+">\n"+o.contentWindow.document.documentElement.outerHTML;ko.removeNode(o);var n=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=l.replace(/<script ([^>]* )?type="text\/html"[^>]*>[\s\S]*?<\/script>/gm,"")).replace(/<!-- ko ((?!--).)*? -->/g,"")).replace(/<!-- \/ko -->/g,"")).replace(/ data-bind="[^"]*"/gm,"")).replace(/ data-mce-(href|src|style)="[^"]*"/gm,"")).replace(/ style="[^"]*"([^>]*) replaced(style="[^"]*")/gm,"$1 $2")).replace(/ replaced(style="[^"]*")([^>]*) style="[^"]*"/gm," $1$2")).replace(/ replaced(style="[^"]*")/gm," $1")).replace(/ http-equiv="[^"]*"([^>]*) replaced(http-equiv="[^"]*")/gm,"$1 $2")).replace(/ replaced(http-equiv="[^"]*")([^>]*) http-equiv="[^"]*"/gm," $1$2")).replace(/ replaced(http-equiv="[^"]*")/gm," $1")).replace(/<replacedcc[^>]* condition="([^"]*)"[^>]*>([\s\S]*?)<\/replacedcc>/g,function(e,o,t){var l="\x3c!--[if "+o.replace(/&/,"&")+"]>";return(l+=t.replace(/<!-- cc:bc:([A-Za-z:]*) -->(<\/cc>)?<!-- cc:ac:\1 -->/g,"</$1>").replace(/><\/cc><!-- cc:sc -->/g,"/>").replace(/<!-- cc:bo:([A-Za-z:]*) --><cc/g,"<$1").replace(/^.*<!-- cc:start -->/,"").replace(/<!-- cc:end -->.*$/,""))+"<![endif]--\x3e"})).match(/ data-[^ =]+(="[^"]+")? /)||l.match(/ replaced([^= ]*=)/);return n&&console.warn("Output HTML contains unexpected data- attributes or replaced attributes",n),l},r.exportHTMLtoTextarea=function(e){$(e).val(r.exportHTML())},r.exportJSONtoTextarea=function(e){$(e).val(r.exportJSON())},r.importJSONfromTextarea=function(e){r.importJSON($(e).val())},r.exportMetadata=function(){return ko.toJSON(r.metadata)},r.exportJSON=function(){return ko.toJSON(r.content)},r.exportJS=function(){return ko.toJS(r.content)},r.importJSON=function(e){var o=ko.utils.parseJson(e);r.content._wrap(o)},r.exportTheme=function(){var e={},o=r.content().theme(),t=function(e,o,l){for(var r in l)if(l.hasOwnProperty(r)){var n=ko.utils.unwrapObservable(l[r]);null!==n&&"object"==typeof n?t(r+".",o,n):o[e+r]=n}};t("",e,o);var l="";for(var n in e)e.hasOwnProperty(n)&&"type"!=n&&(l+=n+": "+e[n]+";\n");return l},r.loadImage=function(e){r.galleryRecent.unshift(e),r.selectedImageTab(0)},r.selectImage=function(e){r.showGallery(!0)},r.dialog=function(e,o){$(e).dialog(o)},r.log=function(e,o){},r.selectedImageTab.subscribe(function(e){1==e&&!1===r.galleryLoaded()&&r.loadGallery()},r,"change"),r}toastr.options={closeButton:!1,debug:!1,positionClass:"toast-bottom-full-width",target:"#mo-body",onclick:null,showDuration:"300",hideDuration:"1000",timeOut:"5000",extendedTimeOut:"1000",showEasing:"swing",hideEasing:"linear",showMethod:"fadeIn",hideMethod:"fadeOut"},module.exports=initializeEditor;
|
||
|
||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
||
|
||
},{"./timed-call.js":67,"console-browserify":6,"toastr":25}]},{},[28,1])(28)
|
||
});
|
||
//# sourceMappingURL=mosaico.min.js.map
|