diff --git a/app.py b/app.py
index 969dca0..de3ae9b 100644
--- a/app.py
+++ b/app.py
@@ -14,16 +14,29 @@ os.makedirs(PHOTO_DIR, exist_ok=True)
CURRENT_LAYOUT = os.path.join(LAYOUT_DIR, "current.json")
def get_layout():
+ # V2: GrapesJS project JSON stored in current_v2.json
+ v2_path = os.path.join(LAYOUT_DIR, "current_v2.json")
+ if os.path.exists(v2_path):
+ with open(v2_path) as f:
+ return json.load(f)
+ # No V2 layout yet — return empty so GrapesJS starts fresh
+ return {}
+
+def get_v1_layout():
+ """Legacy V1 layout for reference"""
if os.path.exists(CURRENT_LAYOUT):
with open(CURRENT_LAYOUT) as f:
return json.load(f)
- default = os.path.join(LAYOUT_DIR, "default.json")
- with open(default) as f:
- layout = json.load(f)
- save_layout(layout)
- return layout
+ return {}
def save_layout(layout):
+ # V2: save GrapesJS project data
+ v2_path = os.path.join(LAYOUT_DIR, "current_v2.json")
+ with open(v2_path, "w") as f:
+ json.dump(layout, f, indent=2)
+
+def save_v1_layout(layout):
+ """Legacy V1 save"""
with open(CURRENT_LAYOUT, "w") as f:
json.dump(layout, f, indent=2)
diff --git a/static/hmi-blocks.js b/static/hmi-blocks.js
new file mode 100644
index 0000000..99ff333
--- /dev/null
+++ b/static/hmi-blocks.js
@@ -0,0 +1,277 @@
+/* BFA Banana Dryer — Custom HMI Blocks for GrapesJS */
+
+function registerHMIBlocks(editor) {
+ const bm = editor.BlockManager;
+ const dm = editor.DomComponents;
+
+ // ── Shared styles ──
+ const cardBase = {
+ 'display': 'flex', 'flex-direction': 'column', 'align-items': 'center', 'justify-content': 'center',
+ 'gap': '6px', 'padding': '16px', 'border-radius': '10px', 'cursor': 'pointer',
+ 'min-height': '120px', 'width': '48%', 'font-family': 'Segoe UI, system-ui, sans-serif',
+ 'border': '1px solid #1e2a45', 'transition': 'background 0.15s', 'box-sizing': 'border-box'
+ };
+
+ // ══════════════════════════════════════════
+ // TEMPERATURE CARD
+ // ══════════════════════════════════════════
+ dm.addType('temp-card', {
+ model: {
+ defaults: {
+ tagName: 'div',
+ draggable: true,
+ droppable: false,
+ attributes: {'data-type': 'temp'},
+ traits: [
+ {type: 'text', name: 'label', label: 'Name', changeProp: true},
+ {type: 'color', name: 'temp_color', label: 'Temp Color', changeProp: true},
+ {type: 'number', name: 'setpoint', label: 'Setpoint (°C)', changeProp: true, min: 0, max: 200},
+ {type: 'text', name: 'linked_id', label: 'Linked Control ID', changeProp: true},
+ ],
+ label: 'Heat Input',
+ temp_color: '#ff4444',
+ setpoint: 130,
+ linked_id: '',
+ components: [
+ {tagName: 'div', attributes: {'data-role': 'name'}, content: 'Heat Input',
+ style: {'font-size': '20px', 'color': '#7a8baa'}},
+ {tagName: 'div', attributes: {'data-role': 'value'}, content: '-- °C',
+ style: {'font-size': '36px', 'font-weight': '700', 'color': '#ff4444'}},
+ {tagName: 'div', attributes: {'data-role': 'bar'},
+ style: {'width': '80%', 'height': '6px', 'background': '#1a2240', 'border-radius': '3px', 'overflow': 'hidden'},
+ components: [{tagName: 'div', style: {'width': '50%', 'height': '100%', 'background': '#ff4444', 'border-radius': '3px'}}]},
+ {tagName: 'div', attributes: {'data-role': 'sp'}, content: 'SP: 130 °C',
+ style: {'font-size': '14px', 'color': '#4a5670'}},
+ ],
+ style: {...cardBase, 'background': '#131a2b'},
+ }
+ }
+ });
+
+ bm.add('temp-card', {
+ label: '🌡 Temperature',
+ category: 'HMI Controls',
+ content: {type: 'temp-card'},
+ attributes: {class: 'gjs-fonts gjs-f-b1'}
+ });
+
+ // ══════════════════════════════════════════
+ // MOTOR CARD
+ // ══════════════════════════════════════════
+ dm.addType('motor-card', {
+ model: {
+ defaults: {
+ tagName: 'div',
+ draggable: true,
+ droppable: false,
+ attributes: {'data-type': 'motor'},
+ traits: [
+ {type: 'text', name: 'label', label: 'Name', changeProp: true},
+ {type: 'number', name: 'speed_sp', label: 'Speed SP (%)', changeProp: true, min: 0, max: 100, step: 5},
+ {type: 'color', name: 'active_color', label: 'Active Color', changeProp: true},
+ {type: 'color', name: 'inactive_color', label: 'Inactive Color', changeProp: true},
+ {type: 'select', name: 'animation', label: 'Animation', changeProp: true,
+ options: [{value:'none'},{value:'fan'},{value:'agitator'},{value:'conveyor'},{value:'pulse'},{value:'vibrate'},{value:'glow'},{value:'blink'},{value:'flow'}]},
+ {type: 'text', name: 'linked_id', label: 'Linked Control ID', changeProp: true},
+ ],
+ label: 'Motor',
+ speed_sp: 50,
+ active_color: '#00c853',
+ inactive_color: '#ff1744',
+ animation: 'none',
+ linked_id: '',
+ components: [
+ {tagName: 'div', style: {'display': 'flex', 'gap': '10px', 'align-items': 'center'},
+ components: [
+ {tagName: 'span', attributes: {'data-role': 'name'}, content: 'Motor',
+ style: {'font-size': '24px', 'font-weight': '600', 'color': '#e8ecf4'}},
+ {tagName: 'span', attributes: {'data-role': 'speed'}, content: '50%',
+ style: {'font-size': '24px', 'color': '#7a8baa'}},
+ ]},
+ {tagName: 'div', attributes: {'data-role': 'state'}, content: 'OFF',
+ style: {'font-size': '36px', 'font-weight': '700', 'color': '#e8ecf4'}},
+ ],
+ style: {...cardBase, 'background': '#ff1744'},
+ }
+ }
+ });
+
+ bm.add('motor-card', {
+ label: '⚙ Motor / Speed',
+ category: 'HMI Controls',
+ content: {type: 'motor-card'},
+ });
+
+ // ══════════════════════════════════════════
+ // OUTPUT CARD
+ // ══════════════════════════════════════════
+ dm.addType('output-card', {
+ model: {
+ defaults: {
+ tagName: 'div',
+ draggable: true,
+ droppable: false,
+ attributes: {'data-type': 'output'},
+ traits: [
+ {type: 'text', name: 'label', label: 'Name', changeProp: true},
+ {type: 'color', name: 'active_color', label: 'Active Color', changeProp: true},
+ {type: 'color', name: 'inactive_color', label: 'Inactive Color', changeProp: true},
+ {type: 'text', name: 'linked_id', label: 'Linked Control ID', changeProp: true},
+ ],
+ label: 'Output',
+ active_color: '#00c853',
+ inactive_color: '#ff1744',
+ linked_id: '',
+ components: [
+ {tagName: 'div', attributes: {'data-role': 'name'}, content: 'Output',
+ style: {'font-size': '20px', 'text-align': 'center', 'color': '#e8ecf4'}},
+ {tagName: 'div', attributes: {'data-role': 'state'}, content: 'OFF',
+ style: {'font-size': '28px', 'font-weight': '700', 'color': '#e8ecf4'}},
+ ],
+ style: {...cardBase, 'background': '#ff1744'},
+ }
+ }
+ });
+
+ bm.add('output-card', {
+ label: '⚡ Output / Switch',
+ category: 'HMI Controls',
+ content: {type: 'output-card'},
+ });
+
+ // ══════════════════════════════════════════
+ // BURNER CARD
+ // ══════════════════════════════════════════
+ dm.addType('burner-card', {
+ model: {
+ defaults: {
+ tagName: 'div',
+ draggable: true,
+ droppable: false,
+ attributes: {'data-type': 'burner'},
+ traits: [
+ {type: 'text', name: 'label', label: 'Name', changeProp: true},
+ {type: 'color', name: 'active_color', label: 'Active Color', changeProp: true},
+ {type: 'color', name: 'inactive_color', label: 'Inactive Color', changeProp: true},
+ ],
+ label: 'Burner',
+ active_color: '#ffab00',
+ inactive_color: '#ff1744',
+ components: [
+ {tagName: 'div', attributes: {'data-role': 'name'}, content: 'Burner',
+ style: {'font-size': '24px', 'color': '#e8ecf4'}},
+ {tagName: 'div', attributes: {'data-role': 'state'}, content: 'OFF',
+ style: {'font-size': '32px', 'font-weight': '700', 'color': '#e8ecf4'}},
+ ],
+ style: {...cardBase, 'background': '#ff1744'},
+ }
+ }
+ });
+
+ bm.add('burner-card', {
+ label: '🔥 Burner',
+ category: 'HMI Controls',
+ content: {type: 'burner-card'},
+ });
+
+ // ══════════════════════════════════════════
+ // AUTOMATION CARD
+ // ══════════════════════════════════════════
+ dm.addType('automation-card', {
+ model: {
+ defaults: {
+ tagName: 'div',
+ draggable: true,
+ droppable: false,
+ attributes: {'data-type': 'automation'},
+ traits: [
+ {type: 'text', name: 'label', label: 'Name', changeProp: true},
+ {type: 'color', name: 'active_color', label: 'Active Color', changeProp: true},
+ {type: 'color', name: 'inactive_color', label: 'Inactive Color', changeProp: true},
+ ],
+ label: 'Automation',
+ active_color: '#00c853',
+ inactive_color: '#ff1744',
+ components: [
+ {tagName: 'div', attributes: {'data-role': 'name'}, content: 'Automation',
+ style: {'font-size': '24px', 'font-weight': '700', 'color': '#e8ecf4'}},
+ {tagName: 'div', attributes: {'data-role': 'rules'}, content: 'Click to configure',
+ style: {'font-size': '12px', 'color': '#7a8baa'}},
+ ],
+ style: {...cardBase, 'background': '#ff1744', 'width': '100%'},
+ }
+ }
+ });
+
+ bm.add('automation-card', {
+ label: '🤖 Automation',
+ category: 'HMI Controls',
+ content: {type: 'automation-card'},
+ });
+
+ // ══════════════════════════════════════════
+ // GAUGE (arc)
+ // ══════════════════════════════════════════
+ bm.add('gauge', {
+ label: '📊 Gauge',
+ category: 'HMI Controls',
+ content: `
+
+
+
+ 50%
+
+
`,
+ });
+
+ // ══════════════════════════════════════════
+ // LAYOUT HELPERS
+ // ══════════════════════════════════════════
+ bm.add('page-container', {
+ label: '📄 Page Container',
+ category: 'Layout',
+ content: `
+
`,
+ });
+
+ bm.add('tab-bar', {
+ label: '📑 Tab Bar',
+ category: 'Layout',
+ content: `
+
PAGE 1
+
PAGE 2
+
PAGE 3
+
`,
+ });
+
+ bm.add('top-bar', {
+ label: '📌 Top Bar',
+ category: 'Layout',
+ content: `
+
+ BFA BANANA DRYER
+ SAE Engineering
+
+
RS485 OFFLINE
+
`,
+ });
+
+ bm.add('text-label', {
+ label: '📝 Text Label',
+ category: 'Layout',
+ content: `Label Text
`,
+ });
+
+ bm.add('divider', {
+ label: '➖ Divider',
+ category: 'Layout',
+ content: `
`,
+ });
+
+ bm.add('spacer', {
+ label: '⬜ Spacer',
+ category: 'Layout',
+ content: `
`,
+ });
+}
diff --git a/static/hmi-canvas.css b/static/hmi-canvas.css
new file mode 100644
index 0000000..e978ce0
--- /dev/null
+++ b/static/hmi-canvas.css
@@ -0,0 +1,8 @@
+/* Canvas styles — injected into GrapesJS iframe */
+:root {
+ --bg: #0a0e17; --card: #131a2b; --border: #1e2a45;
+ --text: #e8ecf4; --text2: #7a8baa; --dim: #4a5670;
+ --blue: #2d7ff9; --green: #00c853; --amber: #ffab00; --red: #ff1744;
+}
+body { margin: 0; background: var(--bg); font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text); }
+* { box-sizing: border-box; }
diff --git a/static/hmi-themes.js b/static/hmi-themes.js
new file mode 100644
index 0000000..3def930
--- /dev/null
+++ b/static/hmi-themes.js
@@ -0,0 +1,41 @@
+/* BFA Banana Dryer — HMI Theme Presets */
+
+const HMI_THEMES = {
+ 'dark-industrial': {
+ '--bg': '#0a0e17', '--card': '#131a2b', '--border': '#1e2a45',
+ '--text': '#e8ecf4', '--text2': '#7a8baa', '--dim': '#4a5670',
+ '--blue': '#2d7ff9', '--green': '#00c853', '--amber': '#ffab00', '--red': '#ff1744',
+ },
+ 'light-industrial': {
+ '--bg': '#f0f2f5', '--card': '#ffffff', '--border': '#d0d5dd',
+ '--text': '#1a1a2e', '--text2': '#667085', '--dim': '#98a2b3',
+ '--blue': '#2563eb', '--green': '#16a34a', '--amber': '#d97706', '--red': '#dc2626',
+ },
+ 'high-contrast': {
+ '--bg': '#000000', '--card': '#1a1a1a', '--border': '#444444',
+ '--text': '#ffffff', '--text2': '#cccccc', '--dim': '#888888',
+ '--blue': '#00aaff', '--green': '#00ff55', '--amber': '#ffcc00', '--red': '#ff3333',
+ },
+ 'classic-scada': {
+ '--bg': '#c0c0c0', '--card': '#d4d4d4', '--border': '#808080',
+ '--text': '#000000', '--text2': '#333333', '--dim': '#666666',
+ '--blue': '#0000cc', '--green': '#008800', '--amber': '#cc8800', '--red': '#cc0000',
+ }
+};
+
+function applyHMITheme(editor, themeName) {
+ const theme = HMI_THEMES[themeName];
+ if (!theme) return;
+
+ // Apply to canvas iframe
+ const frame = editor.Canvas.getFrameEl();
+ if (frame && frame.contentDocument) {
+ const doc = frame.contentDocument.documentElement;
+ Object.entries(theme).forEach(([k, v]) => doc.style.setProperty(k, v));
+ doc.style.background = theme['--bg'];
+ }
+
+ // Apply to editor UI
+ const root = document.documentElement;
+ Object.entries(theme).forEach(([k, v]) => root.style.setProperty(k, v));
+}
diff --git a/static/vendor/grapes.min.css b/static/vendor/grapes.min.css
new file mode 100644
index 0000000..d8f0576
--- /dev/null
+++ b/static/vendor/grapes.min.css
@@ -0,0 +1 @@
+.CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20, 255, 20, 0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:blue}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:red}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, 0.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, 0.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42 !important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0px}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498 !important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom{color:#c85e7c}.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-property,.cm-s-hopscotch span.cm-attribute{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{text-decoration:underline;color:white !important}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}.sp-container{position:absolute;top:0;left:0;display:inline-block;z-index:9999994;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{position:absolute;top:0;left:0;bottom:0;right:0}.sp-color{position:absolute;top:0;left:0;bottom:0;right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid #000;background:#fff;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:solid 1px #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0px;right:0;bottom:0;left:84%;height:28px}.sp-container,.sp-replacer,.sp-preview,.sp-dragger,.sp-slider,.sp-alpha,.sp-clear,.sp-alpha-handle,.sp-container.sp-dragging .sp-input,.sp-container button{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-input-disabled .sp-input-container{display:none}.sp-container.sp-buttons-disabled .sp-button-container{display:none}.sp-container.sp-palette-buttons-disabled .sp-palette-button-container{display:none}.sp-palette-only .sp-picker-container{display:none}.sp-palette-disabled .sp-palette-container{display:none}.sp-initial-disabled .sp-initial{display:none}.sp-sat{background-image:-webkit-gradient(linear, 0 0, 100% 0, from(#fff), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));background-image:linear-gradient(to right, #fff, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr="#FFFFFFFF", endColorstr="#00CC9A81")}.sp-val{background-image:-webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));background-image:-webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));background-image:-moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:-ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));background-image:linear-gradient(to top, #000, rgba(204, 154, 129, 0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00CC9A81", endColorstr="#FF000000")}.sp-hue{background:-moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:-webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));background:-webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);background:linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff0000", endColorstr="#ffff00")}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ffff00", endColorstr="#00ff00")}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00", endColorstr="#00ffff")}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ffff", endColorstr="#0000ff")}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff", endColorstr="#ff00ff")}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#ff00ff", endColorstr="#ff0000")}.sp-hidden{display:none !important}.sp-cf:before,.sp-cf:after{content:"";display:table}.sp-cf:after{clear:both}@media(max-device-width: 480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;position:absolute;top:0;left:0}.sp-slider{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:#fff;opacity:.8}.sp-container{border-radius:0;background-color:#ececec;border:solid 1px #f0c49b;padding:0}.sp-container,.sp-container button,.sp-container input,.sp-color,.sp-hue,.sp-clear{font:normal 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-color,.sp-hue,.sp-clear{border:solid 1px #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container{width:100%}.sp-input{font-size:12px !important;border:1px inset;padding:4px 5px;margin:0;width:100%;background:rgba(0,0,0,0);border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-picker-container,.sp-palette-container{float:left;position:relative;padding:10px;padding-bottom:300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:solid 2px rgba(0,0,0,0)}.sp-palette .sp-thumb-el:hover,.sp-palette .sp-thumb-el.sp-thumb-active{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:solid 1px #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-palette-button-container,.sp-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;border:solid 1px #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer:hover,.sp-replacer.sp-active{border-color:#f0c49b;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:solid 1px #222;margin-right:5px;float:left;z-index:0}.sp-palette{max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:solid 1px #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top, #eeeeee, #cccccc);background-image:-moz-linear-gradient(top, #eeeeee, #cccccc);background-image:-ms-linear-gradient(top, #eeeeee, #cccccc);background-image:-o-linear-gradient(top, #eeeeee, #cccccc);background-image:linear-gradient(to bottom, #eeeeee, #cccccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top, #dddddd, #bbbbbb);background-image:-moz-linear-gradient(top, #dddddd, #bbbbbb);background-image:-ms-linear-gradient(top, #dddddd, #bbbbbb);background-image:-o-linear-gradient(top, #dddddd, #bbbbbb);background-image:linear-gradient(to bottom, #dddddd, #bbbbbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f !important;margin:0;padding:2px;margin-right:5px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f !important;text-decoration:underline}.sp-palette span:hover,.sp-palette span.sp-thumb-active{border-color:#000}.sp-preview,.sp-alpha,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-preview-inner,.sp-alpha-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=)}.sp-clear-display{background-repeat:no-repeat;background-position:center;background-image:url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}.gjs-is__grab,.gjs-is__grab *{cursor:grab !important}.gjs-is__grabbing,.gjs-is__grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:grabbing !important}.gjs-one-bg{background-color:var(--gjs-primary-color)}.gjs-one-color{color:var(--gjs-primary-color)}.gjs-one-color-h:hover{color:var(--gjs-primary-color)}.gjs-two-bg{background-color:var(--gjs-secondary-color)}.gjs-two-color{color:var(--gjs-secondary-color)}.gjs-two-color-h:hover{color:var(--gjs-secondary-color)}.gjs-three-bg{background-color:var(--gjs-tertiary-color)}.gjs-three-color{color:var(--gjs-tertiary-color)}.gjs-three-color-h:hover{color:var(--gjs-tertiary-color)}.gjs-four-bg{background-color:var(--gjs-quaternary-color)}.gjs-four-color{color:var(--gjs-quaternary-color)}.gjs-four-color-h:hover{color:var(--gjs-quaternary-color)}.gjs-danger-bg{background-color:var(--gjs-color-red)}.gjs-danger-color{color:var(--gjs-color-red)}.gjs-danger-color-h:hover{color:var(--gjs-color-red)}.gjs-bg-main,.gjs-sm-colorp-c,.gjs-off-prv{background-color:var(--gjs-main-color)}.gjs-color-main,.gjs-sm-stack #gjs-sm-add,.gjs-off-prv{color:var(--gjs-font-color);fill:var(--gjs-font-color)}.gjs-color-active{color:var(--gjs-font-color-active);fill:var(--gjs-font-color-active)}.gjs-color-warn{color:var(--gjs-color-warn);fill:var(--gjs-color-warn)}.gjs-color-hl{color:var(--gjs-color-highlight);fill:var(--gjs-color-highlight)}.gjs-invis-invis,.gjs-clm-tags #gjs-clm-new,.gjs-no-app{background-color:rgba(0,0,0,0);border:none;color:inherit}.gjs-no-app{height:10px}.gjs-test::btn{color:"#fff"}.opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-checker-bg,.gjs-field-colorp-c,.checker-bg,.gjs-sm-layer-preview{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==")}.gjs-no-user-select,.gjs-rte-toolbar,.gjs-layer-name,.gjs-grabbing,.gjs-grabbing *{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-pointer-events,.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el,.gjs-resizer-c{pointer-events:none}.gjs-bdrag{pointer-events:none !important;position:absolute !important;z-index:10 !important;width:auto}.gjs-drag-helper{background-color:var(--gjs-color-blue) !important;pointer-events:none !important;position:absolute !important;z-index:10 !important;transform:scale(0.3) !important;transform-origin:top left !important;-webkit-transform-origin:top left !important;margin:15px !important;transition:none !important;outline:none !important}.gjs-grabbing,.gjs-grabbing *{cursor:grabbing !important;cursor:-webkit-grabbing !important}.gjs-grabbing{overflow:hidden}.gjs-off-prv{position:relative;z-index:10;padding:5px;cursor:pointer}.gjs-editor-cont ::-webkit-scrollbar-track{background:var(--gjs-secondary-dark-color)}.gjs-editor-cont ::-webkit-scrollbar-thumb{background-color:hsla(0,0%,100%,.2)}.gjs-editor-cont ::-webkit-scrollbar{width:8px}:root{--gjs-main-color: #444;--gjs-primary-color: #444;--gjs-secondary-color: #ddd;--gjs-tertiary-color: #804f7b;--gjs-quaternary-color: #d278c9;--gjs-font-color: #ddd;--gjs-font-color-active: #f8f8f8;--gjs-main-dark-color: rgba(0, 0, 0, 0.2);--gjs-secondary-dark-color: rgba(0, 0, 0, 0.1);--gjs-main-light-color: rgba(255, 255, 255, 0.1);--gjs-secondary-light-color: rgba(255, 255, 255, 0.7);--gjs-soft-light-color: rgba(255, 255, 255, 0.015);--gjs-color-blue: #3b97e3;--gjs-color-red: #dd3636;--gjs-color-yellow: #ffca6f;--gjs-color-green: #62c462;--gjs-left-width: 15%;--gjs-color-highlight: #71b7f1;--gjs-color-warn: #ffca6f;--gjs-handle-margin: -5px;--gjs-light-border: rgba(255, 255, 255, 0.05);--gjs-arrow-color: rgba(255, 255, 255, 0.7);--gjs-dark-text-shadow: rgba(0, 0, 0, 0.2);--gjs-color-input-padding: 22px;--gjs-input-padding: 5px;--gjs-padding-elem-classmanager: 5px 6px;--gjs-upload-padding: 150px 10px;--gjs-animation-duration: 0.2s;--gjs-main-font: Helvetica, sans-serif;--gjs-font-size: 0.75rem;--gjs-placeholder-background-color: var(--gjs-color-green);--gjs-canvas-top: 40px;--gjs-flex-item-gap: 5px}.clear{clear:both}.no-select,.gjs-clm-tags #gjs-clm-close,.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector-title,.gjs-trait-category .gjs-title,.gjs-com-no-select,.gjs-com-no-select img{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.gjs-no-touch-actions{touch-action:none}.gjs-disabled{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;opacity:.5;filter:alpha(opacity=50)}.gjs-editor{font-family:var(--gjs-main-font);font-size:var(--gjs-font-size);position:relative;box-sizing:border-box;height:100%}.gjs-freezed,.gjs-freezed{opacity:.5;filter:alpha(opacity=50);pointer-events:none}.gjs-traits-label{border-bottom:1px solid var(--gjs-main-dark-color);font-weight:lighter;margin-bottom:5px;padding:10px;text-align:left}.gjs-label-wrp{width:30%;min-width:30%}.gjs-field-wrp{flex-grow:1}.gjs-traits-c,.gjs-traits-cs{display:flex;flex-direction:column}.gjs-trait-categories{display:flex;flex-direction:column}.gjs-trait-category{width:100%}.gjs-trait-category .gjs-caret-icon{margin-right:5px}.gjs-trt-header{font-weight:lighter;padding:10px}.gjs-trt-trait{display:flex;justify-content:flex-start;padding:5px 10px;font-weight:lighter;align-items:center;text-align:left;gap:5px}.gjs-trt-traits{font-size:var(--gjs-font-size)}.gjs-trt-trait .gjs-label{text-align:left;text-overflow:ellipsis;overflow:hidden}.gjs-guide-info{position:absolute}.gjs-guide-info__content{position:absolute;height:100%;display:flex;width:100%;padding:5px}.gjs-guide-info__line{position:relative;margin:auto}.gjs-guide-info__line::before,.gjs-guide-info__line::after{content:"";display:block;position:absolute;background-color:inherit}.gjs-guide-info__y{padding:0 5px}.gjs-guide-info__y .gjs-guide-info__content{justify-content:center}.gjs-guide-info__y .gjs-guide-info__line{width:100%;height:1px}.gjs-guide-info__y .gjs-guide-info__line::before,.gjs-guide-info__y .gjs-guide-info__line::after{width:1px;height:10px;top:0;bottom:0;left:0;margin:auto}.gjs-guide-info__y .gjs-guide-info__line::after{left:auto;right:0}.gjs-guide-info__x{padding:5px 0}.gjs-guide-info__x .gjs-guide-info__content{align-items:center}.gjs-guide-info__x .gjs-guide-info__line{height:100%;width:1px}.gjs-guide-info__x .gjs-guide-info__line::before,.gjs-guide-info__x .gjs-guide-info__line::after{width:10px;height:1px;left:0;right:0;top:0;margin:auto;transform:translateX(-50%)}.gjs-guide-info__x .gjs-guide-info__line::after{top:auto;bottom:0}.gjs-badge{white-space:nowrap}.gjs-badge__icon{vertical-align:middle;display:inline-block;width:15px;height:15px}.gjs-badge__icon svg{fill:currentColor}.gjs-badge__name{display:inline-block;vertical-align:middle}.gjs-frame-wrapper{position:absolute;width:100%;height:100%;left:0;right:0;margin:auto}.gjs-frame-wrapper--anim{transition:width .35s ease,height .35s ease}.gjs-frame-wrapper__top{transform:translateY(-100%) translateX(-50%);display:flex;padding:5px 0;position:absolute;width:100%;left:50%;top:0}.gjs-frame-wrapper__top-r{margin-left:auto}.gjs-frame-wrapper__left{position:absolute;left:0;transform:translateX(-100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__bottom{position:absolute;bottom:0;transform:translateY(100%) translateX(-50%);width:100%;left:50%}.gjs-frame-wrapper__right{position:absolute;right:0;transform:translateX(100%) translateY(-50%);height:100%;top:50%}.gjs-frame-wrapper__icon{width:24px;cursor:pointer}.gjs-frame-wrapper__icon>svg{fill:currentColor}.gjs-padding-v-top,.gjs-fixedpadding-v-top{width:100%;top:0;left:0}.gjs-padding-v-right,.gjs-fixedpadding-v-right{right:0}.gjs-padding-v-bottom,.gjs-fixedpadding-v-bottom{width:100%;left:0;bottom:0}.gjs-padding-v-left,.gjs-fixedpadding-v-left{left:0}.gjs-cv-canvas{box-sizing:border-box;width:calc(100% - var(--gjs-left-width));height:calc(100% - var(--gjs-canvas-top));bottom:0;overflow:hidden;z-index:1;position:absolute;left:0;top:var(--gjs-canvas-top)}.gjs-cv-canvas-bg{background-color:rgba(0,0,0,.15)}.gjs-cv-canvas.gjs-cui{width:100%;height:100%;top:0}.gjs-cv-canvas.gjs-is__grab .gjs-cv-canvas__frames,.gjs-cv-canvas.gjs-is__grabbing .gjs-cv-canvas__frames{pointer-events:none}.gjs-cv-canvas__frames{position:absolute;top:0;left:0;width:100%;height:100%}.gjs-cv-canvas__spots{position:absolute;pointer-events:none;z-index:1}.gjs-cv-canvas .gjs-ghost{display:none;pointer-events:none;background-color:#5b5b5b;border:2px dashed #ccc;position:absolute;z-index:10;opacity:.55;filter:alpha(opacity=55)}.gjs-cv-canvas .gjs-highlighter,.gjs-cv-canvas .gjs-highlighter-sel{position:absolute;outline:1px solid var(--gjs-color-blue);outline-offset:-1px;pointer-events:none;width:100%;height:100%}.gjs-cv-canvas .gjs-highlighter-warning{outline:3px solid var(--gjs-color-yellow)}.gjs-cv-canvas .gjs-highlighter-sel{outline:2px solid var(--gjs-color-blue);outline-offset:-2px}.gjs-cv-canvas #gjs-tools,.gjs-cv-canvas .gjs-tools{width:100%;height:100%;position:absolute;top:0;left:0;outline:none;z-index:1}.gjs-cv-canvas #gjs-tools{z-index:2}.gjs-cv-canvas *{box-sizing:border-box}.gjs-frame{outline:medium none;height:100%;width:100%;border:none;margin:auto;display:block;transition:width .35s ease,height .35s ease;position:absolute;top:0;bottom:0;left:0;right:0}.gjs-toolbar{position:absolute;background-color:var(--gjs-color-blue);white-space:nowrap;color:#fff;z-index:10;top:0;left:0}.gjs-toolbar-item{width:26px;padding:5px;cursor:pointer;display:inline-block}.gjs-toolbar-item svg{fill:currentColor;vertical-align:middle}.gjs-resizer-c{position:absolute;left:0;top:0;width:100%;height:100%;z-index:9}.gjs-margin-v-el,.gjs-padding-v-el,.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.1;filter:alpha(opacity=10);position:absolute;background-color:#ff0}.gjs-fixedmargin-v-el,.gjs-fixedpadding-v-el{opacity:.2;filter:alpha(opacity=20)}.gjs-padding-v-el,.gjs-fixedpadding-v-el{background-color:navy}.gjs-resizer-h{pointer-events:all;position:absolute;border:3px solid var(--gjs-color-blue);width:10px;height:10px;background-color:#fff;margin:var(--gjs-handle-margin)}.gjs-resizer-h-tl{top:0;left:0;cursor:nwse-resize}.gjs-resizer-h-tr{top:0;right:0;cursor:nesw-resize}.gjs-resizer-h-tc{top:0;margin:var(--gjs-handle-margin) auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-cl{left:0;margin:auto var(--gjs-handle-margin);top:0;bottom:0;cursor:ew-resize}.gjs-resizer-h-cr{margin:auto var(--gjs-handle-margin);top:0;bottom:0;right:0;cursor:ew-resize}.gjs-resizer-h-bl{bottom:0;left:0;cursor:nesw-resize}.gjs-resizer-h-bc{bottom:0;margin:var(--gjs-handle-margin) auto;left:0;right:0;cursor:ns-resize}.gjs-resizer-h-br{bottom:0;right:0;cursor:nwse-resize}.gjs-pn-panel .gjs-resizer-h{background-color:rgba(0,0,0,.2);border:none;opacity:0;transition:opacity .25s}.gjs-pn-panel .gjs-resizer-h:hover{opacity:1}.gjs-pn-panel .gjs-resizer-h-tc,.gjs-pn-panel .gjs-resizer-h-bc{margin:0 auto;width:100%}.gjs-pn-panel .gjs-resizer-h-cr,.gjs-pn-panel .gjs-resizer-h-cl{margin:auto 0;height:100%}.gjs-resizing .gjs-highlighter,.gjs-resizing .gjs-badge{display:none !important}.gjs-resizing-tl *{cursor:nwse-resize !important}.gjs-resizing-tr *{cursor:nesw-resize !important}.gjs-resizing-tc *{cursor:ns-resize !important}.gjs-resizing-cl *{cursor:ew-resize !important}.gjs-resizing-cr *{cursor:ew-resize !important}.gjs-resizing-bl *{cursor:nesw-resize !important}.gjs-resizing-bc *{cursor:ns-resize !important}.gjs-resizing-br *{cursor:nwse-resize !important}.btn-cl,.gjs-am-close,.gjs-mdl-btn-close{opacity:.3;filter:alpha(opacity=30);font-size:25px;cursor:pointer}.btn-cl:hover,.gjs-am-close:hover,.gjs-mdl-btn-close:hover{opacity:.7;filter:alpha(opacity=70)}.no-dots,.ui-resizable-handle{border:none !important;margin:0 !important;outline:none !important}.gjs-com-dashed *{outline:1px dashed #888;outline-offset:-2px;box-sizing:border-box}.gjs-com-badge,.gjs-badge{pointer-events:none;background-color:var(--gjs-color-blue);color:#fff;padding:2px 5px;position:absolute;z-index:1;font-size:12px;outline:none;display:none}.gjs-badge-warning{background-color:var(--gjs-color-yellow)}.gjs-placeholder,.gjs-com-placeholder,.gjs-placeholder{position:absolute;z-index:10;pointer-events:none;display:none}.gjs-placeholder,.gjs-placeholder{border-style:solid !important;outline:none;box-sizing:border-box;transition:top var(--gjs-animation-duration),left var(--gjs-animation-duration),width var(--gjs-animation-duration),height var(--gjs-animation-duration)}.gjs-placeholder.horizontal,.gjs-com-placeholder.horizontal,.gjs-placeholder.horizontal{border-color:rgba(0,0,0,0) var(--gjs-placeholder-background-color);border-width:3px 5px;margin:-3px 0 0}.gjs-placeholder.vertical,.gjs-com-placeholder.vertical,.gjs-placeholder.vertical{border-color:var(--gjs-placeholder-background-color) rgba(0,0,0,0);border-width:5px 3px;margin:0 0 0 -3px}.gjs-placeholder-int,.gjs-com-placeholder-int,.gjs-placeholder-int{background-color:var(--gjs-placeholder-background-color);box-shadow:0 0 3px rgba(0,0,0,.2);height:100%;width:100%;pointer-events:none;padding:1.5px;outline:none}.gjs-pn-panel{display:inline-block;position:absolute;box-sizing:border-box;text-align:center;padding:5px;z-index:3}.gjs-pn-panel .icon-undo,.gjs-pn-panel .icon-redo{font-size:20px;height:30px;width:25px}.gjs-pn-commands{width:calc(100% - var(--gjs-left-width));left:0;top:0;box-shadow:0 0 5px var(--gjs-main-dark-color)}.gjs-pn-options{right:var(--gjs-left-width);top:0}.gjs-pn-views{border-bottom:2px solid var(--gjs-main-dark-color);right:0;width:var(--gjs-left-width);z-index:4}.gjs-pn-views-container{height:100%;padding:42px 0 0;right:0;width:var(--gjs-left-width);overflow:auto;box-shadow:0 0 5px var(--gjs-main-dark-color)}.gjs-pn-buttons{align-items:center;display:flex;justify-content:space-between}.gjs-pn-btn{box-sizing:border-box;min-height:30px;min-width:30px;line-height:21px;background-color:rgba(0,0,0,0);border:none;font-size:18px;margin-right:5px;border-radius:2px;padding:4px;position:relative;cursor:pointer}.gjs-pn-btn.gjs-pn-active{background-color:rgba(0,0,0,.15);box-shadow:0 0 3px rgba(0,0,0,.25) inset}.gjs-pn-btn svg{fill:currentColor}.gjs-label{line-height:18px}.gjs-fields{display:flex}.gjs-select{padding:0;width:100%}.gjs-select select{padding-right:10px}.gjs-select:-moz-focusring,.gjs-select select:-moz-focusring{color:rgba(0,0,0,0);text-shadow:0 0 0 var(--gjs-secondary-light-color)}.gjs-input:focus,.gjs-button:focus,.gjs-btn-prim:focus,.gjs-select:focus,.gjs-select select:focus{outline:none}.gjs-field input,.gjs-field select,.gjs-field textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;color:inherit;border:none;background-color:rgba(0,0,0,0);box-sizing:border-box;width:100%;position:relative;padding:var(--gjs-input-padding);z-index:1}.gjs-field input:focus,.gjs-field select:focus,.gjs-field textarea:focus{outline:none}.gjs-field input[type=number]{-moz-appearance:textfield}.gjs-field input[type=number]::-webkit-outer-spin-button,.gjs-field input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.gjs-field-range{flex:9 1 auto}.gjs-field-integer input{padding-right:30px}.gjs-select option,.gjs-field-select option,.gjs-clm-select option,.gjs-sm-select option,.gjs-fields option,.gjs-sm-unit option{background-color:var(--gjs-main-color);color:var(--gjs-font-color)}.gjs-field{background-color:var(--gjs-main-dark-color);border:none;box-shadow:none;border-radius:2px;box-sizing:border-box;padding:0;position:relative}.gjs-field textarea{resize:vertical}.gjs-field .gjs-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;z-index:0}.gjs-field .gjs-d-s-arrow{bottom:0;top:0;margin:auto;right:var(--gjs-input-padding);border-top:4px solid var(--gjs-arrow-color);position:absolute;height:0;width:0;border-left:3px solid rgba(0,0,0,0);border-right:4px solid rgba(0,0,0,0);cursor:pointer}.gjs-field-arrows{position:absolute;cursor:ns-resize;margin:auto;height:20px;width:9px;z-index:10;bottom:0;right:calc(var(--gjs-input-padding) - 2px);top:0}.gjs-field-color,.gjs-field-radio{width:100%}.gjs-field-color input{padding-right:var(--gjs-color-input-padding);box-sizing:border-box}.gjs-field-colorp{border-left:1px solid var(--gjs-main-dark-color);box-sizing:border-box;height:100%;padding:2px;position:absolute;right:0;top:0;width:var(--gjs-color-input-padding);z-index:10}.gjs-field-colorp .gjs-checker-bg,.gjs-field-colorp .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-field-colorp-c{height:100%;position:relative;width:100%}.gjs-field-color-picker{background-color:var(--gjs-font-color);cursor:pointer;height:100%;width:100%;box-shadow:0 0 1px var(--gjs-main-dark-color);border-radius:1px;position:absolute;top:0}.gjs-field-checkbox{padding:0;width:17px;height:17px;display:block;cursor:pointer}.gjs-field-checkbox input{display:none}.gjs-field-checkbox input:checked+.gjs-chk-icon{border-color:hsla(0,0%,100%,.5);border-width:0 2px 2px 0;border-style:solid}.gjs-radio-item{flex:1 1 auto;text-align:center;border-left:1px solid var(--gjs-dark-text-shadow)}.gjs-radio-item:first-child{border:none}.gjs-radio-item:hover{background:var(--gjs-main-dark-color)}.gjs-radio-item input{display:none}.gjs-radio-item input:checked+.gjs-radio-item-label{background-color:hsla(0,0%,100%,.2)}.gjs-radio-items{display:flex}.gjs-radio-item-label{cursor:pointer;display:block;padding:var(--gjs-input-padding)}.gjs-field-units{position:absolute;margin:auto;right:10px;bottom:0;top:0}.gjs-field-unit{position:absolute;right:10px;top:3px;font-size:10px;color:var(--gjs-arrow-color);cursor:pointer}.gjs-input-unit{text-align:center}.gjs-field-arrow-u,.gjs-field-arrow-d{position:absolute;height:0;width:0;border-left:3px solid rgba(0,0,0,0);border-right:4px solid rgba(0,0,0,0);border-top:4px solid var(--gjs-arrow-color);bottom:4px;cursor:pointer}.gjs-field-arrow-u{border-bottom:4px solid var(--gjs-arrow-color);border-top:none;top:4px}.gjs-field-select{padding:0}.gjs-field-range{background-color:rgba(0,0,0,0);border:none;box-shadow:none;padding:0}.gjs-field-range input{margin:0;height:100%}.gjs-field-range input:focus{outline:none}.gjs-field-range input::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;height:10px;width:10px;border:1px solid var(--gjs-main-dark-color);border-radius:100%;background-color:var(--gjs-font-color);cursor:pointer}.gjs-field-range input::-moz-range-thumb{height:10px;width:10px;border:1px solid var(--gjs-main-dark-color);border-radius:100%;background-color:var(--gjs-font-color);cursor:pointer}.gjs-field-range input::-ms-thumb{height:10px;width:10px;border:1px solid var(--gjs-main-dark-color);border-radius:100%;background-color:var(--gjs-font-color);cursor:pointer}.gjs-field-range input::-moz-range-track{background-color:var(--gjs-main-dark-color);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-webkit-slider-runnable-track{background-color:var(--gjs-main-dark-color);border-radius:1px;margin-top:3px;height:3px}.gjs-field-range input::-ms-track{background-color:var(--gjs-main-dark-color);border-radius:1px;margin-top:3px;height:3px}.gjs-btn-prim{color:inherit;background-color:var(--gjs-main-light-color);border-radius:2px;padding:3px 6px;padding:var(--gjs-input-padding);cursor:pointer;border:none}.gjs-btn-prim:active{background-color:var(--gjs-main-light-color)}.gjs-btn--full{width:100%}.gjs-chk-icon{-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg);box-sizing:border-box;display:block;height:14px;margin:0 5px;width:6px}.gjs-add-trasp{background:none;border:none;color:var(--gjs-font-color);cursor:pointer;font-size:1em;border-radius:2px;opacity:.75;filter:alpha(opacity=75)}.gjs-add-trasp:hover{opacity:1;filter:alpha(opacity=100)}.gjs-add-trasp:active{background-color:rgba(0,0,0,.2)}.gjs-devices-c{display:flex;align-items:center;padding:2px 3px 3px 3px}.gjs-devices-c .gjs-device-label{flex-grow:2;text-align:left;margin-right:10px}.gjs-devices-c .gjs-select{flex-grow:20}.gjs-devices-c .gjs-add-trasp{flex-grow:1;margin-left:5px}.gjs-category-open,.gjs-block-category.gjs-open,.gjs-sm-sector.gjs-sm-open,.gjs-trait-category.gjs-open{border-bottom:1px solid rgba(0,0,0,.25)}.gjs-category-title,.gjs-layer-title,.gjs-block-category .gjs-title,.gjs-sm-sector-title,.gjs-trait-category .gjs-title{font-weight:lighter;background-color:var(--gjs-secondary-dark-color);letter-spacing:1px;padding:9px 10px 9px 20px;border-bottom:1px solid rgba(0,0,0,.25);text-align:left;position:relative;cursor:pointer}.gjs-sm-clear{cursor:pointer;width:14px;min-width:14px;height:14px;margin-left:3px}.gjs-sm-header{font-weight:lighter;padding:10px}.gjs-sm-sector{clear:both;font-weight:lighter;text-align:left}.gjs-sm-sector-title{display:flex;align-items:center}.gjs-sm-sector-caret{width:17px;height:17px;min-width:17px;transform:rotate(-90deg)}.gjs-sm-sector-label{margin-left:5px}.gjs-sm-sector.gjs-sm-open .gjs-sm-sector-caret{transform:none}.gjs-sm-properties{font-size:var(--gjs-font-size);padding:10px 5px;display:flex;flex-wrap:wrap;align-items:flex-end;box-sizing:border-box;width:100%}.gjs-sm-label{margin:5px 5px 3px 0;display:flex;align-items:center}.gjs-sm-close-btn,.gjs-sm-preview-file-close{display:block;font-size:23px;position:absolute;cursor:pointer;right:5px;top:0;opacity:.7;filter:alpha(opacity=70)}.gjs-sm-close-btn:hover,.gjs-sm-preview-file-close:hover{opacity:.9;filter:alpha(opacity=90)}.gjs-sm-field,.gjs-clm-select,.gjs-clm-field{width:100%;position:relative}.gjs-sm-field input,.gjs-clm-select input,.gjs-clm-field input,.gjs-sm-field select,.gjs-clm-select select,.gjs-clm-field select{background-color:rgba(0,0,0,0);color:hsla(0,0%,100%,.7);border:none;width:100%}.gjs-sm-field input,.gjs-clm-select input,.gjs-clm-field input{box-sizing:border-box}.gjs-sm-field select,.gjs-clm-select select,.gjs-clm-field select{position:relative;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gjs-sm-field select::-ms-expand,.gjs-clm-select select::-ms-expand,.gjs-clm-field select::-ms-expand{display:none}.gjs-sm-field select:-moz-focusring,.gjs-clm-select select:-moz-focusring,.gjs-clm-field select:-moz-focusring{color:rgba(0,0,0,0);text-shadow:0 0 0 var(--gjs-secondary-light-color)}.gjs-sm-field input:focus,.gjs-clm-select input:focus,.gjs-clm-field input:focus,.gjs-sm-field select:focus,.gjs-clm-select select:focus,.gjs-clm-field select:focus{outline:none}.gjs-sm-field .gjs-sm-unit,.gjs-clm-select .gjs-sm-unit,.gjs-clm-field .gjs-sm-unit{position:absolute;right:10px;top:3px;font-size:10px;color:var(--gjs-secondary-light-color);cursor:pointer}.gjs-sm-field .gjs-clm-sel-arrow,.gjs-clm-select .gjs-clm-sel-arrow,.gjs-clm-field .gjs-clm-sel-arrow,.gjs-sm-field .gjs-sm-int-arrows,.gjs-clm-select .gjs-sm-int-arrows,.gjs-clm-field .gjs-sm-int-arrows,.gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-field .gjs-sm-sel-arrow{height:100%;width:9px;position:absolute;right:0;top:0;cursor:ns-resize}.gjs-sm-field .gjs-sm-sel-arrow,.gjs-clm-select .gjs-sm-sel-arrow,.gjs-clm-field .gjs-sm-sel-arrow{cursor:pointer}.gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-field .gjs-sm-d-s-arrow,.gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-field .gjs-sm-u-arrow{position:absolute;height:0;width:0;border-left:3px solid rgba(0,0,0,0);border-right:4px solid rgba(0,0,0,0);cursor:pointer}.gjs-sm-field .gjs-sm-u-arrow,.gjs-clm-select .gjs-sm-u-arrow,.gjs-clm-field .gjs-sm-u-arrow{border-bottom:4px solid var(--gjs-secondary-light-color);top:4px}.gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-field .gjs-sm-d-arrow,.gjs-clm-select .gjs-sm-d-arrow,.gjs-clm-field .gjs-sm-d-arrow,.gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-field .gjs-sm-d-s-arrow{border-top:4px solid var(--gjs-secondary-light-color);bottom:4px}.gjs-sm-field .gjs-clm-d-s-arrow,.gjs-clm-select .gjs-clm-d-s-arrow,.gjs-clm-field .gjs-clm-d-s-arrow,.gjs-sm-field .gjs-sm-d-s-arrow,.gjs-clm-select .gjs-sm-d-s-arrow,.gjs-clm-field .gjs-sm-d-s-arrow{bottom:7px}.gjs-sm-field.gjs-sm-color,.gjs-sm-color.gjs-clm-field,.gjs-sm-field.gjs-sm-input,.gjs-sm-input.gjs-clm-field,.gjs-sm-field.gjs-sm-integer,.gjs-sm-integer.gjs-clm-field,.gjs-sm-field.gjs-sm-list,.gjs-sm-list.gjs-clm-field,.gjs-sm-field.gjs-sm-select,.gjs-clm-select,.gjs-sm-select.gjs-clm-field{background-color:var(--gjs-main-dark-color);border:1px solid rgba(0,0,0,.1);box-shadow:1px 1px 0 var(--gjs-main-light-color);color:var(--gjs-secondary-light-color);border-radius:2px;box-sizing:border-box;padding:0 5px}.gjs-sm-field.gjs-sm-composite,.gjs-sm-composite.gjs-clm-select,.gjs-sm-composite.gjs-clm-field{border-radius:2px}.gjs-sm-field.gjs-sm-select,.gjs-clm-select,.gjs-sm-select.gjs-clm-field{padding:0}.gjs-sm-field.gjs-sm-select select,.gjs-clm-select select,.gjs-sm-select.gjs-clm-field select{height:20px}.gjs-sm-field.gjs-sm-select option,.gjs-clm-select option,.gjs-sm-select.gjs-clm-field option{padding:3px 0}.gjs-sm-field.gjs-sm-composite,.gjs-sm-composite.gjs-clm-select,.gjs-sm-composite.gjs-clm-field{background-color:var(--gjs-secondary-dark-color);border:1px solid rgba(0,0,0,.25)}.gjs-sm-field.gjs-sm-list,.gjs-sm-list.gjs-clm-select,.gjs-sm-list.gjs-clm-field{width:auto;padding:0;overflow:hidden;float:left}.gjs-sm-field.gjs-sm-list input,.gjs-sm-list.gjs-clm-select input,.gjs-sm-list.gjs-clm-field input{display:none}.gjs-sm-field.gjs-sm-list label,.gjs-sm-list.gjs-clm-select label,.gjs-sm-list.gjs-clm-field label{cursor:pointer;padding:5px;display:block}.gjs-sm-field.gjs-sm-list .gjs-sm-radio:checked+label,.gjs-sm-list.gjs-clm-select .gjs-sm-radio:checked+label,.gjs-sm-list.gjs-clm-field .gjs-sm-radio:checked+label{background-color:hsla(0,0%,100%,.2)}.gjs-sm-field.gjs-sm-list .gjs-sm-icon,.gjs-sm-list.gjs-clm-select .gjs-sm-icon,.gjs-sm-list.gjs-clm-field .gjs-sm-icon{background-repeat:no-repeat;background-position:center;text-shadow:none;line-height:normal}.gjs-sm-field.gjs-sm-integer select,.gjs-sm-integer.gjs-clm-select select,.gjs-sm-integer.gjs-clm-field select{width:auto;padding:0}.gjs-sm-list .gjs-sm-el{float:left;border-left:1px solid var(--gjs-main-dark-color)}.gjs-sm-list .gjs-sm-el:first-child{border:none}.gjs-sm-list .gjs-sm-el:hover{background:var(--gjs-main-dark-color)}.gjs-sm-slider .gjs-field-integer{flex:1 1 65px}.gjs-sm-property{box-sizing:border-box;float:left;width:50%;margin-bottom:5px;padding:0 5px}.gjs-sm-property--full,.gjs-sm-property.gjs-sm-composite,.gjs-sm-property.gjs-sm-file,.gjs-sm-property.gjs-sm-list,.gjs-sm-property.gjs-sm-stack,.gjs-sm-property.gjs-sm-slider,.gjs-sm-property.gjs-sm-color{width:100%}.gjs-sm-property .gjs-sm-btn{background-color:color-mix(in srgb, var(--gjs-main-dark-color), white 13%);border-radius:2px;box-shadow:1px 1px 0 color-mix(in srgb, var(--gjs-main-dark-color), white 2%),1px 1px 0 color-mix(in srgb, var(--gjs-main-dark-color), white 17%) inset;padding:5px;position:relative;text-align:center;height:auto;width:100%;cursor:pointer;color:var(--gjs-font-color);box-sizing:border-box;text-shadow:-1px -1px 0 var(--gjs-main-dark-color);border:none;opacity:.85;filter:alpha(opacity=85)}.gjs-sm-property .gjs-sm-btn-c{box-sizing:border-box;float:left;width:100%}.gjs-sm-property__text-shadow .gjs-sm-layer-preview-cnt::after{color:#000;content:"T";font-weight:900;line-height:17px;padding:0 4px}.gjs-sm-preview-file{background-color:var(--gjs-light-border);border-radius:2px;margin-top:5px;position:relative;overflow:hidden;border:1px solid color-mix(in srgb, var(--gjs-light-border), black 1%);padding:3px 20px}.gjs-sm-preview-file-cnt{background-size:auto 100%;background-repeat:no-repeat;background-position:center center;height:50px}.gjs-sm-preview-file-close{top:-5px;width:14px;height:14px}.gjs-sm-layers{margin-top:5px;padding:1px 3px;min-height:30px}.gjs-sm-layer{background-color:hsla(0,0%,100%,.055);border-radius:2px;margin:2px 0;padding:7px;position:relative}.gjs-sm-layer.gjs-sm-active{background-color:hsla(0,0%,100%,.12)}.gjs-sm-layer .gjs-sm-label-wrp{display:flex;align-items:center}.gjs-sm-layer #gjs-sm-move{height:14px;width:14px;min-width:14px;cursor:grab}.gjs-sm-layer #gjs-sm-label{flex-grow:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0 5px}.gjs-sm-layer-preview{height:15px;width:15px;min-width:15px;margin-right:5px;border-radius:2px}.gjs-sm-layer-preview-cnt{border-radius:2px;background-color:#fff;height:100%;width:100%;background-size:cover !important}.gjs-sm-layer #gjs-sm-close-layer{display:block;cursor:pointer;height:14px;width:14px;min-width:14px;opacity:.5;filter:alpha(opacity=50)}.gjs-sm-layer #gjs-sm-close-layer:hover{opacity:.8;filter:alpha(opacity=80)}.gjs-sm-stack .gjs-sm-properties{padding:5px 0 0}.gjs-sm-stack #gjs-sm-add{background:none;border:none;cursor:pointer;outline:none;position:absolute;right:0;top:-17px;opacity:.75;padding:0;width:18px;height:18px}.gjs-sm-stack #gjs-sm-add:hover{opacity:1;filter:alpha(opacity=100)}.gjs-sm-colorp-c{height:100%;width:20px;position:absolute;right:0;top:0;box-sizing:border-box;border-radius:2px;padding:2px}.gjs-sm-colorp-c .gjs-checker-bg,.gjs-sm-colorp-c .gjs-field-colorp-c{height:100%;width:100%;border-radius:1px}.gjs-sm-color-picker{background-color:var(--gjs-font-color);cursor:pointer;height:16px;width:100%;margin-top:-16px;box-shadow:0 0 1px var(--gjs-main-dark-color);border-radius:1px}.gjs-sm-btn-upload #gjs-sm-upload{left:0;top:0;position:absolute;width:100%;opacity:0;cursor:pointer}.gjs-sm-btn-upload #gjs-sm-label{padding:2px 0}.gjs-sm-layer>#gjs-sm-move{opacity:.7;filter:alpha(opacity=70);cursor:move;font-size:12px;float:left;margin:0 5px 0 0}.gjs-sm-layer>#gjs-sm-move:hover{opacity:.9;filter:alpha(opacity=90)}.gjs-blocks-c{display:flex;flex-wrap:wrap;justify-content:flex-start}.gjs-block-categories{display:flex;flex-direction:column}.gjs-block-category{width:100%}.gjs-block-category .gjs-caret-icon{margin-right:5px}.gjs-block{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;width:45%;min-width:45px;padding:1em;box-sizing:border-box;min-height:90px;cursor:all-scroll;font-size:11px;font-weight:lighter;text-align:center;display:flex;flex-direction:column;justify-content:space-between;border:1px solid rgba(0,0,0,.2);border-radius:3px;margin:10px 2.5% 5px;box-shadow:0 1px 0 0 rgba(0,0,0,.15);transition:all .2s ease 0s;transition-property:box-shadow,color}.gjs-block:hover{box-shadow:0 3px 4px 0 rgba(0,0,0,.15)}.gjs-block svg{fill:currentColor}.gjs-block__media{margin-bottom:10px;pointer-events:none}.gjs-block-svg{width:54px;fill:currentColor}.gjs-block-svg-path{fill:currentColor}.gjs-block.fa{font-size:2em;line-height:2em;padding:11px}.gjs-block-label{line-height:normal;font-size:.65rem;font-weight:normal;font-family:Helvetica,sans-serif;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.gjs-block.gjs-bdrag{width:auto;padding:0}.gjs-selected-parent{border:1px solid var(--gjs-color-yellow)}.gjs-opac50{opacity:.5;filter:alpha(opacity=50)}.gjs-layer{font-weight:lighter;text-align:left;position:relative;font-size:var(--gjs-font-size);display:grid}.gjs-layer-item{display:flex;align-items:center;justify-content:space-between;padding:5px 10px;border-bottom:1px solid var(--gjs-main-dark-color);background-color:var(--gjs-secondary-dark-color);gap:var(--gjs-flex-item-gap);cursor:pointer}.gjs-layer-item-left,.gjs-layer-item-right{display:flex;align-items:center;gap:var(--gjs-flex-item-gap)}.gjs-layer-item-left{width:100%}.gjs-layer-hidden{opacity:.55;filter:alpha(opacity=55)}.gjs-layer-vis{box-sizing:content-box;cursor:pointer;z-index:1}.gjs-layer-vis-on,.gjs-layer-vis-off{display:flex;width:13px}.gjs-layer-vis-off{display:none}.gjs-layer-vis.gjs-layer-off .gjs-layer-vis-on{display:none}.gjs-layer-vis.gjs-layer-off .gjs-layer-vis-off{display:flex}.gjs-layer-caret{width:15px;cursor:pointer;box-sizing:content-box;transform:rotate(90deg);display:flex;opacity:.7;filter:alpha(opacity=70)}.gjs-layer-caret:hover{opacity:1;filter:alpha(opacity=100)}.gjs-layer.open>.gjs-layer-item .gjs-layer-caret{transform:rotate(180deg)}.gjs-layer-title{padding:0;display:flex;align-items:center;background-color:rgba(0,0,0,0) !important;border-bottom:none}.gjs-layer-title-inn{align-items:center;position:relative;display:flex;gap:var(--gjs-flex-item-gap)}.gjs-layer-title-c{width:100%}.gjs-layer__icon{display:block;width:100%;max-width:15px;max-height:15px;padding-left:5px}.gjs-layer__icon svg{fill:currentColor}.gjs-layer-name{display:inline-block;box-sizing:content-box;overflow:hidden;white-space:nowrap;max-width:170px;height:auto}.gjs-layer-name--no-edit{text-overflow:ellipsis}.gjs-layer>.gjs-layer-children{display:none}.gjs-layer.open>.gjs-layer-children{display:block}.gjs-layer-no-chld>.gjs-layer-title-inn>.gjs-layer-caret{visibility:hidden}.gjs-layer-move{display:flex;width:13px;box-sizing:content-box;cursor:move}.gjs-layer.gjs-hovered .gjs-layer-item{background-color:var(--gjs-soft-light-color)}.gjs-layer.gjs-selected .gjs-layer-item{background-color:var(--gjs-main-light-color)}.gjs-layers{position:relative;height:100%}.gjs-layers #gjs-placeholder{width:100%;position:absolute}.gjs-layers #gjs-placeholder #gjs-plh-int{height:100%;padding:1px}.gjs-layers #gjs-placeholder #gjs-plh-int.gjs-insert{background-color:var(--gjs-color-green)}#gjs-clm-add-tag,.gjs-clm-tags-btn{background-color:hsla(0,0%,100%,.15);border-radius:2px;padding:3px;margin-right:3px;border:1px solid rgba(0,0,0,.15);width:24px;height:24px;box-sizing:border-box;cursor:pointer}.gjs-clm-tags-btn svg{fill:currentColor;display:block}.gjs-clm-header{display:flex;align-items:center;margin:7px 0}.gjs-clm-header-status{flex-shrink:1;margin-left:auto}.gjs-clm-tag{display:flex;overflow:hidden;align-items:center;border-radius:3px;margin:0 3px 3px 0;padding:5px;cursor:default}.gjs-clm-tag-status,.gjs-clm-tag-close{width:12px;height:12px;flex-shrink:1}.gjs-clm-tag-status svg,.gjs-clm-tag-close svg{vertical-align:middle;fill:currentColor}.gjs-clm-sels-info{margin:7px 0;text-align:left}.gjs-clm-sel-id{font-size:.9em;opacity:.5;filter:alpha(opacity=50)}.gjs-clm-label-sel{float:left;padding-right:5px}.gjs-clm-tags{font-size:var(--gjs-font-size);padding:10px 5px}.gjs-clm-tags #gjs-clm-sel{padding:7px 0;float:left}.gjs-clm-tags #gjs-clm-sel{font-style:italic;margin-left:5px}.gjs-clm-tags #gjs-clm-tags-field{clear:both;padding:5px;margin-bottom:5px;display:flex;flex-wrap:wrap}.gjs-clm-tags #gjs-clm-tags-c{display:flex;flex-wrap:wrap;vertical-align:top;overflow:hidden}.gjs-clm-tags #gjs-clm-new{color:var(--gjs-font-color);padding:var(--gjs-padding-elem-classmanager);display:none}.gjs-clm-tags #gjs-clm-close{opacity:.85;filter:alpha(opacity=85);font-size:20px;line-height:0;cursor:pointer;color:hsla(0,0%,100%,.9)}.gjs-clm-tags #gjs-clm-close:hover{opacity:1;filter:alpha(opacity=100)}.gjs-clm-tags #gjs-clm-checkbox{color:hsla(0,0%,100%,.9);vertical-align:middle;cursor:pointer;font-size:9px}.gjs-clm-tags #gjs-clm-tag-label{flex-grow:1;text-overflow:ellipsis;overflow:hidden;padding:0 3px;cursor:text}.gjs-mdl-container{font-family:var(--gjs-main-font);overflow-y:auto;position:fixed;background-color:rgba(0,0,0,.5);display:flex;top:0;left:0;right:0;bottom:0;z-index:100}.gjs-mdl-dialog{text-shadow:-1px -1px 0 rgba(0,0,0,.05);animation:gjs-slide-down .215s;margin:auto;max-width:850px;width:90%;border-radius:3px;font-weight:lighter;position:relative;z-index:2}.gjs-mdl-title{font-size:1rem}.gjs-mdl-btn-close{position:absolute;right:15px;top:5px}.gjs-mdl-active .gjs-mdl-dialog{animation:gjs-mdl-slide-down .216s}.gjs-mdl-header,.gjs-mdl-content{padding:10px 15px;clear:both}.gjs-mdl-header{position:relative;border-bottom:1px solid var(--gjs-main-dark-color);padding:15px 15px 7px}.gjs-export-dl::after{content:"";clear:both;display:block;margin-bottom:10px}.gjs-dropzone{display:none;opacity:0;position:absolute;top:0;left:0;z-index:11;width:100%;height:100%;transition:opacity .25s;pointer-events:none}.gjs-dropzone-active .gjs-dropzone{display:block;opacity:1}.gjs-am-assets{height:290px;overflow:auto;clear:both;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start}.gjs-am-assets-header{padding:5px}.gjs-am-add-asset .gjs-am-add-field{width:70%;float:left}.gjs-am-add-asset button{width:25%;float:right}.gjs-am-preview-cont{position:relative;height:70px;width:30%;background-color:var(--gjs-main-color);border-radius:2px;float:left;overflow:hidden}.gjs-am-preview{position:absolute;background-position:center center;background-size:cover;background-repeat:no-repeat;height:100%;width:100%;z-index:1}.gjs-am-preview-bg{opacity:.5;filter:alpha(opacity=50);position:absolute;height:100%;width:100%;z-index:0}.gjs-am-dimensions{opacity:.5;filter:alpha(opacity=50);font-size:10px}.gjs-am-meta{width:70%;float:left;font-size:12px;padding:5px 0 0 5px;box-sizing:border-box}.gjs-am-meta>div{margin-bottom:5px}.gjs-am-close{cursor:pointer;position:absolute;right:5px;top:0;display:none}.gjs-am-asset{border-bottom:1px solid color-mix(in srgb, var(--gjs-main-dark-color), black 3%);padding:5px;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.gjs-am-asset:hover .gjs-am-close{display:block}.gjs-am-highlight{background-color:var(--gjs-main-light-color)}.gjs-am-assets-cont{background-color:var(--gjs-secondary-dark-color);border-radius:3px;box-sizing:border-box;padding:10px;width:45%;float:right;height:325px;overflow:hidden}.gjs-am-file-uploader{width:55%;float:left}.gjs-am-file-uploader>form{background-color:var(--gjs-secondary-dark-color);border:2px dashed;border-radius:3px;position:relative;text-align:center;margin-bottom:15px}.gjs-am-file-uploader>form.gjs-am-hover{border:2px solid var(--gjs-color-green);color:color-mix(in srgb, var(--gjs-color-green), white 5%)}.gjs-am-file-uploader>form.gjs-am-disabled{border-color:red}.gjs-am-file-uploader>form #gjs-am-uploadFile{opacity:0;filter:alpha(opacity=0);padding:var(--gjs-upload-padding);width:100%;box-sizing:border-box}.gjs-am-file-uploader #gjs-am-title{position:absolute;padding:var(--gjs-upload-padding);width:100%}.gjs-cm-editor-c{float:left;box-sizing:border-box;width:50%}.gjs-cm-editor-c .CodeMirror{height:450px}.gjs-cm-editor{font-size:12px}.gjs-cm-editor#gjs-cm-htmlmixed{padding-right:10px;border-right:1px solid var(--gjs-main-dark-color)}.gjs-cm-editor#gjs-cm-htmlmixed #gjs-cm-title{color:#a97d44}.gjs-cm-editor#gjs-cm-css{padding-left:10px}.gjs-cm-editor#gjs-cm-css #gjs-cm-title{color:#ddca7e}.gjs-cm-editor #gjs-cm-title{background-color:var(--gjs-main-dark-color);font-size:12px;padding:5px 10px 3px;text-align:right}.gjs-rte-toolbar{position:absolute;z-index:10}.gjs-rte-toolbar-ui{border:1px solid var(--gjs-main-dark-color);border-radius:3px}.gjs-rte-actionbar{display:flex}.gjs-rte-action{display:flex;align-items:center;justify-content:center;padding:5px;width:25px;border-right:1px solid var(--gjs-main-dark-color);text-align:center;cursor:pointer;outline:none}.gjs-rte-action:last-child{border-right:none}.gjs-rte-action:hover{background-color:var(--gjs-main-light-color)}.gjs-rte-active{background-color:var(--gjs-main-light-color)}.gjs-rte-disabled{color:var(--gjs-main-light-color);cursor:not-allowed}.gjs-rte-disabled:hover{background-color:unset}.gjs-editor-sp{border:1px solid var(--gjs-main-dark-color);box-shadow:0 0 7px var(--gjs-main-dark-color);border-radius:3px}.gjs-editor-sp .sp-hue,.gjs-editor-sp .sp-slider{cursor:row-resize}.gjs-editor-sp .sp-color,.gjs-editor-sp .sp-dragger{cursor:crosshair}.gjs-editor-sp .sp-alpha-inner,.gjs-editor-sp .sp-alpha-handle{cursor:col-resize}.gjs-editor-sp .sp-hue{left:90%}.gjs-editor-sp .sp-color{right:15%}.gjs-editor-sp .sp-picker-container{border:none}.gjs-editor-sp .colpick_dark .colpick_color{outline:1px solid var(--gjs-main-dark-color)}.gjs-editor-sp .sp-cancel,.gjs-editor-sp .sp-cancel:hover{bottom:-8px;color:#777 !important;font-size:25px;left:0;position:absolute;text-decoration:none}.gjs-editor-sp .sp-alpha-handle{background-color:#ccc;border:1px solid #555;width:4px}.gjs-editor-sp .sp-color,.gjs-editor-sp .sp-hue{border:1px solid #333}.gjs-editor-sp .sp-slider{background-color:#ccc;border:1px solid #555;height:3px;left:-4px;width:22px}.gjs-editor-sp .sp-dragger{background:rgba(0,0,0,0);box-shadow:0 0 0 1px #111}.gjs-editor-sp .sp-button-container{float:none;width:100%;position:relative;text-align:right}.gjs-editor-sp .sp-button-container .sp-choose,.gjs-editor-sp .sp-button-container .sp-choose:hover,.gjs-editor-sp .sp-button-container .sp-choose:active{background:var(--gjs-main-dark-color);border-color:var(--gjs-main-dark-color);color:var(--gjs-font-color);text-shadow:none;box-shadow:none;padding:3px 5px}.gjs-editor-sp .sp-palette-container{border:none;float:none;margin:0;padding:5px 10px 0}.gjs-editor-sp .sp-palette .sp-thumb-el,.gjs-editor-sp .sp-palette .sp-thumb-el:hover{border:1px solid rgba(0,0,0,.9)}.gjs-editor-sp .sp-palette .sp-thumb-el:hover,.gjs-editor-sp .sp-palette .sp-thumb-el.sp-thumb-active{border-color:rgba(0,0,0,.9)}.gjs-hidden{display:none}@keyframes gjs-slide-down{0%{transform:translate(0, -3rem);opacity:0}100%{transform:translate(0, 0);opacity:1}}@keyframes gjs-slide-up{0%{transform:translate(0, 0);opacity:1}100%{transform:translate(0, -3rem);opacity:0}}.cm-s-hopscotch span.cm-error{color:#fff}
diff --git a/static/vendor/grapes.min.js b/static/vendor/grapes.min.js
new file mode 100644
index 0000000..ecfce8d
--- /dev/null
+++ b/static/vendor/grapes.min.js
@@ -0,0 +1,3 @@
+/*! grapesjs - 0.22.4 */
+!function(t,e){'object'==typeof exports&&'object'==typeof module?module.exports=e():'function'==typeof define&&define.amd?define([],e):'object'==typeof exports?exports["grapesjs"]=e():t["grapesjs"]=e()}('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof window?window:this,(()=>(()=>{var t={4729:(t,e,n)=>{var o,r,i;1&&(r=[n(5706),n(4193)],void 0===(i='function'==typeof(o=function(t,e){var n=Array.prototype.slice;function o(t,e,n){return n.length<=4?t.call(e,n[0],n[1],n[2],n[3]):t.apply(e,n)}function r(t,e){return n.call(t,e)}function i(e,n){return null!=e&&(t.isArray(n)||(n=r(arguments,1)),t.all(n,(function(t){return t in e})))}var a=function(){var e=!1,n=-1;function o(){n++,e=!0,t.defer((function(){e=!1}))}return function(){return e||o(),n}}();function s(){this.registeredObjects=[],this.cidIndexes=[]}function l(e,n,o,r){for(var i,a=0,s=n.length;at.maximumStackLength&&(t.shift(),t.pointer--)}}}s.prototype={isRegistered:function(e){return e&&e.cid?this.registeredObjects[e.cid]:t.contains(this.registeredObjects,e)},register:function(t){return!this.isRegistered(t)&&(t&&t.cid?(this.registeredObjects[t.cid]=t,this.cidIndexes.push(t.cid)):this.registeredObjects.push(t),!0)},unregister:function(e){if(this.isRegistered(e)){if(e&&e.cid)delete this.registeredObjects[e.cid],this.cidIndexes.splice(t.indexOf(this.cidIndexes,e.cid),1);else{var n=t.indexOf(this.registeredObjects,e);this.registeredObjects.splice(n,1)}return!0}return!1},get:function(){return t.map(this.cidIndexes,(function(t){return this.registeredObjects[t]}),this).concat(this.registeredObjects)}};var f={add:{undo:function(t,e,n,o){t.remove(n,o)},redo:function(t,e,n,o){o.index&&(o.at=o.index),t.add(n,o)},on:function(e,n,o){return{object:n,before:void 0,after:e,options:t.clone(o)}}},remove:{undo:function(t,e,n,o){"index"in o&&(o.at=o.index),t.add(e,o)},redo:function(t,e,n,o){t.remove(e,o)},on:function(e,n,o){return{object:n,before:e,after:void 0,options:t.clone(o)}}},change:{undo:function(e,n,o,r){t.isEmpty(n)?t.each(t.keys(o),e.unset,e):(e.set(n),r&&r.unsetData&&r.unsetData.before&&r.unsetData.before.length&&t.each(r.unsetData.before,e.unset,e))},redo:function(e,n,o,r){t.isEmpty(o)?t.each(t.keys(n),e.unset,e):(e.set(o),r&&r.unsetData&&r.unsetData.after&&r.unsetData.after.length&&t.each(r.unsetData.after,e.unset,e))},on:function(e,n){var o=e.changedAttributes(),r=t.keys(o),i=t.pick(e.previousAttributes(),r),a=t.keys(i),s=(n||(n={})).unsetData={after:[],before:[]};return r.length!=a.length&&(r.length>a.length?t.each(r,(function(t){t in i||s.before.push(t)}),this):t.each(a,(function(t){t in o||s.after.push(t)}))),{object:e,before:i,after:o,options:t.clone(n)}}},reset:{undo:function(t,e,n){t.reset(e)},redo:function(t,e,n){t.reset(n)},on:function(e,n){return{object:e,before:n.previousModels,after:t.clone(e.models)}}}};function h(){}function g(e,n,o,r){if("object"==typeof n)return t.each(n,(function(t,n){2===e?g(e,t,o,r):g(e,n,t,o)}));switch(e){case 0:i(o,"undo","redo","on")&&t.all(t.pick(o,"undo","redo","on"),t.isFunction)&&(r[n]=o);break;case 1:r[n]&&t.isObject(o)&&(r[n]=t.extend({},r[n],o));break;case 2:delete r[n]}return this}h.prototype=f;var v=e.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(t){c("undo",this.attributes)},redo:function(t){c("redo",this.attributes)}}),y=e.Collection.extend({model:v,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(t){this.maximumStackLength=t}}),m=e.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(e){this.stack=new y,this.objectRegistry=new s,this.undoTypes=new h,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",(function(t,e){this.stack.setMaxLength(e)}),this),e&&e.track&&this.startTracking(),e&&e.register&&(t.isArray(e.register)||t.isArguments(e.register)?o(this.register,this,e.register):this.register(e.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(t){d(this.stack,t,r(arguments,1),this.undoTypes)},register:function(){l("on",arguments,this._addToStack,this)},unregister:function(){l("off",arguments,this._addToStack,this)},unregisterAll:function(){o(this.unregister,this,this.objectRegistry.get())},undo:function(t){u("undo",this,this.stack,t)},undoAll:function(){u("undo",this,this.stack,!1,!0)},redo:function(t){u("redo",this,this.stack,t)},redoAll:function(){u("redo",this,this.stack,!1,!0)},isAvailable:function(t){var e=this.stack,n=e.length;switch(t){case"undo":return n>0&&e.pointer>-1;case"redo":return n>0&&e.pointer{var o,r;!function(){var i='object'==typeof self&&self.self===self&&self||'object'==typeof n.g&&n.g.global===n.g&&n.g;if(1)o=[n(5706),n(6411),e],r=function(t,e,n){i.Backbone=function(t,e,n,o){var r=t.Backbone,i=Array.prototype.slice;e.VERSION='1.4.1',e.$=o,e.noConflict=function(){return t.Backbone=r,this},e.emulateHTTP=!1,e.emulateJSON=!1;var a,s=e.Events={},l=/\s+/,c=function(t,e,o,r,i){var a,s=0;if(o&&'object'==typeof o){void 0!==r&&'context'in i&&void 0===i.context&&(i.context=r);for(a=n.keys(o);sthis.length&&(r=this.length),r<0&&(r+=this.length+1);var i,a,s=[],l=[],c=[],u=[],p={},d=e.add,f=e.merge,h=e.remove,g=!1,v=this.comparator&&null==r&&!1!==e.sort,y=n.isString(this.comparator)?this.comparator:null;for(a=0;a7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=('/'+this.root+'/').replace(W,'/'),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||'/';return this.location.replace(e+'#'+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement('iframe'),this.iframe.src='javascript:0',this.iframe.style.display='none',this.iframe.tabIndex=-1;var o=document.body,r=o.insertBefore(this.iframe,o.firstChild).contentWindow;r.document.open(),r.document.close(),r.location.hash='#'+this.fragment}var i=window.addEventListener||function(t,e){return attachEvent('on'+t,e)};if(this._usePushState?i('popstate',this.checkUrl,!1):this._useHashChange&&!this.iframe?i('hashchange',this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent('on'+t,e)};this._usePushState?t('popstate',this.checkUrl,!1):this._useHashChange&&!this.iframe&&t('hashchange',this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),U.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),n.some(this.handlers,(function(e){if(e.route.test(t))return e.callback(t),!0})))},navigate:function(t,e){if(!U.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||'');var n=this.root;''!==t&&'?'!==t.charAt(0)||(n=n.slice(0,-1)||'/');var o=n+t;t=t.replace($,'');var r=this.decodeFragment(t);if(this.fragment!==r){if(this.fragment=r,this._usePushState)this.history[e.replace?'replaceState':'pushState']({},document.title,o);else{if(!this._wantsHashChange)return this.location.assign(o);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var i=this.iframe.contentWindow;e.replace||(i.document.open(),i.document.close()),this._updateHash(i.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var o=t.href.replace(/(javascript:|#).*$/,'');t.replace(o+'#'+e)}else t.hash='#'+e}}),e.history=new U;var q=function(t,e){var o,r=this;return o=t&&n.has(t,'constructor')?t.constructor:function(){return r.apply(this,arguments)},n.extend(o,r,e),o.prototype=n.create(r.prototype,t),o.prototype.constructor=o,o.__super__=r.prototype,o};y.extend=m.extend=V.extend=P.extend=U.extend=q;var G=function(){throw new Error('A "url" property or function must be specified')},K=function(t,e){var n=e.error;e.error=function(o){n&&n.call(e.context,t,o,e),t.trigger('error',t,o,e)}};return e}(i,n,t,e)}.apply(e,o),void 0===r||(t.exports=r);else;}()},3640:(t,e,n)=>{1&&function(t){t.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e){return/^[;{}]$/.test(e)}}),t.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(t,e,n,o){return this.jsonMode?/^[\[,{]$/.test(e)||/^}/.test(n):(";"!=e||!o.lexical||")"!=o.lexical.type)&&/^[;{}]$/.test(e)&&!/^;/.test(n)}});var e=/^(a|abbr|acronym|area|base|bdo|big|br|button|caption|cite|code|col|colgroup|dd|del|dfn|em|frame|hr|iframe|img|input|ins|kbd|label|legend|link|map|object|optgroup|option|param|q|samp|script|select|small|span|strong|sub|sup|textarea|tt|var)$/;t.extendMode("xml",{commentStart:"\x3c!--",commentEnd:"--\x3e",newlineAfterToken:function(t,n,o,r){var i=!1;return"html"==this.configuration&&(i=!!r.context&&e.test(r.context.tagName)),!i&&("tag"==t&&/>$/.test(n)&&r.context||/^-1&&s>-1&&s>a&&(t=t.substr(0,a)+t.substring(a+i.commentStart.length,s)+t.substr(s+i.commentEnd.length)),r.replaceRange(t,n,o)}}))})),t.defineExtension("autoIndentRange",(function(t,e){var n=this;this.operation((function(){for(var o=t.line;o<=e.line;o++)n.indentLine(o,"smart")}))})),t.defineExtension("autoFormatRange",(function(e,n){var o=this,r=o.getMode(),i=o.getRange(e,n).split("\n"),a=t.copyState(r,o.getTokenAt(e).state),s=o.getOption("tabSize"),l="",c=0,u=0===e.ch;function p(){l+="\n",u=!0,++c}for(var d=0;d2),v=/Android/.test(t),y=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),m=g||/Mac/.test(e),b=/\bCrOS\b/.test(t),_=/win/i.test(e),w=p&&t.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(p=!1,l=!0);var x=m&&(c||p&&(null==w||w<12.11)),C=n||a&&s>=9;function O(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var S,T=function(t,e){var n=t.className,o=O(e).exec(n);if(o){var r=n.slice(o.index+o[0].length);t.className=n.slice(0,o.index)+(r?o[1]+r:"")}};function P(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function k(t,e){return P(t).appendChild(e)}function E(t,e,n,o){var r=document.createElement(t);if(n&&(r.className=n),o&&(r.style.cssText=o),"string"==typeof e)r.appendChild(document.createTextNode(e));else if(e)for(var i=0;i=e)return a+(e-i);a+=s-i,a+=n-a%n,i=s+1}}g?N=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(N=function(t){try{t.select()}catch(t){}});var R=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};function H(t,e){for(var n=0;n=e)return o+Math.min(a,e-r);if(r+=i-o,o=i+1,(r+=n-r%n)>=e)return o}}var G=[""];function K(t){for(;G.length<=t;)G.push(Y(G)+" ");return G[t]}function Y(t){return t[t.length-1]}function X(t,e){for(var n=[],o=0;o""&&(t.toUpperCase()!=t.toLowerCase()||tt.test(t))}function nt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&et(t))||e.test(t):et(t)}function ot(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var rt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function it(t){return t.charCodeAt(0)>=768&&rt.test(t)}function at(t,e,n){for(;(n<0?e>0:en?-1:1;;){if(e==n)return e;var r=(e+n)/2,i=o<0?Math.ceil(r):Math.floor(r);if(i==e)return t(i)?e:n;t(i)?n=i:e=i+o}}function lt(t,e,n,o){if(!t)return o(e,n,"ltr",0);for(var r=!1,i=0;ie||e==n&&a.to==e)&&(o(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr",i),r=!0)}r||o(e,n,"ltr")}var ct=null;function ut(t,e,n){var o;ct=null;for(var r=0;re)return r;i.to==e&&(i.from!=i.to&&"before"==n?o=r:ct=r),i.from==e&&(i.from!=i.to&&"before"!=n?o=r:ct=r)}return null!=o?o:ct}var pt=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?t.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?e.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var o=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,i=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(t,e,n){this.level=t,this.from=e,this.to=n}return function(t,e){var c="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!o.test(t))return!1;for(var u=t.length,p=[],d=0;d-1&&(o[e]=r.slice(0,i).concat(r.slice(i+1)))}}}function yt(t,e){var n=gt(t,e);if(n.length)for(var o=Array.prototype.slice.call(arguments,2),r=0;r0}function wt(t){t.prototype.on=function(t,e){ht(this,t,e)},t.prototype.off=function(t,e){vt(this,t,e)}}function xt(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Ct(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function Ot(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function St(t){xt(t),Ct(t)}function Tt(t){return t.target||t.srcElement}function Pt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),m&&t.ctrlKey&&1==e&&(e=3),e}var kt,Et,At=function(){if(a&&s<9)return!1;var t=E('div');return"draggable"in t||"dragDrop"in t}();function jt(t){if(null==kt){var e=E("span","");k(t,E("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(kt=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=kt?E("span",""):E("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Mt(t){if(null!=Et)return Et;var e=k(t,document.createTextNode("AخA")),n=S(e,0,1).getBoundingClientRect(),o=S(e,1,2).getBoundingClientRect();return P(t),!(!n||n.left==n.right)&&(Et=o.right-n.right<3)}var Dt,Lt=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],o=t.length;e<=o;){var r=t.indexOf("\n",e);-1==r&&(r=t.length);var i=t.slice(e,"\r"==t.charAt(r-1)?r-1:r),a=i.indexOf("\r");-1!=a?(n.push(i.slice(0,a)),e+=a+1):(n.push(i),e=r+1)}return n}:function(t){return t.split(/\r\n?|\n/)},Nt=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},It="oncopy"in(Dt=E("div"))||(Dt.setAttribute("oncopy","return;"),"function"==typeof Dt.oncopy),Vt=null;function Ft(t){if(null!=Vt)return Vt;var e=k(t,E("span","x")),n=e.getBoundingClientRect(),o=S(e,0,1).getBoundingClientRect();return Vt=Math.abs(n.left-o.left)>1}var Rt={},Ht={};function Bt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),Rt[t]=e}function Ut(t,e){Ht[t]=e}function zt(t){if("string"==typeof t&&Ht.hasOwnProperty(t))t=Ht[t];else if(t&&"string"==typeof t.name&&Ht.hasOwnProperty(t.name)){var e=Ht[t.name];"string"==typeof e&&(e={name:e}),(t=Q(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return zt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return zt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Wt(t,e){e=zt(e);var n=Rt[e.name];if(!n)return Wt(t,"text/plain");var o=n(t,e);if($t.hasOwnProperty(e.name)){var r=$t[e.name];for(var i in r)r.hasOwnProperty(i)&&(o.hasOwnProperty(i)&&(o["_"+i]=o[i]),o[i]=r[i])}if(o.name=e.name,e.helperType&&(o.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)o[a]=e.modeProps[a];return o}var $t={};function qt(t,e){V(e,$t.hasOwnProperty(t)?$t[t]:$t[t]={})}function Gt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var o in e){var r=e[o];r instanceof Array&&(r=r.concat([])),n[o]=r}return n}function Kt(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Yt(t,e,n){return!t.startState||t.startState(e,n)}var Xt=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Jt(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var o=0;;++o){var r=n.children[o],i=r.chunkSize();if(e=t.first&&en?ie(n,Jt(t,n).text.length):fe(e,Jt(t,e.line).text.length)}function fe(t,e){var n=t.ch;return null==n||n>e?ie(t.line,e):n<0?ie(t.line,0):t}function he(t,e){for(var n=[],o=0;o=this.string.length},Xt.prototype.sol=function(){return this.pos==this.lineStart},Xt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xt.prototype.next=function(){if(this.pose},Xt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Xt.prototype.skipToEnd=function(){this.pos=this.string.length},Xt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Xt.prototype.backUp=function(t){this.pos-=t},Xt.prototype.column=function(){return this.lastColumnPos0?null:(o&&!1!==e&&(this.pos+=o[0].length),o)}var r=function(t){return n?t.toLowerCase():t};if(r(this.string.substr(this.pos,t.length))==r(t))return!1!==e&&(this.pos+=t.length),!0},Xt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Xt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Xt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ge=function(t,e){this.state=t,this.lookAhead=e},ve=function(t,e,n,o){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=o||0,this.baseTokens=null,this.baseTokenPos=1};function ye(t,e,n,o){var r=[t.state.modeGen],i={};Te(t,e.text,t.doc.mode,n,(function(t,e){return r.push(t,e)}),i,o);for(var a=n.state,s=function(o){n.baseTokens=r;var s=t.state.overlays[o],l=1,c=0;n.state=!0,Te(t,e.text,s.mode,n,(function(t,e){for(var n=l;ct&&r.splice(l,1,t,r[l+1],o),l+=2,c=Math.min(t,o)}if(e)if(s.opaque)r.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;nt.options.maxHighlightLength&&Gt(t.doc.mode,o.state),i=ye(t,e,o);r&&(o.state=r),e.stateAfter=o.save(!r),e.styles=i.styles,i.classes?e.styleClasses=i.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function be(t,e,n){var o=t.doc,r=t.display;if(!o.mode.startState)return new ve(o,!0,e);var i=Pe(t,e,n),a=i>o.first&&Jt(o,i-1).stateAfter,s=a?ve.fromSaved(o,a,i):new ve(o,Yt(o.mode),i);return o.iter(i,e,(function(n){_e(t,n.text,s);var o=s.line;n.stateAfter=o==e-1||o%5==0||o>=r.viewFrom&&oe.start)return i}throw new Error("Mode "+t.name+" failed to advance stream.")}ve.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},ve.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},ve.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ve.fromSaved=function(t,e,n){return e instanceof ge?new ve(t,Gt(t.mode,e.state),n,e.lookAhead):new ve(t,Gt(t.mode,e),n)},ve.prototype.save=function(t){var e=!1!==t?Gt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ge(e,this.maxLookAhead):e};var Ce=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function Oe(t,e,n,o){var r,i,a=t.doc,s=a.mode,l=Jt(a,(e=de(a,e)).line),c=be(t,e.line,n),u=new Xt(l.text,t.options.tabSize,c);for(o&&(i=[]);(o||u.post.options.maxHighlightLength?(s=!1,a&&_e(t,e,o,p.pos),p.pos=e.length,l=null):l=Se(xe(n,p,o.state,d),i),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||u!=l){for(;ca;--s){if(s<=i.first)return i.first;var l=Jt(i,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ge?c.lookAhead:0)<=i.modeFrontier))return s;var u=F(l.text,null,t.options.tabSize);(null==r||o>u)&&(r=s-1,o=u)}return r}function ke(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;o--){var r=Jt(t,o).stateAfter;if(r&&(!(r instanceof ge)||o+r.lookAhead=e:i.to>e);(o||(o=[])).push(new De(a,i.from,s?null:i.to))}}return o}function Fe(t,e,n){var o;if(t)for(var r=0;r=e:i.to>e)||i.from==e&&"bookmark"==a.type&&(!n||i.marker.insertLeft)){var s=null==i.from||(a.inclusiveLeft?i.from<=e:i.from0&&s)for(var b=0;b0)){var u=[l,1],p=ae(c.from,s.from),d=ae(c.to,s.to);(p<0||!a.inclusiveLeft&&!p)&&u.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}function Ue(t){var e=t.markedSpans;if(e){for(var n=0;ne)&&(!n||qe(n,i.marker)<0)&&(n=i.marker)}return n}function Je(t,e,n,o,r){var i=Jt(t,e),a=Ae&&i.markedSpans;if(a)for(var s=0;s=0&&p<=0||u<=0&&p>=0)&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?ae(c.to,n)>=0:ae(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?ae(c.from,o)<=0:ae(c.from,o)<0)))return!0}}}function Ze(t){for(var e;e=Ke(t);)t=e.find(-1,!0).line;return t}function Qe(t){for(var e;e=Ye(t);)t=e.find(1,!0).line;return t}function tn(t){for(var e,n;e=Ye(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function en(t,e){var n=Jt(t,e),o=Ze(n);return n==o?e:ee(o)}function nn(t,e){if(e>t.lastLine())return e;var n,o=Jt(t,e);if(!on(t,o))return e;for(;n=Ye(o);)o=n.find(1,!0).line;return ee(o)+1}function on(t,e){var n=Ae&&e.markedSpans;if(n)for(var o=void 0,r=0;re.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var cn=function(t,e,n){this.text=t,ze(this,e),this.height=n?n(this):1};function un(t,e,n,o){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Ue(t),ze(t,n);var r=o?o(t):1;r!=t.height&&te(t,r)}function pn(t){t.parent=null,Ue(t)}cn.prototype.lineNo=function(){return ee(this)},wt(cn);var dn={},fn={};function hn(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?fn:dn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function gn(t,e){var n=A("span",null,null,l?"padding-right: .1px":null),o={pre:A("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var r=0;r<=(e.rest?e.rest.length:0);r++){var i=r?e.rest[r-1]:e.line,a=void 0;o.pos=0,o.addToken=yn,Mt(t.display.measure)&&(a=dt(i,t.doc.direction))&&(o.addToken=bn(o.addToken,a)),o.map=[],wn(i,o,me(t,i,e!=t.display.externalMeasured&&ee(i))),i.styleClasses&&(i.styleClasses.bgClass&&(o.bgClass=L(i.styleClasses.bgClass,o.bgClass||"")),i.styleClasses.textClass&&(o.textClass=L(i.styleClasses.textClass,o.textClass||""))),0==o.map.length&&o.map.push(0,0,o.content.appendChild(jt(t.display.measure))),0==r?(e.measure.map=o.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(o.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var s=o.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(o.content.className="cm-tab-wrap-hack")}return yt(t,"renderLine",t,e.line,o.pre),o.pre.className&&(o.textClass=L(o.pre.className,o.textClass||"")),o}function vn(t){var e=E("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function yn(t,e,n,o,r,i,l){if(e){var c,u=t.splitSpaces?mn(e,t.trailingSpace):e,p=t.cm.state.specialChars,d=!1;if(p.test(e)){c=document.createDocumentFragment();for(var f=0;1;){p.lastIndex=f;var h=p.exec(e),g=h?h.index-f:e.length-f;if(g){var v=document.createTextNode(u.slice(f,f+g));a&&s<9?c.appendChild(E("span",[v])):c.appendChild(v),t.map.push(t.pos,t.pos+g,v),t.col+=g,t.pos+=g}if(!h)break;f+=g+1;var y=void 0;if("\t"==h[0]){var m=t.cm.options.tabSize,b=m-t.col%m;(y=c.appendChild(E("span",K(b),"cm-tab"))).setAttribute("role","presentation"),y.setAttribute("cm-text","\t"),t.col+=b}else"\r"==h[0]||"\n"==h[0]?((y=c.appendChild(E("span","\r"==h[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",h[0]),t.col+=1):((y=t.cm.options.specialCharPlaceholder(h[0])).setAttribute("cm-text",h[0]),a&&s<9?c.appendChild(E("span",[y])):c.appendChild(y),t.col+=1);t.map.push(t.pos,t.pos+1,y),t.pos++}}else t.col+=e.length,c=document.createTextNode(u),t.map.push(t.pos,t.pos+e.length,c),a&&s<9&&(d=!0),t.pos+=e.length;if(t.trailingSpace=32==u.charCodeAt(e.length-1),n||o||r||d||i||l){var _=n||"";o&&(_+=o),r&&(_+=r);var w=E("span",[c],_,i);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&w.setAttribute(x,l[x]);return t.content.appendChild(w)}t.content.appendChild(c)}}function mn(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,o="",r=0;rc&&p.from<=c);d++);if(p.to>=u)return t(n,o,r,i,a,s,l);t(n,o.slice(0,p.to-c),r,i,null,s,l),i=null,o=o.slice(p.to-c),c=p.to}}}function _n(t,e,n,o){var r=!o&&n.widgetNode;r&&t.map.push(t.pos,t.pos+e,r),!o&&t.cm.display.input.needsContentAttribute&&(r||(r=t.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(t.cm.display.input.setUneditable(r),t.content.appendChild(r)),t.pos+=e,t.trailingSpace=!1}function wn(t,e,n){var o=t.markedSpans,r=t.text,i=0;if(o)for(var a,s,l,c,u,p,d,f=r.length,h=0,g=1,v="",y=0;;){if(y==h){l=c=u=s="",d=null,p=null,y=1/0;for(var m=[],b=void 0,_=0;_h||x.collapsed&&w.to==h&&w.from==h)){if(null!=w.to&&w.to!=h&&y>w.to&&(y=w.to,c=""),x.className&&(l+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&w.from==h&&(u+=" "+x.startStyle),x.endStyle&&w.to==y&&(b||(b=[])).push(x.endStyle,w.to),x.title&&((d||(d={})).title=x.title),x.attributes)for(var C in x.attributes)(d||(d={}))[C]=x.attributes[C];x.collapsed&&(!p||qe(p.marker,x)<0)&&(p=w)}else w.from>h&&y>w.from&&(y=w.from)}if(b)for(var O=0;O=f)break;for(var T=Math.min(f,y);1;){if(v){var P=h+v.length;if(!p){var k=P>T?v.slice(0,T-h):v;e.addToken(e,k,a?a+l:l,u,h+k.length==y?c:"",s,d)}if(P>=T){v=v.slice(T-h),h=T;break}h=P,u=""}v=r.slice(i,i=n[g++]),a=hn(n[g++],e.cm.options)}}else for(var E=1;E2&&i.push((l.bottom+c.top)/2-n.top)}}i.push(n.bottom-n.top)}}function Zn(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var o=0;on)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}function Qn(t,e){var n=ee(e=Ze(e)),o=t.display.externalMeasured=new xn(t.doc,e,n);o.lineN=n;var r=o.built=gn(t,o);return o.text=r.pre,k(t.display.lineMeasure,r.pre),o}function to(t,e,n,o){return oo(t,no(t,e),n,o)}function eo(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&ee)&&(r=(i=l-s)-1,e>=l&&(a="right")),null!=r){if(o=t[c+2],s==l&&n==(o.insertLeft?"left":"right")&&(a=n),"left"==n&&0==r)for(;c&&t[c-2]==t[c-3]&&t[c-1].insertLeft;)o=t[(c-=3)+2],a="left";if("right"==n&&r==l-s)for(;c=0&&(n=t[r]).left==n.right;r--);return n}function lo(t,e,n,o){var r,i=ao(e.map,n,o),l=i.node,c=i.start,u=i.end,p=i.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&it(e.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+u0&&(p=o="right"),r=t.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==o?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!r||!r.left&&!r.right)){var h=l.parentNode.getClientRects()[0];r=h?{left:h.left,right:h.left+jo(t.display),top:h.top,bottom:h.bottom}:io}for(var g=r.top-e.rect.top,v=r.bottom-e.rect.top,y=(g+v)/2,m=e.view.measure.heights,b=0;b=o.text.length?(l=o.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(t,e,n){return a(n?t-1:t,1==s[e].level!=n)}var p=ut(s,l,c),d=ct,f=u(l,p,"before"==c);return null!=d&&(f.other=u(l,d,"before"!=c)),f}function wo(t,e){var n=0;e=de(t.doc,e),t.options.lineWrapping||(n=jo(t.display)*e.ch);var o=Jt(t.doc,e.line),r=an(o)+$n(t.display);return{left:n,right:n,top:r,bottom:r+o.height}}function xo(t,e,n,o,r){var i=ie(t,e,n);return i.xRel=r,o&&(i.outside=o),i}function Co(t,e,n){var o=t.doc;if((n+=t.display.viewOffset)<0)return xo(o.first,0,null,-1,-1);var r=ne(o,n),i=o.first+o.size-1;if(r>i)return xo(o.first+o.size-1,Jt(o,i).text.length,null,1,1);e<0&&(e=0);for(var a=Jt(o,r);;){var s=Po(t,a,r,e,n),l=Xe(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==r)return c;a=Jt(o,r=c.line)}}function Oo(t,e,n,o){o-=vo(e);var r=e.text.length,i=st((function(e){return oo(t,n,e-1).bottom<=o}),r,0);return{begin:i,end:r=st((function(e){return oo(t,n,e).top>o}),i,r)}}function So(t,e,n,o){return n||(n=no(t,e)),Oo(t,e,n,yo(t,e,oo(t,n,o),"line").top)}function To(t,e,n,o){return!(t.bottom<=n)&&(t.top>n||(o?t.left:t.right)>e)}function Po(t,e,n,o,r){r-=an(e);var i=no(t,e),a=vo(e),s=0,l=e.text.length,c=!0,u=dt(e,t.doc.direction);if(u){var p=(t.options.lineWrapping?Eo:ko)(t,e,n,i,u,o,r);s=(c=1!=p.level)?p.from:p.to-1,l=c?p.to:p.from-1}var d,f,h=null,g=null,v=st((function(e){var n=oo(t,i,e);return n.top+=a,n.bottom+=a,!!To(n,o,r,!1)&&(n.top<=r&&n.left<=o&&(h=e,g=n),!0)}),s,l),y=!1;if(g){var m=o-g.left=_.bottom?1:0}return xo(n,v=at(e.text,v,1),f,y,o-d)}function ko(t,e,n,o,r,i,a){var s=st((function(s){var l=r[s],c=1!=l.level;return To(_o(t,ie(n,c?l.to:l.from,c?"before":"after"),"line",e,o),i,a,!0)}),0,r.length-1),l=r[s];if(s>0){var c=1!=l.level,u=_o(t,ie(n,c?l.from:l.to,c?"after":"before"),"line",e,o);To(u,i,a,!0)&&u.top>a&&(l=r[s-1])}return l}function Eo(t,e,n,o,r,i,a){var s=Oo(t,e,o,a),l=s.begin,c=s.end;/\s/.test(e.text.charAt(c-1))&&c--;for(var u=null,p=null,d=0;d=c||f.to<=l)){var h=oo(t,o,1!=f.level?Math.min(c,f.to)-1:Math.max(l,f.from)).right,g=hg)&&(u=f,p=g)}}return u||(u=r[r.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function Ao(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==ro){ro=E("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)ro.appendChild(document.createTextNode("x")),ro.appendChild(E("br"));ro.appendChild(document.createTextNode("x"))}k(t.measure,ro);var n=ro.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),P(t.measure),n||1}function jo(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=E("span","xxxxxxxxxx"),n=E("pre",[e],"CodeMirror-line-like");k(t.measure,n);var o=e.getBoundingClientRect(),r=(o.right-o.left)/10;return r>2&&(t.cachedCharWidth=r),r||10}function Mo(t){for(var e=t.display,n={},o={},r=e.gutters.clientLeft,i=e.gutters.firstChild,a=0;i;i=i.nextSibling,++a){var s=t.display.gutterSpecs[a].className;n[s]=i.offsetLeft+i.clientLeft+r,o[s]=i.clientWidth}return{fixedPos:Do(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:o,wrapperWidth:e.wrapper.clientWidth}}function Do(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Lo(t){var e=Ao(t.display),n=t.options.lineWrapping,o=n&&Math.max(5,t.display.scroller.clientWidth/jo(t.display)-3);return function(r){if(on(t.doc,r))return 0;var i=0;if(r.widgets)for(var a=0;a0&&(l=Jt(t.doc,c.line).text).length==c.ch){var u=F(l,l.length,t.options.tabSize)-l.length;c=ie(c.line,Math.max(0,Math.round((i-Gn(t.display).left)/jo(t.display))-u))}return c}function Vo(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,o=0;oe)&&(r.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=r.viewTo)Ae&&en(t.doc,e)r.viewFrom?Ho(t):(r.viewFrom+=o,r.viewTo+=o);else if(e<=r.viewFrom&&n>=r.viewTo)Ho(t);else if(e<=r.viewFrom){var i=Bo(t,n,n+o,1);i?(r.view=r.view.slice(i.index),r.viewFrom=i.lineN,r.viewTo+=o):Ho(t)}else if(n>=r.viewTo){var a=Bo(t,e,e,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):Ho(t)}else{var s=Bo(t,e,e,-1),l=Bo(t,n,n+o,1);s&&l?(r.view=r.view.slice(0,s.index).concat(Cn(t,s.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=o):Ho(t)}var c=r.externalMeasured;c&&(n=r.lineN&&e=o.viewTo)){var i=o.view[Vo(t,e)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==H(a,n)&&a.push(n)}}}function Ho(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function Bo(t,e,n,o){var r,i=Vo(t,e),a=t.display.view;if(!Ae||n==t.doc.first+t.doc.size)return{index:i,lineN:n};for(var s=t.display.viewFrom,l=0;l0){if(i==a.length-1)return null;r=s+a[i].size-e,i++}else r=s-e;e+=r,n+=r}for(;en(t.doc,n)!=n;){if(i==(o<0?0:a.length-1))return null;n+=o*a[i-(o<0?1:0)].size,i+=o}return{index:i,lineN:n}}function Uo(t,e,n){var o=t.display;0==o.view.length||e>=o.viewTo||n<=o.viewFrom?(o.view=Cn(t,e,n),o.viewFrom=e):(o.viewFrom>e?o.view=Cn(t,e,o.viewFrom).concat(o.view):o.viewFromn&&(o.view=o.view.slice(0,Vo(t,n)))),o.viewTo=n}function zo(t){for(var e=t.display.view,n=0,o=0;o=t.display.viewTo||s.to().line0&&(r.style.width=i.right-i.left+"px")}if(o.other){var a=n.appendChild(E("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=o.other.left+"px",a.style.top=o.other.top+"px",a.style.height=.85*(o.other.bottom-o.other.top)+"px"}}function Go(t,e){return t.top-e.top||t.left-e.left}function Ko(t,e,n){var o=t.display,r=t.doc,i=document.createDocumentFragment(),a=Gn(t.display),s=a.left,l=Math.max(o.sizerWidth,Yn(t)-o.sizer.offsetLeft)-a.right,c="ltr"==r.direction;function u(t,e,n,o){e<0&&(e=0),e=Math.round(e),o=Math.round(o),i.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+t+"px;\n top: "+e+"px; width: "+(null==n?l-t:n)+"px;\n height: "+(o-e)+"px"))}function p(e,n,o){var i,a,p=Jt(r,e),d=p.text.length;function f(n,o){return bo(t,ie(e,n),"div",p,o)}function h(e,n,o){var r=So(t,p,null,e),i="ltr"==n==("after"==o)?"left":"right";return f("after"==o?r.begin:r.end-(/\s/.test(p.text.charAt(r.end-1))?2:1),i)[i]}var g=dt(p,r.direction);return lt(g,n||0,null==o?d:o,(function(t,e,r,p){var v="ltr"==r,y=f(t,v?"left":"right"),m=f(e-1,v?"right":"left"),b=null==n&&0==t,_=null==o&&e==d,w=0==p,x=!g||p==g.length-1;if(m.top-y.top<=3){var C=(c?_:b)&&x,O=(c?b:_)&&w?s:(v?y:m).left,S=C?l:(v?m:y).right;u(O,y.top,S-O,y.bottom)}else{var T,P,k,E;v?(T=c&&b&&w?s:y.left,P=c?l:h(t,r,"before"),k=c?s:h(e,r,"after"),E=c&&_&&x?l:m.right):(T=c?h(t,r,"before"):s,P=!c&&b&&w?l:y.right,k=!c&&_&&x?s:m.left,E=c?h(e,r,"after"):l),u(T,y.top,P-T,y.bottom),y.bottom0?e.blinker=setInterval((function(){t.hasFocus()||Qo(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Xo(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Zo(t))}function Jo(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&Qo(t))}),100)}function Zo(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(yt(t,"focus",t,e),t.state.focused=!0,D(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),Yo(t))}function Qo(t,e){t.state.delayingBlurEvent||(t.state.focused&&(yt(t,"blur",t,e),t.state.focused=!1,T(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function tr(t){for(var e=t.display,n=e.lineDiv.offsetTop,o=Math.max(0,e.scroller.getBoundingClientRect().top),r=e.lineDiv.getBoundingClientRect().top,i=0,l=0;l.005||g<-.005)&&(rt.display.sizerWidth){var y=Math.ceil(d/jo(t.display));y>t.display.maxLineLength&&(t.display.maxLineLength=y,t.display.maxLine=c.line,t.display.maxLineChanged=!0)}}}Math.abs(i)>2&&(e.scroller.scrollTop+=i)}function er(t){if(t.widgets)for(var e=0;e=a&&(i=ne(e,an(Jt(e,l))-t.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function or(t,e){if(!mt(t,"scrollCursorIntoView")){var n=t.display,o=n.sizer.getBoundingClientRect(),r=null;if(e.top+o.top<0?r=!0:e.bottom+o.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!h){var i=E("div","",null,"position: absolute;\n top: "+(e.top-n.viewOffset-$n(t.display))+"px;\n height: "+(e.bottom-e.top+Kn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(i),i.scrollIntoView(r),t.display.lineSpace.removeChild(i)}}}function rr(t,e,n,o){var r;null==o&&(o=0),t.options.lineWrapping||e!=n||(n="before"==e.sticky?ie(e.line,e.ch+1,"before"):e,e=e.ch?ie(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e);for(var i=0;i<5;i++){var a=!1,s=_o(t,e),l=n&&n!=e?_o(t,n):s,c=ar(t,r={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-o,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+o}),u=t.doc.scrollTop,p=t.doc.scrollLeft;if(null!=c.scrollTop&&(fr(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(gr(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return r}function ir(t,e){var n=ar(t,e);null!=n.scrollTop&&fr(t,n.scrollTop),null!=n.scrollLeft&&gr(t,n.scrollLeft)}function ar(t,e){var n=t.display,o=Ao(t.display);e.top<0&&(e.top=0);var r=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,i=Xn(t),a={};e.bottom-e.top>i&&(e.bottom=e.top+i);var s=t.doc.height+qn(n),l=e.tops-o;if(e.topr+i){var u=Math.min(e.top,(c?s:e.bottom)-i);u!=r&&(a.scrollTop=u)}var p=t.options.fixedGutter?0:n.gutters.offsetWidth,d=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-p,f=Yn(t)-n.gutters.offsetWidth,h=e.right-e.left>f;return h&&(e.right=e.left+f),e.left<10?a.scrollLeft=0:e.leftf+d-3&&(a.scrollLeft=e.right+(h?0:10)-f),a}function sr(t,e){null!=e&&(pr(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function lr(t){pr(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function cr(t,e,n){null==e&&null==n||pr(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function ur(t,e){pr(t),t.curOp.scrollToPos=e}function pr(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,dr(t,wo(t,e.from),wo(t,e.to),e.margin))}function dr(t,e,n,o){var r=ar(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-o,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+o});cr(t,r.scrollLeft,r.scrollTop)}function fr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Wr(t,{top:e}),hr(t,e,!0),n&&Wr(t),Ir(t,100))}function hr(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function gr(t,e,n,o){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!o||(t.doc.scrollLeft=e,Kr(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function vr(t){var e=t.display,n=e.gutters.offsetWidth,o=Math.round(t.doc.height+qn(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:o,scrollHeight:o+Kn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var yr=function(t,e,n){this.cm=n;var o=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");o.tabIndex=r.tabIndex=-1,t(o),t(r),ht(o,"scroll",(function(){o.clientHeight&&e(o.scrollTop,"vertical")})),ht(r,"scroll",(function(){r.clientWidth&&e(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};yr.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,o=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?o+"px":"0";var r=t.viewHeight-(e?o:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?o+"px":"0",this.horiz.style.left=t.barLeft+"px";var i=t.viewWidth-t.barLeft-(n?o:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+i)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==o&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?o:0,bottom:e?o:0}},yr.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},yr.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},yr.prototype.zeroWidthHack=function(){var t=m&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new R,this.disableVert=new R},yr.prototype.enableZeroWidthBar=function(t,e,n){function o(){var r=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,o)}t.style.pointerEvents="auto",e.set(1e3,o)},yr.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var mr=function(){};function br(t,e){e||(e=vr(t));var n=t.display.barWidth,o=t.display.barHeight;_r(t,e);for(var r=0;r<4&&n!=t.display.barWidth||o!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&tr(t),_r(t,vr(t)),n=t.display.barWidth,o=t.display.barHeight}function _r(t,e){var n=t.display,o=n.scrollbars.update(e);n.sizer.style.paddingRight=(n.barWidth=o.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=o.bottom)+"px",n.heightForcer.style.borderBottom=o.bottom+"px solid transparent",o.right&&o.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=o.bottom+"px",n.scrollbarFiller.style.width=o.right+"px"):n.scrollbarFiller.style.display="",o.bottom&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=o.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}mr.prototype.update=function(){return{bottom:0,right:0}},mr.prototype.setScrollLeft=function(){},mr.prototype.setScrollTop=function(){},mr.prototype.clear=function(){};var wr={native:yr,null:mr};function xr(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&T(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new wr[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),ht(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,n){"horizontal"==n?gr(t,e):fr(t,e)}),t),t.display.scrollbars.addClass&&D(t.display.wrapper,t.display.scrollbars.addClass)}var Cr=0;function Or(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Cr,markArrays:null},Sn(t.curOp)}function Sr(t){var e=t.curOp;e&&Pn(e,(function(t){for(var e=0;e=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new Fr(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function kr(t){t.updatedDisplay=t.mustUpdate&&Ur(t.cm,t.update)}function Er(t){var e=t.cm,n=e.display;t.updatedDisplay&&tr(e),t.barMeasure=vr(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=to(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+Kn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Yn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Ar(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft=t.display.viewTo)){var n=+new Date+t.options.workTime,o=be(t,e.highlightFrontier),r=[];e.iter(o.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(i){if(o.line>=t.display.viewFrom){var a=i.styles,s=i.text.length>t.options.maxHighlightLength?Gt(e.mode,o.state):null,l=ye(t,i,o,!0);s&&(o.state=s),i.styles=l.styles;var c=i.styleClasses,u=l.classes;u?i.styleClasses=u:c&&(i.styleClasses=null);for(var p=!a||a.length!=i.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!p&&dn)return Ir(t,t.options.workDelay),!0})),e.highlightFrontier=o.line,e.modeFrontier=Math.max(e.modeFrontier,o.line),r.length&&Mr(t,(function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==zo(t))return!1;Yr(t)&&(Ho(t),e.dims=Mo(t));var r=o.first+o.size,i=Math.max(e.visible.from-t.options.viewportMargin,o.first),a=Math.min(r,e.visible.to+t.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(r,n.viewTo)),Ae&&(i=en(t.doc,i),a=nn(t.doc,a));var s=i!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;Uo(t,i,a),n.viewOffset=an(Jt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=zo(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Hr(t);return l>4&&(n.lineDiv.style.display="none"),$r(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Br(c),P(n.cursorDiv),P(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,Ir(t,400)),n.updateLineNumbers=null,!0}function zr(t,e){for(var n=e.viewport,o=!0;;o=!1){if(o&&t.options.lineWrapping&&e.oldDisplayWidth!=Yn(t))o&&(e.visible=nr(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+qn(t.display)-Xn(t),n.top)}),e.visible=nr(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!Ur(t,e))break;tr(t);var r=vr(t);Wo(t),br(t,r),Gr(t,r),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Wr(t,e){var n=new Fr(t,e);if(Ur(t,n)){tr(t),zr(t,n);var o=vr(t);Wo(t),br(t,o),Gr(t,o),n.finish()}}function $r(t,e,n){var o=t.display,r=t.options.lineNumbers,i=o.lineDiv,a=i.firstChild;function s(e){var n=e.nextSibling;return l&&m&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var c=o.view,u=o.viewFrom,p=0;p-1&&(f=!1),jn(t,d,u,n)),f&&(P(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(re(t.options,u)))),a=d.node.nextSibling}else{var h=Rn(t,d,u,n);i.insertBefore(h,a)}u+=d.size}for(;a;)a=s(a)}function qr(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",En(t,"gutterChanged",t)}function Gr(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+Kn(t)+"px"}function Kr(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var o=Do(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,i=o+"px",a=0;as.clientWidth,u=s.scrollHeight>s.clientHeight;if(r&&c||i&&u){if(i&&m&&l)t:for(var d=e.target,f=a.view;d!=s;d=d.parentNode)for(var h=0;h=0&&ae(t,o.to())<=0)return n}return-1};var ai=function(t,e){this.anchor=t,this.head=e};function si(t,e,n){var o=t&&t.options.selectionsMayTouch,r=e[n];e.sort((function(t,e){return ae(t.from(),e.from())})),n=H(e,r);for(var i=1;i0:l>=0){var c=ue(s.from(),a.from()),u=ce(s.to(),a.to()),p=s.empty()?a.from()==a.head:s.from()==s.head;i<=n&&--n,e.splice(--i,2,new ai(p?u:c,p?c:u))}}return new ii(e,n)}function li(t,e){return new ii([new ai(t,e||t)],0)}function ci(t){return t.text?ie(t.from.line+t.text.length-1,Y(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function ui(t,e){if(ae(t,e.from)<0)return t;if(ae(t,e.to)<=0)return ci(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,o=t.ch;return t.line==e.to.line&&(o+=ci(e).ch-e.to.ch),ie(n,o)}function pi(t,e){for(var n=[],o=0;o1&&t.remove(s.line+1,h-1),t.insert(s.line+1,y)}En(t,"change",t,e)}function mi(t,e,n){function o(t,r,i){if(t.linked)for(var a=0;a1&&!t.done[t.done.length-2].ranges?(t.done.pop(),Y(t.done)):void 0}function Ti(t,e,n,o){var r=t.history;r.undone.length=0;var i,a,s=+new Date;if((r.lastOp==o||r.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&r.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(i=Si(r,r.lastOp==o)))a=Y(i.changes),0==ae(e.from,e.to)&&0==ae(e.from,a.to)?a.to=ci(e):i.changes.push(Ci(t,e));else{var l=Y(r.done);for(l&&l.ranges||Ei(t.sel,r.done),i={changes:[Ci(t,e)],generation:r.generation},r.done.push(i);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=o,r.lastOrigin=r.lastSelOrigin=e.origin,a||yt(t,"historyAdded")}function Pi(t,e,n,o){var r=e.charAt(0);return"*"==r||"+"==r&&n.ranges.length==o.ranges.length&&n.somethingSelected()==o.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function ki(t,e,n,o){var r=t.history,i=o&&o.origin;n==r.lastSelOp||i&&r.lastSelOrigin==i&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==i||Pi(t,i,Y(r.done),e))?r.done[r.done.length-1]=e:Ei(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=i,r.lastSelOp=n,o&&!1!==o.clearRedo&&Oi(r.undone)}function Ei(t,e){var n=Y(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Ai(t,e,n,o){var r=e["spans_"+t.id],i=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,o),(function(n){n.markedSpans&&((r||(r=e["spans_"+t.id]={}))[i]=n.markedSpans),++i}))}function ji(t){if(!t)return null;for(var e,n=0;n-1&&(Y(s)[p]=c[p],delete c[p])}}}return o}function Ni(t,e,n,o){if(o){var r=t.anchor;if(n){var i=ae(e,r)<0;i!=ae(n,r)<0?(r=e,e=n):i!=ae(e,n)<0&&(e=n)}return new ai(r,e)}return new ai(n||e,e)}function Ii(t,e,n,o,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),Ui(t,new ii([Ni(t.sel.primary(),e,n,r)],0),o)}function Vi(t,e,n){for(var o=[],r=t.cm&&(t.cm.display.shift||t.extend),i=0;i=e.ch:s.to>e.ch))){if(r&&(yt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var p=l.find(o<0?1:-1),d=void 0;if((o<0?u:c)&&(p=Yi(t,p,-o,p&&p.line==e.line?i:null)),p&&p.line==e.line&&(d=ae(p,n))&&(o<0?d<0:d>0))return Gi(t,p,e,o,r)}var f=l.find(o<0?-1:1);return(o<0?c:u)&&(f=Yi(t,f,o,f.line==e.line?i:null)),f?Gi(t,f,e,o,r):null}}return e}function Ki(t,e,n,o,r){var i=o||1,a=Gi(t,e,n,i,r)||!r&&Gi(t,e,n,i,!0)||Gi(t,e,n,-i,r)||!r&&Gi(t,e,n,-i,!0);return a||(t.cantEdit=!0,ie(t.first,0))}function Yi(t,e,n,o){return n<0&&0==e.ch?e.line>t.first?de(t,ie(e.line-1)):null:n>0&&e.ch==(o||Jt(t,e.line)).text.length?e.line=0;--r)Qi(t,{from:o[r].from,to:o[r].to,text:r?[""]:e.text,origin:e.origin});else Qi(t,e)}}function Qi(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ae(e.from,e.to)){var n=pi(t,e);Ti(t,e,n,t.cm?t.cm.curOp.id:NaN),na(t,e,n,Re(t,e));var o=[];mi(t,(function(t,n){n||-1!=H(o,t.history)||(sa(t.history,e),o.push(t.history)),na(t,e,null,Re(t,e))}))}}function ta(t,e,n){var o=t.cm&&t.cm.state.suppressEdits;if(!o||n){for(var r,i=t.history,a=t.sel,s="undo"==e?i.done:i.undone,l="undo"==e?i.undone:i.done,c=0;c=0;--f){var h=d(f);if(h)return h.v}}}}function ea(t,e){if(0!=e&&(t.first+=e,t.sel=new ii(X(t.sel.ranges,(function(t){return new ai(ie(t.anchor.line+e,t.anchor.ch),ie(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){Fo(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,o=n.viewFrom;ot.lastLine())){if(e.from.linei&&(e={from:e.from,to:ie(i,Jt(t,i).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Zt(t,e.from,e.to),n||(n=pi(t,e)),t.cm?oa(t.cm,e,o):yi(t,e,o),zi(t,n,z),t.cantEdit&&Ki(t,ie(t.firstLine(),0))&&(t.cantEdit=!1)}}function oa(t,e,n){var o=t.doc,r=t.display,i=e.from,a=e.to,s=!1,l=i.line;t.options.lineWrapping||(l=ee(Ze(Jt(o,i.line))),o.iter(l,a.line+1,(function(t){if(t==r.maxLine)return s=!0,!0}))),o.sel.contains(e.from,e.to)>-1&&bt(t),yi(o,e,n,Lo(t)),t.options.lineWrapping||(o.iter(l,i.line+e.text.length,(function(t){var e=sn(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),ke(o,i.line),Ir(t,400);var c=e.text.length-(a.line-i.line)-1;e.full?Fo(t):i.line!=a.line||1!=e.text.length||vi(t.doc,e)?Fo(t,i.line,a.line+1,c):Ro(t,i.line,"text");var u=_t(t,"changes"),p=_t(t,"change");if(p||u){var d={from:i,to:a,text:e.text,removed:e.removed,origin:e.origin};p&&En(t,"change",t,d),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(d)}t.display.selForContextMenu=null}function ra(t,e,n,o,r){var i;o||(o=n),ae(o,n)<0&&(n=(i=[o,n])[0],o=i[1]),"string"==typeof e&&(e=t.splitLines(e)),Zi(t,{from:n,to:o,text:e,origin:r})}function ia(t,e,n,o){n1||!(this.children[0]instanceof ca))){var s=[];this.collapse(s),this.children=[new ca(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var a=r.lines.length%25+25,s=a;s10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var o=0;o0||0==a&&!1!==i.clearWhenEmpty)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=A("span",[i.replacedWith],"CodeMirror-widget"),o.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),o.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(Je(t,e.line,e,n,i)||e.line!=n.line&&Je(t,n.line,e,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");Me()}i.addToHistory&&Ti(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,l=e.line,c=t.cm;if(t.iter(l,n.line+1,(function(o){c&&i.collapsed&&!c.options.lineWrapping&&Ze(o)==c.display.maxLine&&(s=!0),i.collapsed&&l!=e.line&&te(o,0),Ie(o,new De(i,l==e.line?e.ch:null,l==n.line?n.ch:null),t.cm&&t.cm.curOp),++l})),i.collapsed&&t.iter(e.line,n.line+1,(function(e){on(t,e)&&te(e,0)})),i.clearOnEnter&&ht(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(je(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),i.collapsed&&(i.id=++ha,i.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),i.collapsed)Fo(c,e.line,n.line+1);else if(i.className||i.startStyle||i.endStyle||i.css||i.attributes||i.title)for(var u=e.line;u<=n.line;u++)Ro(c,u,"text");i.atomic&&$i(c.doc),En(c,"markerAdded",c,i)}return i}ga.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&Or(t),_t(this,"clear")){var n=this.find();n&&En(this,"clear",n.from,n.to)}for(var o=null,r=null,i=0;it.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=o&&t&&this.collapsed&&Fo(t,o,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&$i(t.doc)),t&&En(t,"markerCleared",t,this,o,r),e&&Sr(t),this.parent&&this.parent.clear()}},ga.prototype.find=function(t,e){var n,o;null==t&&"bookmark"==this.type&&(t=1);for(var r=0;r=0;l--)Zi(this,o[l]);s?Bi(this,s):this.cm&&lr(this.cm)})),undo:Nr((function(){ta(this,"undo")})),redo:Nr((function(){ta(this,"redo")})),undoSelection:Nr((function(){ta(this,"undo",!0)})),redoSelection:Nr((function(){ta(this,"redo",!0)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,o=0;o=t.ch)&&e.push(r.marker.parent||r.marker)}return e},findMarks:function(t,e,n){t=de(this,t),e=de(this,e);var o=[],r=t.line;return this.iter(t.line,e.line+1,(function(i){var a=i.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&r!=t.line||null!=l.from&&r==e.line&&l.from>=e.ch||n&&!n(l.marker)||o.push(l.marker.parent||l.marker)}++r})),o},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var o=0;ot)return e=t,!0;t-=i,++n})),de(this,ie(n,e))},indexFromPos:function(t){var e=(t=de(this,t)).ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var p=t.dataTransfer.getData("Text");if(p){var d;if(e.state.draggingText&&!e.state.draggingText.copy&&(d=e.listSelections()),zi(e.doc,li(n,n)),d)for(var f=0;f=0;e--)ra(t.doc,"",o[e].from,o[e].to,"+delete");lr(t)}))}function Ga(t,e,n){var o=at(t.text,e+n,n);return o<0||o>t.text.length?null:o}function Ka(t,e,n){var o=Ga(t,e.ch,n);return null==o?null:new ie(e.line,o,n<0?"after":"before")}function Ya(t,e,n,o,r){if(t){"rtl"==e.doc.direction&&(r=-r);var i=dt(n,e.doc.direction);if(i){var a,s=r<0?Y(i):i[0],l=r<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var c=no(e,n);a=r<0?n.text.length-1:0;var u=oo(e,c,a).top;a=st((function(t){return oo(e,c,t).top==u}),r<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Ga(n,a,1))}else a=r<0?s.to:s.from;return new ie(o,a,l)}}return new ie(o,r<0?n.text.length:0,r<0?"before":"after")}function Xa(t,e,n,o){var r=dt(e,t.doc.direction);if(!r)return Ka(e,n,o);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var i=ut(r,n.ch,n.sticky),a=r[i];if("ltr"==t.doc.direction&&a.level%2==0&&(o>0?a.to>n.ch:a.from=a.from&&d>=u.begin)){var f=p?"before":"after";return new ie(n.line,d,f)}}var h=function(t,e,o){for(var i=function(t,e){return e?new ie(n.line,l(t,1),"before"):new ie(n.line,t,"after")};t>=0&&t0==(1!=a.level),c=s?o.begin:l(o.end,-1);if(a.from<=c&&c0?u.end:l(u.begin,-1);return null==v||o>0&&v==e.text.length||!(g=h(o>0?0:r.length-1,o,c(v)))?null:g}Fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Fa["default"]=m?Fa.macDefault:Fa.pcDefault;var Ja={selectAll:Xi,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),z)},killLine:function(t){return qa(t,(function(e){if(e.empty()){var n=Jt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)r=new ie(r.line,r.ch+1),t.replaceRange(i.charAt(r.ch-1)+i.charAt(r.ch-2),ie(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var a=Jt(t.doc,r.line-1).text;a&&(r=new ie(r.line,1),t.replaceRange(i.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),ie(r.line-1,a.length-1),r,"+transpose"))}n.push(new ai(r,r))}t.setSelections(n)}))},newlineAndIndent:function(t){return Mr(t,(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var o=0;o-1&&(ae((r=s.ranges[r]).from(),e)<0||e.xRel>0)&&(ae(r.to(),e)>0||e.xRel<0)?xs(t,o,e,i):Os(t,o,e,i)}function xs(t,e,n,o){var r=t.display,i=!1,c=Dr(t,(function(e){l&&(r.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:Jo(t)),vt(r.wrapper.ownerDocument,"mouseup",c),vt(r.wrapper.ownerDocument,"mousemove",u),vt(r.scroller,"dragstart",p),vt(r.scroller,"drop",c),i||(xt(e),o.addNew||Ii(t.doc,n,null,null,o.extend),l&&!d||a&&9==s?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),u=function(t){i=i||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},p=function(){return i=!0};l&&(r.scroller.draggable=!0),t.state.draggingText=c,c.copy=!o.moveOnDrag,ht(r.wrapper.ownerDocument,"mouseup",c),ht(r.wrapper.ownerDocument,"mousemove",u),ht(r.scroller,"dragstart",p),ht(r.scroller,"drop",c),t.state.delayingBlurEvent=!0,setTimeout((function(){return r.input.focus()}),20),r.scroller.dragDrop&&r.scroller.dragDrop()}function Cs(t,e,n){if("char"==n)return new ai(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new ai(ie(e.line,0),de(t.doc,ie(e.line+1,0)));var o=n(t,e);return new ai(o.from,o.to)}function Os(t,e,n,o){a&&Jo(t);var r=t.display,i=t.doc;xt(e);var s,l,c=i.sel,u=c.ranges;if(o.addNew&&!o.extend?(l=i.sel.contains(n),s=l>-1?u[l]:new ai(n,n)):(s=i.sel.primary(),l=i.sel.primIndex),"rectangle"==o.unit)o.addNew||(s=new ai(n,n)),n=Io(t,e,!0,!0),l=-1;else{var p=Cs(t,n,o.unit);s=o.extend?Ni(s,p.anchor,p.head,o.extend):p}o.addNew?-1==l?(l=u.length,Ui(i,si(t,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==o.unit&&!o.extend?(Ui(i,si(t,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=i.sel):Fi(i,l,s,W):(l=0,Ui(i,new ii([s],0),W),c=i.sel);var d=n;function f(e){if(0!=ae(d,e))if(d=e,"rectangle"==o.unit){for(var r=[],a=t.options.tabSize,u=F(Jt(i,n.line).text,n.ch,a),p=F(Jt(i,e.line).text,e.ch,a),f=Math.min(u,p),h=Math.max(u,p),g=Math.min(n.line,e.line),v=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=v;g++){var y=Jt(i,g).text,m=q(y,f,a);f==h?r.push(new ai(ie(g,m),ie(g,m))):y.length>m&&r.push(new ai(ie(g,m),ie(g,q(y,h,a))))}r.length||r.push(new ai(n,n)),Ui(i,si(t,c.ranges.slice(0,l).concat(r),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,_=s,w=Cs(t,e,o.unit),x=_.anchor;ae(w.anchor,x)>0?(b=w.head,x=ue(_.from(),w.anchor)):(b=w.anchor,x=ce(_.to(),w.head));var C=c.ranges.slice(0);C[l]=Ss(t,new ai(de(i,x),b)),Ui(i,si(t,C,l),W)}}var h=r.wrapper.getBoundingClientRect(),g=0;function v(e){var n=++g,a=Io(t,e,!0,"rectangle"==o.unit);if(a)if(0!=ae(a,d)){t.curOp.focus=M(),f(a);var s=nr(r,i);(a.line>=s.to||a.lineh.bottom?20:0;l&&setTimeout(Dr(t,(function(){g==n&&(r.scroller.scrollTop+=l,v(e))})),50)}}function y(e){t.state.selectingText=!1,g=1/0,e&&(xt(e),r.input.focus()),vt(r.wrapper.ownerDocument,"mousemove",m),vt(r.wrapper.ownerDocument,"mouseup",b),i.history.lastSelOrigin=null}var m=Dr(t,(function(t){0!==t.buttons&&Pt(t)?v(t):y(t)})),b=Dr(t,y);t.state.selectingText=b,ht(r.wrapper.ownerDocument,"mousemove",m),ht(r.wrapper.ownerDocument,"mouseup",b)}function Ss(t,e){var n=e.anchor,o=e.head,r=Jt(t.doc,n.line);if(0==ae(n,o)&&n.sticky==o.sticky)return e;var i=dt(r);if(!i)return e;var a=ut(i,n.ch,n.sticky),s=i[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==i.length)return e;if(o.line!=n.line)l=(o.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var u=ut(i,o.ch,o.sticky),p=u-a||(o.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?p<0:p>0}var d=i[c+(l?-1:0)],f=l==(1==d.level),h=f?d.from:d.to,g=f?"after":"before";return n.ch==h&&n.sticky==g?e:new ai(new ie(n.line,h,g),o)}function Ts(t,e,n,o){var r,i;if(e.touches)r=e.touches[0].clientX,i=e.touches[0].clientY;else try{r=e.clientX,i=e.clientY}catch(t){return!1}if(r>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;o&&xt(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!_t(t,n))return Ot(e);i-=s.top-a.viewOffset;for(var l=0;l=r)return yt(t,n,t,ne(t.doc,i),t.display.gutterSpecs[l].className,e),Ot(e)}}function Ps(t,e){return Ts(t,e,"gutterClick",!0)}function ks(t,e){Wn(t.display,e)||Es(t,e)||mt(t,e,"contextmenu")||C||t.display.input.onContextMenu(e)}function Es(t,e){return!!_t(t,"gutterContextMenu")&&Ts(t,e,"gutterContextMenu",!1)}function As(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),fo(t)}vs.prototype.compare=function(t,e,n){return this.time+gs>t&&0==ae(e,this.pos)&&n==this.button};var js={toString:function(){return"CodeMirror.Init"}},Ms={},Ds={};function Ls(t){var e=t.optionHandlers;function n(n,o,r,i){t.defaults[n]=o,r&&(e[n]=i?function(t,e,n){n!=js&&r(t,e,n)}:r)}t.defineOption=n,t.Init=js,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,hi(t)}),!0),n("indentUnit",2,hi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){gi(t),fo(t),Fo(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],o=t.doc.first;t.doc.iter((function(t){for(var r=0;;){var i=t.text.indexOf(e,r);if(-1==i)break;r=i+e.length,n.push(ie(o,i))}o++}));for(var r=n.length-1;r>=0;r--)ra(t.doc,e,n[r],ie(n[r].line,n[r].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=js&&t.refresh()})),n("specialCharPlaceholder",vn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!_),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){As(t),Zr(t)}),!0),n("keyMap","default",(function(t,e,n){var o=$a(e),r=n!=js&&$a(n);r&&r.detach&&r.detach(t,o),o.attach&&o.attach(t,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Is,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=Xr(e,t.options.lineNumbers),Zr(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Do(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return br(t)}),!0),n("scrollbarStyle","native",(function(t){xr(t),br(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=Xr(t.options.gutters,e),Zr(t)}),!0),n("firstLineNumber",1,Zr,!0),n("lineNumberFormatter",(function(t){return t}),Zr,!0),n("showCursorWhenSelecting",!1,Wo,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Qo(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=''===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Ns),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Wo,!0),n("singleCursorHeightPerLine",!0,Wo,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,gi,!0),n("addModeClass",!1,gi,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,gi,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}function Ns(t,e,n){if(!e!=!(n&&n!=js)){var o=t.display.dragFunctions,r=e?ht:vt;r(t.display.scroller,"dragstart",o.start),r(t.display.scroller,"dragenter",o.enter),r(t.display.scroller,"dragover",o.over),r(t.display.scroller,"dragleave",o.leave),r(t.display.scroller,"drop",o.drop)}}function Is(t){t.options.lineWrapping?(D(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(T(t.display.wrapper,"CodeMirror-wrap"),ln(t)),No(t),Fo(t),fo(t),setTimeout((function(){return br(t)}),100)}function Vs(t,e){var n=this;if(!(this instanceof Vs))return new Vs(t,e);this.options=e=e?V(e):{},V(Ms,e,!1);var o=e.value;"string"==typeof o?o=new Ca(o,e.mode,null,e.lineSeparator,e.direction):e.mode&&(o.modeOption=e.mode),this.doc=o;var r=new Vs.inputStyles[e.inputStyle](this),i=this.display=new Qr(t,o,r,e);for(var c in i.wrapper.CodeMirror=this,As(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),xr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new R,keySeq:null,specialChars:null},e.autofocus&&!y&&i.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Fs(this),ja(),Or(this),this.curOp.forceUpdate=!0,bi(this,o),e.autofocus&&!y||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Zo(n)}),20):Qo(this),Ds)Ds.hasOwnProperty(c)&&Ds[c](this,e[c],js);Yr(this),e.finishInit&&e.finishInit(this);for(var u=0;u20*20}ht(e.scroller,"touchstart",(function(r){if(!mt(t,r)&&!i(r)&&!Ps(t,r)){e.input.ensurePolled(),clearTimeout(n);var a=+new Date;e.activeTouch={start:a,moved:!1,prev:a-o.end<=300?o:null},1==r.touches.length&&(e.activeTouch.left=r.touches[0].pageX,e.activeTouch.top=r.touches[0].pageY)}})),ht(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),ht(e.scroller,"touchend",(function(n){var o=e.activeTouch;if(o&&!Wn(e,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var i,a=t.coordsChar(e.activeTouch,"page");i=!o.prev||l(o,o.prev)?new ai(a,a):!o.prev.prev||l(o,o.prev.prev)?t.findWordAt(a):new ai(ie(a.line,0),de(t.doc,ie(a.line+1,0))),t.setSelection(i.anchor,i.head),t.focus(),xt(n)}r()})),ht(e.scroller,"touchcancel",r),ht(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(fr(t,e.scroller.scrollTop),gr(t,e.scroller.scrollLeft,!0),yt(t,"scroll",t))})),ht(e.scroller,"mousewheel",(function(e){return ri(t,e)})),ht(e.scroller,"DOMMouseScroll",(function(e){return ri(t,e)})),ht(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){mt(t,e)||St(e)},over:function(e){mt(t,e)||(Pa(t,e),St(e))},start:function(e){return Ta(t,e)},drop:Dr(t,Sa),leave:function(e){mt(t,e)||ka(t)}};var c=e.input.getField();ht(c,"keyup",(function(e){return ps.call(t,e)})),ht(c,"keydown",Dr(t,cs)),ht(c,"keypress",Dr(t,ds)),ht(c,"focus",(function(e){return Zo(t,e)})),ht(c,"blur",(function(e){return Qo(t,e)}))}Vs.defaults=Ms,Vs.optionHandlers=Ds;var Rs=[];function Hs(t,e,n,o){var r,i=t.doc;null==n&&(n="add"),"smart"==n&&(i.mode.indent?r=be(t,e).state:n="prev");var a=t.options.tabSize,s=Jt(i,e),l=F(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(o||/\S/.test(s.text)){if("smart"==n&&((c=i.mode.indent(r,s.text.slice(u.length),s.text))==U||c>150)){if(!o)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>i.first?F(Jt(i,e-1).text,null,a):0:"add"==n?c=l+t.options.indentUnit:"subtract"==n?c=l-t.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var p="",d=0;if(t.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)d+=a,p+="\t";if(da,l=Lt(e),c=null;if(s&&o.ranges.length>1)if(Bs&&Bs.text.join("\n")==e){if(o.ranges.length%Bs.text.length==0){c=[];for(var u=0;u=0;d--){var f=o.ranges[d],h=f.from(),g=f.to();f.empty()&&(n&&n>0?h=ie(h.line,h.ch-n):t.state.overwrite&&!s?g=ie(g.line,Math.min(Jt(i,g.line).text.length,g.ch+Y(l).length)):s&&Bs&&Bs.lineWise&&Bs.text.join("\n")==l.join("\n")&&(h=g=ie(h.line,0)));var v={from:h,to:g,text:c?c[d%c.length]:l,origin:r||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};Zi(t.doc,v),En(t,"inputRead",t,v)}e&&!s&&$s(t,e),lr(t),t.curOp.updateInput<2&&(t.curOp.updateInput=p),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Ws(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Mr(e,(function(){return zs(e,n,0,null,"paste")})),!0}function $s(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.doc.sel,o=n.ranges.length-1;o>=0;o--){var r=n.ranges[o];if(!(r.head.ch>100||o&&n.ranges[o-1].head.line==r.head.line)){var i=t.getModeAt(r.head),a=!1;if(i.electricChars){for(var s=0;s-1){a=Hs(t,r.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(Jt(t.doc,r.head.line).text.slice(0,r.head.ch))&&(a=Hs(t,r.head.line,"smart"));a&&En(t,"electricInput",t,r.head.line)}}}function qs(t){for(var e=[],n=[],o=0;on&&(Hs(this,r.head.line,t,!0),n=r.head.line,o==this.doc.sel.primIndex&&lr(this));else{var i=r.from(),a=r.to(),s=Math.max(n,i.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Fi(this.doc,o,new ai(i,c[o].to()),z)}}})),getTokenAt:function(t,e){return Oe(this,t,e)},getLineTokens:function(t,e){return Oe(this,ie(t),e,!0)},getTokenTypeAt:function(t){t=de(this.doc,t);var e,n=me(this,Jt(this.doc,t.line)),o=0,r=(n.length-1)/2,i=t.ch;if(0==i)e=n[2];else for(;;){var a=o+r>>1;if((a?n[2*a-1]:0)>=i)r=a;else{if(!(n[2*a+1]i&&(t=i,r=!0),o=Jt(this.doc,t)}else o=t;return yo(this,o,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-an(o):0)},defaultTextHeight:function(){return Ao(this.display)},defaultCharWidth:function(){return jo(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,o,r){var i=this.display,a=(t=_o(this,de(this.doc,t))).bottom,s=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),i.sizer.appendChild(e),"over"==o)a=t.top;else if("above"==o||"near"==o){var l=Math.max(i.wrapper.clientHeight,this.doc.height),c=Math.max(i.sizer.clientWidth,i.lineSpace.clientWidth);('above'==o||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom),s+e.offsetWidth>c&&(s=c-e.offsetWidth)}e.style.top=a+"px",e.style.left=e.style.right="","right"==r?(s=i.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==r?s=0:"middle"==r&&(s=(i.sizer.clientWidth-e.offsetWidth)/2),e.style.left=s+"px"),n&&ir(this,{left:s,top:a,right:s+e.offsetWidth,bottom:a+e.offsetHeight})},triggerOnKeyDown:Lr(cs),triggerOnKeyPress:Lr(ds),triggerOnKeyUp:ps,triggerOnMouseDown:Lr(ms),execCommand:function(t){if(Ja.hasOwnProperty(t))return Ja[t].call(null,this)},triggerElectric:Lr((function(t){$s(this,t)})),findPosH:function(t,e,n,o){var r=1;e<0&&(r=-1,e=-e);for(var i=de(this.doc,t),a=0;a0&&a(e.charAt(n-1));)--n;for(;o.5||this.options.lineWrapping)&&No(this),yt(this,"refresh",this)})),swapDoc:Lr((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),bi(this,t),fo(this),this.display.input.reset(),cr(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,En(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},wt(t),t.registerHelper=function(e,o,r){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][o]=r},t.registerGlobalHelper=function(e,o,r,i){t.registerHelper(e,o,i),n[e]._global.push({pred:r,val:i})}}function Xs(t,e,n,o,r){var i=e,a=n,s=Jt(t,e.line),l=r&&"rtl"==t.direction?-n:n;function c(){var n=e.line+l;return!(n=t.first+t.size)&&(e=new ie(n,e.ch,e.sticky),s=Jt(t,n))}function u(i){var a;if("codepoint"==o){var u=s.text.charCodeAt(e.ch+(n>0?0:-1));if(isNaN(u))a=null;else{var p=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new ie(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(p?2:1))),-n)}}else a=r?Xa(t.cm,s,e,n):Ka(s,e,n);if(null==a){if(i||!c())return!1;e=Ya(r,t.cm,s,e.line,l)}else e=a;return!0}if("char"==o||"codepoint"==o)u();else if("column"==o)u(!0);else if("word"==o||"group"==o)for(var p=null,d="group"==o,f=t.cm&&t.cm.getHelper(e,"wordChars"),h=!0;!(n<0)||u(!h);h=!1){var g=s.text.charAt(e.ch)||"\n",v=nt(g,f)?"w":d&&"\n"==g?"n":!d||/\s/.test(g)?null:"p";if(!d||h||v||(v="s"),p&&p!=v){n<0&&(n=1,u(),e.sticky="after");break}if(v&&(p=v),n>0&&!u(!h))break}var y=Ki(t,e,i,a,!0);return se(i,y)&&(y.hitSide=!0),y}function Js(t,e,n,o){var r,i,a=t.doc,s=e.left;if("page"==o){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*Ao(t.display),3);r=(n>0?e.bottom:e.top)+n*c}else"line"==o&&(r=n>0?e.bottom+3:e.top-3);for(;(i=Co(t,s,r)).outside;){if(n<0?r<=0:r>=a.height){i.hitSide=!0;break}r+=5*n}return i}var Zs=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new R,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Qs(t,e){var n=eo(t,e.line);if(!n||n.hidden)return null;var o=Jt(t.doc,e.line),r=Zn(n,o,e.line),i=dt(o,t.doc.direction),a="left";i&&(a=ut(i,e.ch)%2?"right":"left");var s=ao(r.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function tl(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function el(t,e){return e&&(t.bad=!0),t}function nl(t,e,n,o,r){var i="",a=!1,s=t.doc.lineSeparator(),l=!1;function c(t){return function(e){return e.id==t}}function u(){a&&(i+=s,l&&(i+=s),a=l=!1)}function p(t){t&&(u(),i+=t)}function d(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void p(n);var i,f=e.getAttribute("cm-marker");if(f){var h=t.findMarks(ie(o,0),ie(r+1,0),c(+f));return void(h.length&&(i=h[0].find(0))&&p(Zt(t.doc,i.from,i.to).join(s)))}if("false"==e.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;g&&u();for(var v=0;v=e.display.viewTo||i.line=e.display.viewFrom&&Qs(e,r)||{node:l[0].measure.map[2],offset:0},u=i.lineo.firstLine()&&(a=ie(a.line-1,Jt(o.doc,a.line-1).length)),s.ch==Jt(o.doc,s.line).text.length&&s.liner.viewTo-1)return!1;a.line==r.viewFrom||0==(t=Vo(o,a.line))?(e=ee(r.view[0].line),n=r.view[0].node):(e=ee(r.view[t].line),n=r.view[t-1].node.nextSibling);var l,c,u=Vo(o,s.line);if(u==r.view.length-1?(l=r.viewTo-1,c=r.lineDiv.lastChild):(l=ee(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;for(var p=o.doc.splitLines(nl(o,n,c,e,l)),d=Zt(o.doc,ie(e,0),ie(l,Jt(o.doc,l).text.length));p.length>1&&d.length>1;)if(Y(p)==Y(d))p.pop(),d.pop(),l--;else{if(p[0]!=d[0])break;p.shift(),d.shift(),e++}for(var f=0,h=0,g=p[0],v=d[0],y=Math.min(g.length,v.length);fa.ch&&m.charCodeAt(m.length-h-1)==b.charCodeAt(b.length-h-1);)f--,h++;p[p.length-1]=m.slice(0,m.length-h).replace(/^\u200b+/,""),p[0]=p[0].slice(f).replace(/\u200b+$/,"");var w=ie(e,f),x=ie(l,d.length?Y(d).length-h:0);return p.length>1||p[0]||ae(w,x)?(ra(o.doc,p,w,x,"+input"),!0):void 0},Zs.prototype.ensurePolled=function(){this.forceCompositionEnd()},Zs.prototype.reset=function(){this.forceCompositionEnd()},Zs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Zs.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},Zs.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Mr(this.cm,(function(){return Fo(t.cm)}))},Zs.prototype.setUneditable=function(t){t.contentEditable="false"},Zs.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Dr(this.cm,zs)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Zs.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Zs.prototype.onContextMenu=function(){},Zs.prototype.resetPosition=function(){},Zs.prototype.needsContentAttribute=!0;var il=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new R,this.hasSelection=!1,this.composing=null};function al(t,e){if((e=e?V(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=M();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function o(){t.value=s.getValue()}var r;if(t.form&&(ht(t.form,"submit",o),!e.leaveSubmitMethodAlone)){var i=t.form;r=i.submit;try{var a=i.submit=function(){o(),i.submit=r,i.submit(),i.submit=a}}catch(t){}}e.finishInit=function(n){n.save=o,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,o(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(vt(t.form,"submit",o),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=r))}},t.style.display="none";var s=Vs((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s}function sl(t){t.off=vt,t.on=ht,t.wheelEventPixels=oi,t.Doc=Ca,t.splitLines=Lt,t.countColumn=F,t.findColumn=q,t.isWordChar=et,t.Pass=U,t.signal=yt,t.Line=cn,t.changeEnd=ci,t.scrollbarModel=wr,t.Pos=ie,t.cmpPos=ae,t.modes=Rt,t.mimeModes=Ht,t.resolveMode=zt,t.getMode=Wt,t.modeExtensions=$t,t.extendMode=qt,t.copyState=Gt,t.startState=Yt,t.innerMode=Kt,t.commands=Ja,t.keyMap=Fa,t.keyName=Wa,t.isModifierKey=Ua,t.lookupKey=Ba,t.normalizeKeyMap=Ha,t.StringStream=Xt,t.SharedTextMarker=ya,t.TextMarker=ga,t.LineWidget=pa,t.e_preventDefault=xt,t.e_stopPropagation=Ct,t.e_stop=St,t.addClass=D,t.contains=j,t.rmClass=T,t.keyNames=La}il.prototype.init=function(t){var e=this,n=this,o=this.cm;this.createField(t);var r=this.textarea;function i(t){if(!mt(o,t)){if(o.somethingSelected())Us({lineWise:!1,text:o.getSelections()});else{if(!o.options.lineWiseCopyCut)return;var e=qs(o);Us({lineWise:!0,text:e.text}),"cut"==t.type?o.setSelections(e.ranges,null,z):(n.prevInput="",r.value=e.text.join("\n"),N(r))}"cut"==t.type&&(o.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(r.style.width="0px"),ht(r,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),ht(r,"paste",(function(t){mt(o,t)||Ws(t,o)||(o.state.pasteIncoming=+new Date,n.fastPoll())})),ht(r,"cut",i),ht(r,"copy",i),ht(t.scroller,"paste",(function(e){if(!Wn(t,e)&&!mt(o,e)){if(!r.dispatchEvent)return o.state.pasteIncoming=+new Date,void n.focus();var i=new Event("paste");i.clipboardData=e.clipboardData,r.dispatchEvent(i)}})),ht(t.lineSpace,"selectstart",(function(e){Wn(t,e)||xt(e)})),ht(r,"compositionstart",(function(){var t=o.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:o.markText(t,o.getCursor("to"),{className:"CodeMirror-composing"})}})),ht(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},il.prototype.createField=function(t){this.wrapper=Ks(),this.textarea=this.wrapper.firstChild},il.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute('aria-label',t):this.textarea.removeAttribute('aria-label')},il.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,o=$o(t);if(t.options.moveInputWithCursor){var r=_o(t,n.sel.primary().head,"div"),i=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();o.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,r.top+a.top-i.top)),o.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,r.left+a.left-i.left))}return o},il.prototype.showSelection=function(t){var e=this.cm.display;k(e.cursorDiv,t.cursors),k(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},il.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&N(this.textarea),a&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},il.prototype.getField=function(){return this.textarea},il.prototype.supportsTouch=function(){return!1},il.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||M()!=this.textarea))try{this.textarea.focus()}catch(t){}},il.prototype.blur=function(){this.textarea.blur()},il.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},il.prototype.receivedFocus=function(){this.slowPoll()},il.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},il.prototype.fastPoll=function(){var t=!1,e=this;function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}e.pollingFast=!0,e.polling.set(20,n)},il.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,o=this.prevInput;if(this.contextMenuPending||!e.state.focused||Nt(n)&&!o&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=n.value;if(r==o&&!e.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===r||m&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||o||(o=""),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(o.length,r.length);l1e3||r.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=r,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},il.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},il.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},il.prototype.onContextMenu=function(t){var e=this,n=e.cm,o=n.display,r=e.textarea;e.contextMenuPending&&e.contextMenuPending();var i=Io(n,t),c=o.scroller.scrollTop;if(i&&!p){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(i)&&Dr(n,Ui)(n.doc,li(i),z);var u,d=r.style.cssText,f=e.wrapper.style.cssText,h=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-h.top-5)+"px; left: "+(t.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),o.input.focus(),l&&window.scrollTo(null,u),o.input.reset(),n.somethingSelected()||(r.value=e.prevInput=" "),e.contextMenuPending=y,o.selForContextMenu=n.doc.sel,clearTimeout(o.detectingSelectAll),a&&s>=9&&v(),C){St(t);var g=function(){vt(window,"mouseup",g),setTimeout(y,20)};ht(window,"mouseup",g)}else setTimeout(y,50)}function v(){if(null!=r.selectionStart){var t=n.somethingSelected(),i=""+(t?r.value:"");r.value="⇚",r.value=i,e.prevInput=t?"":"",r.selectionStart=1,r.selectionEnd=i.length,o.selForContextMenu=n.doc.sel}}function y(){if(e.contextMenuPending==y&&(e.contextMenuPending=!1,e.wrapper.style.cssText=f,r.style.cssText=d,a&&s<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=c),null!=r.selectionStart)){(!a||a&&s<9)&&v();var t=0,i=function(){o.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&""==e.prevInput?Dr(n,Xi)(n):t++<10?o.detectingSelectAll=setTimeout(i,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(i,200)}}},il.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},il.prototype.setUneditable=function(){},il.prototype.needsContentAttribute=!1,Ls(Vs),Ys(Vs);var ll="iter insert remove copy getEditor constructor".split(" ");for(var cl in Ca.prototype)Ca.prototype.hasOwnProperty(cl)&&H(ll,cl)<0&&(Vs.prototype[cl]=function(t){return function(){return t.apply(this.doc,arguments)}}(Ca.prototype[cl]));return wt(Ca),Vs.inputStyles={textarea:il,contenteditable:Zs},Vs.defineMode=function(t){Vs.defaults.mode||"null"==t||(Vs.defaults.mode=t),Bt.apply(this,arguments)},Vs.defineMIME=Ut,Vs.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Vs.defineMIME("text/plain","null"),Vs.defineExtension=function(t,e){Vs.prototype[t]=e},Vs.defineDocExtension=function(t,e){Ca.prototype[t]=e},Vs.fromTextArea=al,sl(Vs),Vs.version="5.63.0",Vs}())},7389:(t,e,n)=>{1&&function(t){"use strict";function e(t){for(var e={},n=0;n*\/]/.test(n)?x(null,"select-op"):"."==n&&t.match(/^-?[_a-z][_a-z0-9-]*/i)?x("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?x(null,n):t.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(t.current())&&(e.tokenize=S),x("variable callee","variable")):/[\w\\\-]/.test(n)?(t.eatWhile(/[\w\\\-]/),x("property","word")):x(null,null):/[\d.]/.test(t.peek())?(t.eatWhile(/[\w.%]/),x("number","unit")):t.match(/^-[\w\\\-]*/)?(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?x("variable-2","variable-definition"):x("variable-2","variable")):t.match(/^\w+-/)?x("meta","meta"):void 0}function O(t){return function(e,n){for(var o,r=!1;null!=(o=e.next());){if(o==t&&!r){")"==t&&e.backUp(1);break}r=!r&&"\\"==o}return(o==t||!r&&")"!=t)&&(n.tokenize=null),x("string","string")}}function S(t,e){return t.next(),t.match(/^\s*[\"\')]/,!1)?e.tokenize=null:e.tokenize=O(")"),x(null,"(")}function T(t,e,n){this.type=t,this.indent=e,this.prev=n}function P(t,e,n,o){return t.context=new T(n,e.indentation()+(!1===o?0:a),t.context),n}function k(t){return t.context.prev&&(t.context=t.context.prev),t.context.type}function E(t,e,n){return M[n.context.type](t,e,n)}function A(t,e,n,o){for(var r=o||1;r>0;r--)n.context=n.context.prev;return E(t,e,n)}function j(t){var e=t.current().toLowerCase();i=y.hasOwnProperty(e)?"atom":v.hasOwnProperty(e)?"keyword":"variable"}var M={top:function(t,e,n){if("{"==t)return P(n,e,"block");if("}"==t&&n.context.prev)return k(n);if(_&&/@component/i.test(t))return P(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return P(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return P(n,e,"atBlock");if(/^@(font-face|counter-style)/i.test(t))return n.stateArg=t,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(t))return"keyframes";if(t&&"@"==t.charAt(0))return P(n,e,"at");if("hash"==t)i="builtin";else if("word"==t)i="tag";else{if("variable-definition"==t)return"maybeprop";if("interpolation"==t)return P(n,e,"interpolation");if(":"==t)return"pseudo";if(m&&"("==t)return P(n,e,"parens")}return n.context.type},block:function(t,e,n){if("word"==t){var o=e.current().toLowerCase();return d.hasOwnProperty(o)?(i="property","maybeprop"):f.hasOwnProperty(o)?(i=w?"string-2":"property","maybeprop"):m?(i=e.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==t?"block":m||"hash"!=t&&"qualifier"!=t?M.top(t,e,n):(i="error","block")},maybeprop:function(t,e,n){return":"==t?P(n,e,"prop"):E(t,e,n)},prop:function(t,e,n){if(";"==t)return k(n);if("{"==t&&m)return P(n,e,"propBlock");if("}"==t||"{"==t)return A(t,e,n);if("("==t)return P(n,e,"parens");if("hash"!=t||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(e.current())){if("word"==t)j(e);else if("interpolation"==t)return P(n,e,"interpolation")}else i+=" error";return"prop"},propBlock:function(t,e,n){return"}"==t?k(n):"word"==t?(i="property","maybeprop"):n.context.type},parens:function(t,e,n){return"{"==t||"}"==t?A(t,e,n):")"==t?k(n):"("==t?P(n,e,"parens"):"interpolation"==t?P(n,e,"interpolation"):("word"==t&&j(e),"parens")},pseudo:function(t,e,n){return"meta"==t?"pseudo":"word"==t?(i="variable-3",n.context.type):E(t,e,n)},documentTypes:function(t,e,n){return"word"==t&&l.hasOwnProperty(e.current())?(i="tag",n.context.type):M.atBlock(t,e,n)},atBlock:function(t,e,n){if("("==t)return P(n,e,"atBlock_parens");if("}"==t||";"==t)return A(t,e,n);if("{"==t)return k(n)&&P(n,e,m?"block":"top");if("interpolation"==t)return P(n,e,"interpolation");if("word"==t){var o=e.current().toLowerCase();i="only"==o||"not"==o||"and"==o||"or"==o?"keyword":c.hasOwnProperty(o)?"attribute":u.hasOwnProperty(o)?"property":p.hasOwnProperty(o)?"keyword":d.hasOwnProperty(o)?"property":f.hasOwnProperty(o)?w?"string-2":"property":y.hasOwnProperty(o)?"atom":v.hasOwnProperty(o)?"keyword":"error"}return n.context.type},atComponentBlock:function(t,e,n){return"}"==t?A(t,e,n):"{"==t?k(n)&&P(n,e,m?"block":"top",!1):("word"==t&&(i="error"),n.context.type)},atBlock_parens:function(t,e,n){return")"==t?k(n):"{"==t||"}"==t?A(t,e,n,2):M.atBlock(t,e,n)},restricted_atBlock_before:function(t,e,n){return"{"==t?P(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(i="variable","restricted_atBlock_before"):E(t,e,n)},restricted_atBlock:function(t,e,n){return"}"==t?(n.stateArg=null,k(n)):"word"==t?(i="@font-face"==n.stateArg&&!h.hasOwnProperty(e.current().toLowerCase())||"@counter-style"==n.stateArg&&!g.hasOwnProperty(e.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(t,e,n){return"word"==t?(i="variable","keyframes"):"{"==t?P(n,e,"top"):E(t,e,n)},at:function(t,e,n){return";"==t?k(n):"{"==t||"}"==t?A(t,e,n):("word"==t?i="tag":"hash"==t&&(i="builtin"),"at")},interpolation:function(t,e,n){return"}"==t?k(n):"{"==t||";"==t?A(t,e,n):("word"==t?i="variable":"variable"!=t&&"("!=t&&")"!=t&&(i="error"),"interpolation")}};return{startState:function(t){return{tokenize:null,state:o?"block":"top",stateArg:null,context:new T(o?"block":"top",t||0,null)}},token:function(t,e){if(!e.tokenize&&t.eatSpace())return null;var n=(e.tokenize||C)(t,e);return n&&"object"==typeof n&&(r=n[1],n=n[0]),i=n,"comment"!=r&&(e.state=M[e.state](r,t,e)),i},indent:function(t,e){var n=t.context,o=e&&e.charAt(0),r=n.indent;return"prop"!=n.type||"}"!=o&&")"!=o||(n=n.prev),n.prev&&("}"!=o||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=o||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=o||"at"!=n.type&&"atBlock"!=n.type)||(r=Math.max(0,n.indent-a)):r=(n=n.prev).indent),r},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],o=e(n),r=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=e(r),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme"],s=e(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light"],c=e(l),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],p=e(u),d=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],f=e(d),h=e(["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),g=e(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),v=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=e(v),m=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","drop-shadow","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","hue-rotate","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturate","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","sepia","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],b=e(m),_=n.concat(r).concat(a).concat(l).concat(u).concat(d).concat(v).concat(m);function w(t,e){for(var n,o=!1;null!=(n=t.next());){if(o&&"/"==n){e.tokenize=null;break}o="*"==n}return["comment","comment"]}t.registerHelper("hintWords","css",_),t.defineMIME("text/css",{documentTypes:o,mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:g,colorKeywords:y,valueKeywords:b,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=w,w(t,e))}},name:"css"}),t.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,colorKeywords:y,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=w,w(t,e)):["operator","operator"]},":":function(t){return!!t.match(/^\s*\{/,!1)&&[null,null]},$:function(t){return t.match(/^[\w-]+/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(t){return!!t.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),t.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:p,nonStandardPropertyKeywords:f,colorKeywords:y,valueKeywords:b,fontProperties:h,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(t,e){return t.eat("/")?(t.skipToEnd(),["comment","comment"]):t.eat("*")?(e.tokenize=w,w(t,e)):["operator","operator"]},"@":function(t){return t.eat("{")?[null,"interpolation"]:!t.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(t.eatWhile(/[\w\\\-]/),t.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),t.defineMIME("text/x-gss",{documentTypes:o,mediaTypes:i,mediaFeatures:s,propertyKeywords:p,nonStandardPropertyKeywords:f,fontProperties:h,counterDescriptors:g,colorKeywords:y,valueKeywords:b,supportsAtComponent:!0,tokenHooks:{"/":function(t,e){return!!t.eat("*")&&(e.tokenize=w,w(t,e))}},name:"css",helperType:"gss"})}(n(4408))},8253:(t,e,n)=>{1&&function(t){"use strict";var e={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function n(t,e,n){var o=t.current(),r=o.search(e);return r>-1?t.backUp(o.length-r):o.match(/<\/?$/)&&(t.backUp(o.length),t.match(e,!1)||t.match(o)),n}var o={};function r(t){var e=o[t];return e||(o[t]=new RegExp("\\s+"+t+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function i(t,e){var n=t.match(r(e));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function a(t,e){return new RegExp((e?"^":"")+" ","i")}function s(t,e){for(var n in t)for(var o=e[n]||(e[n]=[]),r=t[n],i=r.length-1;i>=0;i--)o.unshift(r[i])}function l(t,e){for(var n=0;n=0;d--)c.script.unshift(["type",p[d].matches,p[d].mode]);function f(e,r){var s,u=i.token(e,r.htmlState),p=/\btag\b/.test(u);if(p&&!/[<>\s\/]/.test(e.current())&&(s=r.htmlState.tagName&&r.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(s))r.inTag=s+" ";else if(r.inTag&&p&&/>$/.test(e.current())){var d=/^([\S]+) (.*)/.exec(r.inTag);r.inTag=null;var h=">"==e.current()&&l(c[d[1]],d[2]),g=t.getMode(o,h),v=a(d[1],!0),y=a(d[1],!1);r.token=function(t,e){return t.match(v,!1)?(e.token=f,e.localState=e.localMode=null,null):n(t,y,e.localMode.token(t,e.localState))},r.localMode=g,r.localState=t.startState(g,i.indent(r.htmlState,"",""))}else r.inTag&&(r.inTag+=e.current(),e.eol()&&(r.inTag+=" "));return u}return{startState:function(){return{token:f,inTag:null,localMode:null,localState:null,htmlState:t.startState(i)}},copyState:function(e){var n;return e.localState&&(n=t.copyState(e.localMode,e.localState)),{token:e.token,inTag:e.inTag,localMode:e.localMode,localState:n,htmlState:t.copyState(i,e.htmlState)}},token:function(t,e){return e.token(t,e)},indent:function(e,n,o){return!e.localMode||/^\s*<\//.test(n)?i.indent(e.htmlState,n,o):e.localMode.indent?e.localMode.indent(e.localState,n,o):t.Pass},innerMode:function(t){return{state:t.localState||t.htmlState,mode:t.localMode||i}}}}),"xml","javascript","css"),t.defineMIME("text/html","htmlmixed")}(n(4408),n(9701),n(6061),n(7389))},6061:(t,e,n)=>{1&&function(t){"use strict";t.defineMode("javascript",(function(e,n){var o,r,i=e.indentUnit,a=n.statementIndent,s=n.jsonld,l=n.json||s,c=!1!==n.trackScope,u=n.typescript,p=n.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function t(t){return{type:t,style:"keyword"}}var e=t("keyword a"),n=t("keyword b"),o=t("keyword c"),r=t("keyword d"),i=t("operator"),a={type:"atom",style:"atom"};return{if:t("if"),while:e,with:e,else:n,do:n,try:n,finally:n,return:r,break:r,continue:r,new:t("new"),delete:o,void:o,throw:o,debugger:t("debugger"),var:t("var"),const:t("var"),let:t("var"),function:t("function"),catch:t("catch"),for:t("for"),switch:t("switch"),case:t("case"),default:t("default"),in:i,typeof:i,instanceof:i,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:t("this"),class:t("class"),super:t("atom"),yield:o,export:t("export"),import:t("import"),extends:o,await:o}}(),f=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(t){for(var e,n=!1,o=!1;null!=(e=t.next());){if(!n){if("/"==e&&!o)return;"["==e?o=!0:o&&"]"==e&&(o=!1)}n=!n&&"\\"==e}}function v(t,e,n){return o=t,r=n,e}function y(t,e){var n=t.next();if('"'==n||"'"==n)return e.tokenize=m(n),e.tokenize(t,e);if("."==n&&t.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return v("number","number");if("."==n&&t.match(".."))return v("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return v(n);if("="==n&&t.eat(">"))return v("=>","operator");if("0"==n&&t.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return v("number","number");if(/\d/.test(n))return t.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),v("number","number");if("/"==n)return t.eat("*")?(e.tokenize=b,b(t,e)):t.eat("/")?(t.skipToEnd(),v("comment","comment")):re(t,e,1)?(g(t),t.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),v("regexp","string-2")):(t.eat("="),v("operator","operator",t.current()));if("`"==n)return e.tokenize=_,_(t,e);if("#"==n&&"!"==t.peek())return t.skipToEnd(),v("meta","meta");if("#"==n&&t.eatWhile(p))return v("variable","property");if("<"==n&&t.match("!--")||"-"==n&&t.match("->")&&!/\S/.test(t.string.slice(0,t.start)))return t.skipToEnd(),v("comment","comment");if(f.test(n))return">"==n&&e.lexical&&">"==e.lexical.type||(t.eat("=")?"!"!=n&&"="!=n||t.eat("="):/[<>*+\-|&?]/.test(n)&&(t.eat(n),">"==n&&t.eat(n))),"?"==n&&t.eat(".")?v("."):v("operator","operator",t.current());if(p.test(n)){t.eatWhile(p);var o=t.current();if("."!=e.lastType){if(d.propertyIsEnumerable(o)){var r=d[o];return v(r.type,r.style,o)}if("async"==o&&t.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return v("async","keyword",o)}return v("variable","variable",o)}}function m(t){return function(e,n){var o,r=!1;if(s&&"@"==e.peek()&&e.match(h))return n.tokenize=y,v("jsonld-keyword","meta");for(;null!=(o=e.next())&&(o!=t||r);)r=!r&&"\\"==o;return r||(n.tokenize=y),v("string","string")}}function b(t,e){for(var n,o=!1;n=t.next();){if("/"==n&&o){e.tokenize=y;break}o="*"==n}return v("comment","comment")}function _(t,e){for(var n,o=!1;null!=(n=t.next());){if(!o&&("`"==n||"$"==n&&t.eat("{"))){e.tokenize=y;break}o=!o&&"\\"==n}return v("quasi","string-2",t.current())}var w="([{}])";function x(t,e){e.fatArrowAt&&(e.fatArrowAt=null);var n=t.string.indexOf("=>",t.start);if(!(n<0)){if(u){var o=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(t.string.slice(t.start,n));o&&(n=o.index)}for(var r=0,i=!1,a=n-1;a>=0;--a){var s=t.string.charAt(a),l=w.indexOf(s);if(l>=0&&l<3){if(!r){++a;break}if(0==--r){"("==s&&(i=!0);break}}else if(l>=3&&l<6)++r;else if(p.test(s))i=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(t.string.charAt(a-1)==s&&"\\"!=t.string.charAt(a-2)){a--;break}}else if(i&&!r){++a;break}}i&&!r&&(e.fatArrowAt=a)}}var C={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function O(t,e,n,o,r,i){this.indented=t,this.column=e,this.type=n,this.prev=r,this.info=i,null!=o&&(this.align=o)}function S(t,e){if(!c)return!1;for(var n=t.localVars;n;n=n.next)if(n.name==e)return!0;for(var o=t.context;o;o=o.prev)for(n=o.vars;n;n=n.next)if(n.name==e)return!0}function T(t,e,n,o,r){var i=t.cc;for(P.state=t,P.stream=r,P.marked=null,P.cc=i,P.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);1;)if((i.length?i.pop():l?$:z)(n,o)){for(;i.length&&i[i.length-1].lex;)i.pop()();return P.marked?P.marked:"variable"==n&&S(t,o)?"variable-2":e}}var P={state:null,column:null,marked:null,cc:null};function k(){for(var t=arguments.length-1;t>=0;t--)P.cc.push(arguments[t])}function E(){return k.apply(null,arguments),!0}function A(t,e){for(var n=e;n;n=n.next)if(n.name==t)return!0;return!1}function j(t){var e=P.state;if(P.marked="def",c){if(e.context)if("var"==e.lexical.info&&e.context&&e.context.block){var o=M(t,e.context);if(null!=o)return void(e.context=o)}else if(!A(t,e.localVars))return void(e.localVars=new N(t,e.localVars));n.globalVars&&!A(t,e.globalVars)&&(e.globalVars=new N(t,e.globalVars))}}function M(t,e){if(e){if(e.block){var n=M(t,e.prev);return n?n==e.prev?e:new L(n,e.vars,!0):null}return A(t,e.vars)?e:new L(e.prev,new N(t,e.vars),!1)}return null}function D(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function L(t,e,n){this.prev=t,this.vars=e,this.block=n}function N(t,e){this.name=t,this.next=e}var I=new N("this",new N("arguments",null));function V(){P.state.context=new L(P.state.context,P.state.localVars,!1),P.state.localVars=I}function F(){P.state.context=new L(P.state.context,P.state.localVars,!0),P.state.localVars=null}function R(){P.state.localVars=P.state.context.vars,P.state.context=P.state.context.prev}function H(t,e){var n=function(){var n=P.state,o=n.indented;if("stat"==n.lexical.type)o=n.lexical.indented;else for(var r=n.lexical;r&&")"==r.type&&r.align;r=r.prev)o=r.indented;n.lexical=new O(o,P.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function B(){var t=P.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function U(t){function e(n){return n==t?E():";"==t||"}"==n||")"==n||"]"==n?k():E(e)}return e}function z(t,e){return"var"==t?E(H("vardef",e),kt,U(";"),B):"keyword a"==t?E(H("form"),G,z,B):"keyword b"==t?E(H("form"),z,B):"keyword d"==t?P.stream.match(/^\s*$/,!1)?E():E(H("stat"),Y,U(";"),B):"debugger"==t?E(U(";")):"{"==t?E(H("}"),F,dt,B,R):";"==t?E():"if"==t?("else"==P.state.lexical.info&&P.state.cc[P.state.cc.length-1]==B&&P.state.cc.pop()(),E(H("form"),G,z,B,Lt)):"function"==t?E(Ft):"for"==t?E(H("form"),F,Nt,z,R,B):"class"==t||u&&"interface"==e?(P.marked="keyword",E(H("form","class"==t?t:e),zt,B)):"variable"==t?u&&"declare"==e?(P.marked="keyword",E(z)):u&&("module"==e||"enum"==e||"type"==e)&&P.stream.match(/^\s*\w/,!1)?(P.marked="keyword","enum"==e?E(ee):"type"==e?E(Ht,U("operator"),yt,U(";")):E(H("form"),Et,U("{"),H("}"),dt,B,B)):u&&"namespace"==e?(P.marked="keyword",E(H("form"),$,z,B)):u&&"abstract"==e?(P.marked="keyword",E(z)):E(H("stat"),it):"switch"==t?E(H("form"),G,U("{"),H("}","switch"),F,dt,B,B,R):"case"==t?E($,U(":")):"default"==t?E(U(":")):"catch"==t?E(H("form"),V,W,z,B,R):"export"==t?E(H("stat"),Gt,B):"import"==t?E(H("stat"),Yt,B):"async"==t?E(z):"@"==e?E($,z):k(H("stat"),$,U(";"),B)}function W(t){if("("==t)return E(Bt,U(")"))}function $(t,e){return K(t,e,!1)}function q(t,e){return K(t,e,!0)}function G(t){return"("!=t?k():E(H(")"),Y,U(")"),B)}function K(t,e,n){if(P.state.fatArrowAt==P.stream.start){var o=n?et:tt;if("("==t)return E(V,H(")"),ut(Bt,")"),B,U("=>"),o,R);if("variable"==t)return k(V,Et,U("=>"),o,R)}var r=n?J:X;return C.hasOwnProperty(t)?E(r):"function"==t?E(Ft,r):"class"==t||u&&"interface"==e?(P.marked="keyword",E(H("form"),Ut,B)):"keyword c"==t||"async"==t?E(n?q:$):"("==t?E(H(")"),Y,U(")"),B,r):"operator"==t||"spread"==t?E(n?q:$):"["==t?E(H("]"),te,B,r):"{"==t?pt(st,"}",null,r):"quasi"==t?k(Z,r):"new"==t?E(nt(n)):E()}function Y(t){return t.match(/[;\}\)\],]/)?k():k($)}function X(t,e){return","==t?E(Y):J(t,e,!1)}function J(t,e,n){var o=0==n?X:J,r=0==n?$:q;return"=>"==t?E(V,n?et:tt,R):"operator"==t?/\+\+|--/.test(e)||u&&"!"==e?E(o):u&&"<"==e&&P.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?E(H(">"),ut(yt,">"),B,o):"?"==e?E($,U(":"),r):E(r):"quasi"==t?k(Z,o):";"!=t?"("==t?pt(q,")","call",o):"."==t?E(at,o):"["==t?E(H("]"),Y,U("]"),B,o):u&&"as"==e?(P.marked="keyword",E(yt,o)):"regexp"==t?(P.state.lastType=P.marked="operator",P.stream.backUp(P.stream.pos-P.stream.start-1),E(r)):void 0:void 0}function Z(t,e){return"quasi"!=t?k():"${"!=e.slice(e.length-2)?E(Z):E(Y,Q)}function Q(t){if("}"==t)return P.marked="string-2",P.state.tokenize=_,E(Z)}function tt(t){return x(P.stream,P.state),k("{"==t?z:$)}function et(t){return x(P.stream,P.state),k("{"==t?z:q)}function nt(t){return function(e){return"."==e?E(t?rt:ot):"variable"==e&&u?E(St,t?J:X):k(t?q:$)}}function ot(t,e){if("target"==e)return P.marked="keyword",E(X)}function rt(t,e){if("target"==e)return P.marked="keyword",E(J)}function it(t){return":"==t?E(B,z):k(X,U(";"),B)}function at(t){if("variable"==t)return P.marked="property",E()}function st(t,e){return"async"==t?(P.marked="property",E(st)):"variable"==t||"keyword"==P.style?(P.marked="property","get"==e||"set"==e?E(lt):(u&&P.state.fatArrowAt==P.stream.start&&(n=P.stream.match(/^\s*:\s*/,!1))&&(P.state.fatArrowAt=P.stream.pos+n[0].length),E(ct))):"number"==t||"string"==t?(P.marked=s?"property":P.style+" property",E(ct)):"jsonld-keyword"==t?E(ct):u&&D(e)?(P.marked="keyword",E(st)):"["==t?E($,ft,U("]"),ct):"spread"==t?E(q,ct):"*"==e?(P.marked="keyword",E(st)):":"==t?k(ct):void 0;var n}function lt(t){return"variable"!=t?k(ct):(P.marked="property",E(Ft))}function ct(t){return":"==t?E(q):"("==t?k(Ft):void 0}function ut(t,e,n){function o(r,i){if(n?n.indexOf(r)>-1:","==r){var a=P.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),E((function(n,o){return n==e||o==e?k():k(t)}),o)}return r==e||i==e?E():n&&n.indexOf(";")>-1?k(t):E(U(e))}return function(n,r){return n==e||r==e?E():k(t,o)}}function pt(t,e,n){for(var o=3;o"),yt):"quasi"==t?k(wt,Ot):void 0}function mt(t){if("=>"==t)return E(yt)}function bt(t){return t.match(/[\}\)\]]/)?E():","==t||";"==t?E(bt):k(_t,bt)}function _t(t,e){return"variable"==t||"keyword"==P.style?(P.marked="property",E(_t)):"?"==e||"number"==t||"string"==t?E(_t):":"==t?E(yt):"["==t?E(U("variable"),ht,U("]"),_t):"("==t?k(Rt,_t):t.match(/[;\}\)\],]/)?void 0:E()}function wt(t,e){return"quasi"!=t?k():"${"!=e.slice(e.length-2)?E(wt):E(yt,xt)}function xt(t){if("}"==t)return P.marked="string-2",P.state.tokenize=_,E(wt)}function Ct(t,e){return"variable"==t&&P.stream.match(/^\s*[?:]/,!1)||"?"==e?E(Ct):":"==t?E(yt):"spread"==t?E(Ct):k(yt)}function Ot(t,e){return"<"==e?E(H(">"),ut(yt,">"),B,Ot):"|"==e||"."==t||"&"==e?E(yt):"["==t?E(yt,U("]"),Ot):"extends"==e||"implements"==e?(P.marked="keyword",E(yt)):"?"==e?E(yt,U(":"),yt):void 0}function St(t,e){if("<"==e)return E(H(">"),ut(yt,">"),B,Ot)}function Tt(){return k(yt,Pt)}function Pt(t,e){if("="==e)return E(yt)}function kt(t,e){return"enum"==e?(P.marked="keyword",E(ee)):k(Et,ft,Mt,Dt)}function Et(t,e){return u&&D(e)?(P.marked="keyword",E(Et)):"variable"==t?(j(e),E()):"spread"==t?E(Et):"["==t?pt(jt,"]"):"{"==t?pt(At,"}"):void 0}function At(t,e){return"variable"!=t||P.stream.match(/^\s*:/,!1)?("variable"==t&&(P.marked="property"),"spread"==t?E(Et):"}"==t?k():"["==t?E($,U(']'),U(':'),At):E(U(":"),Et,Mt)):(j(e),E(Mt))}function jt(){return k(Et,Mt)}function Mt(t,e){if("="==e)return E(q)}function Dt(t){if(","==t)return E(kt)}function Lt(t,e){if("keyword b"==t&&"else"==e)return E(H("form","else"),z,B)}function Nt(t,e){return"await"==e?E(Nt):"("==t?E(H(")"),It,B):void 0}function It(t){return"var"==t?E(kt,Vt):"variable"==t?E(Vt):k(Vt)}function Vt(t,e){return")"==t?E():";"==t?E(Vt):"in"==e||"of"==e?(P.marked="keyword",E($,Vt)):k($,Vt)}function Ft(t,e){return"*"==e?(P.marked="keyword",E(Ft)):"variable"==t?(j(e),E(Ft)):"("==t?E(V,H(")"),ut(Bt,")"),B,gt,z,R):u&&"<"==e?E(H(">"),ut(Tt,">"),B,Ft):void 0}function Rt(t,e){return"*"==e?(P.marked="keyword",E(Rt)):"variable"==t?(j(e),E(Rt)):"("==t?E(V,H(")"),ut(Bt,")"),B,gt,R):u&&"<"==e?E(H(">"),ut(Tt,">"),B,Rt):void 0}function Ht(t,e){return"keyword"==t||"variable"==t?(P.marked="type",E(Ht)):"<"==e?E(H(">"),ut(Tt,">"),B):void 0}function Bt(t,e){return"@"==e&&E($,Bt),"spread"==t?E(Bt):u&&D(e)?(P.marked="keyword",E(Bt)):u&&"this"==t?E(ft,Mt):k(Et,ft,Mt)}function Ut(t,e){return"variable"==t?zt(t,e):Wt(t,e)}function zt(t,e){if("variable"==t)return j(e),E(Wt)}function Wt(t,e){return"<"==e?E(H(">"),ut(Tt,">"),B,Wt):"extends"==e||"implements"==e||u&&","==t?("implements"==e&&(P.marked="keyword"),E(u?yt:$,Wt)):"{"==t?E(H("}"),$t,B):void 0}function $t(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||u&&D(e))&&P.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(P.marked="keyword",E($t)):"variable"==t||"keyword"==P.style?(P.marked="property",E(qt,$t)):"number"==t||"string"==t?E(qt,$t):"["==t?E($,ft,U("]"),qt,$t):"*"==e?(P.marked="keyword",E($t)):u&&"("==t?k(Rt,$t):";"==t||","==t?E($t):"}"==t?E():"@"==e?E($,$t):void 0}function qt(t,e){if("!"==e)return E(qt);if("?"==e)return E(qt);if(":"==t)return E(yt,Mt);if("="==e)return E(q);var n=P.state.lexical.prev;return k(n&&"interface"==n.info?Rt:Ft)}function Gt(t,e){return"*"==e?(P.marked="keyword",E(Qt,U(";"))):"default"==e?(P.marked="keyword",E($,U(";"))):"{"==t?E(ut(Kt,"}"),Qt,U(";")):k(z)}function Kt(t,e){return"as"==e?(P.marked="keyword",E(U("variable"))):"variable"==t?k(q,Kt):void 0}function Yt(t){return"string"==t?E():"("==t?k($):"."==t?k(X):k(Xt,Jt,Qt)}function Xt(t,e){return"{"==t?pt(Xt,"}"):("variable"==t&&j(e),"*"==e&&(P.marked="keyword"),E(Zt))}function Jt(t){if(","==t)return E(Xt,Jt)}function Zt(t,e){if("as"==e)return P.marked="keyword",E(Xt)}function Qt(t,e){if("from"==e)return P.marked="keyword",E($)}function te(t){return"]"==t?E():k(ut(q,"]"))}function ee(){return k(H("form"),Et,U("{"),H("}"),ut(ne,"}"),B,B)}function ne(){return k(Et,Mt)}function oe(t,e){return"operator"==t.lastType||","==t.lastType||f.test(e.charAt(0))||/[,.]/.test(e.charAt(0))}function re(t,e,n){return e.tokenize==y&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(e.lastType)||"quasi"==e.lastType&&/\{\s*$/.test(t.string.slice(0,t.pos-(n||0)))}return R.lex=!0,B.lex=!0,{startState:function(t){var e={tokenize:y,lastType:"sof",cc:[],lexical:new O((t||0)-i,0,"block",!1),localVars:n.localVars,context:n.localVars&&new L(null,null,!1),indented:t||0};return n.globalVars&&"object"==typeof n.globalVars&&(e.globalVars=n.globalVars),e},token:function(t,e){if(t.sol()&&(e.lexical.hasOwnProperty("align")||(e.lexical.align=!1),e.indented=t.indentation(),x(t,e)),e.tokenize!=b&&t.eatSpace())return null;var n=e.tokenize(t,e);return"comment"==o?n:(e.lastType="operator"!=o||"++"!=r&&"--"!=r?o:"incdec",T(e,n,o,r,t))},indent:function(e,o){if(e.tokenize==b||e.tokenize==_)return t.Pass;if(e.tokenize!=y)return 0;var r,s=o&&o.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(o))for(var c=e.cc.length-1;c>=0;--c){var u=e.cc[c];if(u==B)l=l.prev;else if(u!=Lt&&u!=R)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(r=e.cc[e.cc.length-1])&&(r==X||r==J)&&!/^[,\.=+\-*:?[\(]/.test(o));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var p=l.type,d=s==p;return"vardef"==p?l.indented+("operator"==e.lastType||","==e.lastType?l.info.length+1:0):"form"==p&&"{"==s?l.indented:"form"==p?l.indented+i:"stat"==p?l.indented+(oe(e,o)?a||i:0):"switch"!=l.info||d||0==n.doubleIndentSwitch?l.align?l.column+(d?0:1):l.indented+(d?0:i):l.indented+(/^(?:case|default)\b/.test(o)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:re,skipExpression:function(e){T(e,"atom","atom","true",new t.StringStream("",2,null))}}})),t.registerHelper("wordChars","javascript",/[\w$]/),t.defineMIME("text/javascript","javascript"),t.defineMIME("text/ecmascript","javascript"),t.defineMIME("application/javascript","javascript"),t.defineMIME("application/x-javascript","javascript"),t.defineMIME("application/ecmascript","javascript"),t.defineMIME("application/json",{name:"javascript",json:!0}),t.defineMIME("application/x-json",{name:"javascript",json:!0}),t.defineMIME("application/manifest+json",{name:"javascript",json:!0}),t.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),t.defineMIME("text/typescript",{name:"javascript",typescript:!0}),t.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(4408))},9701:(t,e,n)=>{1&&function(t){"use strict";var e={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};t.defineMode("xml",(function(o,r){var i,a,s=o.indentUnit,l={},c=r.htmlMode?e:n;for(var u in c)l[u]=c[u];for(var u in r)l[u]=r[u];function p(t,e){function n(n){return e.tokenize=n,n(t,e)}var o=t.next();return"<"==o?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(h("atom","]]>")):null:t.match("--")?n(h("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(g(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=h("meta","?>"),"meta"):(i=t.eat("/")?"closeTag":"openTag",e.tokenize=d,"tag bracket"):"&"==o?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function d(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">"))return e.tokenize=p,i=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return i="equals",null;if("<"==n){e.tokenize=p,e.state=_,e.tagName=e.tagStart=null;var o=e.tokenize(t,e);return o?o+" tag error":"tag error"}return/[\'\"]/.test(n)?(e.tokenize=f(n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=d;break}return"string"};return e.isInAttribute=!0,e}function h(t,e){return function(n,o){for(;!n.eol();){if(n.match(e)){o.tokenize=p;break}n.next()}return t}}function g(t){return function(e,n){for(var o;null!=(o=e.next());){if("<"==o)return n.tokenize=g(t+1),n.tokenize(e,n);if(">"==o){if(1==t){n.tokenize=p;break}return n.tokenize=g(t-1),n.tokenize(e,n)}}return"meta"}}function v(t){return t&&t.toLowerCase()}function y(t,e,n){this.prev=t.context,this.tagName=e||"",this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function m(t){t.context&&(t.context=t.context.prev)}function b(t,e){for(var n;1;){if(!t.context)return;if(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(v(n))||!l.contextGrabbers[v(n)].hasOwnProperty(v(e)))return;m(t)}}function _(t,e,n){return"openTag"==t?(n.tagStart=e.column(),w):"closeTag"==t?x:_}function w(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",S):l.allowMissingTagName&&"endTag"==t?(a="tag bracket",S(t,e,n)):(a="error",w)}function x(t,e,n){if("word"==t){var o=e.current();return n.context&&n.context.tagName!=o&&l.implicitlyClosed.hasOwnProperty(v(n.context.tagName))&&m(n),n.context&&n.context.tagName==o||!1===l.matchClosing?(a="tag",C):(a="tag error",O)}return l.allowMissingTagName&&"endTag"==t?(a="tag bracket",C(t,e,n)):(a="error",O)}function C(t,e,n){return"endTag"!=t?(a="error",C):(m(n),_)}function O(t,e,n){return a="error",C(t,e,n)}function S(t,e,n){if("word"==t)return a="attribute",T;if("endTag"==t||"selfcloseTag"==t){var o=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(v(o))?b(n,o):(b(n,o),n.context=new y(n,o,r==n.indented)),_}return a="error",S}function T(t,e,n){return"equals"==t?P:(l.allowMissing||(a="error"),S(t,e,n))}function P(t,e,n){return"string"==t?k:"word"==t&&l.allowUnquoted?(a="string",S):(a="error",S(t,e,n))}function k(t,e,n){return"string"==t?k:S(t,e,n)}return p.isInText=!0,{startState:function(t){var e={tokenize:p,state:_,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;i=null;var n=e.tokenize(t,e);return(n||i)&&"comment"!=n&&(a=null,e.state=e.state(i||n,t,e),a&&(n="error"==a?n+" error":a)),n},indent:function(e,n,o){var r=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+s;if(r&&r.noIndent)return t.Pass;if(e.tokenize!=d&&e.tokenize!=p)return o?o.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==P&&(t.state=S)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],n=t.context;n;n=n.prev)e.push(n.tagName);return e.reverse()}}})),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(4408))},3023:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var o,r=n(1749),i=void 0&&(void 0).__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const a=function(t){function e(e,n,o){var r=t.call(this,n,o)||this;return r._module=e,r}return i(e,t),Object.defineProperty(e.prototype,"module",{get:function(){return this._module},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this._module.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this._module.em},enumerable:!1,configurable:!0}),e}(r.Kx)},2820:(t,e,n)=>{"use strict";n.d(e,{A:()=>s,F:()=>r});var o,r,i=n(3023),a=void 0&&(void 0).__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});!function(t){t["Select"]="select",t["Hover"]="hover",t["Spacing"]="spacing",t["Target"]="target",t["Resize"]="resize"}(r||(r={}));const s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.defaults=function(){return{id:'',type:''}},Object.defineProperty(e.prototype,"type",{get:function(){return this.get('type')||''},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"component",{get:function(){var t;return this.get('component')||(null===(t=this.get('componentView'))||void 0===t?void 0:t.model)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"componentView",{get:function(){var t;return this.get('componentView')||(null===(t=this.get('component'))||void 0===t?void 0:t.getView())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"el",{get:function(){var t;return null===(t=this.componentView)||void 0===t?void 0:t.el},enumerable:!1,configurable:!0}),e.prototype.getBoxRect=function(t){var e=this.el,n=this.em.Canvas.getCanvasView(),o=this.get('boxRect');return o||(e&&n?n.getElBoxRect(e,t):{x:0,y:0,width:0,height:0})},e.prototype.getStyle=function(t){void 0===t&&(t={});var e=t.boxRect||this.getBoxRect(t),n=e.width,o=e.height,r=e.x,i=e.y;return{width:"".concat(n,"px"),height:"".concat(o,"px"),top:'0',left:'0',position:'absolute',translate:"".concat(r,"px ").concat(i,"px")}},e.prototype.isType=function(t){return this.type===t},e}(i.A)},8351:(t,e,n)=>{"use strict";var o;n.d(e,{A:()=>r}),function(t){t["run"]="command:run",t["_run"]="run",t["runCommand"]="command:run:",t["_runCommand"]="run:",t["runBeforeCommand"]="command:run:before:",t["abort"]="command:abort:",t["_abort"]="abort:",t["stop"]="command:stop",t["_stop"]="stop",t["stopCommand"]="command:stop:",t["_stopCommand"]="stop:",t["stopBeforeCommand"]="command:stop:before:"}(o||(o={}));const r=o},371:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});const o={run:function(t){t.Components.clear(),t.Css.clear()}}},6301:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var o=n(5706),r=n(5633),i=n(2097);const a={run:function(t){(0,o.bindAll)(this,'onKeyUp','enableDragger','disableDragger'),this.editor=t,this.canvasModel=this.canvas.getCanvasView().model,this.toggleMove(1)},stop:function(t){this.toggleMove(),this.disableDragger()},onKeyUp:function(t){' '===(0,i.Ch)(t)&&this.editor.stopCommand(this.id)},enableDragger:function(t){this.toggleDragger(1,t)},disableDragger:function(t){this.toggleDragger(0,t)},toggleDragger:function(t,e){var n=this.canvasModel,o=this.em,i=this.dragger,a=t?'add':'remove';this.getCanvas().classList[a]("".concat(this.ppfx,"is__grabbing")),i||(i=new r.A({getPosition:function(){return{x:n.get('x'),y:n.get('y')}},setPosition:function(t){var e=t.x,o=t.y;n.set({x:e,y:o})},onStart:function(t,e){o.trigger('canvas:move:start',e)},onDrag:function(t,e){o.trigger('canvas:move',e)},onEnd:function(t,e){o.trigger('canvas:move:end',e)}}),this.dragger=i),t?i.start(e):i.stop()},toggleMove:function(t){var e=this.ppfx,n=t?'add':'remove',o=t?'on':'off',r={on:i.on,off:i.AU},a=this.getCanvas(),s=["".concat(e,"is__grab")];!t&&s.push("".concat(e,"is__grabbing")),s.forEach((function(t){return a.classList[n](t)})),r[o](document,'keyup',this.onKeyUp),r[o](a,'mousedown',this.enableDragger),r[o](document,'mouseup',this.disableDragger)}}},5301:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>l,defineCommand:()=>s});var o,r=n(1749),i=n(8351),a=void 0&&(void 0).__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});function s(t){return t}const l=function(t){function e(e){var n=t.call(this,0)||this;n.config=e||{},n.em=n.config.em||{};var o=n.config.stylePrefix;return n.pfx=o,n.ppfx=n.config.pStylePrefix,n.hoverClass="".concat(o,"hover"),n.badgeClass="".concat(o,"badge"),n.plhClass="".concat(o,"placeholder"),n.freezClass="".concat(n.ppfx,"freezed"),n.canvas=n.em.Canvas,n.init(n.config),n}return a(e,t),e.prototype.onFrameScroll=function(t){},e.prototype.getCanvas=function(){return this.canvas.getElement()},e.prototype.getCanvasBody=function(){return this.canvas.getBody()},e.prototype.getCanvasTools=function(){return this.canvas.getToolsEl()},e.prototype.offset=function(t){var e=t.getBoundingClientRect();return{top:e.top+t.ownerDocument.body.scrollTop,left:e.left+t.ownerDocument.body.scrollLeft}},e.prototype.init=function(t){},e.prototype.callRun=function(t,e){void 0===e&&(e={});var n=this.id;if(t.trigger("".concat(i.A.runBeforeCommand).concat(n),{options:e}),t.trigger("".concat(i.A._runCommand).concat(n,":before"),e),e.abort)return t.trigger("".concat(i.A.abort).concat(n),{options:e}),void t.trigger("".concat(i.A._abort).concat(n),e);var o=e.sender||t,r=this.run(t,o,e),a={id:n,result:r,options:e};return t.trigger("".concat(i.A.runCommand).concat(n),a),t.trigger(i.A.run,a),t.trigger("".concat(i.A._runCommand).concat(n),r,e),t.trigger(i.A._run,n,r,e),r},e.prototype.callStop=function(t,e){void 0===e&&(e={});var n=this.id,o=e.sender||t;t.trigger("".concat(i.A.stopBeforeCommand).concat(n),{options:e}),t.trigger("".concat(i.A._stopCommand).concat(n,":before"),e);var r=this.stop(t,o,e),a={id:n,result:r,options:e};return t.trigger("".concat(i.A.stopCommand).concat(n),a),t.trigger(i.A.stop,a),t.trigger("".concat(i.A._stopCommand).concat(n),r,e),t.trigger(i.A._stop,n,r,e),r},e.prototype.stopCommand=function(t){this.em.Commands.stop(this.id,t)},e.prototype.run=function(t,e,n){},e.prototype.stop=function(t,e,n){},e}(r.Kx)},8542:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var o=n(5706),r=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r{"use strict";n.r(e),n.d(e,{default:()=>s});var o=n(5706),r=n(5633),i=void 0&&(void 0).__assign||function(){return i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
\n ");(e=document.createElement('div')).className="".concat(s,"guides"),l.className="".concat(s,"guide-info ").concat(s,"guide-info__x"),c.className="".concat(s,"guide-info ").concat(s,"guide-info__y"),l.innerHTML=u,c.innerHTML=u,e.appendChild(l),e.appendChild(c),r.Canvas.getGlobalToolsEl().appendChild(e),this.guidesEl=e,this.elGuideInfoX=l,this.elGuideInfoY=c,this.elGuideInfoContentX=l.querySelector(".".concat(s,"guide-info__content")),this.elGuideInfoContentY=c.querySelector(".".concat(s,"guide-info__content")),i.on('canvas:update frame:scroll',(0,o.debounce)((function(){var e;t.updateGuides(),a.debug&&(null===(e=t.guides)||void 0===e||e.forEach((function(e){return t.renderGuide(e)})))}),200))}return e},getGuidesStatic:function(){var t=this,e=[],n=this.target.getEl(),r=n.parentNode,i=void 0===r?{}:r;return(0,o.each)(i.children,(function(o){return e=e.concat(n!==o?t.getElementGuides(o):[])})),e.concat(this.getElementGuides(i))},getGuidesTarget:function(){return this.getElementGuides(this.target.getEl())},updateGuides:function(t){var e,n,r=this;(t||this.guides).forEach((function(t){var i=t.origin,a=e===i?n:r.getElementPos(i);e=i,n=a,(0,o.each)(r.getGuidePosUpdate(t,a),(function(e,n){return t[n]=e})),t.originRect=a}))},getGuidePosUpdate:function(t,e){var n={},o=e.top,r=e.height,i=e.left,a=e.width;switch(t.type){case't':n.y=o;break;case'b':n.y=o+r;break;case'l':n.x=i;break;case'r':n.x=i+a;break;case'x':n.x=i+a/2;break;case'y':n.y=o+r/2}return n},renderGuide:function(t){void 0===t&&(t={});var e=t.guide||document.createElement('div'),n='px',o=t.active?2:1,r=e.children[0];return e.style="position: absolute; background-color: ".concat(t.active?'green':'red',";"),e.children.length||((r=document.createElement('div')).style='position: absolute; color: red; padding: 5px; top: 0; left: 0;',e.appendChild(r)),t.y?(e.style.width='100%',e.style.height="".concat(o).concat(n),e.style.top="".concat(t.y).concat(n),e.style.left=0):(e.style.width="".concat(o).concat(n),e.style.height='100%',e.style.left="".concat(t.x).concat(n),e.style.top="0".concat(n)),!t.guide&&this.guidesContainer.appendChild(e),e},getElementPos:function(t){return this.editor.Canvas.getElementPos(t,{noScroll:1})},getElementGuides:function(t){var e=this,n=this.opts,o=this.getElementPos(t),r=o.top,a=o.height,s=o.left,l=o.width,c=[{type:'t',y:r},{type:'b',y:r+a},{type:'l',x:s},{type:'r',x:s+l},{type:'x',x:s+l/2},{type:'y',y:r+a/2}].map((function(r){return i(i({},r),{origin:t,originRect:o,guide:n.debug&&e.renderGuide(r)})}));return c.forEach((function(t){var n;return null===(n=e.guides)||void 0===n?void 0:n.push(t)})),c},getTranslate:function(t,e){void 0===e&&(e='x');var n=0;return(t||'').split(' ').forEach((function(t){var o=t.trim(),r="translate".concat(e.toUpperCase(),"(");0===o.indexOf(r)&&(n=parseFloat(o.replace(r,'')))})),n},setTranslate:function(t,e,n){var o="translate".concat(e.toUpperCase(),"("),r="".concat(o).concat(n,")"),i=(t||'').split(' ').map((function(t){return 0===t.trim().indexOf(o)&&(t=r),t})).join(' ');return i.indexOf(o)<0&&(i+=" ".concat(r)),i},getPosition:function(){var t=this.target,e=this.isTran,n=t.getStyle(),o=n.left,r=n.top,i=n.transform,a=0,s=0;return e?(a=this.getTranslate(i),s=this.getTranslate(i,'y')):(a=parseFloat(o||0),s=parseFloat(r||0)),{x:a,y:s}},setPosition:function(t){var e=t.x,n=t.y,r=t.end,i=t.position,a=t.width,s=t.height,l=this,c=l.target,u=l.isTran,p=l.em,d='px',f=!r,h="".concat(parseInt(e,10)).concat(d),g="".concat(parseInt(n,10)).concat(d),v={};if(u){var y=c.getStyle()['transform']||'';y=this.setTranslate(y,'x',h),v={transform:y=this.setTranslate(y,'y',g),__p:f},c.addStyle(v,{avoidStore:!r})}else{var m={position:i,width:a,height:s},b={left:h,top:g,__p:f};(0,o.keys)(m).forEach((function(t){var e=m[t];e&&(b[t]=e)})),v=b,c.addStyle(v,{avoidStore:!r})}null==p||p.Styles.__emitCmpStyleUpdate(v,{components:p.getSelected()})},_getDragData:function(){var t=this.target;return{target:t,parent:t.parent(),index:t.index()}},onStart:function(t){var e=this,n=e.target,o=e.editor,r=e.isTran,i=e.opts,a=i.center,s=i.onStart,l=o.Canvas,c=n.getStyle(),u='absolute',p=[u,'relative'];if(s&&s(this._getDragData()),!r&&c.position!==u){var d=l.offset(n.getEl()),f=d.left,h=d.top,g=d.width,v=d.height,y=n.parent(),m=void 0;do{var b=y.getStyle();m=p.indexOf(b.position)>=0?y:null,y=y.parent()}while(y&&!m);if(a){var _=l.getMouseRelativeCanvas(t);f=_.x,h=_.y}else if(m){var w=l.offset(m.getEl());f-=w.left,h-=w.top}this.setPosition({x:f,y:h,width:"".concat(g,"px"),height:"".concat(v,"px"),position:u})}},onDrag:function(){for(var t=this,e=[],n=0;n0})).sort((function(t,e){return t.gap-e.gap})).map((function(t){return t.guide}))[0];if(m){var b=m.originRect,_=b.left,w=b.width,x=b.top,C=b.height,O=b.rect,S=u?_{"use strict";n.r(e),n.d(e,{default:()=>o});const o={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.components(),o=n&&n.filter((function(t){return t.get('selectable')}))[0];o&&e.push(o)})),e.length&&t.select(e)}}}},3709:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});const o={run:function(t,e,n){if(void 0===n&&(n={}),t.Canvas.hasFocus()||n.force){var o=[];t.getSelectedAll().forEach((function(t){for(var e=t.parent();e&&!e.get('selectable');)e=e.parent();e&&o.push(e)})),o.length&&t.select(o)}}}},2860:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});const o={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var o,r=n.components().length,i=0,a=0;do{i++,o=(a=t.index()+i)<=r?n.getChildAt(a):null}while(o&&!o.get('selectable'));e.push(o||t)}})),e.length&&t.select(e)}}}},4944:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});const o={run:function(t){if(t.Canvas.hasFocus()){var e=[];t.getSelectedAll().forEach((function(t){var n=t.parent();if(n){var o,r=0,i=0;do{r++,o=(i=t.index()-r)>=0?n.getChildAt(i):null}while(o&&!o.get('selectable'));e.push(o||t)}})),e.length&&t.select(e)}}}},767:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(5706);const r={run:function(t,e,n){void 0===n&&(n={});var r=n.target,i=[];if(!r.get('styles'))return i;var a=r.get('type'),s=t.Pages.getAllWrappers();if(!(0,o.flatten)(s.map((function(t){return t.findType(a)}))).length){var l=t.CssComposer.getAll();i=l.filter((function(t){return t.get('group')==="cmp:".concat(a)})),l.remove(i)}return i}}},2126:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(2097);const r={run:function(t,e,n){var r=this;void 0===n&&(n={}),e&&e.set&&e.set('active',0);var i=t.getConfig(),a=t.Modal,s=i.stylePrefix;if(this.cm=t.CodeManager||null,!this.editors){var l=this.buildEditor('htmlmixed','hopscotch','HTML'),c=this.buildEditor('css','hopscotch','CSS');this.htmlEditor=l.model,this.cssEditor=c.model;var u=(0,o.a_)('div',{class:"".concat(s,"export-dl")});u.appendChild(l.el),u.appendChild(c.el),this.editors=u}a.open({title:i.textViewCode,content:this.editors}).getModel().once('change:open',(function(){return t.stopCommand("".concat(r.id))})),this.htmlEditor.setContent(t.getHtml(n.optsHtml)),this.cssEditor.setContent(t.getCss(n.optsCss))},stop:function(t){var e=t.Modal;e&&e.close()},buildEditor:function(t,e,n){var o=this.em.CodeManager,r=o.createViewer({label:n,codeName:t,theme:e});return{model:r,el:new o.EditorView({model:r,config:o.getConfig()}).render().el}}}},1085:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(5706);const r={isEnabled:function(){var t=document;return!!(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement)},enable:function(t){var e='';return t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen?(e='webkit',t.webkitRequestFullscreen()):t.mozRequestFullScreen?(e='moz',t.mozRequestFullScreen()):t.msRequestFullscreen&&t.msRequestFullscreen(),e},disable:function(){var t=document;this.isEnabled()&&(t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen())},fsChanged:function(t){this.isEnabled()||(this.stopCommand({sender:this.sender}),document.removeEventListener("".concat(t||'',"fullscreenchange"),this.fsChanged))},run:function(t,e,n){void 0===n&&(n={}),this.sender=e;var r=n.target,i=(0,o.isElement)(r)?r:document.querySelector(r),a=this.enable(i||t.getContainer());this.fsChanged=this.fsChanged.bind(this,a),document.addEventListener(a+'fullscreenchange',this.fsChanged)},stop:function(t,e){e&&e.set&&e.set('active',!1),this.disable()}}},9622:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>l});var o=n(5706),r=n(6411),i=n(2097),a=n(4596),s=n(2983);const l=(0,o.extend)({},s["default"],a["default"],{init:function(t){a["default"].init.apply(this,arguments),(0,o.bindAll)(this,'initSorter','rollback','onEndMove'),this.opt=t,this.hoverClass=this.ppfx+'highlighter-warning',this.badgeClass=this.ppfx+'badge-warning',this.noSelClass=this.ppfx+'no-select'},enable:function(){for(var t=[],e=0;e{"use strict";n.r(e),n.d(e,{default:()=>i});var o=n(5706),r=n(2097);const i={open:function(t){var e=this,n=this,r=n.editor,i=n.title,a=n.config,s=n.am,l=a.custom;if((0,o.isFunction)(l.open))return l.open(s.__customData());r.Modal.open({title:i,content:t}).onceClose((function(){return r.stopCommand(e.id)}))},close:function(){var t=this.config.custom;if((0,o.isFunction)(t.close))return t.close(this.am.__customData());var e=this.editor.Modal;e&&e.close()},run:function(t,e,n){void 0===n&&(n={});var o=t.AssetManager,i=o.getConfig(),a=n.types,s=void 0===a?[]:a,l=n.accept,c=n.select;if(this.title=n.modalTitle||t.t('assetManager.modalTitle')||'',this.editor=t,this.config=i,this.am=o,o.setTarget(n.target),o.onClick(n.onClick),o.onDblClick(n.onDblClick),o.onSelect(n.onSelect),o.__behaviour({select:c,types:s,options:n}),i.custom)this.rendered=this.rendered||(0,r.a_)('div'),this.rendered.className="".concat(i.stylePrefix,"custom-wrp"),o.__behaviour({container:this.rendered}),o.__trgCustom();else{if(!this.rendered||s){var u=o.getAll().filter((function(t){return t}));s&&s.length&&(u=u.filter((function(t){return-1!==s.indexOf(t.get('type'))}))),o.render(u),this.rendered=o.getContainer()}if(l){var p=this.rendered.querySelector("input#".concat(i.stylePrefix,"uploadFile"));p&&p.setAttribute('accept',l)}}return this.open(this.rendered),this},stop:function(t){this.editor=t,this.close(this.rendered)}}},3666:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var o=n(5706),r=n(2097);const i={open:function(){var t=this,e=t.container,n=t.editor,r=t.bm,i=t.config,a=i.custom,s=i.appendTo;if((0,o.isFunction)(a.open))return a.open(r.__customData());if(this.firstRender&&!s){var l='views-container',c=n.Panels;(c.getPanel(l)||c.addPanel({id:l})).set('appendContent',e).trigger('change:appendContent'),a||e.appendChild(r.render())}e&&(e.style.display='block')},close:function(){var t=this.container,e=this.config.custom;if((0,o.isFunction)(e.close))return e.close(this.bm.__customData());t&&(t.style.display='none')},run:function(t){var e=t.Blocks;this.config=e.getConfig(),this.firstRender=!this.container,this.container=this.container||(0,r.a_)('div'),this.editor=t,this.bm=e;var n=this.container;e.__behaviour({container:n}),this.config.custom&&e.__trgCustom(),this.open()},stop:function(){this.close()}}},5838:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});const o={run:function(t){var e=t.LayerManager,n=t.Panels,o=e.getConfig();if(!o.appendTo){if(!this.layers){var r='views-container',i=document.createElement('div'),a=n.getPanel(r)||n.addPanel({id:r});o.custom?e.__trgCustom({container:i}):i.appendChild(e.render()),a.set('appendContent',i).trigger('change:appendContent'),this.layers=i}this.layers.style.display='block'}},stop:function(){var t=this.layers;t&&(t.style.display='none')}}},8692:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(6411);const r={run:function(t,e){if(this.sender=e,!this.$cnt){var n=t.getConfig(),r=t.Panels,i=t.DeviceManager,a=t.SelectorManager,s=t.StyleManager,l='change:appendContent',c=(0,o["default"])('
'),u=(0,o["default"])('
'),p=(0,o["default"])('
'),d=(0,o["default"])('
');if(this.$cnt=c,this.$cntInner=u,u.append(p),u.append(d),c.append(u),i&&n.showDevices){var f=r.addPanel({id:'devices-c'}),h=i.render();f.set('appendContent',h).trigger(l)}var g=a.getConfig();g.custom?a.__trgCustom({container:p.get(0)}):g.appendTo||p.append(a.render([])),this.sm=s;var v=s.getConfig(),y=v.stylePrefix;this.$header=(0,o["default"])("")),c.append(this.$header),v.custom?s.__trgCustom({container:d.get(0)}):v.appendTo||d.append(s.render());var m='views-container';(r.getPanel(m)||r.addPanel({id:m})).set('appendContent',c).trigger(l);var b=t.getModel();this.listenTo(b,s.events.target,this.toggleSm)}this.toggleSm()},toggleSm:function(){var t=this,e=t.sender,n=t.sm,o=t.$cntInner,r=t.$header;e&&e.get&&!e.get('active')||!n||(n.getSelected()?(null==o||o.show(),null==r||r.hide()):(null==o||o.hide(),null==r||r.show()))},stop:function(){var t,e;null===(t=this.$cntInner)||void 0===t||t.hide(),null===(e=this.$header)||void 0===e||e.hide()}}},9163:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(6411);const r={run:function(t,e){this.sender=e;var n,r=t.getModel(),i=t.Config.stylePrefix,a=t.TraitManager,s=a.getConfig();if(!s.appendTo){if(!this.$cn){this.$cn=(0,o["default"])('
'),this.$cn2=(0,o["default"])('
'),this.$cn.append(this.$cn2),this.$header=(0,o["default"])('').append("")),this.$cn.append(this.$header),s.custom?a.__trgCustom({container:this.$cn2.get(0)}):(this.$cn2.append("
").concat(r.t('traitManager.label'),"
")),this.$cn2.append(a.render()));var l=t.Panels;null==(n=l.getPanel('views-container')?l.getPanel('views-container'):l.addPanel({id:'views-container'}))||n.set('appendContent',this.$cn.get(0)).trigger('change:appendContent'),this.target=t.getModel(),this.listenTo(this.target,'component:toggled',this.toggleTm)}this.toggleTm()}},toggleTm:function(){var t=this.sender;t&&t.get&&!t.get('active')||(1===this.target.getSelectedAll().length?(this.$cn2.show(),this.$header.hide()):(this.$cn2.hide(),this.$header.show()))},stop:function(){this.$cn2&&this.$cn2.hide(),this.$header&&this.$header.hide()}}},9298:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(5706);const r={run:function(t,e,n){void 0===n&&(n={});var r=t.getModel(),a=r.get('clipboard'),s=t.getSelected();(null==a?void 0:a.length)&&s&&(t.getSelectedAll().forEach((function(e){var s,l,c,u,p=(null===(l=null===(s=e.delegate)||void 0===s?void 0:s.copy)||void 0===l?void 0:l.call(s,e))||e,d=p.collection;if(d){var f={at:p.index()+1,action:n.action||'paste-component'};u=(0,o.contains)(a,p)&&p.get('copyable')?d.add(p.clone(),f):i(t,a,p.parent(),f)}else{var h=null===(c=r.Pages.getSelected())||void 0===c?void 0:c.getMainComponent();f={at:(null==h?void 0:h.components().length)||0,action:n.action||'paste-component'};u=i(t,a,h,f)}(u=(0,o.isArray)(u)?u:[u]).forEach((function(e){return t.trigger('component:paste',e)}))})),s.emitUpdate())}};function i(t,e,n,o){var r=e.filter((function(t){return t.get('copyable')})).filter((function(e){return t.Components.canMove(n,e).result}));return n.components().add(r.map((function(t){return t.clone()})),o)}},8594:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var o=n(5706),r=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r
{"use strict";n.r(e),n.d(e,{default:()=>r});var o=void 0&&(void 0).__assign||function(){return o=Object.assign||function(t){for(var e,n=1,o=arguments.length;n{"use strict";n.r(e),n.d(e,{default:()=>S});var o,r=n(5706),i=n(1749),a=void 0&&(void 0).__extends||(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});const s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a(e,t),e.prototype.defaults=function(){return{command:'',attributes:{}}},e}(i.Kx);var l=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e}(i.pM);const u=c;c.prototype.model=s;var p=n(91),d=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),f=void 0&&(void 0).__assign||function(){return f=Object.assign||function(t){for(var e,n=1,o=arguments.length;n").concat(l," "):'',"\n ").concat(r.getName(),"
");i.innerHTML=p?p(r):d}var f='px';a.display='block';var h=o.getTargetToElementFixed(t,i,{pos:e}).top,g=n.leftOff<0?-n.leftOff:0;a.top=h+f,a.left=g+f}else a.display='none'},showHighlighter:function(t){this.canvas.getHighlighter(t).style.opacity=''},initResize:function(t){var e=this.em,n=this.canvas,o=e.Editor,i=!(0,r.isElement)(t)&&(0,b.GW)(t)?t:e.getSelected(),a=null==i?void 0:i.get('resizable'),s=w.F.Resize,l=n.hasCustomSpot(s);if(n.removeSpots({type:s}),i&&a){n.addSpot({type:s,component:i});var c,u=(0,r.isElement)(t)?t:i.getEl(),p=(0,_.isObject)(a)?a:{},d=p.onStart,f=void 0===d?function(){}:d,h=p.onMove,g=void 0===h?function(){}:h,v=p.onEnd,y=void 0===v?function(){}:v,x=p.updateTarget,S=void 0===x?function(){}:x,T=O(p,["onStart","onMove","onEnd","updateTarget"]);if(l||!u||this.activeResizer)return;var P=e.config.stylePrefix||'',k="".concat(P,"resizing"),E=this,A={component:i,el:u},j=function(t,e,n){var o=n.docs;o&&o.forEach((function(e){var n=e.body,o=n.className||'';n.className=('add'==t?"".concat(o," ").concat(k):o.replace(k,'')).trim()}))},M=C({onStart:function(t,r){f(t,r);var a=r.el,s=r.config,l=r.resizer,u=s.keyHeight,p=s.keyWidth,d=s.currentUnit,h=s.keepAutoHeight,g=s.keepAutoWidth;j('add',0,r),c=e.Styles.getModelToStyle(i),n.toggleFramesEvents(!1);var v=getComputedStyle(a),y=c.getStyle(),b=y[p];s.autoWidth=g&&'auto'===b,isNaN(parseFloat(b))&&(b=v[p]);var w=y[u];s.autoHeight=h&&'auto'===w,isNaN(parseFloat(w))&&(w=v[u]),l.startDim.w=parseFloat(b),l.startDim.h=parseFloat(w),m=!1,d&&(s.unitHeight=(0,_.getUnitFromValue)(w),s.unitWidth=(0,_.getUnitFromValue)(b)),E.activeResizer=!0,o.trigger('component:resize',C(C({},A),{type:'start'}))},onMove:function(t){g(t),o.trigger('component:resize',C(C({},A),{type:'move'}))},onEnd:function(t,e){y(t,e),j('remove',0,e),o.trigger('component:resize',C(C({},A),{type:'end'})),n.toggleFramesEvents(!0),m=!0,E.activeResizer=!1},updateTarget:function(t,o,r){if(S(t,o,r),c){var a=r.store,s=r.selectedHandler,l=r.config,u=l.keyHeight,p=l.keyWidth,d=l.autoHeight,f=l.autoWidth,h=l.unitWidth,g=l.unitHeight,v=['tc','bc'].indexOf(s)>=0,y=['cl','cr'].indexOf(s)>=0,m={};if(!v){var b=n.getBody().offsetWidth,_=o.w{"use strict";n.r(e),n.d(e,{default:()=>a});var o=n(6411),r=n(6778),i=n(2128);const a={startSelectPosition:function(t,e,n){void 0===n&&(n={}),this.isPointed=!1;var o=this.em.Utils,a=t[0].ownerDocument.body;o&&(this.sorter=new o.ComponentSorter({em:this.em,treeClass:r.A,containerContext:{container:a,containerSel:'*',itemSel:'*',pfx:this.ppfx,document:e,placeholderElement:this.canvas.getPlacerEl()},positionOptions:{windowMargin:1,canvasRelative:!0},dragBehavior:{dragDirection:i.A.BothDirections,nested:!0}})),n.onStart&&(this.sorter.eventHandlers.legacyOnStartSort=n.onStart),t&&t.length>0&&this.sorter.startSort(t.map((function(t){return{element:t}})))},getOffsetDim:function(){var t=this.offset(this.canvas.getFrameEl()),e=this.offset(this.canvas.getElement());return{top:t.top-e.top,left:t.left-e.left}},stopSelectPosition:function(){this.posTargetCollection=null,this.posIndex='after'==this.posMethod&&0!==this.cDim.length?this.posIndex+1:this.posIndex,this.sorter&&this.sorter.cancelDrag(),this.cDim&&(this.posIsLastEl=0!==this.cDim.length&&'after'==this.posMethod&&this.posIndex==this.cDim.length,this.posTargetEl=0===this.cDim.length?(0,o["default"])(this.outsideElem):!this.posIsLastEl&&this.cDim[this.posIndex]?(0,o["default"])(this.cDim[this.posIndex][5]).parent():(0,o["default"])(this.outsideElem),this.posTargetModel=this.posTargetEl.data('model'),this.posTargetCollection=this.posTargetEl.data('model-comp'))},enable:function(){this.startSelectPosition()},nearFloat:function(t,e,n){var o=t||0,r=e||'before',i=n.length,a=0!==i&&'after'==r&&o==i;return 0!==i&&(!a&&!n[o][4]||n[o-1]&&!n[o-1][4]||a&&!n[o-1][4])?1:0},run:function(){this.enable()},stop:function(){this.stopSelectPosition(),this.$wrapper.css('cursor',''),this.$wrapper.unbind()}}},9490:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>s});var o=n(5706),r=n(2820),i=n(6411),a=void 0&&(void 0).__assign||function(){return a=Object.assign||function(t){for(var e,n=1,o=arguments.length;n")).get(0),A=(0,i["default"])(""),l=r.parseFromString(s,i);if(a){if(n.asDocument)return l;var c=l.head,u=l.body,p=c.querySelectorAll('script');(0,t.each)(p,(function(t){return u.appendChild(t)}));var d=[];(0,t.each)(c.children,(function(t){return d.push(t)})),(0,t.each)(d,(function(t,e){return u.insertBefore(t,u.children[e])})),o=u}else o=l.firstChild;return o}(v,f),m=y,b=y;g&&(m=b.documentElement,u.doctype=(0,_t.LJ)(b.doctype));var _=m.querySelectorAll('script'),w=_.length;if(!((0,t.isUndefined)(c.allowScripts)?f.allowScripts:c.allowScripts))for(;w--;)null===(s=_[w].parentNode)||void 0===s||s.removeChild(_[w]);if(f.allowUnsafeAttr&&f.allowUnsafeAttrValue||this.__sanitizeNode(m,f),r){for(var x=m.querySelectorAll('style'),C=x.length,O='';C--;)O=x[C].innerHTML+O,null===(l=x[C].parentNode)||void 0===l||l.removeChild(x[C]);O&&(u.css=r.parse(O))}null==n||n.trigger("".concat(Nt,":root"),{input:v,root:m});var S=[];if(g)u.head=this.parseNode(b.head,p),u.root=this.parseNodeAttr(m),S=this.parseNode(b.body,p);else{var T=this.parseNodes(m,p);S=1!==T.length||p.returnArray?T:T[0]}return u.html=S,null==n||n.trigger(Nt,{input:v,output:u,options:f}),u},__sanitizeNode:function(e,n){var o=this,r=e.attributes||[],i=e.childNodes||[],a=[];(0,t.each)(r,(function(t){var e=t.nodeName||'',o=t.nodeValue||'';!n.allowUnsafeAttr&&e.startsWith('on')&&a.push(e),!n.allowUnsafeAttrValue&&o.startsWith('javascript:')&&a.push(e)})),a.map((function(t){return e.removeAttribute(t)})),(0,t.each)(i,(function(t){return o.__sanitizeNode(t,n)}))},__checkAsDocument:function(n,o){return(0,e.isDef)(o.asDocument)?o.asDocument:(0,t.isFunction)(o.detectDocument)?!!o.detectDocument(n):o.detectDocument?n.toLowerCase().trim().startsWith('",t["lessThan"]="<",t["greaterThanOrEqual"]=">=",t["lessThanOrEqual"]="<=",t["equals"]="=",t["notEquals"]="!="}(ne||(ne={}));var ie,ae=function(t){function e(e){var n=t.call(this)||this;return n.operator=e,n}return re(e,t),e.prototype.evaluate=function(t,e){switch(this.operator){case ne.greaterThan:return t>e;case ne.lessThan:return t=e;case ne.lessThanOrEqual:return t<=e;case ne.equals:return t===e;case ne.notEquals:return t!==e;default:throw new Error("Unsupported number operator: ".concat(this.operator))}},e}(Jt),se=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();!function(t){t["contains"]="contains",t["startsWith"]="startsWith",t["endsWith"]="endsWith",t["matchesRegex"]="matchesRegex",t["equalsIgnoreCase"]="equalsIgnoreCase",t["trimEquals"]="trimEquals"}(ie||(ie={}));var le=function(t){function e(e){var n=t.call(this)||this;return n.operator=e,n}return se(e,t),e.prototype.evaluate=function(t,e){switch(this.operator){case ie.contains:return t.includes(e);case ie.startsWith:return t.startsWith(e);case ie.endsWith:return t.endsWith(e);case ie.matchesRegex:if(!e)throw new Error('Regex pattern must be provided.');return new RegExp(e).test(t);case ie.equalsIgnoreCase:return t.toLowerCase()===e.toLowerCase();case ie.trimEquals:return t.trim()===e.trim();default:throw new Error("Unsupported string operator: ".concat(this.operator))}},e}(Jt),ce=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ue=function(t){function e(e,n){var o=t.call(this,e)||this;return o.condition=e,o.em=n.em,o}return ce(e,t),e.prototype.evaluate=function(){return this.evaluateCondition(this.condition)},e.prototype.evaluateCondition=function(t){if('boolean'==typeof t)return t;if(this.isLogicGroup(t)){var e=t.logicalOperator,n=t.statements,o=new oe(e);return new Xt(o,n,{em:this.em}).evaluate()}if(this.isExpression(t)){var r=t.left,i=(o=t.operator,t.right),a=Kt(r,this.em),s=Kt(i,this.em);return this.getOperator(a,o).evaluate(a,s)}throw new Error('Invalid condition type.')},e.prototype.getOperator=function(t,e){if(this.isOperatorInEnum(e,Yt))return new te(e);if('number'==typeof t)return new ae(e);if('string'==typeof t)return new le(e);throw new Error("Unsupported data type: ".concat(typeof t))},e.prototype.getDataVariables=function(){var t=[];return this.extractVariables(this.condition,t),t},e.prototype.extractVariables=function(t,e){var n=this;this.isExpression(t)?(Gt(t.left)&&e.push(t.left),Gt(t.right)&&e.push(t.right)):this.isLogicGroup(t)&&t.statements.forEach((function(t){return n.extractVariables(t,e)}))},e.prototype.isLogicGroup=function(t){return t&&void 0!==t.logicalOperator&&Array.isArray(t.statements)},e.prototype.isExpression=function(t){return t&&void 0!==t.left&&'string'==typeof t.operator},e.prototype.isOperatorInEnum=function(t,e){return Object.values(e).includes(t)},e}(u.Kx),pe=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),de='conditional-variable',fe=function(t){function e(e,n,o,r){var i=this;if(void 0===e)throw new he;var a=new ue(e,{em:r.em});return(i=t.call(this,{type:de,condition:a,ifTrue:n,ifFalse:o})||this).ifTrue=n,i.ifFalse=o,i.variableListeners=[],i.condition=a,i.em=r.em,i.lastEvaluationResult=i.evaluate(),i.listenToDataVariables(),i._onValueChange=r.onValueChange,i}return pe(e,t),e.prototype.evaluate=function(){return this.condition.evaluate()},e.prototype.getDataValue=function(){return this.lastEvaluationResult?Kt(this.ifTrue,this.em):Kt(this.ifFalse,this.em)},e.prototype.reevaluate=function(){this.lastEvaluationResult=this.evaluate()},Object.defineProperty(e.prototype,"onValueChange",{set:function(t){this._onValueChange=t,this.listenToDataVariables()},enumerable:!1,configurable:!0}),e.prototype.listenToDataVariables=function(){var t=this;this.em&&(this.cleanupListeners(),this.getDependentDataVariables().forEach((function(e){var n=new Ht(e,{em:t.em}),o=new ve({model:t,em:t.em,dataVariable:n,updateValueFromDataVariable:function(){var e;t.reevaluate(),null===(e=t._onValueChange)||void 0===e||e.call(t)}.bind(t)});t.variableListeners.push(o)})))},e.prototype.getDependentDataVariables=function(){var t=this.condition.getDataVariables();return Gt(this.ifTrue)&&t.push(this.ifTrue),Gt(this.ifFalse)&&t.push(this.ifFalse),t},e.prototype.cleanupListeners=function(){this.variableListeners.forEach((function(t){return t.destroy()})),this.variableListeners=[]},e.prototype.toJSON=function(){return{type:de,condition:this.condition,ifTrue:this.ifTrue,ifFalse:this.ifFalse}},e}(u.Kx),he=function(t){function e(){return t.call(this,'No condition was provided to a conditional component.')||this}return pe(e,t),e}(Error),ge=function(){function t(t){var e=this;this.dataListeners=[],this.onChange=function(){var t=e.dynamicVariable.getDataValue();e.updateValueFromDynamicVariable(t)},this.em=t.em,this.model=t.model,this.dynamicVariable=t.dataVariable,this.updateValueFromDynamicVariable=t.updateValueFromDataVariable,this.listenToDynamicVariable()}return t.prototype.listenToDynamicVariable=function(){var t=this,e=this,n=e.em,o=e.dynamicVariable,r=e.model;this.removeListeners();var i=[];switch(o.get('type')){case Ft:i=this.listenToDataVariable(o,n);break;case de:i=this.listenToConditionalVariable(o,n)}i.forEach((function(e){return r.listenTo(e.obj,e.event,t.onChange)})),this.dataListeners=i},t.prototype.listenToConditionalVariable=function(t,e){var n=this;return t.getDependentDataVariables().flatMap((function(t){return n.listenToDataVariable(new Ht(t,{em:n.em}),e)}))},t.prototype.listenToDataVariable=function(t,n){var o=[],r=t.attributes.path,i=(0,e.stringToPath)(r||'').join('.'),a=this.em.DataSources.fromPath(r),s=a[0],l=a[1];return s&&o.push({obj:s.records,event:'add remove reset'}),l&&o.push({obj:l,event:'change'}),o.push({obj:t,event:'change:path change:defaultValue'},{obj:n.DataSources.all,event:'add remove reset'},{obj:n,event:"".concat(Wt.path,":").concat(i)}),o},t.prototype.removeListeners=function(){var t=this,e=this.model;this.dataListeners.forEach((function(n){return e.stopListening(n.obj,n.event,t.onChange)})),this.dataListeners=[]},t.prototype.destroy=function(){this.removeListeners()},t}();const ve=ge;var ye=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),me=void 0&&(void 0).__assign||function(){return me=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0:r;if('__'===e.substring(0,2))return"continue";var a=o[e];((0,t.isArray)(a)?a:[a]).forEach((function(t){var o="".concat(t).concat(i?' !important':'');o&&n.push("".concat(e,":").concat(o,";"))}))};for(var a in o)i(a);return n.join('')},o.prototype.getSelectors=function(){return this.get('selectors')||this.get('classes')},o.prototype.getSelectorsString=function(t){return this.selectorsToString?this.selectorsToString(t):this.getSelectors().getFullString()},o}(u.Kx);const xe=we;var Ce=void 0&&(void 0).__assign||function(){return Ce=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0}))},De=function(t,e){void 0===e&&(e={});var n=[],o=e.changed;if(e.fromInstance||e.noPropagate||e.fromUndo||o&&Me(t,o))return n;var r=je(t)||[],i=Ae(t);return n=(i?Oe([i],je(i)||[],!0):r).filter((function(e){return e!==t})).filter((function(t){return!(o&&Me(t,o))}))},Le=function(t,e){for(var n=t,o=t.parent(e);o&&Pe(o);)n=o,o=o.parent(e);return n},Ne=function(t,e){void 0===e&&(e={});var n=Ae(t),o=n&&je(n);!e.skipRefs&&o&&n.set(Dn,o.filter((function(e){return e!==t}))),t.set(Ln,0),t.components().forEach((function(t){return Ne(t,e)}))},Ie=function(t,e,n,o){void 0===o&&(o={});var r=Ae(t),i=je(t);(r||i)&&t.em.log(e,{model:t,toUp:n,context:'symbols',opts:o})},Ve=function(t,e,n,o){var r=o||n||{},i={fromInstance:r.fromInstance,fromUndo:r.fromUndo},a=e.opt.temporary;if(o)if(o.add){var s=[],l=!!je(t);if((m=De(t,Ce(Ce({},i),{changed:'components:add'}))).length){var c=Ae(e);s=je(c||e)||[],(s=Oe([],s,!0)).push(c||e)}!a&&Ie(t,'add',m,{opts:o,addedInstances:s.map((function(t){return t.cid})),added:e.cid}),m.forEach((function(n){var r=Le(n),i=s.filter((function(t){var e=Le(t,{prev:1});return r&&e&&e===r}))[0]||e.clone({symbol:!0,symbolInv:l});n.append(i,Ce({fromInstance:t},o))}))}else{var u=Ae(e);if(u&&!o.temporary&&u.set(Dn,je(u).filter((function(t){return t!==e}))),!ke(e)&&!o.skipRefsUp){var p='components:remove',d=o.index,f=e.parent(),h=Ce({fromInstance:e},o),g=ke(e),v=function(t){var e=t.parent();e&&!Me(e,p)&&t.remove(h)};m=Me(f,p)?[]:De(e,i);g&&(m=f&&De(f,Ce(Ce({},i),{changed:p})),v=function(t){var e=t.components().at(d);e&&e.remove(Ce({fromInstance:f},h))}),!a&&Ie(t,'remove',m,{opts:o,removed:e.cid,isSymbNested:g}),m.forEach(v)}}else{var y=e,m=De(t,Ce(Ce({},i),{changed:'components:reset'})),b=y.models,_=new Set;Ie(t,'reset',m,{components:b}),m.forEach((function(e){var o=e.components(),r=b.map((function(t,e){return!Pe(t)||_.has(t)?(_.add(t),t.clone({symbol:!0})):o.at(e)}));o.reset(r,Ce({fromInstance:t},n))}))}t.__changesUp(r)},Fe=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Re=void 0&&(void 0).__assign||function(){return Re=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0}));e.keepIds=(e.keepIds||[]).concat(s),i.forEach((function(t){return n.removeChildren(t,o,e)})),t.each((function(t){return n.onAdd(t)}))},n.prototype.resetFromString=function(t,e){var n,o;void 0===t&&(t=''),void 0===e&&(e={}),e.keepIds=Ue(this);var r=this,i=r.domc,a=r.em,s=r.parent,l=null==a?void 0:a.Css,c=(null==i?void 0:i.allById())||{},u=this.parseString(t,e),p=ze(u,c,e),d=e.visitedCmps,f=void 0===d?{}:d;Object.keys(f).forEach((function(t){var e=f[t];if(e.length){var n=(null==l?void 0:l.getRules("#".concat(t)))||[];n.length&&e.forEach((function(t){n.forEach((function(e){var n=e.clone();n.set('selectors',["#".concat(t.attributes.id)]),l.getAll().add(n)}))}))}})),this.reset(p,e),null==a||a.trigger('component:content',s,e,t),null===(o=(n=s).__checkInnerChilds)||void 0===o||o.call(n)},n.prototype.removeChildren=function(t,e,n){var o=this;if(void 0===n&&(n={}),t){var r=this.domc,i=this.em,a=n.temporary||n.fromUndo;if(t.prevColl=this,!a){var s=t.getId(),l=i.Selectors.getAll(),c=i.Css.getAll(),u=(n.keepIds||[]).indexOf(s)<0;delete(r?r.allById():{})[s];var p=u?c.remove(c.filter((function(t){return t.getSelectors().getFullString()==="#".concat(s)})),n):[];l.remove(p.map((function(t){return t.getSelectors().at(0)}))),t.opt.temporary||(i.Commands.run('core:component-style-clear',{target:t}),t.removed(),t.trigger('removed'),i.trigger(pt.I.remove,t),r&&Te(t)&&ke(t)&&r.symbols.__trgEvent(r.events.symbolInstanceRemove,{component:t},!0));var d=t.components();d.forEach((function(t){Ve(t,t,d,Re(Re({},n),{skipRefsUp:!0})),o.removeChildren(t,e,n)}))}var f=t.components();i.stopListening(f),i.stopListening(t),i.stopListening(t.get('classes')),t.__postRemove()}},n.prototype.model=function(t,e){var n,o=e.collection.opt,r=o.em,i=r.Components.componentTypes;e.em=r,e.config=o.config,e.componentTypes=i,e.domc=o.domc;for(var a=0;a=0&&i.set('void',!0),r.em=a,i.opt=r,i.em=a,i.config=r.config||{},i.set('attributes',Pn(Pn({},(0,t.result)(i,'defaults').attributes||{}),i.get('attributes')||{})),i.ccid=o.createId(i,r),i.preInit(),i.initClasses(),i.initComponents(),i.initTraits(),i.initToolbar(),i.initScriptProps(),i.listenTo(i,'change:script',i.scriptUpdated),i.listenTo(i,'change:tagName',i.tagUpdated),i.listenTo(i,'change:attributes',i.attrUpdated),i.listenTo(i,'change:attributes:id',i._idUpdated),i.on('change:toolbar',i.__emitUpdateTlb),i.on('change',i.__onChange),i.on(Vn,i.__propToParent),i.set('status',''),i.views=[],['classes','traits','components'].forEach((function(t){var e="add remove ".concat('components'!==t?'change':'');i.listenTo(i.get(t),e.trim(),(function(){for(var e=[],n=0;n").concat(r);return!i&&(a+="".concat(e,">")),a},o.prototype.getInnerHTML=function(t){return this.__innerHTML(t)},o.prototype.__innerHTML=function(t){void 0===t&&(t={});var e=this.components();return e.length?e.map((function(e){return e.toHTML(t)})).join(''):this.content},o.prototype.__attrToString=function(n){void 0===n&&(n={});var o=[],r=n.attributes,i=this.getAttrToHTML(n);if(r&&((0,t.isFunction)(r)?i=r(this,i)||{}:(0,e.isObject)(r)&&(i=r)),n.withProps){var a=this.toJSON();(0,t.forEach)(a,(function(n,o){'_'!==o[0]&&['classes','attributes','components'].indexOf(o)<0&&(i["data-gjs-".concat(o)]=(0,t.isArray)(n)||(0,e.isObject)(n)?JSON.stringify(n):(0,t.isBoolean)(n)?"".concat(n):n)}))}for(var s in i){var l=i[s];if(!(0,t.isUndefined)(l)&&null!==l)if((0,t.isBoolean)(l))l&&o.push(s);else{var c='';if(n.altQuoteAttr&&(0,t.isString)(l)&&l.indexOf('"')>=0)c="'".concat(l.replace(/'/g,'''),"'");else{var u=(0,t.isString)(l)?l.replace(/"/g,'"'):l;c="\"".concat(u,"\"")}o.push("".concat(s,"=").concat(c))}}return o.join(' ')},o.prototype.getAttrToHTML=function(t){var e=this.getAttributes();return jn(this.em)&&!0!==(null==t?void 0:t.keepInlineStyle)&&delete e.style,e},o.prototype.toJSON=function(e){void 0===e&&(e={});var n=a.Model.prototype.toJSON.call(this,e);if(n.attributes=this.getAttributes(),delete n.attributes.class,delete n.toolbar,delete n.traits,delete n.status,delete n.open,delete n._undoexc,delete n.delegate,!e.fromUndo){var o=n[Ln],r=n[Dn];r&&(0,t.isArray)(r)&&(n[Dn]=r.filter((function(t){return t})).map((function(t){return t.getId?t.getId():t}))),o&&!(0,t.isString)(o)&&(n[Ln]=o.getId())}return this.em.getConfig().avoidDefaults&&this.getChangedProps(n),n},o.prototype.getChangedProps=function(e){var n=e||a.Model.prototype.toJSON.apply(this),o=(0,t.result)(this,'defaults');return(0,t.forEach)(o,(function(t,e){-1===['type'].indexOf(e)&&n[e]===t&&delete n[e]})),(0,t.isEmpty)(n.type)&&delete n.type,(0,t.forEach)(['attributes','style'],(function(e){(0,t.isEmpty)(o[e])&&(0,t.isEmpty)(n[e])&&delete n[e]})),(0,t.forEach)(['classes','components'],(function(e){(!n[e]||(0,t.isEmpty)(o[e])&&!n[e].length)&&delete n[e]})),n},o.prototype.getId=function(){return(this.get('attributes')||{}).id||this.ccid||this.cid},o.prototype.setId=function(t,e){var n=Pn({},this.get('attributes'));return n.id=t,this.set('attributes',n,e),this},o.prototype.getEl=function(t){var e=this.getView(t);return e&&e.el},o.prototype.getView=function(t){var e=this,n=e.view,o=e.views,r=e.em,i=t||(null==r?void 0:r.getCurrentFrameModel());return i&&(n=o.filter((function(t){return t.frameView===i.view}))[0]),n},o.prototype.getCurrentView=function(){var t=this.em.getCurrentFrame(),e=null==t?void 0:t.model;return this.getView(e)},o.prototype.__getScriptProps=function(){var t=this.props();return(this.get('script-props')||[]).reduce((function(e,n){return e[n]=t[n],e}),{})},o.prototype.getScriptString=function(e){var n=this,o=e||this.get('script')||'';if(!o)return o;if(this.get('script-props'))o=o.toString().trim();else{if((0,t.isFunction)(o)){var r=o.toString().trim();o=(r=r.slice(r.indexOf('{')+1,r.lastIndexOf('}'))).trim()}var i=this.em.getConfig(),a=An(i.tagVarStart||'{[ '),s=An(i.tagVarEnd||' ]}'),l=new RegExp("".concat(a,"([\\w\\d-]*)").concat(s),'g');o=o.replace(l,(function(e,o){n.scriptUpdated();var r=n.attributes[o]||'';return(0,t.isArray)(r)||'object'==typeof r?JSON.stringify(r):r}))}return o},o.prototype.emitUpdate=function(t){for(var e,n=[],o=1;o=0&&this.__propSelfToParent({component:this,changed:(e={},e[t]=a,e),options:n[2]||n[1]||{}})},o.prototype.onAll=function(e){return(0,t.isFunction)(e)&&(e(this),this.components().forEach((function(t){return t.onAll(e)}))),this},o.prototype.forEachChild=function(e){(0,t.isFunction)(e)&&this.components().forEach((function(t){e(t),t.forEachChild(e)}))},o.prototype.remove=function(t){var e=this;void 0===t&&(t={});var n=this.em,o=this.collection,r=function(){o&&o.remove(e,Pn({action:pt.t.remove},t)),o||(e.components('',t),e.components().removeChildren(e,void 0,t))},i=Pn({},t);return[this,n].map((function(t){return t.trigger(pt.I.removeBefore,e,r,i)})),!i.abort&&r(),this},o.prototype.move=function(t,e){if(void 0===e&&(e={}),t){var n=e.at,o=this.index(),r=t===this.parent();if(!r||!(o===n||o===n-1)){r&&n&&n>o&&(e.at=n-1);var i=pt.t.move;this.remove({action:i,temporary:1}),t.append(this,Pn({action:i},e)),this.emitUpdate()}}return this},o.prototype.isInstanceOf=function(t){var e,n,o=null===(n=null===(e=this.em)||void 0===e?void 0:e.Components.getType(t))||void 0===n?void 0:n.model;if(!o)return!1;var r=this.constructor.typeExtends;return this instanceof o||r.has(t)},o.prototype.isChildOf=function(e){for(var n=(0,t.isString)(e),o=this.parent();o;){if(n){if(o.isInstanceOf(e))return!0}else if(o===e)return!0;o=o.parent()}return!1},o.prototype.resetId=function(t){void 0===t&&(t={});var e=this.em,n=this.getId();if(!n)return this;var r=o.createId(this);this.setId(r);var i=null==e?void 0:e.Css.getIdRule(n),a=null==i?void 0:i.get('selectors').at(0);return null==a||a.set('name',r),this},o.prototype._getStyleRule=function(t){var e=(void 0===t?{}:t).id,n=this.em,o=e||this.getId();return null==n?void 0:n.Css.getIdRule(o)},o.prototype._getStyleSelector=function(t){var e=this._getStyleRule(t);return null==e?void 0:e.get('selectors').at(0)},o.prototype._idUpdated=function(t,e,n){if(void 0===n&&(n={}),!n.idUpdate){var r=this.ccid,i=(this.get('attributes')||{}).id,a=(this.previous('attributes')||{}).id||r,s=o.getList(this);if(s[i]||!i&&a)return this.setId(a,{idUpdate:!0});delete s[a],s[i]=this,this.ccid=i;var l=this._getStyleSelector({id:a});l&&l.set({name:i,label:i})}},o.getDefaults=function(){return(0,t.result)(this.prototype,'defaults')},o.isComponent=function(t,n){return{tagName:(0,e.toLowerCase)(t.tagName)}},o.ensureInList=function(t){var e=o.getList(t),n=t.getId(),r=e[n];if(r){if(r!==t){var i=o.getIncrementId(n,e);t.setId(i),e[i]=t}}else e[n]=t;t.components().forEach((function(t){return o.ensureInList(t)}))},o.createId=function(t,e){void 0===e&&(e={});var n,r=o.getList(t),i=e.idMap,a=void 0===i?{}:i,s=t.get('attributes').id;return s?(n=o.getIncrementId(s,r,e),t.setId(n),s!==n&&(a[s]=n)):n=o.getNewId(r),r[n]=t,n},o.getNewId=function(t){for(var e=Object.keys(t).length.toString().length+2,n=(Math.random()+1.1).toString(36).slice(-e),r="i".concat(n);t[r];)r=o.getNewId(t);return r},o.getIncrementId=function(t,e,n){void 0===n&&(n={});var o=n.keepIds,r=1,i=t;if((void 0===o?[]:o).indexOf(t)<0)for(;e[i];)r++,i="".concat(t,"-").concat(r);return i},o.getList=function(t){var e,n=t.em,o=null==n?void 0:n.Components;return null!==(e=null==o?void 0:o.componentsById)&&void 0!==e?e:{}},o.checkId=function(e,n,r,i){void 0===n&&(n=[]),void 0===r&&(r={}),void 0===i&&(i={});var a=(0,t.isArray)(e)?e:[e],s=i.keepIds,l=void 0===s?[]:s,c=i.idMap,u=void 0===c?{}:c;a.forEach((function(e){e.attributes;var a=e.attributes,s=void 0===a?{}:a,c=e.components,p=s.id;if(p&&r[p]&&l.indexOf(p)<0){var d=o.getIncrementId(p,r);u[p]=d,s.id=d,(0,t.isArray)(n)&&n.forEach((function(t){var e=t.selectors;e.forEach((function(t,n){t==="#".concat(p)&&(e[n]="#".concat(d))}))}))}c&&o.checkId(c,n,r,i)}))},o.typeExtends=new Set,o}(xe);const Hn=Rn;var Bn=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Un=void 0&&(void 0).__assign||function(){return Un=Object.assign||function(t){for(var e,n=1,o=arguments.length;n';if(i.stopDefault(),i.inAbsoluteMode()){var d=i.Components.getWrapper(),f=d.append({})[0],h=i.Commands.run('core:component-drag',{event:t,guidesInfo:1,center:1,target:f,onEnd:function(t,e,n){var o;if(!n.cancelled&&p){o=d.append(p)[0];var i=a.getOffset(),l=f.getStyle(),c=l.top,u=l.left,h=l.position,g=(0,_t.Xy)(t.target),v=parseInt("".concat(parseFloat(u)+g.x-i.left),10),y=parseInt("".concat(parseFloat(c)+g.y-i.top),10);o.addStyle({left:v+'px',top:y+'px',position:h})}r.handleDragEnd(o,s),f.remove()}});c=function(e){return h.stop(t,{cancel:e})},this.setAbsoluteDragContent=function(t){return p=t}}else{var g=new u.ComponentSorter({em:i,treeClass:Jn,containerContext:{container:this.el,containerSel:'*',itemSel:'*',pfx:'gjs-',placeholderElement:a.getPlacerEl(),document:this.el.ownerDocument},dragBehavior:{dragDirection:Gn.A.BothDirections,nested:!0},positionOptions:{windowMargin:1,canvasRelative:!0},eventHandlers:{legacyOnEndMove:this.handleDragEnd}}),v=null===(e=this.getSorterOptions)||void 0===e?void 0:e.call(this,g);v&&(g.eventHandlers.legacyOnStartSort=v.legacyOnStart,g.eventHandlers.legacyOnEnd=v.legacyOnEnd,g.containerContext.customTarget=v.customTarget);var y=null===(n=this.getTempDropModel(p).view)||void 0===n?void 0:n.el,m=y?[{element:y,dragSource:l}]:[];g.startSort(m),this.sorter=g,this.draggedNode=null===(o=g.sourceNodes)||void 0===o?void 0:o[0],c=function(t){t?g.cancelDrag():g.endDrag()}}this.dragStop=c,i.trigger('canvas:dragenter',s,p)}},e.prototype.getTempDropModel=function(t){var e,n=this.em.Components.getComponents(),o={avoidChildren:1,avoidStore:1,avoidUpdateStyle:1},r=n.add(t,Zn(Zn({},o),{temporary:!0})),i=n.remove(r,Zn(Zn({},o),{temporary:!0}));return null===(e=(i=i instanceof Array?i[0]:i).view)||void 0===e||e.$el.data('model',i),i},e.prototype.handleDragEnd=function(t,e){var n=this.em;this.over=!1,t&&(n.set('dragResult',t),n.trigger('canvas:drop',e,t)),n.runDefault({preserveSelected:1})},e.prototype.handleDragOver=function(t){t.preventDefault(),this.em.trigger('canvas:dragover',t)},e.prototype.handleDrop=function(t){var e;t.preventDefault();var n=t.dataTransfer,o=this.getContentByData(n).content;this.draggedNode&&(this.draggedNode.content=o),null===(e=this.setAbsoluteDragContent)||void 0===e||e.call(this,o),this.endDrop(!o,t)},e.prototype.getContentByData=function(e){var n=this.em,o=e&&e.types,r=e&&e.files||[],i=n.get('dragSource'),a=e&&e.getData('text');if(r.length){a=[];for(var s=0;s=0)a=e&&e.getData('text/html').replace(/<\/?meta[^>]*>/g,'');else if((0,t.indexOf)(o,'text/uri-list')>=0)a={type:'link',attributes:{href:a},content:a};else if((0,t.indexOf)(o,'text/json')>=0){var u=e&&e.getData('text/json');u&&(a=JSON.parse(u))}else 1===o.length&&'text/plain'===o[0]&&(a="".concat(a,"
"));var p={content:a};return n.trigger('canvas:dragdata',e,p),p},e}();const to=Qn;var eo=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),no=void 0&&(void 0).__assign||function(){return no=Object.assign||function(t){for(var e,n=1,o=arguments.length;ns&&(l+=i-s),!(0,t.isUndefined)(e)&&l!==r&&l>0&&l0){var l=n.shift(),u=(0,_t.a_)('script',no({type:'text/javascript'},(0,t.isString)(l)?{src:l}:l));null===(r=o.contentDocument)||void 0===r||r.head.appendChild(u),u.hasAttribute('nomodule')&&'noModule'in HTMLScriptElement.prototype?c(n):u.onerror=u.onload=c.bind(null,n)}else null==i||i.trigger(vt.frameLoadHead,s),e.renderBody(),null==i||i.trigger(vt.frameLoadBody,s),null==i||i.trigger(a,s)};o.onload=function(){var t=e.config.frameContent;if(t){var n=e.getDoc();n.open(),n.write(t),n.close()}s.window=e.getWindow(),null==i||i.trigger("".concat(a,":before"),s),null==i||i.trigger(vt.frameLoad,s),e.renderHead(),c(oo([],l.get('scripts'),!0))}},o.prototype.renderStyles=function(e){void 0===e&&(e={});var n=this.getHead(),o=this.getCanvasModel(),r=function(e){return void 0===e&&(e=[]),e.map((function(e){return{tag:'link',attributes:no({rel:'stylesheet'},(0,t.isString)(e)?{href:e}:e)}}))},i=r(e.prev||o.previous('styles')),a=r(null==o?void 0:o.get('styles')),s=[],l=[],c=function(t,e,n){t.forEach((function(t){var o=t.attributes.href;!e.some((function(t){return t.attributes.href===o}))&&n.push(t)}))};c(a,i,l),c(i,a,s),s.forEach((function(t){var e,o=n.querySelector("link[href=\"".concat(t.attributes.href,"\"]"));null===(e=null==o?void 0:o.parentNode)||void 0===e||e.removeChild(o)})),(0,_t.af)(n,l)},o.prototype.renderHead=function(){var t,e=this.model,n=this.em,o=e.root,r=null===(t=null==n?void 0:n.Components)||void 0===t?void 0:t.getType(zn).view;r&&(this.headView=new r({el:this.getHead(),model:o.head,config:no(no({},o.config),{frameView:this})}).render())},o.prototype.renderBody=function(){var t,n,o,r=this,i=this,a=i.config,s=i.em,l=i.model,c=i.ppfx,u=this.getDoc(),p=this.getBody(),d=this.getWindow(),f=l.hasAutoHeight(),h=s.config;d._isEditor=!0,this.renderStyles({prev:[]});(0,_t.BC)(p,""));var g=l.root,v=((null===(t=null==s?void 0:s.Components)||void 0===t?void 0:t.getType('wrapper'))||{}).view;v&&(this.wrapper=new v({model:g,config:no(no({},g.config),{em:s,frameView:this})}).render(),(0,_t.BC)(p,null===(n=this.wrapper)||void 0===n?void 0:n.el),(0,_t.BC)(p,new At({collection:l.getStyles(),config:no(no({},s.Css.getConfig()),{frameView:this})}).render().el),(0,_t.BC)(p,this.getJsContainer()),(0,_t.on)(p,'click',(function(t){var e;return t&&'A'==(null===(e=t.target)||void 0===e?void 0:e.tagName)&&t.preventDefault()})),(0,_t.on)(p,'submit',(function(t){return t&&t.preventDefault()})),[{event:'keydown keyup keypress',class:'KeyboardEvent'},{event:'mousedown mousemove mouseup',class:'MouseEvent'},{event:'pointerdown pointermove pointerup',class:'PointerEvent'},{event:'wheel',class:'WheelEvent',opts:{passive:!a.infiniteCanvas}}].forEach((function(t){return t.event.split(' ').forEach((function(e){u.addEventListener(e,(function(e){return r.el.dispatchEvent((0,_t.yL)(e,t.class))}),t.opts)}))})),this._toggleEffects(!0),(0,e.hasDnd)(s)&&(this.droppable=new to(s,null===(o=this.wrapper)||void 0===o?void 0:o.el)),this.loaded=!0,l.trigger('loaded'))},o.prototype._toggleEffects=function(t){var e=t?_t.on:_t.AU,n=this.getWindow();n&&e(n,"".concat(_t.D8," resize"),this._emitUpdate)},o.prototype._emitUpdate=function(){this.model._emitUpdated()},o}(bt);const io=ro;var ao=n(5633),so=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),lo=void 0&&(void 0).__assign||function(){return lo=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n ").concat(i.get('name')||'',"\n
\n \n \n
\n
\n
\n ")).append(e.el);var l=(0,_t.a_)('div',{class:"".concat(o,"tools"),style:'pointer-events:none; display: none'},"\n
\n
\n \n
\n
\n
\n \n
\n "));this.elTools=l;var c=null==r?void 0:r.toolsWrapper;return c&&c.appendChild(l),s&&s({el:a,elTop:a.querySelector('[data-frame-top]'),elRight:a.querySelector('[data-frame-right]'),elBottom:a.querySelector('[data-frame-bottom]'),elLeft:a.querySelector('[data-frame-left]'),frame:i,frameWrapperView:this,remove:this.remove,startDrag:this.startDrag}),this},n}(bt);const uo=co;var po=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),fo=function(t){function e(e,n){void 0===e&&(e={});var o=t.call(this,e,!0)||this;return o.listenTo(o.collection,'reset',o.render),o.canvasView=n.canvasView,o._module=n.module,o}return po(e,t),e.prototype.onRemoveBefore=function(t,e){void 0===e&&(e={}),t.forEach((function(t){return t.remove(e)}))},e.prototype.onRender=function(){var t=this.$el,e=this.ppfx;t.attr({class:"".concat(e,"frames")})},e.prototype.clearItems=function(){(this.viewCollection||[]).forEach((function(t){return t.remove()})),this.viewCollection=[]},e.prototype.renderView=function(t,e){return new uo(t,this.canvasView)},e}(xt);const ho=fo;var go=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),vo=void 0&&(void 0).__assign||function(){return vo=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
\n \n
\n \n ")},o.prototype._onFramesUpdate=function(){this._initFrames(),this._renderFrames()},o.prototype._initFrames=function(){var t=this,e=t.frames,n=t.model,o=t.config,r=t.em,i=n.frames;r.set('readyCanvas',0),i.once('loaded:all',(function(){return r.set('readyCanvas',1)})),null==e||e.remove(),this.frames=new ho({collection:i},vo(vo({},o),{canvasView:this}))},o.prototype.checkSelected=function(t,e){var n;void 0===e&&(e={});var o=e.scroll,r=this.em.getCurrentFrame();o&&(null===(n=t.views)||void 0===n||n.forEach((function(t){t.frameView===r&&t.scrollIntoView(o)})))},o.prototype.remove=function(){for(var t,e=[],n=0;n=S?S/2-C/2:-w)+w)*E,y:(-v.y+T/2-O/2+x)*E};if(m){var M=s.getZoomMultiplier(),D=(T*M-T)/2;j.y=(-v.y+x)*E-D/M}s.setCoords(j.x,j.y)},o.prototype.isElInViewport=function(t){var n=(0,e.getElement)(t),o=(0,_t.C8)(n),r=this.getFrameOffset(n),i=o.top,a=o.left;return i>=0&&a>=0&&i<=r.height&&a<=r.width},o.prototype.offset=function(t,e){void 0===e&&(e={});var n=e.noScroll,o=(0,_t.C8)(t),r=n?{x:0,y:0}:(0,_t.Xy)(t);return{top:o.top+r.y,left:o.left+r.x,width:o.width,height:o.height}},o.prototype.getRectToScreen=function(t){var e,n,o,r,i=this.module.getZoomDecimal(),a=this.module.getCoords(),s=this.getViewportDelta();return{x:(null!==(e=t.x)&&void 0!==e?e:0)*i+a.x+s.x||0,y:(null!==(n=t.y)&&void 0!==n?n:0)*i+a.y+s.y||0,width:(null!==(o=t.width)&&void 0!==o?o:0)*i,height:(null!==(r=t.height)&&void 0!==r?r:0)*i}},o.prototype.getElBoxRect=function(t,n){var o,r,i;void 0===n&&(n={});var a=this.module,s=(0,_t.C8)(t),l=s.width,c=s.height,u=s.left,p=s.top,d=null===(o=(0,e.getComponentView)(t))||void 0===o?void 0:o.frameView,f=null==d?void 0:d.getBoxRect(),h=a.getZoomMultiplier(),g=null!==(r=null==f?void 0:f.x)&&void 0!==r?r:0,v=null!==(i=null==f?void 0:f.y)&&void 0!==i?i:0,y=this.el,m=(0,_t.Xy)(),b={x:u+g+(y.scrollLeft+m.x)*h,y:p+v+(y.scrollTop+m.y)*h,width:l,height:c};return n.local&&(b.x=u,b.y=p),n.toScreen?this.getRectToScreen(b):b},o.prototype.getViewportRect=function(t){void 0===t&&(t={});var e=this.getCanvasOffset(),n=e.top,o=e.left,r=e.width,i=e.height,a=this.module;if(t.toWorld){var s=a.getZoomMultiplier(),l=a.getCoords(),c=this.getViewportDelta();return{x:(-l.x-c.x||0)*s,y:(-l.y-c.y||0)*s,width:r*s,height:i*s}}return{x:o,y:n,width:r,height:i}},o.prototype.getViewportDelta=function(t){void 0===t&&(t={});var e=this.module.getZoomMultiplier(),n=this.getCanvasOffset(),o=n.width,r=n.height;return{x:(o*e-o)/2/e,y:(r*e-r)/2/e}},o.prototype.clearOff=function(){this.frmOff=void 0,this.cvsOff=void 0},o.prototype.getFrameOffset=function(t){var e;if(!this.frmOff||t){var n=null===(e=this.frame)||void 0===e?void 0:e.el,o=null==t?void 0:t.ownerDocument.defaultView,r=o?o.frameElement:n;this.frmOff=this.offset(r||n)}return this.frmOff},o.prototype.getCanvasOffset=function(){return this.cvsOff||(this.cvsOff=this.offset(this.el)),this.cvsOff},o.prototype.getElementPos=function(t,e){void 0===e&&(e={});var n=this.module.getZoomDecimal(),o=this.getFrameOffset(t),r=this.el,i=this.getCanvasOffset(),a=this.offset(t,e),s=e.avoidFrameOffset?0:o.top,l=e.avoidFrameOffset?0:o.left,c=e.avoidFrameZoom?a.top:a.top*n,u=e.avoidFrameZoom?a.left:a.left*n;return{top:e.avoidFrameOffset?c:c+s-i.top+r.scrollTop,left:e.avoidFrameOffset?u:u+l-i.left+r.scrollLeft,height:e.avoidFrameZoom?a.height:a.height*n,width:e.avoidFrameZoom?a.width:a.width*n,zoom:n,rect:a}},o.prototype.getElementOffsets=function(t){if(!t||(0,_t.ir)(t))return{};var e={},n=window.getComputedStyle(t),o=this.module.getZoomDecimal();return['marginTop','marginRight','marginBottom','marginLeft','paddingTop','paddingRight','paddingBottom','paddingLeft','borderTopWidth','borderRightWidth','borderBottomWidth','borderLeftWidth'].forEach((function(t){e[t]=parseFloat(n[t])*o})),e},o.prototype.getPosition=function(t){var e;void 0===t&&(t={});var n=null===(e=this.frame)||void 0===e?void 0:e.el.contentDocument;if(!n)return{top:0,left:0,width:0,height:0};var o=n.body,r=this.module.getZoomDecimal(),i=this.getFrameOffset(),a=this.getCanvasOffset(),s=t.noScroll;return{top:i.top+(s?0:o.scrollTop)*r-a.top,left:i.left+(s?0:o.scrollLeft)*r-a.left,width:a.width,height:a.height}},o.prototype.updateScript=function(t){var e=t.model,n=e.getId();if(!t.scriptContainer){t.scriptContainer=(0,_t.a_)('div',{'data-id':n});var o=this.getJsContainer();null==o||o.appendChild(t.scriptContainer)}t.el.id=n,t.scriptContainer.innerHTML='';var r=document.createElement('script'),i=e.getScriptString(),a=e.get('script-props')?i:"function(){\n".concat(i,"\n;}"),s=JSON.stringify(e.__getScriptProps());r.innerHTML="\n setTimeout(function() {\n var item = document.getElementById('".concat(n,"');\n if (!item) return;\n var script = (").concat(a,").bind(item);\n script(").concat(s,");\n }, 1);"),setTimeout((function(){var e=t.scriptContainer;null==e||e.appendChild(r)}),0)},o.prototype.getJsContainer=function(t){var e=this.getFrameView(t);return null==e?void 0:e.getJsContainer()},o.prototype.getFrameView=function(t){return(null==t?void 0:t.frameView)||this.em.getCurrentFrame()},o.prototype._renderFrames=function(){if(this.ready){var t=this,e=t.model,n=t.frames,o=t.em,r=t.framesArea,i=e.frames;i.listenToLoad(),n.render();var a=i.at(0),s=null==a?void 0:a.view;o.setCurrentFrame(s),null==r||r.appendChild(n.el),this.frame=s,this.updateFramesArea()}},o.prototype.renderFrames=function(){this._renderFrames()},o.prototype.render=function(){var t=this,n=t.el,o=t.$el,r=t.ppfx,i=t.config,a=t.em;o.html(this.template());var s=o.find('[data-frames]');this.framesArea=s.get(0);var l=o.find('[data-tools]');return this.toolsWrapper=l.get(0),l.append("\n \n \n ")),this.toolsEl=n.querySelector("#".concat(r,"tools")),this.hlEl=n.querySelector(".".concat(r,"highlighter")),this.badgeEl=n.querySelector(".".concat(r,"badge")),this.placerEl=n.querySelector(".".concat(r,"placeholder")),this.ghostEl=n.querySelector(".".concat(r,"ghost")),this.toolbarEl=n.querySelector(".".concat(r,"toolbar")),this.resizerEl=n.querySelector(".".concat(r,"resizer")),this.offsetEl=n.querySelector(".".concat(r,"offset-v")),this.fixedOffsetEl=n.querySelector(".".concat(r,"offset-fixed-v")),this.toolsGlobEl=n.querySelector(".".concat(r,"tools-gl")),this.spotsEl=n.querySelector('[data-spots]'),this.cvStyle=n.querySelector('[data-canvas-style]'),this.el.className=(0,e.getUiClass)(a,this.className),this.ready=!0,this._renderFrames(),this},o}(bt);const mo=yo;var bo=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),_o=void 0&&(void 0).__assign||function(){return _o=Object.assign||function(t){for(var e,n=1,o=arguments.length;ni.top+i.height?i.top+i.height:f,left:d,elementTop:i.top,elementLeft:i.left,elementWidth:i.width,elementHeight:i.height,targetWidth:t.offsetWidth,targetHeight:t.offsetHeight,canvasTop:r.top,canvasLeft:r.left,canvasWidth:r.width,canvasHeight:r.height};return c&&this.em&&this.em.trigger(c,h),h}},o.prototype.canvasRectOffset=function(t,e,n){var o=this;void 0===n&&(n={});var r=function(t,e,r){void 0===e&&(e=1);var i=o.em.getZoomDecimal(),a=e?'top':'left',s=t.ownerDocument,l=n.offset?function(t){var e=t.defaultView;return null==e?void 0:e.frameElement}(s):{},c=l.offsetTop,u=void 0===c?0:c,p=l.offsetLeft,d=void 0===p?0:p,f=s.body||{},h=f.scrollTop,g=void 0===h?0:h,v=f.scrollLeft,y=e?g:void 0===v?0:v,m=e?u:d;return r[a]-(y-m)*i};return{top:r(t,1,e),left:r(t,0,e)}},o.prototype.getTargetToElementFixed=function(e,n,o){void 0===o&&(o={});var r=o.pos||this.getElementPos(e,{noScroll:!0}),i=o.canvasOff||this.canvasRectOffset(e,r),a=n.offsetHeight||0,s=n.offsetWidth||0,l=r.left+r.width,c=this.getCanvasView(),u=c.getPosition(),p=c.getFrameOffset(e),d=o.event,f=-a,h=(0,t.isUndefined)(o.left)?r.width-s:o.left;if(h=r.left<-h?-r.left:h,h=l>u.width?h-(l-u.width):h,i.top\n \n "),fallback:"\n \n "),file:''})},enumerable:!1,configurable:!0}),o.prototype.initToolbar=function(){n.prototype.initToolbar.call(this);var t=this.em;if(t){var e='image-editor';if(t.Commands.has(e)){for(var o=!1,r=this.get('toolbar'),i=0;i=0)&&delete r.editable}))}return r},o}(Wo);const Qo=Zo;var tr=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),er=void 0&&(void 0).__assign||function(){return er=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0},n}(Hn);var Tr=void 0&&(void 0).__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Pr=void 0&&(void 0).__assign||function(){return Pr=Object.assign||function(t){for(var e,n=1,o=arguments.length;n").concat(l).concat(s,"