From 1e3766f0060e6da502fccf9ba9eb938d5ac860bb Mon Sep 17 00:00:00 2001 From: Daniel Starns Date: Wed, 7 Aug 2024 06:10:31 -0700 Subject: [PATCH] refactor: remove dist from src (#6041) --- .github/workflows/build.yml | 1 + .github/workflows/publish.yml | 1 + .gitignore | 1 + dist/css/grapes.min.css | 1 - dist/grapes.min.js | 3 - dist/grapes.min.js.map | 1 - dist/grapes.mjs | 62858 -------------------------------- dist/grapes.mjs.map | 1 - dist/index.d.ts | 12969 ------- 9 files changed, 3 insertions(+), 75833 deletions(-) delete mode 100644 dist/css/grapes.min.css delete mode 100644 dist/grapes.min.js delete mode 100644 dist/grapes.min.js.map delete mode 100644 dist/grapes.mjs delete mode 100644 dist/grapes.mjs.map delete mode 100644 dist/index.d.ts diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d47b6bb4f..9c94c246d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,7 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'yarn' - run: yarn --frozen-lockfile + - run: yarn build - run: npm run lint - run: npm run ts:build:check - run: npm test \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f79bb78b10..07b297225f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,6 +16,7 @@ jobs: registry-url: 'https://registry.npmjs.org' cache: 'yarn' - run: yarn --frozen-lockfile + - run: yarn build - run: npm run lint - run: npm publish env: diff --git a/.gitignore b/.gitignore index 2dc41a6809..052dde3f65 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ bower_components/ grapesjs-*.tgz _index.html docs/.vuepress/dist +dist/ \ No newline at end of file diff --git a/dist/css/grapes.min.css b/dist/css/grapes.min.css deleted file mode 100644 index 7a834c1625..0000000000 --- a/dist/css/grapes.min.css +++ /dev/null @@ -1 +0,0 @@ -.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 .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-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;z-index:0}.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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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+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:rgba(255,255,255,.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:rgba(255,255,255,.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:rgba(255,255,255,.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:rgba(255,255,255,.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:rgba(255,255,255,.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:rgba(255,255,255,.055);border-radius:2px;margin:2px 0;padding:7px;position:relative}.gjs-sm-layer.gjs-sm-active{background-color:rgba(255,255,255,.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:rgba(255,255,255,.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:rgba(255,255,255,.9)}.gjs-clm-tags #gjs-clm-close:hover{opacity:1;filter:alpha(opacity=100)}.gjs-clm-tags #gjs-clm-checkbox{color:rgba(255,255,255,.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/dist/grapes.min.js b/dist/grapes.min.js deleted file mode 100644 index 2b2a7419a5..0000000000 --- a/dist/grapes.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! grapesjs - 0.21.12 */ -!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={410:(t,e,n)=>{var o,r,i;1&&(r=[n(50),n(316)],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(i){var a='object'==typeof self&&self.self===self&&self||'object'==typeof n.g&&n.g.global===n.g&&n.g;if(1)o=[n(50),n(895),e],r=function(t,e,n){a.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),z.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(!z.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 z;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=F.extend=k.extend=z.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}(a,n,t,e)}.apply(e,o),void 0===r||(t.exports=r);else;}()},210:(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),y=/Android/.test(t),m=v||y||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),b=v||/Mac/.test(e),w=/\bCrOS\b/.test(t),_=/win/i.test(e),x=d&&t.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(d=!1,l=!0);var C=b&&(c||d&&(null==x||x<12.11)),S=n||a&&s>=9;function O(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var T,k=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 E(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function P(t,e){return E(t).appendChild(e)}function A(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}}v?I=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(I=function(t){try{t.select()}catch(t){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function U(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 Z=[""];function X(t){for(;Z.length<=t;)Z.push(J(Z)+" ");return Z[t]}function J(t){return t[t.length-1]}function Q(t,e){for(var n=[],o=0;o"€"&&(t.toUpperCase()!=t.toLowerCase()||ot.test(t))}function it(t,e){return e?!!(e.source.indexOf("\\w")>-1&&rt(t))||e.test(t):rt(t)}function at(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var st=/[\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 lt(t){return t.charCodeAt(0)>=768&&st.test(t)}function ct(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 pt(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 dt=null;function ft(t,e,n){var o;dt=null;for(var r=0;re)return r;i.to==e&&(i.from!=i.to&&"before"==n?o=r:dt=r),i.from==e&&(i.from!=i.to&&"before"!=n?o=r:dt=r)}return null!=o?o:dt}var ht=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 wt(t,e){var n=mt(t,e);if(n.length)for(var o=Array.prototype.slice.call(arguments,2),r=0;r0}function St(t){t.prototype.on=function(t,e){yt(this,t,e)},t.prototype.off=function(t,e){bt(this,t,e)}}function Ot(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function Tt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function kt(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Et(t){Ot(t),Tt(t)}function Pt(t){return t.target||t.srcElement}function At(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),b&&t.ctrlKey&&1==e&&(e=3),e}var jt,Mt,Lt=function(){if(a&&s<9)return!1;var t=A('div');return"draggable"in t||"dragDrop"in t}();function Dt(t){if(null==jt){var e=A("span","​");P(t,A("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(jt=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=jt?A("span","​"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Nt(t){if(null!=Mt)return Mt;var e=P(t,document.createTextNode("AخA")),n=T(e,0,1).getBoundingClientRect(),o=T(e,1,2).getBoundingClientRect();return E(t),!(!n||n.left==n.right)&&(Mt=o.right-n.right<3)}var It,Ft=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/)},Vt=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)},Rt="oncopy"in(It=A("div"))||(It.setAttribute("oncopy","return;"),"function"==typeof It.oncopy),Ht=null;function Bt(t){if(null!=Ht)return Ht;var e=P(t,A("span","x")),n=e.getBoundingClientRect(),o=T(e,0,1).getBoundingClientRect();return Ht=Math.abs(n.left-o.left)>1}var zt={},Ut={};function Wt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),zt[t]=e}function $t(t,e){Ut[t]=e}function qt(t){if("string"==typeof t&&Ut.hasOwnProperty(t))t=Ut[t];else if(t&&"string"==typeof t.name&&Ut.hasOwnProperty(t.name)){var e=Ut[t.name];"string"==typeof e&&(e={name:e}),(t=nt(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return qt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return qt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Gt(t,e){e=qt(e);var n=zt[e.name];if(!n)return Gt(t,"text/plain");var o=n(t,e);if(Kt.hasOwnProperty(e.name)){var r=Kt[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 Kt={};function Yt(t,e){H(e,Kt.hasOwnProperty(t)?Kt[t]:Kt[t]={})}function Zt(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 Xt(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 Jt(t,e,n){return!t.startState||t.startState(e,n)}var Qt=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 te(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?le(n,te(t,n).text.length):ve(e,te(t,e.line).text.length)}function ve(t,e){var n=t.ch;return null==n||n>e?le(t.line,e):n<0?le(t.line,0):t}function ye(t,e){for(var n=[],o=0;o=this.string.length},Qt.prototype.sol=function(){return this.pos==this.lineStart},Qt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Qt.prototype.next=function(){if(this.pose},Qt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Qt.prototype.skipToEnd=function(){this.pos=this.string.length},Qt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Qt.prototype.backUp=function(t){this.pos-=t},Qt.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},Qt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Qt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Qt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Qt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var me=function(t,e){this.state=t,this.lookAhead=e},be=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 we(t,e,n,o){var r=[t.state.modeGen],i={};Pe(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,Pe(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&&Zt(t.doc.mode,o.state),i=we(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 xe(t,e,n){var o=t.doc,r=t.display;if(!o.mode.startState)return new be(o,!0,e);var i=Ae(t,e,n),a=i>o.first&&te(o,i-1).stateAfter,s=a?be.fromSaved(o,a,i):new be(o,Jt(o.mode),i);return o.iter(i,e,(function(n){Ce(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.")}be.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},be.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}},be.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},be.fromSaved=function(t,e,n){return e instanceof me?new be(t,Zt(t.mode,e.state),n,e.lookAhead):new be(t,Zt(t.mode,e),n)},be.prototype.save=function(t){var e=!1!==t?Zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new me(e,this.maxLookAhead):e};var Te=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function ke(t,e,n,o){var r,i,a=t.doc,s=a.mode,l=te(a,(e=ge(a,e)).line),c=xe(t,e.line,n),u=new Qt(l.text,t.options.tabSize,c);for(o&&(i=[]);(o||u.post.options.maxHighlightLength?(s=!1,a&&Ce(t,e,o,p.pos),p.pos=e.length,l=null):l=Ee(Oe(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=te(i,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof me?c.lookAhead:0)<=i.modeFrontier))return s;var u=B(l.text,null,t.options.tabSize);(null==r||o>u)&&(r=s-1,o=u)}return r}function je(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;o--){var r=te(t,o).stateAfter;if(r&&(!(r instanceof me)||o+r.lookAhead=e:i.to>e);(o||(o=[])).push(new Ie(a,i.from,s?null:i.to))}}return o}function Be(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=ce(c.from,s.from),d=ce(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 $e(t){var e=t.markedSpans;if(e){for(var n=0;ne)&&(!n||Ye(n,i.marker)<0)&&(n=i.marker)}return n}function tn(t,e,n,o,r){var i=te(t,e),a=Le&&i.markedSpans;if(a)for(var s=0;s=0&&p<=0||u<=0&&p>=0)&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?ce(c.to,n)>=0:ce(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?ce(c.from,o)<=0:ce(c.from,o)<0)))return!0}}}function en(t){for(var e;e=Xe(t);)t=e.find(-1,!0).line;return t}function nn(t){for(var e;e=Je(t);)t=e.find(1,!0).line;return t}function on(t){for(var e,n;e=Je(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function rn(t,e){var n=te(t,e),o=en(n);return n==o?e:re(o)}function an(t,e){if(e>t.lastLine())return e;var n,o=te(t,e);if(!sn(t,o))return e;for(;n=Je(o);)o=n.find(1,!0).line;return re(o)+1}function sn(t,e){var n=Le&&e.markedSpans;if(n)for(var o=void 0,r=0;re.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var dn=function(t,e,n){this.text=t,qe(this,e),this.height=n?n(this):1};function fn(t,e,n,o){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),$e(t),qe(t,n);var r=o?o(t):1;r!=t.height&&oe(t,r)}function hn(t){t.parent=null,$e(t)}dn.prototype.lineNo=function(){return re(this)},St(dn);var gn={},vn={};function yn(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?vn:gn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function mn(t,e){var n=j("span",null,null,l?"padding-right: .1px":null),o={pre:j("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=wn,Nt(t.display.measure)&&(a=gt(i,t.doc.direction))&&(o.addToken=xn(o.addToken,a)),o.map=[],Sn(i,o,_e(t,i,e!=t.display.externalMeasured&&re(i))),i.styleClasses&&(i.styleClasses.bgClass&&(o.bgClass=N(i.styleClasses.bgClass,o.bgClass||"")),i.styleClasses.textClass&&(o.textClass=N(i.styleClasses.textClass,o.textClass||""))),0==o.map.length&&o.map.push(0,0,o.content.appendChild(Dt(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 wt(t,"renderLine",t,e.line,o.pre),o.pre.className&&(o.textClass=N(o.pre.className,o.textClass||"")),o}function bn(t){var e=A("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function wn(t,e,n,o,r,i,l){if(e){var c,u=t.splitSpaces?_n(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(A("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(A("span",X(b),"cm-tab"))).setAttribute("role","presentation"),y.setAttribute("cm-text","\t"),t.col+=b}else"\r"==h[0]||"\n"==h[0]?((y=c.appendChild(A("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(A("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 w=n||"";o&&(w+=o),r&&(w+=r);var _=A("span",[c],w,i);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&_.setAttribute(x,l[x]);return t.content.appendChild(_)}t.content.appendChild(c)}}function _n(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 Cn(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 Sn(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,w=0;wh||x.collapsed&&_.to==h&&_.from==h)){if(null!=_.to&&_.to!=h&&y>_.to&&(y=_.to,c=""),x.className&&(l+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&_.from==h&&(u+=" "+x.startStyle),x.endStyle&&_.to==y&&(b||(b=[])).push(x.endStyle,_.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||Ye(p.marker,x)<0)&&(p=_)}else _.from>h&&y>_.from&&(y=_.from)}if(b)for(var S=0;S=f)break;for(var T=Math.min(f,y);1;){if(v){var k=h+v.length;if(!p){var E=k>T?v.slice(0,T-h):v;e.addToken(e,E,a?a+l:l,u,h+E.length==y?c:"",s,d)}if(k>=T){v=v.slice(T-h),h=T;break}h=k,u=""}v=r.slice(i,i=n[g++]),a=yn(n[g++],e.cm.options)}}else for(var P=1;P2&&i.push((l.bottom+c.top)/2-n.top)}}i.push(n.bottom-n.top)}}function eo(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};if(t.rest){for(var o=0;on)return{map:t.measure.maps[r],cache:t.measure.caches[r],before:!0}}}function no(t,e){var n=re(e=en(e)),o=t.display.externalMeasured=new On(t.doc,e,n);o.lineN=n;var r=o.built=mn(t,o);return o.text=r.pre,P(t.display.lineMeasure,r.pre),o}function oo(t,e,n,o){return ao(t,io(t,e),n,o)}function ro(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 po(t,e,n,o){var r,i=co(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&<(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+Do(t.display),top:h.top,bottom:h.bottom}:lo}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=ft(s,l,c),d=dt,f=u(l,p,"before"==c);return null!=d&&(f.other=u(l,d,"before"!=c)),f}function So(t,e){var n=0;e=ge(t.doc,e),t.options.lineWrapping||(n=Do(t.display)*e.ch);var o=te(t.doc,e.line),r=cn(o)+Kn(t.display);return{left:n,right:n,top:r,bottom:r+o.height}}function Oo(t,e,n,o,r){var i=le(t,e,n);return i.xRel=r,o&&(i.outside=o),i}function To(t,e,n){var o=t.doc;if((n+=t.display.viewOffset)<0)return Oo(o.first,0,null,-1,-1);var r=ie(o,n),i=o.first+o.size-1;if(r>i)return Oo(o.first+o.size-1,te(o,i).text.length,null,1,1);e<0&&(e=0);for(var a=te(o,r);;){var s=Ao(t,a,r,e,n),l=Qe(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=te(o,r=c.line)}}function ko(t,e,n,o){o-=bo(e);var r=e.text.length,i=ut((function(e){return ao(t,n,e-1).bottom<=o}),r,0);return{begin:i,end:r=ut((function(e){return ao(t,n,e).top>o}),i,r)}}function Eo(t,e,n,o){return n||(n=io(t,e)),ko(t,e,n,wo(t,e,ao(t,n,o),"line").top)}function Po(t,e,n,o){return!(t.bottom<=n)&&(t.top>n||(o?t.left:t.right)>e)}function Ao(t,e,n,o,r){r-=cn(e);var i=io(t,e),a=bo(e),s=0,l=e.text.length,c=!0,u=gt(e,t.doc.direction);if(u){var p=(t.options.lineWrapping?Mo:jo)(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=ut((function(e){var n=ao(t,i,e);return n.top+=a,n.bottom+=a,!!Po(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=w.bottom?1:0}return Oo(n,v=ct(e.text,v,1),f,y,o-d)}function jo(t,e,n,o,r,i,a){var s=ut((function(s){var l=r[s],c=1!=l.level;return Po(Co(t,le(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=Co(t,le(n,c?l.from:l.to,c?"after":"before"),"line",e,o);Po(u,i,a,!0)&&u.top>a&&(l=r[s-1])}return l}function Mo(t,e,n,o,r,i,a){var s=ko(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=ao(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 Lo(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==so){so=A("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)so.appendChild(document.createTextNode("x")),so.appendChild(A("br"));so.appendChild(document.createTextNode("x"))}P(t.measure,so);var n=so.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),E(t.measure),n||1}function Do(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=A("span","xxxxxxxxxx"),n=A("pre",[e],"CodeMirror-line-like");P(t.measure,n);var o=e.getBoundingClientRect(),r=(o.right-o.left)/10;return r>2&&(t.cachedCharWidth=r),r||10}function No(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:Io(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:o,wrapperWidth:e.wrapper.clientWidth}}function Io(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Fo(t){var e=Lo(t.display),n=t.options.lineWrapping,o=n&&Math.max(5,t.display.scroller.clientWidth/Do(t.display)-3);return function(r){if(sn(t.doc,r))return 0;var i=0;if(r.widgets)for(var a=0;a0&&(l=te(t.doc,c.line).text).length==c.ch){var u=B(l,l.length,t.options.tabSize)-l.length;c=le(c.line,Math.max(0,Math.round((i-Zn(t.display).left)/Do(t.display))-u))}return c}function Ho(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)Le&&rn(t.doc,e)r.viewFrom?Uo(t):(r.viewFrom+=o,r.viewTo+=o);else if(e<=r.viewFrom&&n>=r.viewTo)Uo(t);else if(e<=r.viewFrom){var i=Wo(t,n,n+o,1);i?(r.view=r.view.slice(i.index),r.viewFrom=i.lineN,r.viewTo+=o):Uo(t)}else if(n>=r.viewTo){var a=Wo(t,e,e,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):Uo(t)}else{var s=Wo(t,e,e,-1),l=Wo(t,n,n+o,1);s&&l?(r.view=r.view.slice(0,s.index).concat(Tn(t,s.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=o):Uo(t)}var c=r.externalMeasured;c&&(n=r.lineN&&e=o.viewTo)){var i=o.view[Ho(t,e)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==U(a,n)&&a.push(n)}}}function Uo(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function Wo(t,e,n,o){var r,i=Ho(t,e),a=t.display.view;if(!Le||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(;rn(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 $o(t,e,n){var o=t.display;0==o.view.length||e>=o.viewTo||n<=o.viewFrom?(o.view=Tn(t,e,n),o.viewFrom=e):(o.viewFrom>e?o.view=Tn(t,e,o.viewFrom).concat(o.view):o.viewFromn&&(o.view=o.view.slice(0,Ho(t,n)))),o.viewTo=n}function qo(t){for(var e=t.display.view,n=0,o=0;o=t.display.viewTo||l.to().line0?a:t.defaultCharWidth())+"px"}if(o.other){var s=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=o.other.left+"px",s.style.top=o.other.top+"px",s.style.height=.85*(o.other.bottom-o.other.top)+"px"}}function Zo(t,e){return t.top-e.top||t.left-e.left}function Xo(t,e,n){var o=t.display,r=t.doc,i=document.createDocumentFragment(),a=Zn(t.display),s=a.left,l=Math.max(o.sizerWidth,Jn(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(A("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=te(r,e),d=p.text.length;function f(n,o){return xo(t,le(e,n),"div",p,o)}function h(e,n,o){var r=Eo(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=gt(p,r.direction);return pt(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,w=null==o&&e==d,_=0==p,x=!g||p==g.length-1;if(m.top-y.top<=3){var C=(c?w:b)&&x,S=(c?b:w)&&_?s:(v?y:m).left,O=C?l:(v?m:y).right;u(S,y.top,O-S,y.bottom)}else{var T,k,E,P;v?(T=c&&b&&_?s:y.left,k=c?l:h(t,r,"before"),E=c?s:h(e,r,"after"),P=c&&w&&x?l:m.right):(T=c?h(t,r,"before"):s,k=!c&&b&&_?l:y.right,E=!c&&w&&x?s:m.left,P=c?h(e,r,"after"):l),u(T,y.top,k-T,y.bottom),y.bottom0?e.blinker=setInterval((function(){t.hasFocus()||nr(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Qo(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||er(t))}function tr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&nr(t))}),100)}function er(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(wt(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()),Jo(t))}function nr(t,e){t.state.delayingBlurEvent||(t.state.focused&&(wt(t,"blur",t,e),t.state.focused=!1,k(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function or(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/Do(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 rr(t){if(t.widgets)for(var e=0;e=a&&(i=ie(e,cn(te(e,l))-t.wrapper.clientHeight),a=l)}return{from:i,to:Math.max(a,i+1)}}function ar(t,e){if(!_t(t,"scrollCursorIntoView")){var n=t.display,o=n.sizer.getBoundingClientRect(),r=null,i=n.wrapper.ownerDocument;if(e.top+o.top<0?r=!0:e.bottom+o.top>(i.defaultView.innerHeight||i.documentElement.clientHeight)&&(r=!1),null!=r&&!g){var a=A("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-Kn(t.display))+"px;\n height: "+(e.bottom-e.top+Xn(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(a),a.scrollIntoView(r),t.display.lineSpace.removeChild(a)}}}function sr(t,e,n,o){var r;null==o&&(o=0),t.options.lineWrapping||e!=n||(n="before"==e.sticky?le(e.line,e.ch+1,"before"):e,e=e.ch?le(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e);for(var i=0;i<5;i++){var a=!1,s=Co(t,e),l=n&&n!=e?Co(t,n):s,c=cr(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&&(vr(t,c.scrollTop),Math.abs(t.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(mr(t,c.scrollLeft),Math.abs(t.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return r}function lr(t,e){var n=cr(t,e);null!=n.scrollTop&&vr(t,n.scrollTop),null!=n.scrollLeft&&mr(t,n.scrollLeft)}function cr(t,e){var n=t.display,o=Lo(t.display);e.top<0&&(e.top=0);var r=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,i=Qn(t),a={};e.bottom-e.top>i&&(e.bottom=e.top+i);var s=t.doc.height+Yn(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=Jn(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 ur(t,e){null!=e&&(hr(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function pr(t){hr(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function dr(t,e,n){null==e&&null==n||hr(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function fr(t,e){hr(t),t.curOp.scrollToPos=e}function hr(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,gr(t,So(t,e.from),So(t,e.to),e.margin))}function gr(t,e,n,o){var r=cr(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});dr(t,r.scrollLeft,r.scrollTop)}function vr(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Gr(t,{top:e}),yr(t,e,!0),n&&Gr(t),Rr(t,100))}function yr(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 mr(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,Xr(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function br(t){var e=t.display,n=e.gutters.offsetWidth,o=Math.round(t.doc.height+Yn(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+Xn(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var wr=function(t,e,n){this.cm=n;var o=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");o.tabIndex=r.tabIndex=-1,t(o),t(r),yt(o,"scroll",(function(){o.clientHeight&&e(o.scrollTop,"vertical")})),yt(r,"scroll",(function(){r.clientWidth&&e(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};wr.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.scrollTop=0,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}},wr.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},wr.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},wr.prototype.zeroWidthHack=function(){var t=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new z,this.disableVert=new z},wr.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.visibility="hidden":e.set(1e3,o)}t.style.visibility="",e.set(1e3,o)},wr.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var _r=function(){};function xr(t,e){e||(e=br(t));var n=t.display.barWidth,o=t.display.barHeight;Cr(t,e);for(var r=0;r<4&&n!=t.display.barWidth||o!=t.display.barHeight;r++)n!=t.display.barWidth&&t.options.lineWrapping&&or(t),Cr(t,br(t)),n=t.display.barWidth,o=t.display.barHeight}function Cr(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=""}_r.prototype.update=function(){return{bottom:0,right:0}},_r.prototype.setScrollLeft=function(){},_r.prototype.setScrollTop=function(){},_r.prototype.clear=function(){};var Sr={native:wr,null:_r};function Or(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&k(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new Sr[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),yt(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?mr(t,e):vr(t,e)}),t),t.display.scrollbars.addClass&&D(t.display.wrapper,t.display.scrollbars.addClass)}var Tr=0;function kr(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:++Tr,markArrays:null},En(t.curOp)}function Er(t){var e=t.curOp;e&&An(e,(function(t){for(var e=0;e=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new Br(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function jr(t){t.updatedDisplay=t.mustUpdate&&$r(t.cm,t.update)}function Mr(t){var e=t.cm,n=e.display;t.updatedDisplay&&or(e),t.barMeasure=br(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=oo(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+Xn(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Jn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Lr(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=xe(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?Zt(e.mode,o.state):null,l=we(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 Rr(t,t.options.workDelay),!0})),e.highlightFrontier=o.line,e.modeFrontier=Math.max(e.modeFrontier,o.line),r.length&&Nr(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==qo(t))return!1;Jr(t)&&(Uo(t),e.dims=No(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)),Le&&(i=rn(t.doc,i),a=an(t.doc,a));var s=i!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;$o(t,i,a),n.viewOffset=cn(te(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=qo(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Ur(t);return l>4&&(n.lineDiv.style.display="none"),Kr(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Wr(c),E(n.cursorDiv),E(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,Rr(t,400)),n.updateLineNumbers=null,!0}function qr(t,e){for(var n=e.viewport,o=!0;;o=!1){if(o&&t.options.lineWrapping&&e.oldDisplayWidth!=Jn(t))o&&(e.visible=ir(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Yn(t.display)-Qn(t),n.top)}),e.visible=ir(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!$r(t,e))break;or(t);var r=br(t);Go(t),xr(t,r),Zr(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 Gr(t,e){var n=new Br(t,e);if($r(t,n)){or(t),qr(t,n);var o=br(t);Go(t),xr(t,o),Zr(t,o),n.finish()}}function Kr(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&&b&&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),Dn(t,d,u,n)),f&&(E(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(se(t.options,u)))),a=d.node.nextSibling}else{var h=zn(t,d,u,n);i.insertBefore(h,a)}u+=d.size}for(;a;)a=s(a)}function Yr(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px",Mn(t,"gutterChanged",t)}function Zr(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+Xn(t)+"px"}function Xr(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var o=Io(e)-e.scroller.scrollLeft+t.doc.scrollLeft,r=e.gutters.offsetWidth,i=o+"px",a=0;a=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute('translate','no'),a&&s<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),l||n&&m||(i.scroller.draggable=!0),t&&(t.appendChild?t.appendChild(i.wrapper):t(i.wrapper)),i.viewFrom=i.viewTo=e.first,i.reportedViewFrom=i.reportedViewTo=e.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Qr(r.gutters,r.lineNumbers),ti(i),o.init(i)}Br.prototype.signal=function(t,e){Ct(t,e)&&this.events.push(arguments)},Br.prototype.finish=function(){for(var t=0;tc.clientWidth,h=c.scrollHeight>c.clientHeight;if(r&&f||i&&h){if(i&&b&&l)t:for(var g=e.target,v=s.view;g!=c;g=g.parentNode)for(var y=0;y=0&&ce(t,o.to())<=0)return n}return-1};var ci=function(t,e){this.anchor=t,this.head=e};function ui(t,e,n){var o=t&&t.options.selectionsMayTouch,r=e[n];e.sort((function(t,e){return ce(t.from(),e.from())})),n=U(e,r);for(var i=1;i0:l>=0){var c=fe(s.from(),a.from()),u=de(s.to(),a.to()),p=s.empty()?a.from()==a.head:s.from()==s.head;i<=n&&--n,e.splice(--i,2,new ci(p?u:c,p?c:u))}}return new li(e,n)}function pi(t,e){return new li([new ci(t,e||t)],0)}function di(t){return t.text?le(t.from.line+t.text.length-1,J(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function fi(t,e){if(ce(t,e.from)<0)return t;if(ce(t,e.to)<=0)return di(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+=di(e).ch-e.to.ch),le(n,o)}function hi(t,e){for(var n=[],o=0;o1&&t.remove(s.line+1,h-1),t.insert(s.line+1,y)}Mn(t,"change",t,e)}function _i(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(),J(t.done)):void 0}function Pi(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=Ei(r,r.lastOp==o)))a=J(i.changes),0==ce(e.from,e.to)&&0==ce(e.from,a.to)?a.to=di(e):i.changes.push(Ti(t,e));else{var l=J(r.done);for(l&&l.ranges||Mi(t.sel,r.done),i={changes:[Ti(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||wt(t,"historyAdded")}function Ai(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 ji(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||Ai(t,i,J(r.done),e))?r.done[r.done.length-1]=e:Mi(e,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=i,r.lastSelOp=n,o&&!1!==o.clearRedo&&ki(r.undone)}function Mi(t,e){var n=J(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Li(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 Di(t){if(!t)return null;for(var e,n=0;n-1&&(J(s)[p]=c[p],delete c[p])}}}return o}function Vi(t,e,n,o){if(o){var r=t.anchor;if(n){var i=ce(e,r)<0;i!=ce(n,r)<0?(r=e,e=n):i!=ce(e,n)<0&&(e=n)}return new ci(r,e)}return new ci(n||e,e)}function Ri(t,e,n,o,r){null==r&&(r=t.cm&&(t.cm.display.shift||t.extend)),$i(t,new li([Vi(t.sel.primary(),e,n,r)],0),o)}function Hi(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&&(wt(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=Ji(t,p,-o,p&&p.line==e.line?i:null)),p&&p.line==e.line&&(d=ce(p,n))&&(o<0?d<0:d>0))return Zi(t,p,e,o,r)}var f=l.find(o<0?-1:1);return(o<0?c:u)&&(f=Ji(t,f,o,f.line==e.line?i:null)),f?Zi(t,f,e,o,r):null}}return e}function Xi(t,e,n,o,r){var i=o||1,a=Zi(t,e,n,i,r)||!r&&Zi(t,e,n,i,!0)||Zi(t,e,n,-i,r)||!r&&Zi(t,e,n,-i,!0);return a||(t.cantEdit=!0,le(t.first,0))}function Ji(t,e,n,o){return n<0&&0==e.ch?e.line>t.first?ge(t,le(e.line-1)):null:n>0&&e.ch==(o||te(t,e.line)).text.length?e.line=0;--r)na(t,{from:o[r].from,to:o[r].to,text:r?[""]:e.text,origin:e.origin});else na(t,e)}}function na(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ce(e.from,e.to)){var n=hi(t,e);Pi(t,e,n,t.cm?t.cm.curOp.id:NaN),ia(t,e,n,ze(t,e));var o=[];_i(t,(function(t,n){n||-1!=U(o,t.history)||(ua(t.history,e),o.push(t.history)),ia(t,e,null,ze(t,e))}))}}function oa(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 ra(t,e){if(0!=e&&(t.first+=e,t.sel=new li(Q(t.sel.ranges,(function(t){return new ci(le(t.anchor.line+e,t.anchor.ch),le(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){Bo(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:le(i,te(t,i).text.length),text:[e.text[0]],origin:e.origin}),e.removed=ee(t,e.from,e.to),n||(n=hi(t,e)),t.cm?aa(t.cm,e,o):wi(t,e,o),qi(t,n,q),t.cantEdit&&Xi(t,le(t.firstLine(),0))&&(t.cantEdit=!1)}}function aa(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=re(en(te(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&&xt(t),wi(o,e,n,Fo(t)),t.options.lineWrapping||(o.iter(l,i.line+e.text.length,(function(t){var e=un(t);e>r.maxLineLength&&(r.maxLine=t,r.maxLineLength=e,r.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),je(o,i.line),Rr(t,400);var c=e.text.length-(a.line-i.line)-1;e.full?Bo(t):i.line!=a.line||1!=e.text.length||bi(t.doc,e)?Bo(t,i.line,a.line+1,c):zo(t,i.line,"text");var u=Ct(t,"changes"),p=Ct(t,"change");if(p||u){var d={from:i,to:a,text:e.text,removed:e.removed,origin:e.origin};p&&Mn(t,"change",t,d),u&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(d)}t.display.selForContextMenu=null}function sa(t,e,n,o,r){var i;o||(o=n),ce(o,n)<0&&(n=(i=[o,n])[0],o=i[1]),"string"==typeof e&&(e=t.splitLines(e)),ea(t,{from:n,to:o,text:e,origin:r})}function la(t,e,n,o){n1||!(this.children[0]instanceof da))){var s=[];this.collapse(s),this.children=[new da(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=j("span",[i.replacedWith],"CodeMirror-widget"),o.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),o.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(tn(t,e.line,e,n,i)||e.line!=n.line&&tn(t,n.line,e,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ne()}i.addToHistory&&Pi(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&&en(o)==c.display.maxLine&&(s=!0),i.collapsed&&l!=e.line&&oe(o,0),Re(o,new Ie(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){sn(t,e)&&oe(e,0)})),i.clearOnEnter&&yt(i,"beforeCursorEnter",(function(){return i.clear()})),i.readOnly&&(De(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),i.collapsed&&(i.id=++ya,i.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),i.collapsed)Bo(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++)zo(c,u,"text");i.atomic&&Ki(c.doc),Mn(c,"markerAdded",c,i)}return i}ma.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&kr(t),Ct(this,"clear")){var n=this.find();n&&Mn(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&&Bo(t,o,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Ki(t.doc)),t&&Mn(t,"markerCleared",t,this,o,r),e&&Er(t),this.parent&&this.parent.clear()}},ma.prototype.find=function(t,e){var n,o;null==t&&"bookmark"==this.type&&(t=1);for(var r=0;r=0;l--)ea(this,o[l]);s?Wi(this,s):this.cm&&pr(this.cm)})),undo:Vr((function(){oa(this,"undo")})),redo:Vr((function(){oa(this,"redo")})),undoSelection:Vr((function(){oa(this,"undo",!0)})),redoSelection:Vr((function(){oa(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=ge(this,t),e=ge(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})),ge(this,le(n,e))},indexFromPos:function(t){var e=(t=ge(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()),qi(e.doc,pi(n,n)),d)for(var f=0;f=0;e--)sa(t.doc,"",o[e].from,o[e].to,"+delete");pr(t)}))}function Za(t,e,n){var o=ct(t.text,e+n,n);return o<0||o>t.text.length?null:o}function Xa(t,e,n){var o=Za(t,e.ch,n);return null==o?null:new le(e.line,o,n<0?"after":"before")}function Ja(t,e,n,o,r){if(t){"rtl"==e.doc.direction&&(r=-r);var i=gt(n,e.doc.direction);if(i){var a,s=r<0?J(i):i[0],l=r<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var c=io(e,n);a=r<0?n.text.length-1:0;var u=ao(e,c,a).top;a=ut((function(t){return ao(e,c,t).top==u}),r<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Za(n,a,1))}else a=r<0?s.to:s.from;return new le(o,a,l)}}return new le(o,r<0?n.text.length:0,r<0?"before":"after")}function Qa(t,e,n,o){var r=gt(e,t.doc.direction);if(!r)return Xa(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=ft(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 le(n.line,d,f)}}var h=function(t,e,o){for(var i=function(t,e){return e?new le(n.line,l(t,1),"before"):new le(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}Ba.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"},Ba.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"},Ba.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"},Ba.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"]},Ba["default"]=b?Ba.macDefault:Ba.pcDefault;var ts={selectAll:Qi,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),q)},killLine:function(t){return Ya(t,(function(e){if(e.empty()){var n=te(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)r=new le(r.line,r.ch+1),t.replaceRange(i.charAt(r.ch-1)+i.charAt(r.ch-2),le(r.line,r.ch-2),r,"+transpose");else if(r.line>t.doc.first){var a=te(t.doc,r.line-1).text;a&&(r=new le(r.line,1),t.replaceRange(i.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),le(r.line-1,a.length-1),r,"+transpose"))}n.push(new ci(r,r))}t.setSelections(n)}))},newlineAndIndent:function(t){return Nr(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&&(ce((r=s.ranges[r]).from(),e)<0||e.xRel>0)&&(ce(r.to(),e)>0||e.xRel<0)?Os(t,o,e,i):ks(t,o,e,i)}function Os(t,e,n,o){var r=t.display,i=!1,c=Ir(t,(function(e){l&&(r.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:tr(t)),bt(r.wrapper.ownerDocument,"mouseup",c),bt(r.wrapper.ownerDocument,"mousemove",u),bt(r.scroller,"dragstart",p),bt(r.scroller,"drop",c),i||(Ot(e),o.addNew||Ri(t.doc,n,null,null,o.extend),l&&!f||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,yt(r.wrapper.ownerDocument,"mouseup",c),yt(r.wrapper.ownerDocument,"mousemove",u),yt(r.scroller,"dragstart",p),yt(r.scroller,"drop",c),t.state.delayingBlurEvent=!0,setTimeout((function(){return r.input.focus()}),20),r.scroller.dragDrop&&r.scroller.dragDrop()}function Ts(t,e,n){if("char"==n)return new ci(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new ci(le(e.line,0),ge(t.doc,le(e.line+1,0)));var o=n(t,e);return new ci(o.from,o.to)}function ks(t,e,n,o){a&&tr(t);var r=t.display,i=t.doc;Ot(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 ci(n,n)):(s=i.sel.primary(),l=i.sel.primIndex),"rectangle"==o.unit)o.addNew||(s=new ci(n,n)),n=Ro(t,e,!0,!0),l=-1;else{var p=Ts(t,n,o.unit);s=o.extend?Vi(s,p.anchor,p.head,o.extend):p}o.addNew?-1==l?(l=u.length,$i(i,ui(t,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==o.unit&&!o.extend?($i(i,ui(t,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=i.sel):Bi(i,l,s,G):(l=0,$i(i,new li([s],0),G),c=i.sel);var d=n;function f(e){if(0!=ce(d,e))if(d=e,"rectangle"==o.unit){for(var r=[],a=t.options.tabSize,u=B(te(i,n.line).text,n.ch,a),p=B(te(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=te(i,g).text,m=Y(y,f,a);f==h?r.push(new ci(le(g,m),le(g,m))):y.length>m&&r.push(new ci(le(g,m),le(g,Y(y,h,a))))}r.length||r.push(new ci(n,n)),$i(i,ui(t,c.ranges.slice(0,l).concat(r),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,w=s,_=Ts(t,e,o.unit),x=w.anchor;ce(_.anchor,x)>0?(b=_.head,x=fe(w.from(),_.anchor)):(b=_.anchor,x=de(w.to(),_.head));var C=c.ranges.slice(0);C[l]=Es(t,new ci(ge(i,x),b)),$i(i,ui(t,C,l),G)}}var h=r.wrapper.getBoundingClientRect(),g=0;function v(e){var n=++g,a=Ro(t,e,!0,"rectangle"==o.unit);if(a)if(0!=ce(a,d)){t.curOp.focus=L(F(t)),f(a);var s=ir(r,i);(a.line>=s.to||a.lineh.bottom?20:0;l&&setTimeout(Ir(t,(function(){g==n&&(r.scroller.scrollTop+=l,v(e))})),50)}}function y(e){t.state.selectingText=!1,g=1/0,e&&(Ot(e),r.input.focus()),bt(r.wrapper.ownerDocument,"mousemove",m),bt(r.wrapper.ownerDocument,"mouseup",b),i.history.lastSelOrigin=null}var m=Ir(t,(function(t){0!==t.buttons&&At(t)?v(t):y(t)})),b=Ir(t,y);t.state.selectingText=b,yt(r.wrapper.ownerDocument,"mousemove",m),yt(r.wrapper.ownerDocument,"mouseup",b)}function Es(t,e){var n=e.anchor,o=e.head,r=te(t.doc,n.line);if(0==ce(n,o)&&n.sticky==o.sticky)return e;var i=gt(r);if(!i)return e;var a=ft(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=ft(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 ci(new le(n.line,h,g),o)}function Ps(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&&Ot(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!Ct(t,n))return kt(e);i-=s.top-a.viewOffset;for(var l=0;l=r)return wt(t,n,t,ie(t.doc,i),t.display.gutterSpecs[l].className,e),kt(e)}}function As(t,e){return Ps(t,e,"gutterClick",!0)}function js(t,e){Gn(t.display,e)||Ms(t,e)||_t(t,e,"contextmenu")||S||t.display.input.onContextMenu(e)}function Ms(t,e){return!!Ct(t,"gutterContextMenu")&&Ps(t,e,"gutterContextMenu",!1)}function Ls(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vo(t)}bs.prototype.compare=function(t,e,n){return this.time+ms>t&&0==ce(e,this.pos)&&n==this.button};var Ds={toString:function(){return"CodeMirror.Init"}},Ns={},Is={};function Fs(t){var e=t.optionHandlers;function n(n,o,r,i){t.defaults[n]=o,r&&(e[n]=i?function(t,e,n){n!=Ds&&r(t,e,n)}:r)}t.defineOption=n,t.Init=Ds,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,yi(t)}),!0),n("indentUnit",2,yi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){mi(t),vo(t),Bo(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(le(o,i))}o++}));for(var r=n.length-1;r>=0;r--)sa(t.doc,e,n[r],le(n[r].line,n[r].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=Ds&&t.refresh()})),n("specialCharPlaceholder",bn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",m?"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){Ls(t),ei(t)}),!0),n("keyMap","default",(function(t,e,n){var o=Ka(e),r=n!=Ds&&Ka(n);r&&r.detach&&r.detach(t,o),o.attach&&o.attach(t,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Rs,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=Qr(e,t.options.lineNumbers),ei(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Io(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return xr(t)}),!0),n("scrollbarStyle","native",(function(t){Or(t),xr(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=Qr(t.options.gutters,e),ei(t)}),!0),n("firstLineNumber",1,ei,!0),n("lineNumberFormatter",(function(t){return t}),ei,!0),n("showCursorWhenSelecting",!1,Go,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(nr(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,Vs),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Go,!0),n("singleCursorHeightPerLine",!0,Go,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,mi,!0),n("addModeClass",!1,mi,!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,mi,!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 Vs(t,e,n){if(!e!=!(n&&n!=Ds)){var o=t.display.dragFunctions,r=e?yt:bt;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 Rs(t){t.options.lineWrapping?(D(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(k(t.display.wrapper,"CodeMirror-wrap"),pn(t)),Vo(t),Bo(t),vo(t),setTimeout((function(){return xr(t)}),100)}function Hs(t,e){var n=this;if(!(this instanceof Hs))return new Hs(t,e);this.options=e=e?H(e):{},H(Ns,e,!1);var o=e.value;"string"==typeof o?o=new Ta(o,e.mode,null,e.lineSeparator,e.direction):e.mode&&(o.modeOption=e.mode),this.doc=o;var r=new Hs.inputStyles[e.inputStyle](this),i=this.display=new ni(t,o,r,e);for(var c in i.wrapper.CodeMirror=this,Ls(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Or(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 z,keySeq:null,specialChars:null},e.autofocus&&!m&&i.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Bs(this),Da(),kr(this),this.curOp.forceUpdate=!0,xi(this,o),e.autofocus&&!m||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&er(n)}),20):nr(this),Is)Is.hasOwnProperty(c)&&Is[c](this,e[c],Ds);Jr(this),e.finishInit&&e.finishInit(this);for(var u=0;u20*20}yt(e.scroller,"touchstart",(function(r){if(!_t(t,r)&&!i(r)&&!As(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)}})),yt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),yt(e.scroller,"touchend",(function(n){var o=e.activeTouch;if(o&&!Gn(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 ci(a,a):!o.prev.prev||l(o,o.prev.prev)?t.findWordAt(a):new ci(le(a.line,0),ge(t.doc,le(a.line+1,0))),t.setSelection(i.anchor,i.head),t.focus(),Ot(n)}r()})),yt(e.scroller,"touchcancel",r),yt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(vr(t,e.scroller.scrollTop),mr(t,e.scroller.scrollLeft,!0),wt(t,"scroll",t))})),yt(e.scroller,"mousewheel",(function(e){return si(t,e)})),yt(e.scroller,"DOMMouseScroll",(function(e){return si(t,e)})),yt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){_t(t,e)||Et(e)},over:function(e){_t(t,e)||(Aa(t,e),Et(e))},start:function(e){return Pa(t,e)},drop:Ir(t,Ea),leave:function(e){_t(t,e)||ja(t)}};var c=e.input.getField();yt(c,"keyup",(function(e){return hs.call(t,e)})),yt(c,"keydown",Ir(t,ds)),yt(c,"keypress",Ir(t,gs)),yt(c,"focus",(function(e){return er(t,e)})),yt(c,"blur",(function(e){return nr(t,e)}))}Hs.defaults=Ns,Hs.optionHandlers=Is;var zs=[];function Us(t,e,n,o){var r,i=t.doc;null==n&&(n="add"),"smart"==n&&(i.mode.indent?r=xe(t,e).state:n="prev");var a=t.options.tabSize,s=te(i,e),l=B(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))==$||c>150)){if(!o)return;n="prev"}}else c=0,n="not";"prev"==n?c=e>i.first?B(te(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=Ft(e),c=null;if(s&&o.ranges.length>1)if(Ws&&Ws.text.join("\n")==e){if(o.ranges.length%Ws.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=le(h.line,h.ch-n):t.state.overwrite&&!s?g=le(g.line,Math.min(te(i,g.line).text.length,g.ch+J(l).length)):s&&Ws&&Ws.lineWise&&Ws.text.join("\n")==l.join("\n")&&(h=g=le(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")};ea(t.doc,v),Mn(t,"inputRead",t,v)}e&&!s&&Ks(t,e),pr(t),t.curOp.updateInput<2&&(t.curOp.updateInput=p),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Gs(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||!e.hasFocus()||Nr(e,(function(){return qs(e,n,0,null,"paste")})),!0}function Ks(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=Us(t,r.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(te(t.doc,r.head.line).text.slice(0,r.head.ch))&&(a=Us(t,r.head.line,"smart"));a&&Mn(t,"electricInput",t,r.head.line)}}}function Ys(t){for(var e=[],n=[],o=0;on&&(Us(this,r.head.line,t,!0),n=r.head.line,o==this.doc.sel.primIndex&&pr(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&&Bi(this.doc,o,new ci(i,c[o].to()),q)}}})),getTokenAt:function(t,e){return ke(this,t,e)},getLineTokens:function(t,e){return ke(this,le(t),e,!0)},getTokenTypeAt:function(t){t=ge(this.doc,t);var e,n=_e(this,te(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=te(this.doc,t)}else o=t;return wo(this,o,{top:0,left:0},e||"page",n||r).top+(r?this.doc.height-cn(o):0)},defaultTextHeight:function(){return Lo(this.display)},defaultCharWidth:function(){return Do(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=Co(this,ge(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&&lr(this,{left:s,top:a,right:s+e.offsetWidth,bottom:a+e.offsetHeight})},triggerOnKeyDown:Fr(ds),triggerOnKeyPress:Fr(gs),triggerOnKeyUp:hs,triggerOnMouseDown:Fr(_s),execCommand:function(t){if(ts.hasOwnProperty(t))return ts[t].call(null,this)},triggerElectric:Fr((function(t){Ks(this,t)})),findPosH:function(t,e,n,o){var r=1;e<0&&(r=-1,e=-e);for(var i=ge(this.doc,t),a=0;a0&&a(e.charAt(n-1));)--n;for(;o.5||this.options.lineWrapping)&&Vo(this),wt(this,"refresh",this)})),swapDoc:Fr((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),xi(this,t),vo(this),this.display.input.reset(),dr(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,Mn(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}},St(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 Qs(t,e,n,o,r){var i=e,a=n,s=te(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 le(n,e.ch,e.sticky),s=te(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 le(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(p?2:1))),-n)}}else a=r?Qa(t.cm,s,e,n):Xa(s,e,n);if(null==a){if(i||!c())return!1;e=Ja(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=it(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=Xi(t,e,i,a,!0);return ue(i,y)&&(y.hitSide=!0),y}function tl(t,e,n,o){var r,i,a=t.doc,s=e.left;if("page"==o){var l=Math.min(t.display.wrapper.clientHeight,V(t).innerHeight||a(t).documentElement.clientHeight),c=Math.max(l-.5*Lo(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=To(t,s,r)).outside;){if(n<0?r<=0:r>=a.height){i.hitSide=!0;break}r+=5*n}return i}var el=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function nl(t,e){var n=ro(t,e.line);if(!n||n.hidden)return null;var o=te(t.doc,e.line),r=eo(n,o,e.line),i=gt(o,t.doc.direction),a="left";i&&(a=ft(i,e.ch)%2?"right":"left");var s=co(r.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function ol(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function rl(t,e){return e&&(t.bad=!0),t}function il(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(le(o,0),le(r+1,0),c(+f));return void(h.length&&(i=h[0].find(0))&&p(ee(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&&nl(e,r)||{node:l[0].measure.map[2],offset:0},u=i.lineo.firstLine()&&(a=le(a.line-1,te(o.doc,a.line-1).length)),s.ch==te(o.doc,s.line).text.length&&s.liner.viewTo-1)return!1;a.line==r.viewFrom||0==(t=Ho(o,a.line))?(e=re(r.view[0].line),n=r.view[0].node):(e=re(r.view[t].line),n=r.view[t-1].node.nextSibling);var l,c,u=Ho(o,s.line);if(u==r.view.length-1?(l=r.viewTo-1,c=r.lineDiv.lastChild):(l=re(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;for(var p=o.doc.splitLines(il(o,n,c,e,l)),d=ee(o.doc,le(e,0),le(l,te(o.doc,l).text.length));p.length>1&&d.length>1;)if(J(p)==J(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 _=le(e,f),x=le(l,d.length?J(d).length-h:0);return p.length>1||p[0]||ce(_,x)?(sa(o.doc,p,_,x,"+input"),!0):void 0},el.prototype.ensurePolled=function(){this.forceCompositionEnd()},el.prototype.reset=function(){this.forceCompositionEnd()},el.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},el.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))},el.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Nr(this.cm,(function(){return Bo(t.cm)}))},el.prototype.setUneditable=function(t){t.contentEditable="false"},el.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Ir(this.cm,qs)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},el.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},el.prototype.onContextMenu=function(){},el.prototype.resetPosition=function(){},el.prototype.needsContentAttribute=!0;var ll=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null,this.resetting=!1};function cl(t,e){if((e=e?H(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=L(t.ownerDocument);e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function o(){t.value=s.getValue()}var r;if(t.form&&(yt(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&&(bt(t.form,"submit",o),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=r))}},t.style.display="none";var s=Hs((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s}function ul(t){t.off=bt,t.on=yt,t.wheelEventPixels=ai,t.Doc=Ta,t.splitLines=Ft,t.countColumn=B,t.findColumn=Y,t.isWordChar=rt,t.Pass=$,t.signal=wt,t.Line=dn,t.changeEnd=di,t.scrollbarModel=Sr,t.Pos=le,t.cmpPos=ce,t.modes=zt,t.mimeModes=Ut,t.resolveMode=qt,t.getMode=Gt,t.modeExtensions=Kt,t.extendMode=Yt,t.copyState=Zt,t.startState=Jt,t.innerMode=Xt,t.commands=ts,t.keyMap=Ba,t.keyName=Ga,t.isModifierKey=$a,t.lookupKey=Wa,t.normalizeKeyMap=Ua,t.StringStream=Qt,t.SharedTextMarker=wa,t.TextMarker=ma,t.LineWidget=ha,t.e_preventDefault=Ot,t.e_stopPropagation=Tt,t.e_stop=Et,t.addClass=D,t.contains=M,t.rmClass=k,t.keyNames=Fa}ll.prototype.init=function(t){var e=this,n=this,o=this.cm;this.createField(t);var r=this.textarea;function i(t){if(!_t(o,t)){if(o.somethingSelected())$s({lineWise:!1,text:o.getSelections()});else{if(!o.options.lineWiseCopyCut)return;var e=Ys(o);$s({lineWise:!0,text:e.text}),"cut"==t.type?o.setSelections(e.ranges,null,q):(n.prevInput="",r.value=e.text.join("\n"),I(r))}"cut"==t.type&&(o.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),v&&(r.style.width="0px"),yt(r,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),yt(r,"paste",(function(t){_t(o,t)||Gs(t,o)||(o.state.pasteIncoming=+new Date,n.fastPoll())})),yt(r,"cut",i),yt(r,"copy",i),yt(t.scroller,"paste",(function(e){if(!Gn(t,e)&&!_t(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)}})),yt(t.lineSpace,"selectstart",(function(e){Gn(t,e)||Ot(e)})),yt(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"})}})),yt(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ll.prototype.createField=function(t){this.wrapper=Xs(),this.textarea=this.wrapper.firstChild;var e=this.cm.options;Zs(this.textarea,e.spellcheck,e.autocorrect,e.autocapitalize)},ll.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute('aria-label',t):this.textarea.removeAttribute('aria-label')},ll.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,o=Ko(t);if(t.options.moveInputWithCursor){var r=Co(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},ll.prototype.showSelection=function(t){var e=this.cm.display;P(e.cursorDiv,t.cursors),P(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},ll.prototype.reset=function(t){if(!(this.contextMenuPending||this.composing&&t)){var e=this.cm;if(this.resetting=!0,e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&I(this.textarea),a&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null));this.resetting=!1}},ll.prototype.getField=function(){return this.textarea},ll.prototype.supportsTouch=function(){return!1},ll.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||L(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch(t){}},ll.prototype.blur=function(){this.textarea.blur()},ll.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ll.prototype.receivedFocus=function(){this.slowPoll()},ll.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},ll.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)},ll.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,o=this.prevInput;if(this.contextMenuPending||this.resetting||!e.state.focused||Vt(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||b&&/[\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},ll.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ll.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},ll.prototype.onContextMenu=function(t){var e=this,n=e.cm,o=n.display,r=e.textarea;e.contextMenuPending&&e.contextMenuPending();var i=Ro(n,t),c=o.scroller.scrollTop;if(i&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(i)&&Ir(n,$i)(n.doc,pi(i),q);var u,p=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=r.ownerDocument.defaultView.scrollY),o.input.focus(),l&&r.ownerDocument.defaultView.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(),S){Et(t);var g=function(){bt(window,"mouseup",g),setTimeout(y,20)};yt(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=p,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?Ir(n,Qi)(n):t++<10?o.detectingSelectAll=setTimeout(i,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(i,200)}}},ll.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},ll.prototype.setUneditable=function(){},ll.prototype.needsContentAttribute=!1,Fs(Hs),Js(Hs);var pl="iter insert remove copy getEditor constructor".split(" ");for(var dl in Ta.prototype)Ta.prototype.hasOwnProperty(dl)&&U(pl,dl)<0&&(Hs.prototype[dl]=function(t){return function(){return t.apply(this.doc,arguments)}}(Ta.prototype[dl]));return St(Ta),Hs.inputStyles={textarea:ll,contenteditable:el},Hs.defineMode=function(t){Hs.defaults.mode||"null"==t||(Hs.defaults.mode=t),Wt.apply(this,arguments)},Hs.defineMIME=$t,Hs.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Hs.defineMIME("text/plain","null"),Hs.defineExtension=function(t,e){Hs.prototype[t]=e},Hs.defineDocExtension=function(t,e){Ta.prototype[t]=e},Hs.fromTextArea=cl,ul(Hs),Hs.version="5.65.15",Hs}())},629:(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=O),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 S(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 O(t,e){return t.next(),t.match(/^\s*[\"\')]/,!1)?e.tokenize=null:e.tokenize=S(")"),x(null,"(")}function T(t,e,n){this.type=t,this.indent=e,this.prev=n}function k(t,e,n,o){return t.context=new T(n,e.indentation()+(!1===o?0:a),t.context),n}function E(t){return t.context.prev&&(t.context=t.context.prev),t.context.type}function P(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 P(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 k(n,e,"block");if("}"==t&&n.context.prev)return E(n);if(w&&/@component/i.test(t))return k(n,e,"atComponentBlock");if(/^@(-moz-)?document$/i.test(t))return k(n,e,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(t))return k(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 k(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 k(n,e,"interpolation");if(":"==t)return"pseudo";if(m&&"("==t)return k(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=_?"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?k(n,e,"prop"):P(t,e,n)},prop:function(t,e,n){if(";"==t)return E(n);if("{"==t&&m)return k(n,e,"propBlock");if("}"==t||"{"==t)return A(t,e,n);if("("==t)return k(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 k(n,e,"interpolation")}else i+=" error";return"prop"},propBlock:function(t,e,n){return"}"==t?E(n):"word"==t?(i="property","maybeprop"):n.context.type},parens:function(t,e,n){return"{"==t||"}"==t?A(t,e,n):")"==t?E(n):"("==t?k(n,e,"parens"):"interpolation"==t?k(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):P(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 k(n,e,"atBlock_parens");if("}"==t||";"==t)return A(t,e,n);if("{"==t)return E(n)&&k(n,e,m?"block":"top");if("interpolation"==t)return k(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)?_?"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?E(n)&&k(n,e,m?"block":"top",!1):("word"==t&&(i="error"),n.context.type)},atBlock_parens:function(t,e,n){return")"==t?E(n):"{"==t||"}"==t?A(t,e,n,2):M.atBlock(t,e,n)},restricted_atBlock_before:function(t,e,n){return"{"==t?k(n,e,"restricted_atBlock"):"word"==t&&"@counter-style"==n.stateArg?(i="variable","restricted_atBlock_before"):P(t,e,n)},restricted_atBlock:function(t,e,n){return"}"==t?(n.stateArg=null,E(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?k(n,e,"top"):P(t,e,n)},at:function(t,e,n){return";"==t?E(n):"{"==t||"}"==t?A(t,e,n):("word"==t?i="tag":"hash"==t&&(i="builtin"),"at")},interpolation:function(t,e,n){return"}"==t?E(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","dynamic-range","video-dynamic-range"],s=e(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],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","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","conic-gradient","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-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","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","repeating-conic-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),w=n.concat(r).concat(a).concat(l).concat(u).concat(d).concat(v).concat(m);function _(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",w),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=_,_(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=_,_(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=_,_(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=_,_(t,e))}},name:"css",helperType:"gss"})}(n(631))},531:(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(631),n(589),n(876),n(629))},876:(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=w,w(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 w(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 _="([{}])";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=_.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 S(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 O(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(k.state=t,k.stream=r,k.marked=null,k.cc=i,k.style=e,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);1;)if((i.length?i.pop():l?$:U)(n,o)){for(;i.length&&i[i.length-1].lex;)i.pop()();return k.marked?k.marked:"variable"==n&&O(t,o)?"variable-2":e}}var k={state:null,column:null,marked:null,cc:null};function E(){for(var t=arguments.length-1;t>=0;t--)k.cc.push(arguments[t])}function P(){return E.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=k.state;if(k.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 D(n,e.vars,!0):null}return A(t,e.vars)?e:new D(e.prev,new N(t,e.vars),!1)}return null}function L(t){return"public"==t||"private"==t||"protected"==t||"abstract"==t||"readonly"==t}function D(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 F(){k.state.context=new D(k.state.context,k.state.localVars,!1),k.state.localVars=I}function V(){k.state.context=new D(k.state.context,k.state.localVars,!0),k.state.localVars=null}function R(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}function H(t,e){var n=function(){var n=k.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 S(o,k.stream.column(),t,null,n.lexical,e)};return n.lex=!0,n}function B(){var t=k.state;t.lexical.prev&&(")"==t.lexical.type&&(t.indented=t.lexical.indented),t.lexical=t.lexical.prev)}function z(t){function e(n){return n==t?P():";"==t||"}"==n||")"==n||"]"==n?E():P(e)}return e}function U(t,e){return"var"==t?P(H("vardef",e),Et,z(";"),B):"keyword a"==t?P(H("form"),G,U,B):"keyword b"==t?P(H("form"),U,B):"keyword d"==t?k.stream.match(/^\s*$/,!1)?P():P(H("stat"),Y,z(";"),B):"debugger"==t?P(z(";")):"{"==t?P(H("}"),V,dt,B,R):";"==t?P():"if"==t?("else"==k.state.lexical.info&&k.state.cc[k.state.cc.length-1]==B&&k.state.cc.pop()(),P(H("form"),G,U,B,Dt)):"function"==t?P(Vt):"for"==t?P(H("form"),V,Nt,U,R,B):"class"==t||u&&"interface"==e?(k.marked="keyword",P(H("form","class"==t?t:e),Ut,B)):"variable"==t?u&&"declare"==e?(k.marked="keyword",P(U)):u&&("module"==e||"enum"==e||"type"==e)&&k.stream.match(/^\s*\w/,!1)?(k.marked="keyword","enum"==e?P(ee):"type"==e?P(Ht,z("operator"),yt,z(";")):P(H("form"),Pt,z("{"),H("}"),dt,B,B)):u&&"namespace"==e?(k.marked="keyword",P(H("form"),$,U,B)):u&&"abstract"==e?(k.marked="keyword",P(U)):P(H("stat"),it):"switch"==t?P(H("form"),G,z("{"),H("}","switch"),V,dt,B,B,R):"case"==t?P($,z(":")):"default"==t?P(z(":")):"catch"==t?P(H("form"),F,W,U,B,R):"export"==t?P(H("stat"),Gt,B):"import"==t?P(H("stat"),Yt,B):"async"==t?P(U):"@"==e?P($,U):E(H("stat"),$,z(";"),B)}function W(t){if("("==t)return P(Bt,z(")"))}function $(t,e){return K(t,e,!1)}function q(t,e){return K(t,e,!0)}function G(t){return"("!=t?E():P(H(")"),Y,z(")"),B)}function K(t,e,n){if(k.state.fatArrowAt==k.stream.start){var o=n?et:tt;if("("==t)return P(F,H(")"),ut(Bt,")"),B,z("=>"),o,R);if("variable"==t)return E(F,Pt,z("=>"),o,R)}var r=n?X:Z;return C.hasOwnProperty(t)?P(r):"function"==t?P(Vt,r):"class"==t||u&&"interface"==e?(k.marked="keyword",P(H("form"),zt,B)):"keyword c"==t||"async"==t?P(n?q:$):"("==t?P(H(")"),Y,z(")"),B,r):"operator"==t||"spread"==t?P(n?q:$):"["==t?P(H("]"),te,B,r):"{"==t?pt(st,"}",null,r):"quasi"==t?E(J,r):"new"==t?P(nt(n)):P()}function Y(t){return t.match(/[;\}\)\],]/)?E():E($)}function Z(t,e){return","==t?P(Y):X(t,e,!1)}function X(t,e,n){var o=0==n?Z:X,r=0==n?$:q;return"=>"==t?P(F,n?et:tt,R):"operator"==t?/\+\+|--/.test(e)||u&&"!"==e?P(o):u&&"<"==e&&k.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?P(H(">"),ut(yt,">"),B,o):"?"==e?P($,z(":"),r):P(r):"quasi"==t?E(J,o):";"!=t?"("==t?pt(q,")","call",o):"."==t?P(at,o):"["==t?P(H("]"),Y,z("]"),B,o):u&&"as"==e?(k.marked="keyword",P(yt,o)):"regexp"==t?(k.state.lastType=k.marked="operator",k.stream.backUp(k.stream.pos-k.stream.start-1),P(r)):void 0:void 0}function J(t,e){return"quasi"!=t?E():"${"!=e.slice(e.length-2)?P(J):P(Y,Q)}function Q(t){if("}"==t)return k.marked="string-2",k.state.tokenize=w,P(J)}function tt(t){return x(k.stream,k.state),E("{"==t?U:$)}function et(t){return x(k.stream,k.state),E("{"==t?U:q)}function nt(t){return function(e){return"."==e?P(t?rt:ot):"variable"==e&&u?P(Ot,t?X:Z):E(t?q:$)}}function ot(t,e){if("target"==e)return k.marked="keyword",P(Z)}function rt(t,e){if("target"==e)return k.marked="keyword",P(X)}function it(t){return":"==t?P(B,U):E(Z,z(";"),B)}function at(t){if("variable"==t)return k.marked="property",P()}function st(t,e){return"async"==t?(k.marked="property",P(st)):"variable"==t||"keyword"==k.style?(k.marked="property","get"==e||"set"==e?P(lt):(u&&k.state.fatArrowAt==k.stream.start&&(n=k.stream.match(/^\s*:\s*/,!1))&&(k.state.fatArrowAt=k.stream.pos+n[0].length),P(ct))):"number"==t||"string"==t?(k.marked=s?"property":k.style+" property",P(ct)):"jsonld-keyword"==t?P(ct):u&&L(e)?(k.marked="keyword",P(st)):"["==t?P($,ft,z("]"),ct):"spread"==t?P(q,ct):"*"==e?(k.marked="keyword",P(st)):":"==t?E(ct):void 0;var n}function lt(t){return"variable"!=t?E(ct):(k.marked="property",P(Vt))}function ct(t){return":"==t?P(q):"("==t?E(Vt):void 0}function ut(t,e,n){function o(r,i){if(n?n.indexOf(r)>-1:","==r){var a=k.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),P((function(n,o){return n==e||o==e?E():E(t)}),o)}return r==e||i==e?P():n&&n.indexOf(";")>-1?E(t):P(z(e))}return function(n,r){return n==e||r==e?P():E(t,o)}}function pt(t,e,n){for(var o=3;o"),yt):"quasi"==t?E(_t,St):void 0}function mt(t){if("=>"==t)return P(yt)}function bt(t){return t.match(/[\}\)\]]/)?P():","==t||";"==t?P(bt):E(wt,bt)}function wt(t,e){return"variable"==t||"keyword"==k.style?(k.marked="property",P(wt)):"?"==e||"number"==t||"string"==t?P(wt):":"==t?P(yt):"["==t?P(z("variable"),ht,z("]"),wt):"("==t?E(Rt,wt):t.match(/[;\}\)\],]/)?void 0:P()}function _t(t,e){return"quasi"!=t?E():"${"!=e.slice(e.length-2)?P(_t):P(yt,xt)}function xt(t){if("}"==t)return k.marked="string-2",k.state.tokenize=w,P(_t)}function Ct(t,e){return"variable"==t&&k.stream.match(/^\s*[?:]/,!1)||"?"==e?P(Ct):":"==t?P(yt):"spread"==t?P(Ct):E(yt)}function St(t,e){return"<"==e?P(H(">"),ut(yt,">"),B,St):"|"==e||"."==t||"&"==e?P(yt):"["==t?P(yt,z("]"),St):"extends"==e||"implements"==e?(k.marked="keyword",P(yt)):"?"==e?P(yt,z(":"),yt):void 0}function Ot(t,e){if("<"==e)return P(H(">"),ut(yt,">"),B,St)}function Tt(){return E(yt,kt)}function kt(t,e){if("="==e)return P(yt)}function Et(t,e){return"enum"==e?(k.marked="keyword",P(ee)):E(Pt,ft,Mt,Lt)}function Pt(t,e){return u&&L(e)?(k.marked="keyword",P(Pt)):"variable"==t?(j(e),P()):"spread"==t?P(Pt):"["==t?pt(jt,"]"):"{"==t?pt(At,"}"):void 0}function At(t,e){return"variable"!=t||k.stream.match(/^\s*:/,!1)?("variable"==t&&(k.marked="property"),"spread"==t?P(Pt):"}"==t?E():"["==t?P($,z(']'),z(':'),At):P(z(":"),Pt,Mt)):(j(e),P(Mt))}function jt(){return E(Pt,Mt)}function Mt(t,e){if("="==e)return P(q)}function Lt(t){if(","==t)return P(Et)}function Dt(t,e){if("keyword b"==t&&"else"==e)return P(H("form","else"),U,B)}function Nt(t,e){return"await"==e?P(Nt):"("==t?P(H(")"),It,B):void 0}function It(t){return"var"==t?P(Et,Ft):"variable"==t?P(Ft):E(Ft)}function Ft(t,e){return")"==t?P():";"==t?P(Ft):"in"==e||"of"==e?(k.marked="keyword",P($,Ft)):E($,Ft)}function Vt(t,e){return"*"==e?(k.marked="keyword",P(Vt)):"variable"==t?(j(e),P(Vt)):"("==t?P(F,H(")"),ut(Bt,")"),B,gt,U,R):u&&"<"==e?P(H(">"),ut(Tt,">"),B,Vt):void 0}function Rt(t,e){return"*"==e?(k.marked="keyword",P(Rt)):"variable"==t?(j(e),P(Rt)):"("==t?P(F,H(")"),ut(Bt,")"),B,gt,R):u&&"<"==e?P(H(">"),ut(Tt,">"),B,Rt):void 0}function Ht(t,e){return"keyword"==t||"variable"==t?(k.marked="type",P(Ht)):"<"==e?P(H(">"),ut(Tt,">"),B):void 0}function Bt(t,e){return"@"==e&&P($,Bt),"spread"==t?P(Bt):u&&L(e)?(k.marked="keyword",P(Bt)):u&&"this"==t?P(ft,Mt):E(Pt,ft,Mt)}function zt(t,e){return"variable"==t?Ut(t,e):Wt(t,e)}function Ut(t,e){if("variable"==t)return j(e),P(Wt)}function Wt(t,e){return"<"==e?P(H(">"),ut(Tt,">"),B,Wt):"extends"==e||"implements"==e||u&&","==t?("implements"==e&&(k.marked="keyword"),P(u?yt:$,Wt)):"{"==t?P(H("}"),$t,B):void 0}function $t(t,e){return"async"==t||"variable"==t&&("static"==e||"get"==e||"set"==e||u&&L(e))&&k.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1)?(k.marked="keyword",P($t)):"variable"==t||"keyword"==k.style?(k.marked="property",P(qt,$t)):"number"==t||"string"==t?P(qt,$t):"["==t?P($,ft,z("]"),qt,$t):"*"==e?(k.marked="keyword",P($t)):u&&"("==t?E(Rt,$t):";"==t||","==t?P($t):"}"==t?P():"@"==e?P($,$t):void 0}function qt(t,e){if("!"==e)return P(qt);if("?"==e)return P(qt);if(":"==t)return P(yt,Mt);if("="==e)return P(q);var n=k.state.lexical.prev;return E(n&&"interface"==n.info?Rt:Vt)}function Gt(t,e){return"*"==e?(k.marked="keyword",P(Qt,z(";"))):"default"==e?(k.marked="keyword",P($,z(";"))):"{"==t?P(ut(Kt,"}"),Qt,z(";")):E(U)}function Kt(t,e){return"as"==e?(k.marked="keyword",P(z("variable"))):"variable"==t?E(q,Kt):void 0}function Yt(t){return"string"==t?P():"("==t?E($):"."==t?E(Z):E(Zt,Xt,Qt)}function Zt(t,e){return"{"==t?pt(Zt,"}"):("variable"==t&&j(e),"*"==e&&(k.marked="keyword"),P(Jt))}function Xt(t){if(","==t)return P(Zt,Xt)}function Jt(t,e){if("as"==e)return k.marked="keyword",P(Zt)}function Qt(t,e){if("from"==e)return k.marked="keyword",P($)}function te(t){return"]"==t?P():E(ut(q,"]"))}function ee(){return E(H("form"),Pt,z("{"),H("}"),ut(ne,"}"),B,B)}function ne(){return E(Pt,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 F.lex=V.lex=!0,R.lex=!0,B.lex=!0,{startState:function(t){var e={tokenize:y,lastType:"sof",cc:[],lexical:new S((t||0)-i,0,"block",!1),localVars:n.localVars,context:n.localVars&&new D(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==w)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!=Dt&&u!=R)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(r=e.cc[e.cc.length-1])&&(r==Z||r==X)&&!/^[,\.=+\-*:?[\(]/.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(631))},589:(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=w,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 w(t,e,n){return"openTag"==t?(n.tagStart=e.column(),_):"closeTag"==t?x:w}function _(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",O):l.allowMissingTagName&&"endTag"==t?(a="tag bracket",O(t,e,n)):(a="error",_)}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",S)}return l.allowMissingTagName&&"endTag"==t?(a="tag bracket",C(t,e,n)):(a="error",S)}function C(t,e,n){return"endTag"!=t?(a="error",C):(m(n),w)}function S(t,e,n){return a="error",C(t,e,n)}function O(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)),w}return a="error",O}function T(t,e,n){return"equals"==t?k:(l.allowMissing||(a="error"),O(t,e,n))}function k(t,e,n){return"string"==t?E:"word"==t&&l.allowUnquoted?(a="string",O):(a="error",O(t,e,n))}function E(t,e,n){return"string"==t?E:O(t,e,n)}return p.isInText=!0,{startState:function(t){var e={tokenize:p,state:w,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==k&&(t.state=O)},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(631))},642:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var o,r=n(346),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.Hn)},675:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s,q:()=>r});var o,r,i=n(642),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.Z)},713:(t,e,n)=>{"use strict";var o;n.d(e,{Z:()=>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},858:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>o});const o={run:function(t){t.Components.clear(),t.Css.clear()}}},884:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var o=n(50),r=n(668),i=n(491);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.sN)(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.Z({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.S1},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)}}},790:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>l,defineCommand:()=>s});var o,r=n(346),i=n(713),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.Z.runBeforeCommand).concat(n),{options:e}),t.trigger("".concat(i.Z._runCommand).concat(n,":before"),e),e.abort)return t.trigger("".concat(i.Z.abort).concat(n),{options:e}),void t.trigger("".concat(i.Z._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.Z.runCommand).concat(n),a),t.trigger(i.Z.run,a),t.trigger("".concat(i.Z._runCommand).concat(n),r,e),t.trigger(i.Z._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.Z.stopBeforeCommand).concat(n),{options:e}),t.trigger("".concat(i.Z._stopCommand).concat(n,":before"),e);var r=this.stop(t,o,e),a={id:n,result:r,options:e};return t.trigger("".concat(i.Z.stopCommand).concat(n),a),t.trigger(i.Z.stop,a),t.trigger("".concat(i.Z._stopCommand).concat(n),r,e),t.trigger(i.Z._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.Hn)},180:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var o=n(50),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(50),r=n(668),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 w=l.getMouseRelativeCanvas(t);f=w.x,h=w.y}else if(m){var _=l.offset(m.getEl());f-=_.left,h-=_.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,w=b.left,_=b.width,x=b.top,C=b.height,S=b.rect,O=u?w{"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)}}}},368:(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)}}}},243:(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)}}}},400:(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)}}}},910:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(50);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}}},744:(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(491);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.ut)('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}}}},975:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(50);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()}}},191:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>l});var o=n(50),r=n(895),i=n(491),a=n(407),s=n(189);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(50),r=n(491);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.ut)('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)}}},117:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var o=n(50),r=n(491);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.ut)('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()}}},614:(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')}}},801:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(895);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"])("
").concat(t.t('styleManager.empty'),"
")),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()}}},395:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(895);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("
").concat(r.t('traitManager.empty'),"
")),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()}}},98:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(50);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)}},129:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>a});var o=n(50),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:()=>O});var o,r=n(50),i=n(346),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.Hn);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.FE);const u=c;c.prototype.model=s;var p=n(330),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.o5)(t)?t:e.getSelected(),a=null==i?void 0:i.get('resizable'),s=_.q.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,w.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,O=void 0===x?function(){}:x,T=S(p,["onStart","onMove","onEnd","updateTarget"]);if(l||!u||this.activeResizer)return;var k=e.config.stylePrefix||'',E="".concat(k,"resizing"),P=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(E):o.replace(E,'')).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 _=y[u];s.autoHeight=h&&'auto'===_,isNaN(parseFloat(_))&&(_=v[u]),l.startDim.w=parseFloat(b),l.startDim.h=parseFloat(_),m=!1,d&&(s.unitHeight=(0,w.getUnitFromValue)(_),s.unitWidth=(0,w.getUnitFromValue)(b)),P.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,P.activeResizer=!1},updateTarget:function(t,o,r){if(O(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,w=o.w{"use strict";n.r(e),n.d(e,{default:()=>r});var o=n(895);const r={startSelectPosition:function(t,e,n){var o=this;void 0===n&&(n={}),this.isPointed=!1;var r=this.em.Utils,i=t.ownerDocument.body;r&&!this.sorter&&(this.sorter=new r.Sorter({container:i,placer:this.canvas.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:this.ppfx,direction:'a',document:e,wmargin:1,nested:1,em:this.em,canvasRelative:1,scale:function(){return o.em.getZoomDecimal()}})),n.onStart&&(this.sorter.onStart=n.onStart),t&&this.sorter.startSort(t,{container:i})},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.moved=0,this.sorter.endMove()),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()}}},804:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>s});var o=n(50),r=n(675),i=n(895),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"])("
")).get(0),j=g+E+'-el',M="".concat(g+k+'-el'," ").concat(g+k),L="".concat(j," ").concat(g+E);m=(0,i["default"])("
")).get(0),b=(0,i["default"])("
")).get(0),w=(0,i["default"])("
")).get(0),_=(0,i["default"])("
")).get(0),x=(0,i["default"])("
")).get(0),C=(0,i["default"])("
")).get(0),S=(0,i["default"])("
")).get(0),O=(0,i["default"])("
")).get(0),this['marginT'+c]=m,this['marginB'+c]=b,this['marginL'+c]=w,this['marginR'+c]=_,this['padT'+c]=x,this['padB'+c]=C,this['padL'+c]=S,this['padR'+c]=O,P.appendChild(m),P.appendChild(b),P.appendChild(w),P.appendChild(_),A.appendChild(x),A.appendChild(C),A.appendChild(S),A.appendChild(O),y.appendChild(P),y.appendChild(A),this[v]='1'}var D='px',N=parseFloat(h.marginLeft.replace(D,''))*p,I=parseFloat(h.marginRight.replace(D,''))*p,F=parseFloat(h.marginTop.replace(D,''))*p,V=parseFloat(h.marginBottom.replace(D,''))*p,R=m.style,H=b.style,B=w.style,z=_.style,U=x.style,W=C.style,$=S.style,q=O.style,G=parseFloat(f.left),K=parseFloat(h.width)*p+D;R.height=F+D,R.width=K,R.top=f.top-F+D,R.left=G+D,H.height=V+D,H.width=K,H.top=f.top+f.height+D,H.left=G+D;var Y=f.height+F+V+D,Z=f.top-F+D;B.height=Y,B.width=N+D,B.top=Z,B.left=G-N+D,z.height=Y,z.width=I+D,z.top=Z,z.left=G+f.width+D;var X=parseFloat(h.paddingTop)*p;U.height=X+D;var J=parseFloat(h.paddingBottom)*p;W.height=J+D;var Q=f.height-J-X+D,tt=f.top+X+D;$.height=Q,$.width=parseFloat(h.paddingLeft)*p+D,$.top=tt;var et=parseFloat(h.paddingRight)*p;q.height=Q,q.width=et+D,q.top=tt}}else t.stopCommand("".concat(this.id),n)},stop:function(t,e,n){void 0===n&&(n={});var o=(n||{}).state||'',r=this.getOffsetMethod(o),i=n.view;this.canvas[r](i).style.opacity=0}}},434:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>i});var o=n(50),r=n(163);const i={init:function(){(0,o.bindAll)(this,'_onFramesChange')},run:function(t){this.toggleVis(t,!0)},stop:function(t){this.toggleVis(t,!1)},toggleVis:function(t,e){if(void 0===e&&(e=!0),!t.Commands.isActive('preview')){var n=t.Canvas,o=e?'on':'off';n.getModel()[o]('change:frames',this._onFramesChange),this.handleFrames(n.getFrames(),e)}},handleFrames:function(t,e){var n=this;t.forEach((function(t){var o;(null===(o=t.view)||void 0===o?void 0:o.loaded)&&n._upFrame(t,e),t.__ol||(t.on('loaded',(function(){return n._upFrame(t)})),t.__ol=!0)}))},_onFramesChange:function(t,e){this.handleFrames(e)},_upFrame:function(t,e){var n,o=this,i=o.ppfx,a=o.em,s=o.id,l=((0,r.isDef)(e)?e:a.Commands.isActive(s))?'add':'remove',c="".concat(i,"dashed");null===(n=t.view)||void 0===n||n.getBody().classList[l](c)}}},346:(t,e,n)=>{"use strict";n.d(e,{FE:()=>u,G7:()=>p,Hn:()=>c,pH:()=>d,vA:()=>r});var o,r,i=n(316),a=n.n(i),s=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)}),l=void 0&&(void 0).__assign||function(){return l=Object.assign||function(t){for(var e,n=1,o=arguments.length;n{"use strict";var o,r;n.d(e,{W:()=>o,g:()=>r}),function(t){t["remove"]="component:remove",t["add"]="component:add",t["move"]="component:move"}(o||(o={})),function(t){t["add"]="component:add",t["remove"]="component:remove",t["removeBefore"]="component:remove:before",t["create"]="component:create",t["update"]="component:update",t["updateInside"]="component:update-inside",t["symbolMainAdd"]="symbol:main:add",t["symbolMainUpdate"]="symbol:main:update",t["symbolMainUpdateDeep"]="symbol:main:update-deep",t["symbolMainRemove"]="symbol:main:remove",t["symbolMain"]="symbol:main",t["symbolInstanceAdd"]="symbol:instance:add",t["symbolInstanceRemove"]="symbol:instance:remove",t["symbolInstance"]="symbol:instance",t["symbol"]="symbol"}(r||(r={}))},330:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var o,r=n(50),i=n(346),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)}),s=function(t){function e(e,n,o){void 0===e&&(e={}),void 0===o&&(o=!1);var r=t.call(this,e)||this;return r.itemsView='',r.itemType='type',r.reuseView=!1,r.config=n||e.config||{},o&&r.listenTo(r.collection,'add',r.addTo),r.items=[],r}return a(e,t),e.prototype.addTo=function(t){this.add(t)},e.prototype.itemViewNotFound=function(t){var e=this.config,n=this.ns,o=e.em,r="".concat(n?"[".concat(n,"]: "):'',"'").concat(t,"' type not found");o&&o.logWarning(r)},e.prototype.add=function(t,e){var n,o=this,i=o.config,a=o.reuseView,s=o.items,l=this.itemsView||{},c=e||null,u=this.itemView,p=t.get(this.itemType);l[p]?u=l[p]:!p||l[p]||(0,r.includes)(['button','checkbox','color','date','datetime-local','email','file','hidden','image','month','number','password','radio','range','reset','search','submit','tel','text','time','url','week'],p)||this.itemViewNotFound(p),n=t.view&&a?t.view:new u({model:t,config:i},i),s&&s.push(n);var d=n.render().el;c?c.appendChild(d):this.$el.append(d)},e.prototype.render=function(){var t=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each((function(e){this.add(e,t)}),this),this.$el.append(t),this.onRender(),this},e.prototype.onRender=function(){},e.prototype.onRemoveBefore=function(t,e){},e.prototype.onRemove=function(t,e){},e.prototype.remove=function(e){void 0===e&&(e={});var n=this.items;return this.onRemoveBefore(n,e),this.clearItems(),t.prototype.remove.call(this),this.onRemove(n,e),this},e.prototype.clearItems=function(){this.items},e}(i.G7);const l=s;s.prototype.itemView=''},668:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var o=n(50),r=n(491),i=void 0&&(void 0).__assign||function(){return i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=e&&t<=e+o||t<=e&&t>=e-o},t.prototype.setGuideLock=function(t,e){var n=(0,o.isUndefined)(t.x)?'Y':'X',r="trg".concat(n);return null!==e?(t.active=!0,t.lock=e,this[r]=t):(delete t.active,delete t.lock,delete this[r]),t},t.prototype.stop=function(t,e){void 0===e&&(e={});var n=this.delta,r=!!e.cancel,i=r?0:n.x,a=r?0:n.y;this.toggleDrag(),this.lockedAxis=null,this.move(i,a,!0);var s=this.opts.onEnd;(0,o.isFunction)(s)&&s(t,this,{cancelled:r})},t.prototype.keyHandle=function(t){(0,r.kl)(t)&&this.stop(t,{cancel:!0})},t.prototype.move=function(t,e,n){var r=this.el,i=this.opts,a=this.startPosition;if(a){var s=i.setPosition,l=a.x+t,c=a.y+e;this.position={x:l,y:c,end:n},(0,o.isFunction)(s)&&s(this.position),r&&(r.style.left="".concat(l,"px"),r.style.top="".concat(c,"px"))}},t.prototype.getContainerEl=function(){var t=this.opts.container;return t?[t]:this.getDocumentEl()},t.prototype.getWindowEl=function(){return this.getContainerEl().map((function(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow}))},t.prototype.getDocumentEl=function(t){var e=this.opts.doc;if(t=t||this.el,!this.docs.length){var n=[document];t&&n.push(t.ownerDocument),e&&n.push(e),this.docs=n}return this.docs},t.prototype.getPointerPos=function(t){var e=this.opts.getPointerPosition,n=(0,r.VB)(t);return e?e(t):{x:n.clientX,y:n.clientY}},t.prototype.getStartPosition=function(){var t=this.el,e=this.opts.getPosition,n={x:0,y:0};return(0,o.isFunction)(e)?n=e():t&&(n={x:parseFloat(t.style.left),y:parseFloat(t.style.top)}),n},t.prototype.getScrollInfo=function(){var t=this.opts.doc,e=t&&t.body;return{y:e?e.scrollTop:0,x:e?e.scrollLeft:0}},t.prototype.detectAxisLock=function(t,e){var n=t,o=e,r=Math.abs(n),i=Math.abs(o);return o>=r||o<=-r?'x':n>i||n<-i?'y':void 0},t}()},895:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>vt});var o='undefined'!=typeof document?document:null,r='undefined'!=typeof window?window:null,i=Array.prototype,a=i.filter,s=i.indexOf,l=i.map,c=i.push,u=i.reverse,p=i.slice,d=i.splice,f=/^#[\w-]*$/,h=/^\.[\w-]*$/,g=/<.+>/,v=/^\w+$/;function y(t,e){return void 0===e&&(e=o),h.test(t)?e.getElementsByClassName(t.slice(1)):v.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t)}function m(t,e){if(void 0===e&&(e=o),t){if(t.__cash)return t;var n=t;if(E(t)){if(e.__cash&&(e=e[0]),!(n=f.test(t)?e.getElementById(t.slice(1)):g.test(t)?ft(t):y(t,e)))return}else if(k(t))return this.ready(t);(n.nodeType||n===r)&&(n=[n]),this.length=n.length;for(var i=0,a=this.length;i=0})):n.value=r}))},w.clone=function(){return this.map((function(t,e){return e.cloneNode(!0)}))},w.detach=function(){return this.each((function(t,e){e.parentNode&&e.parentNode.removeChild(e)}))};var ut,pt=/^\s*<(\w+)[^>]*>/,dt=/^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/;function ft(t){if(function(){if(!ut){var t=o.createElement('table'),e=o.createElement('tr');ut={'*':o.createElement('div'),tr:o.createElement('tbody'),td:e,th:e,thead:t,tbody:t,tfoot:t}}}(),!E(t))return[];if(dt.test(t))return[o.createElement(RegExp.$1)];var e=pt.test(t)&&RegExp.$1,n=ut[e]||ut['*'];return n.innerHTML=t,b(n.childNodes).detach().get()}function ht(t,e,n){if(void 0!==e){var o=E(e);!o&&e.length?S(e,(function(e){return ht(t,e,n)})):S(t,o?function(t){t.insertAdjacentHTML(n?'afterbegin':'beforeend',e)}:function(t,o){return function(t,e,n){n?t.insertBefore(e,t.childNodes[0]):t.appendChild(e)}(t,o?e.cloneNode(!0):e,n)})}}b.parseHTML=ft,w.empty=function(){var t=this[0];if(t)for(;t.firstChild;)t.removeChild(t.firstChild);return this},w.append=function(){var t=this;return S(arguments,(function(e){ht(t,e)})),this},w.appendTo=function(t){return ht(b(t),this),this},w.html=function(t){if(void 0===t)return this[0]&&this[0].innerHTML;var e=t.nodeType?t[0].outerHTML:t;return this.each((function(t,n){n.innerHTML=e}))},w.insertAfter=function(t){var e=this;return b(t).each((function(t,n){var o=n.parentNode;e.each((function(e,r){o.insertBefore(t?r.cloneNode(!0):r,n.nextSibling)}))})),this},w.after=function(){var t=this;return S(u.apply(arguments),(function(e){u.apply(b(e).slice()).insertAfter(t)})),this},w.insertBefore=function(t){var e=this;return b(t).each((function(t,n){var o=n.parentNode;e.each((function(e,r){o.insertBefore(t?r.cloneNode(!0):r,n)}))})),this},w.before=function(){var t=this;return S(arguments,(function(e){b(e).insertBefore(t)})),this},w.prepend=function(){var t=this;return S(arguments,(function(e){ht(t,e,!0)})),this},w.prependTo=function(t){return ht(b(t),u.apply(this.slice()),!0),this},w.remove=function(){return this.detach().off()},w.replaceWith=function(t){var e=this;return this.each((function(n,o){var r=o.parentNode;if(r){var i=n?b(t).clone():b(t);if(!i[0])return e.remove(),!1;r.replaceChild(i[0],o),b(i[0]).after(i.slice(1))}}))},w.replaceAll=function(t){return b(t).replaceWith(this),this},w.text=function(t){return void 0===t?this[0]?this[0].textContent:'':this.each((function(e,n){n.textContent=t}))};var gt=o&&o.documentElement;w.offset=function(){var t=this[0];if(t){var e=t.getBoundingClientRect();return{top:e.top+r.pageYOffset-gt.clientTop,left:e.left+r.pageXOffset-gt.clientLeft}}},w.offsetParent=function(){return b(this[0]&&this[0].offsetParent)},w.position=function(){var t=this[0];if(t)return{left:t.offsetLeft,top:t.offsetTop}},w.children=function(t){var e=[];return this.each((function(t,n){c.apply(e,n.children)})),e=b(D(e)),t?e.filter((function(e,n){return T(n,t)})):e},w.contents=function(){var t=[];return this.each((function(e,n){c.apply(t,'IFRAME'===n.tagName?[n.contentDocument]:n.childNodes)})),b(t.length&&D(t))},w.find=function(t){for(var e=[],n=0,o=this.length;n{"use strict";n.d(e,{$Q:()=>g,BM:()=>_,FW:()=>d,G1:()=>s,GX:()=>S,L_:()=>c,Mx:()=>l,R3:()=>v,S1:()=>D,SJ:()=>w,Ut:()=>C,VB:()=>k,Vb:()=>A,cx:()=>u,dL:()=>h,hy:()=>j,kl:()=>E,nB:()=>M,o5:()=>x,on:()=>L,pn:()=>f,r$:()=>P,rw:()=>m,sE:()=>p,sN:()=>T,t3:()=>b,ut:()=>y});var o=n(50),r=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r=i?t.appendChild(e):t.insertBefore(e,r[a])},v=function(t,e){return g(t,e)},y=function(t,e,n){void 0===e&&(e={});var r=document.createElement(t);return e&&(0,o.each)(e,(function(t,e){return r.setAttribute(e,t)})),n&&((0,o.isString)(n)?r.innerHTML=n:r.appendChild(n)),r},m=function(t){return document.createTextNode(t)},b=function(t,e){var n,o=t.type;try{n=new window[e](o,t)}catch(t){(n=document.createEvent(e)).initEvent(o,!0,!0)}return n._parentEvent=t,0===o.indexOf('key')&&(n.keyCodeVal=t.keyCode,['keyCode','which'].forEach((function(t){Object.defineProperty(n,t,{get:function(){return this.keyCodeVal}})}))),n},w=function(t,e){void 0===e&&(e=[]),(Array.isArray(e)?e:[e]).forEach((function(e){var n=e[i]||'div',r=e[a]||{},s=document.createElement(n);(0,o.each)(r,(function(t,e){s.setAttribute(e,t)})),t.appendChild(s)}))},_=function(t){return(null==t?void 0:t.nodeType)===Node.TEXT_NODE},x=function(t){return t&&!_(t)&&!function(t){return(null==t?void 0:t.nodeType)===Node.COMMENT_NODE}(t)},C=function(t){var e,n={top:0,left:0,width:0,height:0};if(!t)return n;if(_(t)){var o=document.createRange();o.selectNode(t),e=o.getBoundingClientRect(),o.detach()}return e||(t.getBoundingClientRect?t.getBoundingClientRect():n)},S=function(t){var e=(null==t?void 0:t.ownerDocument)||document,n=e.documentElement,o=e.defaultView||window;return{x:(o.pageXOffset||n.scrollLeft||0)-(n.clientLeft||0),y:(o.pageYOffset||n.scrollTop||0)-(n.clientTop||0)}},O=function(t){return t.which||t.keyCode},T=function(t){return String.fromCharCode(O(t))},k=function(t){return t.touches&&t.touches[0]?t.touches[0]:t},E=function(t){return 27===O(t)},P=function(t){return 13===O(t)},A=function(t){return function(t){return t.ctrlKey}(t)||t.metaKey},j=function(t){if(!t)return'';var e=t.name,n=t.publicId,o=t.systemId,r=n?" PUBLIC \"".concat(n,"\""):'',i=!n&&o?" SYSTEM \"".concat(o,"\""):'';return"")},M=function(t){void 0===t&&(t={});var e=[];return(0,o.each)(t,(function(t,n){return e.push("".concat(n,"=\"").concat(t,"\""))})),e.join(' ')},L=function(t,e,n,r){var i=e.split(/\s+/),a=(0,o.isArray)(t)?t:[t];i.forEach((function(t){a.forEach((function(e){return null==e?void 0:e.addEventListener(t,n,r)}))}))},D=function(t,e,n,r){var i=e.split(/\s+/),a=(0,o.isArray)(t)?t:[t];i.forEach((function(t){a.forEach((function(e){return null==e?void 0:e.removeEventListener(t,n,r)}))}))}},163:(t,e,n)=>{"use strict";n.r(e),n.d(e,{appendStyles:()=>m,buildBase64UrlFromSvg:()=>B,camelCase:()=>x,capitalize:()=>L,createId:()=>H,deepMerge:()=>P,escape:()=>k,escapeNodeContent:()=>E,find:()=>T,getComponentModel:()=>V,getComponentView:()=>F,getElement:()=>O,getGlobal:()=>f,getModel:()=>A,getUiClass:()=>y,getUnitFromValue:()=>w,getViewEl:()=>N,hasDnd:()=>S,hasWin:()=>d,isBultInMethod:()=>l,isComponent:()=>I,isDef:()=>p,isEmptyObj:()=>M,isObject:()=>j,isRule:()=>D,matches:()=>v,normalizeFloat:()=>C,normalizeKey:()=>c,setViewEl:()=>R,shallowDiff:()=>b,toLowerCase:()=>h,upFirst:()=>_,wait:()=>u});var o=n(50),r=n(491),i=void 0&&(void 0).__assign||function(){return i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0?a!==s&&(n[i]=s):n[i]=null}for(var i in e)e.hasOwnProperty(i)&&(0,o.isUndefined)(t[i])&&(n[i]=e[i]);return n},w=function(t){return t.replace(parseFloat(t),'')},_=function(t){return t[0].toUpperCase()+t.toLowerCase().slice(1)},x=function(t){return t.replace(/-./g,(function(t){return t[1].toUpperCase()}))},C=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=0);var o=0;if(isNaN(t))return n;if(t=parseFloat(t),Math.floor(t)!==t){var r=e.toString().split('.')[1];o=r?r.length:0}return o?parseFloat(t.toFixed(o)):t},S=function(t){return'draggable'in document.createElement('i')&&(!t||t.config.nativeDnD)},O=function(t){return(0,o.isElement)(t)||(0,r.BM)(t)?t:t&&t.getEl?t.getEl():void 0},T=function(t,e){var n=null;return t.some((function(o,r){return e(o,r,t)?(n=o,1):0})),n},k=function(t){return void 0===t&&(t=''),"".concat(t).replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"').replace(/'/g,''').replace(/`/g,'`')},E=function(t){return void 0===t&&(t=''),"".concat(t).replace(/&/g,'&').replace(//g,'>')},P=function(){for(var t=[],e=0;e{var o={"./CanvasClear":858,"./CanvasClear.ts":858,"./CanvasMove":884,"./CanvasMove.ts":884,"./CommandAbstract":790,"./CommandAbstract.ts":790,"./ComponentDelete":180,"./ComponentDelete.ts":180,"./ComponentDrag":544,"./ComponentDrag.ts":544,"./ComponentEnter":236,"./ComponentEnter.ts":236,"./ComponentExit":368,"./ComponentExit.ts":368,"./ComponentNext":243,"./ComponentNext.ts":243,"./ComponentPrev":400,"./ComponentPrev.ts":400,"./ComponentStyleClear":910,"./ComponentStyleClear.ts":910,"./CopyComponent":744,"./CopyComponent.ts":744,"./ExportTemplate":457,"./ExportTemplate.ts":457,"./Fullscreen":975,"./Fullscreen.ts":975,"./MoveComponent":191,"./MoveComponent.ts":191,"./OpenAssets":912,"./OpenAssets.ts":912,"./OpenBlocks":117,"./OpenBlocks.ts":117,"./OpenLayers":614,"./OpenLayers.ts":614,"./OpenStyleManager":801,"./OpenStyleManager.ts":801,"./OpenTraitManager":395,"./OpenTraitManager.ts":395,"./PasteComponent":98,"./PasteComponent.ts":98,"./Preview":129,"./Preview.ts":129,"./Resize":116,"./Resize.ts":116,"./SelectComponent":407,"./SelectComponent.ts":407,"./SelectPosition":189,"./SelectPosition.ts":189,"./ShowOffset":804,"./ShowOffset.ts":804,"./SwitchVisibility":434,"./SwitchVisibility.ts":434};function r(t){var e=i(t);return n(e)}function i(t){if(!n.o(o,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code='MODULE_NOT_FOUND',e}return o[t]}r.keys=function(){return Object.keys(o)},r.resolve=i,t.exports=r,r.id=828},50:(t,e,n)=>{"use strict";n.r(e),n.d(e,{VERSION:()=>r,after:()=>Ne,all:()=>en,allKeys:()=>vt,any:()=>nn,assign:()=>Nt,before:()=>Ie,bind:()=>Ce,bindAll:()=>Te,chain:()=>be,chunk:()=>Rn,clone:()=>Rt,collect:()=>Ye,compact:()=>En,compose:()=>De,constant:()=>J,contains:()=>on,countBy:()=>mn,create:()=>Vt,debounce:()=>je,default:()=>Wn,defaults:()=>It,defer:()=>Pe,delay:()=>Ee,detect:()=>qe,difference:()=>An,drop:()=>Tn,each:()=>Ke,escape:()=>se,every:()=>en,extend:()=>Dt,extendOwn:()=>Nt,filter:()=>Qe,find:()=>qe,findIndex:()=>He,findKey:()=>Ve,findLastIndex:()=>Be,findWhere:()=>Ge,first:()=>On,flatten:()=>Pn,foldl:()=>Xe,foldr:()=>Je,forEach:()=>Ke,functions:()=>Mt,get:()=>Wt,groupBy:()=>vn,has:()=>$t,head:()=>On,identity:()=>qt,include:()=>on,includes:()=>on,indexBy:()=>yn,indexOf:()=>We,initial:()=>Sn,inject:()=>Xe,intersection:()=>Dn,invert:()=>jt,invoke:()=>rn,isArguments:()=>Y,isArray:()=>q,isArrayBuffer:()=>F,isBoolean:()=>E,isDataView:()=>$,isDate:()=>L,isElement:()=>P,isEmpty:()=>lt,isEqual:()=>gt,isError:()=>N,isFinite:()=>Z,isFunction:()=>H,isMap:()=>Ot,isMatch:()=>ct,isNaN:()=>X,isNull:()=>T,isNumber:()=>M,isObject:()=>O,isRegExp:()=>D,isSet:()=>kt,isString:()=>j,isSymbol:()=>I,isTypedArray:()=>rt,isUndefined:()=>k,isWeakMap:()=>Tt,isWeakSet:()=>Et,iteratee:()=>Xt,keys:()=>st,last:()=>kn,lastIndexOf:()=>$e,map:()=>Ye,mapObject:()=>Qt,matcher:()=>Gt,matches:()=>Gt,max:()=>ln,memoize:()=>ke,methods:()=>Mt,min:()=>cn,mixin:()=>Bn,negate:()=>Le,noop:()=>te,now:()=>re,object:()=>Fn,omit:()=>Cn,once:()=>Fe,pairs:()=>At,partial:()=>xe,partition:()=>bn,pick:()=>xn,pluck:()=>an,property:()=>Kt,propertyOf:()=>ee,random:()=>oe,range:()=>Vn,reduce:()=>Xe,reduceRight:()=>Je,reject:()=>tn,rest:()=>Tn,restArguments:()=>S,result:()=>ve,sample:()=>dn,select:()=>Qe,shuffle:()=>fn,size:()=>wn,some:()=>nn,sortBy:()=>hn,sortedIndex:()=>ze,tail:()=>Tn,take:()=>On,tap:()=>Ht,template:()=>ge,templateSettings:()=>ce,throttle:()=>Ae,times:()=>ne,toArray:()=>pn,toPath:()=>Bt,transpose:()=>Nn,unescape:()=>le,union:()=>Ln,uniq:()=>Mn,unique:()=>Mn,uniqueId:()=>me,unzip:()=>Nn,values:()=>Pt,where:()=>sn,without:()=>jn,wrap:()=>Me,zip:()=>In});var o={};n.r(o),n.d(o,{VERSION:()=>r,after:()=>Ne,all:()=>en,allKeys:()=>vt,any:()=>nn,assign:()=>Nt,before:()=>Ie,bind:()=>Ce,bindAll:()=>Te,chain:()=>be,chunk:()=>Rn,clone:()=>Rt,collect:()=>Ye,compact:()=>En,compose:()=>De,constant:()=>J,contains:()=>on,countBy:()=>mn,create:()=>Vt,debounce:()=>je,default:()=>zn,defaults:()=>It,defer:()=>Pe,delay:()=>Ee,detect:()=>qe,difference:()=>An,drop:()=>Tn,each:()=>Ke,escape:()=>se,every:()=>en,extend:()=>Dt,extendOwn:()=>Nt,filter:()=>Qe,find:()=>qe,findIndex:()=>He,findKey:()=>Ve,findLastIndex:()=>Be,findWhere:()=>Ge,first:()=>On,flatten:()=>Pn,foldl:()=>Xe,foldr:()=>Je,forEach:()=>Ke,functions:()=>Mt,get:()=>Wt,groupBy:()=>vn,has:()=>$t,head:()=>On,identity:()=>qt,include:()=>on,includes:()=>on,indexBy:()=>yn,indexOf:()=>We,initial:()=>Sn,inject:()=>Xe,intersection:()=>Dn,invert:()=>jt,invoke:()=>rn,isArguments:()=>Y,isArray:()=>q,isArrayBuffer:()=>F,isBoolean:()=>E,isDataView:()=>$,isDate:()=>L,isElement:()=>P,isEmpty:()=>lt,isEqual:()=>gt,isError:()=>N,isFinite:()=>Z,isFunction:()=>H,isMap:()=>Ot,isMatch:()=>ct,isNaN:()=>X,isNull:()=>T,isNumber:()=>M,isObject:()=>O,isRegExp:()=>D,isSet:()=>kt,isString:()=>j,isSymbol:()=>I,isTypedArray:()=>rt,isUndefined:()=>k,isWeakMap:()=>Tt,isWeakSet:()=>Et,iteratee:()=>Xt,keys:()=>st,last:()=>kn,lastIndexOf:()=>$e,map:()=>Ye,mapObject:()=>Qt,matcher:()=>Gt,matches:()=>Gt,max:()=>ln,memoize:()=>ke,methods:()=>Mt,min:()=>cn,mixin:()=>Bn,negate:()=>Le,noop:()=>te,now:()=>re,object:()=>Fn,omit:()=>Cn,once:()=>Fe,pairs:()=>At,partial:()=>xe,partition:()=>bn,pick:()=>xn,pluck:()=>an,property:()=>Kt,propertyOf:()=>ee,random:()=>oe,range:()=>Vn,reduce:()=>Xe,reduceRight:()=>Je,reject:()=>tn,rest:()=>Tn,restArguments:()=>S,result:()=>ve,sample:()=>dn,select:()=>Qe,shuffle:()=>fn,size:()=>wn,some:()=>nn,sortBy:()=>hn,sortedIndex:()=>ze,tail:()=>Tn,take:()=>On,tap:()=>Ht,template:()=>ge,templateSettings:()=>ce,throttle:()=>Ae,times:()=>ne,toArray:()=>pn,toPath:()=>Bt,transpose:()=>Nn,unescape:()=>le,union:()=>Ln,uniq:()=>Mn,unique:()=>Mn,uniqueId:()=>me,unzip:()=>Nn,values:()=>Pt,where:()=>sn,without:()=>jn,wrap:()=>Me,zip:()=>In});var r='1.13.6',i='object'==typeof self&&self.self===self&&self||'object'==typeof global&&global.global===global&&global||Function('return this')()||{},a=Array.prototype,s=Object.prototype,l='undefined'!=typeof Symbol?Symbol.prototype:null,c=a.push,u=a.slice,p=s.toString,d=s.hasOwnProperty,f='undefined'!=typeof ArrayBuffer,h='undefined'!=typeof DataView,g=Array.isArray,v=Object.keys,y=Object.create,m=f&&ArrayBuffer.isView,b=isNaN,w=isFinite,_=!{toString:null}.propertyIsEnumerable('toString'),x=['valueOf','isPrototypeOf','toString','propertyIsEnumerable','hasOwnProperty','toLocaleString'],C=Math.pow(2,53)-1;function S(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),o=Array(n),r=0;r=0&&n<=C}}function tt(t){return function(e){return null==e?void 0:e[t]}}const et=tt('byteLength'),nt=Q(et);var ot=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const rt=f?function(t){return m?m(t)&&!$(t):nt(t)&&ot.test(p.call(t))}:J(!1),it=tt('length');function at(t,e){e=function(t){for(var e={},n=t.length,o=0;o':'>','"':'"',"'":''','`':'`'},se=ie(ae),le=ie(jt(ae)),ce=ut.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var ue=/(.)^/,pe={"'":"'",'\\':'\\','\r':'r','\n':'n','\u2028':'u2028','\u2029':'u2029'},de=/\\|'|\r|\n|\u2028|\u2029/g;function fe(t){return'\\'+pe[t]}var he=/^\s*(\w|\$)+\s*$/;function ge(t,e,n){!e&&n&&(e=n),e=It({},e,ut.templateSettings);var o=RegExp([(e.escape||ue).source,(e.interpolate||ue).source,(e.evaluate||ue).source].join('|')+'|$','g'),r=0,i="__p+='";t.replace(o,(function(e,n,o,a,s){return i+=t.slice(r,s).replace(de,fe),r=s+e.length,n?i+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":o?i+="'+\n((__t=("+o+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),e})),i+="';\n";var a,s=e.variable;if(s){if(!he.test(s))throw new Error('variable is not a bare identifier: '+s)}else i='with(obj||{}){\n'+i+'}\n',s='obj';i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+'return __p;\n';try{a=new Function(s,'_',i)}catch(t){throw t.source=i,t}var l=function(t){return a.call(this,t,ut)};return l.source='function('+s+'){\n'+i+'}',l}function ve(t,e,n){var o=(e=zt(e)).length;if(!o)return H(n)?n.call(t):n;for(var r=0;r1)Oe(s,e-1,n,o),r=o.length;else for(var l=0,c=s.length;le?(o&&(clearTimeout(o),o=null),s=c,a=t.apply(r,i),o||(r=i=null)):o||!1===n.trailing||(o=setTimeout(l,u)),a};return c.cancel=function(){clearTimeout(o),s=0,o=r=i=null},c}function je(t,e,n){var o,r,i,a,s,l=function(){var c=re()-r;e>c?o=setTimeout(l,e-c):(o=null,n||(a=t.apply(s,i)),o||(i=s=null))},c=S((function(c){return s=this,i=c,r=re(),o||(o=setTimeout(l,e),n&&(a=t.apply(s,i))),a}));return c.cancel=function(){clearTimeout(o),o=i=s=null},c}function Me(t,e){return xe(e,t)}function Le(t){return function(){return!t.apply(this,arguments)}}function De(){var t=arguments,e=t.length-1;return function(){for(var n=e,o=t[e].apply(this,arguments);n--;)o=t[n].call(this,o);return o}}function Ne(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function Ie(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}const Fe=xe(Ie,2);function Ve(t,e,n){e=Jt(e,n);for(var o,r=st(t),i=0,a=r.length;i0?0:r-1;i>=0&&i0?a=i>=0?i:Math.max(i+s,a):s=i>=0?Math.min(i+1,s):i+s+1;else if(n&&i&&s)return o[i=n(o,r)]===r?i:-1;if(r!=r)return(i=e(u.call(o,a,s),X))>=0?i+a:-1;for(i=t>0?a:s-1;i>=0&&i=3;return function(e,n,o,r){var i=!Se(e)&&st(e),a=(i||e).length,s=t>0?0:a-1;for(r||(o=e[i?i[s]:s],s+=t);s>=0&&s=0}const rn=S((function(t,e,n){var o,r;return H(e)?r=e:(e=zt(e),o=e.slice(0,-1),e=e[e.length-1]),Ye(t,(function(t){var i=r;if(!i){if(o&&o.length&&(t=Ut(t,o)),null==t)return;i=t[e]}return null==i?i:i.apply(t,n)}))}));function an(t,e){return Ye(t,Kt(e))}function sn(t,e){return Qe(t,Gt(e))}function ln(t,e,n){var o,r,i=-1/0,a=-1/0;if(null==e||'number'==typeof e&&'object'!=typeof t[0]&&null!=t)for(var s=0,l=(t=Se(t)?t:Pt(t)).length;si&&(i=o);else e=Jt(e,n),Ke(t,(function(t,n,o){((r=e(t,n,o))>a||r===-1/0&&i===-1/0)&&(i=t,a=r)}));return i}function cn(t,e,n){var o,r,i=1/0,a=1/0;if(null==e||'number'==typeof e&&'object'!=typeof t[0]&&null!=t)for(var s=0,l=(t=Se(t)?t:Pt(t)).length;so||void 0===n)return 1;if(n1&&(o=Yt(o,e[1])),e=vt(t)):(o=_n,e=Oe(e,!1,!1),t=Object(t));for(var r=0,i=e.length;r1&&(n=e[1])):(e=Ye(Oe(e,!1,!1),String),o=function(t,n){return!on(e,n)}),xn(t,o,n)}));function Sn(t,e,n){return u.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function On(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:Sn(t,t.length-e)}function Tn(t,e,n){return u.call(t,null==e||n?1:e)}function kn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:Tn(t,Math.max(0,t.length-e))}function En(t){return Qe(t,Boolean)}function Pn(t,e){return Oe(t,e,!1)}const An=S((function(t,e){return e=Oe(e,!0,!0),Qe(t,(function(t){return!on(e,t)}))})),jn=S((function(t,e){return An(t,e)}));function Mn(t,e,n,o){E(e)||(o=n,n=e,e=!1),null!=n&&(n=Jt(n,o));for(var r=[],i=[],a=0,s=it(t);a{var e=t&&t.__esModule?()=>t['default']:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.g=function(){if('object'==typeof globalThis)return globalThis;try{return this||new Function('return this')()}catch(t){if('object'==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(t,'__esModule',{value:!0})};var o={};return(()=>{"use strict";n.d(o,{default:()=>Ig});var t=n(50),e=n(163);function r(t){for(var n=[],o=1;o',move:'',plus:'',caret:'',delete:'',copy:'',arrowUp:'',chevron:'',eye:'',eyeOff:''},i18n:{},undoManager:{},assetManager:{},canvas:{},layerManager:{},storageManager:{},richTextEditor:{},domComponents:{},modal:{},codeManager:{},panels:{},commands:{},cssComposer:{},selectorManager:{},deviceManager:{},styleManager:{},blockManager:{},traitManager:{},textViewCode:'Code',keepUnusedStyles:!1,customUI:!1};var a=n(316),s=n.n(a),l=n(895);var c,u=n(346),p=void 0&&(void 0).__extends||(c=function(t,e){return c=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])},c(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}c(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return p(e,t),e}(u.Hn);const f=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return p(n,e),n.prototype.getByComponent=function(t){var e=this;return this.filter((function(n){return e.getComponent(n)===t}))[0]},n.prototype.addComponent=function(e,n){var o=this,r=((0,t.isArray)(e)?e:[e]).filter((function(t){return!o.hasComponent(t)})).map((function(t){return new d({component:t})}))[0];return this.push(r,n)},n.prototype.getComponent=function(t){return t.get('component')},n.prototype.hasComponent=function(t){var e=this.getByComponent(t);return e&&this.contains(e)},n.prototype.lastComponent=function(){var t=this.last();return t?this.getComponent(t):void 0},n.prototype.allComponents=function(){var t=this;return this.map((function(e){return t.getComponent(e)})).filter((function(t){return t}))},n.prototype.removeComponent=function(e,n){var o=this,r=((0,t.isArray)(e)?e:[e]).map((function(t){return o.getByComponent(t)}));return this.remove(r,n)},n}(u.FE);var h=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)}}(),g=void 0&&(void 0).__assign||function(){return g=Object.assign||function(t){for(var e,n=1,o=arguments.length;n',frameStyle:"\n body { background-color: #fff }\n * ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1) }\n * ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2) }\n * ::-webkit-scrollbar { width: 10px }\n ",notTextable:['button','a','input[type=checkbox]','input[type=radio]'],allowExternalDrop:!0};var _=n(642);const x={default:'',devices:[{id:'desktop',name:'Desktop',width:''},{id:'tablet',name:'Tablet',width:'770px',widthMedia:'992px'},{id:'mobileLandscape',name:'Mobile landscape',width:'568px',widthMedia:'768px'},{id:'mobilePortrait',name:'Mobile portrait',width:'320px',widthMedia:'480px'}]};var C=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)}}();const S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return C(e,t),e.prototype.defaults=function(){return{name:'',width:null,height:'',widthMedia:null,priority:null}},e.prototype.initialize=function(){var t=this;null===this.get('widthMedia')&&this.set('widthMedia',this.get('width')),null===this.get('width')&&this.set('width',this.get('widthMedia')),!this.get('priority')&&this.set('priority',parseFloat(this.get('widthMedia'))||0);['width','height','widthMedia'].forEach((function(e){return t.checkUnit(e)}))},e.prototype.checkUnit=function(t){var e=this.get(t)||'';(parseFloat(e)||0).toString()===e.toString()&&this.set(t,"".concat(e,"px"))},e.prototype.getName=function(){return this.get('name')||this.get('id')},e.prototype.getWidthMedia=function(){return this.get('widthMedia')||''},e}(u.Hn);var O=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)}}(),T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return O(e,t),e}(u.FE);const k=T;T.prototype.model=S;var E=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)}}(),P=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},A=function(t){function e(e){var n=t.call(this,e)||this;return n.config=e.config||{},n.em=n.config.em,n.ppfx=n.config.pStylePrefix||'',n.listenTo(n.em,'change:device',n.updateSelect),n}return E(e,t),e.prototype.template=function(t){var e=t.ppfx,n=t.label;return r(M||(M=P(["\n
","
\n
\n \n \n \n
\n
\n
\n
\n \n "],["\n
","
\n
\n \n \n \n
\n
\n
\n
\n \n "])),e,n,e,e,e,e,e,e,e)},e.prototype.events=function(){return{change:'updateDevice','click [data-add-trasp]':'startAdd'}},e.prototype.startAdd=function(){},e.prototype.updateDevice=function(){var t=this.em;if(t){var e=this.devicesEl;t.set('device',e?e.val():'')}},e.prototype.updateSelect=function(){var t=this.em,e=this.devicesEl;if(t&&t.getDeviceModel&&e){var n=t.getDeviceModel();e.val(n?n.get('id'):'')}},e.prototype.getOptions=function(){var t=this.collection,e=this.em,n='';return t.forEach((function(t){var o=t.attributes,r=o.name,i=o.id,a=e&&e.t&&e.t("deviceManager.devices.".concat(i))||r;n+="")})),n},e.prototype.render=function(){var t=this,e=t.em,n=t.ppfx,o=t.$el,r=t.el,i=e&&e.t&&e.t('deviceManager.device');return o.html(this.template({ppfx:n,label:i})),this.devicesEl=o.find(".".concat(n,"devices")),this.devicesEl.append(this.getOptions()),this.devicesEl.val(e.get('device')),r.className="".concat(n,"devices-c"),this},e}(u.G7);const j=A;var M,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)}}(),D=void 0&&(void 0).__assign||function(){return D=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0&&this.head.splice(r,1)},o.prototype.addLink=function(t){var e='link';!this.getHeadByAttr('href',t,e)&&this.addHeadItem({tag:e,attributes:{href:t,rel:'stylesheet'}})},o.prototype.removeLink=function(t){this.removeHeadByAttr('href',t,'link')},o.prototype.addScript=function(t){var e='script';!this.getHeadByAttr('src',t,e)&&this.addHeadItem({tag:e,attributes:{src:t}})},o.prototype.removeScript=function(t){this.removeHeadByAttr('src',t,'script')},o.prototype.getPage=function(){var t;return null===(t=this.collection)||void 0===t?void 0:t.page},o.prototype._emitUpdated=function(t){void 0===t&&(t={}),this.em.trigger('frame:updated',J({frame:this},t))},o.prototype.hasAutoHeight=function(){return!('auto'!==this.attributes.height&&!this.config.infiniteCanvas)},o.prototype.toJSON=function(e){void 0===e&&(e={});var n=_.Z.prototype.toJSON.call(this,e),o=(0,t.result)(this,'defaults');return e.fromUndo&&delete n.component,delete n.styles,delete n.changesCount,n[tt]&&delete n.width,n[et]&&delete n.height,n.refFrame&&(n.refFrame=n.refFrame.id,delete n.component),(0,t.forEach)(n,(function(t,e){0===e.indexOf('_')&&delete n[e]})),(0,t.forEach)(o,(function(t,e){n[e]===t&&delete n[e]})),(0,t.forEach)(['attributes','head'],(function(e){(0,t.isEmpty)(n[e])&&delete n[e]})),n},o}(_.Z);const rt=ot;var it=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)}}();const at=function(e){function n(n,o){void 0===o&&(o=[]);var r=e.call(this,n,o,rt)||this;return r.loadedItems=0,r.itemsToLoad=0,(0,t.bindAll)(r,'itemLoaded'),r.on('add',r.onAdd),r.on('reset',r.onReset),r.on('remove',r.onRemove),r.forEach((function(t){return r.onAdd(t)})),r}return it(n,e),n.prototype.onAdd=function(t){this.module.framesById[t.id]=t},n.prototype.onReset=function(t,e){var n=this;((null==e?void 0:e.previousModels)||[]).map((function(t){return n.onRemove(t)}))},n.prototype.onRemove=function(t){t.onRemove(),delete this.module.framesById[t.id]},n.prototype.initRefs=function(){this.forEach((function(t){return t.initRefs()}))},n.prototype.itemLoaded=function(){this.loadedItems++,this.loadedItems>=this.itemsToLoad&&(this.trigger('loaded:all'),this.listenToLoadItems(!1))},n.prototype.listenToLoad=function(){this.loadedItems=0,this.itemsToLoad=this.length,this.listenToLoadItems(!0)},n.prototype.listenToLoadItems=function(t){var e=this;this.forEach((function(n){return n[t?'on':'off']('loaded',e.itemLoaded)}))},n}(Z);var st=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)}}(),lt=function(t){function e(e){var n=this,o=e.em,r=e.config,i=r.scripts,a=r.styles;return(n=t.call(this,e,{scripts:i,styles:a})||this).set('frames',new at(e)),n.on('change:zoom',n.onZoomChange),n.on('change:x change:y',n.onCoordsChange),n.on('change:pointer change:pointerScreen',n.onPointerChange),n.listenTo(o,"change:device ".concat(V),n.updateDevice),n.listenTo(o,G.select,n._pageUpdated),n}return st(e,t),e.prototype.defaults=function(){return{frame:'',frames:[],rulers:!1,zoom:100,x:0,y:0,scripts:[],styles:[],pointer:u.pH,pointerScreen:u.pH}},Object.defineProperty(e.prototype,"frames",{get:function(){return this.get('frames')},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=this.em.Pages._initPage();this.set('frames',t.getFrames()),this.updateDevice({frame:t.getMainFrame()})},e.prototype._pageUpdated=function(t,e){var n=this.em;n.setSelected(),n.get('readyCanvas')&&n.stopDefault(),null==e||e.getFrames().map((function(t){return t.disable()})),this.set('frames',t.getFrames()),this.updateDevice({frame:t.getMainFrame()})},e.prototype.updateDevice=function(t){void 0===t&&(t={});var e=this.em,n=e.getDeviceModel(),o=t.frame||e.getCurrentFrameModel();if(o&&n){var r=n.attributes,i=r.width,a=r.height;o.set({width:i,height:a},{noUndo:1})}},e.prototype.onZoomChange=function(){var t=this.em,e=this.module;this.get('zoom')<1&&this.set('zoom',1),t.trigger(e.events.zoom)},e.prototype.onCoordsChange=function(){var t=this.em,e=this.module;t.trigger(e.events.coords)},e.prototype.onPointerChange=function(){var t=this.em,e=this.module;t.trigger(e.events.pointer)},e.prototype.getPointerCoords=function(t){void 0===t&&(t=u.vA.World);var e=this.attributes,n=e.pointer,o=e.pointerScreen;return t===u.vA.World?n:o},e}(_.Z);const ct=lt;var ut=n(675),pt=n(184),dt=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)}}(),ft=function(e){function n(n,o){void 0===o&&(o=[]);var r=e.call(this,n,o,ut.Z)||this;r.on('add',r.onAdd),r.on('change',r.onChange),r.on('remove',r.onRemove);var i=r.em;r.refreshDbn=(0,t.debounce)((function(){return r.refresh()}),0);var a="component:resize styleable:change component:input ".concat(pt.g.update," frame:updated undo redo");return r.listenTo(i,a,(function(){return r.refreshDbn()})),r}return dt(n,e),Object.defineProperty(n.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"events",{get:function(){return this.module.events},enumerable:!1,configurable:!0}),n.prototype.refresh=function(){var t=this.em,e=this.events;t.trigger(e.spot)},n.prototype.onAdd=function(t){this.__trgEvent(this.events.spotAdd,{spot:t})},n.prototype.onChange=function(t){this.__trgEvent(this.events.spotUpdate,{spot:t})},n.prototype.onRemove=function(t){this.__trgEvent(this.events.spotRemove,{spot:t})},n.prototype.__trgEvent=function(t,e){this.module.em.trigger(t,e),this.refreshDbn()},n}(Z);const ht=ft;var gt;!function(t){t["dragEnter"]="canvas:dragenter",t["dragOver"]="canvas:dragover",t["dragEnd"]="canvas:dragend",t["dragData"]="canvas:dragdata",t["drop"]="canvas:drop",t["spot"]="canvas:spot",t["spotAdd"]="canvas:spot:add",t["spotUpdate"]="canvas:spot:update",t["spotRemove"]="canvas:spot:remove",t["coords"]="canvas:coords",t["zoom"]="canvas:zoom",t["pointer"]="canvas:pointer",t["refresh"]="canvas:refresh",t["frameLoad"]="canvas:frame:load",t["frameLoadHead"]="canvas:frame:load:head",t["frameLoadBody"]="canvas:frame:load:body"}(gt||(gt={}));const vt=gt;var yt=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)}}(),mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return yt(e,t),Object.defineProperty(e.prototype,"pfx",{get:function(){return this.ppfx+this.config.stylePrefix||''},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ppfx",{get:function(){return this.em.config.stylePrefix||''},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"module",{get:function(){var t,e;return null!==(e=null===(t=this.model)||void 0===t?void 0:t.module)&&void 0!==e?e:this.collection.module},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this.module.config},enumerable:!1,configurable:!0}),e.prototype.preinitialize=function(t){this.className=''},e}(u.G7);const bt=mt;var wt=n(491),_t=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)}}();const xt=function(t){function e(e,n){void 0===e&&(e={}),void 0===n&&(n=!1);var o=t.call(this,e)||this;return o.itemsView='',o.itemType='type',o.reuseView=!1,o.viewCollection=[],n&&o.listenTo(o.collection,'add',o.addTo),o}return _t(e,t),e.prototype.addTo=function(t){this.add(t)},e.prototype.itemViewNotFound=function(t){},e.prototype.add=function(t,e){var n,o=this.reuseView,r=this.viewCollection,i=e||null,a=t.get(this.itemType);n=t.view&&o?t.view:this.renderView(t,a),r.push(n);var s=n.render().el;i?i.appendChild(s):this.$el.append(s)},e.prototype.render=function(){var t=this,e=document.createDocumentFragment();return this.clearItems(),this.$el.empty(),this.collection.length&&this.collection.each((function(n){return t.add(n,e)})),this.$el.append(e),this.onRender(),this},e.prototype.onRender=function(){},e.prototype.onRemoveBefore=function(t,e){},e.prototype.onRemove=function(t,e){},e.prototype.remove=function(t){void 0===t&&(t={});var e=this.viewCollection;return this.onRemoveBefore(e,t),this.clearItems(),u.G7.prototype.remove.apply(this,t),this.onRemove(e,t),this},e.prototype.clearItems=function(){this.viewCollection},e}(bt);var Ct=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)}}();const St=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this;n.config=e.config||{};var o=n.model;return n.listenTo(o,'change',n.render),n.listenTo(o,'destroy remove',n.remove),n.listenTo(o.get('selectors'),'change',n.render),n}return Ct(e,t),e.prototype.tagName=function(){return'style'},e.prototype.render=function(){var t=this.model,e=this.el,n=t.get('important');return e.innerHTML=t.toCSS({important:n}),this},e}(u.G7);var Ot=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)}}();const Tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype._createElement=function(){return document.createTextNode('')},e.prototype.render=function(){var t=this.model,e=t.get('important');return this.el.textContent=t.getDeclaration({important:e}),this},e}(St);var kt=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)}}(),Et=function(t,e){return"".concat(t).concat(e?"-".concat(parseFloat(e)):'')},Pt=function(e){function n(n){var o=e.call(this,n)||this;(0,t.bindAll)(o,'sortRules');var r=n.config||{};o.atRules={},o.config=r,o.em=r.em,o.pfx=r.stylePrefix||'',o.className=o.pfx+'rules';var i=o.collection;return o.listenTo(i,'add',o.addTo),o.listenTo(i,'reset',o.render),o}return kt(n,e),n.prototype.addTo=function(t){this.addToCollection(t)},n.prototype.addToCollection=function(t,e){if(this.renderStarted){var n,o,r=e||null,i={model:t,config:this.config};if('keyframes'===t.get('atRuleType')){var a=t.getAtRule(),s=this.atRules[a];if(!s){var l=document.createElement('style');s=document.createTextNode(''),l.appendChild(document.createTextNode("".concat(a,"{"))),l.appendChild(s),l.appendChild(document.createTextNode('}')),this.atRules[a]=s,n=l}o=new Tt(i),s.appendData(o.render().el.textContent)}else n=(o=new St(i)).render().el;var c=this.className,u=t.get('mediaText'),p=Et(c),d=p;if(u&&(d=Et(c,this.getMediaWidth(u))),n){var f=r||this.el,h=void 0;try{h=f.querySelector("#".concat(d))}catch(t){}h||(h=f.querySelector("#".concat(p))),null==h||h.appendChild(n)}return n}},n.prototype.getMediaWidth=function(t){return t&&t.replace("(".concat(this.em.getConfig().mediaCondition,": "),'').replace(')','')},n.prototype.sortRules=function(t,e){var n=-1!==(this.em.getConfig().mediaCondition||'').indexOf('min-width');return n?(n?t:e)-(n?e:t):0},n.prototype.render=function(){var t=this;this.renderStarted=!0,this.atRules={};var e=this,n=e.em,o=e.$el,r=e.collection,i=this.className,a=document.createDocumentFragment();o.empty();var s=n.Devices.getAll().pluck('priority').sort(this.sortRules);return s.every((function(t){return t}))&&s.unshift(0),s.forEach((function(t){return a.appendChild((0,wt.ut)('div',{id:Et(i,t)}))})),r.each((function(e){return t.addToCollection(e,a)})),o.append(a),o.attr('class',i),this},n}(u.G7);const At=Pt;var jt='text/html',Mt=jt;var Lt=void 0&&(void 0).__assign||function(){return Lt=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;){var o=e.indexOf('/*'),r=e.indexOf('*/')+2;e=e.replace(e.slice(o,r),'')}for(var i=e.split(';'),a=0,s=i.length;a'!=="".concat(t.outerHTML).slice(-2)||(a.void=!0),i&&!a.components&&!e.skipChildren){var c=r[0];1===i&&3===c.nodeType?(!a.type&&(a.type='text'),a.components={type:'textnode',content:c.nodeValue}):a.components=this.parseNodes(t,Lt(Lt({},e),{inSvg:e.inSvg||'svg'===a.type}))}var u=a.components;if(!a.type&&(null==u?void 0:u.length)){for(var p=n.textTypes,d=void 0===p?[]:p,f=n.textTags,h=void 0===f?[]:f,g=!0,v=!1,y=0;y".concat(e,"
"),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}(g,d),y=v,m=v;h&&(y=m.documentElement,u.doctype=(0,wt.hy)(m.doctype));var b=y.querySelectorAll('script'),w=b.length;if(!((0,t.isUndefined)(c.allowScripts)?d.allowScripts:c.allowScripts))for(;w--;)null===(s=b[w].parentNode)||void 0===s||s.removeChild(b[w]);if(d.allowUnsafeAttr&&d.allowUnsafeAttrValue||this.__sanitizeNode(y,d),r){for(var _=y.querySelectorAll('style'),x=_.length,C='';x--;)C=_[x].innerHTML+C,null===(l=_[x].parentNode)||void 0===l||l.removeChild(_[x]);C&&(u.css=r.parse(C))}null==e||e.trigger("".concat(Nt,":root"),{input:g,root:y});var S=[];if(h)u.head=this.parseNode(m.head,p),u.root=this.parseNodeAttr(y),S=this.parseNode(m.body,p);else{var O=this.parseNodes(y,p);S=1!==O.length||p.returnArray?O:O[0]}return u.html=S,null==e||e.trigger(Nt,{input:g,output:u}),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)}))}}};var Ft=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)}}(),Vt=void 0&&(void 0).__assign||function(){return Vt=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.Hn);const zt=Bt;var Ut=void 0&&(void 0).__assign||function(){return Ut=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0}))},Qt=function(t,e){void 0===e&&(e={});var n=[],o=e.changed;if(e.fromInstance||e.noPropagate||e.fromUndo||o&&Jt(t,o))return n;var r=Xt(t)||[],i=Zt(t);return n=(i?Wt([i],Xt(i)||[],!0):r).filter((function(e){return e!==t})).filter((function(t){return!(o&&Jt(t,o))}))},te=function(t,e){for(var n=t,o=t.parent(e);o&&Gt(o);)n=o,o=o.parent(e);return n},ee=function(t,e){void 0===e&&(e={});var n=Zt(t),o=n&&Xt(n);!e.skipRefs&&o&&n.set(Ye,o.filter((function(e){return e!==t}))),t.set(Ze,0),t.components().forEach((function(t){return ee(t,e)}))},ne=function(t,e,n,o){void 0===o&&(o={});var r=Zt(t),i=Xt(t);(r||i)&&t.em.log(e,{model:t,toUp:n,context:'symbols',opts:o})},oe=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=!!Xt(t);if((m=Qt(t,Ut(Ut({},i),{changed:'components:add'}))).length){var c=Zt(e);s=Xt(c||e)||[],(s=Wt([],s,!0)).push(c||e)}!a&&ne(t,'add',m,{opts:o,addedInstances:s.map((function(t){return t.cid})),added:e.cid}),m.forEach((function(n){var r=te(n),i=s.filter((function(t){var e=te(t,{prev:1});return r&&e&&e===r}))[0]||e.clone({symbol:!0,symbolInv:l});n.append(i,Ut({fromInstance:t},o))}))}else{var u=Zt(e);if(u&&!o.temporary&&u.set(Ye,Xt(u).filter((function(t){return t!==e}))),!Kt(e)&&!o.skipRefsUp){var p='components:remove',d=o.index,f=e.parent(),h=Ut({fromInstance:e},o),g=Kt(e),v=function(t){var e=t.parent();e&&!Jt(e,p)&&t.remove(h)};m=Jt(f,p)?[]:Qt(e,i);g&&(m=f&&Qt(f,Ut(Ut({},i),{changed:p})),v=function(t){var e=t.components().at(d);e&&e.remove(Ut({fromInstance:f},h))}),!a&&ne(t,'remove',m,{opts:o,removed:e.cid,isSymbNested:g}),m.forEach(v)}}else{var y=e,m=Qt(t,Ut(Ut({},i),{changed:'components:reset'})),b=y.models,w=new Set;ne(t,'reset',m,{components:b}),m.forEach((function(e){var o=e.components(),r=b.map((function(t,e){return!Gt(t)||w.has(t)?(w.add(t),t.clone({symbol:!0})):o.at(e)}));o.reset(r,Ut({fromInstance:t},n))}))}t.__changesUp(r)},re=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)}}(),ie=void 0&&(void 0).__assign||function(){return ie=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&g.reset(h,o)}else d.components=h}return d}))},ue=function(e){function n(t,n){var o=e.call(this,t,n)||this;o.opt=n,o.listenTo(o,'add',o.onAdd),o.listenTo(o,'remove',o.removeChildren),o.listenTo(o,'reset',o.resetChildren);var r=n.em,i=n.config;return o.config=i,o.em=r,o.domc=n.domc||(null==r?void 0:r.Components),o}return re(n,e),Object.defineProperty(n.prototype,"events",{get:function(){var t;return null===(t=this.domc)||void 0===t?void 0:t.events},enumerable:!1,configurable:!0}),n.prototype.resetChildren=function(t,e){var n=this;void 0===e&&(e={});var o=this,r=e.previousModels||[],i=r.filter((function(e){return!t.get(e.cid)})),a=le(t),s=le(r).filter((function(t){return a.indexOf(t)>=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=le(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=ce(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.g.remove,t),r&&qt(t)&&Kt(t)&&r.symbols.__trgEvent(r.events.symbolInstanceRemove,{component:t},!0));var d=t.components();d.forEach((function(t){oe(t,t,d,ie(ie({},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.frame=r.frame,i.config=r.config||{},i.set('attributes',Ue(Ue({},(0,t.result)(i,'defaults').attributes||{}),i.get('attributes')||{})),i.ccid=o.createId(i,r),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(Qe,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=0)d="'".concat(p.replace(/'/g,'''),"'");else{var f=(0,t.isString)(p)?p.replace(/"/g,'"'):p;d="\"".concat(f,"\"")}r.push("".concat(u,"=").concat(d))}}var h=r.length?" ".concat(r.join(' ')):'',g=o.getInnerHTML(n),v="<".concat(i).concat(h).concat(a?'/':'',">").concat(g);return!a&&(v+="")),v},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.getAttrToHTML=function(t){var e=this.getAttributes();return Ge(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[Ze],r=n[Ye];r&&(0,t.isArray)(r)&&(n[Ye]=r.filter((function(t){return t})).map((function(t){return t.getId?t.getId():t}))),o&&!(0,t.isString)(o)&&(n[Ze]=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=Ue({},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=qe(i.tagVarStart||'{[ '),s=qe(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,Ue({action:pt.W.remove},t)),o||(e.components('',t),e.components().removeChildren(e,void 0,t))},i=Ue({},t);return[this,n].map((function(t){return t.trigger(pt.g.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.W.move;this.remove({action:i,temporary:1}),t.append(this,Ue({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}(zt);const en=tn;var nn=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)}}(),on=void 0&&(void 0).__assign||function(){return on=Object.assign||function(t){for(var e,n=1,o=arguments.length;n';if(n.stopDefault(),n.inAbsoluteMode()){var u=n.Components.getWrapper(),p=u.append({})[0],d=n.Commands.run('core:component-drag',{event:t,guidesInfo:1,center:1,target:p,onEnd:function(t,n,i){var a;if(!i.cancelled){a=u.append(c)[0];var s=o.getOffset(),l=p.getStyle(),d=l.top,f=l.left,h=l.position,g=(0,wt.GX)(t.target),v=parseInt("".concat(parseFloat(f)+g.x-s.left),10),y=parseInt("".concat(parseFloat(d)+g.y-s.top),10);a.addStyle({left:v+'px',top:y+'px',position:h})}e.handleDragEnd(a,r),p.remove()}});a=function(e){return d.stop(t,{cancel:e})},s=function(t){return c=t}}else{var f=new l.Sorter(cn({em:n,wmargin:1,nested:1,canvasRelative:1,direction:'a',container:this.el,placer:o.getPlacerEl(),containerSel:'*',itemSel:'*',pfx:'gjs-',onEndMove:function(t){return e.handleDragEnd(t,r)},document:this.el.ownerDocument},this.sortOpts||{}));f.setDropContent(c),f.startSort(),this.sorter=f,a=function(t){t&&(f.moved=!1),f.endMove()},s=function(t){return f.setDropContent(t)}}this.dragStop=a,this.dragContent=s,n.trigger('canvas:dragenter',r,c)}},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){t.preventDefault();var e=this.dragContent,n=t.dataTransfer,o=this.getContentByData(n).content;t.target.style.border='',o&&e&&e(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('dragContent'),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 pn=un;var dn=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)}}(),fn=void 0&&(void 0).__assign||function(){return fn=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,wt.ut)('script',fn({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(hn([],l.get('scripts'),!0))}},o.prototype.renderStyles=function(e){void 0===e&&(e={});var n=this.getHead(),o=this.getCanvasModel(),r=function(e){return e.map((function(e){return{tag:'link',attributes:fn({rel:'stylesheet'},(0,t.isString)(e)?{href:e}:e)}}))},i=r(e.prev||o.previous('styles')),a=r(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,wt.SJ)(n,l)},o.prototype.renderHead=function(){var t=this.model,e=this.em,n=t.root,o=e.Components.getType(rn).view;this.headView=new o({el:this.getHead(),model:n.head,config:fn(fn({},n.config),{frameView:this})}).render()},o.prototype.renderBody=function(){var t,n,o=this,r=this,i=r.config,a=r.em,s=r.model,l=r.ppfx,c=this.getDoc(),u=this.getBody(),p=this.getWindow(),d=s.hasAutoHeight(),f=a.config;p._isEditor=!0,this.renderStyles({prev:[]});(0,wt.R3)(u,""));var h=s.root,g=a.Components.getType('wrapper').view;this.wrapper=new g({model:h,config:fn(fn({},h.config),{em:a,frameView:this})}).render(),(0,wt.R3)(u,null===(t=this.wrapper)||void 0===t?void 0:t.el),(0,wt.R3)(u,new At({collection:s.getStyles(),config:fn(fn({},a.Css.getConfig()),{frameView:this})}).render().el),(0,wt.R3)(u,this.getJsContainer()),(0,wt.on)(u,'click',(function(t){var e;return t&&'A'==(null===(e=t.target)||void 0===e?void 0:e.tagName)&&t.preventDefault()})),(0,wt.on)(u,'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:!i.infiniteCanvas}}].forEach((function(t){return t.event.split(' ').forEach((function(e){c.addEventListener(e,(function(e){return o.el.dispatchEvent((0,wt.t3)(e,t.class))}),t.opts)}))})),this._toggleEffects(!0),(0,e.hasDnd)(a)&&(this.droppable=new pn(a,null===(n=this.wrapper)||void 0===n?void 0:n.el)),this.loaded=!0,s.trigger('loaded')},o.prototype._toggleEffects=function(t){var e=t?wt.on:wt.S1,n=this.getWindow();n&&e(n,"".concat(wt.G1," resize"),this._emitUpdate)},o.prototype._emitUpdate=function(){this.model._emitUpdated()},o}(bt);const vn=gn;var yn=n(668),mn=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)}}(),bn=void 0&&(void 0).__assign||function(){return bn=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 \n
\n
\n
\n ")).append(e.el);var l=(0,wt.ut)('div',{class:"".concat(o,"tools"),style:'pointer-events:none; display: none'},"\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\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 _n=wn;var xn=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)}}(),Cn=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 xn(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 _n(t,this.canvasView)},e}(xt);const Sn=Cn;var On=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)}}(),Tn=void 0&&(void 0).__assign||function(){return Tn=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 Sn({collection:i},Tn(Tn({},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=O?O/2-C/2:-_)+_)*P,y:(-v.y+T/2-S/2+x)*P};if(m){var M=s.getZoomMultiplier(),L=(T*M-T)/2;j.y=(-v.y+x)*P-L/M}s.setCoords(j.x,j.y)},o.prototype.isElInViewport=function(t){var n=(0,e.getElement)(t),o=(0,wt.Ut)(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,wt.Ut)(t),r=n?{x:0,y:0}:(0,wt.GX)(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,wt.Ut)(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,wt.GX)(),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,wt.BM)(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,wt.ut)('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 (").concat(a,".bind(item))(").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
\n
\n
\n
\n ").concat(i.extHl?"
"):'',"\n
\n
\n
\n
\n
\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 En=kn;var Pn=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)}}(),An=void 0&&(void 0).__assign||function(){return An=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}(to);const co=lo;var uo=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)}}(),po=void 0&&(void 0).__assign||function(){return po=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0},n}(en);var Fo=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").concat(l).concat(s,""):s},n.prototype.__postAdd=function(){var t,n=null===(t=this.em)||void 0===t?void 0:t.UndoManager;return!this.__hasUm&&(null==n||n.add(this)),e.prototype.__postAdd.call(this)},n.prototype.__postRemove=function(){var t,n=null===(t=this.em)||void 0===t?void 0:t.UndoManager;return null==n||n.remove(this),e.prototype.__postRemove.call(this)},n.isComponent=function(){return!1},n}(en);const lr=sr;var cr=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)}}(),ur=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.compView=gr,t}return cr(n,e),n.prototype.initialize=function(t){this.opts=t||{},this.config=t.config||{},this.em=this.config.em;var e=this.collection;this.listenTo(e,'add',this.addTo),this.listenTo(e,'reset',this.resetChildren),this.listenTo(e,'remove',this.removeChildren)},n.prototype.removeChildren=function(t,e,n){var o=this;void 0===n&&(n={}),t.views.forEach((function(t){if(t){var e=t.childrenView,n=t.scriptContainer;e&&e.stopListening(),(0,wt.L_)(n),t.remove.apply(t)}})),t.components().forEach((function(t){return o.removeChildren(t,e,n)}))},n.prototype.addTo=function(t){this.addToCollection(t,null,this.collection.indexOf(t))},n.prototype.addToCollection=function(e,n,o){for(var r=this,i=r.config,a=r.opts,s=r.em,l=i.frameView,c=(null==l?void 0:l.model)&&e.getView(l.model),u=a.componentTypes||(null==s?void 0:s.Components.getTypes()),p=e.get('type')||'default',d=this.compView,f=0;f=0&&l0&&u=0&&p0&&c<=s)},o.prototype.scrollIntoView=function(t){var e;if(void 0===t&&(t={}),!this.isInViewport()||t.force){var n=this.el;if('smooth'!==t.behavior){var o=this.getOffsetRect();null===(e=n.ownerDocument.defaultView)||void 0===e||e.scrollTo(0,o.top)}else n.scrollIntoView(fr({behavior:'smooth',block:'nearest'},t))}},o.prototype.reset=function(){var t=this.el;this.el='',this._ensureElement(),this._setData(),(0,wt.dL)(t,this.el),this.render()},o.prototype._setData=function(){var t=this.model,e=t.components();this.$el.data({model:t,collection:e,view:this})},o.prototype._createElement=function(t){return this.createDoc.createElement(t)},o.prototype.renderChildren=function(){this.updateContent();var t=this.getChildrenContainer(),e=this.childrenView||new pr({collection:this.model.get('components'),config:this.config,componentTypes:this.opts.componentTypes});e.render(t),this.childrenView=e;for(var n=Array.prototype.slice.call(e.el.childNodes),o=0,r=n.length;o0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]-1;return pi(pi({},i),!u||p?{reason:ci.TargetReject}:{result:!0})},o.prototype.allById=function(){return this.componentsById},o.prototype.getById=function(t){return this.componentsById[t]||null},o.prototype.destroy=function(){var t,e=this.allById();Object.keys(e).forEach((function(t){return e[t]&&e[t].remove()})),null===(t=this.componentView)||void 0===t||t.remove(),[this.em,this.componentsById,this.componentView].forEach((function(t){return{}}))},o}(b);const gi=hi;const vi={stylePrefix:'css-',rules:[]};var yi=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)}}(),mi=Number.MAX_VALUE,bi=function(n){function o(){var e=n.call(this)||this;return(0,t.bindAll)(e,'sortRules'),e.compCls=[],e.ids=[],e}return yi(o,n),o.prototype.buildFromModel=function(t,e){var n=this;void 0===e&&(e={});var o='',r=this.em,i=r&&r.getConfig().avoidInlineStyle,a=t.styleToString(),s=t.classes;return this.ids.push("#".concat(t.getId())),s.forEach((function(t){return n.compCls.push(t.getFullName())})),!i&&a&&(o="#".concat(t.getId(),"{").concat(a,"}")),t.components().forEach((function(t){return o+=n.buildFromModel(t,e)})),o},o.prototype.build=function(n,o){var r=this;void 0===o&&(o={});var i=o.json,a=o.em,s=o.cssc||(null==a?void 0:a.Css);this.em=a,this.compCls=[],this.ids=[],this.model=n;var l=[],c=n?this.buildFromModel(n,o):'',u=(0,t.isUndefined)(o.clearStyles)&&a?a.getConfig().clearStyles:o.clearStyles;if(s){var p=o.rules||s.getAll(),d={},f=[];o.onlyMatched&&n&&(0,e.hasWin)()&&(p=this.matchedRules(n,p)),p.forEach((function(t){var e=t.getAtRule();if(e){var n=d[e];n?n.push(t):d[e]=[t]}else{var a=r.buildFromRule(t,f,o);i?l.push(a):c+=a}})),this.sortMediaObject(d).forEach((function(t){var e='',n=t.key;t.value.forEach((function(t){var a=r.buildFromRule(t,f,o);t.get('singleAtRule')?c+="".concat(n,"{").concat(a,"}"):e+=a,i&&l.push(a)})),e&&(c+="".concat(n,"{").concat(e,"}"))})),a&&u&&p.remove&&p.remove(f)}return i?l.filter((function(t){return t})):c},o.prototype.buildFromRule=function(t,e,n){var o,r=this;void 0===n&&(n={});var i,a='',s=this.model,l=t.selectorsToString({skipAdd:1}),c=t.get('selectorsAdd'),u=t.get('singleAtRule');if(null===(o=t.get('selectors'))||void 0===o||o.forEach((function(t){var e=t.getFullName();(r.compCls.indexOf(e)>=0||r.ids.indexOf(e)>=0||n.keepUnusedStyles)&&(i=1)})),l&&i||c||u||!s){var p=t.getDeclaration({body:1});p&&(n.json?a=t:a+=p)}else e.push(t);return a},o.prototype.matchedRules=function(t,e){var n=this,o=t.getEl(),r=[];return e.forEach((function(t){try{t.selectorsToString().split(',').some((function(t){return null==o?void 0:o.matches(n.__cleanSelector(t))}))&&r.push(t)}catch(t){}})),t.components().forEach((function(t){r=r.concat(n.matchedRules(t,e))})),r=r.filter((function(t,e){return r.indexOf(t)===e}))},o.prototype.getQueryLength=function(t){var e=/(-?\d*\.?\d+)\w{0,}/.exec(t);return e?parseFloat(e[1]):mi},o.prototype.sortMediaObject=function(e){var n=this;void 0===e&&(e={});var o=[];return(0,t.each)(e,(function(t,e){return o.push({key:e,value:t})})),o.sort((function(t,e){var o=[t.key,e.key].every((function(t){return-1!==t.indexOf('min-width')})),r=o?t.key:e.key,i=o?e.key:t.key;return n.getQueryLength(r)-n.getQueryLength(i)}))},o.prototype.sortRules=function(t,e){var n=function(t){return t.get('mediaText')||''},o=[n(t),n(e)].every((function(t){return-1!==t.indexOf('min-width')})),r=n(o?t:e),i=n(o?e:t);return this.getQueryLength(r)-this.getQueryLength(i)},o.prototype.__cleanSelector=function(t){return t.split(' ').map((function(t){return t.split(':')[0]})).join(' ')},o}(u.Hn);const wi=bi;var _i=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)}}(),xi=void 0&&(void 0).__assign||function(){return xi=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0}))},o.prototype.setIdRule=function(e,n,o){void 0===n&&(n={}),void 0===o&&(o={});var r=o.addOpts,i=void 0===r?{}:r,a=o.mediaText,s=o.state||'',l=(0,t.isUndefined)(a)?this.em.getCurrentMedia():a,c=this.em.Selectors.add({name:e,type:ve.TYPE_ID},i),u=this.add(c,s,l,{},i);return u.setStyle(n,ji(ji({},o),i)),u},o.prototype.getIdRule=function(e,n){void 0===n&&(n={});var o=n.mediaText,r=n.state||'',i=(0,t.isUndefined)(o)?this.em.getCurrentMedia():o,a=this.em.Selectors.get(e,ve.TYPE_ID);return a&&this.get(a,r,i)},o.prototype.setClassRule=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var o=n.state||'',r=n.mediaText||this.em.getCurrentMedia(),i=this.em.Selectors.add({name:t,type:ve.TYPE_CLASS}),a=this.add(i,o,r);return a.setStyle(e,n),a},o.prototype.getClassRule=function(t,e){void 0===e&&(e={});var n=e.state||'',o=e.mediaText||this.em.getCurrentMedia(),r=this.em.Selectors.get(t,ve.TYPE_CLASS);return r&&this.get(r,n,o)},o.prototype.remove=function(e,n){var o=(0,t.isString)(e)?this.getRules(e):e,r=this.getAll().remove(o,n);return(0,t.isArray)(r)?r:[r]},o.prototype.clear=function(t){return void 0===t&&(t={}),this.getAll().reset([],t),this},o.prototype.getComponentRules=function(e,n){void 0===n&&(n={});var o=n.state,r=n.mediaText;n.current&&(o=this.em.get('state')||'',r=this.em.getCurrentMedia());var i=e.getId();return this.getAll().filter((function(e){return!(!(0,t.isUndefined)(o)&&e.get('state')!==o)&&(!(!(0,t.isUndefined)(r)&&e.get('mediaText')!==r)&&e.getSelectorsString()==="#".concat(i))}))},o.prototype.render=function(){var t;return null===(t=this.rulesView)||void 0===t||t.remove(),this.rulesView=new At({collection:this.rules,config:this.config}),this.rulesView.render().el},o.prototype.checkId=function(e,n){void 0===n&&(n={});var o=n.idMap,r=void 0===o?{}:o,i=[];return Object.keys(r).length?((Array.isArray(e)?e:[e]).forEach((function(e){var n=e.selectors;if(n&&1==n.length){var o=n[0];if((0,t.isString)(o)){if('#'===o[0]){var a=o.substring(1),s=r[a];a&&s&&(n[0]="#".concat(s),i.push(e))}}else if(o.name&&o.type===ve.TYPE_ID){(s=r[o.name])&&(o.name=s,i.push(e))}}})),i):i},o.prototype.destroy=function(){var t;this.rules.reset(),this.rules.stopListening(),null===(t=this.rulesView)||void 0===t||t.remove()},o}(b);const Di=Li;const Ni={appendTo:'',blocks:[],appendOnClick:!1,custom:!1};var Ii=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)}}();const Fi=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Ii(n,e),n.prototype.defaults=function(){return{label:'',content:'',media:'',category:'',activate:!1,select:void 0,resetId:!1,disable:!1,onClick:void 0,attributes:{}}},Object.defineProperty(n.prototype,"category",{get:function(){var t=this.get('category');return t instanceof Ce?t:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"parent",{get:function(){return this.collection},enumerable:!1,configurable:!0}),n.prototype.getId=function(){return this.id},n.prototype.getLabel=function(){return this.get('label')},n.prototype.getMedia=function(){return this.get('media')},n.prototype.getContent=function(){return this.get('content')},n.prototype.getCategoryLabel=function(){var e=this.get('category');return(0,t.isFunction)(null==e?void 0:e.get)?e.get('label'):(null==e?void 0:e.label)?null==e?void 0:e.label:e},n}(u.Hn);var Vi=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)}}(),Ri=function(t){function e(e,n){var o=t.call(this,e)||this;return o.em=n.em,o.on('add',o.handleAdd),o}return Vi(e,t),e.prototype.getCategories=function(){return this.em.Blocks.getCategories()},e.prototype.handleAdd=function(t){this.initCategory(t)},e}(ke);const Hi=Ri;var Bi;Ri.prototype.model=Fi,function(t){t["add"]="block:add",t["remove"]="block:remove",t["removeBefore"]="block:remove:before",t["update"]="block:update",t["dragStart"]="block:drag:start",t["drag"]="block:drag",t["dragEnd"]="block:drag:stop",t["categoryUpdate"]="block:category:update",t["custom"]="block:custom",t["all"]="block"}(Bi||(Bi={}));var zi=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)}}(),Ui=function(n){function o(t,e){void 0===e&&(e={});var o=n.call(this,t)||this,r=o.model;return o.em=e.em,o.config=e,o.endDrag=o.endDrag.bind(o),o.ppfx=e.pStylePrefix||'',o.listenTo(r,'destroy remove',o.remove),o.listenTo(r,'change',o.render),o}return zi(o,n),o.prototype.events=function(){return{click:'handleClick',mousedown:'startDrag',dragstart:'handleDragStart',drag:'handleDrag',dragend:'handleDragEnd'}},o.prototype.__getModule=function(){return this.em.Blocks},o.prototype.handleClick=function(e){var n=this,o=n.config,r=n.model,i=n.em,a=r.get('onClick')||o.appendOnClick;if(i.trigger('block:click',r,e),a){if((0,t.isFunction)(a))return a(r,null==i?void 0:i.getEditor(),{event:e});var s,l,c=o.getSorter(),u=r.get('content'),p=i.getSelected();if(c.setDropContent(u),p)if(c.validTarget(p.getEl(),u).valid)s=p;else{var d=p.parent();d&&c.validTarget(d.getEl(),u).valid&&(s=d,l=d.components().indexOf(p)+1)}if(!s){var f=i.getWrapper();c.validTarget(f.getEl(),u).valid&&(s=f)}var h=s&&s.append(u,{at:l})[0];h&&i.setSelected(h,{scroll:1})}},o.prototype.startDrag=function(t){var e=this,n=e.config,o=e.em,r=e.model,i=r.get('disable');if(0===t.button&&n.getSorter&&!this.el.draggable&&!i){o.refreshCanvas();var a=n.getSorter();a.__currentBlock=r,a.setDragHelper(this.el,t),a.setDropContent(this.model.get('content')),a.startSort(this.el),(0,wt.on)(document,'mouseup',this.endDrag)}},o.prototype.handleDragStart=function(t){this.__getModule().__startDrag(this.model,t)},o.prototype.handleDrag=function(t){this.__getModule().__drag(t)},o.prototype.handleDragEnd=function(){this.__getModule().__endDrag()},o.prototype.endDrag=function(){(0,wt.S1)(document,'mouseup',this.endDrag);var t=this.config.getSorter();t.moved=0,t.endMove()},o.prototype.render=function(){var t,n=this,o=n.em,r=n.el,i=n.$el,a=n.ppfx,s=n.model,l=s.get('disable'),c=s.get('attributes')||{},u=c.class||'',p="".concat(a,"block"),d=o&&o.t("blockManager.labels.".concat(s.id))||s.get('label'),f=s.get('render'),h=s.get('media'),g=l?"".concat(p,"--disable"):"".concat(a,"four-color-h");i.attr(c),r.className="".concat(u," ").concat(p," ").concat(a,"one-bg ").concat(g).trim(),r.innerHTML="\n ".concat(h?"
").concat(h,"
"):'',"\n
").concat(d,"
\n "),r.title=c.title||(null===(t=r.textContent)||void 0===t?void 0:t.trim()),r.setAttribute('draggable',"".concat(!(!(0,e.hasDnd)(o)||l)));var v=f&&f({el:r,model:s,className:p,prefix:a});return v&&(r.innerHTML=v),this},o}(u.G7);const Wi=Ui;var $i=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)}}(),qi=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},Gi=function(t){function e(e,n,o){var r=t.call(this,e)||this;r.config=n;var i=n.pStylePrefix||'';return r.em=n.em,r.catName=o,r.pfx=i,r.caretR='fa fa-caret-right',r.caretD='fa fa-caret-down',r.iconClass="".concat(i,"caret-icon"),r.activeClass="".concat(i,"open"),r.className="".concat(i).concat(o,"-category"),r.listenTo(r.model,'change:open',r.updateVisibility),r.model.view=r,r}return $i(e,t),e.prototype.events=function(){return{'click [data-title]':'toggle'}},e.prototype.template=function(t){var e=t.pfx,n=t.label,o=t.catName;return r(Yi||(Yi=qi(["\n
\n \n ","\n
\n
\n "],["\n
\n \n ","\n
\n
\n "])),e,e,n,e,o)},e.prototype.attributes=function(){return this.model.get('attributes')||{}},e.prototype.updateVisibility=function(){this.model.get('open')?this.open():this.close()},e.prototype.open=function(){this.$el.addClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretD),this.getTypeEl().style.display=''},e.prototype.close=function(){this.$el.removeClass(this.activeClass),this.getIconEl().className="".concat(this.iconClass," ").concat(this.caretR),this.getTypeEl().style.display='none'},e.prototype.toggle=function(){var t=this.model;t.set('open',!t.get('open'))},e.prototype.getIconEl=function(){return this.iconEl||(this.iconEl=this.el.querySelector(".".concat(this.iconClass))),this.iconEl},e.prototype.getTypeEl=function(){return this.typeEl||(this.typeEl=this.el.querySelector(".".concat(this.pfx).concat(this.catName,"s-c"))),this.typeEl},e.prototype.append=function(t){this.getTypeEl().appendChild(t)},e.prototype.render=function(){var t=this,e=t.em,n=t.el,o=t.$el,r=t.model,i=t.pfx,a=t.catName,s=e.t("".concat(a,"Manager.categories.").concat(r.id))||r.get('label');return n.innerHTML=this.template({pfx:i,label:s,catName:a}),o.addClass(this.className),o.css({order:r.get('order')}),this.updateVisibility(),this},e}(u.G7);const Ki=Gi;var Yi,Zi=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)}}(),Xi=void 0&&(void 0).__assign||function(){return Xi=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
\n
\n
\n "),this.collection.each((function(e){return t.add(e,n)})),this.append(n);var o="".concat(this.blockContClass,"s ").concat(e,"one-bg ").concat(e,"two-color");return this.$el.addClass(o),this.rendered=!0,this},n}(u.G7);const Qi=Ji;var ta=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)}}(),ea=void 0&&(void 0).__assign||function(){return ea=Object.assign||function(t){for(var e,n=1,o=arguments.length;n',iconSync:'',iconTagOn:'',iconTagOff:'',iconTagRemove:'',componentFirst:!1,custom:!1};var ia=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)}}(),aa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ia(e,t),e.prototype.defaults=function(){return{name:'',label:''}},e.prototype.getName=function(){return this.get('name')},e.prototype.getLabel=function(){return this.get('label')||this.getName()},e}(u.Hn);const sa=aa;aa.prototype.idAttribute='name';var la=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)}}(),ca=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},ua='contentEditable',pa=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,o=e.config||{};return n.config=o,n.module=e.module,n.coll=e.coll||null,n.pfx=o.stylePrefix||'',n.ppfx=o.pStylePrefix||'',n.em=o.em,n.listenTo(n.model,'change:active',n.updateStatus),n}return la(e,t),e.prototype.template=function(){var t=this,e=t.pfx,n=t.model,o=t.config,i=n.get('label')||'';return r(fa||(fa=ca(["\n \n ","\n $"," \n "],["\n \n ","\n $"," \n "])),e,e,e,i,e,e,o.iconTagRemove)},e.prototype.events=function(){return{'click [data-tag-remove]':'removeTag','click [data-tag-status]':'changeStatus','dblclick [data-tag-name]':'startEditTag','focusout [data-tag-name]':'endEditTag'}},e.prototype.getInputEl=function(){return this.inputEl||(this.inputEl=this.el.querySelector('[data-tag-name]')),this.inputEl},e.prototype.startEditTag=function(){var t=this.em,e=this.getInputEl();e[ua]='true',e.focus(),null==t||t.setEditing(!0)},e.prototype.endEditTag=function(){var t=this.model,e=this.em,n=this.getInputEl(),o=n.textContent||'',r=null==e?void 0:e.Selectors;n[ua]='false',null==e||e.setEditing(!1),r&&r.rename(t,o)!==t&&(n.innerText=t.getLabel())},e.prototype.changeStatus=function(){var t=this.model;t.set('active',!t.getActive())},e.prototype.removeTag=function(){this.module.removeSelected(this.model)},e.prototype.updateStatus=function(){var t=this,e=t.model,n=t.$el,o=t.config,r=o.iconTagOn,i=o.iconTagOff,a=n.find('[data-tag-status]');e.get('active')?(a.html(r),n.removeClass('opac50')):(a.html(i),n.addClass('opac50'))},e.prototype.render=function(){var t=this,e=t.pfx,n=t.ppfx,o=t.$el,r=t.model,i="".concat(e,"tag"),a=["".concat(i," ").concat(n,"three-bg")];return r.get('protected')&&a.push("".concat(i,"-protected")),o.html(this.template()),o.attr('class',a.join(' ')),this.updateStatus(),this},e}(u.G7);const da=pa;var fa,ha=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)}}(),ga=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},va=function(e){function n(n){void 0===n&&(n={});var o=e.call(this,n)||this;o.config=n.config||{},o.pfx=o.config.stylePrefix||'',o.ppfx=o.config.pStylePrefix||'',o.className=o.pfx+'tags',o.stateInputId=o.pfx+'states',o.stateInputC=o.pfx+'input-c',o.states=o.config.states||[];var r=o.config.em,i=o.collection;o.target=r;var a=r.Selectors;o.module=a,o.em=r,o.componentChanged=(0,t.debounce)(o.componentChanged.bind(o),0),o.checkSync=(0,t.debounce)(o.checkSync.bind(o),0);var s=pt.g.update,l="".concat(s,":classes"),c="component:toggled ".concat(l),u="".concat(l," ").concat(s,":attributes:id change:state");return o.listenTo(r,c,o.componentChanged),o.listenTo(r,'styleManager:update',o.componentChanged),o.listenTo(r,u,o.__handleStateChange),o.listenTo(r,'styleable:change change:device',o.checkSync),o.listenTo(i,'add',o.addNew),o.listenTo(i,'reset',o.renderClasses),o.listenTo(i,'remove',o.tagRemoved),o.listenTo(a.getAll(),a.events.state,(0,t.debounce)((function(){return o.renderStates()}),0)),o.delegateEvents(),o}return ha(n,e),n.prototype.template=function(t){var e=t.labelInfo,n=t.labelHead,o=t.iconSync,i=t.iconAdd,a=t.pfx,s=t.ppfx;return r(ma||(ma=ga(["
\n
","
\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n $"," \n $"," \n
\n
\n
",":
\n
\n
"],["
\n
","
\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n $"," \n $"," \n
\n
\n
",":
\n
\n
"])),a,a,a,a,n,a,a,a,s,s,s,a,s,s,a,s,a,a,a,a,a,i,a,a,o,a,a,e,a)},n.prototype.events=function(){return{'change [data-states]':'stateChanged','click [data-add]':'startNewTag','focusout [data-input]':'endNewTag','keyup [data-input]':'onInputKeyUp','click [data-sync-style]':'syncStyle'}},n.prototype.syncStyle=function(){var t,e=this.em,n=this.getTarget(),o=e.Css,r=this.getCommonSelectors({opts:{noDisabled:1}}),i=e.get('state'),a=e.getCurrentMedia(),s=[],l=o.get(r,i,a)||o.add(r,i,a);this.getTargets().forEach((function(e){var n=o.getIdRule(e.getId(),{state:i,mediaText:a});t=n.getStyle(),n.setStyle({}),s.push(n)})),t&&l.addStyle(t),e.trigger('component:toggled'),e.trigger('component:sync-style',{component:n,selectors:r,mediaText:a,rule:l,ruleComponents:s,state:i})},n.prototype.tagRemoved=function(t){this.updateStateVis()},n.prototype.addNew=function(t){this.addToClasses(t)},n.prototype.startNewTag=function(){var t,e;null===(t=this.$addBtn)||void 0===t||t.css({display:'none'}),null===(e=this.$input)||void 0===e||e.show().focus()},n.prototype.endNewTag=function(){var t,e;null===(t=this.$addBtn)||void 0===t||t.css({display:''}),null===(e=this.$input)||void 0===e||e.hide().val('')},n.prototype.onInputKeyUp=function(t){var e;13===t.keyCode?(t.preventDefault(),this.addNewTag(null===(e=this.$input)||void 0===e?void 0:e.val())):27===t.keyCode&&this.endNewTag()},n.prototype.checkStates=function(){var t=this.em.getState(),e=this.getStates();e&&e.val(t)},n.prototype.componentChanged=function(t){var e=(void 0===t?{}:t).targets;this.updateSelection(e)},n.prototype.updateSelection=function(e){var n=e||this.getTargets(),o=[];return(n=(0,t.isArray)(n)?n:[n])&&n.length&&(o=this.getCommonSelectors({targets:n}),this.checkSync({validSelectors:o})),this.collection.reset(o),this.updateStateVis(n),this.module.__trgCustom(),o},n.prototype.getCommonSelectors=function(t){var e=void 0===t?{}:t,n=e.targets,o=e.opts,r=void 0===o?{}:o,i=n||this.getTargets();return this.module.__getCommonSelectors(i,r)},n.prototype._commonSelectors=function(){for(var t,e=[],n=0;n",""],["",""])),i,e);else{var u=null==e?void 0:e.getSelectors();if(!u)return'';var p=u.getStyleable(),d=s.get('state'),f=e.getId?r(wa||(wa=ga(["","\n #",""],["","\n #",""])),i,e.getName(),i,e.getId()):'';n=(n=this.collection.getFullString(p))?r(_a||(_a=ga(["",""],["",""])),i,n):e.get('selectorsAdd')||f,n=c&&f?f:n,n+=d?r(xa||(xa=ga([":",""],[":",""])),i,d):'',n=l?l({result:n,state:d,target:e}):n}return n&&"").concat(n,"")},n.prototype.stateChanged=function(t){var e=this.em,n=t.target.value;e.set('state',n)},n.prototype.addNewTag=function(t){var e=t.trim();e&&(this.module.addSelected({label:e}),this.endNewTag())},n.prototype.addToClasses=function(t,e){var n=e,o=this.getClasses(),r=new da({model:t,config:this.config,coll:this.collection,module:this.module}).render().el;return n?n.appendChild(r):o.append(r),r},n.prototype.renderClasses=function(){var t=this,e=document.createDocumentFragment(),n=this.getClasses();n.empty(),this.collection.each((function(n){return t.addToClasses(n,e)})),n.append(e)},n.prototype.getClasses=function(){return this.$el.find('[data-selectors]')},n.prototype.getStates=function(){if(!this.$states){var t=this.$el.find('[data-states]');this.$states=t[0]&&t}return this.$states},n.prototype.getStatesC=function(){return this.$statesC||(this.$statesC=this.$el.find('#'+this.stateInputC)),this.$statesC},n.prototype.renderStates=function(){var t=this.module,e=this.em,n=e.t('selectorManager.emptyState'),o=t.getStates().map((function(t){var n=e.t("selectorManager.states.".concat(t.id))||t.getLabel()||t.id;return"")})).join(''),r=this.getStates();r&&r.html("").concat(o)),this.checkStates()},n.prototype.render=function(){var t=this,e=t.em,n=t.pfx,o=t.ppfx,r=t.config,i=t.$el,a=t.el,s=r.render,l={iconSync:r.iconSync,iconAdd:r.iconAdd,labelHead:e.t('selectorManager.label'),labelInfo:e.t('selectorManager.selected'),ppfx:o,pfx:n,el:a};i.html(this.template(l));var c=s&&s(l);return c&&c!==a&&i.empty().append(c),this.$input=i.find('[data-input]'),this.$addBtn=i.find('[data-add]'),this.$classes=i.find('#'+n+'tags-c'),this.$btnSyncEl=i.find('[data-sync-style]'),this.$input.hide(),this.renderStates(),this.renderClasses(),i.attr('class',"".concat(this.className," ").concat(o,"one-bg ").concat(o,"two-color")),this},n}(u.G7);const ya=va;var ma,ba,wa,_a,xa,Ca=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)}}(),Sa=void 0&&(void 0).__assign||function(){return Sa=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0})):e.slice(1).reduce((function(e,n){return t.__common(e,n)}),e[0]):[]},o.prototype.__updateSelectedByComponents=function(){this.selected.reset(this.__getCommon())},o}(b);const Va=Fa;const Ra={textTags:['br','b','i','u','a','ul','ol'],textTypes:['text','textnode','comment'],parserCss:void 0,parserHtml:void 0,optionsHtml:{htmlType:'text/html',allowScripts:!1,allowUnsafeAttr:!1,allowUnsafeAttrValue:!1,keepEmptyTextNodes:!1}};var Ha,Ba=5,za=6,Ua=7,Wa=11,$a=12,qa=13,Ga=14,Ka=15,Ya=((Ha={})[4]='media',Ha[Ba]='font-face',Ha[za]='page',Ha[Ua]='keyframes',Ha[Wa]='counter-style',Ha[$a]='supports',Ha[qa]='document',Ha[Ga]='font-feature-values',Ha[Ka]='viewport',Ha),Za=(0,t.keys)(Ya),Xa=[Ba,za,Wa,Ka],Ja=Za.filter((function(t){return Xa.indexOf(Number(t))<0})).map((function(t){return Ya[t]})).concat(['container','layer']),Qa=Xa.map((function(t){return Ya[t]})),ts=function(t){void 0===t&&(t='');for(var e=[],n=[],o=t.split(','),r=0,i=o.length;r=0&&(o.singleAtRule=!0),l&&(o.atRuleType=l),c&&(o.selectorsAdd=c),u&&(o.mediaText=u),s&&(t[r-1]=a[0],o.state=s,a.splice(a.length-1,1)),o.selectors=t,o.style=e,o},rs=function(t){var e=t.cssText,n=void 0===e?'':e;return Ja.find((function(t){return 0===n.indexOf("@".concat(t))}))},is=function(t){for(var e=[],n=t.cssRules||[],o=0,r=n.length;o=0;if(p)s=!0,l=Ya[a],c=ns(i);else if(Za.indexOf("".concat(a))>=0||!a&&rs(i)){var d=is(i),f=Ya[a]||rs(i);c=ns(i);for(var h=0,g=d.length;h0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]").concat(n,"")},o.prototype.templateInput=function(t){var e=this.clsField;return"
")},o.prototype.getClbOpts=function(){return{component:this.target,trait:this.model,elInput:this.getInputElem()}},o.prototype.removeView=function(){this.remove(),this.removed()},o.prototype.init=function(){},o.prototype.removed=function(){},o.prototype.onRender=function(t){},o.prototype.onUpdate=function(t){},o.prototype.onEvent=function(t){},o.prototype.onChange=function(e){var n=this.getInputElem();n&&!(0,t.isUndefined)(n.value)&&this.model.set('value',n.value),this.onEvent(Ks(Ks({},this.getClbOpts()),{event:e}))},o.prototype.getValueForTarget=function(){return this.model.get('value')},o.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.value=t)},o.prototype.onValueChange=function(t,e,n){if(void 0===n&&(n={}),n.fromTarget)this.setInputValue(t.get('value')),this.postUpdate();else{var o=this.getValueForTarget();t.setTargetValue(o,n)}},o.prototype.renderLabel=function(){var t=this.$el,e=this.target,n=this.getLabel(),o=this.templateLabel(e);this.createLabel&&(o=this.createLabel({label:n,component:e,trait:this})||''),t.find('[data-label]').append(o)},o.prototype.getLabel=function(){var t=this.em,n=this.model.attributes,o=n.label,r=n.name;return t.t("traitManager.traits.labels.".concat(r))||(0,e.capitalize)(o||r).replace(/-/g,' ')},o.prototype.getComponent=function(){return this.target},o.prototype.getInputEl=function(){if(!this.$input){var e=this.em,n=this.model,o=n,r=n.attributes.name,i=o.get('placeholder')||o.get('default')||'',a=o.get('type')||'text',s=o.get('min'),c=o.get('max'),u=this.getModelValue(),p=(0,l["default"])("")),d=e.t("traitManager.traits.attributes.".concat(r))||{};p.attr(Ks({placeholder:i},d)),(0,t.isUndefined)(u)||(o.set({value:u},{silent:!0}),p.prop('value',u)),s&&p.prop('min',s),c&&p.prop('max',c),this.$input=p}return this.$input.get(0)},o.prototype.getInputElem=function(){var t=this.input,e=this.$input;return t||e&&e.get&&e.get(0)||this.getElInput()},o.prototype.getModelValue=function(){return this.model.getValue()},o.prototype.getElInput=function(){return this.elInput},o.prototype.renderField=function(){var e=this,n=e.$el,o=e.appendInput,r=e.model,i=n.find('[data-input]'),a=i[i.length-1],s=r.el;s||(s=this.createInput?this.createInput(this.getClbOpts()):this.getInputEl()),(0,t.isString)(s)?(a.innerHTML=s,this.elInput=a.firstChild):(o?a.appendChild(s):a.insertBefore(s,a.firstChild),this.elInput=s),r.el=this.elInput},o.prototype.hasLabel=function(){var t=this.model.attributes.label;return!this.noLabel&&!1!==t},o.prototype.rerender=function(){delete this.model.el,this.render()},o.prototype.postUpdate=function(){this.onUpdate(this.getClbOpts())},o.prototype.render=function(){var e=this,n=e.$el,o=e.pfx,r=e.ppfx,i=e.model.attributes,a=i.type,s=i.id,l=this.hasLabel&&this.hasLabel(),c="".concat(o,"trait");delete this.$input;var u="
\n ").concat(l?"
"):'',"\n
\n ").concat(this.templateInput?(0,t.isFunction)(this.templateInput)?this.templateInput(this.getClbOpts()):this.templateInput:'',"\n
\n
");return n.empty().append(u),l&&this.renderLabel(),this.renderField(),this.el.className="".concat(c,"__wrp ").concat(c,"__wrp-").concat(s),this.postUpdate(),this.onRender(this.getClbOpts()),this},o}(u.G7);const Zs=Ys;Ys.prototype.eventCapture=['change'];var Xs=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)}}(),Js=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Xs(e,t),e.prototype.templateInput=function(){return''},e.prototype.onChange=function(){this.handleClick()},e.prototype.handleClick=function(){this.model.runCommand()},e.prototype.renderLabel=function(){this.model.get('label')&&Zs.prototype.renderLabel.apply(this)},e.prototype.getInputEl=function(){var t=this.model,e=this.ppfx,n=t.props(),o=n.labelButton,r=n.text,i=n.full,a=o||r,s="".concat(e,"btn");return"")},e}(Zs);const Qs=Js;Js.prototype.eventCapture=['click button'];var tl=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)}}();const el=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.appendInput=!1,t}return tl(n,e),n.prototype.templateInput=function(){var t=this.ppfx,e=this.clsField;return"")},n.prototype.onChange=function(){this.model.set('value',this.getInputElem().checked)},n.prototype.setInputValue=function(t){var e=this.getInputElem();e&&(e.checked=!!t)},n.prototype.getInputEl=function(){for(var e=[],n=0;n")},e.prototype.inputClass=function(){return"".concat(this.ppfx,"field")},e.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},e.prototype.elementUpdated=function(){this.model.trigger('el:change')},e.prototype.setValue=function(t,e){var n=this.model,o=t||n.get('defaults'),r=this.getInputEl();r&&(r.value=o)},e.prototype.handleModelChange=function(t,e,n){this.setValue(e,n)},e.prototype.handleChange=function(t){t.stopPropagation();var e=this.getInputEl().value;this.__onInputChange(e),this.elementUpdated()},e.prototype.__onInputChange=function(t){this.model.set({value:t},{fromInput:1})},e.prototype.getInputEl=function(){if(!this.inputEl){var t=this.model,e=this.opts.type||'text',n=t.get('placeholder')||t.get('defaults')||t.get('default')||'';this.inputEl=(0,l["default"])(""))}return this.inputEl.get(0)},e.prototype.render=function(){this.inputEl=null;var t=this.$el;return t.addClass(this.inputClass()),t.html(this.template()),t.find(".".concat(this.holderClass())).append(this.getInputEl()),this},e}(u.G7);const rl=ol;ol.prototype.events={change:'handleChange'};var il=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)}}(),al=void 0&&(void 0).__assign||function(){return al=Object.assign||function(t){for(var e,n=1,o=arguments.length;n","
","
",''].join(''),l=function(){var t='';if(i)for(var e=1;e<=6;e++)t+="
";return["
","
","
","
","",'
','
',"
","
","
","
","
","
","
","
",'
','
','
',"
",'
',"
","
",t,'
','
',"
",'
',"
","",'
',"
","
","","",'
','
','
'].join('')}(),c='spectrum.id';t.fn.spectrum=function(e,n){if('string'==typeof e){var o=this,i=Array.prototype.slice.call(arguments,1);return this.each((function(){var n=r[t(this).data(c)];if(n){var a=n[e];if(!a)throw new Error("Spectrum: no such method: '"+e+"'");'get'==e?o=n.get():'container'==e?o=n.container:'option'==e?o=n.option.apply(n,i):'destroy'==e?(n.destroy(),t(this).removeData(c)):a.apply(n,i)}})),o}return this.spectrum('destroy').each((function(){var n=T(this,t.extend({},e,t(this).data()));t(this).data(c,n.id)}))},t.fn.spectrum.load=!0,t.fn.spectrum.loadOpts={},t.fn.spectrum.draggable=A,t.fn.spectrum.defaults=o,t.fn.spectrum.inputTypeColorSupport=function e(){if(void 0===e._cachedResult){var n=t("")[0];e._cachedResult='color'===n.type&&''!==n.value}return e._cachedResult},t.spectrum={},t.spectrum.localization={},t.spectrum.palettes={},t.fn.spectrum.processNativeColorInputs=function(){var e=t('input[type=color]');e.length&&!j()&&e.spectrum({preferredFormat:'hex6'})};var u=/^[\s,#]+/,p=/\s+$/,d=0,f=Math,h=f.round,g=f.min,v=f.max,y=f.random,m=function(t,e){if(e=e||{},(t=t||'')instanceof m)return t;if(!(this instanceof m))return new m(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,o=!1,r=!1;'string'==typeof t&&(t=function(t){t=t.replace(u,'').replace(p,'').toLowerCase();var e,n=!1;if(x[t])t=x[t],n=!0;else if('transparent'==t)return{r:0,g:0,b:0,a:0,format:'name'};if(e=S.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=S.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=S.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=S.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=S.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=S.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=S.hex8.exec(t))return{a:et(e[1]),r:J(e[2]),g:J(e[3]),b:J(e[4]),format:n?'name':'hex8'};if(e=S.hex6.exec(t))return{r:J(e[1]),g:J(e[2]),b:J(e[3]),format:n?'name':'hex'};if(e=S.hex3.exec(t))return{r:J(e[1]+''+e[1]),g:J(e[2]+''+e[2]),b:J(e[3]+''+e[3]),format:n?'name':'hex'};return!1}(t));'object'==typeof t&&(t.hasOwnProperty('r')&&t.hasOwnProperty('g')&&t.hasOwnProperty('b')?(i=t.r,a=t.g,s=t.b,e={r:255*Z(i,255),g:255*Z(a,255),b:255*Z(s,255)},o=!0,r='%'===String(t.r).substr(-1)?'prgb':'rgb'):t.hasOwnProperty('h')&&t.hasOwnProperty('s')&&t.hasOwnProperty('v')?(t.s=tt(t.s),t.v=tt(t.v),e=function(t,e,n){t=6*Z(t,360),e=Z(e,100),n=Z(n,100);var o=f.floor(t),r=t-o,i=n*(1-e),a=n*(1-r*e),s=n*(1-(1-r)*e),l=o%6,c=[n,a,i,i,s,n][l],u=[s,n,n,a,i,i][l],p=[i,i,s,n,n,a][l];return{r:255*c,g:255*u,b:255*p}}(t.h,t.s,t.v),o=!0,r='hsv'):t.hasOwnProperty('h')&&t.hasOwnProperty('s')&&t.hasOwnProperty('l')&&(t.s=tt(t.s),t.l=tt(t.l),e=function(t,e,n){var o,r,i;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=Z(t,360),e=Z(e,100),n=Z(n,100),0===e)o=r=i=n;else{var s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;o=a(l,s,t+1/3),r=a(l,s,t),i=a(l,s,t-1/3)}return{r:255*o,g:255*r,b:255*i}}(t.h,t.s,t.l),o=!0,r='hsl'),t.hasOwnProperty('a')&&(n=t.a));var i,a,s;return n=Y(n),{ok:o,format:t.format||r,r:g(255,v(e.r,0)),g:g(255,v(e.g,0)),b:g(255,v(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=h(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=h(this._r)),this._g<1&&(this._g=h(this._g)),this._b<1&&(this._b=h(this._b)),this._ok=n.ok,this._tc_id=d++};m.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},setAlpha:function(t){return this._a=Y(t),this._roundA=h(100*this._a)/100,this},toHsv:function(){var t=L(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=L(this._r,this._g,this._b),e=h(360*t.h),n=h(100*t.s),o=h(100*t.v);return 1==this._a?'hsv('+e+', '+n+'%, '+o+'%)':'hsva('+e+', '+n+'%, '+o+'%, '+this._roundA+')'},toHsl:function(){var t=M(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=M(this._r,this._g,this._b),e=h(360*t.h),n=h(100*t.s),o=h(100*t.l);return 1==this._a?'hsl('+e+', '+n+'%, '+o+'%)':'hsla('+e+', '+n+'%, '+o+'%, '+this._roundA+')'},toHex:function(t){return D(this._r,this._g,this._b,t)},toHexString:function(t){return'#'+this.toHex(t)},toHex8:function(){return N(this._r,this._g,this._b,this._a)},toHex8String:function(){return'#'+this.toHex8()},toRgb:function(){return{r:h(this._r),g:h(this._g),b:h(this._b),a:this._a}},toRgbString:function(){return 1==this._a?'rgb('+h(this._r)+', '+h(this._g)+', '+h(this._b)+')':'rgba('+h(this._r)+', '+h(this._g)+', '+h(this._b)+', '+this._roundA+')'},toPercentageRgb:function(){return{r:h(100*Z(this._r,255))+'%',g:h(100*Z(this._g,255))+'%',b:h(100*Z(this._b,255))+'%',a:this._a}},toPercentageRgbString:function(){return 1==this._a?'rgb('+h(100*Z(this._r,255))+'%, '+h(100*Z(this._g,255))+'%, '+h(100*Z(this._b,255))+'%)':'rgba('+h(100*Z(this._r,255))+'%, '+h(100*Z(this._g,255))+'%, '+h(100*Z(this._b,255))+'%, '+this._roundA+')'},toName:function(){return 0===this._a?'transparent':!(this._a<1)&&(C[D(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e='#'+N(this._r,this._g,this._b,this._a),n=e,o=this._gradientType?'GradientType = 1, ':'';t&&(n=m(t).toHex8String());return'progid:DXImageTransform.Microsoft.gradient('+o+'startColorstr='+e+',endColorstr='+n+')'},toString:function(t){var e=!!t;t=t||this._format;var n=!1,o=this._a<1&&this._a>=0;return e||!o||'hex'!==t&&'hex6'!==t&&'hex3'!==t&&'name'!==t?('rgb'===t&&(n=this.toRgbString()),'prgb'===t&&(n=this.toPercentageRgbString()),'hex'!==t&&'hex6'!==t||(n=this.toHexString()),'hex3'===t&&(n=this.toHexString(!0)),'hex8'===t&&(n=this.toHex8String()),'name'===t&&(n=this.toName()),'hsl'===t&&(n=this.toHslString()),'hsv'===t&&(n=this.toHsvString()),n||this.toHexString()):'name'===t&&0===this._a?this.toName():this.toRgbString()},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(R,arguments)},brighten:function(){return this._applyModification(H,arguments)},darken:function(){return this._applyModification(B,arguments)},desaturate:function(){return this._applyModification(I,arguments)},saturate:function(){return this._applyModification(F,arguments)},greyscale:function(){return this._applyModification(V,arguments)},spin:function(){return this._applyModification(z,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(G,arguments)},complement:function(){return this._applyCombination(U,arguments)},monochromatic:function(){return this._applyCombination(K,arguments)},splitcomplement:function(){return this._applyCombination(q,arguments)},triad:function(){return this._applyCombination(W,arguments)},tetrad:function(){return this._applyCombination($,arguments)}},m.fromRatio=function(t,e){if('object'==typeof t){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]='a'===o?t[o]:tt(t[o]));t=n}return m(t,e)},m.equals=function(t,e){return!(!t||!e)&&m(t).toRgbString()==m(e).toRgbString()},m.random=function(){return m.fromRatio({r:y(),g:y(),b:y()})},m.mix=function(t,e,n){n=0===n?0:n||50;var o,r=m(t).toRgb(),i=m(e).toRgb(),a=n/100,s=2*a-1,l=i.a-r.a,c=1-(o=((o=s*l==-1?s:(s+l)/(1+s*l))+1)/2),u={r:i.r*o+r.r*c,g:i.g*o+r.g*c,b:i.b*o+r.b*c,a:i.a*a+r.a*(1-a)};return m(u)},m.readability=function(t,e){var n=m(t),o=m(e),r=n.toRgb(),i=o.toRgb(),a=n.getBrightness(),s=o.getBrightness(),l=Math.max(r.r,i.r)-Math.min(r.r,i.r)+Math.max(r.g,i.g)-Math.min(r.g,i.g)+Math.max(r.b,i.b)-Math.min(r.b,i.b);return{brightness:Math.abs(a-s),color:l}},m.isReadable=function(t,e){var n=m.readability(t,e);return n.brightness>125&&n.color>500},m.mostReadable=function(t,e){for(var n=null,o=0,r=!1,i=0;i125&&a.color>500,l=3*(a.brightness/125)+a.color/500;(s&&!r||s&&r&&l>o||!s&&!r&&l>o)&&(r=s,o=l,n=m(e[i]))}return n};var b,w,_,x=m.names={aliceblue:'f0f8ff',antiquewhite:'faebd7',aqua:'0ff',aquamarine:'7fffd4',azure:'f0ffff',beige:'f5f5dc',bisque:'ffe4c4',black:'000',blanchedalmond:'ffebcd',blue:'00f',blueviolet:'8a2be2',brown:'a52a2a',burlywood:'deb887',burntsienna:'ea7e5d',cadetblue:'5f9ea0',chartreuse:'7fff00',chocolate:'d2691e',coral:'ff7f50',cornflowerblue:'6495ed',cornsilk:'fff8dc',crimson:'dc143c',cyan:'0ff',darkblue:'00008b',darkcyan:'008b8b',darkgoldenrod:'b8860b',darkgray:'a9a9a9',darkgreen:'006400',darkgrey:'a9a9a9',darkkhaki:'bdb76b',darkmagenta:'8b008b',darkolivegreen:'556b2f',darkorange:'ff8c00',darkorchid:'9932cc',darkred:'8b0000',darksalmon:'e9967a',darkseagreen:'8fbc8f',darkslateblue:'483d8b',darkslategray:'2f4f4f',darkslategrey:'2f4f4f',darkturquoise:'00ced1',darkviolet:'9400d3',deeppink:'ff1493',deepskyblue:'00bfff',dimgray:'696969',dimgrey:'696969',dodgerblue:'1e90ff',firebrick:'b22222',floralwhite:'fffaf0',forestgreen:'228b22',fuchsia:'f0f',gainsboro:'dcdcdc',ghostwhite:'f8f8ff',gold:'ffd700',goldenrod:'daa520',gray:'808080',green:'008000',greenyellow:'adff2f',grey:'808080',honeydew:'f0fff0',hotpink:'ff69b4',indianred:'cd5c5c',indigo:'4b0082',ivory:'fffff0',khaki:'f0e68c',lavender:'e6e6fa',lavenderblush:'fff0f5',lawngreen:'7cfc00',lemonchiffon:'fffacd',lightblue:'add8e6',lightcoral:'f08080',lightcyan:'e0ffff',lightgoldenrodyellow:'fafad2',lightgray:'d3d3d3',lightgreen:'90ee90',lightgrey:'d3d3d3',lightpink:'ffb6c1',lightsalmon:'ffa07a',lightseagreen:'20b2aa',lightskyblue:'87cefa',lightslategray:'789',lightslategrey:'789',lightsteelblue:'b0c4de',lightyellow:'ffffe0',lime:'0f0',limegreen:'32cd32',linen:'faf0e6',magenta:'f0f',maroon:'800000',mediumaquamarine:'66cdaa',mediumblue:'0000cd',mediumorchid:'ba55d3',mediumpurple:'9370db',mediumseagreen:'3cb371',mediumslateblue:'7b68ee',mediumspringgreen:'00fa9a',mediumturquoise:'48d1cc',mediumvioletred:'c71585',midnightblue:'191970',mintcream:'f5fffa',mistyrose:'ffe4e1',moccasin:'ffe4b5',navajowhite:'ffdead',navy:'000080',oldlace:'fdf5e6',olive:'808000',olivedrab:'6b8e23',orange:'ffa500',orangered:'ff4500',orchid:'da70d6',palegoldenrod:'eee8aa',palegreen:'98fb98',paleturquoise:'afeeee',palevioletred:'db7093',papayawhip:'ffefd5',peachpuff:'ffdab9',peru:'cd853f',pink:'ffc0cb',plum:'dda0dd',powderblue:'b0e0e6',purple:'800080',rebeccapurple:'663399',red:'f00',rosybrown:'bc8f8f',royalblue:'4169e1',saddlebrown:'8b4513',salmon:'fa8072',sandybrown:'f4a460',seagreen:'2e8b57',seashell:'fff5ee',sienna:'a0522d',silver:'c0c0c0',skyblue:'87ceeb',slateblue:'6a5acd',slategray:'708090',slategrey:'708090',snow:'fffafa',springgreen:'00ff7f',steelblue:'4682b4',tan:'d2b48c',teal:'008080',thistle:'d8bfd8',tomato:'ff6347',turquoise:'40e0d0',violet:'ee82ee',wheat:'f5deb3',white:'fff',whitesmoke:'f5f5f5',yellow:'ff0',yellowgreen:'9acd32'},C=m.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(x),S=(w='[\\s|\\(]+('+(b='(?:'+'[-\\+]?\\d*\\.\\d+%?'+')|(?:'+'[-\\+]?\\d+%?'+')')+')[,|\\s]+('+b+')[,|\\s]+('+b+')\\s*\\)?',_='[\\s|\\(]+('+b+')[,|\\s]+('+b+')[,|\\s]+('+b+')[,|\\s]+('+b+')\\s*\\)?',{rgb:new RegExp('rgb'+w),rgba:new RegExp('rgba'+_),hsl:new RegExp('hsl'+w),hsla:new RegExp('hsla'+_),hsv:new RegExp('hsv'+w),hsva:new RegExp('hsva'+_),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});window.tinycolor=m,t((function(){t.fn.spectrum.load&&t.fn.spectrum.processNativeColorInputs()}))}function O(e,n,o,r){for(var i=[],s=0;s')}else{i.push(t('
').append(t('').attr('title',r.noColorSelectedText)).html())}}return"
"+i.join('')+'
'}function T(e,c){var u,p,d,f,h=function(e,n){var r=t.extend({},o,e);return r.callbacks={move:P(r.move,n),change:P(r.change,n),show:P(r.show,n),hide:P(r.hide,n),beforeShow:P(r.beforeShow,n)},r}(c,e),g=h.flat,v=h.showSelectionPalette,y=h.localStorageKey,b=h.theme,w=h.callbacks,_=(u=$t,p=10,function(){var t=this,e=arguments,n=function(){f=null,u.apply(t,e)};d&&clearTimeout(f),!d&&f||(f=setTimeout(n,p))}),x=!1,C=!1,S=!0,T=0,k=0,M=0,L=0,D=0,N=0,I=0,F=0,V=0,R=0,H=1,B=[],z=[],U={},W=h.selectionPalette.slice(0),$=h.maxSelectionSize,q='sp-dragging',G=null,K=e.ownerDocument,Y=(K.body,t(e)),Z=!1,X=t(l,K).addClass(b),J=X.find('.sp-picker-container'),Q=X.find('.sp-color'),tt=X.find('.sp-dragger'),et=X.find('.sp-hue'),nt=X.find('.sp-slider'),ot=X.find('.sp-alpha-inner'),rt=X.find('.sp-alpha'),it=X.find('.sp-alpha-handle'),at=X.find('.sp-input'),st=X.find('.sp-palette'),lt=X.find('.sp-initial'),ct=X.find('.sp-cancel'),ut=X.find('.sp-clear'),pt=X.find('.sp-choose'),dt=X.find('.sp-palette-toggle'),ft=Y.is('input'),ht=ft&&'color'===Y.attr('type')&&j(),gt=ft&&!g,vt=gt?t(s).addClass(b).addClass(h.className).addClass(h.replacerClassName):t([]),yt=gt?vt:Y,mt=vt.find('.sp-preview-inner'),bt=h.color||ft&&Y.val(),wt=!1,_t=h.preferredFormat,xt=!h.showButtons||h.clickoutFiresChange,Ct=!bt,St=h.allowEmpty&&!ht;function Ot(){if(h.showPaletteOnly&&(h.showPalette=!0),dt.text(h.showPaletteOnly?h.togglePaletteMoreText:h.togglePaletteLessText),h.palette){B=h.palette.slice(0),z=t.isArray(B[0])?B:[B],U={};for(var e=0;e1&&(delete window.localStorage[y],t.each(e,(function(t,e){kt(e)})))}catch(t){}try{W=window.localStorage[y].split(';')}catch(t){}}}function kt(e){if(v){var n=m(e).toRgbString();if(!U[n]&&-1===t.inArray(n,W))for(W.push(n);W.length>$;)W.shift();if(y&&window.localStorage)try{window.localStorage[y]=W.join(';')}catch(t){}}}function Et(){var e=Ht(),n=t.map(z,(function(t,n){return O(t,e,'sp-palette-row sp-palette-row-'+n,h)}));Tt(),W&&n.push(O(function(){var t=[];if(h.showPalette)for(var e=0;ewindow.innerWidth-window.scrollX&&i.right-a>0&&(l.left-=a-l.width);i.bottom+sMath.abs(e-r);G=i?'x':'y'}}else G=null;var a=!G||'y'===G;(!G||'x'===G)&&(V=parseFloat(t/T)),a&&(R=parseFloat((k-e)/k)),Ct=!1,h.showAlpha||(H=1),Bt()}),At,jt),bt?(Rt(bt),zt(),_t=h.preferredFormat||m(bt).getFormat(),kt(bt)):zt(),g&&Dt();var o=i?'mousedown.spectrum':'click.spectrum touchstart.spectrum';st.delegate('.sp-thumb-el',o,n),lt.delegate('.sp-thumb-el:nth-child(1)',o,{ignore:!0},n)}();var Gt={show:Dt,hide:Ft,toggle:Lt,reflow:$t,option:function(e,o){return e===n?t.extend({},h):o===n?h[e]:(h[e]=o,'preferredFormat'===e&&(_t=h.preferredFormat),void Ot())},enable:function(){Z=!1,Y.attr('disabled',!1),yt.removeClass('sp-disabled')},disable:qt,offset:function(t){h.offset=t,$t()},set:function(t){Rt(t),Wt()},get:Ht,destroy:function(){Y.show(),yt.unbind('click.spectrum touchstart.spectrum'),X.remove(),vt.remove(),r[Gt.id]=null},container:X};return Gt.id=r.push(Gt)-1,Gt}function k(){}function E(t){t.stopPropagation()}function P(t,e){var n=Array.prototype.slice,o=n.call(arguments,2);return function(){return t.apply(e,o.concat(n.call(arguments)))}}function A(e,n,o,r){n=n||function(){},o=o||function(){},r=r||function(){};var a=document,s=!1,l={},c=0,u=0,p='ontouchstart'in window,d={};function f(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.returnValue=!1}function h(t){if(s){if(i&&a.documentMode<9&&!t.button)return g();var o=t&&t.touches&&t.touches[0],r=o&&o.pageX||t.pageX,d=o&&o.pageY||t.pageY,h=Math.max(0,Math.min(r-l.left,u)),v=Math.max(0,Math.min(d-l.top,c));p&&f(t),n.apply(e,[h,v,t])}}function g(){s&&(t(a).unbind(d),t(a.body).removeClass('sp-dragging'),setTimeout((function(){r.apply(e,arguments)}),0)),s=!1}d['selectstart']=f,d['dragstart']=f,d['touchmove mousemove']=h,d['touchend mouseup']=g,t(e).bind('touchstart mousedown',(function(n){(n.which?3==n.which:2==n.button)||s||!1!==o.apply(e,arguments)&&(s=!0,c=t(e).height(),u=t(e).width(),l=t(e).offset(),t(a).bind(d),t(a.body).addClass('sp-dragging'),h(n),f(n))}))}function j(){return t.fn.spectrum.inputTypeColorSupport()}function M(t,e,n){t=Z(t,255),e=Z(e,255),n=Z(n,255);var o,r,i=v(t,e,n),a=g(t,e,n),s=(i+a)/2;if(i==a)o=r=0;else{var l=i-a;switch(r=s>.5?l/(2-i-a):l/(i+a),i){case t:o=(e-n)/l+(e>1)+720)%360;--e;)o.h=(o.h+r)%360,i.push(m(o));return i}function K(t,e){e=e||6;for(var n=m(t).toHsv(),o=n.h,r=n.s,i=n.v,a=[],s=1/e;e--;)a.push(m({h:o,s:r,v:i})),i=(i+s)%1;return a}function Y(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Z(t,e){(function(t){return'string'==typeof t&&-1!=t.indexOf('.')&&1===parseFloat(t)})(t)&&(t='100%');var n=function(t){return'string'==typeof t&&-1!=t.indexOf('%')}(t);return t=g(e,v(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),f.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function X(t){return g(1,v(0,t))}function J(t){return parseInt(t,16)}function Q(t){return 1==t.length?'0'+t:''+t}function tt(t){return t<=1&&(t=100*t+'%'),t}function et(t){return J(t)/255}}(l["default"]);var sl=function(t){var e='name'===t.getFormat()&&t.toName(),n=1==t.getAlpha()?t.toHexString():t.toRgbString();return e||n.replace(/ /g,'')},ll=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return il(n,e),n.prototype.template=function(){var t=this.ppfx;return"\n
\n
\n
\n
\n
\n
\n ")},n.prototype.inputClass=function(){var t=this.ppfx;return"".concat(t,"field ").concat(t,"field-color")},n.prototype.holderClass=function(){return"".concat(this.ppfx,"input-holder")},n.prototype.remove=function(){return e.prototype.remove.call(this),this.colorEl.spectrum('destroy'),this},n.prototype.handleChange=function(e){e.stopPropagation();var n=e.target.value;(0,t.isUndefined)(n)||this.__onInputChange(n)},n.prototype.__onInputChange=function(t){var e=this.model,n=this.opts.onChange,o=t,r=this.getColorEl();if(r){r.spectrum('set',o);var i=r.spectrum('get'),a=o&&sl(i);a&&(o=a)}n?n(o):e.set({value:o},{fromInput:1})},n.prototype.setValue=function(e,n){void 0===n&&(n={});var o=this.model,r=(0,t.isUndefined)(n.def)?o.get('defaults'):n.def,i=(0,t.isUndefined)(e)?(0,t.isUndefined)(r)?'':r:e,a=this.getInputEl(),s=this.getColorEl(),l='none'!=i?i:'';a.value=i,s.get(0).style.backgroundColor=l,(n.fromTarget||n.fromInput&&!n.avoidStore)&&(s.spectrum('set',l),this.noneColor='none'==i,this.movedColor=l)},n.prototype.getColorEl=function(){var t=this;if(!this.colorEl){var e=this,n=e.em,o=e.model,r=e.opts,i=this.ppfx,a=r.onChange,s=(0,l["default"])("
")),c=s.get(0).style,u=n&&n.getConfig&&n.getConfig().colorPicker||{};this.movedColor='';var p,d=!1;this.$el.find('[data-colorp-c]').append(s);var f=function(t,e){void 0===e&&(e=!0),a?a(t,!e):(e&&o.setValueFromInput(0,!1),o.setValueFromInput(t,e))};s.spectrum(al(al(al({color:o.getValue()||!1,containerClassName:"".concat(i,"one-bg ").concat(i,"two-color ").concat(i,"editor-sp"),maxSelectionSize:8,showPalette:!0,showAlpha:!0,chooseText:'Ok',cancelText:'⨯',palette:[]},u),o.get('colorPicker')||{}),{move:function(e){var n=sl(e);t.movedColor=n,c.backgroundColor=n,f(n,!1)},change:function(e){d=!0;var n=sl(e);c.backgroundColor=n,f(n),t.noneColor=!1},show:function(e){d=!1,t.movedColor='',p=a?o.getValue({noDefault:!0}):sl(e)},hide:function(){d||!p&&!a||(t.noneColor&&(p=''),c.backgroundColor=p,s.spectrum('set',p),f(p,!1))}})),n&&n.on&&this.listenTo(n,'component:selected',(function(){t.movedColor&&f(t.movedColor),d=!0,t.movedColor='',s.spectrum('hide')})),this.colorEl=s}return this.colorEl},n.prototype.render=function(){return rl.prototype.render.call(this),this.getColorEl(),this},n}(rl);const cl=ll;var ul=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)}}();const pl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ul(e,t),e.prototype.templateInput=function(){return''},e.prototype.getInputEl=function(){if(!this.input){var t=this.model,e=this.getModelValue(),n=new cl({model:t,target:this.config.em,contClass:this.ppfx+'field-color',ppfx:this.ppfx}).render();n.setValue(e,{fromTarget:1}),this.input=n.el}return this.input},e}(Zs);var dl=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)}}(),fl=function(e){function n(n){void 0===n&&(n={});var o=e.call(this,n)||this;return(0,t.bindAll)(o,'moveIncrement','upIncrement'),o.doc=document,o.listenTo(o.model,'change:unit',o.handleModelChange),o}return dl(n,e),n.prototype.template=function(){var t=this.ppfx;return"\n \n \n
\n
\n
\n
\n ")},n.prototype.inputClass=function(){var t=this.ppfx;return this.opts.contClass||"".concat(t,"field ").concat(t,"field-integer")},n.prototype.setValue=function(t,e){var n=e||{},o=this.validateInputValue(t,{deepCheck:1}),r={value:o.value,unit:''};(o.unit||o.force)&&(r.unit=o.unit),this.model.set(r,n),n.silent&&this.handleModelChange()},n.prototype.handleChange=function(t){t.stopPropagation(),this.setValue(this.getInputEl().value),this.elementUpdated()},n.prototype.handleUnitChange=function(t){t.stopPropagation();var e=this.getUnitEl().value;this.model.set('unit',e),this.elementUpdated()},n.prototype.handleKeyDown=function(t){'ArrowUp'===t.key&&(t.preventDefault(),this.upArrowClick()),'ArrowDown'===t.key&&(t.preventDefault(),this.downArrowClick())},n.prototype.elementUpdated=function(){this.model.trigger('el:change')},n.prototype.handleModelChange=function(){var t=this.model;this.getInputEl().value=t.get('value');var e=this.getUnitEl();e&&(e.value=t.get('unit')||'')},n.prototype.getUnitEl=function(){if(!this.unitEl){var t=this.model,e=t.get('units')||[];if(e.length){var n=[''];e.forEach((function(e){var o=e==t.get('unit')?'selected':'';n.push(""))}));var o=document.createElement('div');o.innerHTML=""),this.unitEl=o.firstChild}}return this.unitEl},n.prototype.upArrowClick=function(){var t=this.model,e=t.get('step'),n=parseFloat(t.get('value'));this.setValue(this.normalizeValue(n+e)),this.elementUpdated()},n.prototype.downArrowClick=function(){var t=this.model,e=t.get('step'),n=parseFloat(t.get('value'));this.setValue(this.normalizeValue(n-e)),this.elementUpdated()},n.prototype.downIncrement=function(t){t.preventDefault(),this.moved=!1;var e=this.model.get('value')||0;e=this.normalizeValue(e),this.current={y:t.pageY,val:e},(0,wt.on)(this.doc,'mousemove',this.moveIncrement),(0,wt.on)(this.doc,'mouseup',this.upIncrement)},n.prototype.moveIncrement=function(t){this.moved=!0;var e=this.model,n=e.get('step'),o=this.current,r=this.normalizeValue(o.val+(o.y-t.pageY)*n),i=this.validateInputValue(r),a=i.value,s=i.unit;return this.prValue=a,e.set({value:a,unit:s},{avoidStore:1}),!1},n.prototype.upIncrement=function(){var t=this.model,e=t.get('step');if((0,wt.S1)(this.doc,'mouseup',this.upIncrement),(0,wt.S1)(this.doc,'mousemove',this.moveIncrement),this.prValue&&this.moved){var n=this.prValue-e;t.set('value',n,{avoidStore:1}).set('value',n+e),this.elementUpdated()}},n.prototype.normalizeValue=function(t,e){void 0===e&&(e=0);var n=this.model.get('step'),o=0;if(isNaN(t))return e;if(t=parseFloat(t),Math.floor(t)!==t){var r=n.toString().split('.')[1];o=r?r.length:0}return o?parseFloat(t.toFixed(o)):t},n.prototype.validateInputValue=function(e,n){void 0===n&&(n={});var o=0,r=n||{},i=this.model,a='',s=(0,t.isUndefined)(e)?a:e,l=n.units||i.get('units')||[],c=i.get('unit')||l.length&&l[0]||'',u=(0,t.isUndefined)(n.max)?i.get('max'):n.max,p=(0,t.isUndefined)(n.min)?i.get('min'):n.min,d=!!i.get('limitlessMax'),f=!!i.get('limitlessMin');if(r.deepCheck){var h=i.get('fixedValues')||[];if(''===s&&(c=''),s){var g=new RegExp('^'+h.join('|'),'g');if(h.length&&g.test(s))s=s.match(g)[0],c='',o=1;else{var v=s+'';s+='',s=parseFloat(s.replace(',','.')),s=isNaN(s)?a:s;var y=v.replace(s,'');(0,t.indexOf)(l,y)>=0&&(c=y)}}}return d||(0,t.isUndefined)(u)||''===u||(s=s>u?u:s),f||(0,t.isUndefined)(p)||''===p||(s=s\n
\n
\n
\n
\n
")},n.prototype.getInputEl=function(){if(!this.$input){var e=this.model,n=this.em,o=e.get('name'),r=e.get('options')||[],i=[],a='',this.$input=(0,l["default"])(a);var s=e.getTargetValue(),c=i.indexOf(s)>=0?s:e.get('default');!(0,t.isUndefined)(c)&&this.$input.val(c)}return this.$input.get(0)},n}(Zs);var wl=n(330),_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)}}(),xl='data-categories',Cl='data-no-categories',Sl=function(t){function e(e,n){var o=t.call(this,e)||this;o.reuseView=!0,o.renderedCategories=new Map,o.itemsView=n;var r=e.config||{};o.config=r;var i=e.editor;o.em=i;var a=r.pStylePrefix||'';return o.ppfx=a,o.pfx=a+r.stylePrefix||'',o.className="".concat(o.pfx,"traits"),o.traitContClass="".concat(a,"traits-c"),o.classNoCat="".concat(a,"traits-empty-c"),o.catsClass="".concat(a,"trait-categories"),o.collection=new Be([],{em:i}),o.listenTo(i,'component:toggled',o.updatedCollection),o.updatedCollection(),o}return _l(e,t),e.prototype.updatedCollection=function(){var t=this.ppfx,e=this.em,n=e.getSelected();this.el.className="".concat(this.traitContClass,"s ").concat(t,"one-bg ").concat(t,"two-color"),this.collection=(null==n?void 0:n.traits)||new Be([],{em:e}),this.render()},e.prototype.add=function(t,e){var n=this.config,o=this.renderedCategories,r=this.itemView,i=t.get(this.itemType);this.itemsView&&this.itemsView[i]&&(r=this.itemsView[i]);var a=new r({config:n,model:t,attributes:t.get('attributes')}).render().el,s=t.parent.initCategory(t);if(s){var l=s.getId(),c=this.getCategoriesEl(),u=o.get(l);return!u&&c&&(u=new Ki({model:s},n,'trait').render(),o.set(l,u),c.appendChild(u.el)),void(null==u||u.append(a))}e?e.appendChild(a):this.append(a)},e.prototype.getCategoriesEl=function(){return this.catsEl||(this.catsEl=this.el.querySelector("[".concat(xl,"]"))),this.catsEl},e.prototype.getTraitsEl=function(){return this.traitsEl||(this.traitsEl=this.el.querySelector("[".concat(Cl,"]"))),this.traitsEl},e.prototype.append=function(t){var e=this.getTraitsEl();null==e||e.appendChild(t)},e.prototype.render=function(){var t=this,e=this,n=e.el,o=e.ppfx,r=e.catsClass,i=e.traitContClass,a=e.classNoCat,s=document.createDocumentFragment();delete this.catsEl,delete this.traitsEl,this.renderedCategories=new Map,n.innerHTML="\n
\n
\n "),this.collection.forEach((function(e){return t.add(e,s)})),this.append(s);var l="".concat(i,"s ").concat(o,"one-bg ").concat(o,"two-color");return this.$el.addClass(l),this.rendered=!0,this},e}(wl.Z);const Ol=Sl;Sl.prototype.itemView=Zs;var Tl=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)}}(),kl=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r\n
\n ").concat(c?"\n ").concat(x,"\n ").concat(C,"\n "):'',"\n
\n
\n
\n ").concat(S,"\n ").concat(m?"").concat(m,""):'',"\n ").concat(y,"\n
\n
\n
\n
\n
\n
").concat(u||'',"
\n
").concat(_||'',"
\n
\n \n
\n ")},Object.defineProperty(n.prototype,"em",{get:function(){return this.module.em},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ppfx",{get:function(){return this.em.getConfig().stylePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"pfx",{get:function(){return this.config.stylePrefix},enumerable:!1,configurable:!0}),n.prototype.initComponent=function(){var t=this,e=this.model,n=this.config.onInit,o=e.components();this.listenTo(o,'remove add reset',this.checkChildren),[['change:status',this.updateStatus],['change:open',this.updateOpening],['change:layerable',this.updateLayerable],['change:style:display',this.updateVisibility],['change:draggable',this.updateMove],['rerender:layer',this.render],['change:name change:custom-name',this.updateName]].forEach((function(n){return t.listenTo(e,n[0],n[1])})),this.$el.data('model',e),this.$el.data('collection',o),e.viewLayer=this,n.bind(this)({component:e,render:this.__render,listenTo:this.listenTo})},n.prototype.updateName=function(){this.getInputName().innerText=this.model.getName()},n.prototype.getVisibilityEl=function(){return this.getItemContainer().find('[data-toggle-visible]')},n.prototype.updateVisibility=function(){var t=this,e=t.pfx,n=t.model,o=t.module,r="".concat(e,"layer-hidden"),i=!o.isVisible(n)?'addClass':'removeClass';this.$el[i](r),this.getVisibilityEl()[i]("".concat(e,"layer-off"))},n.prototype.updateMove=function(){var t=this.model,e=this.config,n=this.getItemContainer().find("[".concat(Yl,"]"))[0];if(n){var o=t.get('draggable')&&e.sortable;n.style.display=o?'':'none'}},n.prototype.toggleVisibility=function(t){null==t||t.stopImmediatePropagation();var e=this.module,n=this.model;e.setVisible(n,!e.isVisible(n))},n.prototype.handleEdit=function(t){null==t||t.stopPropagation();var e=this,n=e.em,o=e.$el,r=e.clsNoEdit,i=e.clsEdit,a=this.getInputName();a[Kl]='true',a.focus(),document.execCommand('selectAll',!1),n.setEditing(!0),o.find(".".concat(this.inputNameCls)).removeClass(r).addClass(i)},n.prototype.handleEditKey=function(t){t.stopPropagation(),((0,wt.kl)(t)||(0,wt.r$)(t))&&this.handleEditEnd(t)},n.prototype.handleEditEnd=function(t){null==t||t.stopPropagation();var e=this,n=e.em,o=e.$el,r=e.clsNoEdit,i=e.clsEdit,a=e.model,s=this.getInputName(),l=s.textContent;s.scrollLeft=0,s[Kl]='false',a.setName(l),n.setEditing(!1),o.find(".".concat(this.inputNameCls)).addClass(r).removeClass(i),this.updateName()},n.prototype.getInputName=function(){return this.inputName||(this.inputName=this.el.querySelector(".".concat(this.inputNameCls))),this.inputName},n.prototype.updateOpening=function(){var t=this,e=t.$el,n=t.model,o=t.pfx,r='open',i="".concat(o,"layer-open"),a=this.getCaret();this.module.isOpen(n)?(e.addClass(r),a.addClass(i)):(e.removeClass(r),a.removeClass(i))},n.prototype.toggleOpening=function(t){var e=this.model,n=this.module;null==t||t.stopImmediatePropagation(),e.get('components').length&&n.setOpen(e,!n.isOpen(e))},n.prototype.handleSelect=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{selected:!0},{event:t})},n.prototype.handleHover=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!0})},n.prototype.handleHoverOut=function(t){null==t||t.stopPropagation();var e=this.module,n=this.model;e.setLayerData(n,{hovered:!1})},n.prototype.startSort=function(t){var e,n,o;t.stopPropagation();var r=this,i=r.em,a=r.sorter,s=r.model;if((!t.button||0===t.button)&&a){var l=(null===(n=null===(e=s.delegate)||void 0===e?void 0:e.move)||void 0===n?void 0:n.call(e,s))||s;a.onStart=zl(i),a.onMoveClb=Ul(i),a.onEndMove=Wl(i,[l]);var c=(null===(o=l.viewLayer)||void 0===o?void 0:o.el)||t.target;a.startSort(c)}},n.prototype.updateStatus=function(){gr.prototype.updateStatus.apply(this,[{avoidHover:!this.config.highlightHover,noExtHl:!0}])},n.prototype.getItemContainer=function(){return this.$el.children('[data-toggle-select]')},n.prototype.checkChildren=function(){var t=this,e=t.model,n=t.clsNoChild,o=t.module,r=o.getComponents(e).length,i=this.getItemContainer(),a=i.find(".".concat(this.clsTitle)),s=i.find('[data-count]');a[r?'removeClass':'addClass'](n),s.html("".concat(r||'')),!r&&o.setOpen(e,!1)},n.prototype.getCaret=function(){return this.caret&&this.caret.length||(this.caret=this.getItemContainer().find(".".concat(this.clsCaret))),this.caret},n.prototype.setRoot=function(e){var n,o=(0,t.isString)(e)?null===(n=this.em.getWrapper())||void 0===n?void 0:n.find(e)[0]:e;o&&(this.stopListening(),this.model=o,this.initComponent(),this._rendered&&this.render())},n.prototype.updateLayerable=function(){(this.parentView||this).render()},n.prototype.__clearItems=function(){var t;null===(t=this.items)||void 0===t||t.remove()},n.prototype.remove=function(){for(var t=[],e=0;e\n ").concat(this.getPreview(),"\n \n
\n ").concat(this.getInfo(),"\n
\n
\n ⨯\n
\n ")},n.prototype.updateTarget=function(e){e&&e.set&&(e.set('attributes',(0,t.clone)(e.get('attributes'))),e.set('src',this.model.get('src')))},n.prototype.getPreview=function(){return''},n.prototype.getInfo=function(){return''},n.prototype.render=function(){var t=this.el;return t.innerHTML=this.template(this,this.model),t.className=this.className,this},n}(u.G7);const bc=mc;var wc=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=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},xc=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return wc(n,e),n.prototype.getPreview=function(){var t=this,e=t.pfx,n=t.ppfx,o=t.model.get('src');return r(Sc||(Sc=_c(["\n
\n
\n "],["\n
\n
\n "])),e,o,e,n)},n.prototype.getInfo=function(){var t=this.pfx,e=this.model,n=e.get('name'),o=e.get('width'),i=e.get('height'),a=e.get('unitDim'),s=o&&i?"".concat(o,"x").concat(i).concat(a):'';return n=n||e.getFilename(),r(Oc||(Oc=_c(["\n
","
\n
","
\n "],["\n
","
\n
","
\n "])),t,n,t,s)},n.prototype.init=function(t){var e=this.pfx;this.className+=" ".concat(e,"asset-image")},n.prototype.onClick=function(){var e=this.model,n=this.pfx,o=this.__getBhv().select,r=this.config.onClick,i=this.collection;i.trigger('deselectAll'),this.$el.addClass(n+'highlight'),(0,t.isFunction)(o)?o(e,!1):(0,t.isFunction)(r)?r(e):this.updateTarget(i.target)},n.prototype.onDblClick=function(){var e=this.em,n=this.model,o=this.__getBhv().select,r=this.config.onDblClick,i=this.collection,a=i.target,s=i.onSelect;(0,t.isFunction)(o)?o(n,!0):(0,t.isFunction)(r)?r(n):(this.updateTarget(a),null==e||e.Modal.close()),(0,t.isFunction)(s)&&s(n)},n.prototype.onRemove=function(t){t.stopImmediatePropagation(),this.model.collection.remove(this.model)},n}(bc);const Cc=xc;var Sc,Oc;xc.prototype.events={'click [data-toggle=asset-remove]':'onRemove',click:'onClick',dblclick:'onDblClick'};var Tc=void 0&&(void 0).__assign||function(){return Tc=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
\n \n
\n \n
\n \n ")),"\n
\n
\n ").concat(r,"\n
\n
\n
\n
\n ")},e.prototype.handleSubmit=function(t){t.preventDefault();var e=this.getAddInput(),n=e&&e.value.trim(),o=this.config.handleAdd;if(n){e.value='';var r=this.getAssetsEl();r&&(r.scrollTop=0),o?o.bind(this)(n):this.options.globalCollection.add(n,{at:0})}},e.prototype.getAssetsEl=function(){return this.el.querySelector(".".concat(this.pfx,"assets"))},e.prototype.getAddInput=function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector(".".concat(this.pfx,"add-asset input"))),this.inputUrl},e.prototype.removedAsset=function(t){this.collection.length||this.toggleNoAssets()},e.prototype.addToAsset=function(t){1==this.collection.length&&this.toggleNoAssets(!0),this.addAsset(t)},e.prototype.addAsset=function(t,e){void 0===e&&(e=null);var n=e,o=this.collection,r=this.config,i=new t.typeView({model:t,collection:o,config:r}).render().el;if(n)n.appendChild(i);else{var a=this.getAssetsEl();a&&a.insertBefore(i,a.firstChild)}return i},e.prototype.toggleNoAssets=function(t){void 0===t&&(t=!1);var e=this.$el.find(".".concat(this.pfx,"assets"));if(t)e.empty();else{var n=this.config.noAssets;n&&e.append(n)}},e.prototype.deselectAll=function(){var t=this.pfx;this.$el.find(".".concat(t,"highlight")).removeClass("".concat(t,"highlight"))},e.prototype.renderAssets=function(){var t=this,e=document.createDocumentFragment(),n=this.$el.find(".".concat(this.pfx,"assets"));n.empty(),this.toggleNoAssets(!!this.collection.length),this.collection.each((function(n){return t.addAsset(n,e)})),n.append(e)},e.prototype.render=function(){var t=this.options.fu.render().el;return this.$el.empty(),this.$el.append(t).append(this.template(this)),this.el.className="".concat(this.ppfx,"asset-manager"),this.renderAssets(),this},e}(u.G7);const Ic=Nc;Nc.prototype.events={submit:'handleSubmit'};var Fc=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)}}(),Vc=void 0&&(void 0).__makeTemplateObject||function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},Rc=function(t){function e(n){void 0===n&&(n={});var o=t.call(this,n)||this;o.options=n;var r=n.config||{};o.module=n.module,o.config=r,o.em=o.config.em,o.pfx=r.stylePrefix||'',o.ppfx=r.pStylePrefix||'',o.target=o.options.globalCollection||{},o.uploadId=o.pfx+'uploadFile',o.disabled=void 0!==r.disableUpload?r.disableUpload:!r.upload&&!r.embedAsBase64,o.multiUpload=void 0===r.multiUpload||r.multiUpload;var i=r.uploadFile;return i?o.uploadFile=i.bind(o):!r.upload&&r.embedAsBase64&&(o.uploadFile=e.embedAsBase64),o.delegateEvents(),o}return Fc(e,t),e.prototype.template=function(t){var e=t.pfx,n=t.title,o=t.uploadId,i=t.disabled,a=t.multiUpload;return r(Bc||(Bc=Vc(["\n
\n
","
\n \n
\n \n "],["\n
\n
","
\n \n
\n \n "])),e,n,o,i?'disabled':'',a?'multiple':'')},e.prototype.events=function(){return{'change [data-input]':'uploadFile'}},e.prototype.onUploadStart=function(){var t=this.module;null==t||t.__propEv(t.events.uploadStart)},e.prototype.onUploadEnd=function(t){var e=this.$el,n=this.module;null==n||n.__propEv(n.events.uploadEnd,t);var o=e.find('input');o&&o.val('')},e.prototype.onUploadError=function(t){var e=this.module;console.error(t),this.onUploadEnd(t),null==e||e.__propEv(e.events.uploadError,t)},e.prototype.onUploadResponse=function(t,e){var n,o=this,r=o.module,i=o.config,a=o.target;try{n='string'==typeof t?JSON.parse(t):t}catch(e){n=t}null==r||r.__propEv(r.events.uploadResponse,n),i.autoAdd&&a&&a.add(n.data,{at:0}),this.onUploadEnd(t),null==e||e(n)},e.prototype.uploadFile=function(t,e){var n=this,o=t.dataTransfer?t.dataTransfer.files:t.target.files,r=this.config,i=r.beforeUpload;if(!1!==(i&&i(o))){var a=new FormData,s=r.params,l=r.customFetch,c=r.fetchOptions;for(var u in s)a.append(u,s[u]);if(this.multiUpload)for(var p=0;p").concat(o.dropzoneContent,"")),p(),'draggable'in i&&[i,s].forEach((function(t){t.ondragover=d,t.ondragleave=f,t.ondrop=h}))},e.prototype.render=function(){var t=this,e=t.$el,n=t.pfx,o=t.em;return e.html(this.template({title:o&&o.t('assetManager.uploadTitle'),uploadId:this.uploadId,disabled:this.disabled,multiUpload:this.multiUpload,pfx:n})),this.initDrop(),e.attr('class',n+'file-uploader'),this},e.embedAsBase64=function(t,e){var n=this,o=t.dataTransfer?t.dataTransfer.files:t.target.files,r={data:[]};if(FileReader){for(var i=[],a=/^(.+)\/(.+)$/,s=function(t){var e=new Promise((function(e,n){var o=new FileReader;o.addEventListener('load',(function(r){var i,s=t.name,l=a.exec(t.type);if('image'===(i=l?l[1]:t.type)){var c={src:o.result,name:s,type:i,height:0,width:0},u=new Image;u.addEventListener('error',(function(t){n(t)})),u.addEventListener('load',(function(){c.height=u.height,c.width=u.width,e(c)})),u.src=c.src}else e(i?{src:o.result,name:s,type:i}:o.result)})),o.addEventListener('error',(function(t){n(t)})),o.addEventListener('abort',(function(t){n('Aborted')})),o.readAsDataURL(t)}));i.push(e)},l=0,c=o;l0&&(i=e.split('.').reduce((function(e,n){if(!(0,t.isUndefined)(e))return e[n]}),r)),i}},o.prototype._debug=function(t,e){void 0===e&&(e={});var n=this.em,o=this.config;(e.debug||o.debug)&&n&&n.logWarning(t)},o.prototype.destroy=function(){},o}(m);const du=pu;var fu=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)}}(),hu=void 0&&(void 0).__assign||function(){return hu=Object.assign||function(t){for(var e,n=1,o=arguments.length;ns+u-e||il+c-e)return 1},o.prototype.getCurrentPos=function(){var t=this.eventMove;return{x:(null==t?void 0:t.pageX)||0,y:(null==t?void 0:t.pageY)||0}},o.prototype.getDim=function(t){var e,n,o,r,i=this.em,a=this.canvasRelative,s=null==i?void 0:i.Canvas,l=s?s.getElementOffsets(t):{};if(a&&i){var c=s.getElementPos(t,{noScroll:1});e=c.top,n=c.left,o=c.height,r=c.width}else{var u=this.offset(t);e=this.relative?t.offsetTop:u.top-(this.wmargin?-1:1)*this.elT,n=this.relative?t.offsetLeft:u.left-(this.wmargin?-1:1)*this.elL,o=t.offsetHeight,r=t.offsetWidth}return{top:e,left:n,height:o,width:r,offsets:l}},o.prototype.getChildrenDim=function(n){var o=this,r=[];if(!n)return r;var i=this.getTargetModel(n);if(i&&i.view&&!this.ignoreViewChildren){var a=i.getCurrentView?i.getCurrentView():i.view;n=a.getChildrenContainer()}return(0,t.each)(n.children,(function(t,i){var a=t,s=(0,e.getModel)(a,l["default"]),c=s&&s.index?s.index():i;if((0,wt.BM)(a)||o.matches(a,o.itemSel)){var u,p=o.getDim(a),d=o.direction;u='v'==d||'h'!=d&&o.isInFlow(a,n),p.dir=u,p.el=a,p.indexEl=c,r.push(p)}})),r},o.prototype.nearBorders=function(t,e,n){var o=!1,r=this.borderOffset,i=e||0,a=n||0,s=t.top,l=t.left,c=t.height,u=t.width;return(s+r>a||a>s+c-r||l+r>i||i>l+u-r)&&(o=!0),o},o.prototype.findPosition=function(t,e,n){for(var o,r={index:0,indexEl:0,method:'before'},i=0,a=0,s=0,l=0,c=0,u=0,p=0,d=t.length;pa||s&&c>=s||i&&h+vx&&(w.at=f-1))}i&&(_?(delete w.at,a=v.getView().insertComponent(i,w)):a=g.add(i,w)),delete this.dropContent,delete this.prevTarget}else if(s){var S=h.dropInfo||(null==v?void 0:v.get('droppable')),O=h.dragInfo||(null==y?void 0:y.get('draggable'));!g&&d.push('Target collection not found'),!b&&S&&d.push("Target is not droppable, accepts [".concat(S,"]")),!m&&O&&d.push("Component not draggable, acceptable by [".concat(O,"]")),s.logWarning('Invalid target position',{errors:d,model:y,context:'sorter',target:v})}return null==s||s.trigger('sorter:drag:end',{targetCollection:g,modelToDrop:i,warns:d,validResult:h,dst:n,srcEl:p}),a},o.prototype.rollback=function(t){(0,wt.S1)(this.getDocuments(),'keydown',this.rollback),27==(t.which||t.keyCode)&&(this.moved=!1,this.endMove())},o}(u.G7);const mu=yu;var bu=void 0&&(void 0).__assign||function(){return bu=Object.assign||function(t){for(var e,n=1,o=arguments.length;nb?v.h=Math.round(v.w/b):v.w=Math.round(v.h*b)}for(var w in~y.indexOf('l')&&(v.l+=i.w-v.w),~y.indexOf('t')&&(v.t+=i.h-v.h),v){var _=w;v[_]=parseInt("".concat(v[_]),10)}return v}},n}();const _u=wu;var xu=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)}}(),Cu=void 0&&(void 0).__assign||function(){return Cu=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0&&Mu.splice(o,1),93!=n&&224!=n||(n=91),n in ku)for(e in ku[n]=!1,Pu)Pu[e]==n&&(Ru[e]=!1)}function Vu(){for(Ou in ku)ku[Ou]=!1;for(Ou in Pu)Ru[Ou]=!1}function Ru(t,e,n){var o,r;o=Bu(t),void 0===n&&(n=e,e='all');for(var i=0;i1&&(r=zu(t),t=[t[t.length-1]]),t=t[0],(t=ju(t))in Tu||(Tu[t]=[]),Tu[t].push({shortcut:o[i],scope:e,method:n,key:o[i],mods:r})}for(Ou in Pu)Ru[Ou]=!1;function Hu(){return Eu||'all'}function Bu(t){var e;return''==(e=(t=t.replace(/\s/g,'')).split(','))[e.length-1]&&(e[e.length-2]+=','),e}function zu(t){for(var e=t.slice(0,t.length-1),n=0;n1&&(s=zu(o)),t=o[o.length-1],t=ju(t),void 0===e&&(e=Hu()),!Tu[t])return;for(r=0;r0,ku)(!ku[o]&&Lu(n.mods,+o)>-1||ku[o]&&-1==Lu(n.mods,+o))&&(i=!1);(0!=n.mods.length||ku[16]||ku[18]||ku[17]||ku[91])&&!i||!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}}(t)})),Uu(t.document,'keyup',Fu),Uu(t,'focus',Vu)};const Wu=Ru;const $u={defaults:{'core:undo':{keys:'⌘+z, ctrl+z',handler:'core:undo',opts:{prevent:!0}},'core:redo':{keys:'⌘+shift+z, ctrl+shift+z',handler:'core:redo',opts:{prevent:!0}},'core:copy':{keys:'⌘+c, ctrl+c',handler:'core:copy'},'core:paste':{keys:'⌘+v, ctrl+v',handler:'core:paste'},'core:component-next':{keys:'s',handler:'core:component-next'},'core:component-prev':{keys:'w',handler:'core:component-prev'},'core:component-enter':{keys:'d',handler:'core:component-enter'},'core:component-exit':{keys:'a',handler:'core:component-exit'},'core:component-delete':{keys:'backspace, delete',handler:'core:component-delete',opts:{prevent:!0}}}};var qu=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)}}(),Gu=void 0&&(void 0).__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var o,r=0,i=e.length;r\n
\n
").concat(r,"
\n
\n
\n
\n
").concat(o,"
\n
\n
\n \n
")},e.prototype.events=function(){return{click:'onClick','click [data-close-modal]':'hide'}},e.prototype.onClick=function(t){this.config.backdrop&&t.target===this.el&&this.hide()},e.prototype.getCollector=function(){return this.$collector||(this.$collector=this.$el.find('.'+this.pfx+'collector')),this.$collector},e.prototype.getContent=function(){var t=this.pfx;return this.$content||(this.$content=this.$el.find(".".concat(t,"content #").concat(t,"c"))),this.$content},e.prototype.getTitle=function(t){return void 0===t&&(t={}),this.$title||(this.$title=this.$el.find('.'+this.pfx+'title')),t.$?this.$title:this.$title.get(0)},e.prototype.updateContent=function(){var t=this.getContent(),e=t.children(),n=this.getCollector(),o=this.model.get('content');e.length&&n.append(e),t.empty().append(o)},e.prototype.updateTitle=function(){var t=this.getTitle({$:!0});t&&t.empty().append(this.model.get('title'))},e.prototype.updateOpen=function(){this.el.style.display=this.model.get('open')?'':'none'},e.prototype.hide=function(){this.model.close()},e.prototype.show=function(){this.model.open()},e.prototype.updateAttr=function(t){var e=this,n=e.pfx,o=e.$el,r=e.el,i=[].slice.call(r.attributes).map((function(t){return t.name}));o.removeAttr(i.join(' ')),o.attr(tp(tp({},t||{}),{class:"".concat(n,"container ").concat(t&&t.class||'').trim()}))},e.prototype.render=function(){var t=this.$el,e=this.model.toJSON();return e.pfx=this.pfx,e.ppfx=this.ppfx,t.html(this.template(e)),this.updateAttr(),this.updateOpen(),this},e}(bt);const np=ep;var op=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)}}(),rp=function(e){function n(n){var o=e.call(this,n,'Modal',Zu)||this;return o.model=new Ju(o),o.model.on('change:open',(function(t,e){n.trigger("modal:".concat(e?'open':'close'))})),o.model.on('change',(0,t.debounce)((function(){var e=o._evData(),r=o.config.custom;(0,t.isFunction)(r)&&r(e),n.trigger('modal',e)}),0)),o}return op(n,e),n.prototype._evData=function(){var e=this,n=this.getTitle(),o=this.getContent(),r=this.model.attributes;return{open:r.open,attributes:r.attributes,title:(0,t.isString)(n)?(0,wt.rw)(n):n,content:(0,t.isString)(o)?(0,wt.rw)(o):o.get?o.get(0):o,close:function(){e.close()}}},n.prototype.postRender=function(t){var e=t.model.config.el||t.el,n=this.render();n&&(null==e||e.appendChild(n))},n.prototype.open=function(t){void 0===t&&(t={});var e=t.attributes||{};return t.title&&this.setTitle(t.title),t.content&&this.setContent(t.content),this.model.set('attributes',e),this.model.open(),this.modal&&this.modal.updateAttr(e),this},n.prototype.close=function(){return this.model.close(),this},n.prototype.onceClose=function(t){return this.em.once('modal:close',t),this},n.prototype.onceOpen=function(t){return this.em.once('modal:open',t),this},n.prototype.isOpen=function(){return!!this.model.get('open')},n.prototype.setTitle=function(t){return this.model.set('title',t),this},n.prototype.getTitle=function(){return this.model.get('title')},n.prototype.setContent=function(t){return this.model.set('content',' '),this.model.set('content',t),this},n.prototype.getContent=function(){return this.model.get('content')},n.prototype.getContentEl=function(){var t;return null===(t=this.modal)||void 0===t?void 0:t.getContent().get(0)},n.prototype.getModel=function(){return this.model},n.prototype.render=function(){var t;if(!this.config.custom){var e=np.extend(this.config.extend),n=this.modal&&this.modal.el;return this.modal=new e({el:n,model:this.model,config:this.config}),null===(t=this.modal)||void 0===t?void 0:t.render().el}},n.prototype.destroy=function(){var t;null===(t=this.modal)||void 0===t||t.remove()},n}(m);const ip=rp;var ap='sw-visibility',sp='export-template',lp='open-sm',cp='open-tm',up='open-layers',pp='open-blocks',dp='fullscreen',fp='preview';const hp={stylePrefix:'pn-',defaults:[{id:'commands',buttons:[{}]},{id:'options',buttons:[{active:!0,id:ap,className:'fa fa-square-o',command:'core:component-outline',context:ap,attributes:{title:'View components'}},{id:fp,className:'fa fa-eye',command:fp,context:fp,attributes:{title:'Preview'}},{id:dp,className:'fa fa-arrows-alt',command:dp,context:dp,attributes:{title:'Fullscreen'}},{id:sp,className:'fa fa-code',command:sp,attributes:{title:'View code'}}]},{id:'views',buttons:[{id:lp,className:'fa fa-paint-brush',command:lp,active:!0,togglable:!1,attributes:{title:'Open Style Manager'}},{id:cp,className:'fa fa-cog',command:cp,togglable:!1,attributes:{title:'Settings'}},{id:up,className:'fa fa-bars',command:up,togglable:!1,attributes:{title:'Open Layer Manager'}},{id:pp,className:'fa fa-th-large',command:pp,togglable:!1,attributes:{title:'Open Blocks'}}]}]};var gp=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)}}();const vp=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.get('buttons').length&&o.set('buttons',new bp(o.module,o.get('buttons'))),o}return gp(e,t),e.prototype.defaults=function(){return{id:'',label:'',tagName:'span',className:'',command:'',context:'',buttons:[],attributes:{},options:{},active:!1,dragDrop:!1,togglable:!0,runDefaultCommand:!0,stopDefaultCommand:!1,disable:!1}},Object.defineProperty(e.prototype,"className",{get:function(){return this.get('className')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"command",{get:function(){return this.get('command')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"active",{get:function(){return this.get('active')},set:function(t){this.set('active',t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"togglable",{get:function(){return this.get('togglable')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"runDefaultCommand",{get:function(){return this.get('runDefaultCommand')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stopDefaultCommand",{get:function(){return this.get('stopDefaultCommand')},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disable",{get:function(){return this.get('disable')},enumerable:!1,configurable:!0}),e}(_.Z);var yp=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)}}(),mp=function(t){function e(e,n){return t.call(this,e,n,vp)||this}return yp(e,t),e.prototype.deactivateAllExceptOne=function(t,e){this.forEach((function(n,o){n!==t&&(n.set('active',!1),e&&n.get('buttons').length&&n.get('buttons').deactivateAllExceptOne(t,e))}))},e.prototype.deactivateAll=function(t,e){var n=t||'';this.forEach((function(t){t.get('context')==n&&t!==e&&t.set('active',!1,{fromCollection:!0})}))},e.prototype.disableAllButtons=function(t){var e=t||'';this.forEach((function(t,n){t.get('context')==e&&t.set('disable',!0)}))},e.prototype.disableAllButtonsExceptOne=function(t,e){this.forEach((function(n,o){n!==t&&(n.set('disable',!0),e&&n.get('buttons').length&&n.get('buttons').disableAllButtonsExceptOne(t,e))}))},e}(Z);const bp=mp;mp.prototype.model=vp;var wp=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)}}();const _p=function(t){function e(e,n){var o=t.call(this,e,n)||this,r=o.get('buttons')||[];return o.buttons=new bp(e,r),o}return wp(e,t),e.prototype.defaults=function(){return{id:'',content:'',visible:!0,buttons:[],attributes:{}}},Object.defineProperty(e.prototype,"buttons",{get:function(){return this.get('buttons')},set:function(t){this.set('buttons',t)},enumerable:!1,configurable:!0}),e}(_.Z);var xp=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)}}(),Cp=function(t){function e(e,n){return t.call(this,e,n,_p)||this}return xp(e,t),e}(Z);const Sp=Cp;Cp.prototype.model=_p;var Op=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)}}(),Tp=void 0&&(void 0).__assign||function(){return Tp=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
","
\n
\n \n "],["\n
\n
","
\n
\n
\n "])),e,e,n,e,o,e)},e.prototype.initialize=function(t){this.config=t.config||{},this.pfx=this.config.stylePrefix},e.prototype.render=function(){var t,e,n=this,o=n.model,r=n.pfx,i=n.$el,a=o.toJSON(),s=o.get('input')||(null===(e=(t=o).getElement)||void 0===e?void 0:e.call(t));return a.pfx=r,i.html(this.template(a)),i.attr('class',"".concat(r,"editor-c")),i.find("#".concat(r,"code")).append(s),this},e}(u.G7);const id=rd;var ad,sd=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)}}(),ld=void 0&&(void 0).__assign||function(){return ld=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0})))return!1;if((0,t.isBoolean)(n))return!0;if((0,t.isArray)(n)&&bd(e).some((function(t){return n.indexOf(t)>=0})))return!0}return!1},on:function(e,n,o){var i=this;!this.beforeCache&&(this.beforeCache=e.previousAttributes());var a=o||n||{};if(a.noUndo&&setTimeout((function(){i.beforeCache=null})),!md(a)){var s=e.toJSON({fromUndo:r}),l={object:e,before:this.beforeCache,after:s};if(this.beforeCache=null,!(0,t.isEmpty)(s))return l}}}),o.um.changeUndoType('add',{on:function(t,e,n){if(void 0===n&&(n={}),!md(n)&&o.isRegistered(e))return{object:e,before:void 0,after:t,options:vd(vd({},n),{fromUndo:r})}}}),o.um.changeUndoType('remove',{on:function(t,e,n){if(void 0===n&&(n={}),!md(n)&&o.isRegistered(e))return{object:e,before:t,after:void 0,options:vd(vd({},n),{fromUndo:r})}}}),o.um.changeUndoType('reset',{undo:function(t,e){t.reset(e,{fromUndo:r})},redo:function(t,e,n){t.reset(n,{fromUndo:r})},on:function(t,e){if(void 0===e&&(e={}),!md(e)&&o.isRegistered(t))return{object:t,before:e.previousModels,after:yd([],t.models,!0),options:vd(vd({},e),{fromUndo:r})}}}),o.um.on('undo redo',(function(){n.getSelectedAll().map((function(t){return t.trigger('rerender:layer')}))})),['undo','redo'].forEach((function(t){return o.um.on(t,(function(){return n.trigger(t)}))})),o}return gd(n,e),n.prototype.postLoad=function(){var t=this.config,e=this.em;t.trackSelection&&e&&this.add(e.get('selected'))},n.prototype.add=function(t){return this.um.register(t),this},n.prototype.remove=function(t){return this.um.unregister(t),this},n.prototype.removeAll=function(){return this.um.unregisterAll(),this},n.prototype.start=function(){return this.um.startTracking(),this},n.prototype.stop=function(){return this.um.stopTracking(),this},n.prototype.undo=function(t){void 0===t&&(t=!0);var e=this.em,n=this.um;return!e.isEditing()&&n.undo(t),this},n.prototype.undoAll=function(){return this.um.undoAll(),this},n.prototype.redo=function(t){void 0===t&&(t=!0);var e=this.em,n=this.um;return!e.isEditing()&&n.redo(t),this},n.prototype.redoAll=function(){return this.um.redoAll(),this},n.prototype.hasUndo=function(){return!!this.um.isAvailable('undo')},n.prototype.hasRedo=function(){return!!this.um.isAvailable('redo')},n.prototype.isRegistered=function(t){return!!this.getInstance().objectRegistry.isRegistered(t)},n.prototype.getStack=function(){return this.um.stack},n.prototype.getStackGroup=function(){var t=[],e=[];return this.getStack().forEach((function(n){var o=n.get('magicFusionIndex');e.indexOf(o)<0&&(e.push(o),t.push(n))})),t},n.prototype.skip=function(t){var e=!!this.um.isTracking();e&&this.stop(),t(),e&&this.start()},n.prototype.getGroupedStack=function(){var e={},n=this.getStack();return n.forEach((function(t,n){var o=t.get('magicFusionIndex'),r=function(t,e){var n=t.attributes,o=n.type,r=n.after,i=n.before,a=n.object,s=n.options;return{index:e,type:o,after:r,before:i,object:a,options:void 0===s?{}:s}}(t,n);e[o]?e[o].push(r):e[o]=[r]})),Object.keys(e).map((function(n){var o=e[n];return{index:o[o.length-1].index,actions:o,labels:(0,t.unique)(o.reduce((function(t,e){var n,o=null===(n=e.options)||void 0===n?void 0:n.action;return o&&t.push(o),t}),[]))}}))},n.prototype.goToGroup=function(e){var n=this;if(e){var o=this.getPointer(),r=e.index-o;(0,t.times)(Math.abs(r),(function(){n[r<0?'undo':'redo'](!1)}))}},n.prototype.getPointer=function(){return this.getStack().pointer},n.prototype.clear=function(){return this.um.clear(),this},n.prototype.getInstance=function(){return this.um},n.prototype.destroy=function(){this.clear().removeAll()},n}(m);const _d=wd;const xd={stylePrefix:'rte-',adjustToolbar:!0,actions:['bold','italic','underline','strikethrough','link','wrap'],custom:!1};var Cd,Sd=void 0&&(void 0).__assign||function(){return Sd=Object.assign||function(t){for(var e,n=1,o=arguments.length;nB',attributes:{title:'Bold'},result:function(t){return t.exec('bold')}},italic:{name:'italic',icon:'I',attributes:{title:'Italic'},result:function(t){return t.exec('italic')}},underline:{name:'underline',icon:'U',attributes:{title:'Underline'},result:function(t){return t.exec('underline')}},strikethrough:{name:'strikethrough',icon:'S',attributes:{title:'Strike-through'},result:function(t){return t.exec('strikeThrough')}},link:{icon:"\n \n ",name:'link',attributes:{style:'font-size:1.4rem;padding:0 4px 2px;',title:'Link'},state:function(t){return t&&t.selection()&&Pd(t)?Td:kd},result:function(t){Pd(t)?t.exec('unlink'):t.insertHTML("").concat(t.selection(),""),{select:!0})}},wrap:{name:'wrap',icon:"\n \n ",attributes:{title:'Wrap for style'},state:function(t){return(null==t?void 0:t.selection())&&Pd(t,'SPAN')?Ed:kd},result:function(t){!Pd(t,'SPAN')&&t.insertHTML("").concat(t.selection(),""),{select:!0})}}},Md=function(){function n(e,n,o){var r=this;if(void 0===o&&(o={}),this.em=e,this.settings=o,n[Od])return n[Od];n[Od]=this,this.setEl(n),this.updateActiveActions=this.updateActiveActions.bind(this),this.__onKeydown=this.__onKeydown.bind(this),this.__onPaste=this.__onPaste.bind(this);var i=(o.actions||[]).map((function(e){var n=e;return(0,t.isString)(e)?n=Sd({},jd[e]):jd[e.name]&&(n=Sd(Sd({},jd[e.name]),e)),n})),a=i.length?i:Object.keys(jd).map((function(t){return jd[t]}));o.classes=Sd({actionbar:'actionbar',button:'action',active:'active',disabled:'disabled',inactive:'inactive'},o.classes);var s=o.classes,l=o.actionbar;if(this.actionbar=l,this.classes=s,this.actions=a,!l){if(!this.isCustom(o.module)){var c=o.actionbarContainer;(l=document.createElement('div')).className=s.actionbar,null==c||c.appendChild(l),this.actionbar=l}a.forEach((function(t){return r.addAction(t)}))}return o.styleWithCSS&&this.exec('styleWithCSS'),this}return n.prototype.isCustom=function(t){var e=t||this.em.RichTextEditor;return!(!(null==e?void 0:e.config.custom)&&!(null==e?void 0:e.customRte))},n.prototype.destroy=function(){},n.prototype.setEl=function(t){this.el=t,this.doc=t.ownerDocument},n.prototype.updateActiveActions=function(){var t=this,e=this.getActions();e.forEach((function(e){var n=e.update,o=e.btn,r=t.classes,i=r.active,a=r.inactive,s=r.disabled,l=e.state,c=e.name,u=t.doc,p=Cd.INACTIVE;if(o&&(o.className=o.className.replace(i,'').trim(),o.className=o.className.replace(a,'').trim(),o.className=o.className.replace(s,'').trim()),l){var d=l(t,u);if(p=d,o)switch(d){case Td:o.className+=" ".concat(i);break;case kd:o.className+=" ".concat(a);break;case Ed:o.className+=" ".concat(s)}}else u.queryCommandSupported(c)&&u.queryCommandState(c)&&(o&&(o.className+=" ".concat(i)),p=Cd.ACTIVE);e.currentState=p,null==n||n(t,e)})),e.length&&this.em.RichTextEditor.__dbdTrgCustom()},n.prototype.enable=function(t){return this.enabled?this:this.__toggleEffects(!0,t)},n.prototype.disable=function(){return this.__toggleEffects(!1)},n.prototype.__toggleEffects=function(t,e){void 0===t&&(t=!1),void 0===e&&(e={});var n=t?wt.on:wt.S1,o=this.el,r=this.doc,i=this.actionbarEl();if(i&&(i.style.display=t?'':'none'),o.contentEditable="".concat(!!t),n(o,'mouseup keyup',this.updateActiveActions),n(r,'keydown',this.__onKeydown),n(r,'paste',this.__onPaste),this.enabled=t,t){var a=e.event;if(this.syncActions(),this.updateActiveActions(),a){var s=null;if(r.caretRangeFromPoint){var l=(0,wt.VB)(a);s=r.caretRangeFromPoint(l.clientX,l.clientY)}else a.rangeParent&&(s=r.createRange()).setStart(a.rangeParent,a.rangeOffset);var c=r.getSelection();null==c||c.removeAllRanges(),s&&(null==c||c.addRange(s))}o.focus()}return this},n.prototype.__onKeydown=function(t){var e=this.em,n=e.RichTextEditor.getConfig().onKeydown;if(n)return n({ev:t,rte:this,editor:e.getEditor()});var o=this.doc;'Enter'!==t.key||['insertOrderedList','insertUnorderedList'].some((function(t){return o.queryCommandState(t)}))||(o.execCommand('insertLineBreak'),t.preventDefault())},n.prototype.__onPaste=function(t){var e=this.em,n=e.RichTextEditor.getConfig().onPaste;if(n)return n({ev:t,rte:this,editor:e.getEditor()});var o=t.clipboardData,r=o.getData('text'),i=o.getData('text/html');if(r&&!i){t.preventDefault();var a=r.replace(/(?:\r\n|\r|\n)/g,'
');this.doc.execCommand('insertHTML',!1,a)}},n.prototype.syncActions=function(){var t=this;this.getActions().forEach((function(e){if(t.actionbar&&(!e.state||e.state&&e.state(t,t.doc)>=0)){var n=e.event||'click',o=e.btn;o&&(o["on".concat(n)]=function(){e.result(t,e),t.updateActiveActions()})}}))},n.prototype.addAction=function(t,e){void 0===e&&(e={});var n=e.sync,o=this.actionbarEl();if(o){var r=t.icon,i=t.attributes,a=void 0===i?{}:i,s=document.createElement('span');for(var l in s.className=this.classes.button,t.btn=s,a)s.setAttribute(l,a[l]);'string'==typeof r?s.innerHTML=r:s.appendChild(r),o.appendChild(s)}n&&(this.actions.push(t),this.syncActions())},n.prototype.getActions=function(){return this.actions},n.prototype.selection=function(){return this.doc.getSelection()},n.prototype.exec=function(t,e){this.doc.execCommand(t,!1,e)},n.prototype.actionbarEl=function(){return this.actionbar},n.prototype.insertHTML=function(n,o){var r=(void 0===o?{}:o).select,i=this,a=i.em,s=i.doc,l=i.el,c=s.getSelection();if(c&&c.rangeCount){var u=(0,e.getComponentModel)(l)||a.getSelected(),p=s.createElement('div'),d=c.getRangeAt(0);d.deleteContents(),(0,t.isString)(n)?p.innerHTML=n:n&&p.appendChild(n),Array.prototype.slice.call(p.childNodes).forEach((function(t){d.insertNode(t)})),c.removeAllRanges(),c.addRange(d),l.focus(),r&&u&&(u.once('rte:disable',(function(){var t=u.find("[".concat(Ad,"]"))[0];t&&(a.setSelected(t),t.removeAttributes(Ad))})),u.trigger('disable'))}},n}();const Ld=Md;var Dd=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)}}(),Nd=void 0&&(void 0).__awaiter||function(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o["throw"](t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))},Id=void 0&&(void 0).__generator||function(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o["return"]:s[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=0}))),g=this.get('onChange'),v={property:this,from:p,to:u,value:l,opts:n};i.__trgEv(i.events.propertyUpdate,v),g&&g(v),h&&this.__upTargetsStyle(((o={})[a]=l,o),n)},o.prototype.__upTargetsStyle=function(t,e){var n,o=null===(n=this.em)||void 0===n?void 0:n.get('StyleManager');null==o||o.addStyleTargets(Wd(Wd({},t),{__p:!!e.avoidStore}),e)},o.prototype._up=function(t,e){void 0===e&&(e={}),e.noTarget&&(e.__up=!0);var n=e.partial,o=$d(e,["partial"]);return t.__p=!(!o.avoidStore&&!n),this.set(t,Wd(Wd({},o),{avoidStore:t.__p}))},o.prototype.up=function(t,e){void 0===e&&(e={}),this.set(t,Wd(Wd({},e),{__up:!0}))},o.prototype.init=function(){},o.prototype.getId=function(){return this.get('id')},o.prototype.getType=function(){return this.get('type')},o.prototype.getName=function(){return this.get('property')},o.prototype.getLabel=function(t){var e;void 0===t&&(t={});var n=t.locale,o=void 0===n||n,r=this.getId(),i=this.get('name')||this.get('label');return o&&(null===(e=this.em)||void 0===e?void 0:e.t("styleManager.properties.".concat(r)))||i},o.prototype.getValue=function(t){void 0===t&&(t={});var e=t.noDefault,n=this.get('value');return this.hasValue()||e?n:this.getDefaultValue()},o.prototype.hasValue=function(e){void 0===e&&(e={});var n=e.noParent&&this.getParentTarget(),o=this.get('value');return!(0,t.isUndefined)(o)&&''!==o&&!n},o.prototype.hasValueParent=function(){return this.hasValue()&&!this.hasValue({noParent:!0})},o.prototype.getStyle=function(t){var n;void 0===t&&(t={});var o=this.getName();return(n={})[t.camelCase?(0,e.camelCase)(o):o]=this.__getFullValue(t),n},o.prototype.getDefaultValue=function(){var e=this.get('default');return"".concat((0,t.isUndefined)(e)?this.get('defaults'):e)},o.prototype.upValue=function(t,e){void 0===e&&(e={});var n=null===t||''===t?this.__getClearProps():this.__parseValue(t,e);return this._up(n,e)},o.prototype.isVisible=function(){return!!this.get('visible')},o.prototype.clear=function(t){return void 0===t&&(t={}),this._up(this.__getClearProps(),Wd(Wd({},t),{__clear:!0})),this},o.prototype.canClear=function(){var t=this.getParent();return t?t.__canClearProp(this):this.hasValue({noParent:!0})},o.prototype.getParent=function(){return this.__getParentProp()},o.prototype.isFull=function(){return!!this.get('full')},o.prototype.__parseValue=function(t,e){return this.parseValue(t,e)},o.prototype.__getClearProps=function(){return{value:''}},o.prototype.setValue=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n={});var o=this.parseValue(t),r=!e;!r&&this.set({value:void 0},{avoidStore:r,silent:!0}),this.set(o,Wd({avoidStore:r},n))},o.prototype.setValueFromInput=function(t,e,n){void 0===n&&(n={}),this.setValue(t,e,Wd(Wd({},n),{fromInput:1}))},o.prototype.parseValue=function(e,n){void 0===n&&(n={});var o={value:e},r='!important',i=this.get('functionName')||'';if((0,t.isString)(e)&&-1!==e.indexOf(r)&&(o.value=e.replace(r,'').trim(),o.important=!0),!i&&!n.complete)return o;var a=[],s="".concat(o.value).trim(),l=s.indexOf('(')+1,c=i||s.substring(0,l-1);if(c&&(o.functionName=c),!i||0===s.indexOf("".concat(i,"("))){var u=s.lastIndexOf(')');a.push(l),u>=0&&a.push(u),o.value=String.prototype.substring.apply(s,a)}if(n.numeric){var p=parseFloat(o.value);o.unit=o.value.replace(p,''),o.value=p}return o},o.prototype.__getFullValue=function(t){var e=(void 0===t?{}:t).withDefault;return!this.hasValue()&&e?this.getDefaultValue():this.getFullValue()},o.prototype.getFullValue=function(e,n){void 0===n&&(n={});var o=this.get('functionName'),r=this.getDefaultValue(),i=(0,t.isUndefined)(e)?this.get('value'):e,a=!(0,t.isUndefined)(i)&&''!==i;if(i&&r&&i===r)return r;if(o&&a){var s='url'===o?"'".concat(i.replace(/'|"/g,''),"'"):i;i="".concat(o,"(").concat(s,")")}return a&&this.get('important')&&!n.skipImportant&&(i="".concat(i," !important")),i||''},o.prototype.__setParentTarget=function(t){this.up({parentTarget:t})},o.prototype.getParentTarget=function(){return this.get('parentTarget')||null},o.prototype.__parseFn=function(t){void 0===t&&(t='');var e=t.indexOf('(')+1,n=t.lastIndexOf(')');return{name:t.substring(0,e-1).trim(),value:String.prototype.substring.apply(t,[e,n>=0?n:void 0]).trim()}},o.prototype.__checkVisibility=function(n){var o=n.target,r=n.component,i=n.sectors,a=r||o;if(!a)return!1;var s=this.getId(),l=this.getName(),c=this.get('toRequire'),u=this.get('requires'),p=this.get('requiresParent'),d=a.get('unstylable'),f=a.get('stylable-require'),h=a.get('stylable');if((0,t.isArray)(h)&&(h=h.indexOf(l)>=0),(0,t.isArray)(d)&&(h=d.indexOf(l)<0),c&&(h=!o||f&&(f.indexOf(s)>=0||f.indexOf(l)>=0)),i&&u){var g=(0,t.keys)(u);i.forEach((function(e){e.getProperties().forEach((function(e){if((0,t.includes)(g,e.id)){var n=u[e.id];h=h&&(0,t.includes)(n,e.get('value'))}}))}))}if(p){var v=r&&r.parent(),y=v&&v.getEl();if(y){var m=(0,e.hasWin)()?window.getComputedStyle(y):{};(0,t.each)(p,(function(e,n){h=h&&m[n]&&(0,t.includes)(e,m[n])}))}else h=!1}return!!h},o}(u.Hn);const Kd=Gd;Gd.callParentInit=function(t,e,n,o){void 0===o&&(o={}),t.prototype.initialize.apply(e,[n,Wd(Wd({},o),{skipInit:1})])},Gd.callInit=function(t,e,n){void 0===n&&(n={}),!n.skipInit&&t.init(e,n)};var Yd=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)}}(),Zd=void 0&&(void 0).__assign||function(){return Zd=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0},o.prototype.getLayer=function(t){return void 0===t&&(t=0),this.layers.at(t)||void 0},o.prototype.getSelectedLayer=function(){var t=this.get('selectedLayer');return t&&t.getIndex()>=0?t:void 0},o.prototype.selectLayer=function(t){return this.set('selectedLayer',t,{__select:!0})},o.prototype.selectLayerAt=function(t){void 0===t&&(t=0);var e=this.getLayer(t);return e&&this.selectLayer(e)},o.prototype.moveLayer=function(e,n){void 0===n&&(n=0);var o=this.layers,r=e?e.getIndex():-1;r>=0&&(0,t.isNumber)(n)&&n>=0&&n\n
\n ")},o.prototype.templateLabel=function(t){var e=this.pfx,n=this.em,o=t.parent,r=t.attributes,i=r.icon,a=void 0===i?'':i,s=r.info,l=void 0===s?'':s,c=null==n?void 0:n.getConfig().icons,u=(null==c?void 0:c.close)||'';return"\n \n ").concat(t.getLabel(),"\n \n ").concat(o?'':"
").concat(u,"
"),"\n ")},o.prototype.templateInput=function(t){return"\n
\n \n
\n ")},o.prototype.remove=function(){var t=this;return u.G7.prototype.remove.apply(this,arguments),['em','input','$input','view'].forEach((function(e){return t[e]=null})),this.__destroyFn(this._getClbOpts()),this},o.prototype.updateStatus=function(){var t,e=this,n=e.model,o=e.pfx,r=e.ppfx,i=e.config,a="".concat(r,"four-color"),s="".concat(r,"color-warn"),l=this.$el.children(".".concat(o,"label")),c=this.getClearEl(),u=c?c.style:{};l.removeClass("".concat(a," ").concat(s)),u.display='none',n.hasValue({noParent:!0})&&i.highlightChanged?(l.addClass(a),i.clearProperties&&(u.display='')):n.hasValue()&&i.highlightComputed&&l.addClass(s),null===(t=this.parent)||void 0===t||t.updateStatus()},o.prototype.clear=function(t){t&&t.stopPropagation(),this.model.clear()},o.prototype.getClearEl=function(){return this.clearEl||(this.clearEl=this.el.querySelector("[".concat(wf,"]"))),this.clearEl},o.prototype.inputValueChanged=function(t){t&&t.stopPropagation(),this.emit||this.model.upValue(t.target.value)},o.prototype.onValueChange=function(t,e,n){void 0===n&&(n={}),this.setValue(this.model.getFullValue(void 0,{skipImportant:!0})),this.updateStatus()},o.prototype.setValue=function(e){var n=this.model,o=(0,t.isUndefined)(e)||''===e?n.getDefaultValue():e;if(this.update)return this.__update(o);this.__setValueInput(o)},o.prototype.__setValueInput=function(t){var e=this.getInputEl();e&&(e.value=t)},o.prototype.getInputEl=function(){return this.input||(this.input=this.el.querySelector('input')),this.input},o.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?'':'none'},o.prototype.clearCached=function(){delete this.clearEl,delete this.input,delete this.$input},o.prototype.__unset=function(){var t=this.unset&&this.unset.bind(this);t&&t(this._getClbOpts())},o.prototype.__update=function(t){var e=this.update&&this.update.bind(this);e&&e(yf(yf({},this._getClbOpts()),{value:t}))},o.prototype.__change=function(){for(var t=[],e=0;e\n \n \n ")},e.prototype.remove=function(){var t;return null===(t=this.props)||void 0===t||t.remove(),xf.prototype.remove.apply(this,arguments),this},e.prototype.onValueChange=function(){},e.prototype.onRender=function(){var t=this.pfx,e=this.model,n=e.get('properties');if(n.length&&!this.props){var o=e.isDetached(),r=new Of({config:kf(kf({},this.config),{highlightComputed:o,highlightChanged:o}),collection:n,parent:this});r.render(),this.$el.find("#".concat(t,"input-holder")).append(r.el),this.props=r}},e.prototype.clearCached=function(){xf.prototype.clearCached.apply(this,arguments),delete this.props},e}(xf);const Pf=Ef;var Af=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)}}(),jf=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Af(n,e),n.prototype.events=function(){return{click:'select','click [data-close-layer]':'removeItem','mousedown [data-move-layer]':'initSorter','touchstart [data-move-layer]':'initSorter'}},n.prototype.template=function(){var t=this,e=t.pfx,n=t.ppfx,o=t.em,r=null==o?void 0:o.getConfig().icons,i=(null==r?void 0:r.close)||'',a=(null==r?void 0:r.move)||'';return"\n
\n
\n ").concat(a,"\n
\n
\n
\n
\n
\n
\n ").concat(i,"\n
\n
\n
\n ")},n.prototype.initialize=function(t){void 0===t&&(t={});var e=this.model,n=t.config||{};this.em=n.em,this.config=n,this.sorter=t.sorter,this.pfx=n.stylePrefix||'',this.ppfx=n.pStylePrefix||'',this.propertyView=t.propertyView;var o=this.propertyView.model;this.listenTo(e,'destroy remove',this.remove),this.listenTo(e,'change:values',this.updateLabel),this.listenTo(o,'change:selectedLayer',this.updateVisibility),e.view=this,e.set({droppable:0,draggable:1}),this.$el.data('model',e)},n.prototype.initSorter=function(){var t;null===(t=this.sorter)||void 0===t||t.startSort(this.el)},n.prototype.removeItem=function(t){t&&t.stopPropagation(),this.model.remove()},n.prototype.select=function(){this.model.select()},n.prototype.getPropertiesWrapper=function(){return this.propsWrapEl||(this.propsWrapEl=this.el.querySelector('[data-properties]')),this.propsWrapEl},n.prototype.getPreviewEl=function(){return this.previewEl||(this.previewEl=this.el.querySelector('[data-preview]')),this.previewEl},n.prototype.getLabelEl=function(){return this.labelEl||(this.labelEl=this.el.querySelector('[data-label]')),this.labelEl},n.prototype.updateLabel=function(){var e=this.model,n=e.getLabel();if(this.getLabelEl().innerHTML=n,e.hasPreview()){var o=this.getPreviewEl(),r=e.getStylePreview({number:{min:-3,max:3}}),i=(0,t.keys)(r).map((function(t){return"".concat(t,":").concat(r[t])})).join(';');o.setAttribute('style',i)}},n.prototype.updateVisibility=function(){var t,e=this,n=e.pfx,o=e.model,r=e.propertyView,i=this.getPropertiesWrapper(),a=o.isSelected();i.style.display=a?'':'none',this.$el[a?'addClass':'removeClass']("".concat(n,"active")),a&&i.appendChild(null===(t=r.props)||void 0===t?void 0:t.el)},n.prototype.render=function(){var t=this,e=t.el,n=t.pfx,o=t.model;return e.innerHTML=this.template(),e.className="".concat(n,"layer"),o.hasPreview()&&(e.querySelector('[data-preview-box]').style.display=''),this.updateLabel(),this.updateVisibility(),this},n}(u.G7);const Mf=jf;var Lf=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)}}(),Df=function(t){function e(e){var n=t.call(this,e)||this,o=n.collection,r=e.config||{},i=r.em,a=r.stylePrefix||'',s=r.pStylePrefix||'';n.config=r,n.pfx=a,n.ppfx=s,n.propertyView=e.propertyView,n.className="".concat(a,"layers ").concat(s,"field"),n.listenTo(o,'add',n.addTo),n.listenTo(o,'reset',n.reset),n.items=[];var l=null==i?void 0:i.Utils;return n.sorter=l?new l.Sorter({container:n.el,ignoreViewChildren:1,containerSel:".".concat(a,"layers"),itemSel:".".concat(a,"layer"),pfx:r.pStylePrefix,em:i}):'',o.view=n,n.$el.data('model',o),n.$el.data('collection',o),n}return Lf(e,t),e.prototype.addTo=function(t){var e=this.collection.indexOf(t);this.addToCollection(t,null,e)},e.prototype.addToCollection=function(t,e,n){var o=e||null,r=this,i=r.propertyView,a=r.config,s=r.sorter,l=r.$el,c=new Mf({model:t,config:a,sorter:s,propertyView:i}),u=c.render().el;if(this.items.push(c),o)o.appendChild(u);else if(void 0!==n){var p='before';l.children().length===n&&(n--,p='after'),n<0?l.append(u):l.children().eq(n)[p](u)}else l.append(u);return u},e.prototype.reset=function(t,e){this.clearItems(),this.render()},e.prototype.remove=function(){return this.clearItems(),u.G7.prototype.remove.apply(this,arguments),this},e.prototype.clearItems=function(){this.items.forEach((function(t){return t.remove()})),this.items=[]},e.prototype.render=function(){var t=this,e=this.$el,n=this.sorter,o=document.createDocumentFragment();return e.empty(),this.collection.forEach((function(e){return t.addToCollection(e,o)})),e.append(o),e.attr('class',this.className),n&&(n.plh=null),this},e}(u.G7);const Nf=Df;var If=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)}}(),Ff=void 0&&(void 0).__assign||function(){return Ff=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n
\n \n ")},e.prototype.init=function(){var t=this.model;this.listenTo(t.layers,'change reset',this.updateStatus),this.listenTo(t,'change:isEmptyValue',this.updateStatus)},e.prototype.addLayer=function(){this.model.addLayer({},{at:0})},e.prototype.setValue=function(){},e.prototype.remove=function(){var t;return null===(t=this.layersView)||void 0===t||t.remove(),Pf.prototype.remove.apply(this,arguments),this},e.prototype.clearCached=function(){Pf.prototype.clearCached.apply(this,arguments),delete this.layersView},e.prototype.onRender=function(){var t=this,e=t.model,n=t.el,o=t.config,r=e.get('properties');if(r.length&&!this.props){var i=new Of({config:Ff(Ff({},o),{highlightComputed:!1,highlightChanged:!1}),collection:r,parent:this});i.render();var a=new Nf({collection:e.layers,config:o,propertyView:this});a.render(),n.querySelector('[data-layers-wrapper]').appendChild(a.el),this.props=i,this.layersView=a}},e}(Pf);const Rf=Vf;var Hf=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)}}(),Bf=void 0&&(void 0).__assign||function(){return Bf=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
\n
\n \n
\n
\n
\n
\n
\n
").concat(r,"
\n
\n \n ")},n.prototype.__setValueInput=function(t){var e=this.model,n=this.el,o=e.getDefaultValue(),r=n.querySelector('[data-preview-box]'),i=n.querySelector('[data-preview]');r.style.display=t&&t!==o?'':'none',i.style.backgroundImage=t||e.getDefaultValue()},n.prototype.openAssetManager=function(){var e,n=this,o=null===(e=this.em)||void 0===e?void 0:e.Assets;null==o||o.open({select:function(e,r){var i=(0,t.isString)(e)?e:e.get('src');n.model.upValue(i,{partial:!r}),r&&o.close()},types:['image'],accept:'image/*'})},n}(xf);const Uf=zf;var Wf=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=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Wf(e,t),e.prototype.templateInput=function(t){return''},e.prototype.init=function(){var t=this.model;this.listenTo(t,'change:unit',this.onValueChange),this.listenTo(t,'change:units',this.render)},e.prototype.setValue=function(t){},e.prototype.onRender=function(){var t=this,e=t.ppfx,n=t.model,o=t.el;if(!this.inputInst){var r=n.input;r.ppfx=e,r.render(),o.querySelector(".".concat(e,"fields")).appendChild(r.el),this.input=r.inputEl.get(0),this.inputInst=r}},e.prototype.clearCached=function(){xf.prototype.clearCached.apply(this,arguments),this.inputInst=null},e}(xf);const qf=$f;var Gf=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)}}(),Kf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Gf(e,t),e.prototype.setValue=function(t){var e;null===(e=this.inputInst)||void 0===e||e.setValue(t,{fromTarget:1,def:this.model.getDefaultValue()})},e.prototype.remove=function(){var t=this;qf.prototype.remove.apply(this,arguments);var e=this.inputInst;return e&&e.remove&&e.remove(),['inputInst','$color'].forEach((function(e){return t[e]=null})),this},e.prototype.__handleChange=function(t,e){this.model.upValue(t,{partial:e})},e.prototype.onRender=function(){var t;if(!this.inputInst){this.__handleChange=this.__handleChange.bind(this);var e=this,n=e.ppfx,o=e.model,r=e.em,i=e.el,a=new cl({target:r,model:o,ppfx:n,onChange:this.__handleChange}).render();i.querySelector(".".concat(n,"fields")).appendChild(a.el),this.input=null===(t=a.inputEl)||void 0===t?void 0:t.get(0),this.inputInst=a}},e}(qf);const Yf=Kf;var Zf=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)}}(),Xf=void 0&&(void 0).__assign||function(){return Xf=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n
\n
\n
\n \n ")},e.prototype.updateOptions=function(){delete this.input,this.onRender()},e.prototype.onRender=function(){var t=this.pfx,e=this.model,n=e.getOptions();if(!this.input){var o=[];n.forEach((function(t){var n=e.getOptionId(t),r=e.getOptionLabel(n),i=t.style?t.style.replace(/"/g,'"'):'',a=i?"style=\"".concat(i,"\""):'',s=n.replace(/"/g,'"');o.push(""))}));var r=this.el.querySelector("#".concat(t,"input-holder"));r.innerHTML=""),this.input=r.firstChild}},e.prototype.__setValueInput=function(t){var e=this.model,n=this.getInputEl(),o=e.getOptions()[0],r=o?e.getOptionId(o):'';n&&(n.value=t||r)},e}(xf);var oh=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)}}(),rh=void 0&&(void 0).__assign||function(){return rh=Object.assign||function(t){for(var e,n=1,o=arguments.length;n")},e.prototype.onRender=function(){var t=this.pfx,e=this.ppfx,n=this.model,o="".concat(e,"radio-item-label"),r=n.getName(),i=n.getOptions(),a="".concat(t,"radio ").concat(t,"radio-").concat(r),s=n.cid;if(!this.input){var l=[];i.forEach((function(i){var c=i.className?"".concat(i.className," ").concat(t,"icon ").concat(o):'',u=n.getOptionId(i),p="".concat(r,"-").concat(u,"-").concat(s),d=c?'':n.getOptionLabel(u),f=i.title?"title=\"".concat(i.title,"\""):'',h=n.getValue()===u?'checked':'';l.push("\n
\n \n \n
\n "))}));var c=this.el.querySelector(".".concat(e,"field"));c.innerHTML="
").concat(l.join(''),"
"),this.input=c.firstChild}},e.prototype.__setValueInput=function(t){var e,n=this.model,o=t||n.getDefaultValue(),r=null===(e=this.getInputEl())||void 0===e?void 0:e.querySelector("[value=\"".concat(o,"\"]"));r&&(r.checked=!0)},e}(nh);const lh=sh;var ch=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)}}(),uh=void 0&&(void 0).__assign||function(){return uh=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n \n \n ")},e.prototype.getSliderEl=function(){return this.slider||(this.slider=this.el.querySelector('input[type=range]')),this.slider},e.prototype.inputValueChanged=function(t){t.stopPropagation(),this.model.upValue(this.getSliderEl().value)},e.prototype.inputValueChangedSoft=function(t){t.stopPropagation(),this.model.upValue(this.getSliderEl().value,{partial:!0})},e.prototype.setValue=function(t){var e=this.model,n=e.parseValue(t);this.getSliderEl().value=''===t?e.getDefaultValue():parseFloat(n.value),qf.prototype.setValue.apply(this,arguments)},e.prototype.onRender=function(){qf.prototype.onRender.apply(this,arguments),this.model.get('showInput')||(this.inputInst.el.style.display='none')},e.prototype.clearCached=function(){qf.prototype.clearCached.apply(this,arguments),delete this.slider},e}(qf);const bh=u.FE.extend(Ec).extend({extendViewApi:1,init:function(){var t=this.opts,e=this.em,n=t.module||(null==e?void 0:e.get('StyleManager'));n&&(n.__listenAdd(this,n.events.propertyAdd),n.__listenRemove(this,n.events.propertyRemove))},types:[{id:'stack',model:gf,view:Rf,isType:function(t){if(t&&'stack'==t.type)return t}},{id:'composite',model:lf,view:Pf,isType:function(t){if(t&&'composite'==t.type)return t}},{id:'file',model:Kd,view:Uf,isType:function(t){if(t&&'file'==t.type)return t}},{id:'color',model:Kd,view:Yf,isType:function(t){if(t&&'color'==t.type)return t}},{id:'select',model:th,view:nh,isType:function(t){if(t&&'select'==t.type)return t}},{id:'radio',model:ih,view:lh,isType:function(t){if(t&&'radio'==t.type)return t}},{id:'slider',model:gh,view:mh,isType:function(t){if(t&&'slider'==t.type)return t}},{id:'integer',model:dh,view:qf,isType:function(t){if(t&&'integer'==t.type)return t}},{id:'number',model:dh,view:qf,isType:function(t){if(t&&'number'==t.type)return t}},{id:'base',model:Kd,view:xf,isType:function(t){return t.type='base',t}}]});var wh=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)}}(),_h=void 0&&(void 0).__assign||function(){return _h=Object.assign||function(t){for(var e,n=1,o=arguments.length;n\n
$","
\n
","
\n \n "],["\n
\n
$","
\n
","
\n
\n "])),s,s,a,s,o)},e.prototype.events=function(){return{'click [data-sector-title]':'toggle'}},e.prototype.updateOpen=function(){var t=this,e=t.$el,n=t.model,o=t.pfx,r=n.isOpen();e[r?'addClass':'removeClass']("".concat(o,"open")),this.getPropertiesEl().style.display=r?'':'none'},e.prototype.updateVisibility=function(){this.el.style.display=this.model.isVisible()?'':'none'},e.prototype.getPropertiesEl=function(){var t=this.$el,e=this.pfx;return t.find(".".concat(e,"properties")).get(0)},e.prototype.toggle=function(){var t=this.model;t.setOpen(!t.get('open'))},e.prototype.renderProperties=function(){var t=this.model,e=this.config,n=t.get('properties');if(n){var o=new Of({collection:n,config:e});this.$el.append(o.render().el)}},e.prototype.render=function(){var t=this,e=t.pfx,n=t.model,o=t.$el,r=n.getId(),i=n.getName();return o.html(this.template({pfx:e,label:i})),this.renderProperties(),o.attr('class',"".concat(e,"sector ").concat(e,"sector__").concat(r," no-select")),this.updateOpen(),this},e}(u.G7);const Vh=Fh;var Rh,Hh=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)}}(),Bh=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,e)||this,o=e.module,r=e.config,i=n.collection;return n.pfx=(null==r?void 0:r.stylePrefix)||'',n.ppfx=(null==r?void 0:r.pStylePrefix)||'',n.config=r,n.module=o,n.listenTo(i,'add',n.addTo),n.listenTo(i,'reset',n.render),n}return Hh(e,t),e.prototype.remove=function(){var t=this;return u.G7.prototype.remove.apply(this,arguments),['config','module','em'].forEach((function(e){return t[e]={}})),this},e.prototype.addTo=function(t,e,n){void 0===n&&(n={}),this.addToCollection(t,null,n)},e.prototype.addToCollection=function(t,e,n){void 0===n&&(n={});var o=this.config,r=this.el,i=e||r,a=new Vh({model:t,config:o}).render().el;return(0,wt.$Q)(i,a,n.at),a},e.prototype.render=function(){var t=this,e=this,n=e.$el,o=e.pfx,r=e.ppfx;n.empty();var i=document.createDocumentFragment();return this.collection.each((function(e){return t.addToCollection(e,i)})),n.append(i),n.addClass("".concat(o,"sectors ").concat(r,"one-bg ").concat(r,"two-color")),this},e}(u.G7);const zh=Bh;var Uh=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)}}(),Wh=void 0&&(void 0).__assign||function(){return Wh=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0}))})):[]},m=function(t){return t?c.getRules().filter((function(e){return e.selectorsToString()===t})):[]};if(p)f=c.getRules("#".concat(p.getId())),h=m(p.get('tagName')),v=(l?y(l.getSelectors().getFullName(d)):[]).concat(h).concat(f);else f=l?c.getRules("#".concat(l.getId())):[],h=m((null==l?void 0:l.get('tagName'))||''),g=y(((null==l?void 0:l.getSelectors().getFullName(d))||[]).filter((function(t){return-1===e.getSelectors().getFullName(d).findIndex((function(e){return e===t}))})).concat(e.getSelectors().getFullName(d))),v=h.concat(f).concat(g);var b=v.filter((function(e){return(0,t.isUndefined)(r)?1:e.get('state')===r})).sort(u.sortRules).reverse();s=b.slice(b.indexOf(e)+1)}return s},o.prototype.addType=function(t,e){this.properties.addType(t,e)},o.prototype.getType=function(t){return this.properties.getType(t)},o.prototype.getTypes=function(){return this.properties.getTypes()},o.prototype.createType=function(t,e){var n=void 0===e?{}:e,o=n.model,r=void 0===o?{}:o,i=n.view,a=void 0===i?{}:i,s=this.config,l=this.getType(t);if(l)return new l.view(Wh({model:new l.model(r),config:s},a))},o.prototype.render=function(){var t=this,e=t.config,n=t.em,o=t.SectView,r=o&&o.el;return this.SectView=new zh({el:r,em:n,config:e,module:this,collection:this.sectors}),this.SectView.render().el},o.prototype._logNoSector=function(t){var e=this.em;e&&e.logWarning("'".concat(t,"' sector not found"))},o.prototype.__emitCmpStyleUpdate=function(t,e){void 0===e&&(e={});var n=this.em;if(!t.__p){var o=this.getSelectedAll(),r=e.components||n.getSelectedAll(),i=Array.isArray(r)?r:[r],a=Wh({},t);delete a.__p,i.forEach((function(t){return!o.includes(t)&&t.__onStyleChange(a)}))}},o.prototype.__upProps=function(t){var e=this;void 0===t&&(t={});var n=this.getSelected();if(n){var o=this.sectors,r=this.model.get('component'),i=this.getSelectedParents(),a=n.getStyle(),s=i.map((function(t){return{target:t,style:t.getStyle()}}));o.map((function(n){n.getProperties().map((function(n){e.__upProp(n,a,s,t)}))})),o.forEach((function(t){var e=t.getProperties();e.forEach((function(t){var e=t.__checkVisibility({target:n,component:r,sectors:o});t.set('visible',e)}));var i=e.some((function(t){return t.isVisible()}));t.set('visible',i)}))}},o.prototype.__upProp=function(t,e,n,o){var r=this,i=t.getName(),a=e[i],s=ig(a),l='stack'===t.getType(),c='composite'===t.getType(),u=Wh(Wh({},o),{__up:!0}),p=!c&&!l,d=t,f=t,h=l?d.__getLayersFromStyle(e):[],g=c?f.__getPropsFromStyle(e):{},v=s?a:null,y=null;if(l&&null===h||c&&null===g){var m=l?'__getLayersFromStyle':'__getPropsFromStyle';if(w=n.filter((function(t){return null!==d[m](t.style)}))[0]){v=w.style[i],y=w.target;var b=d[m](w.style);l?h=b:g=b}}else if(!s){var w;v=null,(w=n.filter((function(t){return ig(t.style[i])}))[0])&&(v=w.style[i],y=w.target)}if(t.__setParentTarget(y),p&&t.__getFullValue()!==v&&t.upValue(v,u),l&&d.__setLayers(h||[],{isEmptyValue:d.isEmptyValueStyle(e)}),c){var _=f.getProperties();if(f.isDetached()){var x=f.__getPropsFromStyle(e,{byName:!0})||{},C=n.map((function(t){return Wh(Wh({},t),{style:f.__getPropsFromStyle(t.style,{byName:!0})||{}})}));_.map((function(t){return r.__upProp(t,x,C,o)}))}else f.__setProperties(g||{},u),f.getProperties().map((function(t){return t.__setParentTarget(y)}))}},o.prototype.destroy=function(){var t;[this.properties,this.sectors].forEach((function(t){t.reset(),t.stopListening()})),null===(t=this.SectView)||void 0===t||t.remove(),this.model.stopListening(),this.upAll.cancel()},o}(b);const lg=sg;var cg=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)}}(),ug=void 0&&(void 0).__assign||function(){return ug=Object.assign||function(t){for(var e,n=1,o=arguments.length;n0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=r.getStepsBeforeSave()&&this.store().catch((function(t){return o.logError(t)}))},o.prototype.loadModule=function(t){var e=new t(this);return this.set(e.name,e),e.onLoad&&this.toLoad.push(e),this.modules.push(e),e},o.prototype.loadStorableModule=function(t){var e=this.loadModule(t);return this.storables.push(e),e},o.prototype.init=function(t,e){void 0===e&&(e={}),this.destroyed&&(this.initialize(e),this.destroyed=!1),this.set('Editor',t)},o.prototype.getEditor=function(){return this.get('Editor')},o.prototype.handleUpdates=function(t,e,n){var o=this;void 0===n&&(n={}),this.__skip||n.temporary||n.noCount||n.avoidStore||!this.get('ready')||(this.timedInterval&&clearTimeout(this.timedInterval),this.timedInterval=setTimeout((function(){var t=o.getDirtyCount()||0,e=(n.unset,fg(n,["unset"]));o.set('changesCount',t+1,e)}),0))},o.prototype.changesUp=function(t){this.handleUpdates(0,0,t)},o.prototype.componentHovered=function(t,e,n){var o=this.previous('componentHovered');o&&this.trigger('component:unhovered',o,n),e&&this.trigger('component:hovered',e,n)},o.prototype.getSelected=function(){return this.selected.lastComponent()},o.prototype.getSelectedAll=function(){return this.selected.allComponents()},o.prototype.setSelected=function(e,n){var o=this;void 0===n&&(n={});var r=n.event,i=r&&(r.ctrlKey||r.metaKey),a=(r||{}).shiftKey,s=((0,t.isArray)(e)?e:[e]).map((function(t){var e,n;return(null===(n=null===(e=null==t?void 0:t.delegate)||void 0===e?void 0:e.select)||void 0===n?void 0:n.call(e,t))||t})).filter(Boolean),l=this.getSelectedAll(),c=this.getConfig().multipleSelection,u=(0,t.isArray)(e);!u&&e||this.removeSelected(l.filter((function(e){return!(0,t.contains)(s,e)}))),s.forEach((function(e){if(e&&(o.trigger('component:select:before',e,n),!e.get('selectable')||n.abort)){if(!n.useValid)return;for(var r=e.parent();r&&!r.get('selectable');)r=r.parent();e=r}if(i&&c)return o.toggleSelected(e);if(a&&c){o.clearSelection(o.Canvas.getWindow());var s,p,d=e.collection,f=e.index();if(o.getSelectedAll().forEach((function(e){var n=e.collection,o=e.index();n===d&&(of&&(p=(0,t.isUndefined)(p)?o:Math.min(p,o)))})),!(0,t.isUndefined)(s))for(;s!==f;)o.addSelected(d.at(s)),s++;if(!(0,t.isUndefined)(p))for(;p!==f;)o.addSelected(d.at(p)),p--;return o.addSelected(e)}!u&&o.removeSelected(l.filter((function(t){return t!==e}))),o.addSelected(e,n)}))},o.prototype.addSelected=function(e,n){var o=this;void 0===n&&(n={}),((0,t.isArray)(e)?e:[e]).forEach((function(e){var r=o.selected;e&&e.get('selectable')&&!e.parents().some((function(t){return r.hasComponent(t)}))&&(n.forceChange&&o.removeSelected(e,n),r.allComponents().filter((function(n){return(0,t.contains)(n.parents(),e)})).forEach((function(t){return o.removeSelected(t,n)})),r.addComponent(e,n),o.trigger('component:select',e,n),o.Canvas.addSpot({type:ut.q.Select,component:e}))}))},o.prototype.removeSelected=function(e,n){var o=this;void 0===n&&(n={}),this.selected.removeComponent(e,n),((0,t.isArray)(e)?e:[e]).forEach((function(t){return o.Canvas.removeSpots({type:ut.q.Select,component:t})}))},o.prototype.toggleSelected=function(e,n){var o=this;void 0===n&&(n={}),((0,t.isArray)(e)?e:[e]).forEach((function(t){o.selected.hasComponent(t)?o.removeSelected(t,n):o.addSelected(t,n)}))},o.prototype.setHovered=function(t,e){var n=this;void 0===e&&(e={});var o=function(t,e){var o=n,r=o.config,i=o.Canvas,a=n.getHovered(),s=n.getSelectedAll(),l=ut.q.Hover,c=ut.q.Spacing;n.set('componentHovered',t||null,e),a&&(i.removeSpots({type:l,component:a}),i.removeSpots({type:c,component:a})),t&&(i.addSpot({type:l,component:t}),s.includes(t)&&!r.showOffsetsSelected||i.addSpot({type:c,component:t}))};if(!t)return o();var r='component:hover';if(e.forceChange&&o(),this.trigger("".concat(r,":before"),t,e),!t.get('hoverable')){if(!e.useValid||e.abort)return;for(var i=t.parent();i&&!i.get('hoverable');)i=i.parent();t=i}e.abort||(o(t,e),this.trigger(r,t,e))},o.prototype.getHovered=function(){return this.get('componentHovered')},o.prototype.setComponents=function(t,e){return void 0===e&&(e={}),this.Components.setComponents(t,e)},o.prototype.getComponents=function(){var t=this.Components,e=this.CodeManager;if(t&&e){var n=t.getComponents();return e.getCode(n,'json')}},o.prototype.setStyle=function(t,e){void 0===e&&(e={});var n=this.Css;return n.clear(e),n.getAll().add(t,e),this},o.prototype.addStyle=function(e,n){void 0===n&&(n={});var o=this.getStyle().add(e,n);return(0,t.isArray)(o)?o:[o]},o.prototype.getStyle=function(){return this.Css.getAll()},o.prototype.setState=function(t){return this.set('state',t),this},o.prototype.getState=function(){return this.get('state')||''},o.prototype.getHtml=function(t){void 0===t&&(t={});var e=this.config,n=e.optsHtml,o=e.jsInHtml?this.getJs(t):'',r=t.component||this.Components.getComponent(),i=r?this.CodeManager.getCode(r,'html',ug(ug({},n),t)):'';return i+=o?"` : '';\n return html;\n }\n\n /**\n * Returns CSS built inside canvas\n * @param {Object} [opts={}] Options\n * @returns {string} CSS string\n * @public\n */\n getCss(opts: { component?: Component; avoidProtected?: boolean } & CssGeneratorBuildOptions = {}) {\n const { config } = this;\n const { optsCss } = config;\n const avoidProt = opts.avoidProtected;\n const keepUnusedStyles = !isUndefined(opts.keepUnusedStyles) ? opts.keepUnusedStyles : config.keepUnusedStyles;\n const cssc = this.Css;\n const wrp = opts.component || this.Components.getComponent();\n const protCss = !avoidProt ? config.protectedCss! : '';\n const css =\n wrp &&\n this.CodeManager.getCode(wrp, 'css', {\n cssc,\n keepUnusedStyles,\n ...optsCss,\n ...opts,\n });\n return wrp ? (opts.json ? css : protCss + css) : '';\n }\n\n /**\n * Returns JS of all components\n * @return {string} JS string\n * @public\n */\n getJs(opts: { component?: Component } = {}) {\n var wrp = opts.component || this.Components.getWrapper();\n return wrp ? this.CodeManager.getCode(wrp, 'js').trim() : '';\n }\n\n /**\n * Store data to the current storage.\n * @public\n */\n async store(options?: T) {\n const data = this.storeData();\n await this.Storage.store(data, options);\n this.clearDirtyCount();\n return data;\n }\n\n /**\n * Load data from the current storage.\n * @public\n */\n async load(options?: T, loadOptions: EditorLoadOptions = {}) {\n const result = await this.Storage.load(options);\n this.loadData(result);\n // Wait in order to properly update the dirty counter (#5385)\n await wait();\n\n if (loadOptions.clear) {\n this.UndoManager.clear();\n this.clearDirtyCount();\n }\n\n return result;\n }\n\n storeData(): ProjectData {\n let result = {};\n // Sync content if there is an active RTE\n const editingCmp = this.getEditing();\n editingCmp && editingCmp.trigger('sync:content', { noCount: true });\n\n this.storables.forEach(m => {\n result = { ...result, ...m.store(1) };\n });\n return JSON.parse(JSON.stringify(result));\n }\n\n loadData(data: ProjectData = {}): ProjectData {\n if (!isEmptyObj(data)) {\n this.storables.forEach(module => module.clear());\n this.storables.forEach(module => module.load(data));\n }\n return data;\n }\n\n /**\n * Returns device model by name\n * @return {Device|null}\n * @private\n */\n getDeviceModel() {\n const name = this.get('device');\n return this.Devices.get(name);\n }\n\n /**\n * Run default command if setted\n * @param {Object} [opts={}] Options\n * @private\n */\n runDefault(opts = {}) {\n const command = this.get('Commands').get(this.config.defaultCommand);\n if (!command || this.defaultRunning) return;\n command.stop(this, this, opts);\n command.run(this, this, opts);\n this.defaultRunning = true;\n }\n\n /**\n * Stop default command\n * @param {Object} [opts={}] Options\n * @private\n */\n stopDefault(opts = {}) {\n const commands = this.get('Commands');\n const command = commands.get(this.config.defaultCommand);\n if (!command || !this.defaultRunning) return;\n command.stop(this, this, opts);\n this.defaultRunning = false;\n }\n\n /**\n * Update canvas dimensions and refresh data useful for tools positioning\n * @public\n */\n refreshCanvas(opts: any = {}) {\n this.Canvas.refresh({ spots: opts.tools });\n }\n\n /**\n * Clear all selected stuf inside the window, sometimes is useful to call before\n * doing some dragging opearation\n * @param {Window} win If not passed the current one will be used\n * @private\n */\n clearSelection(win?: Window) {\n var w = win || window;\n w.getSelection()?.removeAllRanges();\n }\n\n /**\n * Get the current media text\n * @return {string}\n */\n getCurrentMedia() {\n const config = this.config;\n const device = this.getDeviceModel();\n const condition = config.mediaCondition;\n const preview = config.devicePreviewMode;\n const width = device && device.get('widthMedia');\n return device && width && !preview ? `(${condition}: ${width})` : '';\n }\n\n /**\n * Return the component wrapper\n * @return {Component}\n */\n getWrapper(): ComponentWrapper | undefined {\n return this.Components.getWrapper();\n }\n\n setCurrentFrame(frameView?: FrameView) {\n return this.set('currentFrame', frameView);\n }\n\n getCurrentFrame(): FrameView | undefined {\n return this.get('currentFrame');\n }\n\n getCurrentFrameModel() {\n return (this.getCurrentFrame() || {})?.model;\n }\n\n getIcon(icon: string) {\n const icons = this.config.icons || {};\n return icons[icon] || '';\n }\n\n /**\n * Return the count of changes made to the content and not yet stored.\n * This count resets at any `store()`\n * @return {number}\n */\n getDirtyCount(): number {\n return this.get('changesCount');\n }\n\n clearDirtyCount() {\n return this.set({ changesCount: 0 }, { isClear: true });\n }\n\n getZoomDecimal() {\n return this.Canvas.getZoomDecimal();\n }\n\n getZoomMultiplier() {\n return this.Canvas.getZoomMultiplier();\n }\n\n setDragMode(value: DragMode) {\n return this.set('dmode', value);\n }\n\n getDragMode(component?: Component): DragMode {\n const mode = component?.getDragMode() || this.get('dmode');\n return mode || '';\n }\n\n t(...args: any[]) {\n const i18n = this.get('I18n');\n return i18n?.t(...args);\n }\n\n /**\n * Returns true if the editor is in absolute mode\n * @returns {Boolean}\n */\n inAbsoluteMode(component?: Component) {\n return this.getDragMode(component) === 'absolute';\n }\n\n /**\n * Destroy editor\n */\n destroyAll() {\n const { config, view } = this;\n const editor = this.getEditor();\n // @ts-ignore\n const { editors = [] } = config.grapesjs || {};\n const shallow = this.get('shallow');\n this._storageTimeout && clearTimeout(this._storageTimeout);\n shallow?.destroyAll();\n this.stopListening();\n this.stopDefault();\n this.modules\n .slice()\n .reverse()\n .forEach(mod => mod.destroy());\n view && view.remove();\n this.clear({ silent: true });\n this.destroyed = true;\n ['_config', 'view', '_previousAttributes', '_events', '_listeners'].forEach(\n //@ts-ignore\n i => (this[i] = {})\n );\n editors.splice(editors.indexOf(editor), 1);\n //@ts-ignore\n hasWin() && $(config.el).empty().attr(this.attrsOrig);\n }\n\n getEditing(): Component | undefined {\n const res = this.get('editing');\n return (res && res.model) || undefined;\n }\n\n setEditing(value: boolean | ComponentView) {\n this.set('editing', value);\n return this;\n }\n\n isEditing() {\n return !!this.get('editing');\n }\n\n log(msg: string, opts: any = {}) {\n const { ns, level = 'debug' } = opts;\n this.trigger('log', msg, opts);\n level && this.trigger(`log:${level}`, msg, opts);\n\n if (ns) {\n const logNs = `log-${ns}`;\n this.trigger(logNs, msg, opts);\n level && this.trigger(`${logNs}:${level}`, msg, opts);\n }\n }\n\n logInfo(msg: string, opts?: any) {\n this.log(msg, { ...opts, level: 'info' });\n }\n\n logWarning(msg: string, opts?: any) {\n this.log(msg, { ...opts, level: 'warning' });\n }\n\n logError(msg: string, opts?: any) {\n this.log(msg, { ...opts, level: 'error' });\n }\n\n initBaseColorPicker(el: any, opts = {}) {\n const { config } = this;\n const { colorPicker = {} } = config;\n const elToAppend = config.el;\n const ppfx = config.stylePrefix;\n\n //@ts-ignore\n return $(el).spectrum({\n containerClassName: `${ppfx}one-bg ${ppfx}two-color`,\n appendTo: elToAppend || 'body',\n maxSelectionSize: 8,\n showPalette: true,\n palette: [],\n showAlpha: true,\n chooseText: 'Ok',\n cancelText: '⨯',\n ...opts,\n ...colorPicker,\n });\n }\n\n /**\n * Execute actions without triggering the storage and undo manager.\n * @param {Function} clb\n * @private\n */\n skip(clb: Function) {\n this.__skip = true;\n const um = this.UndoManager;\n um ? um.skip(clb) : clb();\n this.__skip = false;\n }\n\n /**\n * Set/get data from the HTMLElement\n * @param {HTMLElement} el\n * @param {string} name Data name\n * @param {any} value Date value\n * @return {any}\n * @private\n */\n data(el: any, name: string, value: any) {\n const varName = '_gjs-data';\n\n if (!el[varName]) {\n el[varName] = {};\n }\n\n if (isUndefined(value)) {\n return el[varName][name];\n } else {\n el[varName][name] = value;\n }\n }\n}\n","import { isObject } from 'underscore';\n\nexport default ({ $ }: { $: any }) => {\n if ($ && $.prototype && $.prototype.constructor.name !== 'jQuery') {\n const fn = $.fn;\n\n // Additional helpers\n\n fn.hide = function () {\n return this.css('display', 'none');\n };\n\n fn.show = function () {\n return this.css('display', 'block');\n };\n\n fn.focus = function () {\n const el = this.get(0);\n el && el.focus();\n return this;\n };\n\n // For spectrum compatibility\n\n fn.bind = function (ev: any, h: any) {\n return this.on(ev, h);\n };\n\n fn.unbind = function (ev: any, h: any) {\n if (isObject(ev)) {\n for (let name in ev) {\n ev.hasOwnProperty(name) && this.off(name, ev[name]);\n }\n\n return this;\n } else {\n return this.off(ev, h);\n }\n };\n\n fn.click = function (h: any) {\n return h ? this.on('click', h) : this.trigger('click');\n };\n\n fn.change = function (h: any) {\n return h ? this.on('change', h) : this.trigger('change');\n };\n\n fn.keydown = function (h: any) {\n return h ? this.on('keydown', h) : this.trigger('keydown');\n };\n\n fn.delegate = function (selector: any, events: any, data: any, handler: any) {\n if (!handler) {\n handler = data;\n }\n\n return this.on(events, selector, function (e: any) {\n e.data = data;\n handler(e);\n });\n };\n\n fn.scrollLeft = function () {\n let el = this.get(0);\n el = el.nodeType == 9 ? el.defaultView : el;\n let win = el instanceof Window ? el : null;\n return win ? win.pageXOffset : el.scrollLeft || 0;\n };\n\n fn.scrollTop = function () {\n let el = this.get(0);\n el = el.nodeType == 9 ? el.defaultView : el;\n let win = el instanceof Window ? el : null;\n return win ? win.pageYOffset : el.scrollTop || 0;\n };\n\n const offset = $.prototype.offset;\n fn.offset = function (coords: any) {\n let top, left;\n\n if (coords) {\n top = coords.top;\n left = coords.left;\n }\n\n if (typeof top != 'undefined') {\n this.css('top', `${top}px`);\n }\n if (typeof left != 'undefined') {\n this.css('left', `${left}px`);\n }\n\n return offset.call(this);\n };\n\n $.map = function (items: any, clb: any) {\n const ar = [];\n\n for (var i = 0; i < items.length; i++) {\n ar.push(clb(items[i], i));\n }\n\n return ar;\n };\n\n const indexOf = Array.prototype.indexOf;\n\n $.inArray = function (val: any, arr: any, i: any) {\n return arr == null ? -1 : indexOf.call(arr, val, i);\n };\n\n $.Event = function (src: any, props: any) {\n if (!(this instanceof $.Event)) {\n return new $.Event(src, props);\n }\n\n this.type = src;\n this.isDefaultPrevented = () => false;\n };\n }\n};\n","import { View, $ } from '../../common';\nimport { appendStyles } from '../../utils/mixins';\nimport EditorModel from '../model/Editor';\n\nexport default class EditorView extends View {\n constructor(model: EditorModel) {\n super({ model });\n const { Panels, UndoManager } = model;\n model.view = this;\n model.once('change:ready', () => {\n Panels.active();\n Panels.disableButtons();\n UndoManager.clear();\n setTimeout(() => {\n model.trigger('load', model.Editor);\n model.clearDirtyCount();\n });\n });\n }\n\n render() {\n const { $el, model } = this;\n const { Panels, Canvas, config, modules } = model;\n const pfx = config.stylePrefix;\n const classNames = [`${pfx}editor`];\n !config.customUI && classNames.push(`${pfx}one-bg ${pfx}two-color`);\n\n const contEl = $(config.el || `body ${config.container}`);\n config.cssIcons && appendStyles(config.cssIcons, { unique: true, prepand: true });\n $el.empty();\n\n config.width && contEl.css('width', config.width);\n config.height && contEl.css('height', config.height);\n\n $el.append(Canvas.render());\n $el.append(Panels.render());\n\n // Load shallow editor\n const { shallow } = model;\n const shallowCanvasEl = shallow.Canvas.render();\n shallowCanvasEl.style.display = 'none';\n $el.append(shallowCanvasEl);\n\n $el.attr('class', classNames.join(' '));\n contEl.addClass(`${pfx}editor-cont`).empty().append($el);\n modules.forEach(md => md.postRender?.(this));\n\n return this;\n }\n}\n","/**\n * Editor contains the top level API which you'll probably use to customize the editor or extend it with plugins.\n * You get the Editor instance on init method and you can pass options via its [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/editor/config/config.ts)\n *\n * ```js\n * const editor = grapesjs.init({\n * // options\n * });\n * ```\n *\n * ## Available Events\n *\n * You can make use of available events in this way\n * ```js\n * editor.on('EVENT-NAME', (some, argument) => {\n * // do something\n * })\n * ```\n *\n * * `update` - The structure of the template is updated (its HTML/CSS)\n * * `undo` - Undo executed\n * * `redo` - Redo executed\n * * `load` - Editor is loaded\n *\n * ### Components\n * Check the [Components](/api/components.html) module.\n * ### Keymaps\n * Check the [Keymaps](/api/keymaps.html) module.\n * ### Style Manager\n * Check the [Style Manager](/api/style_manager.html) module.\n * ### Storage\n * Check the [Storage](/api/storage_manager.html) module.\n * ### Canvas\n * Check the [Canvas](/api/canvas.html) module.\n * ### RTE\n * Check the [Rich Text Editor](/api/rich_text_editor.html) module.\n * ### Commands\n * Check the [Commands](/api/commands.html) module.\n * ### Selectors\n * Check the [Selectors](/api/selector_manager.html) module.\n * ### Blocks\n * Check the [Blocks](/api/block_manager.html) module.\n * ### Assets\n * Check the [Assets](/api/assets.html) module.\n * ### Modal\n * Check the [Modal](/api/modal_dialog.html) module.\n * ### Devices\n * Check the [Devices](/api/device_manager.html) module.\n * ### Parser\n * Check the [Parser](/api/parser.html) module.\n * ### Pages\n * Check the [Pages](/api/pages.html) module.\n *\n * ## Methods\n * @module docsjs.Editor\n */\nimport { IBaseModule } from '../abstract/Module';\nimport AssetManager from '../asset_manager';\nimport { AssetEvent } from '../asset_manager/types';\nimport BlockManager, { BlockEvent } from '../block_manager';\nimport CanvasModule, { CanvasEvent } from '../canvas';\nimport CodeManagerModule from '../code_manager';\nimport CommandsModule, { CommandEvent } from '../commands';\nimport { AddOptions, EventHandler, LiteralUnion } from '../common';\nimport CssComposer from '../css_composer';\nimport CssRule from '../css_composer/model/CssRule';\nimport CssRules from '../css_composer/model/CssRules';\nimport DeviceManager from '../device_manager';\nimport ComponentManager, { ComponentEvent } from '../dom_components';\nimport Component from '../dom_components/model/Component';\nimport Components from '../dom_components/model/Components';\nimport ComponentWrapper from '../dom_components/model/ComponentWrapper';\nimport { ComponentAdd, DragMode } from '../dom_components/model/types';\nimport I18nModule from '../i18n';\nimport KeymapsModule, { KeymapEvent } from '../keymaps';\nimport ModalModule, { ModalEvent } from '../modal_dialog';\nimport LayerManager from '../navigator';\nimport PageManager from '../pages';\nimport PanelManager from '../panels';\nimport ParserModule from '../parser';\nimport { CustomParserCss } from '../parser/config/config';\nimport RichTextEditorModule, { RichTextEditorEvent } from '../rich_text_editor';\nimport { CustomRTE } from '../rich_text_editor/config/config';\nimport SelectorManager, { SelectorEvent } from '../selector_manager';\nimport StorageManager, { StorageEvent, StorageOptions, ProjectData } from '../storage_manager';\nimport StyleManager, { StyleManagerEvent } from '../style_manager';\nimport TraitManager from '../trait_manager';\nimport UndoManagerModule from '../undo_manager';\nimport UtilsModule from '../utils';\nimport html from '../utils/html';\nimport defaults, { EditorConfig, EditorConfigKeys } from './config/config';\nimport EditorModel, { EditorLoadOptions } from './model/Editor';\nimport EditorView from './view/EditorView';\n\nexport type ParsedRule = {\n selectors: string;\n style: Record;\n atRule?: string;\n params?: string;\n};\n\ntype GeneralEvent = 'canvasScroll' | 'undo' | 'redo' | 'load' | 'update';\n\ntype EditorBuiltInEvents =\n | ComponentEvent\n | BlockEvent\n | AssetEvent\n | KeymapEvent\n | StyleManagerEvent\n | StorageEvent\n | CanvasEvent\n | SelectorEvent\n | RichTextEditorEvent\n | ModalEvent\n | CommandEvent\n | GeneralEvent;\n\ntype EditorEvent = LiteralUnion;\n\ntype EditorConfigType = EditorConfig & { pStylePrefix?: string };\n\ntype EditorModelParam = Parameters[N];\n\nexport type EditorParam = Parameters[N];\n\nexport default class Editor implements IBaseModule {\n editorView?: EditorView;\n editor: EditorModel;\n $: any;\n em: EditorModel;\n config: EditorConfigType;\n\n constructor(config: EditorConfig = {}, opts: any = {}) {\n this.config = {\n ...defaults,\n ...config,\n pStylePrefix: config.stylePrefix ?? defaults.stylePrefix,\n };\n this.em = new EditorModel(this.config);\n this.$ = opts.$;\n this.em.init(this);\n this.editor = this.em;\n }\n\n get Config() {\n return this.em.config;\n }\n get I18n(): I18nModule {\n return this.em.I18n;\n }\n get Utils(): UtilsModule {\n return this.em.Utils;\n }\n get Commands(): CommandsModule {\n return this.em.Commands;\n }\n get Keymaps(): KeymapsModule {\n return this.em.Keymaps;\n }\n get Modal(): ModalModule {\n return this.em.Modal;\n }\n get Panels(): PanelManager {\n return this.em.Panels;\n }\n get Canvas(): CanvasModule {\n return this.em.Canvas;\n }\n get Parser(): ParserModule {\n return this.em.Parser;\n }\n get CodeManager(): CodeManagerModule {\n return this.em.CodeManager;\n }\n get UndoManager(): UndoManagerModule {\n return this.em.UndoManager;\n }\n get RichTextEditor(): RichTextEditorModule {\n return this.em.RichTextEditor;\n }\n get Pages(): PageManager {\n return this.em.Pages;\n }\n get Components(): ComponentManager {\n return this.em.Components;\n }\n get DomComponents(): ComponentManager {\n return this.em.Components;\n }\n get Layers(): LayerManager {\n return this.em.Layers;\n }\n get LayerManager(): LayerManager {\n return this.em.Layers;\n }\n get Css(): CssComposer {\n return this.em.Css;\n }\n get CssComposer(): CssComposer {\n return this.em.Css;\n }\n get Storage(): StorageManager {\n return this.em.Storage;\n }\n get StorageManager(): StorageManager {\n return this.em.Storage;\n }\n get Assets(): AssetManager {\n return this.em.Assets;\n }\n get AssetManager(): AssetManager {\n return this.em.Assets;\n }\n get Blocks(): BlockManager {\n return this.em.Blocks;\n }\n get BlockManager(): BlockManager {\n return this.em.Blocks;\n }\n get Traits(): TraitManager {\n return this.em.Traits;\n }\n get TraitManager(): TraitManager {\n return this.em.Traits;\n }\n get Selectors(): SelectorManager {\n return this.em.Selectors;\n }\n get SelectorManager(): SelectorManager {\n return this.em.Selectors;\n }\n get Styles(): StyleManager {\n return this.em.Styles;\n }\n get StyleManager(): StyleManager {\n return this.em.Styles;\n }\n get Devices(): DeviceManager {\n return this.em.Devices;\n }\n get DeviceManager(): DeviceManager {\n return this.em.Devices;\n }\n\n get EditorModel() {\n return this.em;\n }\n\n /**\n * Returns configuration object\n * @returns {any} Returns the configuration object or the value of the specified property\n */\n getConfig<\n P extends EditorConfigKeys | undefined = undefined,\n R = P extends EditorConfigKeys ? EditorConfig[P] : EditorConfig\n >(prop?: P): R {\n return this.em.getConfig(prop);\n }\n\n /**\n * Returns HTML built inside canvas\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Return the HTML of a specific Component\n * @param {Boolean} [opts.cleanId=false] Remove unnecessary IDs (eg. those created automatically)\n * @returns {string} HTML string\n */\n getHtml(opts?: EditorModelParam<'getHtml', 0>) {\n return this.em.getHtml(opts);\n }\n\n /**\n * Returns CSS built inside canvas\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Return the CSS of a specific Component\n * @param {Boolean} [opts.json=false] Return an array of CssRules instead of the CSS string\n * @param {Boolean} [opts.avoidProtected=false] Don't include protected CSS\n * @param {Boolean} [opts.onlyMatched=false] Return only rules matched by the passed component.\n * @param {Boolean} [opts.keepUnusedStyles=false] Force keep all defined rules. Toggle on in case output looks different inside/outside of the editor.\n * @returns {String|Array} CSS string or array of CssRules\n */\n getCss(opts?: EditorModelParam<'getCss', 0>) {\n return this.em.getCss(opts);\n }\n\n /**\n * Returns JS of all components\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Get the JS of a specific component\n * @returns {String} JS string\n */\n getJs(opts?: EditorModelParam<'getJs', 0>) {\n return this.em.getJs(opts);\n }\n\n /**\n * Return the complete tree of components. Use `getWrapper` to include also the wrapper\n * @return {Components}\n */\n getComponents(): Components {\n return this.Components.getComponents();\n }\n\n /**\n * Return the wrapper and its all components\n * @return {Component}\n */\n getWrapper(): ComponentWrapper | undefined {\n return this.Components.getWrapper();\n }\n\n /**\n * Set components inside editor's canvas. This method overrides actual components\n * @param {Array|Object|string} components HTML string or components model\n * @param {Object} opt the options object to be used by the [setComponents]{@link em#setComponents} method\n * @return {this}\n * @example\n * editor.setComponents('
New component
');\n * // or\n * editor.setComponents({\n * type: 'text',\n * classes:['cls'],\n * content: 'New component'\n * });\n */\n setComponents(components: ComponentAdd, opt: AddOptions = {}) {\n this.em.setComponents(components, opt);\n return this;\n }\n\n /**\n * Add components\n * @param {Array|Object|string} components HTML string or components model\n * @param {Object} opts Options\n * @param {Boolean} [opts.avoidUpdateStyle=false] If the HTML string contains styles,\n * by default, they will be created and, if already exist, updated. When this option\n * is true, styles already created will not be updated.\n * @return {Array}\n * @example\n * editor.addComponents('
New component
');\n * // or\n * editor.addComponents({\n * type: 'text',\n * classes:['cls'],\n * content: 'New component'\n * });\n */\n addComponents(components: ComponentAdd, opts?: AddOptions): Component[] {\n return this.getWrapper()!.append(components, opts);\n }\n\n /**\n * Returns style in JSON format object\n * @return {Object}\n */\n getStyle(): CssRules {\n return this.em.Css.getAll();\n }\n\n /**\n * Set style inside editor's canvas. This method overrides actual style\n * @param {Array|Object|string} style CSS string or style model\n * @return {this}\n * @example\n * editor.setStyle('.cls{color: red}');\n * //or\n * editor.setStyle({\n * selectors: ['cls'],\n * style: { color: 'red' }\n * });\n */\n setStyle(style: any, opt: any = {}) {\n this.em.setStyle(style, opt);\n return this;\n }\n\n /**\n * Add styles to the editor\n * @param {Array|Object|string} style CSS string or style model\n * @returns {Array} Array of created CssRule instances\n * @example\n * editor.addStyle('.cls{color: red}');\n */\n addStyle(style: any, opts = {}): CssRule[] {\n return this.em.addStyle(style, opts);\n }\n\n /**\n * Returns the last selected component, if there is one\n * @return {Model}\n */\n getSelected() {\n return this.em.getSelected();\n }\n\n /**\n * Returns an array of all selected components\n * @return {Array}\n */\n getSelectedAll() {\n return this.em.getSelectedAll();\n }\n\n /**\n * Get a stylable entity from the selected component.\n * If you select a component without classes the entity is the Component\n * itself and all changes will go inside its 'style' attribute. Otherwise,\n * if the selected component has one or more classes, the function will\n * return the corresponding CSS Rule\n * @return {Model}\n */\n getSelectedToStyle() {\n let selected = this.em.getSelected();\n\n if (selected) {\n return this.StyleManager.getModelToStyle(selected);\n }\n }\n\n /**\n * Select a component\n * @param {Component|HTMLElement} el Component to select\n * @param {Object} [opts] Options\n * @param {Boolean} [opts.scroll] Scroll canvas to the selected element\n * @return {this}\n * @example\n * // Select dropped block\n * editor.on('block:drag:stop', function(model) {\n * editor.select(model);\n * });\n */\n select(el?: EditorModelParam<'setSelected', 0>, opts?: { scroll?: boolean }) {\n this.em.setSelected(el, opts);\n return this;\n }\n\n /**\n * Add component to selection\n * @param {Component|HTMLElement|Array} el Component to select\n * @return {this}\n * @example\n * editor.selectAdd(model);\n */\n // selectAdd(el: Parameters[0]) {\n selectAdd(el: EditorModelParam<'addSelected', 0>) {\n this.em.addSelected(el);\n return this;\n }\n\n /**\n * Remove component from selection\n * @param {Component|HTMLElement|Array} el Component to select\n * @return {this}\n * @example\n * editor.selectRemove(model);\n */\n selectRemove(el: EditorModelParam<'removeSelected', 0>) {\n this.em.removeSelected(el);\n return this;\n }\n\n /**\n * Toggle component selection\n * @param {Component|HTMLElement|Array} el Component to select\n * @return {this}\n * @example\n * editor.selectToggle(model);\n */\n selectToggle(el: EditorModelParam<'toggleSelected', 0>) {\n this.em.toggleSelected(el);\n return this;\n }\n\n /**\n * Returns, if active, the Component enabled in rich text editing mode.\n * @returns {Component|null}\n * @example\n * const textComp = editor.getEditing();\n * if (textComp) {\n * console.log('HTML: ', textComp.toHTML());\n * }\n */\n getEditing() {\n return this.em.getEditing();\n }\n\n /**\n * Set device to the editor. If the device exists it will\n * change the canvas to the proper width\n * @param {string} name Name of the device\n * @return {this}\n * @example\n * editor.setDevice('Tablet');\n */\n setDevice(name: string) {\n this.em.set('device', name);\n return this;\n }\n\n /**\n * Return the actual active device\n * @return {string} Device name\n * @example\n * var device = editor.getDevice();\n * console.log(device);\n * // 'Tablet'\n */\n getDevice(): string {\n return this.em.get('device');\n }\n\n /**\n * Execute command\n * @param {string} id Command ID\n * @param {Object} options Custom options\n * @return {*} The return is defined by the command\n * @example\n * editor.runCommand('myCommand', {someValue: 1});\n */\n runCommand(id: string, options: Record = {}) {\n return this.Commands.run(id, options);\n }\n\n /**\n * Stop the command if stop method was provided\n * @param {string} id Command ID\n * @param {Object} options Custom options\n * @return {*} The return is defined by the command\n * @example\n * editor.stopCommand('myCommand', {someValue: 1});\n */\n stopCommand(id: string, options: Record = {}) {\n return this.Commands.stop(id, options);\n }\n\n /**\n * Store data to the current storage.\n * This will reset the counter of changes (`editor.getDirtyCount()`).\n * @param {Object} [options] Storage options.\n * @returns {Object} Stored data.\n * @example\n * const storedData = await editor.store();\n */\n async store(options?: T) {\n return await this.em.store(options);\n }\n\n /**\n * Load data from the current storage.\n * @param {Object} [options] Storage options.\n * @param {Object} [loadOptions={}] Load options.\n * @param {Boolean} [loadOptions.clear=false] Clear the editor state (eg. dirty counter, undo manager, etc.).\n * @returns {Object} Loaded data.\n * @example\n * const data = await editor.load();\n */\n async load(options?: T, loadOptions: EditorLoadOptions = {}) {\n return await this.em.load(options, loadOptions);\n }\n\n /**\n * Get the JSON project data, which could be stored and loaded back with `editor.loadProjectData(json)`\n * @returns {Object}\n * @example\n * console.log(editor.getProjectData());\n * // { pages: [...], styles: [...], ... }\n */\n getProjectData() {\n return this.em.storeData();\n }\n\n /**\n * Load data from the JSON project\n * @param {Object} data Project to load\n * @example\n * editor.loadProjectData({ pages: [...], styles: [...], ... })\n */\n loadProjectData(data: ProjectData) {\n return this.em.loadData(data);\n }\n\n storeData() {\n return this.em.storeData();\n }\n\n loadData(data: any) {\n return this.em.loadData(data);\n }\n\n /**\n * Returns container element. The one which was indicated as 'container'\n * on init method\n * @return {HTMLElement}\n */\n getContainer() {\n return this.config.el;\n }\n\n /**\n * Return the count of changes made to the content and not yet stored.\n * This count resets at any `store()`\n * @return {number}\n */\n getDirtyCount() {\n return this.em.getDirtyCount();\n }\n\n /**\n * Reset the counter of changes.\n */\n clearDirtyCount() {\n return this.em.clearDirtyCount();\n }\n\n /**\n * Update editor dimension offsets\n *\n * This method could be useful when you update, for example, some position\n * of the editor element (eg. canvas, panels, etc.) with CSS, where without\n * refresh you'll get misleading position of tools\n * @param {Object} [options] Options\n * @param {Boolean} [options.tools=false] Update the position of tools (eg. rich text editor, component highlighter, etc.)\n */\n refresh(opts?: { tools?: boolean }) {\n this.em.refreshCanvas(opts);\n }\n\n /**\n * Replace the built-in Rich Text Editor with a custom one.\n * @param {Object} obj Custom RTE Interface\n * @example\n * editor.setCustomRte({\n * // Function for enabling custom RTE\n * // el is the HTMLElement of the double clicked Text Component\n * // rte is the same instance you have returned the first time you call\n * // enable(). This is useful if need to check if the RTE is already enabled so\n * // ion this case you'll need to return the RTE and the end of the function\n * enable: function(el, rte) {\n * rte = new MyCustomRte(el, {}); // this depends on the Custom RTE API\n * ...\n * return rte; // return the RTE instance\n * }\n *\n * // Disable the editor, called for example when you unfocus the Text Component\n * disable: function(el, rte) {\n * rte.blur(); // this depends on the Custom RTE API\n * }\n *\n * // Called when the Text Component is focused again. If you returned the RTE instance\n * // from the enable function, the enable won't be called again instead will call focus,\n * // in this case to avoid double binding of the editor\n * focus: function (el, rte) {\n * rte.focus(); // this depends on the Custom RTE API\n * }\n * });\n */\n setCustomRte(obj: CustomRTE & ThisType) {\n this.RichTextEditor.customRte = obj;\n }\n\n /**\n * Replace the default CSS parser with a custom one.\n * The parser function receives a CSS string as a parameter and expects\n * an array of CSSRule objects as a result. If you need to remove the\n * custom parser, pass `null` as the argument\n * @param {Function|null} parser Parser function\n * @return {this}\n * @example\n * editor.setCustomParserCss(css => {\n * const result = [];\n * // ... parse the CSS string\n * result.push({\n * selectors: '.someclass, div .otherclass',\n * style: { color: 'red' }\n * })\n * // ...\n * return result;\n * });\n */\n setCustomParserCss(parser: CustomParserCss) {\n this.Parser.getConfig().parserCss = parser;\n return this;\n }\n\n /**\n * Change the global drag mode of components.\n * To get more about this feature read: https://github.com/GrapesJS/grapesjs/issues/1936\n * @param {String} value Drag mode, options: 'absolute' | 'translate'\n * @returns {this}\n */\n setDragMode(value: DragMode) {\n this.em.setDragMode(value);\n return this;\n }\n\n /**\n * Trigger event log message\n * @param {*} msg Message to log\n * @param {Object} [opts={}] Custom options\n * @param {String} [opts.ns=''] Namespace of the log (eg. to use in plugins)\n * @param {String} [opts.level='debug'] Level of the log, `debug`, `info`, `warning`, `error`\n * @return {this}\n * @example\n * editor.log('Something done!', { ns: 'from-plugin-x', level: 'info' });\n * // This will trigger following events\n * // `log`, `log:info`, `log-from-plugin-x`, `log-from-plugin-x:info`\n * // Callbacks of those events will always receive the message and\n * // options, as arguments, eg:\n * // editor.on('log:info', (msg, opts) => console.info(msg, opts))\n */\n log(msg: string, opts: { ns?: string; level?: string } = {}) {\n this.em.log(msg, opts);\n return this;\n }\n\n /**\n * Translate label\n * @param {String} key Label to translate\n * @param {Object} [opts] Options for the translation\n * @param {Object} [opts.params] Params for the translation\n * @param {Boolean} [opts.noWarn] Avoid warnings in case of missing resources\n * @returns {String}\n * @example\n * editor.t('msg');\n * // use params\n * editor.t('msg2', { params: { test: 'hello' } });\n * // custom local\n * editor.t('msg2', { params: { test: 'hello' } l: 'it' });\n */\n t(...args: any[]) {\n return this.em.t(...args);\n }\n\n /**\n * Attach event\n * @param {string} event Event name\n * @param {Function} callback Callback function\n * @return {this}\n */\n on(event: EditorEvent, callback: EventHandler) {\n this.em.on(event, callback);\n return this;\n }\n\n /**\n * Attach event and detach it after the first run\n * @param {string} event Event name\n * @param {Function} callback Callback function\n * @return {this}\n */\n once(event: EditorEvent, callback: EventHandler) {\n this.em.once(event, callback);\n return this;\n }\n\n /**\n * Detach event\n * @param {string} event Event name\n * @param {Function} callback Callback function\n * @return {this}\n */\n off(event: EditorEvent, callback: EventHandler) {\n this.em.off(event, callback);\n return this;\n }\n\n /**\n * Trigger event\n * @param {string} event Event to trigger\n * @return {this}\n */\n trigger(event: EditorEvent, ...args: any[]) {\n this.em.trigger.apply(this.em, [event, ...args]);\n return this;\n }\n\n /**\n * Destroy the editor\n */\n destroy() {\n if (!this.em) return;\n this.em.destroyAll();\n this.editorView = undefined;\n }\n\n /**\n * Returns editor element\n * @return {HTMLElement}\n * @private\n */\n getEl() {\n return this.editorView?.el;\n }\n\n /**\n * Returns editor model\n * @return {Model}\n * @private\n */\n getModel() {\n return this.em;\n }\n\n /**\n * Render editor\n * @return {HTMLElement}\n */\n render() {\n this.editorView?.remove();\n this.editorView = new EditorView(this.em);\n return this.editorView.render().el;\n }\n\n /**\n * Trigger a callback once the editor is loaded and rendered.\n * The callback will be executed immediately if the method is called on the already rendered editor.\n * @param {Function} clb Callback to trigger\n * @example\n * editor.onReady(() => {\n * // perform actions\n * });\n */\n onReady(clb: EventHandler) {\n this.em.get('ready') ? clb(this) : this.em.on('load', clb);\n }\n\n /**\n * Print safe HTML by using ES6 tagged template strings.\n * @param {Array} literals\n * @param {Array} substs\n * @returns {String}\n * @example\n * const unsafeStr = '';\n * const safeStr = 'Hello';\n * // Use `$${var}` to avoid escaping\n * const strHtml = editor.html`Escaped ${unsafeStr} unescaped $${safeStr}`;\n */\n html = html;\n}\n","import { isString } from 'underscore';\nimport Editor from '../editor';\nimport { getGlobal } from '../utils/mixins';\n\ntype PluginOptions = Record;\n\nexport type Plugin = (editor: Editor, config: T) => void;\n\nconst getPluginById = (pluginId: string, plugins: PluginManager) => {\n let result = plugins.get(pluginId);\n\n // Try to search in global context\n if (!result) {\n const wplg = (getGlobal() as any)[pluginId];\n result = wplg?.default || wplg;\n }\n\n return result;\n};\n\nexport const getPlugin = (plugin: string | Plugin, plugins: PluginManager) => {\n return isString(plugin)\n ? getPluginById(plugin, plugins)\n : (plugin as unknown as { default: Plugin })?.default || plugin;\n};\n\nexport const logPluginWarn = (editor: Editor, plugin: string) => {\n editor.getModel().logWarning(`Plugin ${plugin} not found`, {\n context: 'plugins',\n plugin,\n });\n};\n\nexport default class PluginManager {\n plugins: Record = {};\n\n /**\n * Add new plugin. Plugins could not be overwritten\n * @param {string} id Plugin ID\n * @param {Function} plugin Function which contains all plugin logic\n * @return {Function} The plugin function\n * @deprecated Don't use named plugins, create plugins as simple functions. More about [Plugins](https://grapesjs.com/docs/modules/Plugins.html)\n * @example\n * PluginManager.add('some-plugin', function(editor) {\n * editor.Commands.add('new-command', {\n * run: function(editor, senderBtn){\n * console.log('Executed new-command');\n * }\n * })\n * });\n */\n add(id: string, plugin: Plugin) {\n const plg = this.get(id);\n\n if (plg) {\n return plg;\n }\n\n // @ts-ignore\n this.plugins[id] = plugin;\n\n return plugin;\n }\n\n /**\n * Returns plugin by ID\n * @param {string} id Plugin ID\n * @return {Function|undefined} Plugin\n * @example\n * var plugin = PluginManager.get('some-plugin');\n * plugin(editor);\n */\n get(id: string): Plugin | undefined {\n return this.plugins[id];\n }\n\n /**\n * Returns object with all plugins\n */\n getAll() {\n return this.plugins;\n }\n}\n","/**\n * File made for IE/Edge support\n * https://github.com/GrapesJS/grapesjs/issues/214\n */\nimport { hasWin } from './mixins';\n\nexport default () => {\n /**\n * Check if IE/Edge\n * @return {Boolean}\n */\n const isIE = () => {\n let match;\n const agent = window.navigator.userAgent;\n const rules: [string, RegExp][] = [\n ['edge', /Edge\\/([0-9\\._]+)/],\n ['ie', /MSIE\\s(7\\.0)/],\n ['ie', /MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/],\n ['ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+).*\\).*Gecko$/],\n ];\n\n for (let i = 0; i < rules.length; i++) {\n const rule = rules[i];\n match = rule[1].exec(agent);\n if (match) break;\n }\n\n return !!match;\n };\n\n if (hasWin() && isIE()) {\n const originalCreateHTMLDocument = DOMImplementation.prototype.createHTMLDocument;\n DOMImplementation.prototype.createHTMLDocument = title => {\n if (!title) title = '';\n return originalCreateHTMLDocument.apply(document.implementation, [title]);\n };\n }\n};\n","import { isElement } from 'underscore';\nimport Editor from './editor';\nimport { EditorConfig } from './editor/config/config';\nimport PluginManager, { Plugin, getPlugin, logPluginWarn } from './plugin_manager';\nimport $ from './utils/cash-dom';\nimport polyfills from './utils/polyfills';\n\ninterface InitEditorConfig extends EditorConfig {\n grapesjs?: typeof grapesjs;\n}\n\npolyfills();\n\nconst plugins = new PluginManager();\nconst editors: Editor[] = [];\n\nexport const usePlugin =

| string>(plugin: P, opts?: P extends Plugin ? C : {}) => {\n let pluginResult = getPlugin(plugin, plugins);\n\n return (editor: Editor) => {\n if (pluginResult) {\n pluginResult(editor, opts || {});\n } else {\n logPluginWarn(editor, plugin as string);\n }\n };\n};\n\nexport const grapesjs = {\n $,\n\n editors,\n\n plugins,\n\n usePlugin,\n\n // @ts-ignore Will be replaced on build\n version: __GJS_VERSION__,\n\n /**\n * Initialize the editor with passed options\n * @param {Object} config Configuration object\n * @param {string|HTMLElement} config.container Selector which indicates where render the editor\n * @param {Boolean} [config.autorender=true] If true, auto-render the content\n * @param {Array} [config.plugins=[]] Array of plugins to execute on start\n * @param {Object} [config.pluginsOpts={}] Custom options for plugins\n * @param {Boolean} [config.headless=false] Init headless editor\n * @return {Editor} Editor instance\n * @example\n * var editor = grapesjs.init({\n * container: '#myeditor',\n * components: '

Hello world
',\n * style: '.hello{color: red}',\n * })\n */\n init(config: EditorConfig = {}) {\n const { headless } = config;\n const els = config.container;\n if (!els && !headless) throw new Error(\"'container' is required\");\n const initConfig: InitEditorConfig = {\n autorender: true,\n plugins: [],\n pluginsOpts: {},\n ...config,\n grapesjs: this,\n el: headless ? undefined : isElement(els) ? els : (document.querySelector(els!) as HTMLElement),\n };\n const editor = new Editor(initConfig, { $ });\n const em = editor.getModel();\n\n // Load plugins\n initConfig.plugins!.forEach(pluginId => {\n const plugin = getPlugin(pluginId, plugins);\n const plgOptions = initConfig.pluginsOpts![pluginId as string] || {};\n\n if (plugin) {\n plugin(editor, plgOptions);\n } else {\n logPluginWarn(editor, pluginId as string);\n }\n });\n\n // Execute `onLoad` on modules once all plugins are initialized.\n // A plugin might have extended/added some custom type so this\n // is a good point to load stuff like components, css rules, etc.\n em.loadOnStart();\n initConfig.autorender && !headless && editor.render();\n editors.push(editor);\n\n return editor;\n },\n};\n\n/**\n * @deprecated Changed to CategoryProperties\n */\nexport type { CategoryProperties as BlockCategoryProperties } from './abstract/ModuleCategory';\n\n// Exports for TS\nexport type { default as Asset } from './asset_manager/model/Asset';\nexport type { default as Assets } from './asset_manager/model/Assets';\nexport type { default as Block } from './block_manager/model/Block';\nexport type { default as Blocks } from './block_manager/model/Blocks';\nexport type { default as Categories } from './abstract/ModuleCategories';\nexport type { default as Category } from './abstract/ModuleCategory';\nexport type { default as Canvas } from './canvas/model/Canvas';\nexport type { default as CanvasSpot } from './canvas/model/CanvasSpot';\nexport type { default as CanvasSpots } from './canvas/model/CanvasSpots';\nexport type { default as Frame } from './canvas/model/Frame';\nexport type { default as Frames } from './canvas/model/Frames';\nexport type { default as CssRule } from './css_composer/model/CssRule';\nexport type { default as CssRules } from './css_composer/model/CssRules';\nexport type { default as Device } from './device_manager/model/Device';\nexport type { default as Devices } from './device_manager/model/Devices';\nexport type { default as ComponentManager } from './dom_components';\nexport type { default as Component } from './dom_components/model/Component';\nexport type { default as Components } from './dom_components/model/Components';\nexport type { default as ComponentView } from './dom_components/view/ComponentView';\nexport type { default as Editor } from './editor';\nexport type { default as Modal } from './modal_dialog/model/Modal';\nexport type { default as Page } from './pages/model/Page';\nexport type { default as Pages } from './pages/model/Pages';\nexport type { default as Button } from './panels/model/Button';\nexport type { default as Buttons } from './panels/model/Buttons';\nexport type { default as Panel } from './panels/model/Panel';\nexport type { default as Panels } from './panels/model/Panels';\nexport type { default as Selector } from './selector_manager/model/Selector';\nexport type { default as Selectors } from './selector_manager/model/Selectors';\nexport type { default as State } from './selector_manager/model/State';\nexport type { default as Properties } from './style_manager/model/Properties';\nexport type { default as Property } from './style_manager/model/Property';\nexport type { default as PropertyRadio } from './style_manager/model/PropertyRadio';\nexport type { default as PropertySelect } from './style_manager/model/PropertySelect';\nexport type { default as PropertyNumber } from './style_manager/model/PropertyNumber';\nexport type { default as PropertySlider } from './style_manager/model/PropertySlider';\nexport type { default as PropertyComposite } from './style_manager/model/PropertyComposite';\nexport type { default as PropertyStack } from './style_manager/model/PropertyStack';\nexport type { default as Sector } from './style_manager/model/Sector';\nexport type { default as Sectors } from './style_manager/model/Sectors';\nexport type { default as Trait } from './trait_manager/model/Trait';\nexport type { default as Traits } from './trait_manager/model/Traits';\n\nexport default grapesjs;\n"],"names":["root","factory","exports","module","define","amd","globalThis","window","this","_","Backbone","core_slice","Array","prototype","slice","apply","fn","ctx","args","length","call","arr","index","hasKeys","obj","keys","isArray","arguments","all","key","getMagicFusionIndex","callstackWasIndexed","magicFusionIndex","indexCycle","defer","ObjectRegistry","registeredObjects","cidIndexes","onoff","which","objects","i","l","objectRegistry","register","unregister","isFunction","actionUndoRedo","action","type","undoTypes","object","before","after","options","managerUndoRedo","manager","stack","magic","everything","isCurrentlyUndoRedoing","pointer","actions","isUndo","clone","models","at","where","get","pop","shift","trigger","validateUndoActionCreation","undoTypesType","condition","addToStack","track","res","diff","add","maximumStackLength","isRegistered","cid","contains","push","splice","indexOf","map","concat","UndoTypes","collection","ignore","model","remove","undefined","isEmpty","each","unset","set","unsetData","afterAttributes","changedAttributes","keysAfter","previousAttributes","pick","keysPrevious","val","reset","previousModels","OwnedUndoTypes","manipulateUndoType","manipType","undoType","fns","undoTypesInstance","isObject","extend","Action","Model","defaults","undo","attributes","redo","UndoStack","Collection","Infinity","setMaxLength","UndoManager","initialize","attr","on","value","startTracking","isArguments","stopTracking","isTracking","_addToStack","unregisterAll","undoAll","redoAll","isAvailable","s","merge","undoManager","addUndoType","changeUndoType","removeUndoType","clear","defaultAttributes","self","g","global","$","previousBackbone","VERSION","noConflict","emulateHTTP","emulateJSON","_listening","Events","eventSplitter","eventsApi","iteratee","events","name","callback","opts","names","context","test","split","_events","onApi","listening","_listeners","id","interop","listenTo","_listenId","uniqueId","listeningTo","_listeningTo","Listening","error","tryCatchOn","handlers","count","e","off","offApi","listeners","stopListening","ids","remaining","j","handler","_callback","cleanup","once","onceMap","bind","listenToOnce","offer","Math","max","triggerApi","objEvents","allEvents","triggerEvents","ev","a1","a2","a3","listener","unbind","attrs","preinitialize","cidPrefix","parse","result","changed","validationError","idAttribute","toJSON","sync","escape","has","matches","_validate","silent","changes","changing","_changing","_previousAttributes","current","prev","isEqual","prevId","_pending","hasChanged","old","previous","fetch","success","resp","serverAttrs","wrapError","save","wait","validate","method","isNew","patch","xhr","destroy","url","base","urlError","replace","encodeURIComponent","constructor","isValid","comparator","_reset","setOptions","addOptions","array","insert","min","tail","singular","removed","_removeModels","added","merged","_isModel","toAdd","toMerge","toRemove","modelMap","sort","sortable","sortAttr","isString","existing","_prepareModel","_addReference","orderChanged","some","m","_removeReference","unshift","_byId","modelId","first","findWhere","Error","sortBy","pluck","create","callbackOpts","values","CollectionIterator","ITERATOR_VALUES","ITERATOR_KEYS","entries","ITERATOR_KEYSVALUES","_onModelEvent","event","$$iterator","Symbol","iterator","kind","_collection","_kind","_index","next","done","View","viewOptions","_ensureElement","delegateEventSplitter","tagName","selector","$el","find","render","_removeElement","setElement","element","undelegateEvents","_setElement","delegateEvents","el","match","delegate","eventName","undelegate","_createElement","document","createElement","className","_setAttributes","addMethod","attribute","cb","defaultVal","addUnderscoreMethods","Class","methods","instance","modelMatcher","matcher","collectionMethods","forEach","collect","reduce","foldl","inject","reduceRight","foldr","detect","filter","select","reject","every","any","include","includes","invoke","toArray","size","head","take","initial","rest","drop","last","without","difference","shuffle","lastIndexOf","chain","sample","partition","groupBy","countBy","indexBy","findIndex","findLastIndex","modelMethods","pairs","invert","omit","config","Base","mixin","mappings","functions","memo","methodMap","params","dataType","data","contentType","JSON","stringify","_method","beforeSend","setRequestHeader","processData","textStatus","errorThrown","ajax","Router","routes","_bindRoutes","optionalParam","namedParam","splatParam","escapeRegExp","route","isRegExp","_routeToRegExp","router","history","fragment","_extractParameters","execute","navigate","optional","RegExp","exec","param","decodeURIComponent","History","checkUrl","location","routeStripper","rootStripper","pathStripper","started","interval","atRoot","pathname","getSearch","matchRoot","decodeFragment","decodeURI","href","getHash","getPath","path","charAt","getFragment","_usePushState","_wantsHashChange","start","hashChange","_hasHashChange","documentMode","_useHashChange","_wantsPushState","pushState","_hasPushState","rootPath","iframe","src","style","display","tabIndex","body","iWindow","insertBefore","firstChild","contentWindow","open","close","hash","addEventListener","attachEvent","_checkUrlInterval","setInterval","loadUrl","stop","removeEventListener","detachEvent","removeChild","clearInterval","decodedFragment","title","assign","_updateHash","protoProps","staticProps","child","parent","__super__","CodeMirror","extendMode","commentStart","commentEnd","newlineAfterToken","_type","content","textAfter","state","jsonMode","lexical","inlineElements","inline","configuration","defineExtension","isComment","from","to","cm","curMode","innerMode","getMode","getTokenAt","mode","operation","replaceRange","line","ch","setCursor","selText","getRange","startIndex","endIndex","substr","substring","cmInstance","indentLine","outer","text","copyState","tabSize","getOption","out","lines","atSol","newline","stream","StringStream","eol","inner","token","cur","pos","string","blankLine","end","setSelection","getCursor","mod","userAgent","navigator","platform","gecko","ie_upto10","ie_11up","edge","ie","ie_version","webkit","qtwebkit","chrome","chrome_version","presto","safari","vendor","mac_geMountainLion","phantom","ios","maxTouchPoints","android","mobile","mac","chromeOS","windows","presto_version","Number","flipCtrlCmd","captureRightClick","classTest","cls","range","rmClass","node","removeChildren","childNodes","removeChildrenAndAdd","appendChild","elt","tag","cssText","createTextNode","eltP","setAttribute","nodeType","parentNode","host","activeElt","doc","activeElement","shadowRoot","addClass","joinClasses","a","b","as","createRange","endNode","r","setEnd","setStart","createTextRange","moveToElementText","collapse","moveEnd","moveStart","selectInput","wrapper","ownerDocument","win","defaultView","f","copyObj","target","overwrite","prop","hasOwnProperty","countColumn","startValue","search","n","nextTab","selectionStart","selectionEnd","_e","Delayed","time","onTimeout","Date","setTimeout","ms","clearTimeout","scrollerGap","Pass","toString","sel_dontScroll","scroll","sel_mouse","origin","sel_move","findColumn","goal","col","skipped","spaceStrs","spaceStr","lst","insertSorted","score","priority","nothing","createObj","props","inst","Object","nonASCIISingleCaseWordChar","isWordCharBasic","toUpperCase","toLowerCase","isWordChar","helper","source","extendingChars","isExtendingChar","charCodeAt","skipExtendingChars","str","dir","findFirst","pred","midF","mid","ceil","floor","iterateBidiSections","order","found","part","level","bidiOther","getBidiPartAt","sticky","bidiOrdering","lowTypes","arabicTypes","charType","code","bidiRE","isNeutral","isStrong","countsAsLeft","countsAsNum","BidiSpan","direction","outerType","len","types","i$1","i$2","type$1","i$3","prev$1","type$2","i$4","type$3","i$5","cur$1","type$4","i$6","end$1","replace$1","j$1","i$7","isRTL","j$2","nstart","reverse","getOrder","noHandlers","emitter","_handlers","getHandlers","signal","signalDOMEvent","override","preventDefault","defaultPrevented","e_defaultPrevented","codemirrorIgnore","signalCursorActivity","cursorActivity","curOp","cursorActivityHandlers","hasHandler","eventMixin","ctor","e_preventDefault","returnValue","e_stopPropagation","stopPropagation","cancelBubble","e_stop","e_target","srcElement","e_button","button","ctrlKey","zwspSupported","badBidiRects","dragAndDrop","div","zeroWidthElement","measure","offsetHeight","offsetWidth","hasBadBidiRects","txt","r0","getBoundingClientRect","r1","left","right","splitLinesAuto","nl","rt","hasSelection","getSelection","te","selection","parentElement","compareEndPoints","hasCopyEvent","oncopy","badZoomedRects","hasBadZoomedRects","normal","fromRange","abs","modes","mimeModes","defineMode","dependencies","defineMIME","mime","spec","resolveMode","mfactory","modeObj","modeExtensions","exts","helperType","modeProps","prop$1","properties","nstate","info","startState","lineOracle","lastColumnPos","lastColumnValue","lineStart","getLine","chunk","children","sz","chunkSize","getBetween","iter","getLines","updateLineHeight","height","lineNo","no","lineAtHeight","h","lh","isLine","lineNumberFor","String","lineNumberFormatter","firstLineNumber","Pos","cmp","equalCursorPos","copyPos","x","maxPos","minPos","clipLine","clipPos","clipToLen","linelen","clipPosArray","sol","peek","eat","eatWhile","eatSpace","skipToEnd","skipTo","backUp","column","indentation","pattern","consume","caseInsensitive","cased","hideFirstChars","lookAhead","oracle","baseToken","SavedContext","Context","maxLookAhead","baseTokens","baseTokenPos","highlightLine","forceToEnd","st","modeGen","lineClasses","runMode","loop","o","overlay","overlays","i_end","opaque","styles","classes","bgClass","textClass","getLineStyles","updateFrontier","getContextBefore","resetState","maxHighlightLength","stateAfter","styleClasses","highlightFrontier","modeFrontier","precise","findStartLine","saved","fromSaved","processLine","viewFrom","viewTo","nextLine","startAt","callBlankLine","readToken","copy","Token","takeToken","asArray","tokens","extractLineClasses","output","lineClass","flattenSpans","curStart","curStyle","addModeClass","mName","minindent","minline","lim","indented","retreatFrontier","sawReadOnlySpans","sawCollapsedSpans","seeReadOnlySpans","seeCollapsedSpans","MarkedSpan","marker","getMarkedSpanFor","spans","span","removeMarkedSpan","addMarkedSpan","op","inThisOp","WeakSet","markedSpans","attachLine","markedSpansBefore","startCh","isInsert","nw","inclusiveLeft","insertLeft","endsAfter","inclusiveRight","markedSpansAfter","endCh","startsBefore","stretchSpansOverChange","change","full","oldFirst","oldLast","sameLine","offset","span$1","clearEmptySpans","newMarkers","gapMarkers","gap","clearWhenEmpty","removeReadOnlyRanges","markers","mark","readOnly","parts","mk","p","newParts","dfrom","dto","detachMarkedSpans","detachLine","attachMarkedSpans","extraLeft","extraRight","compareCollapsedMarkers","lenDiff","aPos","bPos","fromCmp","toCmp","collapsedSpanAtSide","sps","sp","collapsed","collapsedSpanAtStart","collapsedSpanAtEnd","collapsedSpanAround","conflictingCollapsedRange","visualLine","visualLineEnd","visualLineContinued","visualLineNo","lineN","vis","visualLineEndNo","lastLine","lineIsHidden","widgetNode","lineIsHiddenInner","heightAtLine","lineObj","lineLength","found$1","findMaxLine","d","maxLine","maxLineLength","maxLineChanged","Line","estimateHeight","updateLine","estHeight","cleanUpLine","styleToClassCache","styleToClassCacheWithMode","interpretTokenStyle","cache","buildLineContent","lineView","builder","pre","trailingSpace","splitSpaces","addToken","buildToken","buildTokenBadBidi","insertLineContent","externalMeasured","maps","caches","lastChild","querySelector","defaultSpecialCharPlaceholder","startStyle","endStyle","css","displayText","special","specialChars","mustWrap","createDocumentFragment","lastIndex","txt$1","tabWidth","specialCharPlaceholder","fullStyle","trailingBefore","spaceBefore","buildCollapsedSpan","ignoreWidget","widget","input","needsContentAttribute","setUneditable","allText","spanStyle","spanEndStyle","spanStartStyle","nextChange","foundBookmarks","endStyles","upto","tokenText","LineView","hidden","buildViewArray","nextPos","view","operationGroup","pushOperation","ops","ownsGroup","delayedCallbacks","fireCallbacksForOps","group","callbacks","cursorActivityCalled","finishOperation","endCb","orphanDelayedCallbacks","signalLater","list","fireOrphanDelayed","delayed","updateLineForChanges","dims","updateLineText","updateLineGutter","updateLineClasses","updateLineWidgets","ensureLineWrapped","replaceChild","zIndex","updateLineBackground","background","wrap","getLineContent","ext","built","wrapClass","gutter","gutterBackground","gutterClass","fixedGutter","fixedPos","gutterTotalWidth","gutterMarkers","lineNumbers","wrap$1","gutterWrap","lineNumber","gutterLeft","k","gutterSpecs","gutterWidth","alignable","isWidget","nextSibling","insertLineWidgets","buildLineElement","insertLineWidgetsFor","allowAbove","widgets","ws","handleMouseEvents","positionLineWidget","above","noHScroll","width","wrapperWidth","coverGutter","paddingLeft","position","marginLeft","widgetHeight","parentStyle","gutters","clientWidth","eventInWidget","getAttribute","sizer","mover","paddingTop","lineSpace","offsetTop","paddingVert","paddingH","cachedPaddingH","getComputedStyle","currentStyle","parseInt","paddingRight","isNaN","scrollGap","nativeBarWidth","displayWidth","scroller","barWidth","displayHeight","clientHeight","barHeight","ensureLineHeights","rect","wrapping","lineWrapping","curWidth","heights","rects","getClientRects","bottom","top","mapFromLineView","updateExternalMeasurement","lineMeasure","measureChar","bias","measureCharPrepared","prepareMeasureForLine","findViewForLine","findViewIndex","getDimensions","forceUpdate","hasHeights","prepared","varHeight","measureCharInner","bogus","rtop","rbottom","measureText","nullRect","nodeAndOffsetInLineMap","mStart","mEnd","coverStart","coverEnd","getUsefulRect","place","maybeUpdateRectForZooming","rSpan","charWidth","rbot","bot","singleCursorHeightPerLine","screen","logicalXDPI","deviceXDPI","scaleX","scaleY","logicalYDPI","deviceYDPI","clearLineMeasurementCacheFor","clearLineMeasurementCache","externalMeasure","clearCaches","cachedCharWidth","cachedTextHeight","lineNumChars","pageScrollX","pageXOffset","documentElement","scrollLeft","pageScrollY","marginTop","pageYOffset","scrollTop","widgetTopHeight","intoCoordSystem","includeWidgets","yOff","viewOffset","lOff","xOff","fromCoordSystem","coords","localBox","lineSpaceBox","charCoords","cursorCoords","preparedMeasure","getBidi","partPos","other","estimateCoords","PosWithInfo","outside","xRel","coordsChar","y","coordsCharInner","rangeEnd","wrappedLineExtent","begin","wrappedLineExtentChar","boxIsAfter","box","ltr","coordsBidiPartWrapped","coordsBidiPart","baseX","chAround","boxAround","atLeft","atStart","_lineNo","ref","closestDist","endX","dist","textHeight","anchor","clientLeft","offsetLeft","compensateForHScroll","th","perLine","widgetsHeight","estimateLineHeights","est","posFromMouse","liberal","forRect","space","clientX","clientY","e$1","colDiff","round","regChange","lendiff","updateLineNumbers","viewChanged","resetView","cut","viewCuttingPoint","cut$1","cutTop","cutBot","regLineChange","oldN","newN","adjustView","countDirtyView","dirty","updateSelection","showSelection","prepareSelection","primary","curFragment","cursors","selFragment","customCursor","$customCursor","sel","ranges","primIndex","empty","drawSelectionCursor","showCursorWhenSelecting","drawSelectionRange","cursor","cursorHeight","getWrapperElement","charPos","defaultCharWidth","otherCursor","cmpCoords","padding","leftSide","rightSide","sizerWidth","docLTR","drawForLine","fromArg","toArg","lineLen","wrapX","side","extent","fromPos","toPos","openStart","openEnd","openRight","topLeft","topRight","botLeft","botRight","sFrom","sTo","fromLine","toLine","singleVLine","leftEnd","rightStart","restartBlink","focused","blinker","cursorDiv","visibility","cursorBlinkRate","hasFocus","onBlur","ensureFocus","focus","onFocus","delayBlurEvent","delayingBlurEvent","draggingText","selForContextMenu","receivedFocus","updateHeightsInViewport","prevBottom","lineDiv","viewTop","oldHeight","mustScroll","updateWidgetHeight","chWidth","w","visibleLines","viewport","ensure","ensureFrom","ensureTo","maybeScrollWindow","doScroll","innerHeight","scrollNode","scrollIntoView","scrollPosIntoView","margin","limit","endCoords","scrollPos","calculateScrollPos","startTop","startLeft","updateScrollTop","setScrollLeft","snapMargin","screentop","docBottom","atTop","atBottom","newTop","gutterSpace","screenleft","screenw","tooWide","addToScrollTop","resolveScrollToPos","ensureCursorVisible","scrollToPos","cursorScrollMargin","scrollToCoords","scrollToRange","scrollToCoordsRange","sPos","updateDisplaySimple","setScrollTop","startWorker","forceScroll","scrollHeight","scrollbars","isScroller","scrollWidth","alignHorizontally","measureForScrollbars","gutterW","docH","viewHeight","viewWidth","barLeft","docHeight","NativeScrollbars","vert","horiz","checkedZeroWidth","minHeight","minWidth","update","needsH","needsV","sWidth","totalHeight","totalWidth","zeroWidthHack","disableHoriz","enableZeroWidthBar","disableVert","bar","delay","maybeDisable","elementFromPoint","NullScrollbars","updateScrollbars","startWidth","startHeight","updateScrollbarsInner","sizes","paddingBottom","heightForcer","borderBottom","scrollbarFiller","coverGutterNextToScrollbar","gutterFiller","scrollbarModel","initScrollbars","scrollbarStyle","axis","nextOpId","startOperation","updateInput","typing","changeObjs","selectionChanged","updateMaxLine","markArrays","endOperation","endOperations","endOperation_R1","endOperation_W1","endOperation_R2","endOperation_W2","endOperation_finish","maybeClipScrollbars","mustUpdate","DisplayUpdate","updatedDisplay","updateDisplayIfNeeded","barMeasure","adjustWidthTo","maxScrollLeft","preparedSelection","takeFocus","setDocumentHeight","postUpdateDisplay","wheelStartX","wheelStartY","maybeHiddenMarkers","unhidden","maybeUnhiddenMarkers","finish","runInOp","methodOp","docMethodOp","highlight","highlightWorker","workTime","changedLines","oldStyles","highlighted","oldCls","newCls","ischange","workDelay","force","visible","editorIsHidden","wrapperHeight","oldDisplayWidth","scrollbarsClipped","marginBottom","borderRightWidth","selectionSnapshot","active","anchorNode","anchorOffset","focusNode","focusOffset","restoreSelection","snapshot","nodeName","removeAllRanges","addRange","renderedView","maybeUpdateLineNumberWidth","viewportMargin","different","lastWrapHeight","lastWrapWidth","toUpdate","selSnapshot","patchDisplay","selectionDiv","reportedViewFrom","reportedViewTo","updateNumbersFrom","container","rm","currentWheelTarget","updateNumber","updateGutterSpace","alignWidgets","comp","align","innerW","lineGutter","lineNumInnerWidth","lineNumWidth","getGutters","sawLineNumbers","renderGutters","specs","gElt","updateGutters","Display","clipPath","draggable","wheelDX","wheelDY","activeTouch","init","wheelSamples","wheelPixelsPerUnit","wheelEventDelta","dx","wheelDeltaX","dy","wheelDeltaY","detail","HORIZONTAL_AXIS","VERTICAL_AXIS","wheelDelta","wheelEventPixels","delta","onScrollWheel","chromeScrollHack","pointerEvents","pixelsPerUnit","deltaMode","deltaX","deltaY","canScrollX","canScrollY","pixels","movedX","movedY","Selection","equals","here","there","deepCopy","Range","somethingSelected","normalizeSelection","mayTouch","selectionsMayTouch","prim","inv","simpleSelection","changeEnd","adjustForChange","computeSelAfterChange","offsetPos","computeReplacedSel","hint","oldPrev","newPrev","loadMode","modeOption","resetModeState","isWholeLineUpdate","wholeLineUpdateBefore","updateDoc","spansFor","linesFor","firstLine","lastText","lastSpans","nlines","added$1","added$2","linkedDocs","sharedHistOnly","propagate","skip","sharedHist","linked","rel","shared","attachDoc","setDirectionClass","directionChanged","undone","undoDepth","lastModTime","lastSelTime","lastOp","lastSelOp","lastOrigin","lastSelOrigin","generation","maxGeneration","historyChangeFromChange","histChange","attachLocalSpans","clearSelectionEvents","lastChangeEvent","hist","addChangeToHistory","selAfter","opId","historyEventDelay","pushSelectionToHistory","selectionEventCanBeMerged","addSelectionToHistory","clearRedo","dest","removeClearedSpans","explicitlyCleared","getOldSpans","mergeOldSpans","stretched","oldCur","stretchCur","copyHistoryArray","newGroup","instantiateSel","newChanges","extendRange","posBefore","extendSelection","extendSelections","heads","replaceOneSelection","setSimpleSelection","filterSelectionChange","setSelectionReplaceHistory","setSelectionNoUndo","NaN","setSelectionInner","skipAtomicInSelection","reCheckSelection","mayClear","newAnchor","skipAtomic","newHead","skipAtomicInner","oldPos","preventCursorLeft","selectLeft","preventCursorRight","selectRight","atomic","near","movePos","far","cantEdit","selectAll","filterChange","canceled","cancel","makeChange","ignoreReadOnly","suppressEdits","makeChangeInner","makeChangeSingleDoc","rebased","rebaseHist","makeChangeFromHistory","allowSelectionOnly","suppress","antiChanges","returned","v","shiftDoc","distance","makeChangeSingleDocInEditor","recomputeMaxLength","checkWidthStart","changesHandler","changeHandler","splitLines","rebaseHistSelSingle","rebaseHistArray","sub","ok","copied","changeLine","handle","changeType","LeafChunk","BranchChunk","removeInner","insertInner","iterN","leaf","maybeSpill","me","sibling","myIndex","used","LineWidget","opt","adjustScrollWhenAboveVisible","addLineWidget","insertAt","aboveVisible","this$1","oldH","nextMarkerId","TextMarker","markText","markTextShared","replacedWith","addToHistory","curLine","clearOnEnter","clearHistory","withOp","visual","dHeight","SharedTextMarker","cloneNode","isParent","findSharedMarkers","findMarks","copySharedMarkers","mFrom","mTo","subMark","detachSharedMarkers","subMarker","nextDocId","Doc","lineSep","cleanGeneration","getValue","join","lineSeparator","setValue","getLineHandle","getLineNumber","getLineHandleVisualStart","lineCount","listSelections","extendSelectionsBy","setSelections","addSelection","getSelections","replaceSelection","dup","replaceSelections","newSel","undoSelection","redoSelection","setExtending","getExtending","historySize","markClean","changeGeneration","forceSplit","isClean","gen","getHistory","setHistory","histData","setGutterMarker","gutterID","clearGutter","lineInfo","addLineClass","removeLineClass","removeLineWidget","setBookmark","realOpts","findMarksAt","getAllMarks","posFromIndex","sepSize","indexFromPos","copyHistory","linkedDoc","unlinkDoc","splitIds","iterLinkedDocs","getEditor","setDirection","eachLine","lastDrop","onDrop","clearDragCursor","files","dataTransfer","isReadOnly","FileReader","File","read","markAsReadAndPasteIfAllFilesAreRead","t","readTextFromFile","file","allowDropFileTypes","reader","onerror","onload","readAsText","text$1","getData","selected","onDragStart","setData","effectAllowed","setDragImage","img","_top","onDragOver","frag","dragCursor","forEachCodeMirror","getElementsByClassName","byClass","editors","globalsRegistered","ensureGlobalHandlers","registerGlobalHandlers","resizeTimer","onResize","setSize","keyNames","fromCharCode","keyMap","normalizeKeyName","alt","ctrl","cmd","normalizeKeyMap","keymap","keyname","lookupKey","getKeyMap","fallthrough","isModifierKey","keyCode","addModifierNames","noShift","altKey","metaKey","shiftKey","keyName","altGraphKey","deleteNearSelection","compute","kill","toKill","replaced","moveCharLogically","moveLogically","endOfLine","visually","prep","targetTop","moveVisually","bidi","mv","getWrappedLineExtent","moveInStorageOrder","searchInVisualLine","getRes","nextCh","basic","pcDefault","emacsy","macDefault","commands","singleSelection","killLine","deleteLine","delLineLeft","delWrappedLineLeft","delWrappedLineRight","rightPos","goDocStart","goDocEnd","goLineStart","goLineStartSmart","lineStartSmart","goLineEnd","lineEnd","goLineRight","goLineLeft","goLineLeftSmart","goLineUp","moveV","goLineDown","goPageUp","goPageDown","goCharLeft","moveH","goCharRight","goColumnLeft","goColumnRight","goWordLeft","goGroupRight","goGroupLeft","goWordRight","delCharBefore","deleteH","delCharAfter","delWordBefore","delWordAfter","delGroupBefore","delGroupAfter","indentAuto","indentSelection","indentMore","indentLess","insertTab","insertSoftTab","spaces","defaultTab","execCommand","transposeChars","newlineAndIndent","sels","openLine","toggleOverwrite","firstNonWS","inWS","doHandleBinding","bound","dropShift","ensurePolled","prevShift","lookupKeyForEditor","keyMaps","extraKeys","stopSeq","dispatchKey","seq","keySeq","dispatchKeyInner","handleKeyBinding","motion","handleCharBinding","lastStoppedKey","onKeyDown","getField","handled","showCrossHair","up","onKeyUp","onKeyPress","charCode","lastClick","lastDoubleClick","DOUBLECLICK_DELAY","PastClick","clickRepeat","now","compare","onMouseDown","supportsTouch","clickInGutter","repeat","selectingText","handleMappedButton","leftButtonDown","onContextMenu","configureMouse","option","unit","addNew","moveOnDrag","contained","behavior","dragDrop","leftButtonStartDrag","leftButtonSelect","moved","dragEnd","mouseMove","dragStart","preventScroll","e2","rangeForUnit","findWordAt","doc$1","ourRange","ourIndex","startSel","lastPos","extendTo","startCol","posCol","leftPos","oldRange","ranges$1","bidiSimplify","editorSize","counter","curCount","move","buttons","anchorLine","boundary","headIndex","usePart","gutterEvent","prevent","mX","mY","touches","lineBox","contextMenuInGutter","themeChanged","theme","Init","optionHandlers","defineOptions","deflt","notOnInit","defineOption","newBreaks","refresh","getInputField","spellcheck","autocorrect","autocapitalize","detach","attach","wrappingChanged","integer","blur","readOnlyChanged","screenReaderLabelChanged","dragDropChanged","resetPosition","funcs","dragFunctions","toggle","enter","over","leave","inputStyles","inputStyle","pasteIncoming","cutIncoming","autofocus","registerEventHandlers","finishInit","initHooks","textRendering","word","touchFinished","prevTouch","finishTouch","isMouseLikeTouchEvent","touch","radiusX","radiusY","farAway","pageX","pageY","inp","how","aggressive","indent","curSpace","curSpaceString","indentUnit","indentString","indentWithTabs","pos$1","defineInitHook","lastCopied","setLastCopied","newLastCopied","applyTextInput","inserted","deleted","recent","paste","textLines","multiPaste","pasteLinesPerSelection","lineWise","changeEvent","triggerElectric","handlePaste","pasted","clipboardData","disableInput","electricChars","smartIndent","getModeAt","electricInput","copyableRanges","lineRange","disableBrowserMagic","field","hiddenTextarea","border","addEditorMethods","helpers","setOption","getDoc","addKeyMap","removeKeyMap","addOverlay","modeSpec","removeOverlay","newRanges","getLineTokens","getTokenTypeAt","getHelper","getHelpers","help","_global","getStateAfter","defaultTextHeight","getViewport","addWidget","vspace","hspace","triggerOnKeyDown","triggerOnKeyPress","triggerOnKeyUp","triggerOnMouseDown","findPosH","amount","hitSide","rtlMoveVisually","findPosV","goalColumn","goals","headPos","startChar","check","scrollTo","getScrollInfo","interpret","swapDoc","phrase","phraseText","phrases","getScrollerElement","getGutterElement","registerHelper","registerGlobalHelper","predicate","origDir","lineDir","findNextLine","moveOnce","boundToLine","astral","sawType","pageSize","moveAmount","ContentEditableInput","lastAnchorNode","lastAnchorOffset","lastFocusNode","lastFocusOffset","polling","composing","gracePeriod","readDOMTimeout","posToDOM","isInGutter","scan","badPos","bad","domTextBetween","closing","extraLinebreak","recognizeMarker","addText","walk","cmText","markerID","isBlock","textContent","nodeValue","domToPos","lineNode","locateNodeInLineView","textNode","topNode","curNode","previousSibling","dist$1","belongsToInput","onCopyCut","lineWiseCopyCut","clearData","kludge","hadFocus","showPrimarySelection","contentEditable","updateFromDOM","readFromDOMSoon","forceCompositionEnd","label","removeAttribute","showMultipleSelections","curAnchor","curFocus","rng","rangeCount","getRangeAt","startGracePeriod","rememberSelection","selectionInEditor","commonAncestorContainer","poll","pollSelection","pollInterval","pollContent","fromIndex","fromNode","toNode","toIndex","newText","oldText","cutFront","cutEnd","oldTop","maxCutFront","newBot","oldBot","maxCutEnd","chFrom","chTo","TextareaInput","prevInput","pollingFast","resetting","fromTextArea","textarea","tabindex","placeholder","realSubmit","form","leaveSubmitMethodAlone","submit","wrappedSubmit","getTextArea","toTextArea","addLegacyProps","cmpPos","createField","prepareCopyCut","fastPoll","dispatchEvent","Event","_display","moveInputWithCursor","wrapOff","lineOff","teTop","teLeft","drawn","contextMenuPending","slowPoll","missed","same","resetSelectionOnContextMenu","oldScrollY","oldCSS","oldWrapperCSS","wrapperBox","offsetParent","scrollY","rehide","detectingSelectAll","prepareSelectAllHack","mouseup","extval","disabled","dontDelegate","func","defineDocExtension","version","keySet","parserConfig","propertyKeywords","tokenHooks","documentTypes","mediaTypes","mediaFeatures","mediaValueKeywords","nonStandardPropertyKeywords","fontProperties","counterDescriptors","colorKeywords","valueKeywords","allowNested","lineComment","supportsAtComponent","highlightNonStandardPropertyKeywords","ret","tp","tokenBase","tokenize","tokenString","tokenParenthesized","quote","escaped","pushContext","popContext","pass","states","popAndPass","wordAsValue","stateArg","_stream","atBlock","cx","blockCommentStart","blockCommentEnd","blockCommentContinue","fold","documentTypes_","mediaTypes_","mediaFeatures_","mediaValueKeywords_","propertyKeywords_","nonStandardPropertyKeywords_","colorKeywords_","valueKeywords_","allWords","tokenCComment","maybeEnd","defaultTags","script","maybeBackup","pat","attrRegexpCache","getAttrRegexp","regexp","getAttrValue","getTagRegexp","anchored","addTags","findMatchingMode","tagInfo","tagText","htmlMode","multilineTagIndentFactor","multilineTagIndentPastTag","allowMissingTagName","tags","configTags","configScript","scriptTypes","html","htmlState","inTag","endTagA","endTag","localState","localMode","local","statementIndent","jsonldMode","jsonld","json","trackScope","isTS","typescript","wordRE","wordCharacters","keywords","kw","A","B","C","D","operator","atom","isOperatorChar","isJsonldKeyword","readRegexp","inSet","cont","tokenComment","expressionAllowed","tokenQuasi","lastType","propertyIsEnumerable","brackets","findFatArrow","fatArrowAt","arrow","depth","sawSomething","bracket","atomicTypes","JSLexical","inScope","varname","localVars","vars","parseJS","cc","marked","expression","statement","lex","inList","block","newContext","registerVarScoped","Var","globalVars","isModifier","defaultVars","pushcontext","pushblockcontext","popcontext","pushlex","poplex","expect","wanted","exp","vardef","parenExpr","maybeexpression","maybeelse","functiondef","forspec","enumdef","typename","typeexpr","maybelabel","maybeCatchBinding","afterExport","afterImport","funarg","expressionInner","expressionNoComma","noComma","arrowBodyNoComma","arrowBody","commasep","maybeop","maybeoperatorNoComma","maybeoperatorComma","classExpression","arrayLiteral","contCommasep","objprop","quasi","maybeTarget","expr","property","continueQuasi","targetNoComma","maybeTypeArgs","getterSetter","afterprop","maybetype","what","sep","proceed","maybetypeOrIn","mayberettype","isKW","afterType","typeprops","typearg","maybeReturnType","quasiType","typeprop","functiondecl","continueQuasiType","typeparam","maybeTypeDefault","maybeAssign","vardefCont","eltpattern","proppattern","forspec1","forspec2","classNameAfter","classBody","classfield","maybeFrom","exportField","importSpec","maybeMoreImports","maybeAs","enummember","isContinuedStatement","basecolumn","firstChar","c","doubleIndentSwitch","closeBrackets","skipExpression","htmlConfig","autoSelfClosers","implicitlyClosed","contextGrabbers","doNotIndent","allowUnquoted","allowMissing","caseFold","xmlConfig","editorConf","config_","setStyle","inText","parser","inBlock","doctype","baseState","tagStart","inAttribute","stringStartCol","closure","isInAttribute","terminator","lower","startOfLine","noIndent","maybePopContext","nextTagName","parentTagName","tagNameState","closeTagNameState","attrState","matchClosing","closeState","closeStateErr","attrEqState","attrValueState","attrContinuedState","isInText","baseIndent","fullLine","alignCDATA","tagAfter","grabbers","skipAttribute","xmlCurrentTag","xmlCurrentContext","_module","em","CanvasSpotBuiltInTypes","getView","componentView","getBoxRect","cvView","Canvas","getCanvasView","boxRect","getElBoxRect","getStyle","translate","isType","CommandsEvents","run","ed","Components","Css","bindAll","editor","canvasModel","canvas","toggleMove","disableDragger","stopCommand","enableDragger","toggleDragger","enable","dragger","methodCls","getCanvas","classList","ppfx","getPosition","setPosition","onStart","onDrag","onEnd","methodEv","methodsEv","defineCommand","def","pfx","stylePrefix","pStylePrefix","hoverClass","badgeClass","plhClass","freezClass","onFrameScroll","getElement","getCanvasBody","getBody","getCanvasTools","getToolsEl","callRun","runBeforeCommand","_runCommand","abort","_abort","sender","runCommand","_run","callStop","stopBeforeCommand","_stopCommand","_stop","Commands","components","component","getSelectedAll","Boolean","logWarning","selectRemove","evName","getEl","guidesStatic","guidesTarget","setupGuides","getModel","isTran","guidesContainer","getGuidesContainer","getGuidesTarget","getGuidesStatic","drg","toggleDrag","getEventOpts","guides","item","guide","guidesEl","getConfig","elInfoX","elInfoY","guideContent","innerHTML","getGlobalToolsEl","elGuideInfoX","elGuideInfoY","elGuideInfoContentX","elGuideInfoContentY","debounce","updateGuides","debug","renderGuide","getElementGuides","lastEl","getElementPos","getGuidePosUpdate","originRect","un","guideSize","numEl","noScroll","getTranslate","transform","itemStr","trim","parseFloat","setTranslate","__p","styleUp","addStyle","avoidStore","Styles","__emitCmpStyleUpdate","getSelected","_getDragData","center","relPos","parentRel","pStyle","getMouseRelativeCanvas","offsetP","guidesInfo","renderGuideInfo","hideGuidesInfo","rectOrigin","isUndefined","isY","origEdge1","origEdge1Raw","origEdge2","origEdge2Raw","elGuideInfo","elGuideInfoCnt","guideInfoStyle","stat","statEdge2","isEdge1","statEdge1","statEdge1Raw","statEdge2Raw","posFirst","posSecond","pos2","sizeRaw","matched","toSelect","coll","snd","incr","getChildAt","wrappers","Pages","getAllWrappers","flatten","wrp","findType","rules","CssComposer","getAll","rule","md","modal","Modal","CodeManager","oHtmlEd","buildEditor","oCsslEd","htmlEditor","cssEditor","class","textViewCode","setContent","getHtml","optsHtml","getCss","optsCss","codeName","createViewer","EditorView","isEnabled","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen","disable","exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen","fsChanged","targetEl","isElement","getContainer","noSelClass","getBadgeEl","getHighlighterEl","wp","$wrapper","initSorter","toggleClipboard","drag","cacheEl","startSelectPosition","frameEl","contentDocument","sorter","onEndMove","stopSelectComponent","getContentWindow","rollback","initSorterFromModel","onEndMoveFromModel","initSorterFromModels","lastModel","frameView","getCurrentFrame","toMove","onMoveClb","onSelect","endMove","$badge","getBadge","$hl","getHighlighter","removeClass","am","custom","__customData","onceClose","AssetManager","accept","modalTitle","setTarget","onClick","onDblClick","__behaviour","rendered","__trgCustom","assets","uploadEl","bm","appendTo","firstRender","pn","Panels","getPanel","addPanel","Blocks","lm","LayerManager","lmConfig","layers","panels","$cnt","DeviceManager","SelectorManager","StyleManager","trgEvCnt","$cntInner","$cntSlm","$cntSm","append","showDevices","devicePanel","dvEl","slmConfig","sm","smConfig","$header","pnCnt","toggleSm","show","hide","panelC","Config","tm","TraitManager","confTm","$cn","$cn2","toggleTm","clp","lastSelected","addOpts","doAdd","pageBody","getMainComponent","emitUpdate","pasteable","cop","canMove","cmdOutline","getPanels","preventDrag","tglEffects","mthEv","tlb","getToolbarEl","elP","querySelectorAll","shouldRunSwVisibility","isActive","stopDefault","editorEl","onclick","panel","canvasS","runDefault","canvasView","getResizerEl","prefix","posFetcher","mousePosFetcher","getMouseRelativePos","canvasResizer","forceNew","Utils","Resizer","command","Toolbar","mousedown","handleClick","getFrameEl","Editor","onRender","DomainViews","ToolbarView","itemView","showOffsets","activeResizer","frameOff","canvasOff","adjScroll","startSelectComponent","toggleSelectComponent","listenToEl","eventCmpUpdate","onFrameUpdated","onContainerChange","onHovered","updateGlobalPos","_upToolbar","updateAttached","getFrames","frame","getWindow","onHover","onOut","onFrameResize","getComponentView","parentEl","getComponentModel","currentDoc","setHovered","useValid","setCurrentFrame","updateLocalPos","views","getViewEl","elHovered","updateToolsLocal","toggleToolsEl","currentFrame","elSelected","updateToolsGlobal","initResize","getElSelected","getElHovered","showElementOffset","elPos","hideElementOffset","showFixedElementOffset","hideFixedElementOffset","hideHighlighter","opacity","isEditing","isChildOf","getEditing","updateBadge","badge","bStyle","posOnly","icon","getIcon","clsBadge","customeLabel","customBadgeLabel","badgeLabel","getName","getTargetToElementFixed","leftOff","showHighlighter","elem","resizable","spotTypeResize","CanvasSpot","Resize","hasCustomResize","hasCustomSpot","removeSpots","addSpot","onMove","updateTarget","resizableOpts","docs","resizer","keyHeight","keyWidth","currentUnit","keepAutoHeight","keepAutoWidth","getModelToStyle","toggleFramesEvents","computedStyle","modelStyle","currentWidth","autoWidth","currentHeight","autoHeight","startDim","unitHeight","getUnitFromValue","unitWidth","store","selectedHandler","onlyHeight","onlyWidth","bodyw","getDragMode","finalStyle","updateToolbar","toolbarEl","toolbarStyle","toolbar","showToolbar","noCustomSpotSelect","Select","toolbarView","updateToolbarPos","getCanvasPosition","updateTools","refreshSpots","isCompSelected","isHoverEn","isNewEl","lastHovered","badgeOpts","customHoverSpot","Hover","showOffsetsSelected","toolsEl","canvasRectOffset","topOff","_trgToolUp","targetToElem","canvasOffsetTop","canvasOffsetLeft","refreshCanvas","hideBadge","cleanPrevious","status","hasWin","preserveSelected","setSelected","trg","isPointed","utils","Sorter","placer","getPlacerEl","containerSel","itemSel","wmargin","nested","canvasRelative","scale","getZoomDecimal","startSort","getOffsetDim","stopSelectPosition","posTargetCollection","posIndex","posMethod","cDim","posIsLastEl","posTargetEl","outsideElem","posTargetModel","nearFloat","isLast","getOffsetMethod","zoom","HTMLElement","Spacing","stateVar","offsetViewer","marginT","marginB","marginL","marginR","padT","padB","padL","padR","stateLow","marginName","paddingName","marginV","paddingV","paddingEls","fullMargName","fullPadName","marginLeftSt","marginRightSt","marginRight","marginTopSt","marginBottomSt","mtStyle","mbStyle","mlStyle","mrStyle","ptStyle","pbStyle","plStyle","prStyle","posLeft","widthEl","marginSideH","marginSideT","padTop","padBot","padSideH","padSideT","padRight","toggleVis","cv","mth","_onFramesChange","handleFrames","frames","loaded","_upFrame","__ol","isDef","CoordinatesTypes","DEFAULT_COORDS","ActionLabelComponents","ComponentsEvents","autoAdd","itemsView","itemType","reuseView","addTo","items","itemViewNotFound","ns","warn","typeField","clearItems","onRemoveBefore","onRemove","xyArr","snapOffset","lastScroll","lastScrollDiff","startPointer","startPosition","globScrollDiff","currentPointer","getDocumentEl","getContainerEl","getWindowEl","keyHandle","handleScroll","actualScroll","scrollDiff","getPointerPos","getStartPosition","currentPos","glDiff","lockedAxis","detectAxisLock","moveDelta","co","deltaPre","snapGuides","newDelta","trgX","trgY","axs","trgPoint","statPoint","deltaPoint","trgGuide","isPointIn","trgValue","setGuideLock","lock","ofst","trgName","cancelled","xPos","yPos","parentWindow","getPos","getPointerPosition","pEv","relX","relY","absX","absY","_Array$prototype","idRe","classRe","htmlRe","tagRe","getElementsByTagName","Cash","__cash","eles","getElementById","parseHTML","ready","cash","eq","ele","camelCaseRe","camelCaseWhitespaceRe","camelCase","letter","removeProp","guid","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","isNumeric","isFinite","getCompareFunction","is","splitValuesRe","getSplitValues","unique","computeStyle","isVariable","getPropertyValue","computeStyleInt","hasClass","removeAttr","_value","toggleClass","isForce","cssVariableRe","isCSSVariable","prefixedProps","docEl","vendorsPrefixes","getPrefixedProp","propCC","propUC","prefixedProp","numericProps","animationIterationCount","columnCount","flexGrow","flexShrink","fontWeight","lineHeight","orphans","widows","getSuffixedValue","setProperty","dataNamespace","dataAttributeRe","getDataCache","dataset","getExtraSpace","xAxis","hasNamespaces","ns1","ns2","removeEventListeners","_ref","hasData","_this","removeData","boxSizing","includeMargins","eventsNamespace","eventsNamespacesSeparator","getEventsCache","parseEventName","removeEvent","namespaces","eventCache","_ref2","eventFullName","_this2","_parseEventName","_one","_this3","_parseEventName2","finalCallback","namespace","thisArg","addEvent","one","readyState","evt","_parseEventName3","createEvent","initEvent","selectOneRe","selectMultipleRe","selectedIndex","getValueSelectSingle","getValueSelectMultiple","queryEncodeSpaceRe","skippableRe","checkableRe","serialize","query","elements","checked","queryEncode","isMultiple","eleValue","containers","fragmentRe","singleTagRe","table","tr","td","thead","tbody","tfoot","initContainers","$1","insertContent","prepend","isStr","insertAdjacentHTML","insertElement","_this4","outerHTML","insertAfter","_this5","_this6","_this7","_this8","_this9","prependTo","replaceWith","_this10","$eles","replaceAll","docEle","clientTop","contents","nextElementSibling","not","closest","parents","previousElementSibling","siblings","KEY_TAG","KEY_ATTR","motionsEv","isDoc","Node","DOCUMENT_NODE","removeEl","inputs","attrUp","isVisible","oldEl","newEl","appendAtIndex","total","createEl","createText","createCustomEvent","oEvent","err","_parentEvent","keyCodeVal","defineProperty","appendVNodes","vNodes","vnode","isTextNode","TEXT_NODE","isTaggableNode","COMMENT_NODE","isCommentNode","getElRect","rectText","selectNode","getDocumentScroll","getKeyCode","getKeyChar","getPointerEvent","isEscKey","isEnterKey","hasModifierKey","hasCtrlKey","doctypeToString","dt","publicId","systemId","pubId","sysId","attrToString","evs","els","isBultInMethod","normalizeKey","mls","Promise","getGlobal","elProt","Element","getUiClass","defCls","appendStyles","stls","link","prepand","shallowDiff","objOrig","objNew","keysNew","origValue","newValue","upFirst","normalizeFloat","step","valueDef","stepDecimals","toFixed","hasDnd","nativeDnD","escapeNodeContent","deepMerge","targValue","srcValue","__cashData","isEmptyObj","capitalize","isRule","toCSS","__gjsv","isComponent","toHTML","setViewEl","createId","chars","random","buildBase64UrlFromSvg","svg","base64Str","btoa","Buffer","webpackContext","req","webpackContextResolve","__webpack_require__","resolve","Function","ArrayProto","ObjProto","SymbolProto","supportsArrayBuffer","ArrayBuffer","supportsDataView","DataView","nativeIsArray","nativeKeys","nativeCreate","nativeIsView","isView","_isNaN","_isFinite","hasEnumBug","nonEnumerableProps","MAX_ARRAY_INDEX","pow","restArguments","isNull","isBoolean","tagTester","nodelist","Int8Array","hasStringTagBug","isIE11","Map","isDataView","getInt8","isArrayBuffer","buffer","isSymbol","isNumber","constant","createSizePropertyCheck","getSizeProperty","sizeProperty","shallowProperty","typedArrayPattern","collectNonEnumProps","emulatedSet","nonEnumIdx","proto","isMatch","_keys","_wrapped","toBufferView","bufferSource","Uint8Array","byteOffset","valueOf","tagDataView","aStack","bStack","deepEq","areArrays","aCtor","bCtor","allKeys","ie11fingerprint","weakMapMethods","forEachName","hasName","commonInit","mapTail","mapMethods","setMethods","createAssigner","keysFunc","baseCreate","Ctor","extendOwn","tap","interceptor","toPath","deepGet","defaultValue","identity","optimizeCb","argCount","accumulator","baseIteratee","mapObject","results","currentKey","noop","propertyOf","times","accum","getTime","createEscaper","escaper","testRegexp","replaceRegexp","templateSettings","evaluate","interpolate","noMatch","escapes","escapeChar","bareIdentifier","template","settings","oldSettings","argument","variable","fallback","idCounter","_chain","executeBound","sourceFunc","boundFunc","callingContext","partial","boundArgs","TypeError","callArgs","strict","idx","memoize","hasher","address","throttle","timeout","later","leading","throttled","_now","trailing","immediate","passed","debounced","_args","negate","compose","findKey","createPredicateIndexFinder","sortedIndex","low","high","createIndexFinder","predicateFind","createReduce","reducer","guard","contextPath","computed","lastComputed","reStrSymbol","rand","temp","criteria","keyInObj","compact","otherArrays","uniq","isSorted","seen","arrays","intersection","argsLength","unzip","chainResult","__webpack_module_cache__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","enumerable","toStringTag","literals","raw","acc","lit","subst","substs","fromElement","projectData","noticeOnUnload","forceClass","log","baseCss","protectedCss","canvasCss","defaultCommand","devicePreviewMode","mediaCondition","tagVarStart","tagVarEnd","keepEmptyTextNodes","jsInHtml","multipleSelection","avoidInlineStyle","avoidDefaults","clearStyles","cssIcons","icons","plus","caret","delete","arrowUp","chevron","eye","eyeOff","i18n","assetManager","layerManager","storageManager","richTextEditor","domComponents","codeManager","cssComposer","selectorManager","deviceManager","styleManager","blockManager","traitManager","keepUnusedStyles","customUI","getByComponent","getComponent","addComponent","hasComponent","Selectable","lastComponent","allComponents","removeComponent","moduleName","collections","_em","_name","cfgParent","cfg","_disable","_config","postLoad","__logWarn","__destroy","__appendTo","elTo","private","skipListen","__initListen","getProjectData","storageKey","loadProjectData","onResult","getAllMap","__catchAllEvent","entity","__remove","removeBefore","__onAllEvent","renderProps","_createId","ln","allMap","__listenAdd","__listenRemove","__listenUpdate","Module","scripts","autoscrollLimit","extHl","frameContent","frameStyle","notTextable","allowExternalDrop","default","devices","widthMedia","checkUnit","pr","getWidthMedia","Devices","updateSelect","startAdd","updateDevice","devEl","devicesEl","getDeviceModel","device","getOptions","evAll","evPfx","evSelect","evUpdate","evAdd","evRemove","evRemoveBefore","chnSel","deviceEvents","Device","_onSelect","deviceId","newDevice","getDevices","ItemManagerModule","PagesEvents","modelConstructor","newModel","keyAutoW","keyAutoH","getDimension","dim","viewDim","endsWith","domc","conf","allRules","idMap","modOpts","Wrapper","getType","newStyles","Parser","parseCss","checkId","changesCount","refFrame","_undo","_undoexc","initRefs","framesById","changesUp","temporary","noCount","getStyles","getHead","setHead","addHeadItem","getHeadByAttr","removeHeadByAttr","addLink","removeLink","addScript","removeScript","getPage","page","_emitUpdated","hasAutoHeight","infiniteCanvas","ModuleModel","fromUndo","loadedItems","itemsToLoad","onAdd","onReset","itemLoaded","listenToLoadItems","listenToLoad","onZoomChange","onCoordsChange","onPointerChange","_pageUpdated","rulers","pointerScreen","mainPage","_initPage","getMainFrame","getCurrentFrameModel","noUndo","getPointerCoords","World","onChange","refreshDbn","evToRefreshDbn","spot","__trgEvent","spotAdd","spotUpdate","spotRemove","CanvasEvents","viewCollection","renderView","important","getDeclaration","getBlockId","atRules","addToCollection","fragmentEl","renderStarted","atRule","getAtRule","atRuleEl","styleEl","appendData","clsName","mediaText","defaultBlockId","blockId","getMediaWidth","contRules","sortRules","isMobFirst","prs","htmlType","defaultType","modelAttrStart","compTypes","getPropAttribute","attrName","attrValue","valueLen","lastChar","splitPropsFromAttr","propsResult","parseStyle","decls","decl","parseClass","cl","parseNodeAttr","attrsLen","detectNode","compType","parseNode","nodes","nodesLen","namespaceURI","void","skipChildren","parseNodes","inSvg","comps","textTypes","textTags","allTxt","foundTextNode","cType","nodePrev","parserCss","cf","optionsHtml","preParser","asDocument","parseRes","parserHtml","DOMParser","mimeType","strF","parseFromString","BrowserParserHtml","allowScripts","allowUnsafeAttr","allowUnsafeAttrValue","__sanitizeNode","styleStr","resHtml","returnArray","startsWith","getLastStyleValue","extendStyle","propOrig","propNew","newStyle","noEvent","removeStyle","styleToString","imp","getSelectors","getSelectorsString","selectorsToString","getFullString","isSymbolMain","keySymbols","isSymbolInstance","keySymbol","isSymbolRoot","symbol","initSymbol","__symbReady","__upSymbProps","getSymbolMain","__getAllById","getSymbolInstances","symbs","symb","isSymbolOverride","ovrd","keySymbolOvrd","prp","getSymbolsToUpdate","fromInstance","noPropagate","symbols","getSymbolTop","detachSymbolInstance","symbolMain","skipRefs","logSymbol","toUp","updateSymbolComps","optUp","toUpOpts","isTemp","addSymb","addedInstances","symbTop","toAppend","addedInst","addedTop","symbolInv","skipRefsUp","isSymbNested","toUpFn","symbPrnt","Set","relCmps","toReset","__changesUp","getComponentIds","getId","getComponentsFromDefs","visitedCmps","restAttr","getNewId","addAttributes","newComponents","cmps","resetChildren","newIds","idsToKeep","keepIds","resetFromString","cssc","allByID","allById","parsed","parseString","newCmps","getRules","newRule","__checkInnerChilds","prevColl","Selectors","canRemoveStyle","rulesRemoved","symbolInstanceRemove","it","__postRemove","df","componentTypes","parseHtml","bodyCmps","restBody","headCmps","restHead","componentsById","optsToPass","addCollection","processedModels","processDef","mdl","ccid","processor","modelPr","$$typeof","avoidInline","Component","ensureInList","setClassRule","__postAdd","recursive","symbolInstanceAdd","TYPE_CLASS","TYPE_ID","namePreEsc","escapeName","nameEsc","Selector","protected","isId","isClass","getFullName","getLabel","setLabel","getActive","setActive","objLen","combine","curr","getStyleable","getValid","noDisabled","combination","getItemsByCategory","allItems","categorySet","categoryMap","emptyItem","category","categoryItems","categoryWithItems","CATEGORY_KEY","initCategory","isDefined","catModel","getCategories","TraitsEvents","Categories","changeProp","cat","initValue","targetEvent","targetUpdated","locale","getTargetValue","valueOpts","trait","setTargetValue","getDefault","idSel","getOptionId","getOptionLabel","optId","propName","getCategoryLabel","catId","catLabel","useType","fromTarget","getAttributes","valueTrue","valueFalse","valueToSet","setValueFromInput","final","toSet","getInitValue","build","buildFromString","optionsTarget","categories","categoryUpdate","handleAdd","handleReset","tmOpts","tf","Traits","traits","CollectionWithCategories","eventDrag","keyUpdate","keyUpdateInside","updateInside","parentAttr","toPropagate","voidElements","initClasses","initComponents","initTraits","initToolbar","initScriptProps","scriptUpdated","tagUpdated","attrUpdated","_idUpdated","__emitUpdateTlb","__onChange","__propToParent","avoidUpdateStyle","removable","droppable","badgable","stylable","unstylable","highlightable","copyable","editable","layerable","selectable","hoverable","dmode","updated","um","__hasUm","__propSelfToParent","__onStyleChange","styleKeys","pros","propsChanged","updateSymbolProps","__upSymbCls","updateSymbolCls","__upSymbComps","setDragMode","setSymbolOverride","getSymbolOverride","$els","closestType","setClass","attrPrev","attrKey","setAttributes","noClass","removeAttributes","attrArr","compAttr","optsAdd","getIdRule","setIdRule","noStyle","addId","selectors","classe","getClasses","classStr","attrCls","toListen","clsArr","normalizeClasses","addChild","avoidChildren","__loadTraits","prevProps","newProps","prevPropsEv","newPropsEv","__scriptPropsChange","getLastChild","tb","traitsI","getTraits","setTraits","getTrait","updateTrait","getTraitIndex","removeTrait","addTrait","clm","_inner","cloned","newId","defName","nameTag","i18nPfx","i18nName","i18nNameTag","i18nDefName","customName","noCustom","setName","sTag","customAttr","getAttrToHTML","withProps","valueRes","altQuoteAttr","attrString","getInnerHTML","__innerHTML","keepInlineStyle","getChangedProps","setId","frm","getCurrentView","__getScriptProps","modelProps","getScriptString","scr","scrStr","reg","onAll","clb","forEachChild","rmOpts","sameParent","isInstanceOf","typeExtends","byType","resetId","oldId","_getStyleRule","idS","_getStyleSelector","idUpdate","idPrev","getList","getDefaults","nextId","getIncrementId","ilen","uid","dm","rootEl","toggleEffects","handleDragEnter","handleDragOver","handleDrop","handleDragLeave","__customTglEff","frameElement","sortOpts","customTarget","startCustom","endCustom","endDrop","dragStop","updateCounter","dragContentOrigin","dragContent","inAbsoluteMode","getWrapper","canvasOffset","getOffset","postLeft","posTop","handleDragEnd","cnt","setDropContent","getContentByData","dragging","lastMaxHeight","tools","frameWrapView","showGlobalTools","cvModel","getCanvasModel","updateHead","renderStyles","allowfullscreen","getCoords","frameRect","canvasRect","getCanvasOffset","vwDelta","getViewportDelta","zoomM","getZoomMultiplier","headEl","attrStr","stl","getJsContainer","jsContainer","elTools","_getTool","getOffsetViewerEl","getRect","getOffsetRect","scrollBottom","scrollRight","_toggleEffects","startAutoscroll","_toggleAutoscrollFx","requestAnimationFrame","autoscroll","lastClientY","actualTop","limitTop","limitBottom","nextTop","spots","updateClientY","stopAutoscroll","mt","renderScripts","evLoad","evOpts","appendScript","scriptEl","hasAttribute","HTMLScriptElement","frameLoadHead","renderBody","frameLoadBody","write","frameLoad","renderHead","normalize","prevStyles","HeadView","headView","_isEditor","passive","_emitUpdate","classAnim","updateOffset","updateSize","frameLoaded","updatePos","setupDragger","dragX","dragY","Dragger","posOpts","startDrag","__clear","destroyed","updateDim","__handleSize","noChanges","onScroll","onscroll","currW","currH","newW","newH","newWidth","newHeight","observer","ResizeObserver","observe","sizeObserver","disconnect","twrp","toolsWrapper","elTop","elRight","elBottom","elLeft","frameWrapperView","clsUnscale","_initFrames","clearOff","checkSelected","updateFrames","_onFramesUpdate","toggleListeners","_renderFrames","currFrame","onWheel","onPointer","screenToWorld","docScroll","screenCoords","isInputFocused","isZooming","newZoom","setZoom","Screen","pointerX","pointerY","zoomDelta","setCoords","toolsWrpEl","defOpts","updateFramesArea","timerZoom","framesArea","cvStyle","mpl","zoomDc","fitViewport","elFrame","elRect","noHeight","ignoreHeight","gapIsNum","gapX","gapY","boxWidth","boxHeight","canvasWidth","canvasHeight","widthRatio","heightRatio","zoomRatio","zoomMltp","yDelta","isElInViewport","getFrameOffset","rTop","rLeft","getRectToScreen","zoomMlt","frameX","frameY","canvasEl","toScreen","getViewportRect","toWorld","frmOff","cvsOff","winEl","frEl","frameOffset","frameTop","avoidFrameOffset","frameLeft","avoidFrameZoom","getElementOffsets","bEl","fo","updateScript","scriptContainer","jsEl","scriptFn","scriptFnStr","scriptProps","getFrameView","frms","mainFrame","renderFrames","$frames","toolsWrp","hlEl","badgeEl","placerEl","ghostEl","resizerEl","offsetEl","fixedOffsetEl","toolsGlobEl","spotsEl","getFrame","getFramesEl","getDocument","_getLocalEl","globalEl","compView","getGhostEl","getFixedOffsetViewerEl","getSpotsEl","setCustomBadgeLabel","topScroll","leftScroll","getTargetToElementDim","canvasPos","toRight","targetHeight","targetWidth","eventToTrigger","topPos","elementTop","elementLeft","elementWidth","elementHeight","canvasTop","canvasLeft","rectOff","getFrameElFromDoc","fullHeight","subWinOffset","yOffset","xOffset","addTop","addLeft","toIgnore","fr","getZoom","hasX","hasY","getPointer","addFrame","getLastDragResult","spotProps","getSpots","cmpView","customSpots","getWorldRectToScreen","draggableComponents","disableTextInnerChilds","useFrameDoc","__escapeContent","frameborder","svgAttrs","ratioDefault","cmdName","hasButtonBool","getSrcResult","isDefaultSrc","srcDef","parseUri","uri","URL","hostname","protocol","port","qrs","pair","getQueryObject","locked","parseFromSrc","updateSrc","defs","mapUrl","mapType","getMapUrl","addr","qr","q","z","columns","rows","rowsToAdd","columnsToAdd","yt","vi","ytnc","defProvider","hasParam","updatePropsFromAttr","updateTraits","videoId","provider","ytUrl","ytncUrl","viUrl","poster","muted","autoplay","controls","color","modestbranding","sources","getYoutubeTraits","getVimeoTraits","getSourceTraits","prov","getYoutubeSrc","getYoutubeNoCookieSrc","getVimeoSrc","getProviderTrait","getAutoplayTrait","getLoopTrait","getControlsTrait","isYtProv","isYtncProv","isViProv","isExtProv","CmpHead","CmpDef","asDoc","headStr","docElAttr","docElAttrStr","childrenView","sameFrameView","getTypes","viewObject","logError","modelOpt","updateStyle","renderAttributes","updateHighlight","updateStatus","updateContent","handleChange","onActive","onDisable","avoidRender","getEvents","dragstart","_clbObj","__isDraggable","handleDragStart","updateClasses","importClasses","renderChildren","chgArr","selectedCls","selectedParentCls","freezedCls","hoveredCls","noPointerCls","pointerInitCls","selCls","noExtHl","noCustomSpotTarget","Target","avoidHover","clsStr","isTextable","hl","styleOpts","__cmpStyleOpts","onAttrUpdate","updateAttributes","textable","defaultAttr","contenteditable","hasComps","getChildrenContainer","prevDef","getChildrenSelector","getTemplate","gtop","gleft","assignRect","isInViewport","frameH","frameW","_setData","createDoc","postRender","createComment","__getSrc","dblclick","click","load","classEmpty","fetchFile","fu","Assets","FileUploader","uploadFile","asset","complete","getSrc","onError","onLoad","noDrag","updateContentText","syncContent","rte","RichTextEditor","fromDisable","disableEditing","canActivate","rteEnabled","sameInEdit","isInnerText","getContent","lastContent","activeRte","toggleEvents","contentOpt","customRte","parseContent","insertComponent","startContainer","startOffset","useDomContent","onInput","disablePropagation","mixins","setEditing","elDocs","getIframe","ifrm","frameBorder","createElementNS","updateProvider","updateVideo","renderByProvider","videoEl","renderYoutube","renderYoutubeNoCookie","renderVimeo","renderSource","initVideoEl","onUpdate","onUpdateDeep","symbolMainRemove","symbolMainAdd","symbolMainUpdate","symbolMainUpdateDeep","isInstance","eventType","symbolInstance","CanMoveReason","ComponentView","ComponentsView","componentHovered","selectAdd","getComponents","setComponents","addType","extendView","extendFn","extendFnView","extendType","extendViewType","typeToExtend","modelToExt","viewToExt","getExtendedObj","srcToExt","parentFn","defBlockProps","blockProps","removeType","getShallowWrapper","shallow","shallowEm","addSymbol","getSymbols","detachSymbol","getSymbolInfo","isMain","mainRef","instances","main","relatives","withChanges","isRoot","reason","InvalidSource","srcModel","SourceReject","isTargetInside","TargetReject","getById","maxValue","MAX_VALUE","compCls","buildFromModel","codeJson","onlyMatched","matchedRules","mRules","buildFromRule","sortMediaObject","rulesStr","ruleStr","dump","selectorStrNoAdd","skipAdd","selectorsAdd","singleAtRule","__cleanSelector","getQueryLength","mediaQuery","itemsArr","mquery","getKey","CSS","ensureSelectors","atRuleType","typeStr","addSelector","selOpts","stateStr","skipState","allowEmpty","getDevice","deviceDefault","getState","stateValue","getStates","sngl","cmpId","ruleProps","wd","selAdd","a1S","a2S","CssRules","slc","singleSel","checkNode","console","sl","newSels","le","selec","modelExists","styleUpdate","addRules","setRule","atRuleParams","addStyles","getRule","optRuleSel","media","getCurrentMedia","getClassRule","getComponentRules","rulesView","sSel","blocks","appendOnClick","activate","getMedia","ctg","BlocksEvents","endDrag","dragend","__getModule","getSorter","validTarget","valid","__currentBlock","setDragHelper","__startDrag","handleDrag","__drag","__endDrag","clsAdd","catName","caretR","caretD","iconClass","activeClass","updateVisibility","getIconEl","getTypeEl","iconEl","typeEl","renderedCategories","noCatClass","blockContClass","catsClass","updateConfig","ignoreCategories","getCategoriesEl","catView","catsEl","getBlocksEl","blocksEl","Block","Category","blocksVisible","bhv","__getBehaviour","_dragBlock","dragResult","oldKey","oldActive","toActive","__getFrameViews","_bhv","fv","blocksView","getAllVisible","getDragBlock","getBlocksByCategory","toRender","external","colls","iconAdd","iconSync","iconTagOn","iconTagOff","iconTagRemove","componentFirst","State","inputProp","getInputEl","inputEl","startEditTag","endEditTag","rename","innerText","changeStatus","removeTag","removeSelected","$chk","mainCls","stateInputId","stateInputC","componentChanged","checkSync","evClsUp","toList","toListCls","__handleStateChange","renderClasses","tagRemoved","renderStates","labelInfo","labelHead","syncStyle","getTarget","cssC","getCommonSelectors","ruleComponents","getTargets","ruleComponent","updateStateVis","addToClasses","startNewTag","$addBtn","$input","endNewTag","onInputKeyUp","addNewTag","checkStates","statesEl","targets","trgs","validSelectors","__getCommonSelectors","_commonSelectors","__common","hasStyle","$btnSyncEl","getStatesC","updateSelector","elSel","__getName","selectedName","idRes","stateChanged","addSelected","$states","$statesC","labelStates","tmpOpts","renderRes","$classes","evCustom","evState","selectorEvents","cFirst","__update","eventCmpUpdateCls","__updateSelectedByComponents","__ctn","selTags","selectorTags","cOpts","cname","selModel","getSelector","newName","setState","setStates","__getCommon","duplicateSelected","commonSelectors","styleToApply","suffix","newSelector","getSelectedTargets","setComponentFirst","getComponentFirst","CSS_RULE_TYPES","AT_RULE_NAMES","AT_RULE_KEYS","SINGLE_AT_RULE_TYPES","NESTABLE_AT_RULE_NAMES","SINGLE_AT_RULE_NAMES","parseSelector","propValue","getPropertyPriority","parseCondition","conditionText","selectorText","createNode","selLen","lastClass","stateArr","getNestableAtRule","cssRules","keyText","isSingleAtRule","subRules","subAtRuleType","lens","subRule","selsParsed","selsAdd","selsArr","lastRule","len3","selsAddStr","sheet","parsedNode","classSets","classSet","autosave","autoload","stepsBeforeSave","recovery","onStore","checkLocal","remote","headers","urlStore","urlLoad","contentTypeJson","fetchOptions","credentials","hasLocal","localStorage","setItem","getItem","thr","_typeof","then","AggregateError","errors","message","P","rejectionReasons","catch","ex","setTimeoutFunc","_state","_handled","_deferreds","doResolve","deferred","_immediateFn","onFulfilled","onRejected","promise","finale","_unhandledRejectionFn","Handler","prom","promiseFinally","allSettled","race","setImmediate","rej","XMLHttpRequest","withCredentials","statusText","responseText","upload","onProgress","onprogress","send","request","__props","parsable","typeJson","fetchOpts","reqHead","typeHead","FormData","StorageEvents","STORAGE_LOCAL","STORAGE_REMOTE","storages","setCurrent","isAutosave","setAutosave","getStepsBeforeSave","setStepsBeforeSave","storage","getStorages","getCurrent","currentStorage","getCurrentStorage","getStorageOptions","getCurrentOptions","getRecoveryStorage","recoveryOpts","__exec","recoveryStorage","recoveryData","__askRecovery","getRecovery","confirm","response","toStore","__clearKeys","onAfter","itemKey","startLoad","startStore","evAfter","afterLoad","afterStore","endLoad","endStore","errorLoad","errorStore","canAutoload","appendInput","eventCapture","clsField","onValueChange","removeView","rerender","templateLabel","templateInput","getClbOpts","elInput","getInputElem","onEvent","getValueForTarget","setInputValue","postUpdate","renderLabel","tpl","createLabel","getModelValue","i18nAttr","getElInput","renderField","createInput","hasLabel","noLabel","tmpl","TraitView","labelButton","TraitButtonView","toInit","targetValue","handleModelChange","holderClass","inputClass","elementUpdated","__onInputChange","fromInput","plh","Input","defaultOpts","beforeShow","flat","showInput","showButtons","clickoutFiresChange","showInitial","showPalette","showPaletteOnly","hideAfterPaletteSelect","togglePaletteOnly","showSelectionPalette","localStorageKey","maxSelectionSize","cancelText","chooseText","togglePaletteMoreText","togglePaletteLessText","clearText","noColorSelectedText","preferredFormat","containerClassName","replacerClassName","showAlpha","palette","selectionPalette","spectrums","IE","rgbaSupport","backgroundColor","replaceInput","markup","gradientFix","dataID","spectrum","extra","spect","loadOpts","inputTypeColorSupport","_cachedResult","colorInput","localization","palettes","processNativeColorInputs","colorInputs","trimLeft","trimRight","tinyCounter","math","mathRound","mathMin","mathMax","mathRandom","tinycolor","rgb","format","named","matchers","rgba","hsl","hsla","hsv","hsva","hex8","convertHexToDecimal","parseIntFromHex","hex6","hex3","stringInputToObject","bound01","convertToPercentage","hsvToRgb","hue2rgb","hslToRgb","boundAlpha","inputToRGB","_originalInput","_r","_g","_b","_a","_roundA","_format","_gradientType","gradientType","_ok","_tc_id","isDark","getBrightness","isLight","getOriginalInput","getFormat","getAlpha","toRgb","setAlpha","toHsv","rgbToHsv","toHsvString","toHsl","rgbToHsl","toHslString","toHex","allow3Char","rgbToHex","toHexString","toHex8","rgbaToHex","toHex8String","toRgbString","toPercentageRgb","toPercentageRgbString","toName","hexNames","toFilter","secondColor","hex8String","secondHex8String","formatSet","formattedString","hasAlpha","_applyModification","lighten","brighten","darken","desaturate","saturate","greyscale","spin","_applyCombination","analogous","complement","monochromatic","splitcomplement","triad","tetrad","fromRatio","newColor","color1","color2","mix","w1","rgb1","rgb2","w2","readability","c1","c2","brightnessA","brightnessB","colorDiff","brightness","isReadable","mostReadable","baseColor","colorList","bestColor","bestScore","bestIsReadable","readable","CSS_UNIT","PERMISSIVE_MATCH3","PERMISSIVE_MATCH4","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","burntsienna","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","green","greenyellow","grey","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","flipped","flip","paletteTemplate","tiny","swatchStyle","callbackContext","instanceOptions","resize","reflow","throttler","isDragging","isDefault","dragWidth","dragHeight","dragHelperHeight","slideHeight","alphaWidth","alphaSlideHelperWidth","slideHelperHeight","currentHue","currentSaturation","currentValue","currentAlpha","paletteArray","paletteLookup","draggingClass","shiftMovementDirection","boundElement","pickerContainer","dragHelper","slider","slideHelper","alphaSliderInner","alphaSlider","alphaSlideHelper","textInput","paletteContainer","initialColorContainer","cancelButton","clearButton","chooseButton","toggleButton","isInput","isInputTypeColor","shouldReplace","replacer","offsetElement","previewElement","initialColor","colorOnShow","currentPreferredFormat","applyOptions","updateSelectionPaletteFromStorage","oldPalette","addColorToSelectionPalette","inArray","drawPalette","currentColor","getUniqueSelectionPalette","drawInitial","setFromTextInput","updateOriginalInput","isDefaultPrevented","hideAll","$doc","onkeydown","clickout","updateUI","revert","ignoreFormatChange","newHsv","updateHelperLocations","flatColor","realColor","displayColor","realHex","realRgb","alpha","realAlpha","gradient","alphaX","slideY","fireCallback","picker","offsetElm","pickerEl","rootElm","inputRect","pickerW","pickerH","innerWidth","scrollX","paletteElementClick","keydown","outerWidth","oldDragX","oldDragY","furtherFromX","paletteEvent","optionName","optionValue","coord","onmove","onstart","onstop","maxHeight","maxWidth","hasTouch","duringDragEvents","t0","hex","pad2","clamp01","hue","slices","modification","isOnePointZero","processPercent","isPercentage","ColorPicker","getColor","colorEl","getColorEl","tc","valueClr","noneColor","movedColor","colorPickerConfig","colorPicker","noDefault","contClass","validateInputValue","deepCheck","validObj","handleUnitChange","getUnitEl","handleKeyDown","upArrowClick","downArrowClick","unitEl","units","normalizeValue","downIncrement","moveIncrement","upIncrement","prValue","defValue","limitlessMax","limitlessMin","fixed","regFixed","valCopy","uN","InputNumber","inputNumber","$unit","resultName","valResult","ATTR_CATEGORIES","ATTR_NO_CATEGORIES","traitContClass","classNoCat","updatedCollection","getTraitsEl","traitsEl","TraitsView","number","checkbox","upAll","__upSel","__onUp","__onSelect","getTraitsByCategory","baseView","getTraitsViewer","hidable","hideTextnode","showWrapper","showHover","scrollCanvas","scrollLayers","highlightHover","onInit","parentView","sortContainer","ignoreViewChildren","avoidSelectOnEnd","viewLayer","ItemView","opened","commandsDef","defComOptions","getOnComponentDragStart","getOnComponentDrag","getOnComponentDragEnd","altMode","CommandAbstract","defaultCommands","nativeDrag","hideTlb","fromMove","cmdMove","oldCmd","noStop","cmdObj","__onRun","__onStop","dataToggleMove","inputNameCls","clsTitleC","clsTitle","clsCaret","clsCount","clsMove","clsChildren","clsNoChild","clsEdit","clsNoEdit","initComponent","clsInput","gut","clsBase","checkChildren","updateOpening","updateLayerable","updateMove","updateName","__render","getInputName","getVisibilityEl","getItemContainer","hClass","isDraggable","toggleVisibility","stopImmediatePropagation","setVisible","handleEdit","handleEditKey","handleEditEnd","inputName","clsOpen","clsChvOpen","getCaret","isOpen","toggleOpening","setOpen","handleSelect","setLayerData","handleHover","hovered","handleHoverOut","itemEl","countEl","setRoot","_rendered","__clearItems","__isLayerable","evRoot","evComponent","propsToListen","__onRootChange","__onComponent","getRoot","prevDspKey","prevDisplay","updateLayer","setLocked","isLocked","getLayerData","cmpOpts","fromLayers","noAssets","uploadName","multiUpload","multiUploadSuffix","customFetch","embedAsBase64","beforeUpload","showUrlInput","dropzone","openAssetsOnDrop","dropzoneContent","getFilename","getExtension","Asset","unitDim","__getBhv","getPreview","getInfo","AssetImageView","TypeableCollection","baseType","getBaseType","typeFound","recognizeType","typeView","ModelInst","ViewInst","extendViewApi","AssetsEvents","renderAssets","addToAsset","removedAsset","deselectAll","handleSubmit","getAddInput","assetsEl","getAssetsEl","globalCollection","inputUrl","toggleNoAssets","addAsset","fuRendered","AssetsView","uploadId","disableUpload","FileUploaderView","onUploadStart","__propEv","uploadStart","onUploadEnd","uploadEnd","onUploadError","uploadError","onUploadResponse","uploadResponse","fetchOptsResult","initDrop","that","uploadForm","ondragover","ondragleave","ondrop","initDropzone","addedCls","edEl","updatedCls","dropzoneCls","cleanEditorElCls","onDragLeave","promises","mimeTypeMatcher","Image","readAsDataURL","assetCmd","assetsVis","assts","__viewParams","editorView","defFrame","getAllFrames","typeMain","pages","_onPageChange","configPages","Layers","mainComp","addBefore","pg","getMain","selectBefore","pagesMap","traitInputAttr","localeFallback","detectLocale","messages","en","addButton","inputPlh","uploadTitle","labels","comment","image","video","row","cell","desktop","tablet","mobileLandscape","mobilePortrait","titles","preview","fullscreen","emptyState","hover","layer","fileButton","sectors","general","layout","typography","decorations","flex","dimension","false","_blank","recover","messagesAdd","I18nEvents","addMessages","_localLang","setLocale","valuePrev","getLocale","getMessages","lang","_debug","setMessages","msg","localeFlb","lFlb","_getMsg","_addParams","nav","language","userLanguage","msgSet","spotTarget","elT","elL","borderOffset","freezeClass","relative","offTop","offLeft","selectOnEnd","getScale","getDocuments","elDoc","dropModel","dropContent","updateTextViewCursorPosition","targetDoc","caretRangeFromPoint","poiner","rangeParent","rangeOffset","setContentEditable","activeTextModel","toggleSortCursor","clonedEl","moveDragHelper","posY","posX","dragHelperStyle","createPlaceholder","ins","prevTarget","sourceEl","getSourceModel","clearSelection","getTargetModel","isTextableActive","tempModel","selectTargetModel","targetModel","dsp","eO","rY","rX","mousePos","eventMove","sourceModel","dimsFromTarget","lastDims","findPosition","disableTextable","movePlaceholder","prevTargetDim","$plh","isInFlow","styleInFlow","$parent","overflow","propFloat","trgModel","dragInfo","dropInfo","indexEl","targetP","validResult","getDim","cacheDimsP","getChildrenDim","cacheDims","nearBorders","targetParent","getTargetFromEl","targetPrev","nearElBorders","getCurrentPos","offsets","elIndex","dirValue","leftLimit","xLimit","yLimit","xCenter","yCenter","dimDown","trgDim","marg","margI","elDim","pT","pL","bT","borderTopWidth","bL","borderLeftWidth","bWidth","obj1","obj2","ancester","s1","toMoveArr","dst","modelToDrop","created","srcEl","warns","targetCollection","srcIndex","sameCollection","onUpdateContainer","minDim","maxDim","silentFrames","avoidContainerUpdate","tl","cr","bl","bc","br","setup","hdl","createHandler","toggleFrames","isHandler","getFocusedEl","getParentEl","getBoundingRect","updateContainer","forceShow","handleMouseDown","mouseFetch","parentRect","handlerAttr","clickedHandler","rectDim","startPos","parentDim","calc","updateRect","getSelectedHandler","elStyle","parentW","parentH","startW","startH","ratioActive","ratio","_mods","_scope","_MODIFIERS","control","_MAP","backspace","tab","return","esc","down","del","home","pageup","pagedown","_downKeys","compareArray","modifierMap","updateModifierKey","clearModifier","assignKey","resetModifiers","scope","mods","getKeys","getMods","shortcut","getScope","mi","setScope","deleteScope","isPressed","getPressedKeyCodes","multipleKeys","modifiersMatch","dispatch","keymaster","keymaps","defKeys","handlerRes","removeAll","backdrop","updateOpen","updateTitle","getCollector","$collector","$content","getTitle","$title","updateAttr","currAttr","_evData","titl","setTitle","onceOpen","getContentEl","swv","expt","osm","otm","ola","obl","ful","prv","togglable","runDefaultCommand","stopDefaultCommand","deactivateAllExceptOne","except","deactivateAll","fromCollection","disableAllButtons","disableAllButtonsExceptOne","Buttons","btn","listen","activeCls","disableCls","btnsVisCls","updateActive","checkActive","updateBtnsVis","updateClassName","updateDisable","fromListen","$buttons","commandName","clicked","toggleActive","appendContent","toggleVisible","resz","resLen","resBools","forContainer","styleWidth","styleHeight","buttonsView","appendEl","getPanelsEl","PanelsViewObj","removePanel","panelId","removeButton","getButton","disableButtons","optsCodeViewer","htmlOpts","cleanId","beforeEach","isFunctionEmpty","mapModel","scrProps","mapJs","autoFormat","autoFormatRange","noRefresh","CodeMirrorEditor","defaultViewer","generators","viewers","defGenerators","js","defViewers","loadDefaultGenerators","loadDefaultViewers","addGenerator","generator","getGenerator","getGenerators","addViewer","viewer","getViewer","getViewers","txtarea","updateViewer","getCode","genId","trackSelection","hasSkip","getChanged","hasUndo","chn","beforeCache","hasRedo","getInstance","getStack","getStackGroup","getGroupedStack","createItem","goToGroup","goTo","adjustToolbar","RichTextEditorActionState","RTE_KEY","btnState","isValidTag","parentAnchor","parentFocus","customElAttr","defActions","bold","italic","underline","strikethrough","insertHTML","setEl","updateActiveActions","__onKeydown","__onPaste","acts","actionbar","inactive","isCustom","actionbarCont","actionbarContainer","addAction","styleWithCSS","getActions","currentState","INACTIVE","newState","queryCommandSupported","queryCommandState","ACTIVE","__dbdTrgCustom","enabled","__toggleEffects","actionbarEl","syncActions","onKeydown","onPaste","textHtml","deleteContents","nd","insertNode","toSel","eventsUp","initRte","globalRte","hideToolbar","actionRes","updatePosition","rteInst","currentView","hideNotStylable","highlightChanged","highlightComputed","showComputed","clearProperties","avoidComputed","functionName","fixedValues","toRequire","requires","requiresParent","parentTarget","__upTargets","Property","callInit","__getParentProp","parentProp","isClear","__getFullValue","kProps","__getClearProps","toProps","applyStyle","__up","__trgEv","propertyUpdate","__upTargetsStyle","addStyleTargets","_up","noTarget","hasValue","getDefaultValue","parentValue","getParentTarget","hasValueParent","noParent","upValue","__parseValue","canClear","getParent","__canClearProp","isFull","parseValue","valueStr","numeric","num","withDefault","getFullValue","fnParameter","skipImportant","__setParentTarget","__parseFn","__checkVisibility","stylableReq","sector","getProperties","callParentInit","skipInit","getIndex","getValues","getLayerLabel","isSelected","getSelectedLayer","selectLayer","removeLayer","moveLayer","getStylePreview","hasPreview","upValues","isNumberType","detached","separator","fromStyle","toStyle","__upProperties","getProperty","getPropertyAt","isDetached","byName","getSeparator","getSplitSeparator","getJoin","__getJoin","getStyleFromProps","__clearIn","__upTargetsStyleProps","__setProperties","__getSplitValue","__styleHasProps","nameProps","__splitValue","__splitStyleName","props4Nums","__getPropsFromStyle","valuesStr","VALUES_REG","PARTS_REG","emptyValue","layerSeparator","layerJoin","layerLabel","selectedLayer","layersColl","__upSelected","__upLayers","getLayers","hasLayers","getLayer","__select","selectLayerAt","currIndex","addLayer","removeLayerAt","getStyleFromLayer","joinLayers","__getJoinLayers","newVal","getLayerSeparator","hasEmptyValue","isEmptyValue","getStyleFromLayers","layerSelect","__layers","__setLayers","newLayers","layersNew","__parseLayer","parseFn","__getLayersFromStyle","isEmptyValueStyle","separatorLayers","inLayer","getEmptyValueStyle","emptyStyle","__getLayers","clearProp","__destroyFn","iconClose","_getClbOpts","computedCls","labelEl","clearStyleEl","getClearEl","clearStyle","clearEl","inputValueChanged","emit","__setValueInput","clearCached","__unset","__change","__updateStyle","createdEl","clsType","propsView","iconMove","propertyView","pModel","updateLabel","removeItem","getPropertiesWrapper","propsWrapEl","getPreviewEl","previewEl","getLabelEl","prvEl","wrapEl","iconPlus","layersView","prvBoxEl","backgroundImage","openAssetManager","inputInst","__handleChange","addOption","propId","__onOptionChange","updateOptions","styleAttr","inputH","firstOpt","firstId","itemCls","elId","titleAttr","inputHld","inputIn","getUnits","getUnit","getMin","getMax","getStep","upUnit","valueProp","unitProp","getSliderEl","inputValueChangedSoft","propertyAdd","propertyRemove","builded","buildProperties","buildProps","extendProperties","checkExtend","propsModel","extendBuilded","withValue","withParentValue","addProperty","moProps","pLen","mProps","isolated","mProp","mPProps","buildP","builtIn","sect","typeNumber","typeColor","typeRadio","typeSelect","typeFile","typeSlider","typeComposite","typeStack","unitsSize","unitsSizeNoPerc","unitsTime","unitsAngle","ss","optsFlex","optsFlexAlign","optsBgSize","optsBgAttach","optsBgRepeat","optsWrap","optsOverflow","optsDir","opstDisplay","optsTransitFn","optsCursor","optsFloat","optsPos","optsTextAlign","optsJustCont","optsAlignCont","optsAlignSelf","optsTransitProp","optsBorderStyle","optsBgPos","optsWeight","optsShadowType","optsFonts","font","fixedFontSizes","fixedLetSpace","requireFlex","__sub","propsToCreate","spread","propToUp","fromRes","iconCaret","clsPfx","getPropertiesEl","renderProperties","objs","evSector","evSectorAdd","evSectorRemove","evSectorUpdate","evProp","evPropAdd","evPropRemove","evPropUp","evLayerSelect","evTarget","propDef","stylesEvents","sectorAdd","sectorRemove","sectorUpdate","Sector","__clearStateTarget","upProps","__upProps","trgCustom","stateTarget","__getStateTarget","addSector","getSector","_logNoSector","getSectors","removeSector","sectorId","removeProperty","lastTarget","lastTargetParents","getParentRules","getSelectedParents","targetState","getBuiltIn","getBuiltInAll","addBuiltIn","smConf","useClasses","deviceW","cssGen","cmpRules","tagNameRules","invisibleAndOtherRules","rulesBySelectors","rSels","rSel","rulesByTagName","createType","SectView","parentStyles","__upProp","sectorVisible","hasVal","isStack","isComposite","canUpdate","propStack","propComp","parentItem","deps","storableDeps","Window","ar","logs","warning","__skip","defaultRunning","dragMode","toLog","attrsOrig","pageManager","constr","loadModule","loadStorableModule","updateChanges","_checkReady","listenLog","eventFrom","eventTo","editing","clipboard","previousModel","storables","modules","toLoad","loadOnStart","headless","Storage","loadData","_storageTimeout","EditorModel","stm","getDirtyCount","updateItr","onbeforeunload","InitModule","Mod","handleUpdates","timedInterval","mltSel","multiple","toggleSelected","selColl","selIndex","forceChange","upHovered","getHovered","selectedAll","typeHover","typeSpacing","getJs","avoidProt","avoidProtected","protCss","storeData","clearDirtyCount","loadOptions","editingCmp","destroyAll","grapesjs","logNs","logInfo","initBaseColorPicker","elToAppend","varName","classNames","contEl","shallowCanvasEl","I18n","Keymaps","addComponents","getSelectedToStyle","selectToggle","setDevice","setCustomRte","setCustomParserCss","onReady","getPlugin","plugin","plugins","pluginId","wplg","getPluginById","logPluginWarn","plg","agent","isIE","DOMImplementation","createHTMLDocument","implementation","polyfills","usePlugin","pluginResult","initConfig","autorender","pluginsOpts","plgOptions"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/grapes.mjs b/dist/grapes.mjs deleted file mode 100644 index f1ad65b85e..0000000000 --- a/dist/grapes.mjs +++ /dev/null @@ -1,62858 +0,0 @@ -/******/ var __webpack_modules__ = ({ - -/***/ 410: -/***/ ((module, exports, __webpack_require__) => { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! - * Backbone.Undo.js v0.2 - * - * Copyright (c)2013 Oliver Sartun - * Released under the MIT License - * - * Documentation and full license available at - * https://github.com/osartun/Backbone.Undo.js - */ - - -(function (factory) { - if (true) { - // AMD support - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(50), __webpack_require__(316)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -})(function (_, Backbone) { - - var core_slice = Array.prototype.slice; - - /** - * As call is faster than apply, this is a faster version of apply as it uses call. - * - * @param {Function} fn The function to execute - * @param {Object} ctx The context the function should be called in - * @param {Array} args The array of arguments that should be applied to the function - * @return Forwards whatever the called function returns - */ - function apply (fn, ctx, args) { - return args.length <= 4 ? - fn.call(ctx, args[0], args[1], args[2], args[3]) : - fn.apply(ctx, args); - } - - /** - * Uses slice on an array or an array-like object. - * - * @param {Array|Object} arr The array or array-like object. - * @param {Number} [index] The index from where the array should be sliced. Default is 0. - * @return {Array} The sliced array - */ - function slice (arr, index) { - return core_slice.call(arr, index); - } - - /** - * Checks if an object has one or more specific keys. The keys - * don't have to be an owned property. - * You can call this function either this way: - * hasKeys(obj, ["a", "b", "c"]) - * or this way: - * hasKeys(obj, "a", "b", "c") - * - * @param {Object} obj The object to check on - * @param {Array} keys The keys to check for - * @return {Boolean} True, if the object has all those keys - */ - function hasKeys (obj, keys) { - if (obj == null) return false; - if (!_.isArray(keys)) { - keys = slice(arguments, 1); - } - return _.all(keys, function (key) { - return key in obj; - }); - } - - /** - * Returns a number that is unique per call stack. The number gets - * changed after the call stack has been completely processed. - * - * @return {number} MagicFusionIndex - */ - var getMagicFusionIndex = (function () { - // If you add several models to a collection or set several - // attributes on a model all in sequence and yet all for - // example in one function, then several Undo-Actions are - // generated. - // If you want to undo your last action only the last model - // would be removed from the collection or the last set - // attribute would be changed back to its previous value. - // To prevent that we have to figure out a way to combine - // all those actions that happened "at the same time". - // Timestamps aren't exact enough. A complex routine could - // run several milliseconds and in that time produce a lot - // of actions with different timestamps. - // Instead we take advantage of the single-threadedness of - // JavaScript: - - var callstackWasIndexed = false, magicFusionIndex = -1; - function indexCycle() { - magicFusionIndex++; - callstackWasIndexed = true; - _.defer(function () { - // Here comes the magic. With a Timeout of 0 - // milliseconds this function gets called whenever - // the current callstack is completed - callstackWasIndexed = false; - }) - } - return function () { - if (!callstackWasIndexed) { - indexCycle(); - } - return magicFusionIndex; - } - })(); - - /** - * To prevent binding a listener several times to one - * object, we register the objects in an ObjectRegistry - * - * @constructor - */ - function ObjectRegistry () { - // This uses two different ways of storing - // objects: In case the object has a cid - // (which Backbone objects typically have) - // it uses this cid as an index. That way - // the Array's length attribute doesn't - // change and the object isn't an item - // in the array, but an object-property. - // Otherwise it's added to the Array as an - // item. - // That way we can use the fast property- - // lookup and only have to fall back to - // iterating over the array in case - // non-Backbone-objects are registered. - this.registeredObjects = []; - // To return a list of all registered - // objects in the 'get' method we have to - // store the objects that have a cid in - // an additional array. - this.cidIndexes = []; - } - ObjectRegistry.prototype = { - /** - * Returns whether the object is already registered in this ObjectRegistry or not. - * - * @this {ObjectRegistry} - * @param {Object} obj The object to check - * @return {Boolean} True if the object is already registered - */ - isRegistered: function (obj) { - // This is where we get a performance boost - // by using the two different ways of storing - // objects. - return obj && obj.cid ? this.registeredObjects[obj.cid] : _.contains(this.registeredObjects, obj); - }, - /** - * Registers an object in this ObjectRegistry. - * - * @this {ObjectRegistry} - * @param {Object} obj The object to register - * @return {undefined} - */ - register: function (obj) { - if (!this.isRegistered(obj)) { - if (obj && obj.cid) { - this.registeredObjects[obj.cid] = obj; - this.cidIndexes.push(obj.cid); - } else { - this.registeredObjects.push(obj); - } - return true; - } - return false; - }, - /** - * Unregisters an object from this ObjectRegistry. - * - * @this {ObjectRegistry} - * @param {Object} obj The object to unregister - * @return {undefined} - */ - unregister: function (obj) { - if (this.isRegistered(obj)) { - if (obj && obj.cid) { - delete this.registeredObjects[obj.cid]; - this.cidIndexes.splice(_.indexOf(this.cidIndexes, obj.cid), 1); - } else { - var i = _.indexOf(this.registeredObjects, obj); - this.registeredObjects.splice(i, 1); - } - return true; - } - return false; - }, - /** - * Returns an array of all objects that are currently in this ObjectRegistry. - * - * @return {Array} An array of all the objects which are currently in the ObjectRegistry - */ - get: function () { - return (_.map(this.cidIndexes, function (cid) {return this.registeredObjects[cid];}, this)).concat(this.registeredObjects); - } - } - - /** - * Binds or unbinds the "all"-listener for one or more objects. - * - * @param {String} which Either "on" or "off" - * @param {Object[]} objects Array of the objects on which the "all"-listener should be bound / unbound to - * @param {Function} [fn] The function that should be bound / unbound. Optional in case of "off" - * @param {Object} [ctx] The context the function should be called in - * @return {undefined} - */ - function onoff(which, objects, fn, ctx) { - for (var i = 0, l = objects.length, obj; i < l; i++) { - obj = objects[i]; - if (!obj) continue; - if (which === "on") { - if (!ctx.objectRegistry.register(obj)) { - // register returned false, so obj was already registered - continue; - } - } else { - if (!ctx.objectRegistry.unregister(obj)) { - // unregister returned false, so obj wasn't registered - continue; - } - } - if (_.isFunction(obj[which])) { - obj[which]("all", fn, ctx); - } - } - } - - /** - * Calls the undo/redo-function for a specific action. - * - * @param {String} which Either "undo" or "redo" - * @param {Object} action The Action's attributes - * @return {undefined} - */ - function actionUndoRedo (which, action) { - var type = action.type, undoTypes = action.undoTypes, fn = !undoTypes[type] || undoTypes[type][which]; - if (_.isFunction(fn)) { - fn(action.object, action.before, action.after, action.options); - } - } - - /** - * The main undo/redo function. - * - * @param {String} which Either "undo" or "redo" - * @param {UndoManager} manager The UndoManager-instance on which an "undo"/"redo"-Event is triggered afterwards - * @param {UndoStack} stack The UndoStack on which we perform - * @param {Boolean} magic If true, undoes / redoes all actions with the same magicFusionIndex - * @param {Boolean} everything If true, undoes / redoes every action that had been tracked - * @return {undefined} - */ - function managerUndoRedo (which, manager, stack, magic, everything) { - if (stack.isCurrentlyUndoRedoing || - (which === "undo" && stack.pointer === -1) || - (which === "redo" && stack.pointer === stack.length - 1)) { - // We're either currently in an undo- / redo-process or - // we reached the end of the stack - return; - } - stack.isCurrentlyUndoRedoing = true; - var action, actions, isUndo = which === "undo"; - if (everything) { - // Undo / Redo all steps until you reach the stack's beginning / end - actions = isUndo && stack.pointer === stack.length - 1 || // If at the stack's end calling undo - !isUndo && stack.pointer === -1 ? // or at the stack's beginning calling redo - _.clone(stack.models) : // => Take all the models. Otherwise: - core_slice.apply(stack.models, isUndo ? [0, stack.pointer] : [stack.pointer, stack.length - 1]); - } else { - // Undo / Redo only one step - action = stack.at(isUndo ? stack.pointer : stack.pointer + 1); - actions = magic ? stack.where({"magicFusionIndex": action.get("magicFusionIndex")}) : [action]; - } - - stack.pointer += (isUndo ? -1 : 1) * actions.length; - while (action = isUndo ? actions.pop() : actions.shift()) { - // Here we're calling the Action's undo / redo method - action[which](); - } - stack.isCurrentlyUndoRedoing = false; - - manager.trigger(which, manager); - } - - /** - * Checks whether an UndoAction should be created or not. Therefore it checks - * whether a "condition" property is set in the undoTypes-object of the specific - * event type. If not, it returns true. If it's set and a boolean, it returns it. - * If it's a function, it returns its result, converting it into a boolean. - * Otherwise it returns true. - * - * @param {Object} undoTypesType The object within the UndoTypes that holds the function for this event type (i.e. "change") - * @param {Arguments} args The arguments the "condition" function is called with - * @return {Boolean} True, if an UndoAction should be created - */ - function validateUndoActionCreation (undoTypesType, args) { - var condition = undoTypesType.condition, type = typeof condition; - return type === "function" ? !!apply(condition, undoTypesType, args) : - type === "boolean" ? condition : true; - } - - /** - * Adds an Undo-Action to the stack. - * - * @param {UndoStack} stack The undostack the action should be added to. - * @param {String} type The event type (i.e. "change") - * @param {Arguments} args The arguments passed to the undoTypes' "on"-handler - * @param {OwnedUndoTypes} undoTypes The undoTypes-object which has the "on"-handler - * @return {undefined} - */ - function addToStack(stack, type, args, undoTypes) { - if (stack.track && !stack.isCurrentlyUndoRedoing && type in undoTypes && - validateUndoActionCreation(undoTypes[type], args)) { - // An UndoAction should be created - var res = apply(undoTypes[type]["on"], undoTypes[type], args), diff; - if (hasKeys(res, "object", "before", "after")) { - res.type = type; - res.magicFusionIndex = getMagicFusionIndex(); - res.undoTypes = undoTypes; - if (stack.pointer < stack.length - 1) { - // New Actions must always be added to the end of the stack. - // If the pointer is not pointed to the last action in the - // stack, presumably because actions were undone before, then - // all following actions must be discarded - var diff = stack.length - stack.pointer - 1; - while (diff--) { - stack.pop(); - } - } - stack.pointer = stack.length; - stack.add(res); - if (stack.length > stack.maximumStackLength) { - stack.shift(); - stack.pointer--; - } - } - } - } - - - /** - * Predefined UndoTypes object with default handlers for the most common events. - * @type {Object} - */ - var UndoTypes = { - "add": { - "undo": function (collection, ignore, model, options) { - // Undo add = remove - collection.remove(model, options); - }, - "redo": function (collection, ignore, model, options) { - // Redo add = add - if (options.index) { - options.at = options.index; - } - collection.add(model, options); - }, - "on": function (model, collection, options) { - return { - object: collection, - before: undefined, - after: model, - options: _.clone(options) - }; - } - }, - "remove": { - "undo": function (collection, model, ignore, options) { - if ("index" in options) { - options.at = options.index; - } - collection.add(model, options); - }, - "redo": function (collection, model, ignore, options) { - collection.remove(model, options); - }, - "on": function (model, collection, options) { - return { - object: collection, - before: model, - after: undefined, - options: _.clone(options) - }; - } - }, - "change": { - "undo": function (model, before, after, options) { - if (_.isEmpty(before)) { - _.each(_.keys(after), model.unset, model); - } else { - model.set(before); - if (options && options.unsetData && options.unsetData.before && options.unsetData.before.length) { - _.each(options.unsetData.before, model.unset, model); - } - } - }, - "redo": function (model, before, after, options) { - if (_.isEmpty(after)) { - _.each(_.keys(before), model.unset, model); - } else { - model.set(after); - if (options && options.unsetData && options.unsetData.after && options.unsetData.after.length) { - _.each(options.unsetData.after, model.unset, model); - } - } - }, - "on": function (model, options) { - var - afterAttributes = model.changedAttributes(), - keysAfter = _.keys(afterAttributes), - previousAttributes = _.pick(model.previousAttributes(), keysAfter), - keysPrevious = _.keys(previousAttributes), - unsetData = (options || (options = {})).unsetData = { - after: [], - before: [] - }; - - if (keysAfter.length != keysPrevious.length) { - // There are new attributes or old attributes have been unset - if (keysAfter.length > keysPrevious.length) { - // New attributes have been added - _.each(keysAfter, function (val) { - if (!(val in previousAttributes)) { - unsetData.before.push(val); - } - }, this); - } else { - // Old attributes have been unset - _.each(keysPrevious, function (val) { - if (!(val in afterAttributes)) { - unsetData.after.push(val); - } - }) - } - } - return { - object: model, - before: previousAttributes, - after: afterAttributes, - options: _.clone(options) - }; - } - }, - "reset": { - "undo": function (collection, before, after) { - collection.reset(before); - }, - "redo": function (collection, before, after) { - collection.reset(after); - }, - "on": function (collection, options) { - return { - object: collection, - before: options.previousModels, - after: _.clone(collection.models) - }; - } - } - }; - - /** - * Every UndoManager instance has an own undoTypes object - * which is an instance of OwnedUndoTypes. OwnedUndoTypes' - * prototype is the global UndoTypes object. Changes to the - * global UndoTypes object take effect on every instance of - * UndoManager as the object is its prototype. And yet every - * local UndoTypes object can be changed individually. - * - * @constructor - */ - function OwnedUndoTypes () {} - OwnedUndoTypes.prototype = UndoTypes; - - /** - * Adds, changes or removes an undo-type from an UndoTypes-object. - * You can call it this way: - * manipulateUndoType (1, "reset", {"on": function () {}}, undoTypes) - * or this way to perform bulk actions: - * manipulateUndoType (1, {"reset": {"on": function () {}}}, undoTypes) - * In case of removing undo-types you can pass an Array for performing - * bulk actions: - * manipulateUndoType(2, ["reset", "change"], undoTypes) - * - * @param {Number} manipType Indicates the kind of action to execute: 0 for add, 1 for change, 2 for remove - * @param {String|Object|Array} undoType The type of undoType that should be added/changed/removed. Can be an object / array to perform bulk actions - * @param {Object} [fns] Object with the functions to add / change. Is optional in case you passed an object as undoType that contains these functions - * @param {OwnedUndoTypes|UndoTypes} undoTypesInstance The undoTypes object to act on - * @return {undefined} - */ - function manipulateUndoType (manipType, undoType, fns, undoTypesInstance) { - // manipType, passed by the calling function - // 0: add - // 1: change - // 2: remove - if (typeof undoType === "object") { - // bulk action. Iterate over this data. - return _.each(undoType, function (val, key) { - if (manipType === 2) { // remove - // undoType is an array - manipulateUndoType (manipType, val, fns, undoTypesInstance); - } else { - // undoType is an object - manipulateUndoType (manipType, key, val, fns); - } - }) - } - - switch (manipType) { - case 0: // add - if (hasKeys(fns, "undo", "redo", "on") && _.all(_.pick(fns, "undo", "redo", "on"), _.isFunction)) { - undoTypesInstance[undoType] = fns; - } - break; - case 1: // change - if (undoTypesInstance[undoType] && _.isObject(fns)) { - // undoTypeInstance[undoType] may be a prototype's property - // So, if we did this _.extend(undoTypeInstance[undoType], fns) - // we would extend the object on the prototype which means - // that this change would have a global effect - // Instead we just want to manipulate this instance. That's why - // we're doing this: - undoTypesInstance[undoType] = _.extend({}, undoTypesInstance[undoType], fns); - } - break; - case 2: // remove - delete undoTypesInstance[undoType]; - break; - } - return this; - } - - /** - * Instantiating "Action" creates the UndoActions that - * are collected in an UndoStack. It holds all relevant - * data to undo / redo an action and has an undo / redo - * method. - */ - var Action = Backbone.Model.extend({ - defaults: { - type: null, // "add", "change", "reset", etc. - object: null, // The object on which the action occurred - before: null, // The previous values which were changed with this action - after: null, // The values after this action - magicFusionIndex: null // The magicFusionIndex helps to combine - // all actions that occurred "at the same time" to undo/redo them altogether - }, - /** - * Undoes this action. - * @param {OwnedUndoTypes|UndoTypes} undoTypes The undoTypes object which contains the "undo"-handler that should be used - * @return {undefined} - */ - undo: function (undoTypes) { - actionUndoRedo("undo", this.attributes); - }, - /** - * Redoes this action. - * @param {OwnedUndoTypes|UndoTypes} undoTypes The undoTypes object which contains the "redo"-handler that should be used - * @return {undefined} - */ - redo: function (undoTypes) { - actionUndoRedo("redo", this.attributes); - } - }), - /** - * An UndoStack is a collection of UndoActions in - * chronological order. - */ - UndoStack = Backbone.Collection.extend({ - model: Action, - pointer: -1, // The pointer indicates the index where we are located within the stack. We start at -1 - track: false, - isCurrentlyUndoRedoing: false, - maximumStackLength: Infinity, - setMaxLength: function (val) { - this.maximumStackLength = val; - } - }), - /** - * An instance of UndoManager can keep track of - * changes to objects and helps to undo them. - */ - UndoManager = Backbone.Model.extend({ - defaults: { - maximumStackLength: Infinity, - track: false - }, - /** - * The constructor function. - * @param {attr} [attr] Object with parameters. The available parameters are: - * - maximumStackLength {number} Set the undo-stack's maximum size - * - track {boolean} Start tracking changes right away - * @return {undefined} - */ - initialize: function (attr) { - this.stack = new UndoStack; - this.objectRegistry = new ObjectRegistry(); - this.undoTypes = new OwnedUndoTypes(); - - // sync the maximumStackLength attribute with our stack - this.stack.setMaxLength(this.get("maximumStackLength")); - this.on("change:maximumStackLength", function (model, value) { - this.stack.setMaxLength(value); - }, this); - - // Start tracking, if attr.track == true - if (attr && attr.track) { - this.startTracking(); - } - - // Register objects passed in the "register" attribute - if (attr && attr.register) { - if (_.isArray(attr.register) || _.isArguments(attr.register)) { - apply(this.register, this, attr.register); - } else { - this.register(attr.register); - } - } - }, - /** - * Starts tracking. Changes of registered objects won't be processed until you've called this function - * @return {undefined} - */ - startTracking: function () { - this.set("track", true); - this.stack.track = true; - }, - /** - * Stops tracking. Afterwards changes of registered objects won't be processed. - * @return {undefined} - */ - stopTracking: function () { - this.set("track", false); - this.stack.track = false; - }, - /** - * Return the state of the tracking - * @return {boolean} - */ - isTracking: function () { - return this.get("track"); - }, - /** - * This is the "all"-handler which is bound to registered - * objects. It creates an UndoAction from the event and adds - * it to the stack. - * - * @param {String} type The event type - * @return {undefined} - */ - _addToStack: function (type) { - addToStack(this.stack, type, slice(arguments, 1), this.undoTypes); - }, - /** - * Registers one or more objects to track their changes. - * @param {...Object} obj The object or objects of which changes should be tracked - * @return {undefined} - */ - register: function () { - onoff("on", arguments, this._addToStack, this); - }, - /** - * Unregisters one or more objects. - * @param {...Object} obj The object or objects of which changes shouldn't be tracked any longer - * @return {undefined} - */ - unregister: function () { - onoff("off", arguments, this._addToStack, this); - }, - /** - * Unregisters all previously registered objects. - * @return {undefined} - */ - unregisterAll: function () { - apply(this.unregister, this, this.objectRegistry.get()); - }, - /** - * Undoes the last action or the last set of actions in case 'magic' is true. - * @param {Boolean} [magic] If true, all actions that happened basically at the same time are undone together - * @return {undefined} - */ - undo: function (magic) { - managerUndoRedo("undo", this, this.stack, magic); - }, - - /** - * Undoes all actions ever tracked by the undo manager - * @return {undefined} - */ - undoAll: function () { - managerUndoRedo("undo", this, this.stack, false, true); - }, - - /** - * Redoes a previously undone action or a set of actions. - * @param {Boolean} [magic] If true, all actions that happened basically at the same time are redone together - * @return {undefined} - */ - redo: function (magic) { - managerUndoRedo("redo", this, this.stack, magic); - }, - - /** - * Redoes all actions ever tracked by the undo manager - * @return {undefined} - */ - redoAll: function () { - managerUndoRedo("redo", this, this.stack, false, true); - }, - /** - * Checks if there's an action in the stack that can be undone / redone - * @param {String} type Either "undo" or "redo" - * @return {Boolean} True if there is a set of actions which can be undone / redone - */ - isAvailable: function (type) { - var s = this.stack, l = s.length; - - switch (type) { - case "undo": return l > 0 && s.pointer > -1; - case "redo": return l > 0 && s.pointer < l - 1; - default: return false; - } - }, - /** - * Sets the stack-reference to the stack of another undoManager. - * @param {UndoManager} undoManager The undoManager whose stack-reference is set to this stack - * @return {undefined} - */ - merge: function (undoManager) { - // This sets the stack-reference to the stack of another - // undoManager so that the stack of this other undoManager - // is used by two different managers. - // This enables to set up a main-undoManager and besides it - // several others for special, exceptional cases (by using - // instance-based custom UndoTypes). Models / collections - // which need this special treatment are only registered at - // those special undoManagers. Those special ones are then - // merged into the main-undoManager to write on its stack. - // That way it's easier to manage exceptional cases. - var args = _.isArray(undoManager) ? undoManager : slice(arguments), manager; - while (manager = args.pop()) { - if (manager instanceof UndoManager && - manager.stack instanceof UndoStack) { - // set the stack reference to our stack - manager.stack = this.stack; - } - } - }, - /** - * Add an UndoType to this specific UndoManager-instance. - * @param {String} type The event this UndoType is made for - * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. Must have the properties "undo", "redo" and "on". Can have the property "condition". - * @return {undefined} - */ - addUndoType: function (type, fns) { - manipulateUndoType(0, type, fns, this.undoTypes); - }, - /** - * Overwrite properties of an existing UndoType for this specific UndoManager-instance. - * @param {String} type The event the UndoType is made for - * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. It extends the existing object. - * @return {undefined} - */ - changeUndoType: function (type, fns) { - manipulateUndoType(1, type, fns, this.undoTypes); - }, - /** - * Remove one or more UndoTypes of this specific UndoManager-instance to fall back to the global UndoTypes. - * @param {String|Array} type The event the UndoType that should be removed is made for. You can also pass an array of events. - * @return {undefined} - */ - removeUndoType: function (type) { - manipulateUndoType(2, type, undefined, this.undoTypes); - }, - - /** - * Removes all actions from the stack. - * @return {undefined} - */ - clear: function() { - this.stack.reset(); - this.stack.pointer = -1; - } - }); - - _.extend(UndoManager, { - /** - * Change the UndoManager's default attributes - * @param {Object} defaultAttributes An object with the new default values. - * @return {undefined} - */ - defaults: function (defaultAttributes) { - _.extend(UndoManager.prototype.defaults, defaultAttributes); - }, - /** - * Add an UndoType to the global UndoTypes-object. - * @param {String} type The event this UndoType is made for - * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. Must have the properties "undo", "redo" and "on". Can have the property "condition". - * @return {undefined} - */ - "addUndoType": function (type, fns) { - manipulateUndoType(0, type, fns, UndoTypes); - }, - /** - * Overwrite properties of an existing UndoType in the global UndoTypes-object. - * @param {String} type The event the UndoType is made for - * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. It extends the existing object. - * @return {undefined} - */ - "changeUndoType": function (type, fns) { - manipulateUndoType(1, type, fns, UndoTypes) - }, - /** - * Remove one or more UndoTypes of this specific UndoManager-instance to fall back to the global UndoTypes. - * @param {String|Array} type The event the UndoType that should be removed is made for. You can also pass an array of events. - * @return {undefined} - */ - "removeUndoType": function (type) { - manipulateUndoType(2, type, undefined, UndoTypes); - } - }) - - return Backbone.UndoManager = UndoManager; - -}); - - -/***/ }), - -/***/ 316: -/***/ ((module, exports, __webpack_require__) => { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Backbone.js 1.4.1 - -// (c) 2010-2022 Jeremy Ashkenas and DocumentCloud -// Backbone may be freely distributed under the MIT license. -// For all details and documentation: -// http://backbonejs.org - -(function(factory) { - - // Establish the root object, `window` (`self`) in the browser, or `global` on the server. - // We use `self` instead of `window` for `WebWorker` support. - var root = typeof self == 'object' && self.self === self && self || - typeof __webpack_require__.g == 'object' && __webpack_require__.g.global === __webpack_require__.g && __webpack_require__.g; - - // Set up Backbone appropriately for the environment. Start with AMD. - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(50), __webpack_require__(895), exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function(_, $, exports) { - // Export global even in AMD case in case this script is loaded with - // others that may still expect a global Backbone. - root.Backbone = factory(root, exports, _, $); - }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - - // Next for Node.js or CommonJS. jQuery may not be needed as a module. - } else { var _, $; } - -})(function(root, Backbone, _, $) { - - // Initial Setup - // ------------- - - // Save the previous value of the `Backbone` variable, so that it can be - // restored later on, if `noConflict` is used. - var previousBackbone = root.Backbone; - - // Create a local reference to a common array method we'll want to use later. - var slice = Array.prototype.slice; - - // Current version of the library. Keep in sync with `package.json`. - Backbone.VERSION = '1.4.1'; - - // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns - // the `$` variable. - Backbone.$ = $; - - // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable - // to its previous owner. Returns a reference to this Backbone object. - Backbone.noConflict = function() { - root.Backbone = previousBackbone; - return this; - }; - - // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option - // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and - // set a `X-Http-Method-Override` header. - Backbone.emulateHTTP = false; - - // Turn on `emulateJSON` to support legacy servers that can't deal with direct - // `application/json` requests ... this will encode the body as - // `application/x-www-form-urlencoded` instead and will send the model in a - // form param named `model`. - Backbone.emulateJSON = false; - - // Backbone.Events - // --------------- - - // A module that can be mixed in to *any object* in order to provide it with - // a custom event channel. You may bind a callback to an event with `on` or - // remove with `off`; `trigger`-ing an event fires all callbacks in - // succession. - // - // var object = {}; - // _.extend(object, Backbone.Events); - // object.on('expand', function(){ alert('expanded'); }); - // object.trigger('expand'); - // - var Events = Backbone.Events = {}; - - // Regular expression used to split event strings. - var eventSplitter = /\s+/; - - // A private global variable to share between listeners and listenees. - var _listening; - - // Iterates over the standard `event, callback` (as well as the fancy multiple - // space-separated events `"change blur", callback` and jQuery-style event - // maps `{event: callback}`). - var eventsApi = function(iteratee, events, name, callback, opts) { - var i = 0, names; - if (name && typeof name === 'object') { - // Handle event maps. - if (callback !== void 0 && 'context' in opts && opts.context === void 0) opts.context = callback; - for (names = _.keys(name); i < names.length ; i++) { - events = eventsApi(iteratee, events, names[i], name[names[i]], opts); - } - } else if (name && eventSplitter.test(name)) { - // Handle space-separated event names by delegating them individually. - for (names = name.split(eventSplitter); i < names.length; i++) { - events = iteratee(events, names[i], callback, opts); - } - } else { - // Finally, standard events. - events = iteratee(events, name, callback, opts); - } - return events; - }; - - // Bind an event to a `callback` function. Passing `"all"` will bind - // the callback to all events fired. - Events.on = function(name, callback, context) { - this._events = eventsApi(onApi, this._events || {}, name, callback, { - context: context, - ctx: this, - listening: _listening - }); - - if (_listening) { - var listeners = this._listeners || (this._listeners = {}); - listeners[_listening.id] = _listening; - // Allow the listening to use a counter, instead of tracking - // callbacks for library interop - _listening.interop = false; - } - - return this; - }; - - // Inversion-of-control versions of `on`. Tell *this* object to listen to - // an event in another object... keeping track of what it's listening to - // for easier unbinding later. - Events.listenTo = function(obj, name, callback) { - if (!obj) return this; - var id = obj._listenId || (obj._listenId = _.uniqueId('l')); - var listeningTo = this._listeningTo || (this._listeningTo = {}); - var listening = _listening = listeningTo[id]; - - // This object is not listening to any other events on `obj` yet. - // Setup the necessary references to track the listening callbacks. - if (!listening) { - this._listenId || (this._listenId = _.uniqueId('l')); - listening = _listening = listeningTo[id] = new Listening(this, obj); - } - - // Bind callbacks on obj. - var error = tryCatchOn(obj, name, callback, this); - _listening = void 0; - - if (error) throw error; - // If the target obj is not Backbone.Events, track events manually. - if (listening.interop) listening.on(name, callback); - - return this; - }; - - // The reducing API that adds a callback to the `events` object. - var onApi = function(events, name, callback, options) { - if (callback) { - var handlers = events[name] || (events[name] = []); - var context = options.context, ctx = options.ctx, listening = options.listening; - if (listening) listening.count++; - - handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening}); - } - return events; - }; - - // An try-catch guarded #on function, to prevent poisoning the global - // `_listening` variable. - var tryCatchOn = function(obj, name, callback, context) { - try { - obj.on(name, callback, context); - } catch (e) { - return e; - } - }; - - // Remove one or many callbacks. If `context` is null, removes all - // callbacks with that function. If `callback` is null, removes all - // callbacks for the event. If `name` is null, removes all bound - // callbacks for all events. - Events.off = function(name, callback, context) { - if (!this._events) return this; - this._events = eventsApi(offApi, this._events, name, callback, { - context: context, - listeners: this._listeners - }); - - return this; - }; - - // Tell this object to stop listening to either specific events ... or - // to every object it's currently listening to. - Events.stopListening = function(obj, name, callback) { - var listeningTo = this._listeningTo; - if (!listeningTo) return this; - - var ids = obj ? [obj._listenId] : _.keys(listeningTo); - for (var i = 0; i < ids.length; i++) { - var listening = listeningTo[ids[i]]; - - // If listening doesn't exist, this object is not currently - // listening to obj. Break out early. - if (!listening) break; - - listening.obj.off(name, callback, this); - if (listening.interop) listening.off(name, callback); - } - if (_.isEmpty(listeningTo)) this._listeningTo = void 0; - - return this; - }; - - // The reducing API that removes a callback from the `events` object. - var offApi = function(events, name, callback, options) { - if (!events) return; - - var context = options.context, listeners = options.listeners; - var i = 0, names; - - // Delete all event listeners and "drop" events. - if (!name && !context && !callback) { - for (names = _.keys(listeners); i < names.length; i++) { - listeners[names[i]].cleanup(); - } - return; - } - - names = name ? [name] : _.keys(events); - for (; i < names.length; i++) { - name = names[i]; - var handlers = events[name]; - - // Bail out if there are no events stored. - if (!handlers) break; - - // Find any remaining events. - var remaining = []; - for (var j = 0; j < handlers.length; j++) { - var handler = handlers[j]; - if ( - callback && callback !== handler.callback && - callback !== handler.callback._callback || - context && context !== handler.context - ) { - remaining.push(handler); - } else { - var listening = handler.listening; - if (listening) listening.off(name, callback); - } - } - - // Replace events if there are any remaining. Otherwise, clean up. - if (remaining.length) { - events[name] = remaining; - } else { - delete events[name]; - } - } - - return events; - }; - - // Bind an event to only be triggered a single time. After the first time - // the callback is invoked, its listener will be removed. If multiple events - // are passed in using the space-separated syntax, the handler will fire - // once for each event, not once for a combination of all events. - Events.once = function(name, callback, context) { - // Map the event into a `{event: once}` object. - var events = eventsApi(onceMap, {}, name, callback, this.off.bind(this)); - if (typeof name === 'string' && context == null) callback = void 0; - return this.on(events, callback, context); - }; - - // Inversion-of-control versions of `once`. - Events.listenToOnce = function(obj, name, callback) { - // Map the event into a `{event: once}` object. - var events = eventsApi(onceMap, {}, name, callback, this.stopListening.bind(this, obj)); - return this.listenTo(obj, events); - }; - - // Reduces the event callbacks into a map of `{event: onceWrapper}`. - // `offer` unbinds the `onceWrapper` after it has been called. - var onceMap = function(map, name, callback, offer) { - if (callback) { - var once = map[name] = _.once(function() { - offer(name, once); - callback.apply(this, arguments); - }); - once._callback = callback; - } - return map; - }; - - // Trigger one or many events, firing all bound callbacks. Callbacks are - // passed the same arguments as `trigger` is, apart from the event name - // (unless you're listening on `"all"`, which will cause your callback to - // receive the true name of the event as the first argument). - Events.trigger = function(name) { - if (!this._events) return this; - - var length = Math.max(0, arguments.length - 1); - var args = Array(length); - for (var i = 0; i < length; i++) args[i] = arguments[i + 1]; - - eventsApi(triggerApi, this._events, name, void 0, args); - return this; - }; - - // Handles triggering the appropriate event callbacks. - var triggerApi = function(objEvents, name, callback, args) { - if (objEvents) { - var events = objEvents[name]; - var allEvents = objEvents.all; - if (events && allEvents) allEvents = allEvents.slice(); - if (events) triggerEvents(events, args); - if (allEvents) triggerEvents(allEvents, [name].concat(args)); - } - return objEvents; - }; - - // A difficult-to-believe, but optimized internal dispatch function for - // triggering events. Tries to keep the usual cases speedy (most internal - // Backbone events have 3 arguments). - var triggerEvents = function(events, args) { - var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2]; - switch (args.length) { - case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return; - case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return; - case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return; - case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return; - default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return; - } - }; - - // A listening class that tracks and cleans up memory bindings - // when all callbacks have been offed. - var Listening = function(listener, obj) { - this.id = listener._listenId; - this.listener = listener; - this.obj = obj; - this.interop = true; - this.count = 0; - this._events = void 0; - }; - - Listening.prototype.on = Events.on; - - // Offs a callback (or several). - // Uses an optimized counter if the listenee uses Backbone.Events. - // Otherwise, falls back to manual tracking to support events - // library interop. - Listening.prototype.off = function(name, callback) { - var cleanup; - if (this.interop) { - this._events = eventsApi(offApi, this._events, name, callback, { - context: void 0, - listeners: void 0 - }); - cleanup = !this._events; - } else { - this.count--; - cleanup = this.count === 0; - } - if (cleanup) this.cleanup(); - }; - - // Cleans up memory bindings between the listener and the listenee. - Listening.prototype.cleanup = function() { - delete this.listener._listeningTo[this.obj._listenId]; - if (!this.interop) delete this.obj._listeners[this.id]; - }; - - // Aliases for backwards compatibility. - Events.bind = Events.on; - Events.unbind = Events.off; - - // Allow the `Backbone` object to serve as a global event bus, for folks who - // want global "pubsub" in a convenient place. - _.extend(Backbone, Events); - - // Backbone.Model - // -------------- - - // Backbone **Models** are the basic data object in the framework -- - // frequently representing a row in a table in a database on your server. - // A discrete chunk of data and a bunch of useful, related methods for - // performing computations and transformations on that data. - - // Create a new model with the specified attributes. A client id (`cid`) - // is automatically generated and assigned for you. - var Model = Backbone.Model = function(attributes, options) { - var attrs = attributes || {}; - options || (options = {}); - this.preinitialize.apply(this, arguments); - this.cid = _.uniqueId(this.cidPrefix); - this.attributes = {}; - if (options.collection) this.collection = options.collection; - if (options.parse) attrs = this.parse(attrs, options) || {}; - var defaults = _.result(this, 'defaults'); - attrs = _.defaults(_.extend({}, defaults, attrs), defaults); - this.set(attrs, options); - this.changed = {}; - this.initialize.apply(this, arguments); - }; - - // Attach all inheritable methods to the Model prototype. - _.extend(Model.prototype, Events, { - - // A hash of attributes whose current and previous value differ. - changed: null, - - // The value returned during the last failed validation. - validationError: null, - - // The default name for the JSON `id` attribute is `"id"`. MongoDB and - // CouchDB users may want to set this to `"_id"`. - idAttribute: 'id', - - // The prefix is used to create the client id which is used to identify models locally. - // You may want to override this if you're experiencing name clashes with model ids. - cidPrefix: 'c', - - // preinitialize is an empty function by default. You can override it with a function - // or object. preinitialize will run before any instantiation logic is run in the Model. - preinitialize: function(){}, - - // Initialize is an empty function by default. Override it with your own - // initialization logic. - initialize: function(){}, - - // Return a copy of the model's `attributes` object. - toJSON: function(options) { - return _.clone(this.attributes); - }, - - // Proxy `Backbone.sync` by default -- but override this if you need - // custom syncing semantics for *this* particular model. - sync: function() { - return Backbone.sync.apply(this, arguments); - }, - - // Get the value of an attribute. - get: function(attr) { - return this.attributes[attr]; - }, - - // Get the HTML-escaped value of an attribute. - escape: function(attr) { - return _.escape(this.get(attr)); - }, - - // Returns `true` if the attribute contains a value that is not null - // or undefined. - has: function(attr) { - return this.get(attr) != null; - }, - - // Special-cased proxy to underscore's `_.matches` method. - matches: function(attrs) { - return !!_.iteratee(attrs, this)(this.attributes); - }, - - // Set a hash of model attributes on the object, firing `"change"`. This is - // the core primitive operation of a model, updating the data and notifying - // anyone who needs to know about the change in state. The heart of the beast. - set: function(key, val, options) { - if (key == null) return this; - - // Handle both `"key", value` and `{key: value}` -style arguments. - var attrs; - if (typeof key === 'object') { - attrs = key; - options = val; - } else { - (attrs = {})[key] = val; - } - - options || (options = {}); - - // Run validation. - if (!this._validate(attrs, options)) return false; - - // Extract attributes and options. - var unset = options.unset; - var silent = options.silent; - var changes = []; - var changing = this._changing; - this._changing = true; - - if (!changing) { - this._previousAttributes = _.clone(this.attributes); - this.changed = {}; - } - - var current = this.attributes; - var changed = this.changed; - var prev = this._previousAttributes; - - // For each `set` attribute, update or delete the current value. - for (var attr in attrs) { - val = attrs[attr]; - if (!_.isEqual(current[attr], val)) changes.push(attr); - if (!_.isEqual(prev[attr], val)) { - changed[attr] = val; - } else { - delete changed[attr]; - } - unset ? delete current[attr] : current[attr] = val; - } - - // Update the `id`. - if (this.idAttribute in attrs) { - var prevId = this.id; - this.id = this.get(this.idAttribute); - this.trigger('changeId', this, prevId, options); - } - - // Trigger all relevant attribute changes. - if (!silent) { - if (changes.length) this._pending = options; - for (var i = 0; i < changes.length; i++) { - this.trigger('change:' + changes[i], this, current[changes[i]], options); - } - } - - // You might be wondering why there's a `while` loop here. Changes can - // be recursively nested within `"change"` events. - if (changing) return this; - if (!silent) { - while (this._pending) { - options = this._pending; - this._pending = false; - this.trigger('change', this, options); - } - } - this._pending = false; - this._changing = false; - return this; - }, - - // Remove an attribute from the model, firing `"change"`. `unset` is a noop - // if the attribute doesn't exist. - unset: function(attr, options) { - return this.set(attr, void 0, _.extend({}, options, {unset: true})); - }, - - // Clear all attributes on the model, firing `"change"`. - clear: function(options) { - var attrs = {}; - for (var key in this.attributes) attrs[key] = void 0; - return this.set(attrs, _.extend({}, options, {unset: true})); - }, - - // Determine if the model has changed since the last `"change"` event. - // If you specify an attribute name, determine if that attribute has changed. - hasChanged: function(attr) { - if (attr == null) return !_.isEmpty(this.changed); - return _.has(this.changed, attr); - }, - - // Return an object containing all the attributes that have changed, or - // false if there are no changed attributes. Useful for determining what - // parts of a view need to be updated and/or what attributes need to be - // persisted to the server. Unset attributes will be set to undefined. - // You can also pass an attributes object to diff against the model, - // determining if there *would be* a change. - changedAttributes: function(diff) { - if (!diff) return this.hasChanged() ? _.clone(this.changed) : false; - var old = this._changing ? this._previousAttributes : this.attributes; - var changed = {}; - var hasChanged; - for (var attr in diff) { - var val = diff[attr]; - if (_.isEqual(old[attr], val)) continue; - changed[attr] = val; - hasChanged = true; - } - return hasChanged ? changed : false; - }, - - // Get the previous value of an attribute, recorded at the time the last - // `"change"` event was fired. - previous: function(attr) { - if (attr == null || !this._previousAttributes) return null; - return this._previousAttributes[attr]; - }, - - // Get all of the attributes of the model at the time of the previous - // `"change"` event. - previousAttributes: function() { - return _.clone(this._previousAttributes); - }, - - // Fetch the model from the server, merging the response with the model's - // local attributes. Any changed attributes will trigger a "change" event. - fetch: function(options) { - options = _.extend({parse: true}, options); - var model = this; - var success = options.success; - options.success = function(resp) { - var serverAttrs = options.parse ? model.parse(resp, options) : resp; - if (!model.set(serverAttrs, options)) return false; - if (success) success.call(options.context, model, resp, options); - model.trigger('sync', model, resp, options); - }; - wrapError(this, options); - return this.sync('read', this, options); - }, - - // Set a hash of model attributes, and sync the model to the server. - // If the server returns an attributes hash that differs, the model's - // state will be `set` again. - save: function(key, val, options) { - // Handle both `"key", value` and `{key: value}` -style arguments. - var attrs; - if (key == null || typeof key === 'object') { - attrs = key; - options = val; - } else { - (attrs = {})[key] = val; - } - - options = _.extend({validate: true, parse: true}, options); - var wait = options.wait; - - // If we're not waiting and attributes exist, save acts as - // `set(attr).save(null, opts)` with validation. Otherwise, check if - // the model will be valid when the attributes, if any, are set. - if (attrs && !wait) { - if (!this.set(attrs, options)) return false; - } else if (!this._validate(attrs, options)) { - return false; - } - - // After a successful server-side save, the client is (optionally) - // updated with the server-side state. - var model = this; - var success = options.success; - var attributes = this.attributes; - options.success = function(resp) { - // Ensure attributes are restored during synchronous saves. - model.attributes = attributes; - var serverAttrs = options.parse ? model.parse(resp, options) : resp; - if (wait) serverAttrs = _.extend({}, attrs, serverAttrs); - if (serverAttrs && !model.set(serverAttrs, options)) return false; - if (success) success.call(options.context, model, resp, options); - model.trigger('sync', model, resp, options); - }; - wrapError(this, options); - - // Set temporary attributes if `{wait: true}` to properly find new ids. - if (attrs && wait) this.attributes = _.extend({}, attributes, attrs); - - var method = this.isNew() ? 'create' : options.patch ? 'patch' : 'update'; - if (method === 'patch' && !options.attrs) options.attrs = attrs; - var xhr = this.sync(method, this, options); - - // Restore attributes. - this.attributes = attributes; - - return xhr; - }, - - // Destroy this model on the server if it was already persisted. - // Optimistically removes the model from its collection, if it has one. - // If `wait: true` is passed, waits for the server to respond before removal. - destroy: function(options) { - options = options ? _.clone(options) : {}; - var model = this; - var success = options.success; - var wait = options.wait; - - var destroy = function() { - model.stopListening(); - model.trigger('destroy', model, model.collection, options); - }; - - options.success = function(resp) { - if (wait) destroy(); - if (success) success.call(options.context, model, resp, options); - if (!model.isNew()) model.trigger('sync', model, resp, options); - }; - - var xhr = false; - if (this.isNew()) { - _.defer(options.success); - } else { - wrapError(this, options); - xhr = this.sync('delete', this, options); - } - if (!wait) destroy(); - return xhr; - }, - - // Default URL for the model's representation on the server -- if you're - // using Backbone's restful methods, override this to change the endpoint - // that will be called. - url: function() { - var base = - _.result(this, 'urlRoot') || - _.result(this.collection, 'url') || - urlError(); - if (this.isNew()) return base; - var id = this.get(this.idAttribute); - return base.replace(/[^\/]$/, '$&/') + encodeURIComponent(id); - }, - - // **parse** converts a response into the hash of attributes to be `set` on - // the model. The default implementation is just to pass the response along. - parse: function(resp, options) { - return resp; - }, - - // Create a new model with identical attributes to this one. - clone: function() { - return new this.constructor(this.attributes); - }, - - // A model is new if it has never been saved to the server, and lacks an id. - isNew: function() { - return !this.has(this.idAttribute); - }, - - // Check if the model is currently in a valid state. - isValid: function(options) { - return this._validate({}, _.extend({}, options, {validate: true})); - }, - - // Run validation against the next complete set of model attributes, - // returning `true` if all is well. Otherwise, fire an `"invalid"` event. - _validate: function(attrs, options) { - if (!options.validate || !this.validate) return true; - attrs = _.extend({}, this.attributes, attrs); - var error = this.validationError = this.validate(attrs, options) || null; - if (!error) return true; - this.trigger('invalid', this, error, _.extend(options, {validationError: error})); - return false; - } - - }); - - // Backbone.Collection - // ------------------- - - // If models tend to represent a single row of data, a Backbone Collection is - // more analogous to a table full of data ... or a small slice or page of that - // table, or a collection of rows that belong together for a particular reason - // -- all of the messages in this particular folder, all of the documents - // belonging to this particular author, and so on. Collections maintain - // indexes of their models, both in order, and for lookup by `id`. - - // Create a new **Collection**, perhaps to contain a specific type of `model`. - // If a `comparator` is specified, the Collection will maintain - // its models in sort order, as they're added and removed. - var Collection = Backbone.Collection = function(models, options) { - options || (options = {}); - this.preinitialize.apply(this, arguments); - if (options.model) this.model = options.model; - if (options.comparator !== void 0) this.comparator = options.comparator; - this._reset(); - this.initialize.apply(this, arguments); - if (models) this.reset(models, _.extend({silent: true}, options)); - }; - - // Default options for `Collection#set`. - var setOptions = {add: true, remove: true, merge: true}; - var addOptions = {add: true, remove: false}; - - // Splices `insert` into `array` at index `at`. - var splice = function(array, insert, at) { - at = Math.min(Math.max(at, 0), array.length); - var tail = Array(array.length - at); - var length = insert.length; - var i; - for (i = 0; i < tail.length; i++) tail[i] = array[i + at]; - for (i = 0; i < length; i++) array[i + at] = insert[i]; - for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i]; - }; - - // Define the Collection's inheritable methods. - _.extend(Collection.prototype, Events, { - - // The default model for a collection is just a **Backbone.Model**. - // This should be overridden in most cases. - model: Model, - - - // preinitialize is an empty function by default. You can override it with a function - // or object. preinitialize will run before any instantiation logic is run in the Collection. - preinitialize: function(){}, - - // Initialize is an empty function by default. Override it with your own - // initialization logic. - initialize: function(){}, - - // The JSON representation of a Collection is an array of the - // models' attributes. - toJSON: function(options) { - return this.map(function(model) { return model.toJSON(options); }); - }, - - // Proxy `Backbone.sync` by default. - sync: function() { - return Backbone.sync.apply(this, arguments); - }, - - // Add a model, or list of models to the set. `models` may be Backbone - // Models or raw JavaScript objects to be converted to Models, or any - // combination of the two. - add: function(models, options) { - return this.set(models, _.extend({merge: false}, options, addOptions)); - }, - - // Remove a model, or a list of models from the set. - remove: function(models, options) { - options = _.extend({}, options); - var singular = !_.isArray(models); - models = singular ? [models] : models.slice(); - var removed = this._removeModels(models, options); - if (!options.silent && removed.length) { - options.changes = {added: [], merged: [], removed: removed}; - this.trigger('update', this, options); - } - return singular ? removed[0] : removed; - }, - - // Update a collection by `set`-ing a new list of models, adding new ones, - // removing models that are no longer present, and merging models that - // already exist in the collection, as necessary. Similar to **Model#set**, - // the core operation for updating the data contained by the collection. - set: function(models, options) { - if (models == null) return; - - options = _.extend({}, setOptions, options); - if (options.parse && !this._isModel(models)) { - models = this.parse(models, options) || []; - } - - var singular = !_.isArray(models); - models = singular ? [models] : models.slice(); - - var at = options.at; - if (at != null) at = +at; - if (at > this.length) at = this.length; - if (at < 0) at += this.length + 1; - - var set = []; - var toAdd = []; - var toMerge = []; - var toRemove = []; - var modelMap = {}; - - var add = options.add; - var merge = options.merge; - var remove = options.remove; - - var sort = false; - var sortable = this.comparator && at == null && options.sort !== false; - var sortAttr = _.isString(this.comparator) ? this.comparator : null; - - // Turn bare objects into model references, and prevent invalid models - // from being added. - var model, i; - for (i = 0; i < models.length; i++) { - model = models[i]; - - // If a duplicate is found, prevent it from being added and - // optionally merge it into the existing model. - var existing = this.get(model); - if (existing) { - if (merge && model !== existing) { - var attrs = this._isModel(model) ? model.attributes : model; - if (options.parse) attrs = existing.parse(attrs, options); - existing.set(attrs, options); - toMerge.push(existing); - if (sortable && !sort) sort = existing.hasChanged(sortAttr); - } - if (!modelMap[existing.cid]) { - modelMap[existing.cid] = true; - set.push(existing); - } - models[i] = existing; - - // If this is a new, valid model, push it to the `toAdd` list. - } else if (add) { - model = models[i] = this._prepareModel(model, options); - if (model) { - toAdd.push(model); - this._addReference(model, options); - modelMap[model.cid] = true; - set.push(model); - } - } - } - - // Remove stale models. - if (remove) { - for (i = 0; i < this.length; i++) { - model = this.models[i]; - if (!modelMap[model.cid]) toRemove.push(model); - } - if (toRemove.length) this._removeModels(toRemove, options); - } - - // See if sorting is needed, update `length` and splice in new models. - var orderChanged = false; - var replace = !sortable && add && remove; - if (set.length && replace) { - orderChanged = this.length !== set.length || _.some(this.models, function(m, index) { - return m !== set[index]; - }); - this.models.length = 0; - splice(this.models, set, 0); - this.length = this.models.length; - } else if (toAdd.length) { - if (sortable) sort = true; - splice(this.models, toAdd, at == null ? this.length : at); - this.length = this.models.length; - } - - // Silently sort the collection if appropriate. - if (sort) this.sort({silent: true}); - - // Unless silenced, it's time to fire all appropriate add/sort/update events. - if (!options.silent) { - for (i = 0; i < toAdd.length; i++) { - if (at != null) options.index = at + i; - model = toAdd[i]; - model.trigger('add', model, this, options); - } - if (sort || orderChanged) this.trigger('sort', this, options); - if (toAdd.length || toRemove.length || toMerge.length) { - options.changes = { - added: toAdd, - removed: toRemove, - merged: toMerge - }; - this.trigger('update', this, options); - } - } - - // Return the added (or merged) model (or models). - return singular ? models[0] : models; - }, - - // When you have more items than you want to add or remove individually, - // you can reset the entire set with a new list of models, without firing - // any granular `add` or `remove` events. Fires `reset` when finished. - // Useful for bulk operations and optimizations. - reset: function(models, options) { - options = options ? _.clone(options) : {}; - for (var i = 0; i < this.models.length; i++) { - this._removeReference(this.models[i], options); - } - options.previousModels = this.models; - this._reset(); - models = this.add(models, _.extend({silent: true}, options)); - if (!options.silent) this.trigger('reset', this, options); - return models; - }, - - // Add a model to the end of the collection. - push: function(model, options) { - return this.add(model, _.extend({at: this.length}, options)); - }, - - // Remove a model from the end of the collection. - pop: function(options) { - var model = this.at(this.length - 1); - return this.remove(model, options); - }, - - // Add a model to the beginning of the collection. - unshift: function(model, options) { - return this.add(model, _.extend({at: 0}, options)); - }, - - // Remove a model from the beginning of the collection. - shift: function(options) { - var model = this.at(0); - return this.remove(model, options); - }, - - // Slice out a sub-array of models from the collection. - slice: function() { - return slice.apply(this.models, arguments); - }, - - // Get a model from the set by id, cid, model object with id or cid - // properties, or an attributes object that is transformed through modelId. - get: function(obj) { - if (obj == null) return void 0; - return this._byId[obj] || - this._byId[this.modelId(this._isModel(obj) ? obj.attributes : obj, obj.idAttribute)] || - obj.cid && this._byId[obj.cid]; - }, - - // Returns `true` if the model is in the collection. - has: function(obj) { - return this.get(obj) != null; - }, - - // Get the model at the given index. - at: function(index) { - if (index < 0) index += this.length; - return this.models[index]; - }, - - // Return models with matching attributes. Useful for simple cases of - // `filter`. - where: function(attrs, first) { - return this[first ? 'find' : 'filter'](attrs); - }, - - // Return the first model with matching attributes. Useful for simple cases - // of `find`. - findWhere: function(attrs) { - return this.where(attrs, true); - }, - - // Force the collection to re-sort itself. You don't need to call this under - // normal circumstances, as the set will maintain sort order as each item - // is added. - sort: function(options) { - var comparator = this.comparator; - if (!comparator) throw new Error('Cannot sort a set without a comparator'); - options || (options = {}); - - var length = comparator.length; - if (_.isFunction(comparator)) comparator = comparator.bind(this); - - // Run sort based on type of `comparator`. - if (length === 1 || _.isString(comparator)) { - this.models = this.sortBy(comparator); - } else { - this.models.sort(comparator); - } - if (!options.silent) this.trigger('sort', this, options); - return this; - }, - - // Pluck an attribute from each model in the collection. - pluck: function(attr) { - return this.map(attr + ''); - }, - - // Fetch the default set of models for this collection, resetting the - // collection when they arrive. If `reset: true` is passed, the response - // data will be passed through the `reset` method instead of `set`. - fetch: function(options) { - options = _.extend({parse: true}, options); - var success = options.success; - var collection = this; - options.success = function(resp) { - var method = options.reset ? 'reset' : 'set'; - collection[method](resp, options); - if (success) success.call(options.context, collection, resp, options); - collection.trigger('sync', collection, resp, options); - }; - wrapError(this, options); - return this.sync('read', this, options); - }, - - // Create a new instance of a model in this collection. Add the model to the - // collection immediately, unless `wait: true` is passed, in which case we - // wait for the server to agree. - create: function(model, options) { - options = options ? _.clone(options) : {}; - var wait = options.wait; - model = this._prepareModel(model, options); - if (!model) return false; - if (!wait) this.add(model, options); - var collection = this; - var success = options.success; - options.success = function(m, resp, callbackOpts) { - if (wait) collection.add(m, callbackOpts); - if (success) success.call(callbackOpts.context, m, resp, callbackOpts); - }; - model.save(null, options); - return model; - }, - - // **parse** converts a response into a list of models to be added to the - // collection. The default implementation is just to pass it through. - parse: function(resp, options) { - return resp; - }, - - // Create a new collection with an identical list of models as this one. - clone: function() { - return new this.constructor(this.models, { - model: this.model, - comparator: this.comparator - }); - }, - - // Define how to uniquely identify models in the collection. - modelId: function(attrs, idAttribute) { - return attrs[idAttribute || this.model.prototype.idAttribute || 'id']; - }, - - // Get an iterator of all models in this collection. - values: function() { - return new CollectionIterator(this, ITERATOR_VALUES); - }, - - // Get an iterator of all model IDs in this collection. - keys: function() { - return new CollectionIterator(this, ITERATOR_KEYS); - }, - - // Get an iterator of all [ID, model] tuples in this collection. - entries: function() { - return new CollectionIterator(this, ITERATOR_KEYSVALUES); - }, - - // Private method to reset all internal state. Called when the collection - // is first initialized or reset. - _reset: function() { - this.length = 0; - this.models = []; - this._byId = {}; - }, - - // Prepare a hash of attributes (or other model) to be added to this - // collection. - _prepareModel: function(attrs, options) { - if (this._isModel(attrs)) { - if (!attrs.collection) attrs.collection = this; - return attrs; - } - options = options ? _.clone(options) : {}; - options.collection = this; - - var model; - if (this.model.prototype) { - model = new this.model(attrs, options); - } else { - // ES class methods didn't have prototype - model = this.model(attrs, options); - } - - if (!model.validationError) return model; - this.trigger('invalid', this, model.validationError, options); - return false; - }, - - // Internal method called by both remove and set. - _removeModels: function(models, options) { - var removed = []; - for (var i = 0; i < models.length; i++) { - var model = this.get(models[i]); - if (!model) continue; - - var index = this.indexOf(model); - this.models.splice(index, 1); - this.length--; - - // Remove references before triggering 'remove' event to prevent an - // infinite loop. #3693 - delete this._byId[model.cid]; - var id = this.modelId(model.attributes, model.idAttribute); - if (id != null) delete this._byId[id]; - - if (!options.silent) { - options.index = index; - model.trigger('remove', model, this, options); - } - - removed.push(model); - this._removeReference(model, options); - } - return removed; - }, - - // Method for checking whether an object should be considered a model for - // the purposes of adding to the collection. - _isModel: function(model) { - return model instanceof Model; - }, - - // Internal method to create a model's ties to a collection. - _addReference: function(model, options) { - this._byId[model.cid] = model; - var id = this.modelId(model.attributes, model.idAttribute); - if (id != null) this._byId[id] = model; - model.on('all', this._onModelEvent, this); - }, - - // Internal method to sever a model's ties to a collection. - _removeReference: function(model, options) { - delete this._byId[model.cid]; - var id = this.modelId(model.attributes, model.idAttribute); - if (id != null) delete this._byId[id]; - if (this === model.collection) delete model.collection; - model.off('all', this._onModelEvent, this); - }, - - // Internal method called every time a model in the set fires an event. - // Sets need to update their indexes when models change ids. All other - // events simply proxy through. "add" and "remove" events that originate - // in other collections are ignored. - _onModelEvent: function(event, model, collection, options) { - if (model) { - if ((event === 'add' || event === 'remove') && collection !== this) return; - if (event === 'destroy') this.remove(model, options); - if (event === 'changeId') { - var prevId = this.modelId(model.previousAttributes(), model.idAttribute); - var id = this.modelId(model.attributes, model.idAttribute); - if (prevId != null) delete this._byId[prevId]; - if (id != null) this._byId[id] = model; - } - } - this.trigger.apply(this, arguments); - } - - }); - - // Defining an @@iterator method implements JavaScript's Iterable protocol. - // In modern ES2015 browsers, this value is found at Symbol.iterator. - /* global Symbol */ - var $$iterator = typeof Symbol === 'function' && Symbol.iterator; - if ($$iterator) { - Collection.prototype[$$iterator] = Collection.prototype.values; - } - - // CollectionIterator - // ------------------ - - // A CollectionIterator implements JavaScript's Iterator protocol, allowing the - // use of `for of` loops in modern browsers and interoperation between - // Backbone.Collection and other JavaScript functions and third-party libraries - // which can operate on Iterables. - var CollectionIterator = function(collection, kind) { - this._collection = collection; - this._kind = kind; - this._index = 0; - }; - - // This "enum" defines the three possible kinds of values which can be emitted - // by a CollectionIterator that correspond to the values(), keys() and entries() - // methods on Collection, respectively. - var ITERATOR_VALUES = 1; - var ITERATOR_KEYS = 2; - var ITERATOR_KEYSVALUES = 3; - - // All Iterators should themselves be Iterable. - if ($$iterator) { - CollectionIterator.prototype[$$iterator] = function() { - return this; - }; - } - - CollectionIterator.prototype.next = function() { - if (this._collection) { - - // Only continue iterating if the iterated collection is long enough. - if (this._index < this._collection.length) { - var model = this._collection.at(this._index); - this._index++; - - // Construct a value depending on what kind of values should be iterated. - var value; - if (this._kind === ITERATOR_VALUES) { - value = model; - } else { - var id = this._collection.modelId(model.attributes, model.idAttribute); - if (this._kind === ITERATOR_KEYS) { - value = id; - } else { // ITERATOR_KEYSVALUES - value = [id, model]; - } - } - return {value: value, done: false}; - } - - // Once exhausted, remove the reference to the collection so future - // calls to the next method always return done. - this._collection = void 0; - } - - return {value: void 0, done: true}; - }; - - // Backbone.View - // ------------- - - // Backbone Views are almost more convention than they are actual code. A View - // is simply a JavaScript object that represents a logical chunk of UI in the - // DOM. This might be a single item, an entire list, a sidebar or panel, or - // even the surrounding frame which wraps your whole app. Defining a chunk of - // UI as a **View** allows you to define your DOM events declaratively, without - // having to worry about render order ... and makes it easy for the view to - // react to specific changes in the state of your models. - - // Creating a Backbone.View creates its initial element outside of the DOM, - // if an existing element is not provided... - var View = Backbone.View = function(options) { - this.cid = _.uniqueId('view'); - this.preinitialize.apply(this, arguments); - _.extend(this, _.pick(options, viewOptions)); - this._ensureElement(); - this.initialize.apply(this, arguments); - }; - - // Cached regex to split keys for `delegate`. - var delegateEventSplitter = /^(\S+)\s*(.*)$/; - - // List of view options to be set as properties. - var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events']; - - // Set up all inheritable **Backbone.View** properties and methods. - _.extend(View.prototype, Events, { - - // The default `tagName` of a View's element is `"div"`. - tagName: 'div', - - // jQuery delegate for element lookup, scoped to DOM elements within the - // current view. This should be preferred to global lookups where possible. - $: function(selector) { - return this.$el.find(selector); - }, - - // preinitialize is an empty function by default. You can override it with a function - // or object. preinitialize will run before any instantiation logic is run in the View - preinitialize: function(){}, - - // Initialize is an empty function by default. Override it with your own - // initialization logic. - initialize: function(){}, - - // **render** is the core function that your view should override, in order - // to populate its element (`this.el`), with the appropriate HTML. The - // convention is for **render** to always return `this`. - render: function() { - return this; - }, - - // Remove this view by taking the element out of the DOM, and removing any - // applicable Backbone.Events listeners. - remove: function() { - this._removeElement(); - this.stopListening(); - return this; - }, - - // Remove this view's element from the document and all event listeners - // attached to it. Exposed for subclasses using an alternative DOM - // manipulation API. - _removeElement: function() { - this.$el.remove(); - }, - - // Change the view's element (`this.el` property) and re-delegate the - // view's events on the new element. - setElement: function(element) { - this.undelegateEvents(); - this._setElement(element); - this.delegateEvents(); - return this; - }, - - // Creates the `this.el` and `this.$el` references for this view using the - // given `el`. `el` can be a CSS selector or an HTML string, a jQuery - // context or an element. Subclasses can override this to utilize an - // alternative DOM manipulation API and are only required to set the - // `this.el` property. - _setElement: function(el) { - this.$el = el instanceof Backbone.$ ? el : Backbone.$(el); - this.el = this.$el[0]; - }, - - // Set callbacks, where `this.events` is a hash of - // - // *{"event selector": "callback"}* - // - // { - // 'mousedown .title': 'edit', - // 'click .button': 'save', - // 'click .open': function(e) { ... } - // } - // - // pairs. Callbacks will be bound to the view, with `this` set properly. - // Uses event delegation for efficiency. - // Omitting the selector binds the event to `this.el`. - delegateEvents: function(events) { - events || (events = _.result(this, 'events')); - if (!events) return this; - this.undelegateEvents(); - for (var key in events) { - var method = events[key]; - if (!_.isFunction(method)) method = this[method]; - if (!method) continue; - var match = key.match(delegateEventSplitter); - this.delegate(match[1], match[2], method.bind(this)); - } - return this; - }, - - // Add a single event listener to the view's element (or a child element - // using `selector`). This only works for delegate-able events: not `focus`, - // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer. - delegate: function(eventName, selector, listener) { - this.$el.on(eventName + '.delegateEvents' + this.cid, selector, listener); - return this; - }, - - // Clears all callbacks previously bound to the view by `delegateEvents`. - // You usually don't need to use this, but may wish to if you have multiple - // Backbone views attached to the same DOM element. - undelegateEvents: function() { - if (this.$el) this.$el.off('.delegateEvents' + this.cid); - return this; - }, - - // A finer-grained `undelegateEvents` for removing a single delegated event. - // `selector` and `listener` are both optional. - undelegate: function(eventName, selector, listener) { - this.$el.off(eventName + '.delegateEvents' + this.cid, selector, listener); - return this; - }, - - // Produces a DOM element to be assigned to your view. Exposed for - // subclasses using an alternative DOM manipulation API. - _createElement: function(tagName) { - return document.createElement(tagName); - }, - - // Ensure that the View has a DOM element to render into. - // If `this.el` is a string, pass it through `$()`, take the first - // matching element, and re-assign it to `el`. Otherwise, create - // an element from the `id`, `className` and `tagName` properties. - _ensureElement: function() { - if (!this.el) { - var attrs = _.extend({}, _.result(this, 'attributes')); - if (this.id) attrs.id = _.result(this, 'id'); - if (this.className) attrs['class'] = _.result(this, 'className'); - this.setElement(this._createElement(_.result(this, 'tagName'))); - this._setAttributes(attrs); - } else { - this.setElement(_.result(this, 'el')); - } - }, - - // Set attributes from a hash on this view's element. Exposed for - // subclasses using an alternative DOM manipulation API. - _setAttributes: function(attributes) { - this.$el.attr(attributes); - } - - }); - - // Proxy Backbone class methods to Underscore functions, wrapping the model's - // `attributes` object or collection's `models` array behind the scenes. - // - // collection.filter(function(model) { return model.get('age') > 10 }); - // collection.each(this.addView); - // - // `Function#apply` can be slow so we use the method's arg count, if we know it. - var addMethod = function(base, length, method, attribute) { - switch (length) { - case 1: return function() { - return base[method](this[attribute]); - }; - case 2: return function(value) { - return base[method](this[attribute], value); - }; - case 3: return function(iteratee, context) { - return base[method](this[attribute], cb(iteratee, this), context); - }; - case 4: return function(iteratee, defaultVal, context) { - return base[method](this[attribute], cb(iteratee, this), defaultVal, context); - }; - default: return function() { - var args = slice.call(arguments); - args.unshift(this[attribute]); - return base[method].apply(base, args); - }; - } - }; - - var addUnderscoreMethods = function(Class, base, methods, attribute) { - _.each(methods, function(length, method) { - if (base[method]) Class.prototype[method] = addMethod(base, length, method, attribute); - }); - }; - - // Support `collection.sortBy('attr')` and `collection.findWhere({id: 1})`. - var cb = function(iteratee, instance) { - if (_.isFunction(iteratee)) return iteratee; - if (_.isObject(iteratee) && !instance._isModel(iteratee)) return modelMatcher(iteratee); - if (_.isString(iteratee)) return function(model) { return model.get(iteratee); }; - return iteratee; - }; - var modelMatcher = function(attrs) { - var matcher = _.matches(attrs); - return function(model) { - return matcher(model.attributes); - }; - }; - - // Underscore methods that we want to implement on the Collection. - // 90% of the core usefulness of Backbone Collections is actually implemented - // right here: - var collectionMethods = {forEach: 3, each: 3, map: 3, collect: 3, reduce: 0, - foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3, - select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3, - contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3, - head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3, - without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3, - isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3, - sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3}; - - - // Underscore methods that we want to implement on the Model, mapped to the - // number of arguments they take. - var modelMethods = {keys: 1, values: 1, pairs: 1, invert: 1, pick: 0, - omit: 0, chain: 1, isEmpty: 1}; - - // Mix in each Underscore method as a proxy to `Collection#models`. - - _.each([ - [Collection, collectionMethods, 'models'], - [Model, modelMethods, 'attributes'] - ], function(config) { - var Base = config[0], - methods = config[1], - attribute = config[2]; - - Base.mixin = function(obj) { - var mappings = _.reduce(_.functions(obj), function(memo, name) { - memo[name] = 0; - return memo; - }, {}); - addUnderscoreMethods(Base, obj, mappings, attribute); - }; - - addUnderscoreMethods(Base, _, methods, attribute); - }); - - // Backbone.sync - // ------------- - - // Override this function to change the manner in which Backbone persists - // models to the server. You will be passed the type of request, and the - // model in question. By default, makes a RESTful Ajax request - // to the model's `url()`. Some possible customizations could be: - // - // * Use `setTimeout` to batch rapid-fire updates into a single request. - // * Send up the models as XML instead of JSON. - // * Persist models via WebSockets instead of Ajax. - // - // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests - // as `POST`, with a `_method` parameter containing the true HTTP method, - // as well as all requests with the body as `application/x-www-form-urlencoded` - // instead of `application/json` with the model in a param named `model`. - // Useful when interfacing with server-side languages like **PHP** that make - // it difficult to read the body of `PUT` requests. - Backbone.sync = function(method, model, options) { - var type = methodMap[method]; - - // Default options, unless specified. - _.defaults(options || (options = {}), { - emulateHTTP: Backbone.emulateHTTP, - emulateJSON: Backbone.emulateJSON - }); - - // Default JSON-request options. - var params = {type: type, dataType: 'json'}; - - // Ensure that we have a URL. - if (!options.url) { - params.url = _.result(model, 'url') || urlError(); - } - - // Ensure that we have the appropriate request data. - if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) { - params.contentType = 'application/json'; - params.data = JSON.stringify(options.attrs || model.toJSON(options)); - } - - // For older servers, emulate JSON by encoding the request into an HTML-form. - if (options.emulateJSON) { - params.contentType = 'application/x-www-form-urlencoded'; - params.data = params.data ? {model: params.data} : {}; - } - - // For older servers, emulate HTTP by mimicking the HTTP method with `_method` - // And an `X-HTTP-Method-Override` header. - if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) { - params.type = 'POST'; - if (options.emulateJSON) params.data._method = type; - var beforeSend = options.beforeSend; - options.beforeSend = function(xhr) { - xhr.setRequestHeader('X-HTTP-Method-Override', type); - if (beforeSend) return beforeSend.apply(this, arguments); - }; - } - - // Don't process data on a non-GET request. - if (params.type !== 'GET' && !options.emulateJSON) { - params.processData = false; - } - - // Pass along `textStatus` and `errorThrown` from jQuery. - var error = options.error; - options.error = function(xhr, textStatus, errorThrown) { - options.textStatus = textStatus; - options.errorThrown = errorThrown; - if (error) error.call(options.context, xhr, textStatus, errorThrown); - }; - - // Make the request, allowing the user to override any Ajax options. - var xhr = options.xhr = Backbone.ajax(_.extend(params, options)); - model.trigger('request', model, xhr, options); - return xhr; - }; - - // Map from CRUD to HTTP for our default `Backbone.sync` implementation. - var methodMap = { - 'create': 'POST', - 'update': 'PUT', - 'patch': 'PATCH', - 'delete': 'DELETE', - 'read': 'GET' - }; - - // Set the default implementation of `Backbone.ajax` to proxy through to `$`. - // Override this if you'd like to use a different library. - Backbone.ajax = function() { - return Backbone.$.ajax.apply(Backbone.$, arguments); - }; - - // Backbone.Router - // --------------- - - // Routers map faux-URLs to actions, and fire events when routes are - // matched. Creating a new one sets its `routes` hash, if not set statically. - var Router = Backbone.Router = function(options) { - options || (options = {}); - this.preinitialize.apply(this, arguments); - if (options.routes) this.routes = options.routes; - this._bindRoutes(); - this.initialize.apply(this, arguments); - }; - - // Cached regular expressions for matching named param parts and splatted - // parts of route strings. - var optionalParam = /\((.*?)\)/g; - var namedParam = /(\(\?)?:\w+/g; - var splatParam = /\*\w+/g; - var escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g; - - // Set up all inheritable **Backbone.Router** properties and methods. - _.extend(Router.prototype, Events, { - - // preinitialize is an empty function by default. You can override it with a function - // or object. preinitialize will run before any instantiation logic is run in the Router. - preinitialize: function(){}, - - // Initialize is an empty function by default. Override it with your own - // initialization logic. - initialize: function(){}, - - // Manually bind a single named route to a callback. For example: - // - // this.route('search/:query/p:num', 'search', function(query, num) { - // ... - // }); - // - route: function(route, name, callback) { - if (!_.isRegExp(route)) route = this._routeToRegExp(route); - if (_.isFunction(name)) { - callback = name; - name = ''; - } - if (!callback) callback = this[name]; - var router = this; - Backbone.history.route(route, function(fragment) { - var args = router._extractParameters(route, fragment); - if (router.execute(callback, args, name) !== false) { - router.trigger.apply(router, ['route:' + name].concat(args)); - router.trigger('route', name, args); - Backbone.history.trigger('route', router, name, args); - } - }); - return this; - }, - - // Execute a route handler with the provided parameters. This is an - // excellent place to do pre-route setup or post-route cleanup. - execute: function(callback, args, name) { - if (callback) callback.apply(this, args); - }, - - // Simple proxy to `Backbone.history` to save a fragment into the history. - navigate: function(fragment, options) { - Backbone.history.navigate(fragment, options); - return this; - }, - - // Bind all defined routes to `Backbone.history`. We have to reverse the - // order of the routes here to support behavior where the most general - // routes can be defined at the bottom of the route map. - _bindRoutes: function() { - if (!this.routes) return; - this.routes = _.result(this, 'routes'); - var route, routes = _.keys(this.routes); - while ((route = routes.pop()) != null) { - this.route(route, this.routes[route]); - } - }, - - // Convert a route string into a regular expression, suitable for matching - // against the current location hash. - _routeToRegExp: function(route) { - route = route.replace(escapeRegExp, '\\$&') - .replace(optionalParam, '(?:$1)?') - .replace(namedParam, function(match, optional) { - return optional ? match : '([^/?]+)'; - }) - .replace(splatParam, '([^?]*?)'); - return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$'); - }, - - // Given a route, and a URL fragment that it matches, return the array of - // extracted decoded parameters. Empty or unmatched parameters will be - // treated as `null` to normalize cross-browser behavior. - _extractParameters: function(route, fragment) { - var params = route.exec(fragment).slice(1); - return _.map(params, function(param, i) { - // Don't decode the search params. - if (i === params.length - 1) return param || null; - return param ? decodeURIComponent(param) : null; - }); - } - - }); - - // Backbone.History - // ---------------- - - // Handles cross-browser history management, based on either - // [pushState](http://diveintohtml5.info/history.html) and real URLs, or - // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange) - // and URL fragments. If the browser supports neither (old IE, natch), - // falls back to polling. - var History = Backbone.History = function() { - this.handlers = []; - this.checkUrl = this.checkUrl.bind(this); - - // Ensure that `History` can be used outside of the browser. - if (typeof window !== 'undefined') { - this.location = window.location; - this.history = window.history; - } - }; - - // Cached regex for stripping a leading hash/slash and trailing space. - var routeStripper = /^[#\/]|\s+$/g; - - // Cached regex for stripping leading and trailing slashes. - var rootStripper = /^\/+|\/+$/g; - - // Cached regex for stripping urls of hash. - var pathStripper = /#.*$/; - - // Has the history handling already been started? - History.started = false; - - // Set up all inheritable **Backbone.History** properties and methods. - _.extend(History.prototype, Events, { - - // The default interval to poll for hash changes, if necessary, is - // twenty times a second. - interval: 50, - - // Are we at the app root? - atRoot: function() { - var path = this.location.pathname.replace(/[^\/]$/, '$&/'); - return path === this.root && !this.getSearch(); - }, - - // Does the pathname match the root? - matchRoot: function() { - var path = this.decodeFragment(this.location.pathname); - var rootPath = path.slice(0, this.root.length - 1) + '/'; - return rootPath === this.root; - }, - - // Unicode characters in `location.pathname` are percent encoded so they're - // decoded for comparison. `%25` should not be decoded since it may be part - // of an encoded parameter. - decodeFragment: function(fragment) { - return decodeURI(fragment.replace(/%25/g, '%2525')); - }, - - // In IE6, the hash fragment and search params are incorrect if the - // fragment contains `?`. - getSearch: function() { - var match = this.location.href.replace(/#.*/, '').match(/\?.+/); - return match ? match[0] : ''; - }, - - // Gets the true hash value. Cannot use location.hash directly due to bug - // in Firefox where location.hash will always be decoded. - getHash: function(window) { - var match = (window || this).location.href.match(/#(.*)$/); - return match ? match[1] : ''; - }, - - // Get the pathname and search params, without the root. - getPath: function() { - var path = this.decodeFragment( - this.location.pathname + this.getSearch() - ).slice(this.root.length - 1); - return path.charAt(0) === '/' ? path.slice(1) : path; - }, - - // Get the cross-browser normalized URL fragment from the path or hash. - getFragment: function(fragment) { - if (fragment == null) { - if (this._usePushState || !this._wantsHashChange) { - fragment = this.getPath(); - } else { - fragment = this.getHash(); - } - } - return fragment.replace(routeStripper, ''); - }, - - // Start the hash change handling, returning `true` if the current URL matches - // an existing route, and `false` otherwise. - start: function(options) { - if (History.started) throw new Error('Backbone.history has already been started'); - History.started = true; - - // Figure out the initial configuration. Do we need an iframe? - // Is pushState desired ... is it available? - this.options = _.extend({root: '/'}, this.options, options); - this.root = this.options.root; - this._wantsHashChange = this.options.hashChange !== false; - this._hasHashChange = 'onhashchange' in window && (document.documentMode === void 0 || document.documentMode > 7); - 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(); - - // Normalize root to always include a leading and trailing slash. - this.root = ('/' + this.root + '/').replace(rootStripper, '/'); - - // Transition from hashChange to pushState or vice versa if both are - // requested. - if (this._wantsHashChange && this._wantsPushState) { - - // If we've started off with a route from a `pushState`-enabled - // browser, but we're currently in a browser that doesn't support it... - if (!this._hasPushState && !this.atRoot()) { - var rootPath = this.root.slice(0, -1) || '/'; - this.location.replace(rootPath + '#' + this.getPath()); - // Return immediately as browser will do redirect to new url - return true; - - // Or if we've started out with a hash-based route, but we're currently - // in a browser where it could be `pushState`-based instead... - } else if (this._hasPushState && this.atRoot()) { - this.navigate(this.getHash(), {replace: true}); - } - - } - - // Proxy an iframe to handle location events if the browser doesn't - // support the `hashchange` event, HTML5 history, or the user wants - // `hashChange` but not `pushState`. - 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 body = document.body; - // Using `appendChild` will throw on IE < 9 if the document is not ready. - var iWindow = body.insertBefore(this.iframe, body.firstChild).contentWindow; - iWindow.document.open(); - iWindow.document.close(); - iWindow.location.hash = '#' + this.fragment; - } - - // Add a cross-platform `addEventListener` shim for older browsers. - var addEventListener = window.addEventListener || function(eventName, listener) { - return attachEvent('on' + eventName, listener); - }; - - // Depending on whether we're using pushState or hashes, and whether - // 'onhashchange' is supported, determine how we check the URL state. - if (this._usePushState) { - addEventListener('popstate', this.checkUrl, false); - } else if (this._useHashChange && !this.iframe) { - addEventListener('hashchange', this.checkUrl, false); - } else if (this._wantsHashChange) { - this._checkUrlInterval = setInterval(this.checkUrl, this.interval); - } - - if (!this.options.silent) return this.loadUrl(); - }, - - // Disable Backbone.history, perhaps temporarily. Not useful in a real app, - // but possibly useful for unit testing Routers. - stop: function() { - // Add a cross-platform `removeEventListener` shim for older browsers. - var removeEventListener = window.removeEventListener || function(eventName, listener) { - return detachEvent('on' + eventName, listener); - }; - - // Remove window listeners. - if (this._usePushState) { - removeEventListener('popstate', this.checkUrl, false); - } else if (this._useHashChange && !this.iframe) { - removeEventListener('hashchange', this.checkUrl, false); - } - - // Clean up the iframe if necessary. - if (this.iframe) { - document.body.removeChild(this.iframe); - this.iframe = null; - } - - // Some environments will throw when clearing an undefined interval. - if (this._checkUrlInterval) clearInterval(this._checkUrlInterval); - History.started = false; - }, - - // Add a route to be tested when the fragment changes. Routes added later - // may override previous routes. - route: function(route, callback) { - this.handlers.unshift({route: route, callback: callback}); - }, - - // Checks the current URL to see if it has changed, and if it has, - // calls `loadUrl`, normalizing across the hidden iframe. - checkUrl: function(e) { - var current = this.getFragment(); - - // If the user pressed the back button, the iframe's hash will have - // changed and we should use that for comparison. - if (current === this.fragment && this.iframe) { - current = this.getHash(this.iframe.contentWindow); - } - - if (current === this.fragment) return false; - if (this.iframe) this.navigate(current); - this.loadUrl(); - }, - - // Attempt to load the current URL fragment. If a route succeeds with a - // match, returns `true`. If no defined routes matches the fragment, - // returns `false`. - loadUrl: function(fragment) { - // If the root doesn't match, no routes can match either. - if (!this.matchRoot()) return false; - fragment = this.fragment = this.getFragment(fragment); - return _.some(this.handlers, function(handler) { - if (handler.route.test(fragment)) { - handler.callback(fragment); - return true; - } - }); - }, - - // Save a fragment into the hash history, or replace the URL state if the - // 'replace' option is passed. You are responsible for properly URL-encoding - // the fragment in advance. - // - // The options object can contain `trigger: true` if you wish to have the - // route callback be fired (not usually desirable), or `replace: true`, if - // you wish to modify the current URL without adding an entry to the history. - navigate: function(fragment, options) { - if (!History.started) return false; - if (!options || options === true) options = {trigger: !!options}; - - // Normalize the fragment. - fragment = this.getFragment(fragment || ''); - - // Don't include a trailing slash on the root. - var rootPath = this.root; - if (fragment === '' || fragment.charAt(0) === '?') { - rootPath = rootPath.slice(0, -1) || '/'; - } - var url = rootPath + fragment; - - // Strip the fragment of the query and hash for matching. - fragment = fragment.replace(pathStripper, ''); - - // Decode for matching. - var decodedFragment = this.decodeFragment(fragment); - - if (this.fragment === decodedFragment) return; - this.fragment = decodedFragment; - - // If pushState is available, we use it to set the fragment as a real URL. - if (this._usePushState) { - this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url); - - // If hash changes haven't been explicitly disabled, update the hash - // fragment to store history. - } else if (this._wantsHashChange) { - this._updateHash(this.location, fragment, options.replace); - if (this.iframe && fragment !== this.getHash(this.iframe.contentWindow)) { - var iWindow = this.iframe.contentWindow; - - // Opening and closing the iframe tricks IE7 and earlier to push a - // history entry on hash-tag change. When replace is true, we don't - // want this. - if (!options.replace) { - iWindow.document.open(); - iWindow.document.close(); - } - - this._updateHash(iWindow.location, fragment, options.replace); - } - - // If you've told us that you explicitly don't want fallback hashchange- - // based history, then `navigate` becomes a page refresh. - } else { - return this.location.assign(url); - } - if (options.trigger) return this.loadUrl(fragment); - }, - - // Update the hash location, either replacing the current entry, or adding - // a new one to the browser history. - _updateHash: function(location, fragment, replace) { - if (replace) { - var href = location.href.replace(/(javascript:|#).*$/, ''); - location.replace(href + '#' + fragment); - } else { - // Some browsers require that `hash` contains a leading #. - location.hash = '#' + fragment; - } - } - - }); - - // Create the default Backbone.history. - Backbone.history = new History; - - // Helpers - // ------- - - // Helper function to correctly set up the prototype chain for subclasses. - // Similar to `goog.inherits`, but uses a hash of prototype properties and - // class properties to be extended. - var extend = function(protoProps, staticProps) { - var parent = this; - var child; - - // The constructor function for the new subclass is either defined by you - // (the "constructor" property in your `extend` definition), or defaulted - // by us to simply call the parent constructor. - if (protoProps && _.has(protoProps, 'constructor')) { - child = protoProps.constructor; - } else { - child = function(){ return parent.apply(this, arguments); }; - } - - // Add static properties to the constructor function, if supplied. - _.extend(child, parent, staticProps); - - // Set the prototype chain to inherit from `parent`, without calling - // `parent`'s constructor function and add the prototype properties. - child.prototype = _.create(parent.prototype, protoProps); - child.prototype.constructor = child; - - // Set a convenience property in case the parent's prototype is needed - // later. - child.__super__ = parent.prototype; - - return child; - }; - - // Set up inheritance for the model, collection, router, view and history. - Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend; - - // Throw an error when a URL is needed, and none is supplied. - var urlError = function() { - throw new Error('A "url" property or function must be specified'); - }; - - // Wrap an optional error callback with a fallback error event. - var wrapError = function(model, options) { - var error = options.error; - options.error = function(resp) { - if (error) error.call(options.context, model, resp, options); - model.trigger('error', model, resp, options); - }; - }; - - return Backbone; -}); - - -/***/ }), - -/***/ 210: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -(function(mod) { - if (true) // CommonJS - mod(__webpack_require__(631)); - else {} -})(function(CodeMirror) { - - CodeMirror.extendMode("css", { - commentStart: "/*", - commentEnd: "*/", - newlineAfterToken: function(_type, content) { - return /^[;{}]$/.test(content); - } - }); - - CodeMirror.extendMode("javascript", { - commentStart: "/*", - commentEnd: "*/", - // FIXME semicolons inside of for - newlineAfterToken: function(_type, content, textAfter, state) { - if (this.jsonMode) { - return /^[\[,{]$/.test(content) || /^}/.test(textAfter); - } else { - if (content == ";" && state.lexical && state.lexical.type == ")") return false; - return /^[;{}]$/.test(content) && !/^;/.test(textAfter); - } - } - }); - - var inlineElements = /^(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)$/; - - CodeMirror.extendMode("xml", { - commentStart: "", - newlineAfterToken: function(type, content, textAfter, state) { - var inline = false; - if (this.configuration == "html") - inline = state.context ? inlineElements.test(state.context.tagName) : false; - return !inline && ((type == "tag" && />$/.test(content) && state.context) || - /^ -1 && endIndex > -1 && endIndex > startIndex) { - // Take string till comment start - selText = selText.substr(0, startIndex) + - // From comment start till comment end - selText.substring(startIndex + curMode.commentStart.length, endIndex) + - // From comment end till string end - selText.substr(endIndex + curMode.commentEnd.length); - } - cm.replaceRange(selText, from, to); - } - }); - }); - - // Applies automatic mode-aware indentation to the specified range - CodeMirror.defineExtension("autoIndentRange", function (from, to) { - var cmInstance = this; - this.operation(function () { - for (var i = from.line; i <= to.line; i++) { - cmInstance.indentLine(i, "smart"); - } - }); - }); - - // Applies automatic formatting to the specified range - CodeMirror.defineExtension("autoFormatRange", function (from, to) { - var cm = this; - var outer = cm.getMode(), text = cm.getRange(from, to).split("\n"); - var state = CodeMirror.copyState(outer, cm.getTokenAt(from).state); - var tabSize = cm.getOption("tabSize"); - - var out = "", lines = 0, atSol = from.ch === 0; - function newline() { - out += "\n"; - atSol = true; - ++lines; - } - - for (var i = 0; i < text.length; ++i) { - var stream = new CodeMirror.StringStream(text[i], tabSize); - while (!stream.eol()) { - var inner = CodeMirror.innerMode(outer, state); - var style = outer.token(stream, state), cur = stream.current(); - stream.start = stream.pos; - if (!atSol || /\S/.test(cur)) { - out += cur; - atSol = false; - } - if (!atSol && inner.mode.newlineAfterToken && - inner.mode.newlineAfterToken(style, cur, stream.string.slice(stream.pos) || text[i+1] || "", inner.state)) - newline(); - } - if (!stream.pos && outer.blankLine) outer.blankLine(state); - if (!atSol && i < text.length - 1) newline(); - } - - cm.operation(function () { - cm.replaceRange(out, from, to); - for (var cur = from.line + 1, end = from.line + lines; cur <= end; ++cur) - cm.indentLine(cur, "smart"); - cm.setSelection(from, cm.getCursor(false)); - }); - }); -}); - - -/***/ }), - -/***/ 631: -/***/ (function(module) { - -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: https://codemirror.net/5/LICENSE - -// This is CodeMirror (https://codemirror.net/5), a code editor -// implemented in JavaScript on top of the browser's DOM. -// -// You can find some technical background for some of the code below -// at http://marijnhaverbeke.nl/blog/#cm-internals . - -(function (global, factory) { - true ? module.exports = factory() : - 0; -}(this, (function () { 'use strict'; - - // Kludges for bugs and behavior differences that can't be feature - // detected are enabled based on userAgent etc sniffing. - var userAgent = navigator.userAgent; - var platform = navigator.platform; - - var gecko = /gecko\/\d/i.test(userAgent); - var ie_upto10 = /MSIE \d/.test(userAgent); - var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent); - var edge = /Edge\/(\d+)/.exec(userAgent); - var ie = ie_upto10 || ie_11up || edge; - var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]); - var webkit = !edge && /WebKit\//.test(userAgent); - var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent); - var chrome = !edge && /Chrome\/(\d+)/.exec(userAgent); - var chrome_version = chrome && +chrome[1]; - var presto = /Opera\//.test(userAgent); - var safari = /Apple Computer/.test(navigator.vendor); - var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent); - var phantom = /PhantomJS/.test(userAgent); - - var ios = safari && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2); - var android = /Android/.test(userAgent); - // This is woefully incomplete. Suggestions for alternative methods welcome. - var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent); - var mac = ios || /Mac/.test(platform); - var chromeOS = /\bCrOS\b/.test(userAgent); - var windows = /win/i.test(platform); - - var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); - if (presto_version) { presto_version = Number(presto_version[1]); } - if (presto_version && presto_version >= 15) { presto = false; webkit = true; } - // Some browsers use the wrong event properties to signal cmd/ctrl on OS X - var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); - var captureRightClick = gecko || (ie && ie_version >= 9); - - function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") } - - var rmClass = function(node, cls) { - var current = node.className; - var match = classTest(cls).exec(current); - if (match) { - var after = current.slice(match.index + match[0].length); - node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); - } - }; - - function removeChildren(e) { - for (var count = e.childNodes.length; count > 0; --count) - { e.removeChild(e.firstChild); } - return e - } - - function removeChildrenAndAdd(parent, e) { - return removeChildren(parent).appendChild(e) - } - - function elt(tag, content, className, style) { - var e = document.createElement(tag); - if (className) { e.className = className; } - if (style) { e.style.cssText = style; } - if (typeof content == "string") { e.appendChild(document.createTextNode(content)); } - else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } } - return e - } - // wrapper for elt, which removes the elt from the accessibility tree - function eltP(tag, content, className, style) { - var e = elt(tag, content, className, style); - e.setAttribute("role", "presentation"); - return e - } - - var range; - if (document.createRange) { range = function(node, start, end, endNode) { - var r = document.createRange(); - r.setEnd(endNode || node, end); - r.setStart(node, start); - return r - }; } - else { range = function(node, start, end) { - var r = document.body.createTextRange(); - try { r.moveToElementText(node.parentNode); } - catch(e) { return r } - r.collapse(true); - r.moveEnd("character", end); - r.moveStart("character", start); - return r - }; } - - function contains(parent, child) { - if (child.nodeType == 3) // Android browser always returns false when child is a textnode - { child = child.parentNode; } - if (parent.contains) - { return parent.contains(child) } - do { - if (child.nodeType == 11) { child = child.host; } - if (child == parent) { return true } - } while (child = child.parentNode) - } - - function activeElt(doc) { - // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. - // IE < 10 will throw when accessed while the page is loading or in an iframe. - // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. - var activeElement; - try { - activeElement = doc.activeElement; - } catch(e) { - activeElement = doc.body || null; - } - while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) - { activeElement = activeElement.shadowRoot.activeElement; } - return activeElement - } - - function addClass(node, cls) { - var current = node.className; - if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls; } - } - function joinClasses(a, b) { - var as = a.split(" "); - for (var i = 0; i < as.length; i++) - { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i]; } } - return b - } - - var selectInput = function(node) { node.select(); }; - if (ios) // Mobile Safari apparently has a bug where select() is broken. - { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; } - else if (ie) // Suppress mysterious IE10 errors - { selectInput = function(node) { try { node.select(); } catch(_e) {} }; } - - function doc(cm) { return cm.display.wrapper.ownerDocument } - - function win(cm) { return doc(cm).defaultView } - - function bind(f) { - var args = Array.prototype.slice.call(arguments, 1); - return function(){return f.apply(null, args)} - } - - function copyObj(obj, target, overwrite) { - if (!target) { target = {}; } - for (var prop in obj) - { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) - { target[prop] = obj[prop]; } } - return target - } - - // Counts the column offset in a string, taking tabs into account. - // Used mostly to find indentation. - function countColumn(string, end, tabSize, startIndex, startValue) { - if (end == null) { - end = string.search(/[^\s\u00a0]/); - if (end == -1) { end = string.length; } - } - for (var i = startIndex || 0, n = startValue || 0;;) { - var nextTab = string.indexOf("\t", i); - if (nextTab < 0 || nextTab >= end) - { return n + (end - i) } - n += nextTab - i; - n += tabSize - (n % tabSize); - i = nextTab + 1; - } - } - - var Delayed = function() { - this.id = null; - this.f = null; - this.time = 0; - this.handler = bind(this.onTimeout, this); - }; - Delayed.prototype.onTimeout = function (self) { - self.id = 0; - if (self.time <= +new Date) { - self.f(); - } else { - setTimeout(self.handler, self.time - +new Date); - } - }; - Delayed.prototype.set = function (ms, f) { - this.f = f; - var time = +new Date + ms; - if (!this.id || time < this.time) { - clearTimeout(this.id); - this.id = setTimeout(this.handler, ms); - this.time = time; - } - }; - - function indexOf(array, elt) { - for (var i = 0; i < array.length; ++i) - { if (array[i] == elt) { return i } } - return -1 - } - - // Number of pixels added to scroller and sizer to hide scrollbar - var scrollerGap = 50; - - // Returned or thrown by various protocols to signal 'I'm not - // handling this'. - var Pass = {toString: function(){return "CodeMirror.Pass"}}; - - // Reused option objects for setSelection & friends - var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"}; - - // The inverse of countColumn -- find the offset that corresponds to - // a particular column. - function findColumn(string, goal, tabSize) { - for (var pos = 0, col = 0;;) { - var nextTab = string.indexOf("\t", pos); - if (nextTab == -1) { nextTab = string.length; } - var skipped = nextTab - pos; - if (nextTab == string.length || col + skipped >= goal) - { return pos + Math.min(skipped, goal - col) } - col += nextTab - pos; - col += tabSize - (col % tabSize); - pos = nextTab + 1; - if (col >= goal) { return pos } - } - } - - var spaceStrs = [""]; - function spaceStr(n) { - while (spaceStrs.length <= n) - { spaceStrs.push(lst(spaceStrs) + " "); } - return spaceStrs[n] - } - - function lst(arr) { return arr[arr.length-1] } - - function map(array, f) { - var out = []; - for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); } - return out - } - - function insertSorted(array, value, score) { - var pos = 0, priority = score(value); - while (pos < array.length && score(array[pos]) <= priority) { pos++; } - array.splice(pos, 0, value); - } - - function nothing() {} - - function createObj(base, props) { - var inst; - if (Object.create) { - inst = Object.create(base); - } else { - nothing.prototype = base; - inst = new nothing(); - } - if (props) { copyObj(props, inst); } - return inst - } - - var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; - function isWordCharBasic(ch) { - return /\w/.test(ch) || ch > "\x80" && - (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)) - } - function isWordChar(ch, helper) { - if (!helper) { return isWordCharBasic(ch) } - if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true } - return helper.test(ch) - } - - function isEmpty(obj) { - for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } } - return true - } - - // Extending unicode characters. A series of a non-extending char + - // any number of extending chars is treated as a single unit as far - // as editing and measuring is concerned. This is not fully correct, - // since some scripts/fonts/browsers also treat other configurations - // of code points as a group. - var extendingChars = /[\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 isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) } - - // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range. - function skipExtendingChars(str, pos, dir) { - while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; } - return pos - } - - // Returns the value from the range [`from`; `to`] that satisfies - // `pred` and is closest to `from`. Assumes that at least `to` - // satisfies `pred`. Supports `from` being greater than `to`. - function findFirst(pred, from, to) { - // At any point we are certain `to` satisfies `pred`, don't know - // whether `from` does. - var dir = from > to ? -1 : 1; - for (;;) { - if (from == to) { return from } - var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF); - if (mid == from) { return pred(mid) ? from : to } - if (pred(mid)) { to = mid; } - else { from = mid + dir; } - } - } - - // BIDI HELPERS - - function iterateBidiSections(order, from, to, f) { - if (!order) { return f(from, to, "ltr", 0) } - var found = false; - for (var i = 0; i < order.length; ++i) { - var part = order[i]; - if (part.from < to && part.to > from || from == to && part.to == from) { - f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i); - found = true; - } - } - if (!found) { f(from, to, "ltr"); } - } - - var bidiOther = null; - function getBidiPartAt(order, ch, sticky) { - var found; - bidiOther = null; - for (var i = 0; i < order.length; ++i) { - var cur = order[i]; - if (cur.from < ch && cur.to > ch) { return i } - if (cur.to == ch) { - if (cur.from != cur.to && sticky == "before") { found = i; } - else { bidiOther = i; } - } - if (cur.from == ch) { - if (cur.from != cur.to && sticky != "before") { found = i; } - else { bidiOther = i; } - } - } - return found != null ? found : bidiOther - } - - // Bidirectional ordering algorithm - // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm - // that this (partially) implements. - - // One-char codes used for character types: - // L (L): Left-to-Right - // R (R): Right-to-Left - // r (AL): Right-to-Left Arabic - // 1 (EN): European Number - // + (ES): European Number Separator - // % (ET): European Number Terminator - // n (AN): Arabic Number - // , (CS): Common Number Separator - // m (NSM): Non-Spacing Mark - // b (BN): Boundary Neutral - // s (B): Paragraph Separator - // t (S): Segment Separator - // w (WS): Whitespace - // N (ON): Other Neutrals - - // Returns null if characters are ordered as they appear - // (left-to-right), or an array of sections ({from, to, level} - // objects) in the order in which they occur visually. - var bidiOrdering = (function() { - // Character types for codepoints 0 to 0xff - var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; - // Character types for codepoints 0x600 to 0x6f9 - var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"; - function charType(code) { - if (code <= 0xf7) { return lowTypes.charAt(code) } - else if (0x590 <= code && code <= 0x5f4) { return "R" } - else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) } - else if (0x6ee <= code && code <= 0x8ac) { return "r" } - else if (0x2000 <= code && code <= 0x200b) { return "w" } - else if (code == 0x200c) { return "b" } - else { return "L" } - } - - var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; - var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; - - function BidiSpan(level, from, to) { - this.level = level; - this.from = from; this.to = to; - } - - return function(str, direction) { - var outerType = direction == "ltr" ? "L" : "R"; - - if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false } - var len = str.length, types = []; - for (var i = 0; i < len; ++i) - { types.push(charType(str.charCodeAt(i))); } - - // W1. Examine each non-spacing mark (NSM) in the level run, and - // change the type of the NSM to the type of the previous - // character. If the NSM is at the start of the level run, it will - // get the type of sor. - for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) { - var type = types[i$1]; - if (type == "m") { types[i$1] = prev; } - else { prev = type; } - } - - // W2. Search backwards from each instance of a European number - // until the first strong type (R, L, AL, or sor) is found. If an - // AL is found, change the type of the European number to Arabic - // number. - // W3. Change all ALs to R. - for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) { - var type$1 = types[i$2]; - if (type$1 == "1" && cur == "r") { types[i$2] = "n"; } - else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R"; } } - } - - // W4. A single European separator between two European numbers - // changes to a European number. A single common separator between - // two numbers of the same type changes to that type. - for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) { - var type$2 = types[i$3]; - if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1"; } - else if (type$2 == "," && prev$1 == types[i$3+1] && - (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1; } - prev$1 = type$2; - } - - // W5. A sequence of European terminators adjacent to European - // numbers changes to all European numbers. - // W6. Otherwise, separators and terminators change to Other - // Neutral. - for (var i$4 = 0; i$4 < len; ++i$4) { - var type$3 = types[i$4]; - if (type$3 == ",") { types[i$4] = "N"; } - else if (type$3 == "%") { - var end = (void 0); - for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {} - var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"; - for (var j = i$4; j < end; ++j) { types[j] = replace; } - i$4 = end - 1; - } - } - - // W7. Search backwards from each instance of a European number - // until the first strong type (R, L, or sor) is found. If an L is - // found, then change the type of the European number to L. - for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) { - var type$4 = types[i$5]; - if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L"; } - else if (isStrong.test(type$4)) { cur$1 = type$4; } - } - - // N1. A sequence of neutrals takes the direction of the - // surrounding strong text if the text on both sides has the same - // direction. European and Arabic numbers act as if they were R in - // terms of their influence on neutrals. Start-of-level-run (sor) - // and end-of-level-run (eor) are used at level run boundaries. - // N2. Any remaining neutrals take the embedding direction. - for (var i$6 = 0; i$6 < len; ++i$6) { - if (isNeutral.test(types[i$6])) { - var end$1 = (void 0); - for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {} - var before = (i$6 ? types[i$6-1] : outerType) == "L"; - var after = (end$1 < len ? types[end$1] : outerType) == "L"; - var replace$1 = before == after ? (before ? "L" : "R") : outerType; - for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; } - i$6 = end$1 - 1; - } - } - - // Here we depart from the documented algorithm, in order to avoid - // building up an actual levels array. Since there are only three - // levels (0, 1, 2) in an implementation that doesn't take - // explicit embedding into account, we can build up the order on - // the fly, without following the level-based algorithm. - var order = [], m; - for (var i$7 = 0; i$7 < len;) { - if (countsAsLeft.test(types[i$7])) { - var start = i$7; - for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} - order.push(new BidiSpan(0, start, i$7)); - } else { - var pos = i$7, at = order.length, isRTL = direction == "rtl" ? 1 : 0; - for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} - for (var j$2 = pos; j$2 < i$7;) { - if (countsAsNum.test(types[j$2])) { - if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; } - var nstart = j$2; - for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} - order.splice(at, 0, new BidiSpan(2, nstart, j$2)); - at += isRTL; - pos = j$2; - } else { ++j$2; } - } - if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); } - } - } - if (direction == "ltr") { - if (order[0].level == 1 && (m = str.match(/^\s+/))) { - order[0].from = m[0].length; - order.unshift(new BidiSpan(0, 0, m[0].length)); - } - if (lst(order).level == 1 && (m = str.match(/\s+$/))) { - lst(order).to -= m[0].length; - order.push(new BidiSpan(0, len - m[0].length, len)); - } - } - - return direction == "rtl" ? order.reverse() : order - } - })(); - - // Get the bidi ordering for the given line (and cache it). Returns - // false for lines that are fully left-to-right, and an array of - // BidiSpan objects otherwise. - function getOrder(line, direction) { - var order = line.order; - if (order == null) { order = line.order = bidiOrdering(line.text, direction); } - return order - } - - // EVENT HANDLING - - // Lightweight event framework. on/off also work on DOM nodes, - // registering native DOM handlers. - - var noHandlers = []; - - var on = function(emitter, type, f) { - if (emitter.addEventListener) { - emitter.addEventListener(type, f, false); - } else if (emitter.attachEvent) { - emitter.attachEvent("on" + type, f); - } else { - var map = emitter._handlers || (emitter._handlers = {}); - map[type] = (map[type] || noHandlers).concat(f); - } - }; - - function getHandlers(emitter, type) { - return emitter._handlers && emitter._handlers[type] || noHandlers - } - - function off(emitter, type, f) { - if (emitter.removeEventListener) { - emitter.removeEventListener(type, f, false); - } else if (emitter.detachEvent) { - emitter.detachEvent("on" + type, f); - } else { - var map = emitter._handlers, arr = map && map[type]; - if (arr) { - var index = indexOf(arr, f); - if (index > -1) - { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); } - } - } - } - - function signal(emitter, type /*, values...*/) { - var handlers = getHandlers(emitter, type); - if (!handlers.length) { return } - var args = Array.prototype.slice.call(arguments, 2); - for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); } - } - - // The DOM events that CodeMirror handles can be overridden by - // registering a (non-DOM) handler on the editor for the event name, - // and preventDefault-ing the event in that handler. - function signalDOMEvent(cm, e, override) { - if (typeof e == "string") - { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; } - signal(cm, override || e.type, cm, e); - return e_defaultPrevented(e) || e.codemirrorIgnore - } - - function signalCursorActivity(cm) { - var arr = cm._handlers && cm._handlers.cursorActivity; - if (!arr) { return } - var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); - for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1) - { set.push(arr[i]); } } - } - - function hasHandler(emitter, type) { - return getHandlers(emitter, type).length > 0 - } - - // Add on and off methods to a constructor's prototype, to make - // registering events on such objects more convenient. - function eventMixin(ctor) { - ctor.prototype.on = function(type, f) {on(this, type, f);}; - ctor.prototype.off = function(type, f) {off(this, type, f);}; - } - - // Due to the fact that we still support jurassic IE versions, some - // compatibility wrappers are needed. - - function e_preventDefault(e) { - if (e.preventDefault) { e.preventDefault(); } - else { e.returnValue = false; } - } - function e_stopPropagation(e) { - if (e.stopPropagation) { e.stopPropagation(); } - else { e.cancelBubble = true; } - } - function e_defaultPrevented(e) { - return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false - } - function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);} - - function e_target(e) {return e.target || e.srcElement} - function e_button(e) { - var b = e.which; - if (b == null) { - if (e.button & 1) { b = 1; } - else if (e.button & 2) { b = 3; } - else if (e.button & 4) { b = 2; } - } - if (mac && e.ctrlKey && b == 1) { b = 3; } - return b - } - - // Detect drag-and-drop - var dragAndDrop = function() { - // There is *some* kind of drag-and-drop support in IE6-8, but I - // couldn't get it to work yet. - if (ie && ie_version < 9) { return false } - var div = elt('div'); - return "draggable" in div || "dragDrop" in div - }(); - - var zwspSupported; - function zeroWidthElement(measure) { - if (zwspSupported == null) { - var test = elt("span", "\u200b"); - removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); - if (measure.firstChild.offsetHeight != 0) - { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); } - } - var node = zwspSupported ? elt("span", "\u200b") : - elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); - node.setAttribute("cm-text", ""); - return node - } - - // Feature-detect IE's crummy client rect reporting for bidi text - var badBidiRects; - function hasBadBidiRects(measure) { - if (badBidiRects != null) { return badBidiRects } - var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); - var r0 = range(txt, 0, 1).getBoundingClientRect(); - var r1 = range(txt, 1, 2).getBoundingClientRect(); - removeChildren(measure); - if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780) - return badBidiRects = (r1.right - r0.right < 3) - } - - // See if "".split is the broken IE version, if so, provide an - // alternative way to split lines. - var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { - var pos = 0, result = [], l = string.length; - while (pos <= l) { - var nl = string.indexOf("\n", pos); - if (nl == -1) { nl = string.length; } - var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); - var rt = line.indexOf("\r"); - if (rt != -1) { - result.push(line.slice(0, rt)); - pos += rt + 1; - } else { - result.push(line); - pos = nl + 1; - } - } - return result - } : function (string) { return string.split(/\r\n?|\n/); }; - - var hasSelection = window.getSelection ? function (te) { - try { return te.selectionStart != te.selectionEnd } - catch(e) { return false } - } : function (te) { - var range; - try {range = te.ownerDocument.selection.createRange();} - catch(e) {} - if (!range || range.parentElement() != te) { return false } - return range.compareEndPoints("StartToEnd", range) != 0 - }; - - var hasCopyEvent = (function () { - var e = elt("div"); - if ("oncopy" in e) { return true } - e.setAttribute("oncopy", "return;"); - return typeof e.oncopy == "function" - })(); - - var badZoomedRects = null; - function hasBadZoomedRects(measure) { - if (badZoomedRects != null) { return badZoomedRects } - var node = removeChildrenAndAdd(measure, elt("span", "x")); - var normal = node.getBoundingClientRect(); - var fromRange = range(node, 0, 1).getBoundingClientRect(); - return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1 - } - - // Known modes, by name and by MIME - var modes = {}, mimeModes = {}; - - // Extra arguments are stored as the mode's dependencies, which is - // used by (legacy) mechanisms like loadmode.js to automatically - // load a mode. (Preferred mechanism is the require/define calls.) - function defineMode(name, mode) { - if (arguments.length > 2) - { mode.dependencies = Array.prototype.slice.call(arguments, 2); } - modes[name] = mode; - } - - function defineMIME(mime, spec) { - mimeModes[mime] = spec; - } - - // Given a MIME type, a {name, ...options} config object, or a name - // string, return a mode config object. - function resolveMode(spec) { - if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { - spec = mimeModes[spec]; - } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { - var found = mimeModes[spec.name]; - if (typeof found == "string") { found = {name: found}; } - spec = createObj(found, spec); - spec.name = found.name; - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { - return resolveMode("application/xml") - } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { - return resolveMode("application/json") - } - if (typeof spec == "string") { return {name: spec} } - else { return spec || {name: "null"} } - } - - // Given a mode spec (anything that resolveMode accepts), find and - // initialize an actual mode object. - function getMode(options, spec) { - spec = resolveMode(spec); - var mfactory = modes[spec.name]; - if (!mfactory) { return getMode(options, "text/plain") } - var modeObj = mfactory(options, spec); - if (modeExtensions.hasOwnProperty(spec.name)) { - var exts = modeExtensions[spec.name]; - for (var prop in exts) { - if (!exts.hasOwnProperty(prop)) { continue } - if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop]; } - modeObj[prop] = exts[prop]; - } - } - modeObj.name = spec.name; - if (spec.helperType) { modeObj.helperType = spec.helperType; } - if (spec.modeProps) { for (var prop$1 in spec.modeProps) - { modeObj[prop$1] = spec.modeProps[prop$1]; } } - - return modeObj - } - - // This can be used to attach properties to mode objects from - // outside the actual mode definition. - var modeExtensions = {}; - function extendMode(mode, properties) { - var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); - copyObj(properties, exts); - } - - function copyState(mode, state) { - if (state === true) { return state } - if (mode.copyState) { return mode.copyState(state) } - var nstate = {}; - for (var n in state) { - var val = state[n]; - if (val instanceof Array) { val = val.concat([]); } - nstate[n] = val; - } - return nstate - } - - // Given a mode and a state (for that mode), find the inner mode and - // state at the position that the state refers to. - function innerMode(mode, state) { - var info; - while (mode.innerMode) { - info = mode.innerMode(state); - if (!info || info.mode == mode) { break } - state = info.state; - mode = info.mode; - } - return info || {mode: mode, state: state} - } - - function startState(mode, a1, a2) { - return mode.startState ? mode.startState(a1, a2) : true - } - - // STRING STREAM - - // Fed to the mode parsers, provides helper functions to make - // parsers more succinct. - - var StringStream = function(string, tabSize, lineOracle) { - this.pos = this.start = 0; - this.string = string; - this.tabSize = tabSize || 8; - this.lastColumnPos = this.lastColumnValue = 0; - this.lineStart = 0; - this.lineOracle = lineOracle; - }; - - StringStream.prototype.eol = function () {return this.pos >= this.string.length}; - StringStream.prototype.sol = function () {return this.pos == this.lineStart}; - StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined}; - StringStream.prototype.next = function () { - if (this.pos < this.string.length) - { return this.string.charAt(this.pos++) } - }; - StringStream.prototype.eat = function (match) { - var ch = this.string.charAt(this.pos); - var ok; - if (typeof match == "string") { ok = ch == match; } - else { ok = ch && (match.test ? match.test(ch) : match(ch)); } - if (ok) {++this.pos; return ch} - }; - StringStream.prototype.eatWhile = function (match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start - }; - StringStream.prototype.eatSpace = function () { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; } - return this.pos > start - }; - StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;}; - StringStream.prototype.skipTo = function (ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true} - }; - StringStream.prototype.backUp = function (n) {this.pos -= n;}; - StringStream.prototype.column = function () { - if (this.lastColumnPos < this.start) { - this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); - this.lastColumnPos = this.start; - } - return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) - }; - StringStream.prototype.indentation = function () { - return countColumn(this.string, null, this.tabSize) - - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) - }; - StringStream.prototype.match = function (pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }; - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) { this.pos += pattern.length; } - return true - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) { return null } - if (match && consume !== false) { this.pos += match[0].length; } - return match - } - }; - StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)}; - StringStream.prototype.hideFirstChars = function (n, inner) { - this.lineStart += n; - try { return inner() } - finally { this.lineStart -= n; } - }; - StringStream.prototype.lookAhead = function (n) { - var oracle = this.lineOracle; - return oracle && oracle.lookAhead(n) - }; - StringStream.prototype.baseToken = function () { - var oracle = this.lineOracle; - return oracle && oracle.baseToken(this.pos) - }; - - // Find the line object corresponding to the given line number. - function getLine(doc, n) { - n -= doc.first; - if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") } - var chunk = doc; - while (!chunk.lines) { - for (var i = 0;; ++i) { - var child = chunk.children[i], sz = child.chunkSize(); - if (n < sz) { chunk = child; break } - n -= sz; - } - } - return chunk.lines[n] - } - - // Get the part of a document between two positions, as an array of - // strings. - function getBetween(doc, start, end) { - var out = [], n = start.line; - doc.iter(start.line, end.line + 1, function (line) { - var text = line.text; - if (n == end.line) { text = text.slice(0, end.ch); } - if (n == start.line) { text = text.slice(start.ch); } - out.push(text); - ++n; - }); - return out - } - // Get the lines between from and to, as array of strings. - function getLines(doc, from, to) { - var out = []; - doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value - return out - } - - // Update the height of a line, propagating the height change - // upwards to parent nodes. - function updateLineHeight(line, height) { - var diff = height - line.height; - if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } } - } - - // Given a line object, find its line number by walking up through - // its parent links. - function lineNo(line) { - if (line.parent == null) { return null } - var cur = line.parent, no = indexOf(cur.lines, line); - for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { - for (var i = 0;; ++i) { - if (chunk.children[i] == cur) { break } - no += chunk.children[i].chunkSize(); - } - } - return no + cur.first - } - - // Find the line at the given vertical position, using the height - // information in the document tree. - function lineAtHeight(chunk, h) { - var n = chunk.first; - outer: do { - for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { - var child = chunk.children[i$1], ch = child.height; - if (h < ch) { chunk = child; continue outer } - h -= ch; - n += child.chunkSize(); - } - return n - } while (!chunk.lines) - var i = 0; - for (; i < chunk.lines.length; ++i) { - var line = chunk.lines[i], lh = line.height; - if (h < lh) { break } - h -= lh; - } - return n + i - } - - function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size} - - function lineNumberFor(options, i) { - return String(options.lineNumberFormatter(i + options.firstLineNumber)) - } - - // A Pos instance represents a position within the text. - function Pos(line, ch, sticky) { - if ( sticky === void 0 ) sticky = null; - - if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) } - this.line = line; - this.ch = ch; - this.sticky = sticky; - } - - // Compare two positions, return 0 if they are the same, a negative - // number when a is less, and a positive number otherwise. - function cmp(a, b) { return a.line - b.line || a.ch - b.ch } - - function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 } - - function copyPos(x) {return Pos(x.line, x.ch)} - function maxPos(a, b) { return cmp(a, b) < 0 ? b : a } - function minPos(a, b) { return cmp(a, b) < 0 ? a : b } - - // Most of the external API clips given positions to make sure they - // actually exist within the document. - function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))} - function clipPos(doc, pos) { - if (pos.line < doc.first) { return Pos(doc.first, 0) } - var last = doc.first + doc.size - 1; - if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) } - return clipToLen(pos, getLine(doc, pos.line).text.length) - } - function clipToLen(pos, linelen) { - var ch = pos.ch; - if (ch == null || ch > linelen) { return Pos(pos.line, linelen) } - else if (ch < 0) { return Pos(pos.line, 0) } - else { return pos } - } - function clipPosArray(doc, array) { - var out = []; - for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); } - return out - } - - var SavedContext = function(state, lookAhead) { - this.state = state; - this.lookAhead = lookAhead; - }; - - var Context = function(doc, state, line, lookAhead) { - this.state = state; - this.doc = doc; - this.line = line; - this.maxLookAhead = lookAhead || 0; - this.baseTokens = null; - this.baseTokenPos = 1; - }; - - Context.prototype.lookAhead = function (n) { - var line = this.doc.getLine(this.line + n); - if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; } - return line - }; - - Context.prototype.baseToken = function (n) { - if (!this.baseTokens) { return null } - while (this.baseTokens[this.baseTokenPos] <= n) - { this.baseTokenPos += 2; } - var type = this.baseTokens[this.baseTokenPos + 1]; - return {type: type && type.replace(/( |^)overlay .*/, ""), - size: this.baseTokens[this.baseTokenPos] - n} - }; - - Context.prototype.nextLine = function () { - this.line++; - if (this.maxLookAhead > 0) { this.maxLookAhead--; } - }; - - Context.fromSaved = function (doc, saved, line) { - if (saved instanceof SavedContext) - { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) } - else - { return new Context(doc, copyState(doc.mode, saved), line) } - }; - - Context.prototype.save = function (copy) { - var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state; - return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state - }; - - - // Compute a style array (an array starting with a mode generation - // -- for invalidation -- followed by pairs of end positions and - // style strings), which is used to highlight the tokens on the - // line. - function highlightLine(cm, line, context, forceToEnd) { - // A styles array always starts with a number identifying the - // mode/overlays that it is based on (for easy invalidation). - var st = [cm.state.modeGen], lineClasses = {}; - // Compute the base array of styles - runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); }, - lineClasses, forceToEnd); - var state = context.state; - - // Run overlays, adjust style array. - var loop = function ( o ) { - context.baseTokens = st; - var overlay = cm.state.overlays[o], i = 1, at = 0; - context.state = true; - runMode(cm, line.text, overlay.mode, context, function (end, style) { - var start = i; - // Ensure there's a token end at the current position, and that i points at it - while (at < end) { - var i_end = st[i]; - if (i_end > end) - { st.splice(i, 1, end, st[i+1], i_end); } - i += 2; - at = Math.min(end, i_end); - } - if (!style) { return } - if (overlay.opaque) { - st.splice(start, i - start, end, "overlay " + style); - i = start + 2; - } else { - for (; start < i; start += 2) { - var cur = st[start+1]; - st[start+1] = (cur ? cur + " " : "") + "overlay " + style; - } - } - }, lineClasses); - context.state = state; - context.baseTokens = null; - context.baseTokenPos = 1; - }; - - for (var o = 0; o < cm.state.overlays.length; ++o) loop( o ); - - return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null} - } - - function getLineStyles(cm, line, updateFrontier) { - if (!line.styles || line.styles[0] != cm.state.modeGen) { - var context = getContextBefore(cm, lineNo(line)); - var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state); - var result = highlightLine(cm, line, context); - if (resetState) { context.state = resetState; } - line.stateAfter = context.save(!resetState); - line.styles = result.styles; - if (result.classes) { line.styleClasses = result.classes; } - else if (line.styleClasses) { line.styleClasses = null; } - if (updateFrontier === cm.doc.highlightFrontier) - { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); } - } - return line.styles - } - - function getContextBefore(cm, n, precise) { - var doc = cm.doc, display = cm.display; - if (!doc.mode.startState) { return new Context(doc, true, n) } - var start = findStartLine(cm, n, precise); - var saved = start > doc.first && getLine(doc, start - 1).stateAfter; - var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start); - - doc.iter(start, n, function (line) { - processLine(cm, line.text, context); - var pos = context.line; - line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null; - context.nextLine(); - }); - if (precise) { doc.modeFrontier = context.line; } - return context - } - - // Lightweight form of highlight -- proceed over this line and - // update state, but don't save a style array. Used for lines that - // aren't currently visible. - function processLine(cm, text, context, startAt) { - var mode = cm.doc.mode; - var stream = new StringStream(text, cm.options.tabSize, context); - stream.start = stream.pos = startAt || 0; - if (text == "") { callBlankLine(mode, context.state); } - while (!stream.eol()) { - readToken(mode, stream, context.state); - stream.start = stream.pos; - } - } - - function callBlankLine(mode, state) { - if (mode.blankLine) { return mode.blankLine(state) } - if (!mode.innerMode) { return } - var inner = innerMode(mode, state); - if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) } - } - - function readToken(mode, stream, state, inner) { - for (var i = 0; i < 10; i++) { - if (inner) { inner[0] = innerMode(mode, state).mode; } - var style = mode.token(stream, state); - if (stream.pos > stream.start) { return style } - } - throw new Error("Mode " + mode.name + " failed to advance stream.") - } - - var Token = function(stream, type, state) { - this.start = stream.start; this.end = stream.pos; - this.string = stream.current(); - this.type = type || null; - this.state = state; - }; - - // Utility for getTokenAt and getLineTokens - function takeToken(cm, pos, precise, asArray) { - var doc = cm.doc, mode = doc.mode, style; - pos = clipPos(doc, pos); - var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise); - var stream = new StringStream(line.text, cm.options.tabSize, context), tokens; - if (asArray) { tokens = []; } - while ((asArray || stream.pos < pos.ch) && !stream.eol()) { - stream.start = stream.pos; - style = readToken(mode, stream, context.state); - if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); } - } - return asArray ? tokens : new Token(stream, style, context.state) - } - - function extractLineClasses(type, output) { - if (type) { for (;;) { - var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); - if (!lineClass) { break } - type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); - var prop = lineClass[1] ? "bgClass" : "textClass"; - if (output[prop] == null) - { output[prop] = lineClass[2]; } - else if (!(new RegExp("(?:^|\\s)" + lineClass[2] + "(?:$|\\s)")).test(output[prop])) - { output[prop] += " " + lineClass[2]; } - } } - return type - } - - // Run the given mode's parser over a line, calling f for each token. - function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { - var flattenSpans = mode.flattenSpans; - if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; } - var curStart = 0, curStyle = null; - var stream = new StringStream(text, cm.options.tabSize, context), style; - var inner = cm.options.addModeClass && [null]; - if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); } - while (!stream.eol()) { - if (stream.pos > cm.options.maxHighlightLength) { - flattenSpans = false; - if (forceToEnd) { processLine(cm, text, context, stream.pos); } - stream.pos = text.length; - style = null; - } else { - style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses); - } - if (inner) { - var mName = inner[0].name; - if (mName) { style = "m-" + (style ? mName + " " + style : mName); } - } - if (!flattenSpans || curStyle != style) { - while (curStart < stream.start) { - curStart = Math.min(stream.start, curStart + 5000); - f(curStart, curStyle); - } - curStyle = style; - } - stream.start = stream.pos; - } - while (curStart < stream.pos) { - // Webkit seems to refuse to render text nodes longer than 57444 - // characters, and returns inaccurate measurements in nodes - // starting around 5000 chars. - var pos = Math.min(stream.pos, curStart + 5000); - f(pos, curStyle); - curStart = pos; - } - } - - // Finds the line to start with when starting a parse. Tries to - // find a line with a stateAfter, so that it can start with a - // valid state. If that fails, it returns the line with the - // smallest indentation, which tends to need the least context to - // parse correctly. - function findStartLine(cm, n, precise) { - var minindent, minline, doc = cm.doc; - var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); - for (var search = n; search > lim; --search) { - if (search <= doc.first) { return doc.first } - var line = getLine(doc, search - 1), after = line.stateAfter; - if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) - { return search } - var indented = countColumn(line.text, null, cm.options.tabSize); - if (minline == null || minindent > indented) { - minline = search - 1; - minindent = indented; - } - } - return minline - } - - function retreatFrontier(doc, n) { - doc.modeFrontier = Math.min(doc.modeFrontier, n); - if (doc.highlightFrontier < n - 10) { return } - var start = doc.first; - for (var line = n - 1; line > start; line--) { - var saved = getLine(doc, line).stateAfter; - // change is on 3 - // state on line 1 looked ahead 2 -- so saw 3 - // test 1 + 2 < 3 should cover this - if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) { - start = line + 1; - break - } - } - doc.highlightFrontier = Math.min(doc.highlightFrontier, start); - } - - // Optimize some code when these features are not used. - var sawReadOnlySpans = false, sawCollapsedSpans = false; - - function seeReadOnlySpans() { - sawReadOnlySpans = true; - } - - function seeCollapsedSpans() { - sawCollapsedSpans = true; - } - - // TEXTMARKER SPANS - - function MarkedSpan(marker, from, to) { - this.marker = marker; - this.from = from; this.to = to; - } - - // Search an array of spans for a span matching the given marker. - function getMarkedSpanFor(spans, marker) { - if (spans) { for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if (span.marker == marker) { return span } - } } - } - - // Remove a span from an array, returning undefined if no spans are - // left (we don't store arrays for lines without spans). - function removeMarkedSpan(spans, span) { - var r; - for (var i = 0; i < spans.length; ++i) - { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } } - return r - } - - // Add a span to a line. - function addMarkedSpan(line, span, op) { - var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet)); - if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) { - line.markedSpans.push(span); - } else { - line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; - if (inThisOp) { inThisOp.add(line.markedSpans); } - } - span.marker.attachLine(line); - } - - // Used for the algorithm that adjusts markers for a change in the - // document. These functions cut an array of spans at a given - // character position, returning an array of remaining chunks (or - // undefined if nothing remains). - function markedSpansBefore(old, startCh, isInsert) { - var nw; - if (old) { for (var i = 0; i < old.length; ++i) { - var span = old[i], marker = span.marker; - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); - if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh) - ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); - } - } } - return nw - } - function markedSpansAfter(old, endCh, isInsert) { - var nw; - if (old) { for (var i = 0; i < old.length; ++i) { - var span = old[i], marker = span.marker; - var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); - if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { - var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh) - ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, - span.to == null ? null : span.to - endCh)); - } - } } - return nw - } - - // Given a change object, compute the new set of marker spans that - // cover the line in which the change took place. Removes spans - // entirely within the change, reconnects spans belonging to the - // same marker that appear on both sides of the change, and cuts off - // spans partially within the change. Returns an array of span - // arrays with one element for each line in (after) the change. - function stretchSpansOverChange(doc, change) { - if (change.full) { return null } - var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; - var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; - if (!oldFirst && !oldLast) { return null } - - var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; - // Get the spans that 'stick out' on both sides - var first = markedSpansBefore(oldFirst, startCh, isInsert); - var last = markedSpansAfter(oldLast, endCh, isInsert); - - // Next, merge those two ends - var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); - if (first) { - // Fix up .to properties of first - for (var i = 0; i < first.length; ++i) { - var span = first[i]; - if (span.to == null) { - var found = getMarkedSpanFor(last, span.marker); - if (!found) { span.to = startCh; } - else if (sameLine) { span.to = found.to == null ? null : found.to + offset; } - } - } - } - if (last) { - // Fix up .from in last (or move them into first in case of sameLine) - for (var i$1 = 0; i$1 < last.length; ++i$1) { - var span$1 = last[i$1]; - if (span$1.to != null) { span$1.to += offset; } - if (span$1.from == null) { - var found$1 = getMarkedSpanFor(first, span$1.marker); - if (!found$1) { - span$1.from = offset; - if (sameLine) { (first || (first = [])).push(span$1); } - } - } else { - span$1.from += offset; - if (sameLine) { (first || (first = [])).push(span$1); } - } - } - } - // Make sure we didn't create any zero-length spans - if (first) { first = clearEmptySpans(first); } - if (last && last != first) { last = clearEmptySpans(last); } - - var newMarkers = [first]; - if (!sameLine) { - // Fill gap with whole-line-spans - var gap = change.text.length - 2, gapMarkers; - if (gap > 0 && first) - { for (var i$2 = 0; i$2 < first.length; ++i$2) - { if (first[i$2].to == null) - { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } } - for (var i$3 = 0; i$3 < gap; ++i$3) - { newMarkers.push(gapMarkers); } - newMarkers.push(last); - } - return newMarkers - } - - // Remove spans that are empty and don't have a clearWhenEmpty - // option of false. - function clearEmptySpans(spans) { - for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) - { spans.splice(i--, 1); } - } - if (!spans.length) { return null } - return spans - } - - // Used to 'clip' out readOnly ranges when making a change. - function removeReadOnlyRanges(doc, from, to) { - var markers = null; - doc.iter(from.line, to.line + 1, function (line) { - if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { - var mark = line.markedSpans[i].marker; - if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) - { (markers || (markers = [])).push(mark); } - } } - }); - if (!markers) { return null } - var parts = [{from: from, to: to}]; - for (var i = 0; i < markers.length; ++i) { - var mk = markers[i], m = mk.find(0); - for (var j = 0; j < parts.length; ++j) { - var p = parts[j]; - if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue } - var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); - if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) - { newParts.push({from: p.from, to: m.from}); } - if (dto > 0 || !mk.inclusiveRight && !dto) - { newParts.push({from: m.to, to: p.to}); } - parts.splice.apply(parts, newParts); - j += newParts.length - 3; - } - } - return parts - } - - // Connect or disconnect spans from a line. - function detachMarkedSpans(line) { - var spans = line.markedSpans; - if (!spans) { return } - for (var i = 0; i < spans.length; ++i) - { spans[i].marker.detachLine(line); } - line.markedSpans = null; - } - function attachMarkedSpans(line, spans) { - if (!spans) { return } - for (var i = 0; i < spans.length; ++i) - { spans[i].marker.attachLine(line); } - line.markedSpans = spans; - } - - // Helpers used when computing which overlapping collapsed span - // counts as the larger one. - function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 } - function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 } - - // Returns a number indicating which of two overlapping collapsed - // spans is larger (and thus includes the other). Falls back to - // comparing ids when the spans cover exactly the same range. - function compareCollapsedMarkers(a, b) { - var lenDiff = a.lines.length - b.lines.length; - if (lenDiff != 0) { return lenDiff } - var aPos = a.find(), bPos = b.find(); - var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); - if (fromCmp) { return -fromCmp } - var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); - if (toCmp) { return toCmp } - return b.id - a.id - } - - // Find out whether a line ends or starts in a collapsed span. If - // so, return the marker for that span. - function collapsedSpanAtSide(line, start) { - var sps = sawCollapsedSpans && line.markedSpans, found; - if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { - sp = sps[i]; - if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && - (!found || compareCollapsedMarkers(found, sp.marker) < 0)) - { found = sp.marker; } - } } - return found - } - function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) } - function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) } - - function collapsedSpanAround(line, ch) { - var sps = sawCollapsedSpans && line.markedSpans, found; - if (sps) { for (var i = 0; i < sps.length; ++i) { - var sp = sps[i]; - if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) && - (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; } - } } - return found - } - - // Test whether there exists a collapsed span that partially - // overlaps (covers the start or end, but not both) of a new span. - // Such overlap is not allowed. - function conflictingCollapsedRange(doc, lineNo, from, to, marker) { - var line = getLine(doc, lineNo); - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) { for (var i = 0; i < sps.length; ++i) { - var sp = sps[i]; - if (!sp.marker.collapsed) { continue } - var found = sp.marker.find(0); - var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); - var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); - if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue } - if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || - fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) - { return true } - } } - } - - // A visual line is a line as drawn on the screen. Folding, for - // example, can cause multiple logical lines to appear on the same - // visual line. This finds the start of the visual line that the - // given line is part of (usually that is the line itself). - function visualLine(line) { - var merged; - while (merged = collapsedSpanAtStart(line)) - { line = merged.find(-1, true).line; } - return line - } - - function visualLineEnd(line) { - var merged; - while (merged = collapsedSpanAtEnd(line)) - { line = merged.find(1, true).line; } - return line - } - - // Returns an array of logical lines that continue the visual line - // started by the argument, or undefined if there are no such lines. - function visualLineContinued(line) { - var merged, lines; - while (merged = collapsedSpanAtEnd(line)) { - line = merged.find(1, true).line - ;(lines || (lines = [])).push(line); - } - return lines - } - - // Get the line number of the start of the visual line that the - // given line number is part of. - function visualLineNo(doc, lineN) { - var line = getLine(doc, lineN), vis = visualLine(line); - if (line == vis) { return lineN } - return lineNo(vis) - } - - // Get the line number of the start of the next visual line after - // the given line. - function visualLineEndNo(doc, lineN) { - if (lineN > doc.lastLine()) { return lineN } - var line = getLine(doc, lineN), merged; - if (!lineIsHidden(doc, line)) { return lineN } - while (merged = collapsedSpanAtEnd(line)) - { line = merged.find(1, true).line; } - return lineNo(line) + 1 - } - - // Compute whether a line is hidden. Lines count as hidden when they - // are part of a visual line that starts with another line, or when - // they are entirely covered by collapsed, non-widget span. - function lineIsHidden(doc, line) { - var sps = sawCollapsedSpans && line.markedSpans; - if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { - sp = sps[i]; - if (!sp.marker.collapsed) { continue } - if (sp.from == null) { return true } - if (sp.marker.widgetNode) { continue } - if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) - { return true } - } } - } - function lineIsHiddenInner(doc, line, span) { - if (span.to == null) { - var end = span.marker.find(1, true); - return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)) - } - if (span.marker.inclusiveRight && span.to == line.text.length) - { return true } - for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) { - sp = line.markedSpans[i]; - if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && - (sp.to == null || sp.to != span.from) && - (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && - lineIsHiddenInner(doc, line, sp)) { return true } - } - } - - // Find the height above the given line. - function heightAtLine(lineObj) { - lineObj = visualLine(lineObj); - - var h = 0, chunk = lineObj.parent; - for (var i = 0; i < chunk.lines.length; ++i) { - var line = chunk.lines[i]; - if (line == lineObj) { break } - else { h += line.height; } - } - for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { - for (var i$1 = 0; i$1 < p.children.length; ++i$1) { - var cur = p.children[i$1]; - if (cur == chunk) { break } - else { h += cur.height; } - } - } - return h - } - - // Compute the character length of a line, taking into account - // collapsed ranges (see markText) that might hide parts, and join - // other lines onto it. - function lineLength(line) { - if (line.height == 0) { return 0 } - var len = line.text.length, merged, cur = line; - while (merged = collapsedSpanAtStart(cur)) { - var found = merged.find(0, true); - cur = found.from.line; - len += found.from.ch - found.to.ch; - } - cur = line; - while (merged = collapsedSpanAtEnd(cur)) { - var found$1 = merged.find(0, true); - len -= cur.text.length - found$1.from.ch; - cur = found$1.to.line; - len += cur.text.length - found$1.to.ch; - } - return len - } - - // Find the longest line in the document. - function findMaxLine(cm) { - var d = cm.display, doc = cm.doc; - d.maxLine = getLine(doc, doc.first); - d.maxLineLength = lineLength(d.maxLine); - d.maxLineChanged = true; - doc.iter(function (line) { - var len = lineLength(line); - if (len > d.maxLineLength) { - d.maxLineLength = len; - d.maxLine = line; - } - }); - } - - // LINE DATA STRUCTURE - - // Line objects. These hold state related to a line, including - // highlighting info (the styles array). - var Line = function(text, markedSpans, estimateHeight) { - this.text = text; - attachMarkedSpans(this, markedSpans); - this.height = estimateHeight ? estimateHeight(this) : 1; - }; - - Line.prototype.lineNo = function () { return lineNo(this) }; - eventMixin(Line); - - // Change the content (text, markers) of a line. Automatically - // invalidates cached information and tries to re-estimate the - // line's height. - function updateLine(line, text, markedSpans, estimateHeight) { - line.text = text; - if (line.stateAfter) { line.stateAfter = null; } - if (line.styles) { line.styles = null; } - if (line.order != null) { line.order = null; } - detachMarkedSpans(line); - attachMarkedSpans(line, markedSpans); - var estHeight = estimateHeight ? estimateHeight(line) : 1; - if (estHeight != line.height) { updateLineHeight(line, estHeight); } - } - - // Detach a line from the document tree and its markers. - function cleanUpLine(line) { - line.parent = null; - detachMarkedSpans(line); - } - - // Convert a style as returned by a mode (either null, or a string - // containing one or more styles) to a CSS style. This is cached, - // and also looks for line-wide styles. - var styleToClassCache = {}, styleToClassCacheWithMode = {}; - function interpretTokenStyle(style, options) { - if (!style || /^\s*$/.test(style)) { return null } - var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; - return cache[style] || - (cache[style] = style.replace(/\S+/g, "cm-$&")) - } - - // Render the DOM representation of the text of a line. Also builds - // up a 'line map', which points at the DOM nodes that represent - // specific stretches of text, and is used by the measuring code. - // The returned object contains the DOM node, this map, and - // information about line-wide styles that were set by the mode. - function buildLineContent(cm, lineView) { - // The padding-right forces the element to have a 'border', which - // is needed on Webkit to be able to get line-level bounding - // rectangles for it (in measureChar). - var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null); - var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content, - col: 0, pos: 0, cm: cm, - trailingSpace: false, - splitSpaces: cm.getOption("lineWrapping")}; - lineView.measure = {}; - - // Iterate over the logical lines that make up this visual line. - for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { - var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0); - builder.pos = 0; - builder.addToken = buildToken; - // Optionally wire in some hacks into the token-rendering - // algorithm, to deal with browser quirks. - if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) - { builder.addToken = buildTokenBadBidi(builder.addToken, order); } - builder.map = []; - var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); - insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); - if (line.styleClasses) { - if (line.styleClasses.bgClass) - { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); } - if (line.styleClasses.textClass) - { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); } - } - - // Ensure at least a single node is present, for measuring. - if (builder.map.length == 0) - { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); } - - // Store the map and a cache object for the current logical line - if (i == 0) { - lineView.measure.map = builder.map; - lineView.measure.cache = {}; - } else { - (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map) - ;(lineView.measure.caches || (lineView.measure.caches = [])).push({}); - } - } - - // See issue #2901 - if (webkit) { - var last = builder.content.lastChild; - if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab"))) - { builder.content.className = "cm-tab-wrap-hack"; } - } - - signal(cm, "renderLine", cm, lineView.line, builder.pre); - if (builder.pre.className) - { builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); } - - return builder - } - - function defaultSpecialCharPlaceholder(ch) { - var token = elt("span", "\u2022", "cm-invalidchar"); - token.title = "\\u" + ch.charCodeAt(0).toString(16); - token.setAttribute("aria-label", token.title); - return token - } - - // Build up the DOM representation for a single token, and add it to - // the line map. Takes care to render special characters separately. - function buildToken(builder, text, style, startStyle, endStyle, css, attributes) { - if (!text) { return } - var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text; - var special = builder.cm.state.specialChars, mustWrap = false; - var content; - if (!special.test(text)) { - builder.col += text.length; - content = document.createTextNode(displayText); - builder.map.push(builder.pos, builder.pos + text.length, content); - if (ie && ie_version < 9) { mustWrap = true; } - builder.pos += text.length; - } else { - content = document.createDocumentFragment(); - var pos = 0; - while (true) { - special.lastIndex = pos; - var m = special.exec(text); - var skipped = m ? m.index - pos : text.length - pos; - if (skipped) { - var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); - if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])); } - else { content.appendChild(txt); } - builder.map.push(builder.pos, builder.pos + skipped, txt); - builder.col += skipped; - builder.pos += skipped; - } - if (!m) { break } - pos += skipped + 1; - var txt$1 = (void 0); - if (m[0] == "\t") { - var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; - txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); - txt$1.setAttribute("role", "presentation"); - txt$1.setAttribute("cm-text", "\t"); - builder.col += tabWidth; - } else if (m[0] == "\r" || m[0] == "\n") { - txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")); - txt$1.setAttribute("cm-text", m[0]); - builder.col += 1; - } else { - txt$1 = builder.cm.options.specialCharPlaceholder(m[0]); - txt$1.setAttribute("cm-text", m[0]); - if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])); } - else { content.appendChild(txt$1); } - builder.col += 1; - } - builder.map.push(builder.pos, builder.pos + 1, txt$1); - builder.pos++; - } - } - builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32; - if (style || startStyle || endStyle || mustWrap || css || attributes) { - var fullStyle = style || ""; - if (startStyle) { fullStyle += startStyle; } - if (endStyle) { fullStyle += endStyle; } - var token = elt("span", [content], fullStyle, css); - if (attributes) { - for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != "style" && attr != "class") - { token.setAttribute(attr, attributes[attr]); } } - } - return builder.content.appendChild(token) - } - builder.content.appendChild(content); - } - - // Change some spaces to NBSP to prevent the browser from collapsing - // trailing spaces at the end of a line when rendering text (issue #1362). - function splitSpaces(text, trailingBefore) { - if (text.length > 1 && !/ /.test(text)) { return text } - var spaceBefore = trailingBefore, result = ""; - for (var i = 0; i < text.length; i++) { - var ch = text.charAt(i); - if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) - { ch = "\u00a0"; } - result += ch; - spaceBefore = ch == " "; - } - return result - } - - // Work around nonsense dimensions being reported for stretches of - // right-to-left text. - function buildTokenBadBidi(inner, order) { - return function (builder, text, style, startStyle, endStyle, css, attributes) { - style = style ? style + " cm-force-border" : "cm-force-border"; - var start = builder.pos, end = start + text.length; - for (;;) { - // Find the part that overlaps with the start of this text - var part = (void 0); - for (var i = 0; i < order.length; i++) { - part = order[i]; - if (part.to > start && part.from <= start) { break } - } - if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) } - inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes); - startStyle = null; - text = text.slice(part.to - start); - start = part.to; - } - } - } - - function buildCollapsedSpan(builder, size, marker, ignoreWidget) { - var widget = !ignoreWidget && marker.widgetNode; - if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); } - if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { - if (!widget) - { widget = builder.content.appendChild(document.createElement("span")); } - widget.setAttribute("cm-marker", marker.id); - } - if (widget) { - builder.cm.display.input.setUneditable(widget); - builder.content.appendChild(widget); - } - builder.pos += size; - builder.trailingSpace = false; - } - - // Outputs a number of spans to make up a line, taking highlighting - // and marked text into account. - function insertLineContent(line, builder, styles) { - var spans = line.markedSpans, allText = line.text, at = 0; - if (!spans) { - for (var i$1 = 1; i$1 < styles.length; i$1+=2) - { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); } - return - } - - var len = allText.length, pos = 0, i = 1, text = "", style, css; - var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes; - for (;;) { - if (nextChange == pos) { // Update current marker set - spanStyle = spanEndStyle = spanStartStyle = css = ""; - attributes = null; - collapsed = null; nextChange = Infinity; - var foundBookmarks = [], endStyles = (void 0); - for (var j = 0; j < spans.length; ++j) { - var sp = spans[j], m = sp.marker; - if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { - foundBookmarks.push(m); - } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { - if (sp.to != null && sp.to != pos && nextChange > sp.to) { - nextChange = sp.to; - spanEndStyle = ""; - } - if (m.className) { spanStyle += " " + m.className; } - if (m.css) { css = (css ? css + ";" : "") + m.css; } - if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; } - if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); } - // support for the old title property - // https://github.com/codemirror/CodeMirror/pull/5673 - if (m.title) { (attributes || (attributes = {})).title = m.title; } - if (m.attributes) { - for (var attr in m.attributes) - { (attributes || (attributes = {}))[attr] = m.attributes[attr]; } - } - if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) - { collapsed = sp; } - } else if (sp.from > pos && nextChange > sp.from) { - nextChange = sp.from; - } - } - if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) - { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1]; } } } - - if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) - { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } } - if (collapsed && (collapsed.from || 0) == pos) { - buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, - collapsed.marker, collapsed.from == null); - if (collapsed.to == null) { return } - if (collapsed.to == pos) { collapsed = false; } - } - } - if (pos >= len) { break } - - var upto = Math.min(len, nextChange); - while (true) { - if (text) { - var end = pos + text.length; - if (!collapsed) { - var tokenText = end > upto ? text.slice(0, upto - pos) : text; - builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, - spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", css, attributes); - } - if (end >= upto) {text = text.slice(upto - pos); pos = upto; break} - pos = end; - spanStartStyle = ""; - } - text = allText.slice(at, at = styles[i++]); - style = interpretTokenStyle(styles[i++], builder.cm.options); - } - } - } - - - // These objects are used to represent the visible (currently drawn) - // part of the document. A LineView may correspond to multiple - // logical lines, if those are connected by collapsed ranges. - function LineView(doc, line, lineN) { - // The starting line - this.line = line; - // Continuing lines, if any - this.rest = visualLineContinued(line); - // Number of logical lines in this visual line - this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; - this.node = this.text = null; - this.hidden = lineIsHidden(doc, line); - } - - // Create a range of LineView objects for the given lines. - function buildViewArray(cm, from, to) { - var array = [], nextPos; - for (var pos = from; pos < to; pos = nextPos) { - var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); - nextPos = pos + view.size; - array.push(view); - } - return array - } - - var operationGroup = null; - - function pushOperation(op) { - if (operationGroup) { - operationGroup.ops.push(op); - } else { - op.ownsGroup = operationGroup = { - ops: [op], - delayedCallbacks: [] - }; - } - } - - function fireCallbacksForOps(group) { - // Calls delayed callbacks and cursorActivity handlers until no - // new ones appear - var callbacks = group.delayedCallbacks, i = 0; - do { - for (; i < callbacks.length; i++) - { callbacks[i].call(null); } - for (var j = 0; j < group.ops.length; j++) { - var op = group.ops[j]; - if (op.cursorActivityHandlers) - { while (op.cursorActivityCalled < op.cursorActivityHandlers.length) - { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } } - } - } while (i < callbacks.length) - } - - function finishOperation(op, endCb) { - var group = op.ownsGroup; - if (!group) { return } - - try { fireCallbacksForOps(group); } - finally { - operationGroup = null; - endCb(group); - } - } - - var orphanDelayedCallbacks = null; - - // Often, we want to signal events at a point where we are in the - // middle of some work, but don't want the handler to start calling - // other methods on the editor, which might be in an inconsistent - // state or simply not expect any other events to happen. - // signalLater looks whether there are any handlers, and schedules - // them to be executed when the last operation ends, or, if no - // operation is active, when a timeout fires. - function signalLater(emitter, type /*, values...*/) { - var arr = getHandlers(emitter, type); - if (!arr.length) { return } - var args = Array.prototype.slice.call(arguments, 2), list; - if (operationGroup) { - list = operationGroup.delayedCallbacks; - } else if (orphanDelayedCallbacks) { - list = orphanDelayedCallbacks; - } else { - list = orphanDelayedCallbacks = []; - setTimeout(fireOrphanDelayed, 0); - } - var loop = function ( i ) { - list.push(function () { return arr[i].apply(null, args); }); - }; - - for (var i = 0; i < arr.length; ++i) - loop( i ); - } - - function fireOrphanDelayed() { - var delayed = orphanDelayedCallbacks; - orphanDelayedCallbacks = null; - for (var i = 0; i < delayed.length; ++i) { delayed[i](); } - } - - // When an aspect of a line changes, a string is added to - // lineView.changes. This updates the relevant part of the line's - // DOM structure. - function updateLineForChanges(cm, lineView, lineN, dims) { - for (var j = 0; j < lineView.changes.length; j++) { - var type = lineView.changes[j]; - if (type == "text") { updateLineText(cm, lineView); } - else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims); } - else if (type == "class") { updateLineClasses(cm, lineView); } - else if (type == "widget") { updateLineWidgets(cm, lineView, dims); } - } - lineView.changes = null; - } - - // Lines with gutter elements, widgets or a background class need to - // be wrapped, and have the extra elements added to the wrapper div - function ensureLineWrapped(lineView) { - if (lineView.node == lineView.text) { - lineView.node = elt("div", null, null, "position: relative"); - if (lineView.text.parentNode) - { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); } - lineView.node.appendChild(lineView.text); - if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; } - } - return lineView.node - } - - function updateLineBackground(cm, lineView) { - var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; - if (cls) { cls += " CodeMirror-linebackground"; } - if (lineView.background) { - if (cls) { lineView.background.className = cls; } - else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } - } else if (cls) { - var wrap = ensureLineWrapped(lineView); - lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); - cm.display.input.setUneditable(lineView.background); - } - } - - // Wrapper around buildLineContent which will reuse the structure - // in display.externalMeasured when possible. - function getLineContent(cm, lineView) { - var ext = cm.display.externalMeasured; - if (ext && ext.line == lineView.line) { - cm.display.externalMeasured = null; - lineView.measure = ext.measure; - return ext.built - } - return buildLineContent(cm, lineView) - } - - // Redraw the line's text. Interacts with the background and text - // classes because the mode may output tokens that influence these - // classes. - function updateLineText(cm, lineView) { - var cls = lineView.text.className; - var built = getLineContent(cm, lineView); - if (lineView.text == lineView.node) { lineView.node = built.pre; } - lineView.text.parentNode.replaceChild(built.pre, lineView.text); - lineView.text = built.pre; - if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { - lineView.bgClass = built.bgClass; - lineView.textClass = built.textClass; - updateLineClasses(cm, lineView); - } else if (cls) { - lineView.text.className = cls; - } - } - - function updateLineClasses(cm, lineView) { - updateLineBackground(cm, lineView); - if (lineView.line.wrapClass) - { ensureLineWrapped(lineView).className = lineView.line.wrapClass; } - else if (lineView.node != lineView.text) - { lineView.node.className = ""; } - var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; - lineView.text.className = textClass || ""; - } - - function updateLineGutter(cm, lineView, lineN, dims) { - if (lineView.gutter) { - lineView.node.removeChild(lineView.gutter); - lineView.gutter = null; - } - if (lineView.gutterBackground) { - lineView.node.removeChild(lineView.gutterBackground); - lineView.gutterBackground = null; - } - if (lineView.line.gutterClass) { - var wrap = ensureLineWrapped(lineView); - lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, - ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px")); - cm.display.input.setUneditable(lineView.gutterBackground); - wrap.insertBefore(lineView.gutterBackground, lineView.text); - } - var markers = lineView.line.gutterMarkers; - if (cm.options.lineNumbers || markers) { - var wrap$1 = ensureLineWrapped(lineView); - var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px")); - gutterWrap.setAttribute("aria-hidden", "true"); - cm.display.input.setUneditable(gutterWrap); - wrap$1.insertBefore(gutterWrap, lineView.text); - if (lineView.line.gutterClass) - { gutterWrap.className += " " + lineView.line.gutterClass; } - if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) - { lineView.lineNumber = gutterWrap.appendChild( - elt("div", lineNumberFor(cm.options, lineN), - "CodeMirror-linenumber CodeMirror-gutter-elt", - ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))); } - if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) { - var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id]; - if (found) - { gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", - ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))); } - } } - } - } - - function updateLineWidgets(cm, lineView, dims) { - if (lineView.alignable) { lineView.alignable = null; } - var isWidget = classTest("CodeMirror-linewidget"); - for (var node = lineView.node.firstChild, next = (void 0); node; node = next) { - next = node.nextSibling; - if (isWidget.test(node.className)) { lineView.node.removeChild(node); } - } - insertLineWidgets(cm, lineView, dims); - } - - // Build a line's DOM representation from scratch - function buildLineElement(cm, lineView, lineN, dims) { - var built = getLineContent(cm, lineView); - lineView.text = lineView.node = built.pre; - if (built.bgClass) { lineView.bgClass = built.bgClass; } - if (built.textClass) { lineView.textClass = built.textClass; } - - updateLineClasses(cm, lineView); - updateLineGutter(cm, lineView, lineN, dims); - insertLineWidgets(cm, lineView, dims); - return lineView.node - } - - // A lineView may contain multiple logical lines (when merged by - // collapsed spans). The widgets for all of them need to be drawn. - function insertLineWidgets(cm, lineView, dims) { - insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); - if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) - { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } } - } - - function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { - if (!line.widgets) { return } - var wrap = ensureLineWrapped(lineView); - for (var i = 0, ws = line.widgets; i < ws.length; ++i) { - var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget" + (widget.className ? " " + widget.className : "")); - if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true"); } - positionLineWidget(widget, node, lineView, dims); - cm.display.input.setUneditable(node); - if (allowAbove && widget.above) - { wrap.insertBefore(node, lineView.gutter || lineView.text); } - else - { wrap.appendChild(node); } - signalLater(widget, "redraw"); - } - } - - function positionLineWidget(widget, node, lineView, dims) { - if (widget.noHScroll) { - (lineView.alignable || (lineView.alignable = [])).push(node); - var width = dims.wrapperWidth; - node.style.left = dims.fixedPos + "px"; - if (!widget.coverGutter) { - width -= dims.gutterTotalWidth; - node.style.paddingLeft = dims.gutterTotalWidth + "px"; - } - node.style.width = width + "px"; - } - if (widget.coverGutter) { - node.style.zIndex = 5; - node.style.position = "relative"; - if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px"; } - } - } - - function widgetHeight(widget) { - if (widget.height != null) { return widget.height } - var cm = widget.doc.cm; - if (!cm) { return 0 } - if (!contains(document.body, widget.node)) { - var parentStyle = "position: relative;"; - if (widget.coverGutter) - { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; } - if (widget.noHScroll) - { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; } - removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); - } - return widget.height = widget.node.parentNode.offsetHeight - } - - // Return true when the given mouse event happened in a widget - function eventInWidget(display, e) { - for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { - if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || - (n.parentNode == display.sizer && n != display.mover)) - { return true } - } - } - - // POSITION MEASUREMENT - - function paddingTop(display) {return display.lineSpace.offsetTop} - function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight} - function paddingH(display) { - if (display.cachedPaddingH) { return display.cachedPaddingH } - var e = removeChildrenAndAdd(display.measure, elt("pre", "x", "CodeMirror-line-like")); - var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; - var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; - if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; } - return data - } - - function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth } - function displayWidth(cm) { - return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth - } - function displayHeight(cm) { - return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight - } - - // Ensure the lineView.wrapping.heights array is populated. This is - // an array of bottom offsets for the lines that make up a drawn - // line. When lineWrapping is on, there might be more than one - // height. - function ensureLineHeights(cm, lineView, rect) { - var wrapping = cm.options.lineWrapping; - var curWidth = wrapping && displayWidth(cm); - if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { - var heights = lineView.measure.heights = []; - if (wrapping) { - lineView.measure.width = curWidth; - var rects = lineView.text.firstChild.getClientRects(); - for (var i = 0; i < rects.length - 1; i++) { - var cur = rects[i], next = rects[i + 1]; - if (Math.abs(cur.bottom - next.bottom) > 2) - { heights.push((cur.bottom + next.top) / 2 - rect.top); } - } - } - heights.push(rect.bottom - rect.top); - } - } - - // Find a line map (mapping character offsets to text nodes) and a - // measurement cache for the given line number. (A line view might - // contain multiple lines when collapsed ranges are present.) - function mapFromLineView(lineView, line, lineN) { - if (lineView.line == line) - { return {map: lineView.measure.map, cache: lineView.measure.cache} } - if (lineView.rest) { - for (var i = 0; i < lineView.rest.length; i++) - { if (lineView.rest[i] == line) - { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } } - for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) - { if (lineNo(lineView.rest[i$1]) > lineN) - { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } } - } - } - - // Render a line into the hidden node display.externalMeasured. Used - // when measurement is needed for a line that's not in the viewport. - function updateExternalMeasurement(cm, line) { - line = visualLine(line); - var lineN = lineNo(line); - var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); - view.lineN = lineN; - var built = view.built = buildLineContent(cm, view); - view.text = built.pre; - removeChildrenAndAdd(cm.display.lineMeasure, built.pre); - return view - } - - // Get a {top, bottom, left, right} box (in line-local coordinates) - // for a given character. - function measureChar(cm, line, ch, bias) { - return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias) - } - - // Find a line view that corresponds to the given line number. - function findViewForLine(cm, lineN) { - if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) - { return cm.display.view[findViewIndex(cm, lineN)] } - var ext = cm.display.externalMeasured; - if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) - { return ext } - } - - // Measurement can be split in two steps, the set-up work that - // applies to the whole line, and the measurement of the actual - // character. Functions like coordsChar, that need to do a lot of - // measurements in a row, can thus ensure that the set-up work is - // only done once. - function prepareMeasureForLine(cm, line) { - var lineN = lineNo(line); - var view = findViewForLine(cm, lineN); - if (view && !view.text) { - view = null; - } else if (view && view.changes) { - updateLineForChanges(cm, view, lineN, getDimensions(cm)); - cm.curOp.forceUpdate = true; - } - if (!view) - { view = updateExternalMeasurement(cm, line); } - - var info = mapFromLineView(view, line, lineN); - return { - line: line, view: view, rect: null, - map: info.map, cache: info.cache, before: info.before, - hasHeights: false - } - } - - // Given a prepared measurement object, measures the position of an - // actual character (or fetches it from the cache). - function measureCharPrepared(cm, prepared, ch, bias, varHeight) { - if (prepared.before) { ch = -1; } - var key = ch + (bias || ""), found; - if (prepared.cache.hasOwnProperty(key)) { - found = prepared.cache[key]; - } else { - if (!prepared.rect) - { prepared.rect = prepared.view.text.getBoundingClientRect(); } - if (!prepared.hasHeights) { - ensureLineHeights(cm, prepared.view, prepared.rect); - prepared.hasHeights = true; - } - found = measureCharInner(cm, prepared, ch, bias); - if (!found.bogus) { prepared.cache[key] = found; } - } - return {left: found.left, right: found.right, - top: varHeight ? found.rtop : found.top, - bottom: varHeight ? found.rbottom : found.bottom} - } - - var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; - - function nodeAndOffsetInLineMap(map, ch, bias) { - var node, start, end, collapse, mStart, mEnd; - // First, search the line map for the text node corresponding to, - // or closest to, the target character. - for (var i = 0; i < map.length; i += 3) { - mStart = map[i]; - mEnd = map[i + 1]; - if (ch < mStart) { - start = 0; end = 1; - collapse = "left"; - } else if (ch < mEnd) { - start = ch - mStart; - end = start + 1; - } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) { - end = mEnd - mStart; - start = end - 1; - if (ch >= mEnd) { collapse = "right"; } - } - if (start != null) { - node = map[i + 2]; - if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) - { collapse = bias; } - if (bias == "left" && start == 0) - { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) { - node = map[(i -= 3) + 2]; - collapse = "left"; - } } - if (bias == "right" && start == mEnd - mStart) - { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) { - node = map[(i += 3) + 2]; - collapse = "right"; - } } - break - } - } - return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd} - } - - function getUsefulRect(rects, bias) { - var rect = nullRect; - if (bias == "left") { for (var i = 0; i < rects.length; i++) { - if ((rect = rects[i]).left != rect.right) { break } - } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) { - if ((rect = rects[i$1]).left != rect.right) { break } - } } - return rect - } - - function measureCharInner(cm, prepared, ch, bias) { - var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); - var node = place.node, start = place.start, end = place.end, collapse = place.collapse; - - var rect; - if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. - for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned - while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; } - while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; } - if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) - { rect = node.parentNode.getBoundingClientRect(); } - else - { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); } - if (rect.left || rect.right || start == 0) { break } - end = start; - start = start - 1; - collapse = "right"; - } - if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); } - } else { // If it is a widget, simply get the box for the whole widget. - if (start > 0) { collapse = bias = "right"; } - var rects; - if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) - { rect = rects[bias == "right" ? rects.length - 1 : 0]; } - else - { rect = node.getBoundingClientRect(); } - } - if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { - var rSpan = node.parentNode.getClientRects()[0]; - if (rSpan) - { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; } - else - { rect = nullRect; } - } - - var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; - var mid = (rtop + rbot) / 2; - var heights = prepared.view.measure.heights; - var i = 0; - for (; i < heights.length - 1; i++) - { if (mid < heights[i]) { break } } - var top = i ? heights[i - 1] : 0, bot = heights[i]; - var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, - right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, - top: top, bottom: bot}; - if (!rect.left && !rect.right) { result.bogus = true; } - if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } - - return result - } - - // Work around problem with bounding client rects on ranges being - // returned incorrectly when zoomed on IE10 and below. - function maybeUpdateRectForZooming(measure, rect) { - if (!window.screen || screen.logicalXDPI == null || - screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) - { return rect } - var scaleX = screen.logicalXDPI / screen.deviceXDPI; - var scaleY = screen.logicalYDPI / screen.deviceYDPI; - return {left: rect.left * scaleX, right: rect.right * scaleX, - top: rect.top * scaleY, bottom: rect.bottom * scaleY} - } - - function clearLineMeasurementCacheFor(lineView) { - if (lineView.measure) { - lineView.measure.cache = {}; - lineView.measure.heights = null; - if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) - { lineView.measure.caches[i] = {}; } } - } - } - - function clearLineMeasurementCache(cm) { - cm.display.externalMeasure = null; - removeChildren(cm.display.lineMeasure); - for (var i = 0; i < cm.display.view.length; i++) - { clearLineMeasurementCacheFor(cm.display.view[i]); } - } - - function clearCaches(cm) { - clearLineMeasurementCache(cm); - cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; - if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; } - cm.display.lineNumChars = null; - } - - function pageScrollX(doc) { - // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206 - // which causes page_Offset and bounding client rects to use - // different reference viewports and invalidate our calculations. - if (chrome && android) { return -(doc.body.getBoundingClientRect().left - parseInt(getComputedStyle(doc.body).marginLeft)) } - return doc.defaultView.pageXOffset || (doc.documentElement || doc.body).scrollLeft - } - function pageScrollY(doc) { - if (chrome && android) { return -(doc.body.getBoundingClientRect().top - parseInt(getComputedStyle(doc.body).marginTop)) } - return doc.defaultView.pageYOffset || (doc.documentElement || doc.body).scrollTop - } - - function widgetTopHeight(lineObj) { - var ref = visualLine(lineObj); - var widgets = ref.widgets; - var height = 0; - if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above) - { height += widgetHeight(widgets[i]); } } } - return height - } - - // Converts a {top, bottom, left, right} box from line-local - // coordinates into another coordinate system. Context may be one of - // "line", "div" (display.lineDiv), "local"./null (editor), "window", - // or "page". - function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { - if (!includeWidgets) { - var height = widgetTopHeight(lineObj); - rect.top += height; rect.bottom += height; - } - if (context == "line") { return rect } - if (!context) { context = "local"; } - var yOff = heightAtLine(lineObj); - if (context == "local") { yOff += paddingTop(cm.display); } - else { yOff -= cm.display.viewOffset; } - if (context == "page" || context == "window") { - var lOff = cm.display.lineSpace.getBoundingClientRect(); - yOff += lOff.top + (context == "window" ? 0 : pageScrollY(doc(cm))); - var xOff = lOff.left + (context == "window" ? 0 : pageScrollX(doc(cm))); - rect.left += xOff; rect.right += xOff; - } - rect.top += yOff; rect.bottom += yOff; - return rect - } - - // Coverts a box from "div" coords to another coordinate system. - // Context may be "window", "page", "div", or "local"./null. - function fromCoordSystem(cm, coords, context) { - if (context == "div") { return coords } - var left = coords.left, top = coords.top; - // First move into "page" coordinate system - if (context == "page") { - left -= pageScrollX(doc(cm)); - top -= pageScrollY(doc(cm)); - } else if (context == "local" || !context) { - var localBox = cm.display.sizer.getBoundingClientRect(); - left += localBox.left; - top += localBox.top; - } - - var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); - return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top} - } - - function charCoords(cm, pos, context, lineObj, bias) { - if (!lineObj) { lineObj = getLine(cm.doc, pos.line); } - return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context) - } - - // Returns a box for a given cursor position, which may have an - // 'other' property containing the position of the secondary cursor - // on a bidi boundary. - // A cursor Pos(line, char, "before") is on the same visual line as `char - 1` - // and after `char - 1` in writing order of `char - 1` - // A cursor Pos(line, char, "after") is on the same visual line as `char` - // and before `char` in writing order of `char` - // Examples (upper-case letters are RTL, lower-case are LTR): - // Pos(0, 1, ...) - // before after - // ab a|b a|b - // aB a|B aB| - // Ab |Ab A|b - // AB B|A B|A - // Every position after the last character on a line is considered to stick - // to the last character on the line. - function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { - lineObj = lineObj || getLine(cm.doc, pos.line); - if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); } - function get(ch, right) { - var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); - if (right) { m.left = m.right; } else { m.right = m.left; } - return intoCoordSystem(cm, lineObj, m, context) - } - var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky; - if (ch >= lineObj.text.length) { - ch = lineObj.text.length; - sticky = "before"; - } else if (ch <= 0) { - ch = 0; - sticky = "after"; - } - if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") } - - function getBidi(ch, partPos, invert) { - var part = order[partPos], right = part.level == 1; - return get(invert ? ch - 1 : ch, right != invert) - } - var partPos = getBidiPartAt(order, ch, sticky); - var other = bidiOther; - var val = getBidi(ch, partPos, sticky == "before"); - if (other != null) { val.other = getBidi(ch, other, sticky != "before"); } - return val - } - - // Used to cheaply estimate the coordinates for a position. Used for - // intermediate scroll updates. - function estimateCoords(cm, pos) { - var left = 0; - pos = clipPos(cm.doc, pos); - if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; } - var lineObj = getLine(cm.doc, pos.line); - var top = heightAtLine(lineObj) + paddingTop(cm.display); - return {left: left, right: left, top: top, bottom: top + lineObj.height} - } - - // Positions returned by coordsChar contain some extra information. - // xRel is the relative x position of the input coordinates compared - // to the found position (so xRel > 0 means the coordinates are to - // the right of the character position, for example). When outside - // is true, that means the coordinates lie outside the line's - // vertical range. - function PosWithInfo(line, ch, sticky, outside, xRel) { - var pos = Pos(line, ch, sticky); - pos.xRel = xRel; - if (outside) { pos.outside = outside; } - return pos - } - - // Compute the character position closest to the given coordinates. - // Input must be lineSpace-local ("div" coordinate system). - function coordsChar(cm, x, y) { - var doc = cm.doc; - y += cm.display.viewOffset; - if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) } - var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; - if (lineN > last) - { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) } - if (x < 0) { x = 0; } - - var lineObj = getLine(doc, lineN); - for (;;) { - var found = coordsCharInner(cm, lineObj, lineN, x, y); - var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0)); - if (!collapsed) { return found } - var rangeEnd = collapsed.find(1); - if (rangeEnd.line == lineN) { return rangeEnd } - lineObj = getLine(doc, lineN = rangeEnd.line); - } - } - - function wrappedLineExtent(cm, lineObj, preparedMeasure, y) { - y -= widgetTopHeight(lineObj); - var end = lineObj.text.length; - var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0); - end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end); - return {begin: begin, end: end} - } - - function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) { - if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); } - var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top; - return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop) - } - - // Returns true if the given side of a box is after the given - // coordinates, in top-to-bottom, left-to-right order. - function boxIsAfter(box, x, y, left) { - return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x - } - - function coordsCharInner(cm, lineObj, lineNo, x, y) { - // Move y into line-local coordinate space - y -= heightAtLine(lineObj); - var preparedMeasure = prepareMeasureForLine(cm, lineObj); - // When directly calling `measureCharPrepared`, we have to adjust - // for the widgets at this line. - var widgetHeight = widgetTopHeight(lineObj); - var begin = 0, end = lineObj.text.length, ltr = true; - - var order = getOrder(lineObj, cm.doc.direction); - // If the line isn't plain left-to-right text, first figure out - // which bidi section the coordinates fall into. - if (order) { - var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart) - (cm, lineObj, lineNo, preparedMeasure, order, x, y); - ltr = part.level != 1; - // The awkward -1 offsets are needed because findFirst (called - // on these below) will treat its first bound as inclusive, - // second as exclusive, but we want to actually address the - // characters in the part's range - begin = ltr ? part.from : part.to - 1; - end = ltr ? part.to : part.from - 1; - } - - // A binary search to find the first character whose bounding box - // starts after the coordinates. If we run across any whose box wrap - // the coordinates, store that. - var chAround = null, boxAround = null; - var ch = findFirst(function (ch) { - var box = measureCharPrepared(cm, preparedMeasure, ch); - box.top += widgetHeight; box.bottom += widgetHeight; - if (!boxIsAfter(box, x, y, false)) { return false } - if (box.top <= y && box.left <= x) { - chAround = ch; - boxAround = box; - } - return true - }, begin, end); - - var baseX, sticky, outside = false; - // If a box around the coordinates was found, use that - if (boxAround) { - // Distinguish coordinates nearer to the left or right side of the box - var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr; - ch = chAround + (atStart ? 0 : 1); - sticky = atStart ? "after" : "before"; - baseX = atLeft ? boxAround.left : boxAround.right; - } else { - // (Adjust for extended bound, if necessary.) - if (!ltr && (ch == end || ch == begin)) { ch++; } - // To determine which side to associate with, get the box to the - // left of the character and compare it's vertical position to the - // coordinates - sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" : - (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ? - "after" : "before"; - // Now get accurate coordinates for this place, in order to get a - // base X position - var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), "line", lineObj, preparedMeasure); - baseX = coords.left; - outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0; - } - - ch = skipExtendingChars(lineObj.text, ch, 1); - return PosWithInfo(lineNo, ch, sticky, outside, x - baseX) - } - - function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) { - // Bidi parts are sorted left-to-right, and in a non-line-wrapping - // situation, we can take this ordering to correspond to the visual - // ordering. This finds the first part whose end is after the given - // coordinates. - var index = findFirst(function (i) { - var part = order[i], ltr = part.level != 1; - return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? "before" : "after"), - "line", lineObj, preparedMeasure), x, y, true) - }, 0, order.length - 1); - var part = order[index]; - // If this isn't the first part, the part's start is also after - // the coordinates, and the coordinates aren't on the same line as - // that start, move one part back. - if (index > 0) { - var ltr = part.level != 1; - var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? "after" : "before"), - "line", lineObj, preparedMeasure); - if (boxIsAfter(start, x, y, true) && start.top > y) - { part = order[index - 1]; } - } - return part - } - - function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) { - // In a wrapped line, rtl text on wrapping boundaries can do things - // that don't correspond to the ordering in our `order` array at - // all, so a binary search doesn't work, and we want to return a - // part that only spans one line so that the binary search in - // coordsCharInner is safe. As such, we first find the extent of the - // wrapped line, and then do a flat search in which we discard any - // spans that aren't on the line. - var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y); - var begin = ref.begin; - var end = ref.end; - if (/\s/.test(lineObj.text.charAt(end - 1))) { end--; } - var part = null, closestDist = null; - for (var i = 0; i < order.length; i++) { - var p = order[i]; - if (p.from >= end || p.to <= begin) { continue } - var ltr = p.level != 1; - var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right; - // Weigh against spans ending before this, so that they are only - // picked if nothing ends after - var dist = endX < x ? x - endX + 1e9 : endX - x; - if (!part || closestDist > dist) { - part = p; - closestDist = dist; - } - } - if (!part) { part = order[order.length - 1]; } - // Clip the part to the wrapped line. - if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; } - if (part.to > end) { part = {from: part.from, to: end, level: part.level}; } - return part - } - - var measureText; - // Compute the default text height. - function textHeight(display) { - if (display.cachedTextHeight != null) { return display.cachedTextHeight } - if (measureText == null) { - measureText = elt("pre", null, "CodeMirror-line-like"); - // Measure a bunch of lines, for browsers that compute - // fractional heights. - for (var i = 0; i < 49; ++i) { - measureText.appendChild(document.createTextNode("x")); - measureText.appendChild(elt("br")); - } - measureText.appendChild(document.createTextNode("x")); - } - removeChildrenAndAdd(display.measure, measureText); - var height = measureText.offsetHeight / 50; - if (height > 3) { display.cachedTextHeight = height; } - removeChildren(display.measure); - return height || 1 - } - - // Compute the default character width. - function charWidth(display) { - if (display.cachedCharWidth != null) { return display.cachedCharWidth } - var anchor = elt("span", "xxxxxxxxxx"); - var pre = elt("pre", [anchor], "CodeMirror-line-like"); - removeChildrenAndAdd(display.measure, pre); - var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; - if (width > 2) { display.cachedCharWidth = width; } - return width || 10 - } - - // Do a bulk-read of the DOM positions and sizes needed to draw the - // view, so that we don't interleave reading and writing to the DOM. - function getDimensions(cm) { - var d = cm.display, left = {}, width = {}; - var gutterLeft = d.gutters.clientLeft; - for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { - var id = cm.display.gutterSpecs[i].className; - left[id] = n.offsetLeft + n.clientLeft + gutterLeft; - width[id] = n.clientWidth; - } - return {fixedPos: compensateForHScroll(d), - gutterTotalWidth: d.gutters.offsetWidth, - gutterLeft: left, - gutterWidth: width, - wrapperWidth: d.wrapper.clientWidth} - } - - // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, - // but using getBoundingClientRect to get a sub-pixel-accurate - // result. - function compensateForHScroll(display) { - return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left - } - - // Returns a function that estimates the height of a line, to use as - // first approximation until the line becomes visible (and is thus - // properly measurable). - function estimateHeight(cm) { - var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; - var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); - return function (line) { - if (lineIsHidden(cm.doc, line)) { return 0 } - - var widgetsHeight = 0; - if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) { - if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; } - } } - - if (wrapping) - { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th } - else - { return widgetsHeight + th } - } - } - - function estimateLineHeights(cm) { - var doc = cm.doc, est = estimateHeight(cm); - doc.iter(function (line) { - var estHeight = est(line); - if (estHeight != line.height) { updateLineHeight(line, estHeight); } - }); - } - - // Given a mouse event, find the corresponding position. If liberal - // is false, it checks whether a gutter or scrollbar was clicked, - // and returns null if it was. forRect is used by rectangular - // selections, and tries to estimate a character position even for - // coordinates beyond the right of the text. - function posFromMouse(cm, e, liberal, forRect) { - var display = cm.display; - if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null } - - var x, y, space = display.lineSpace.getBoundingClientRect(); - // Fails unpredictably on IE[67] when mouse is dragged around quickly. - try { x = e.clientX - space.left; y = e.clientY - space.top; } - catch (e$1) { return null } - var coords = coordsChar(cm, x, y), line; - if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { - var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; - coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); - } - return coords - } - - // Find the view element corresponding to a given line. Return null - // when the line isn't visible. - function findViewIndex(cm, n) { - if (n >= cm.display.viewTo) { return null } - n -= cm.display.viewFrom; - if (n < 0) { return null } - var view = cm.display.view; - for (var i = 0; i < view.length; i++) { - n -= view[i].size; - if (n < 0) { return i } - } - } - - // Updates the display.view data structure for a given change to the - // document. From and to are in pre-change coordinates. Lendiff is - // the amount of lines added or subtracted by the change. This is - // used for changes that span multiple lines, or change the way - // lines are divided into visual lines. regLineChange (below) - // registers single-line changes. - function regChange(cm, from, to, lendiff) { - if (from == null) { from = cm.doc.first; } - if (to == null) { to = cm.doc.first + cm.doc.size; } - if (!lendiff) { lendiff = 0; } - - var display = cm.display; - if (lendiff && to < display.viewTo && - (display.updateLineNumbers == null || display.updateLineNumbers > from)) - { display.updateLineNumbers = from; } - - cm.curOp.viewChanged = true; - - if (from >= display.viewTo) { // Change after - if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) - { resetView(cm); } - } else if (to <= display.viewFrom) { // Change before - if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { - resetView(cm); - } else { - display.viewFrom += lendiff; - display.viewTo += lendiff; - } - } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap - resetView(cm); - } else if (from <= display.viewFrom) { // Top overlap - var cut = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cut) { - display.view = display.view.slice(cut.index); - display.viewFrom = cut.lineN; - display.viewTo += lendiff; - } else { - resetView(cm); - } - } else if (to >= display.viewTo) { // Bottom overlap - var cut$1 = viewCuttingPoint(cm, from, from, -1); - if (cut$1) { - display.view = display.view.slice(0, cut$1.index); - display.viewTo = cut$1.lineN; - } else { - resetView(cm); - } - } else { // Gap in the middle - var cutTop = viewCuttingPoint(cm, from, from, -1); - var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); - if (cutTop && cutBot) { - display.view = display.view.slice(0, cutTop.index) - .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) - .concat(display.view.slice(cutBot.index)); - display.viewTo += lendiff; - } else { - resetView(cm); - } - } - - var ext = display.externalMeasured; - if (ext) { - if (to < ext.lineN) - { ext.lineN += lendiff; } - else if (from < ext.lineN + ext.size) - { display.externalMeasured = null; } - } - } - - // Register a change to a single line. Type must be one of "text", - // "gutter", "class", "widget" - function regLineChange(cm, line, type) { - cm.curOp.viewChanged = true; - var display = cm.display, ext = cm.display.externalMeasured; - if (ext && line >= ext.lineN && line < ext.lineN + ext.size) - { display.externalMeasured = null; } - - if (line < display.viewFrom || line >= display.viewTo) { return } - var lineView = display.view[findViewIndex(cm, line)]; - if (lineView.node == null) { return } - var arr = lineView.changes || (lineView.changes = []); - if (indexOf(arr, type) == -1) { arr.push(type); } - } - - // Clear the view. - function resetView(cm) { - cm.display.viewFrom = cm.display.viewTo = cm.doc.first; - cm.display.view = []; - cm.display.viewOffset = 0; - } - - function viewCuttingPoint(cm, oldN, newN, dir) { - var index = findViewIndex(cm, oldN), diff, view = cm.display.view; - if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) - { return {index: index, lineN: newN} } - var n = cm.display.viewFrom; - for (var i = 0; i < index; i++) - { n += view[i].size; } - if (n != oldN) { - if (dir > 0) { - if (index == view.length - 1) { return null } - diff = (n + view[index].size) - oldN; - index++; - } else { - diff = n - oldN; - } - oldN += diff; newN += diff; - } - while (visualLineNo(cm.doc, newN) != newN) { - if (index == (dir < 0 ? 0 : view.length - 1)) { return null } - newN += dir * view[index - (dir < 0 ? 1 : 0)].size; - index += dir; - } - return {index: index, lineN: newN} - } - - // Force the view to cover a given range, adding empty view element - // or clipping off existing ones as needed. - function adjustView(cm, from, to) { - var display = cm.display, view = display.view; - if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { - display.view = buildViewArray(cm, from, to); - display.viewFrom = from; - } else { - if (display.viewFrom > from) - { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); } - else if (display.viewFrom < from) - { display.view = display.view.slice(findViewIndex(cm, from)); } - display.viewFrom = from; - if (display.viewTo < to) - { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); } - else if (display.viewTo > to) - { display.view = display.view.slice(0, findViewIndex(cm, to)); } - } - display.viewTo = to; - } - - // Count the number of lines in the view whose DOM representation is - // out of date (or nonexistent). - function countDirtyView(cm) { - var view = cm.display.view, dirty = 0; - for (var i = 0; i < view.length; i++) { - var lineView = view[i]; - if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; } - } - return dirty - } - - function updateSelection(cm) { - cm.display.input.showSelection(cm.display.input.prepareSelection()); - } - - function prepareSelection(cm, primary) { - if ( primary === void 0 ) primary = true; - - var doc = cm.doc, result = {}; - var curFragment = result.cursors = document.createDocumentFragment(); - var selFragment = result.selection = document.createDocumentFragment(); - - var customCursor = cm.options.$customCursor; - if (customCursor) { primary = true; } - for (var i = 0; i < doc.sel.ranges.length; i++) { - if (!primary && i == doc.sel.primIndex) { continue } - var range = doc.sel.ranges[i]; - if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue } - var collapsed = range.empty(); - if (customCursor) { - var head = customCursor(cm, range); - if (head) { drawSelectionCursor(cm, head, curFragment); } - } else if (collapsed || cm.options.showCursorWhenSelecting) { - drawSelectionCursor(cm, range.head, curFragment); - } - if (!collapsed) - { drawSelectionRange(cm, range, selFragment); } - } - return result - } - - // Draws a cursor for the given range - function drawSelectionCursor(cm, head, output) { - var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); - - var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); - cursor.style.left = pos.left + "px"; - cursor.style.top = pos.top + "px"; - cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; - - if (/\bcm-fat-cursor\b/.test(cm.getWrapperElement().className)) { - var charPos = charCoords(cm, head, "div", null, null); - var width = charPos.right - charPos.left; - cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + "px"; - } - - if (pos.other) { - // Secondary cursor, shown when on a 'jump' in bi-directional text - var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); - otherCursor.style.display = ""; - otherCursor.style.left = pos.other.left + "px"; - otherCursor.style.top = pos.other.top + "px"; - otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; - } - } - - function cmpCoords(a, b) { return a.top - b.top || a.left - b.left } - - // Draws the given range as a highlighted selection - function drawSelectionRange(cm, range, output) { - var display = cm.display, doc = cm.doc; - var fragment = document.createDocumentFragment(); - var padding = paddingH(cm.display), leftSide = padding.left; - var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; - var docLTR = doc.direction == "ltr"; - - function add(left, top, width, bottom) { - if (top < 0) { top = 0; } - top = Math.round(top); - bottom = Math.round(bottom); - fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px"))); - } - - function drawForLine(line, fromArg, toArg) { - var lineObj = getLine(doc, line); - var lineLen = lineObj.text.length; - var start, end; - function coords(ch, bias) { - return charCoords(cm, Pos(line, ch), "div", lineObj, bias) - } - - function wrapX(pos, dir, side) { - var extent = wrappedLineExtentChar(cm, lineObj, null, pos); - var prop = (dir == "ltr") == (side == "after") ? "left" : "right"; - var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1); - return coords(ch, prop)[prop] - } - - var order = getOrder(lineObj, doc.direction); - iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) { - var ltr = dir == "ltr"; - var fromPos = coords(from, ltr ? "left" : "right"); - var toPos = coords(to - 1, ltr ? "right" : "left"); - - var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen; - var first = i == 0, last = !order || i == order.length - 1; - if (toPos.top - fromPos.top <= 3) { // Single line - var openLeft = (docLTR ? openStart : openEnd) && first; - var openRight = (docLTR ? openEnd : openStart) && last; - var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left; - var right = openRight ? rightSide : (ltr ? toPos : fromPos).right; - add(left, fromPos.top, right - left, fromPos.bottom); - } else { // Multiple lines - var topLeft, topRight, botLeft, botRight; - if (ltr) { - topLeft = docLTR && openStart && first ? leftSide : fromPos.left; - topRight = docLTR ? rightSide : wrapX(from, dir, "before"); - botLeft = docLTR ? leftSide : wrapX(to, dir, "after"); - botRight = docLTR && openEnd && last ? rightSide : toPos.right; - } else { - topLeft = !docLTR ? leftSide : wrapX(from, dir, "before"); - topRight = !docLTR && openStart && first ? rightSide : fromPos.right; - botLeft = !docLTR && openEnd && last ? leftSide : toPos.left; - botRight = !docLTR ? rightSide : wrapX(to, dir, "after"); - } - add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom); - if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); } - add(botLeft, toPos.top, botRight - botLeft, toPos.bottom); - } - - if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; } - if (cmpCoords(toPos, start) < 0) { start = toPos; } - if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; } - if (cmpCoords(toPos, end) < 0) { end = toPos; } - }); - return {start: start, end: end} - } - - var sFrom = range.from(), sTo = range.to(); - if (sFrom.line == sTo.line) { - drawForLine(sFrom.line, sFrom.ch, sTo.ch); - } else { - var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); - var singleVLine = visualLine(fromLine) == visualLine(toLine); - var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; - var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; - if (singleVLine) { - if (leftEnd.top < rightStart.top - 2) { - add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); - add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); - } else { - add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); - } - } - if (leftEnd.bottom < rightStart.top) - { add(leftSide, leftEnd.bottom, null, rightStart.top); } - } - - output.appendChild(fragment); - } - - // Cursor-blinking - function restartBlink(cm) { - if (!cm.state.focused) { return } - var display = cm.display; - clearInterval(display.blinker); - var on = true; - display.cursorDiv.style.visibility = ""; - if (cm.options.cursorBlinkRate > 0) - { display.blinker = setInterval(function () { - if (!cm.hasFocus()) { onBlur(cm); } - display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; - }, cm.options.cursorBlinkRate); } - else if (cm.options.cursorBlinkRate < 0) - { display.cursorDiv.style.visibility = "hidden"; } - } - - function ensureFocus(cm) { - if (!cm.hasFocus()) { - cm.display.input.focus(); - if (!cm.state.focused) { onFocus(cm); } - } - } - - function delayBlurEvent(cm) { - cm.state.delayingBlurEvent = true; - setTimeout(function () { if (cm.state.delayingBlurEvent) { - cm.state.delayingBlurEvent = false; - if (cm.state.focused) { onBlur(cm); } - } }, 100); - } - - function onFocus(cm, e) { - if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; } - - if (cm.options.readOnly == "nocursor") { return } - if (!cm.state.focused) { - signal(cm, "focus", cm, e); - cm.state.focused = true; - addClass(cm.display.wrapper, "CodeMirror-focused"); - // This test prevents this from firing when a context - // menu is closed (since the input reset would kill the - // select-all detection hack) - if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { - cm.display.input.reset(); - if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730 - } - cm.display.input.receivedFocus(); - } - restartBlink(cm); - } - function onBlur(cm, e) { - if (cm.state.delayingBlurEvent) { return } - - if (cm.state.focused) { - signal(cm, "blur", cm, e); - cm.state.focused = false; - rmClass(cm.display.wrapper, "CodeMirror-focused"); - } - clearInterval(cm.display.blinker); - setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150); - } - - // Read the actual heights of the rendered lines, and update their - // stored heights to match. - function updateHeightsInViewport(cm) { - var display = cm.display; - var prevBottom = display.lineDiv.offsetTop; - var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top); - var oldHeight = display.lineDiv.getBoundingClientRect().top; - var mustScroll = 0; - for (var i = 0; i < display.view.length; i++) { - var cur = display.view[i], wrapping = cm.options.lineWrapping; - var height = (void 0), width = 0; - if (cur.hidden) { continue } - oldHeight += cur.line.height; - if (ie && ie_version < 8) { - var bot = cur.node.offsetTop + cur.node.offsetHeight; - height = bot - prevBottom; - prevBottom = bot; - } else { - var box = cur.node.getBoundingClientRect(); - height = box.bottom - box.top; - // Check that lines don't extend past the right of the current - // editor width - if (!wrapping && cur.text.firstChild) - { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; } - } - var diff = cur.line.height - height; - if (diff > .005 || diff < -.005) { - if (oldHeight < viewTop) { mustScroll -= diff; } - updateLineHeight(cur.line, height); - updateWidgetHeight(cur.line); - if (cur.rest) { for (var j = 0; j < cur.rest.length; j++) - { updateWidgetHeight(cur.rest[j]); } } - } - if (width > cm.display.sizerWidth) { - var chWidth = Math.ceil(width / charWidth(cm.display)); - if (chWidth > cm.display.maxLineLength) { - cm.display.maxLineLength = chWidth; - cm.display.maxLine = cur.line; - cm.display.maxLineChanged = true; - } - } - } - if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; } - } - - // Read and store the height of line widgets associated with the - // given line. - function updateWidgetHeight(line) { - if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) { - var w = line.widgets[i], parent = w.node.parentNode; - if (parent) { w.height = parent.offsetHeight; } - } } - } - - // Compute the lines that are visible in a given viewport (defaults - // the the current scroll position). viewport may contain top, - // height, and ensure (see op.scrollToPos) properties. - function visibleLines(display, doc, viewport) { - var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; - top = Math.floor(top - paddingTop(display)); - var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; - - var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); - // Ensure is a {from: {line, ch}, to: {line, ch}} object, and - // forces those lines into the viewport (if possible). - if (viewport && viewport.ensure) { - var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; - if (ensureFrom < from) { - from = ensureFrom; - to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); - } else if (Math.min(ensureTo, doc.lastLine()) >= to) { - from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); - to = ensureTo; - } - } - return {from: from, to: Math.max(to, from + 1)} - } - - // SCROLLING THINGS INTO VIEW - - // If an editor sits on the top or bottom of the window, partially - // scrolled out of view, this ensures that the cursor is visible. - function maybeScrollWindow(cm, rect) { - if (signalDOMEvent(cm, "scrollCursorIntoView")) { return } - - var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; - var doc = display.wrapper.ownerDocument; - if (rect.top + box.top < 0) { doScroll = true; } - else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; } - if (doScroll != null && !phantom) { - var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;")); - cm.display.lineSpace.appendChild(scrollNode); - scrollNode.scrollIntoView(doScroll); - cm.display.lineSpace.removeChild(scrollNode); - } - } - - // Scroll a given position into view (immediately), verifying that - // it actually became visible (as line heights are accurately - // measured, the position of something may 'drift' during drawing). - function scrollPosIntoView(cm, pos, end, margin) { - if (margin == null) { margin = 0; } - var rect; - if (!cm.options.lineWrapping && pos == end) { - // Set pos and end to the cursor positions around the character pos sticks to - // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch - // If pos == Pos(_, 0, "before"), pos and end are unchanged - end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos; - pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos; - } - for (var limit = 0; limit < 5; limit++) { - var changed = false; - var coords = cursorCoords(cm, pos); - var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); - rect = {left: Math.min(coords.left, endCoords.left), - top: Math.min(coords.top, endCoords.top) - margin, - right: Math.max(coords.left, endCoords.left), - bottom: Math.max(coords.bottom, endCoords.bottom) + margin}; - var scrollPos = calculateScrollPos(cm, rect); - var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; - if (scrollPos.scrollTop != null) { - updateScrollTop(cm, scrollPos.scrollTop); - if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; } - } - if (scrollPos.scrollLeft != null) { - setScrollLeft(cm, scrollPos.scrollLeft); - if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; } - } - if (!changed) { break } - } - return rect - } - - // Scroll a given set of coordinates into view (immediately). - function scrollIntoView(cm, rect) { - var scrollPos = calculateScrollPos(cm, rect); - if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); } - if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); } - } - - // Calculate a new scroll position needed to scroll the given - // rectangle into view. Returns an object with scrollTop and - // scrollLeft properties. When these are undefined, the - // vertical/horizontal position does not need to be adjusted. - function calculateScrollPos(cm, rect) { - var display = cm.display, snapMargin = textHeight(cm.display); - if (rect.top < 0) { rect.top = 0; } - var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; - var screen = displayHeight(cm), result = {}; - if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; } - var docBottom = cm.doc.height + paddingVert(display); - var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin; - if (rect.top < screentop) { - result.scrollTop = atTop ? 0 : rect.top; - } else if (rect.bottom > screentop + screen) { - var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen); - if (newTop != screentop) { result.scrollTop = newTop; } - } - - var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth; - var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace; - var screenw = displayWidth(cm) - display.gutters.offsetWidth; - var tooWide = rect.right - rect.left > screenw; - if (tooWide) { rect.right = rect.left + screenw; } - if (rect.left < 10) - { result.scrollLeft = 0; } - else if (rect.left < screenleft) - { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); } - else if (rect.right > screenw + screenleft - 3) - { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; } - return result - } - - // Store a relative adjustment to the scroll position in the current - // operation (to be applied when the operation finishes). - function addToScrollTop(cm, top) { - if (top == null) { return } - resolveScrollToPos(cm); - cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; - } - - // Make sure that at the end of the operation the current cursor is - // shown. - function ensureCursorVisible(cm) { - resolveScrollToPos(cm); - var cur = cm.getCursor(); - cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin}; - } - - function scrollToCoords(cm, x, y) { - if (x != null || y != null) { resolveScrollToPos(cm); } - if (x != null) { cm.curOp.scrollLeft = x; } - if (y != null) { cm.curOp.scrollTop = y; } - } - - function scrollToRange(cm, range) { - resolveScrollToPos(cm); - cm.curOp.scrollToPos = range; - } - - // When an operation has its scrollToPos property set, and another - // scroll action is applied before the end of the operation, this - // 'simulates' scrolling that position into view in a cheap way, so - // that the effect of intermediate scroll commands is not ignored. - function resolveScrollToPos(cm) { - var range = cm.curOp.scrollToPos; - if (range) { - cm.curOp.scrollToPos = null; - var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); - scrollToCoordsRange(cm, from, to, range.margin); - } - } - - function scrollToCoordsRange(cm, from, to, margin) { - var sPos = calculateScrollPos(cm, { - left: Math.min(from.left, to.left), - top: Math.min(from.top, to.top) - margin, - right: Math.max(from.right, to.right), - bottom: Math.max(from.bottom, to.bottom) + margin - }); - scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop); - } - - // Sync the scrollable area and scrollbars, ensure the viewport - // covers the visible area. - function updateScrollTop(cm, val) { - if (Math.abs(cm.doc.scrollTop - val) < 2) { return } - if (!gecko) { updateDisplaySimple(cm, {top: val}); } - setScrollTop(cm, val, true); - if (gecko) { updateDisplaySimple(cm); } - startWorker(cm, 100); - } - - function setScrollTop(cm, val, forceScroll) { - val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val)); - if (cm.display.scroller.scrollTop == val && !forceScroll) { return } - cm.doc.scrollTop = val; - cm.display.scrollbars.setScrollTop(val); - if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; } - } - - // Sync scroller and scrollbar, ensure the gutter elements are - // aligned. - function setScrollLeft(cm, val, isScroller, forceScroll) { - val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)); - if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return } - cm.doc.scrollLeft = val; - alignHorizontally(cm); - if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; } - cm.display.scrollbars.setScrollLeft(val); - } - - // SCROLLBARS - - // Prepare DOM reads needed to update the scrollbars. Done in one - // shot to minimize update/measure roundtrips. - function measureForScrollbars(cm) { - var d = cm.display, gutterW = d.gutters.offsetWidth; - var docH = Math.round(cm.doc.height + paddingVert(cm.display)); - return { - clientHeight: d.scroller.clientHeight, - viewHeight: d.wrapper.clientHeight, - scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, - viewWidth: d.wrapper.clientWidth, - barLeft: cm.options.fixedGutter ? gutterW : 0, - docHeight: docH, - scrollHeight: docH + scrollGap(cm) + d.barHeight, - nativeBarWidth: d.nativeBarWidth, - gutterWidth: gutterW - } - } - - var NativeScrollbars = function(place, scroll, cm) { - this.cm = cm; - var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); - var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); - vert.tabIndex = horiz.tabIndex = -1; - place(vert); place(horiz); - - on(vert, "scroll", function () { - if (vert.clientHeight) { scroll(vert.scrollTop, "vertical"); } - }); - on(horiz, "scroll", function () { - if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal"); } - }); - - this.checkedZeroWidth = false; - // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). - if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; } - }; - - NativeScrollbars.prototype.update = function (measure) { - var needsH = measure.scrollWidth > measure.clientWidth + 1; - var needsV = measure.scrollHeight > measure.clientHeight + 1; - var sWidth = measure.nativeBarWidth; - - if (needsV) { - this.vert.style.display = "block"; - this.vert.style.bottom = needsH ? sWidth + "px" : "0"; - var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); - // A bug in IE8 can cause this value to be negative, so guard it. - this.vert.firstChild.style.height = - Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; - } else { - this.vert.scrollTop = 0; - this.vert.style.display = ""; - this.vert.firstChild.style.height = "0"; - } - - if (needsH) { - this.horiz.style.display = "block"; - this.horiz.style.right = needsV ? sWidth + "px" : "0"; - this.horiz.style.left = measure.barLeft + "px"; - var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); - this.horiz.firstChild.style.width = - Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; - } else { - this.horiz.style.display = ""; - this.horiz.firstChild.style.width = "0"; - } - - if (!this.checkedZeroWidth && measure.clientHeight > 0) { - if (sWidth == 0) { this.zeroWidthHack(); } - this.checkedZeroWidth = true; - } - - return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0} - }; - - NativeScrollbars.prototype.setScrollLeft = function (pos) { - if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; } - if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); } - }; - - NativeScrollbars.prototype.setScrollTop = function (pos) { - if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; } - if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); } - }; - - NativeScrollbars.prototype.zeroWidthHack = function () { - var w = mac && !mac_geMountainLion ? "12px" : "18px"; - this.horiz.style.height = this.vert.style.width = w; - this.horiz.style.visibility = this.vert.style.visibility = "hidden"; - this.disableHoriz = new Delayed; - this.disableVert = new Delayed; - }; - - NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) { - bar.style.visibility = ""; - function maybeDisable() { - // To find out whether the scrollbar is still visible, we - // check whether the element under the pixel in the bottom - // right corner of the scrollbar box is the scrollbar box - // itself (when the bar is still visible) or its filler child - // (when the bar is hidden). If it is still visible, we keep - // it enabled, if it's hidden, we disable pointer events. - var box = bar.getBoundingClientRect(); - var elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2) - : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1); - if (elt != bar) { bar.style.visibility = "hidden"; } - else { delay.set(1000, maybeDisable); } - } - delay.set(1000, maybeDisable); - }; - - NativeScrollbars.prototype.clear = function () { - var parent = this.horiz.parentNode; - parent.removeChild(this.horiz); - parent.removeChild(this.vert); - }; - - var NullScrollbars = function () {}; - - NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} }; - NullScrollbars.prototype.setScrollLeft = function () {}; - NullScrollbars.prototype.setScrollTop = function () {}; - NullScrollbars.prototype.clear = function () {}; - - function updateScrollbars(cm, measure) { - if (!measure) { measure = measureForScrollbars(cm); } - var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight; - updateScrollbarsInner(cm, measure); - for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { - if (startWidth != cm.display.barWidth && cm.options.lineWrapping) - { updateHeightsInViewport(cm); } - updateScrollbarsInner(cm, measureForScrollbars(cm)); - startWidth = cm.display.barWidth; startHeight = cm.display.barHeight; - } - } - - // Re-synchronize the fake scrollbars with the actual size of the - // content. - function updateScrollbarsInner(cm, measure) { - var d = cm.display; - var sizes = d.scrollbars.update(measure); - - d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; - d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; - d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"; - - if (sizes.right && sizes.bottom) { - d.scrollbarFiller.style.display = "block"; - d.scrollbarFiller.style.height = sizes.bottom + "px"; - d.scrollbarFiller.style.width = sizes.right + "px"; - } else { d.scrollbarFiller.style.display = ""; } - if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { - d.gutterFiller.style.display = "block"; - d.gutterFiller.style.height = sizes.bottom + "px"; - d.gutterFiller.style.width = measure.gutterWidth + "px"; - } else { d.gutterFiller.style.display = ""; } - } - - var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}; - - function initScrollbars(cm) { - if (cm.display.scrollbars) { - cm.display.scrollbars.clear(); - if (cm.display.scrollbars.addClass) - { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); } - } - - cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) { - cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); - // Prevent clicks in the scrollbars from killing focus - on(node, "mousedown", function () { - if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); } - }); - node.setAttribute("cm-not-content", "true"); - }, function (pos, axis) { - if (axis == "horizontal") { setScrollLeft(cm, pos); } - else { updateScrollTop(cm, pos); } - }, cm); - if (cm.display.scrollbars.addClass) - { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); } - } - - // Operations are used to wrap a series of changes to the editor - // state in such a way that each change won't have to update the - // cursor and display (which would be awkward, slow, and - // error-prone). Instead, display updates are batched and then all - // combined and executed at once. - - var nextOpId = 0; - // Start a new operation. - function startOperation(cm) { - cm.curOp = { - cm: cm, - viewChanged: false, // Flag that indicates that lines might need to be redrawn - startHeight: cm.doc.height, // Used to detect need to update scrollbar - forceUpdate: false, // Used to force a redraw - updateInput: 0, // Whether to reset the input textarea - typing: false, // Whether this reset should be careful to leave existing text (for compositing) - changeObjs: null, // Accumulated changes, for firing change events - cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on - cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already - selectionChanged: false, // Whether the selection needs to be redrawn - updateMaxLine: false, // Set when the widest line needs to be determined anew - scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet - scrollToPos: null, // Used to scroll to a specific position - focus: false, - id: ++nextOpId, // Unique ID - markArrays: null // Used by addMarkedSpan - }; - pushOperation(cm.curOp); - } - - // Finish an operation, updating the display and signalling delayed events - function endOperation(cm) { - var op = cm.curOp; - if (op) { finishOperation(op, function (group) { - for (var i = 0; i < group.ops.length; i++) - { group.ops[i].cm.curOp = null; } - endOperations(group); - }); } - } - - // The DOM updates done when an operation finishes are batched so - // that the minimum number of relayouts are required. - function endOperations(group) { - var ops = group.ops; - for (var i = 0; i < ops.length; i++) // Read DOM - { endOperation_R1(ops[i]); } - for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe) - { endOperation_W1(ops[i$1]); } - for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM - { endOperation_R2(ops[i$2]); } - for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe) - { endOperation_W2(ops[i$3]); } - for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM - { endOperation_finish(ops[i$4]); } - } - - function endOperation_R1(op) { - var cm = op.cm, display = cm.display; - maybeClipScrollbars(cm); - if (op.updateMaxLine) { findMaxLine(cm); } - - op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || - op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || - op.scrollToPos.to.line >= display.viewTo) || - display.maxLineChanged && cm.options.lineWrapping; - op.update = op.mustUpdate && - new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); - } - - function endOperation_W1(op) { - op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); - } - - function endOperation_R2(op) { - var cm = op.cm, display = cm.display; - if (op.updatedDisplay) { updateHeightsInViewport(cm); } - - op.barMeasure = measureForScrollbars(cm); - - // If the max line changed since it was last measured, measure it, - // and ensure the document's width matches it. - // updateDisplay_W2 will use these properties to do the actual resizing - if (display.maxLineChanged && !cm.options.lineWrapping) { - op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; - cm.display.sizerWidth = op.adjustWidthTo; - op.barMeasure.scrollWidth = - Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); - op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); - } - - if (op.updatedDisplay || op.selectionChanged) - { op.preparedSelection = display.input.prepareSelection(); } - } - - function endOperation_W2(op) { - var cm = op.cm; - - if (op.adjustWidthTo != null) { - cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; - if (op.maxScrollLeft < cm.doc.scrollLeft) - { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); } - cm.display.maxLineChanged = false; - } - - var takeFocus = op.focus && op.focus == activeElt(doc(cm)); - if (op.preparedSelection) - { cm.display.input.showSelection(op.preparedSelection, takeFocus); } - if (op.updatedDisplay || op.startHeight != cm.doc.height) - { updateScrollbars(cm, op.barMeasure); } - if (op.updatedDisplay) - { setDocumentHeight(cm, op.barMeasure); } - - if (op.selectionChanged) { restartBlink(cm); } - - if (cm.state.focused && op.updateInput) - { cm.display.input.reset(op.typing); } - if (takeFocus) { ensureFocus(op.cm); } - } - - function endOperation_finish(op) { - var cm = op.cm, display = cm.display, doc = cm.doc; - - if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); } - - // Abort mouse wheel delta measurement, when scrolling explicitly - if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) - { display.wheelStartX = display.wheelStartY = null; } - - // Propagate the scroll position to the actual DOM scroller - if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); } - - if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); } - // If we need to scroll a specific position into view, do so. - if (op.scrollToPos) { - var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), - clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); - maybeScrollWindow(cm, rect); - } - - // Fire events for markers that are hidden/unidden by editing or - // undoing - var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; - if (hidden) { for (var i = 0; i < hidden.length; ++i) - { if (!hidden[i].lines.length) { signal(hidden[i], "hide"); } } } - if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1) - { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide"); } } } - - if (display.wrapper.offsetHeight) - { doc.scrollTop = cm.display.scroller.scrollTop; } - - // Fire change events, and delayed event handlers - if (op.changeObjs) - { signal(cm, "changes", cm, op.changeObjs); } - if (op.update) - { op.update.finish(); } - } - - // Run the given function in an operation - function runInOp(cm, f) { - if (cm.curOp) { return f() } - startOperation(cm); - try { return f() } - finally { endOperation(cm); } - } - // Wraps a function in an operation. Returns the wrapped function. - function operation(cm, f) { - return function() { - if (cm.curOp) { return f.apply(cm, arguments) } - startOperation(cm); - try { return f.apply(cm, arguments) } - finally { endOperation(cm); } - } - } - // Used to add methods to editor and doc instances, wrapping them in - // operations. - function methodOp(f) { - return function() { - if (this.curOp) { return f.apply(this, arguments) } - startOperation(this); - try { return f.apply(this, arguments) } - finally { endOperation(this); } - } - } - function docMethodOp(f) { - return function() { - var cm = this.cm; - if (!cm || cm.curOp) { return f.apply(this, arguments) } - startOperation(cm); - try { return f.apply(this, arguments) } - finally { endOperation(cm); } - } - } - - // HIGHLIGHT WORKER - - function startWorker(cm, time) { - if (cm.doc.highlightFrontier < cm.display.viewTo) - { cm.state.highlight.set(time, bind(highlightWorker, cm)); } - } - - function highlightWorker(cm) { - var doc = cm.doc; - if (doc.highlightFrontier >= cm.display.viewTo) { return } - var end = +new Date + cm.options.workTime; - var context = getContextBefore(cm, doc.highlightFrontier); - var changedLines = []; - - doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) { - if (context.line >= cm.display.viewFrom) { // Visible - var oldStyles = line.styles; - var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null; - var highlighted = highlightLine(cm, line, context, true); - if (resetState) { context.state = resetState; } - line.styles = highlighted.styles; - var oldCls = line.styleClasses, newCls = highlighted.classes; - if (newCls) { line.styleClasses = newCls; } - else if (oldCls) { line.styleClasses = null; } - var ischange = !oldStyles || oldStyles.length != line.styles.length || - oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); - for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; } - if (ischange) { changedLines.push(context.line); } - line.stateAfter = context.save(); - context.nextLine(); - } else { - if (line.text.length <= cm.options.maxHighlightLength) - { processLine(cm, line.text, context); } - line.stateAfter = context.line % 5 == 0 ? context.save() : null; - context.nextLine(); - } - if (+new Date > end) { - startWorker(cm, cm.options.workDelay); - return true - } - }); - doc.highlightFrontier = context.line; - doc.modeFrontier = Math.max(doc.modeFrontier, context.line); - if (changedLines.length) { runInOp(cm, function () { - for (var i = 0; i < changedLines.length; i++) - { regLineChange(cm, changedLines[i], "text"); } - }); } - } - - // DISPLAY DRAWING - - var DisplayUpdate = function(cm, viewport, force) { - var display = cm.display; - - this.viewport = viewport; - // Store some values that we'll need later (but don't want to force a relayout for) - this.visible = visibleLines(display, cm.doc, viewport); - this.editorIsHidden = !display.wrapper.offsetWidth; - this.wrapperHeight = display.wrapper.clientHeight; - this.wrapperWidth = display.wrapper.clientWidth; - this.oldDisplayWidth = displayWidth(cm); - this.force = force; - this.dims = getDimensions(cm); - this.events = []; - }; - - DisplayUpdate.prototype.signal = function (emitter, type) { - if (hasHandler(emitter, type)) - { this.events.push(arguments); } - }; - DisplayUpdate.prototype.finish = function () { - for (var i = 0; i < this.events.length; i++) - { signal.apply(null, this.events[i]); } - }; - - function maybeClipScrollbars(cm) { - var display = cm.display; - if (!display.scrollbarsClipped && display.scroller.offsetWidth) { - display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; - display.heightForcer.style.height = scrollGap(cm) + "px"; - display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; - display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; - display.scrollbarsClipped = true; - } - } - - function selectionSnapshot(cm) { - if (cm.hasFocus()) { return null } - var active = activeElt(doc(cm)); - if (!active || !contains(cm.display.lineDiv, active)) { return null } - var result = {activeElt: active}; - if (window.getSelection) { - var sel = win(cm).getSelection(); - if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) { - result.anchorNode = sel.anchorNode; - result.anchorOffset = sel.anchorOffset; - result.focusNode = sel.focusNode; - result.focusOffset = sel.focusOffset; - } - } - return result - } - - function restoreSelection(snapshot) { - if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(snapshot.activeElt.ownerDocument)) { return } - snapshot.activeElt.focus(); - if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) && - snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { - var doc = snapshot.activeElt.ownerDocument; - var sel = doc.defaultView.getSelection(), range = doc.createRange(); - range.setEnd(snapshot.anchorNode, snapshot.anchorOffset); - range.collapse(false); - sel.removeAllRanges(); - sel.addRange(range); - sel.extend(snapshot.focusNode, snapshot.focusOffset); - } - } - - // Does the actual updating of the line display. Bails out - // (returning false) when there is nothing to be done and forced is - // false. - function updateDisplayIfNeeded(cm, update) { - var display = cm.display, doc = cm.doc; - - if (update.editorIsHidden) { - resetView(cm); - return false - } - - // Bail out if the visible area is already rendered and nothing changed. - if (!update.force && - update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && - (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && - display.renderedView == display.view && countDirtyView(cm) == 0) - { return false } - - if (maybeUpdateLineNumberWidth(cm)) { - resetView(cm); - update.dims = getDimensions(cm); - } - - // Compute a suitable new viewport (from & to) - var end = doc.first + doc.size; - var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); - var to = Math.min(end, update.visible.to + cm.options.viewportMargin); - if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); } - if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); } - if (sawCollapsedSpans) { - from = visualLineNo(cm.doc, from); - to = visualLineEndNo(cm.doc, to); - } - - var different = from != display.viewFrom || to != display.viewTo || - display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; - adjustView(cm, from, to); - - display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); - // Position the mover div to align with the current scroll position - cm.display.mover.style.top = display.viewOffset + "px"; - - var toUpdate = countDirtyView(cm); - if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && - (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) - { return false } - - // For big changes, we hide the enclosing element during the - // update, since that speeds up the operations on most browsers. - var selSnapshot = selectionSnapshot(cm); - if (toUpdate > 4) { display.lineDiv.style.display = "none"; } - patchDisplay(cm, display.updateLineNumbers, update.dims); - if (toUpdate > 4) { display.lineDiv.style.display = ""; } - display.renderedView = display.view; - // There might have been a widget with a focused element that got - // hidden or updated, if so re-focus it. - restoreSelection(selSnapshot); - - // Prevent selection and cursors from interfering with the scroll - // width and height. - removeChildren(display.cursorDiv); - removeChildren(display.selectionDiv); - display.gutters.style.height = display.sizer.style.minHeight = 0; - - if (different) { - display.lastWrapHeight = update.wrapperHeight; - display.lastWrapWidth = update.wrapperWidth; - startWorker(cm, 400); - } - - display.updateLineNumbers = null; - - return true - } - - function postUpdateDisplay(cm, update) { - var viewport = update.viewport; - - for (var first = true;; first = false) { - if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { - // Clip forced viewport to actual scrollable area. - if (viewport && viewport.top != null) - { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; } - // Updated line heights might result in the drawn area not - // actually covering the viewport. Keep looping until it does. - update.visible = visibleLines(cm.display, cm.doc, viewport); - if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) - { break } - } else if (first) { - update.visible = visibleLines(cm.display, cm.doc, viewport); - } - if (!updateDisplayIfNeeded(cm, update)) { break } - updateHeightsInViewport(cm); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - updateScrollbars(cm, barMeasure); - setDocumentHeight(cm, barMeasure); - update.force = false; - } - - update.signal(cm, "update", cm); - if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { - update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); - cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo; - } - } - - function updateDisplaySimple(cm, viewport) { - var update = new DisplayUpdate(cm, viewport); - if (updateDisplayIfNeeded(cm, update)) { - updateHeightsInViewport(cm); - postUpdateDisplay(cm, update); - var barMeasure = measureForScrollbars(cm); - updateSelection(cm); - updateScrollbars(cm, barMeasure); - setDocumentHeight(cm, barMeasure); - update.finish(); - } - } - - // Sync the actual display DOM structure with display.view, removing - // nodes for lines that are no longer in view, and creating the ones - // that are not there yet, and updating the ones that are out of - // date. - function patchDisplay(cm, updateNumbersFrom, dims) { - var display = cm.display, lineNumbers = cm.options.lineNumbers; - var container = display.lineDiv, cur = container.firstChild; - - function rm(node) { - var next = node.nextSibling; - // Works around a throw-scroll bug in OS X Webkit - if (webkit && mac && cm.display.currentWheelTarget == node) - { node.style.display = "none"; } - else - { node.parentNode.removeChild(node); } - return next - } - - var view = display.view, lineN = display.viewFrom; - // Loop over the elements in the view, syncing cur (the DOM nodes - // in display.lineDiv) with the view as we go. - for (var i = 0; i < view.length; i++) { - var lineView = view[i]; - if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet - var node = buildLineElement(cm, lineView, lineN, dims); - container.insertBefore(node, cur); - } else { // Already drawn - while (cur != lineView.node) { cur = rm(cur); } - var updateNumber = lineNumbers && updateNumbersFrom != null && - updateNumbersFrom <= lineN && lineView.lineNumber; - if (lineView.changes) { - if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false; } - updateLineForChanges(cm, lineView, lineN, dims); - } - if (updateNumber) { - removeChildren(lineView.lineNumber); - lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); - } - cur = lineView.node.nextSibling; - } - lineN += lineView.size; - } - while (cur) { cur = rm(cur); } - } - - function updateGutterSpace(display) { - var width = display.gutters.offsetWidth; - display.sizer.style.marginLeft = width + "px"; - // Send an event to consumers responding to changes in gutter width. - signalLater(display, "gutterChanged", display); - } - - function setDocumentHeight(cm, measure) { - cm.display.sizer.style.minHeight = measure.docHeight + "px"; - cm.display.heightForcer.style.top = measure.docHeight + "px"; - cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px"; - } - - // Re-align line numbers and gutter marks to compensate for - // horizontal scrolling. - function alignHorizontally(cm) { - var display = cm.display, view = display.view; - if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return } - var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; - var gutterW = display.gutters.offsetWidth, left = comp + "px"; - for (var i = 0; i < view.length; i++) { if (!view[i].hidden) { - if (cm.options.fixedGutter) { - if (view[i].gutter) - { view[i].gutter.style.left = left; } - if (view[i].gutterBackground) - { view[i].gutterBackground.style.left = left; } - } - var align = view[i].alignable; - if (align) { for (var j = 0; j < align.length; j++) - { align[j].style.left = left; } } - } } - if (cm.options.fixedGutter) - { display.gutters.style.left = (comp + gutterW) + "px"; } - } - - // Used to ensure that the line number gutter is still the right - // size for the current document size. Returns true when an update - // is needed. - function maybeUpdateLineNumberWidth(cm) { - if (!cm.options.lineNumbers) { return false } - var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; - if (last.length != display.lineNumChars) { - var test = display.measure.appendChild(elt("div", [elt("div", last)], - "CodeMirror-linenumber CodeMirror-gutter-elt")); - var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; - display.lineGutter.style.width = ""; - display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; - display.lineNumWidth = display.lineNumInnerWidth + padding; - display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; - display.lineGutter.style.width = display.lineNumWidth + "px"; - updateGutterSpace(cm.display); - return true - } - return false - } - - function getGutters(gutters, lineNumbers) { - var result = [], sawLineNumbers = false; - for (var i = 0; i < gutters.length; i++) { - var name = gutters[i], style = null; - if (typeof name != "string") { style = name.style; name = name.className; } - if (name == "CodeMirror-linenumbers") { - if (!lineNumbers) { continue } - else { sawLineNumbers = true; } - } - result.push({className: name, style: style}); - } - if (lineNumbers && !sawLineNumbers) { result.push({className: "CodeMirror-linenumbers", style: null}); } - return result - } - - // Rebuild the gutter elements, ensure the margin to the left of the - // code matches their width. - function renderGutters(display) { - var gutters = display.gutters, specs = display.gutterSpecs; - removeChildren(gutters); - display.lineGutter = null; - for (var i = 0; i < specs.length; ++i) { - var ref = specs[i]; - var className = ref.className; - var style = ref.style; - var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + className)); - if (style) { gElt.style.cssText = style; } - if (className == "CodeMirror-linenumbers") { - display.lineGutter = gElt; - gElt.style.width = (display.lineNumWidth || 1) + "px"; - } - } - gutters.style.display = specs.length ? "" : "none"; - updateGutterSpace(display); - } - - function updateGutters(cm) { - renderGutters(cm.display); - regChange(cm); - alignHorizontally(cm); - } - - // The display handles the DOM integration, both for input reading - // and content drawing. It holds references to DOM nodes and - // display-related state. - - function Display(place, doc, input, options) { - var d = this; - this.input = input; - - // Covers bottom-right square when both scrollbars are present. - d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); - d.scrollbarFiller.setAttribute("cm-not-content", "true"); - // Covers bottom of gutter when coverGutterNextToScrollbar is on - // and h scrollbar is present. - d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); - d.gutterFiller.setAttribute("cm-not-content", "true"); - // Will contain the actual code, positioned to cover the viewport. - d.lineDiv = eltP("div", null, "CodeMirror-code"); - // Elements are added to these to represent selection and cursors. - d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); - d.cursorDiv = elt("div", null, "CodeMirror-cursors"); - // A visibility: hidden element used to find the size of things. - d.measure = elt("div", null, "CodeMirror-measure"); - // When lines outside of the viewport are measured, they are drawn in this. - d.lineMeasure = elt("div", null, "CodeMirror-measure"); - // Wraps everything that needs to exist inside the vertically-padded coordinate system - d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], - null, "position: relative; outline: none"); - var lines = eltP("div", [d.lineSpace], "CodeMirror-lines"); - // Moved around its parent to cover visible view. - d.mover = elt("div", [lines], null, "position: relative"); - // Set to the height of the document, allowing scrolling. - d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); - d.sizerWidth = null; - // Behavior of elts with overflow: auto and padding is - // inconsistent across browsers. This is used to ensure the - // scrollable area is big enough. - d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); - // Will contain the gutters, if any. - d.gutters = elt("div", null, "CodeMirror-gutters"); - d.lineGutter = null; - // Actual scrollable element. - d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); - d.scroller.setAttribute("tabIndex", "-1"); - // The element in which the editor lives. - d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); - // See #6982. FIXME remove when this has been fixed for a while in Chrome - if (chrome && chrome_version >= 105) { d.wrapper.style.clipPath = "inset(0px)"; } - - // This attribute is respected by automatic translation systems such as Google Translate, - // and may also be respected by tools used by human translators. - d.wrapper.setAttribute('translate', 'no'); - - // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) - if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } - if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; } - - if (place) { - if (place.appendChild) { place.appendChild(d.wrapper); } - else { place(d.wrapper); } - } - - // Current rendered range (may be bigger than the view window). - d.viewFrom = d.viewTo = doc.first; - d.reportedViewFrom = d.reportedViewTo = doc.first; - // Information about the rendered lines. - d.view = []; - d.renderedView = null; - // Holds info about a single rendered line when it was rendered - // for measurement, while not in view. - d.externalMeasured = null; - // Empty space (in pixels) above the view - d.viewOffset = 0; - d.lastWrapHeight = d.lastWrapWidth = 0; - d.updateLineNumbers = null; - - d.nativeBarWidth = d.barHeight = d.barWidth = 0; - d.scrollbarsClipped = false; - - // Used to only resize the line number gutter when necessary (when - // the amount of lines crosses a boundary that makes its width change) - d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; - // Set to true when a non-horizontal-scrolling line widget is - // added. As an optimization, line widget aligning is skipped when - // this is false. - d.alignWidgets = false; - - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - - // Tracks the maximum line length so that the horizontal scrollbar - // can be kept static when scrolling. - d.maxLine = null; - d.maxLineLength = 0; - d.maxLineChanged = false; - - // Used for measuring wheel scrolling granularity - d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; - - // True when shift is held down. - d.shift = false; - - // Used to track whether anything happened since the context menu - // was opened. - d.selForContextMenu = null; - - d.activeTouch = null; - - d.gutterSpecs = getGutters(options.gutters, options.lineNumbers); - renderGutters(d); - - input.init(d); - } - - // Since the delta values reported on mouse wheel events are - // unstandardized between browsers and even browser versions, and - // generally horribly unpredictable, this code starts by measuring - // the scroll effect that the first few mouse wheel events have, - // and, from that, detects the way it can convert deltas to pixel - // offsets afterwards. - // - // The reason we want to know the amount a wheel event will scroll - // is that it gives us a chance to update the display before the - // actual scrolling happens, reducing flickering. - - var wheelSamples = 0, wheelPixelsPerUnit = null; - // Fill in a browser-detected starting value on browsers where we - // know one. These don't have to be accurate -- the result of them - // being wrong would just be a slight flicker on the first wheel - // scroll (if it is large enough). - if (ie) { wheelPixelsPerUnit = -.53; } - else if (gecko) { wheelPixelsPerUnit = 15; } - else if (chrome) { wheelPixelsPerUnit = -.7; } - else if (safari) { wheelPixelsPerUnit = -1/3; } - - function wheelEventDelta(e) { - var dx = e.wheelDeltaX, dy = e.wheelDeltaY; - if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; } - if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; } - else if (dy == null) { dy = e.wheelDelta; } - return {x: dx, y: dy} - } - function wheelEventPixels(e) { - var delta = wheelEventDelta(e); - delta.x *= wheelPixelsPerUnit; - delta.y *= wheelPixelsPerUnit; - return delta - } - - function onScrollWheel(cm, e) { - // On Chrome 102, viewport updates somehow stop wheel-based - // scrolling. Turning off pointer events during the scroll seems - // to avoid the issue. - if (chrome && chrome_version == 102) { - if (cm.display.chromeScrollHack == null) { cm.display.sizer.style.pointerEvents = "none"; } - else { clearTimeout(cm.display.chromeScrollHack); } - cm.display.chromeScrollHack = setTimeout(function () { - cm.display.chromeScrollHack = null; - cm.display.sizer.style.pointerEvents = ""; - }, 100); - } - var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y; - var pixelsPerUnit = wheelPixelsPerUnit; - if (e.deltaMode === 0) { - dx = e.deltaX; - dy = e.deltaY; - pixelsPerUnit = 1; - } - - var display = cm.display, scroll = display.scroller; - // Quit if there's nothing to scroll here - var canScrollX = scroll.scrollWidth > scroll.clientWidth; - var canScrollY = scroll.scrollHeight > scroll.clientHeight; - if (!(dx && canScrollX || dy && canScrollY)) { return } - - // Webkit browsers on OS X abort momentum scrolls when the target - // of the scroll event is removed from the scrollable element. - // This hack (see related code in patchDisplay) makes sure the - // element is kept around. - if (dy && mac && webkit) { - outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { - for (var i = 0; i < view.length; i++) { - if (view[i].node == cur) { - cm.display.currentWheelTarget = cur; - break outer - } - } - } - } - - // On some browsers, horizontal scrolling will cause redraws to - // happen before the gutter has been realigned, causing it to - // wriggle around in a most unseemly way. When we have an - // estimated pixels/delta value, we just handle horizontal - // scrolling entirely here. It'll be slightly off from native, but - // better than glitching out. - if (dx && !gecko && !presto && pixelsPerUnit != null) { - if (dy && canScrollY) - { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); } - setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit)); - // Only prevent default scrolling if vertical scrolling is - // actually possible. Otherwise, it causes vertical scroll - // jitter on OSX trackpads when deltaX is small and deltaY - // is large (issue #3579) - if (!dy || (dy && canScrollY)) - { e_preventDefault(e); } - display.wheelStartX = null; // Abort measurement, if in progress - return - } - - // 'Project' the visible viewport to cover the area that is being - // scrolled into view (if we know enough to estimate it). - if (dy && pixelsPerUnit != null) { - var pixels = dy * pixelsPerUnit; - var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; - if (pixels < 0) { top = Math.max(0, top + pixels - 50); } - else { bot = Math.min(cm.doc.height, bot + pixels + 50); } - updateDisplaySimple(cm, {top: top, bottom: bot}); - } - - if (wheelSamples < 20 && e.deltaMode !== 0) { - if (display.wheelStartX == null) { - display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; - display.wheelDX = dx; display.wheelDY = dy; - setTimeout(function () { - if (display.wheelStartX == null) { return } - var movedX = scroll.scrollLeft - display.wheelStartX; - var movedY = scroll.scrollTop - display.wheelStartY; - var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || - (movedX && display.wheelDX && movedX / display.wheelDX); - display.wheelStartX = display.wheelStartY = null; - if (!sample) { return } - wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); - ++wheelSamples; - }, 200); - } else { - display.wheelDX += dx; display.wheelDY += dy; - } - } - } - - // Selection objects are immutable. A new one is created every time - // the selection changes. A selection is one or more non-overlapping - // (and non-touching) ranges, sorted, and an integer that indicates - // which one is the primary selection (the one that's scrolled into - // view, that getCursor returns, etc). - var Selection = function(ranges, primIndex) { - this.ranges = ranges; - this.primIndex = primIndex; - }; - - Selection.prototype.primary = function () { return this.ranges[this.primIndex] }; - - Selection.prototype.equals = function (other) { - if (other == this) { return true } - if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false } - for (var i = 0; i < this.ranges.length; i++) { - var here = this.ranges[i], there = other.ranges[i]; - if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false } - } - return true - }; - - Selection.prototype.deepCopy = function () { - var out = []; - for (var i = 0; i < this.ranges.length; i++) - { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); } - return new Selection(out, this.primIndex) - }; - - Selection.prototype.somethingSelected = function () { - for (var i = 0; i < this.ranges.length; i++) - { if (!this.ranges[i].empty()) { return true } } - return false - }; - - Selection.prototype.contains = function (pos, end) { - if (!end) { end = pos; } - for (var i = 0; i < this.ranges.length; i++) { - var range = this.ranges[i]; - if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) - { return i } - } - return -1 - }; - - var Range = function(anchor, head) { - this.anchor = anchor; this.head = head; - }; - - Range.prototype.from = function () { return minPos(this.anchor, this.head) }; - Range.prototype.to = function () { return maxPos(this.anchor, this.head) }; - Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch }; - - // Take an unsorted, potentially overlapping set of ranges, and - // build a selection out of it. 'Consumes' ranges array (modifying - // it). - function normalizeSelection(cm, ranges, primIndex) { - var mayTouch = cm && cm.options.selectionsMayTouch; - var prim = ranges[primIndex]; - ranges.sort(function (a, b) { return cmp(a.from(), b.from()); }); - primIndex = indexOf(ranges, prim); - for (var i = 1; i < ranges.length; i++) { - var cur = ranges[i], prev = ranges[i - 1]; - var diff = cmp(prev.to(), cur.from()); - if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) { - var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); - var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; - if (i <= primIndex) { --primIndex; } - ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); - } - } - return new Selection(ranges, primIndex) - } - - function simpleSelection(anchor, head) { - return new Selection([new Range(anchor, head || anchor)], 0) - } - - // Compute the position of the end of a change (its 'to' property - // refers to the pre-change end). - function changeEnd(change) { - if (!change.text) { return change.to } - return Pos(change.from.line + change.text.length - 1, - lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)) - } - - // Adjust a position to refer to the post-change position of the - // same text, or the end of the change if the change covers it. - function adjustForChange(pos, change) { - if (cmp(pos, change.from) < 0) { return pos } - if (cmp(pos, change.to) <= 0) { return changeEnd(change) } - - var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; - if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; } - return Pos(line, ch) - } - - function computeSelAfterChange(doc, change) { - var out = []; - for (var i = 0; i < doc.sel.ranges.length; i++) { - var range = doc.sel.ranges[i]; - out.push(new Range(adjustForChange(range.anchor, change), - adjustForChange(range.head, change))); - } - return normalizeSelection(doc.cm, out, doc.sel.primIndex) - } - - function offsetPos(pos, old, nw) { - if (pos.line == old.line) - { return Pos(nw.line, pos.ch - old.ch + nw.ch) } - else - { return Pos(nw.line + (pos.line - old.line), pos.ch) } - } - - // Used by replaceSelections to allow moving the selection to the - // start or around the replaced test. Hint may be "start" or "around". - function computeReplacedSel(doc, changes, hint) { - var out = []; - var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; - var from = offsetPos(change.from, oldPrev, newPrev); - var to = offsetPos(changeEnd(change), oldPrev, newPrev); - oldPrev = change.to; - newPrev = to; - if (hint == "around") { - var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; - out[i] = new Range(inv ? to : from, inv ? from : to); - } else { - out[i] = new Range(from, from); - } - } - return new Selection(out, doc.sel.primIndex) - } - - // Used to get the editor into a consistent state again when options change. - - function loadMode(cm) { - cm.doc.mode = getMode(cm.options, cm.doc.modeOption); - resetModeState(cm); - } - - function resetModeState(cm) { - cm.doc.iter(function (line) { - if (line.stateAfter) { line.stateAfter = null; } - if (line.styles) { line.styles = null; } - }); - cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first; - startWorker(cm, 100); - cm.state.modeGen++; - if (cm.curOp) { regChange(cm); } - } - - // DOCUMENT DATA STRUCTURE - - // By default, updates that start and end at the beginning of a line - // are treated specially, in order to make the association of line - // widgets and marker elements with the text behave more intuitive. - function isWholeLineUpdate(doc, change) { - return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && - (!doc.cm || doc.cm.options.wholeLineUpdateBefore) - } - - // Perform a change on the document data structure. - function updateDoc(doc, change, markedSpans, estimateHeight) { - function spansFor(n) {return markedSpans ? markedSpans[n] : null} - function update(line, text, spans) { - updateLine(line, text, spans, estimateHeight); - signalLater(line, "change", line, change); - } - function linesFor(start, end) { - var result = []; - for (var i = start; i < end; ++i) - { result.push(new Line(text[i], spansFor(i), estimateHeight)); } - return result - } - - var from = change.from, to = change.to, text = change.text; - var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); - var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; - - // Adjust the line structure - if (change.full) { - doc.insert(0, linesFor(0, text.length)); - doc.remove(text.length, doc.size - text.length); - } else if (isWholeLineUpdate(doc, change)) { - // This is a whole-line replace. Treated specially to make - // sure line objects move the way they are supposed to. - var added = linesFor(0, text.length - 1); - update(lastLine, lastLine.text, lastSpans); - if (nlines) { doc.remove(from.line, nlines); } - if (added.length) { doc.insert(from.line, added); } - } else if (firstLine == lastLine) { - if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); - } else { - var added$1 = linesFor(1, text.length - 1); - added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight)); - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - doc.insert(from.line + 1, added$1); - } - } else if (text.length == 1) { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); - doc.remove(from.line + 1, nlines); - } else { - update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); - update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); - var added$2 = linesFor(1, text.length - 1); - if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); } - doc.insert(from.line + 1, added$2); - } - - signalLater(doc, "change", doc, change); - } - - // Call f for all linked documents. - function linkedDocs(doc, f, sharedHistOnly) { - function propagate(doc, skip, sharedHist) { - if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) { - var rel = doc.linked[i]; - if (rel.doc == skip) { continue } - var shared = sharedHist && rel.sharedHist; - if (sharedHistOnly && !shared) { continue } - f(rel.doc, shared); - propagate(rel.doc, doc, shared); - } } - } - propagate(doc, null, true); - } - - // Attach a document to an editor. - function attachDoc(cm, doc) { - if (doc.cm) { throw new Error("This document is already in use.") } - cm.doc = doc; - doc.cm = cm; - estimateLineHeights(cm); - loadMode(cm); - setDirectionClass(cm); - cm.options.direction = doc.direction; - if (!cm.options.lineWrapping) { findMaxLine(cm); } - cm.options.mode = doc.modeOption; - regChange(cm); - } - - function setDirectionClass(cm) { - (cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl"); - } - - function directionChanged(cm) { - runInOp(cm, function () { - setDirectionClass(cm); - regChange(cm); - }); - } - - function History(prev) { - // Arrays of change events and selections. Doing something adds an - // event to done and clears undo. Undoing moves events from done - // to undone, redoing moves them in the other direction. - this.done = []; this.undone = []; - this.undoDepth = prev ? prev.undoDepth : Infinity; - // Used to track when changes can be merged into a single undo - // event - this.lastModTime = this.lastSelTime = 0; - this.lastOp = this.lastSelOp = null; - this.lastOrigin = this.lastSelOrigin = null; - // Used by the isClean() method - this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1; - } - - // Create a history change event from an updateDoc-style change - // object. - function historyChangeFromChange(doc, change) { - var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; - attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); - linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true); - return histChange - } - - // Pop all selection events off the end of a history array. Stop at - // a change event. - function clearSelectionEvents(array) { - while (array.length) { - var last = lst(array); - if (last.ranges) { array.pop(); } - else { break } - } - } - - // Find the top change event in the history. Pop off selection - // events that are in the way. - function lastChangeEvent(hist, force) { - if (force) { - clearSelectionEvents(hist.done); - return lst(hist.done) - } else if (hist.done.length && !lst(hist.done).ranges) { - return lst(hist.done) - } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { - hist.done.pop(); - return lst(hist.done) - } - } - - // Register a change in the history. Merges changes that are within - // a single operation, or are close together with an origin that - // allows merging (starting with "+") into a single event. - function addChangeToHistory(doc, change, selAfter, opId) { - var hist = doc.history; - hist.undone.length = 0; - var time = +new Date, cur; - var last; - - if ((hist.lastOp == opId || - hist.lastOrigin == change.origin && change.origin && - ((change.origin.charAt(0) == "+" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) || - change.origin.charAt(0) == "*")) && - (cur = lastChangeEvent(hist, hist.lastOp == opId))) { - // Merge this change into the last event - last = lst(cur.changes); - if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { - // Optimized case for simple insertion -- don't want to add - // new changesets for every character typed - last.to = changeEnd(change); - } else { - // Add new sub-event - cur.changes.push(historyChangeFromChange(doc, change)); - } - } else { - // Can not be merged, start a new event. - var before = lst(hist.done); - if (!before || !before.ranges) - { pushSelectionToHistory(doc.sel, hist.done); } - cur = {changes: [historyChangeFromChange(doc, change)], - generation: hist.generation}; - hist.done.push(cur); - while (hist.done.length > hist.undoDepth) { - hist.done.shift(); - if (!hist.done[0].ranges) { hist.done.shift(); } - } - } - hist.done.push(selAfter); - hist.generation = ++hist.maxGeneration; - hist.lastModTime = hist.lastSelTime = time; - hist.lastOp = hist.lastSelOp = opId; - hist.lastOrigin = hist.lastSelOrigin = change.origin; - - if (!last) { signal(doc, "historyAdded"); } - } - - function selectionEventCanBeMerged(doc, origin, prev, sel) { - var ch = origin.charAt(0); - return ch == "*" || - ch == "+" && - prev.ranges.length == sel.ranges.length && - prev.somethingSelected() == sel.somethingSelected() && - new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500) - } - - // Called whenever the selection changes, sets the new selection as - // the pending selection in the history, and pushes the old pending - // selection into the 'done' array when it was significantly - // different (in number of selected ranges, emptiness, or time). - function addSelectionToHistory(doc, sel, opId, options) { - var hist = doc.history, origin = options && options.origin; - - // A new event is started when the previous origin does not match - // the current, or the origins don't allow matching. Origins - // starting with * are always merged, those starting with + are - // merged when similar and close together in time. - if (opId == hist.lastSelOp || - (origin && hist.lastSelOrigin == origin && - (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || - selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) - { hist.done[hist.done.length - 1] = sel; } - else - { pushSelectionToHistory(sel, hist.done); } - - hist.lastSelTime = +new Date; - hist.lastSelOrigin = origin; - hist.lastSelOp = opId; - if (options && options.clearRedo !== false) - { clearSelectionEvents(hist.undone); } - } - - function pushSelectionToHistory(sel, dest) { - var top = lst(dest); - if (!(top && top.ranges && top.equals(sel))) - { dest.push(sel); } - } - - // Used to store marked span information in the history. - function attachLocalSpans(doc, change, from, to) { - var existing = change["spans_" + doc.id], n = 0; - doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) { - if (line.markedSpans) - { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; } - ++n; - }); - } - - // When un/re-doing restores text containing marked spans, those - // that have been explicitly cleared should not be restored. - function removeClearedSpans(spans) { - if (!spans) { return null } - var out; - for (var i = 0; i < spans.length; ++i) { - if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } } - else if (out) { out.push(spans[i]); } - } - return !out ? spans : out.length ? out : null - } - - // Retrieve and filter the old marked spans stored in a change event. - function getOldSpans(doc, change) { - var found = change["spans_" + doc.id]; - if (!found) { return null } - var nw = []; - for (var i = 0; i < change.text.length; ++i) - { nw.push(removeClearedSpans(found[i])); } - return nw - } - - // Used for un/re-doing changes from the history. Combines the - // result of computing the existing spans with the set of spans that - // existed in the history (so that deleting around a span and then - // undoing brings back the span). - function mergeOldSpans(doc, change) { - var old = getOldSpans(doc, change); - var stretched = stretchSpansOverChange(doc, change); - if (!old) { return stretched } - if (!stretched) { return old } - - for (var i = 0; i < old.length; ++i) { - var oldCur = old[i], stretchCur = stretched[i]; - if (oldCur && stretchCur) { - spans: for (var j = 0; j < stretchCur.length; ++j) { - var span = stretchCur[j]; - for (var k = 0; k < oldCur.length; ++k) - { if (oldCur[k].marker == span.marker) { continue spans } } - oldCur.push(span); - } - } else if (stretchCur) { - old[i] = stretchCur; - } - } - return old - } - - // Used both to provide a JSON-safe object in .getHistory, and, when - // detaching a document, to split the history in two - function copyHistoryArray(events, newGroup, instantiateSel) { - var copy = []; - for (var i = 0; i < events.length; ++i) { - var event = events[i]; - if (event.ranges) { - copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); - continue - } - var changes = event.changes, newChanges = []; - copy.push({changes: newChanges}); - for (var j = 0; j < changes.length; ++j) { - var change = changes[j], m = (void 0); - newChanges.push({from: change.from, to: change.to, text: change.text}); - if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) { - if (indexOf(newGroup, Number(m[1])) > -1) { - lst(newChanges)[prop] = change[prop]; - delete change[prop]; - } - } } } - } - } - return copy - } - - // The 'scroll' parameter given to many of these indicated whether - // the new cursor position should be scrolled into view after - // modifying the selection. - - // If shift is held or the extend flag is set, extends a range to - // include a given position (and optionally a second position). - // Otherwise, simply returns the range between the given positions. - // Used for cursor motion and such. - function extendRange(range, head, other, extend) { - if (extend) { - var anchor = range.anchor; - if (other) { - var posBefore = cmp(head, anchor) < 0; - if (posBefore != (cmp(other, anchor) < 0)) { - anchor = head; - head = other; - } else if (posBefore != (cmp(head, other) < 0)) { - head = other; - } - } - return new Range(anchor, head) - } else { - return new Range(other || head, head) - } - } - - // Extend the primary selection range, discard the rest. - function extendSelection(doc, head, other, options, extend) { - if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); } - setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options); - } - - // Extend all selections (pos is an array of selections with length - // equal the number of selections) - function extendSelections(doc, heads, options) { - var out = []; - var extend = doc.cm && (doc.cm.display.shift || doc.extend); - for (var i = 0; i < doc.sel.ranges.length; i++) - { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); } - var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex); - setSelection(doc, newSel, options); - } - - // Updates a single range in the selection. - function replaceOneSelection(doc, i, range, options) { - var ranges = doc.sel.ranges.slice(0); - ranges[i] = range; - setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options); - } - - // Reset the selection to a single range. - function setSimpleSelection(doc, anchor, head, options) { - setSelection(doc, simpleSelection(anchor, head), options); - } - - // Give beforeSelectionChange handlers a change to influence a - // selection update. - function filterSelectionChange(doc, sel, options) { - var obj = { - ranges: sel.ranges, - update: function(ranges) { - this.ranges = []; - for (var i = 0; i < ranges.length; i++) - { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), - clipPos(doc, ranges[i].head)); } - }, - origin: options && options.origin - }; - signal(doc, "beforeSelectionChange", doc, obj); - if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj); } - if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) } - else { return sel } - } - - function setSelectionReplaceHistory(doc, sel, options) { - var done = doc.history.done, last = lst(done); - if (last && last.ranges) { - done[done.length - 1] = sel; - setSelectionNoUndo(doc, sel, options); - } else { - setSelection(doc, sel, options); - } - } - - // Set a new selection. - function setSelection(doc, sel, options) { - setSelectionNoUndo(doc, sel, options); - addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); - } - - function setSelectionNoUndo(doc, sel, options) { - if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) - { sel = filterSelectionChange(doc, sel, options); } - - var bias = options && options.bias || - (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); - setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); - - if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption("readOnly") != "nocursor") - { ensureCursorVisible(doc.cm); } - } - - function setSelectionInner(doc, sel) { - if (sel.equals(doc.sel)) { return } - - doc.sel = sel; - - if (doc.cm) { - doc.cm.curOp.updateInput = 1; - doc.cm.curOp.selectionChanged = true; - signalCursorActivity(doc.cm); - } - signalLater(doc, "cursorActivity", doc); - } - - // Verify that the selection does not partially select any atomic - // marked ranges. - function reCheckSelection(doc) { - setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false)); - } - - // Return a selection that does not partially select any atomic - // ranges. - function skipAtomicInSelection(doc, sel, bias, mayClear) { - var out; - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i]; - var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]; - var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear); - var newHead = range.head == range.anchor ? newAnchor : skipAtomic(doc, range.head, old && old.head, bias, mayClear); - if (out || newAnchor != range.anchor || newHead != range.head) { - if (!out) { out = sel.ranges.slice(0, i); } - out[i] = new Range(newAnchor, newHead); - } - } - return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel - } - - function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { - var line = getLine(doc, pos.line); - if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { - var sp = line.markedSpans[i], m = sp.marker; - - // Determine if we should prevent the cursor being placed to the left/right of an atomic marker - // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it - // is with selectLeft/Right - var preventCursorLeft = ("selectLeft" in m) ? !m.selectLeft : m.inclusiveLeft; - var preventCursorRight = ("selectRight" in m) ? !m.selectRight : m.inclusiveRight; - - if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && - (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) { - if (mayClear) { - signal(m, "beforeCursorEnter"); - if (m.explicitlyCleared) { - if (!line.markedSpans) { break } - else {--i; continue} - } - } - if (!m.atomic) { continue } - - if (oldPos) { - var near = m.find(dir < 0 ? 1 : -1), diff = (void 0); - if (dir < 0 ? preventCursorRight : preventCursorLeft) - { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); } - if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) - { return skipAtomicInner(doc, near, pos, dir, mayClear) } - } - - var far = m.find(dir < 0 ? -1 : 1); - if (dir < 0 ? preventCursorLeft : preventCursorRight) - { far = movePos(doc, far, dir, far.line == pos.line ? line : null); } - return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null - } - } } - return pos - } - - // Ensure a given position is not inside an atomic range. - function skipAtomic(doc, pos, oldPos, bias, mayClear) { - var dir = bias || 1; - var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || - (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) || - skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || - (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true)); - if (!found) { - doc.cantEdit = true; - return Pos(doc.first, 0) - } - return found - } - - function movePos(doc, pos, dir, line) { - if (dir < 0 && pos.ch == 0) { - if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) } - else { return null } - } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { - if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) } - else { return null } - } else { - return new Pos(pos.line, pos.ch + dir) - } - } - - function selectAll(cm) { - cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll); - } - - // UPDATING - - // Allow "beforeChange" event handlers to influence a change - function filterChange(doc, change, update) { - var obj = { - canceled: false, - from: change.from, - to: change.to, - text: change.text, - origin: change.origin, - cancel: function () { return obj.canceled = true; } - }; - if (update) { obj.update = function (from, to, text, origin) { - if (from) { obj.from = clipPos(doc, from); } - if (to) { obj.to = clipPos(doc, to); } - if (text) { obj.text = text; } - if (origin !== undefined) { obj.origin = origin; } - }; } - signal(doc, "beforeChange", doc, obj); - if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj); } - - if (obj.canceled) { - if (doc.cm) { doc.cm.curOp.updateInput = 2; } - return null - } - return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin} - } - - // Apply a change to a document, and add it to the document's - // history, and propagating it to all linked documents. - function makeChange(doc, change, ignoreReadOnly) { - if (doc.cm) { - if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) } - if (doc.cm.state.suppressEdits) { return } - } - - if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { - change = filterChange(doc, change, true); - if (!change) { return } - } - - // Possibly split or suppress the update based on the presence - // of read-only spans in its range. - var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); - if (split) { - for (var i = split.length - 1; i >= 0; --i) - { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text, origin: change.origin}); } - } else { - makeChangeInner(doc, change); - } - } - - function makeChangeInner(doc, change) { - if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return } - var selAfter = computeSelAfterChange(doc, change); - addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); - - makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); - var rebased = []; - - linkedDocs(doc, function (doc, sharedHist) { - if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change); - rebased.push(doc.history); - } - makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); - }); - } - - // Revert a change stored in a document's history. - function makeChangeFromHistory(doc, type, allowSelectionOnly) { - var suppress = doc.cm && doc.cm.state.suppressEdits; - if (suppress && !allowSelectionOnly) { return } - - var hist = doc.history, event, selAfter = doc.sel; - var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; - - // Verify that there is a useable event (so that ctrl-z won't - // needlessly clear selection events) - var i = 0; - for (; i < source.length; i++) { - event = source[i]; - if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) - { break } - } - if (i == source.length) { return } - hist.lastOrigin = hist.lastSelOrigin = null; - - for (;;) { - event = source.pop(); - if (event.ranges) { - pushSelectionToHistory(event, dest); - if (allowSelectionOnly && !event.equals(doc.sel)) { - setSelection(doc, event, {clearRedo: false}); - return - } - selAfter = event; - } else if (suppress) { - source.push(event); - return - } else { break } - } - - // Build up a reverse change object to add to the opposite history - // stack (redo when undoing, and vice versa). - var antiChanges = []; - pushSelectionToHistory(selAfter, dest); - dest.push({changes: antiChanges, generation: hist.generation}); - hist.generation = event.generation || ++hist.maxGeneration; - - var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); - - var loop = function ( i ) { - var change = event.changes[i]; - change.origin = type; - if (filter && !filterChange(doc, change, false)) { - source.length = 0; - return {} - } - - antiChanges.push(historyChangeFromChange(doc, change)); - - var after = i ? computeSelAfterChange(doc, change) : lst(source); - makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); - if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); } - var rebased = []; - - // Propagate to the linked documents - linkedDocs(doc, function (doc, sharedHist) { - if (!sharedHist && indexOf(rebased, doc.history) == -1) { - rebaseHist(doc.history, change); - rebased.push(doc.history); - } - makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); - }); - }; - - for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) { - var returned = loop( i$1 ); - - if ( returned ) return returned.v; - } - } - - // Sub-views need their line numbers shifted when text is added - // above or below them in the parent document. - function shiftDoc(doc, distance) { - if (distance == 0) { return } - doc.first += distance; - doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range( - Pos(range.anchor.line + distance, range.anchor.ch), - Pos(range.head.line + distance, range.head.ch) - ); }), doc.sel.primIndex); - if (doc.cm) { - regChange(doc.cm, doc.first, doc.first - distance, distance); - for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) - { regLineChange(doc.cm, l, "gutter"); } - } - } - - // More lower-level change function, handling only a single document - // (not linked ones). - function makeChangeSingleDoc(doc, change, selAfter, spans) { - if (doc.cm && !doc.cm.curOp) - { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) } - - if (change.to.line < doc.first) { - shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); - return - } - if (change.from.line > doc.lastLine()) { return } - - // Clip the change to the size of this doc - if (change.from.line < doc.first) { - var shift = change.text.length - 1 - (doc.first - change.from.line); - shiftDoc(doc, shift); - change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), - text: [lst(change.text)], origin: change.origin}; - } - var last = doc.lastLine(); - if (change.to.line > last) { - change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), - text: [change.text[0]], origin: change.origin}; - } - - change.removed = getBetween(doc, change.from, change.to); - - if (!selAfter) { selAfter = computeSelAfterChange(doc, change); } - if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); } - else { updateDoc(doc, change, spans); } - setSelectionNoUndo(doc, selAfter, sel_dontScroll); - - if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0))) - { doc.cantEdit = false; } - } - - // Handle the interaction of a change to a document with the editor - // that this document is part of. - function makeChangeSingleDocInEditor(cm, change, spans) { - var doc = cm.doc, display = cm.display, from = change.from, to = change.to; - - var recomputeMaxLength = false, checkWidthStart = from.line; - if (!cm.options.lineWrapping) { - checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); - doc.iter(checkWidthStart, to.line + 1, function (line) { - if (line == display.maxLine) { - recomputeMaxLength = true; - return true - } - }); - } - - if (doc.sel.contains(change.from, change.to) > -1) - { signalCursorActivity(cm); } - - updateDoc(doc, change, spans, estimateHeight(cm)); - - if (!cm.options.lineWrapping) { - doc.iter(checkWidthStart, from.line + change.text.length, function (line) { - var len = lineLength(line); - if (len > display.maxLineLength) { - display.maxLine = line; - display.maxLineLength = len; - display.maxLineChanged = true; - recomputeMaxLength = false; - } - }); - if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; } - } - - retreatFrontier(doc, from.line); - startWorker(cm, 400); - - var lendiff = change.text.length - (to.line - from.line) - 1; - // Remember that these lines changed, for updating the display - if (change.full) - { regChange(cm); } - else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) - { regLineChange(cm, from.line, "text"); } - else - { regChange(cm, from.line, to.line + 1, lendiff); } - - var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); - if (changeHandler || changesHandler) { - var obj = { - from: from, to: to, - text: change.text, - removed: change.removed, - origin: change.origin - }; - if (changeHandler) { signalLater(cm, "change", cm, obj); } - if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); } - } - cm.display.selForContextMenu = null; - } - - function replaceRange(doc, code, from, to, origin) { - var assign; - - if (!to) { to = from; } - if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); } - if (typeof code == "string") { code = doc.splitLines(code); } - makeChange(doc, {from: from, to: to, text: code, origin: origin}); - } - - // Rebasing/resetting history to deal with externally-sourced changes - - function rebaseHistSelSingle(pos, from, to, diff) { - if (to < pos.line) { - pos.line += diff; - } else if (from < pos.line) { - pos.line = from; - pos.ch = 0; - } - } - - // Tries to rebase an array of history events given a change in the - // document. If the change touches the same lines as the event, the - // event, and everything 'behind' it, is discarded. If the change is - // before the event, the event's positions are updated. Uses a - // copy-on-write scheme for the positions, to avoid having to - // reallocate them all on every rebase, but also avoid problems with - // shared position objects being unsafely updated. - function rebaseHistArray(array, from, to, diff) { - for (var i = 0; i < array.length; ++i) { - var sub = array[i], ok = true; - if (sub.ranges) { - if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } - for (var j = 0; j < sub.ranges.length; j++) { - rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); - rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); - } - continue - } - for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) { - var cur = sub.changes[j$1]; - if (to < cur.from.line) { - cur.from = Pos(cur.from.line + diff, cur.from.ch); - cur.to = Pos(cur.to.line + diff, cur.to.ch); - } else if (from <= cur.to.line) { - ok = false; - break - } - } - if (!ok) { - array.splice(0, i + 1); - i = 0; - } - } - } - - function rebaseHist(hist, change) { - var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; - rebaseHistArray(hist.done, from, to, diff); - rebaseHistArray(hist.undone, from, to, diff); - } - - // Utility for applying a change to a line by handle or number, - // returning the number and optionally registering the line as - // changed. - function changeLine(doc, handle, changeType, op) { - var no = handle, line = handle; - if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)); } - else { no = lineNo(handle); } - if (no == null) { return null } - if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); } - return line - } - - // The document is represented as a BTree consisting of leaves, with - // chunk of lines in them, and branches, with up to ten leaves or - // other branch nodes below them. The top node is always a branch - // node, and is the document object itself (meaning it has - // additional methods and properties). - // - // All nodes have parent links. The tree is used both to go from - // line numbers to line objects, and to go from objects to numbers. - // It also indexes by height, and is used to convert between height - // and line object, and to find the total height of the document. - // - // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html - - function LeafChunk(lines) { - this.lines = lines; - this.parent = null; - var height = 0; - for (var i = 0; i < lines.length; ++i) { - lines[i].parent = this; - height += lines[i].height; - } - this.height = height; - } - - LeafChunk.prototype = { - chunkSize: function() { return this.lines.length }, - - // Remove the n lines at offset 'at'. - removeInner: function(at, n) { - for (var i = at, e = at + n; i < e; ++i) { - var line = this.lines[i]; - this.height -= line.height; - cleanUpLine(line); - signalLater(line, "delete"); - } - this.lines.splice(at, n); - }, - - // Helper used to collapse a small branch into a single leaf. - collapse: function(lines) { - lines.push.apply(lines, this.lines); - }, - - // Insert the given array of lines at offset 'at', count them as - // having the given height. - insertInner: function(at, lines, height) { - this.height += height; - this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); - for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; } - }, - - // Used to iterate over a part of the tree. - iterN: function(at, n, op) { - for (var e = at + n; at < e; ++at) - { if (op(this.lines[at])) { return true } } - } - }; - - function BranchChunk(children) { - this.children = children; - var size = 0, height = 0; - for (var i = 0; i < children.length; ++i) { - var ch = children[i]; - size += ch.chunkSize(); height += ch.height; - ch.parent = this; - } - this.size = size; - this.height = height; - this.parent = null; - } - - BranchChunk.prototype = { - chunkSize: function() { return this.size }, - - removeInner: function(at, n) { - this.size -= n; - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var rm = Math.min(n, sz - at), oldHeight = child.height; - child.removeInner(at, rm); - this.height -= oldHeight - child.height; - if (sz == rm) { this.children.splice(i--, 1); child.parent = null; } - if ((n -= rm) == 0) { break } - at = 0; - } else { at -= sz; } - } - // If the result is smaller than 25 lines, ensure that it is a - // single leaf node. - if (this.size - n < 25 && - (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { - var lines = []; - this.collapse(lines); - this.children = [new LeafChunk(lines)]; - this.children[0].parent = this; - } - }, - - collapse: function(lines) { - for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); } - }, - - insertInner: function(at, lines, height) { - this.size += lines.length; - this.height += height; - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at <= sz) { - child.insertInner(at, lines, height); - if (child.lines && child.lines.length > 50) { - // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced. - // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest. - var remaining = child.lines.length % 25 + 25; - for (var pos = remaining; pos < child.lines.length;) { - var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)); - child.height -= leaf.height; - this.children.splice(++i, 0, leaf); - leaf.parent = this; - } - child.lines = child.lines.slice(0, remaining); - this.maybeSpill(); - } - break - } - at -= sz; - } - }, - - // When a node has grown, check whether it should be split. - maybeSpill: function() { - if (this.children.length <= 10) { return } - var me = this; - do { - var spilled = me.children.splice(me.children.length - 5, 5); - var sibling = new BranchChunk(spilled); - if (!me.parent) { // Become the parent node - var copy = new BranchChunk(me.children); - copy.parent = me; - me.children = [copy, sibling]; - me = copy; - } else { - me.size -= sibling.size; - me.height -= sibling.height; - var myIndex = indexOf(me.parent.children, me); - me.parent.children.splice(myIndex + 1, 0, sibling); - } - sibling.parent = me.parent; - } while (me.children.length > 10) - me.parent.maybeSpill(); - }, - - iterN: function(at, n, op) { - for (var i = 0; i < this.children.length; ++i) { - var child = this.children[i], sz = child.chunkSize(); - if (at < sz) { - var used = Math.min(n, sz - at); - if (child.iterN(at, used, op)) { return true } - if ((n -= used) == 0) { break } - at = 0; - } else { at -= sz; } - } - } - }; - - // Line widgets are block elements displayed above or below a line. - - var LineWidget = function(doc, node, options) { - if (options) { for (var opt in options) { if (options.hasOwnProperty(opt)) - { this[opt] = options[opt]; } } } - this.doc = doc; - this.node = node; - }; - - LineWidget.prototype.clear = function () { - var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); - if (no == null || !ws) { return } - for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } } - if (!ws.length) { line.widgets = null; } - var height = widgetHeight(this); - updateLineHeight(line, Math.max(0, line.height - height)); - if (cm) { - runInOp(cm, function () { - adjustScrollWhenAboveVisible(cm, line, -height); - regLineChange(cm, no, "widget"); - }); - signalLater(cm, "lineWidgetCleared", cm, this, no); - } - }; - - LineWidget.prototype.changed = function () { - var this$1 = this; - - var oldH = this.height, cm = this.doc.cm, line = this.line; - this.height = null; - var diff = widgetHeight(this) - oldH; - if (!diff) { return } - if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); } - if (cm) { - runInOp(cm, function () { - cm.curOp.forceUpdate = true; - adjustScrollWhenAboveVisible(cm, line, diff); - signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line)); - }); - } - }; - eventMixin(LineWidget); - - function adjustScrollWhenAboveVisible(cm, line, diff) { - if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) - { addToScrollTop(cm, diff); } - } - - function addLineWidget(doc, handle, node, options) { - var widget = new LineWidget(doc, node, options); - var cm = doc.cm; - if (cm && widget.noHScroll) { cm.display.alignWidgets = true; } - changeLine(doc, handle, "widget", function (line) { - var widgets = line.widgets || (line.widgets = []); - if (widget.insertAt == null) { widgets.push(widget); } - else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); } - widget.line = line; - if (cm && !lineIsHidden(doc, line)) { - var aboveVisible = heightAtLine(line) < doc.scrollTop; - updateLineHeight(line, line.height + widgetHeight(widget)); - if (aboveVisible) { addToScrollTop(cm, widget.height); } - cm.curOp.forceUpdate = true; - } - return true - }); - if (cm) { signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)); } - return widget - } - - // TEXTMARKERS - - // Created with markText and setBookmark methods. A TextMarker is a - // handle that can be used to clear or find a marked position in the - // document. Line objects hold arrays (markedSpans) containing - // {from, to, marker} object pointing to such marker objects, and - // indicating that such a marker is present on that line. Multiple - // lines may point to the same marker when it spans across lines. - // The spans will have null for their from/to properties when the - // marker continues beyond the start/end of the line. Markers have - // links back to the lines they currently touch. - - // Collapsed markers have unique ids, in order to be able to order - // them, which is needed for uniquely determining an outer marker - // when they overlap (they may nest, but not partially overlap). - var nextMarkerId = 0; - - var TextMarker = function(doc, type) { - this.lines = []; - this.type = type; - this.doc = doc; - this.id = ++nextMarkerId; - }; - - // Clear the marker. - TextMarker.prototype.clear = function () { - if (this.explicitlyCleared) { return } - var cm = this.doc.cm, withOp = cm && !cm.curOp; - if (withOp) { startOperation(cm); } - if (hasHandler(this, "clear")) { - var found = this.find(); - if (found) { signalLater(this, "clear", found.from, found.to); } - } - var min = null, max = null; - for (var i = 0; i < this.lines.length; ++i) { - var line = this.lines[i]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), "text"); } - else if (cm) { - if (span.to != null) { max = lineNo(line); } - if (span.from != null) { min = lineNo(line); } - } - line.markedSpans = removeMarkedSpan(line.markedSpans, span); - if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm) - { updateLineHeight(line, textHeight(cm.display)); } - } - if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) { - var visual = visualLine(this.lines[i$1]), len = lineLength(visual); - if (len > cm.display.maxLineLength) { - cm.display.maxLine = visual; - cm.display.maxLineLength = len; - cm.display.maxLineChanged = true; - } - } } - - if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); } - this.lines.length = 0; - this.explicitlyCleared = true; - if (this.atomic && this.doc.cantEdit) { - this.doc.cantEdit = false; - if (cm) { reCheckSelection(cm.doc); } - } - if (cm) { signalLater(cm, "markerCleared", cm, this, min, max); } - if (withOp) { endOperation(cm); } - if (this.parent) { this.parent.clear(); } - }; - - // Find the position of the marker in the document. Returns a {from, - // to} object by default. Side can be passed to get a specific side - // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the - // Pos objects returned contain a line object, rather than a line - // number (used to prevent looking up the same line twice). - TextMarker.prototype.find = function (side, lineObj) { - if (side == null && this.type == "bookmark") { side = 1; } - var from, to; - for (var i = 0; i < this.lines.length; ++i) { - var line = this.lines[i]; - var span = getMarkedSpanFor(line.markedSpans, this); - if (span.from != null) { - from = Pos(lineObj ? line : lineNo(line), span.from); - if (side == -1) { return from } - } - if (span.to != null) { - to = Pos(lineObj ? line : lineNo(line), span.to); - if (side == 1) { return to } - } - } - return from && {from: from, to: to} - }; - - // Signals that the marker's widget changed, and surrounding layout - // should be recomputed. - TextMarker.prototype.changed = function () { - var this$1 = this; - - var pos = this.find(-1, true), widget = this, cm = this.doc.cm; - if (!pos || !cm) { return } - runInOp(cm, function () { - var line = pos.line, lineN = lineNo(pos.line); - var view = findViewForLine(cm, lineN); - if (view) { - clearLineMeasurementCacheFor(view); - cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; - } - cm.curOp.updateMaxLine = true; - if (!lineIsHidden(widget.doc, line) && widget.height != null) { - var oldHeight = widget.height; - widget.height = null; - var dHeight = widgetHeight(widget) - oldHeight; - if (dHeight) - { updateLineHeight(line, line.height + dHeight); } - } - signalLater(cm, "markerChanged", cm, this$1); - }); - }; - - TextMarker.prototype.attachLine = function (line) { - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp; - if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) - { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); } - } - this.lines.push(line); - }; - - TextMarker.prototype.detachLine = function (line) { - this.lines.splice(indexOf(this.lines, line), 1); - if (!this.lines.length && this.doc.cm) { - var op = this.doc.cm.curOp - ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); - } - }; - eventMixin(TextMarker); - - // Create a marker, wire it up to the right lines, and - function markText(doc, from, to, options, type) { - // Shared markers (across linked documents) are handled separately - // (markTextShared will call out to this again, once per - // document). - if (options && options.shared) { return markTextShared(doc, from, to, options, type) } - // Ensure we are in an operation. - if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) } - - var marker = new TextMarker(doc, type), diff = cmp(from, to); - if (options) { copyObj(options, marker, false); } - // Don't connect empty markers unless clearWhenEmpty is false - if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) - { return marker } - if (marker.replacedWith) { - // Showing up as a widget implies collapsed (widget replaces text) - marker.collapsed = true; - marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget"); - if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true"); } - if (options.insertLeft) { marker.widgetNode.insertLeft = true; } - } - if (marker.collapsed) { - if (conflictingCollapsedRange(doc, from.line, from, to, marker) || - from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) - { throw new Error("Inserting collapsed marker partially overlapping an existing one") } - seeCollapsedSpans(); - } - - if (marker.addToHistory) - { addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); } - - var curLine = from.line, cm = doc.cm, updateMaxLine; - doc.iter(curLine, to.line + 1, function (line) { - if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) - { updateMaxLine = true; } - if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); } - addMarkedSpan(line, new MarkedSpan(marker, - curLine == from.line ? from.ch : null, - curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp); - ++curLine; - }); - // lineIsHidden depends on the presence of the spans, so needs a second pass - if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) { - if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); } - }); } - - if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }); } - - if (marker.readOnly) { - seeReadOnlySpans(); - if (doc.history.done.length || doc.history.undone.length) - { doc.clearHistory(); } - } - if (marker.collapsed) { - marker.id = ++nextMarkerId; - marker.atomic = true; - } - if (cm) { - // Sync editor state - if (updateMaxLine) { cm.curOp.updateMaxLine = true; } - if (marker.collapsed) - { regChange(cm, from.line, to.line + 1); } - else if (marker.className || marker.startStyle || marker.endStyle || marker.css || - marker.attributes || marker.title) - { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text"); } } - if (marker.atomic) { reCheckSelection(cm.doc); } - signalLater(cm, "markerAdded", cm, marker); - } - return marker - } - - // SHARED TEXTMARKERS - - // A shared marker spans multiple linked documents. It is - // implemented as a meta-marker-object controlling multiple normal - // markers. - var SharedTextMarker = function(markers, primary) { - this.markers = markers; - this.primary = primary; - for (var i = 0; i < markers.length; ++i) - { markers[i].parent = this; } - }; - - SharedTextMarker.prototype.clear = function () { - if (this.explicitlyCleared) { return } - this.explicitlyCleared = true; - for (var i = 0; i < this.markers.length; ++i) - { this.markers[i].clear(); } - signalLater(this, "clear"); - }; - - SharedTextMarker.prototype.find = function (side, lineObj) { - return this.primary.find(side, lineObj) - }; - eventMixin(SharedTextMarker); - - function markTextShared(doc, from, to, options, type) { - options = copyObj(options); - options.shared = false; - var markers = [markText(doc, from, to, options, type)], primary = markers[0]; - var widget = options.widgetNode; - linkedDocs(doc, function (doc) { - if (widget) { options.widgetNode = widget.cloneNode(true); } - markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); - for (var i = 0; i < doc.linked.length; ++i) - { if (doc.linked[i].isParent) { return } } - primary = lst(markers); - }); - return new SharedTextMarker(markers, primary) - } - - function findSharedMarkers(doc) { - return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; }) - } - - function copySharedMarkers(doc, markers) { - for (var i = 0; i < markers.length; i++) { - var marker = markers[i], pos = marker.find(); - var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); - if (cmp(mFrom, mTo)) { - var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); - marker.markers.push(subMark); - subMark.parent = marker; - } - } - } - - function detachSharedMarkers(markers) { - var loop = function ( i ) { - var marker = markers[i], linked = [marker.primary.doc]; - linkedDocs(marker.primary.doc, function (d) { return linked.push(d); }); - for (var j = 0; j < marker.markers.length; j++) { - var subMarker = marker.markers[j]; - if (indexOf(linked, subMarker.doc) == -1) { - subMarker.parent = null; - marker.markers.splice(j--, 1); - } - } - }; - - for (var i = 0; i < markers.length; i++) loop( i ); - } - - var nextDocId = 0; - var Doc = function(text, mode, firstLine, lineSep, direction) { - if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) } - if (firstLine == null) { firstLine = 0; } - - BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); - this.first = firstLine; - this.scrollTop = this.scrollLeft = 0; - this.cantEdit = false; - this.cleanGeneration = 1; - this.modeFrontier = this.highlightFrontier = firstLine; - var start = Pos(firstLine, 0); - this.sel = simpleSelection(start); - this.history = new History(null); - this.id = ++nextDocId; - this.modeOption = mode; - this.lineSep = lineSep; - this.direction = (direction == "rtl") ? "rtl" : "ltr"; - this.extend = false; - - if (typeof text == "string") { text = this.splitLines(text); } - updateDoc(this, {from: start, to: start, text: text}); - setSelection(this, simpleSelection(start), sel_dontScroll); - }; - - Doc.prototype = createObj(BranchChunk.prototype, { - constructor: Doc, - // Iterate over the document. Supports two forms -- with only one - // argument, it calls that for each line in the document. With - // three, it iterates over the range given by the first two (with - // the second being non-inclusive). - iter: function(from, to, op) { - if (op) { this.iterN(from - this.first, to - from, op); } - else { this.iterN(this.first, this.first + this.size, from); } - }, - - // Non-public interface for adding and removing lines. - insert: function(at, lines) { - var height = 0; - for (var i = 0; i < lines.length; ++i) { height += lines[i].height; } - this.insertInner(at - this.first, lines, height); - }, - remove: function(at, n) { this.removeInner(at - this.first, n); }, - - // From here, the methods are part of the public interface. Most - // are also available from CodeMirror (editor) instances. - - getValue: function(lineSep) { - var lines = getLines(this, this.first, this.first + this.size); - if (lineSep === false) { return lines } - return lines.join(lineSep || this.lineSeparator()) - }, - setValue: docMethodOp(function(code) { - var top = Pos(this.first, 0), last = this.first + this.size - 1; - makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), - text: this.splitLines(code), origin: "setValue", full: true}, true); - if (this.cm) { scrollToCoords(this.cm, 0, 0); } - setSelection(this, simpleSelection(top), sel_dontScroll); - }), - replaceRange: function(code, from, to, origin) { - from = clipPos(this, from); - to = to ? clipPos(this, to) : from; - replaceRange(this, code, from, to, origin); - }, - getRange: function(from, to, lineSep) { - var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); - if (lineSep === false) { return lines } - if (lineSep === '') { return lines.join('') } - return lines.join(lineSep || this.lineSeparator()) - }, - - getLine: function(line) {var l = this.getLineHandle(line); return l && l.text}, - - getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }}, - getLineNumber: function(line) {return lineNo(line)}, - - getLineHandleVisualStart: function(line) { - if (typeof line == "number") { line = getLine(this, line); } - return visualLine(line) - }, - - lineCount: function() {return this.size}, - firstLine: function() {return this.first}, - lastLine: function() {return this.first + this.size - 1}, - - clipPos: function(pos) {return clipPos(this, pos)}, - - getCursor: function(start) { - var range = this.sel.primary(), pos; - if (start == null || start == "head") { pos = range.head; } - else if (start == "anchor") { pos = range.anchor; } - else if (start == "end" || start == "to" || start === false) { pos = range.to(); } - else { pos = range.from(); } - return pos - }, - listSelections: function() { return this.sel.ranges }, - somethingSelected: function() {return this.sel.somethingSelected()}, - - setCursor: docMethodOp(function(line, ch, options) { - setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); - }), - setSelection: docMethodOp(function(anchor, head, options) { - setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); - }), - extendSelection: docMethodOp(function(head, other, options) { - extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); - }), - extendSelections: docMethodOp(function(heads, options) { - extendSelections(this, clipPosArray(this, heads), options); - }), - extendSelectionsBy: docMethodOp(function(f, options) { - var heads = map(this.sel.ranges, f); - extendSelections(this, clipPosArray(this, heads), options); - }), - setSelections: docMethodOp(function(ranges, primary, options) { - if (!ranges.length) { return } - var out = []; - for (var i = 0; i < ranges.length; i++) - { out[i] = new Range(clipPos(this, ranges[i].anchor), - clipPos(this, ranges[i].head || ranges[i].anchor)); } - if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); } - setSelection(this, normalizeSelection(this.cm, out, primary), options); - }), - addSelection: docMethodOp(function(anchor, head, options) { - var ranges = this.sel.ranges.slice(0); - ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); - setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options); - }), - - getSelection: function(lineSep) { - var ranges = this.sel.ranges, lines; - for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this, ranges[i].from(), ranges[i].to()); - lines = lines ? lines.concat(sel) : sel; - } - if (lineSep === false) { return lines } - else { return lines.join(lineSep || this.lineSeparator()) } - }, - getSelections: function(lineSep) { - var parts = [], ranges = this.sel.ranges; - for (var i = 0; i < ranges.length; i++) { - var sel = getBetween(this, ranges[i].from(), ranges[i].to()); - if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); } - parts[i] = sel; - } - return parts - }, - replaceSelection: function(code, collapse, origin) { - var dup = []; - for (var i = 0; i < this.sel.ranges.length; i++) - { dup[i] = code; } - this.replaceSelections(dup, collapse, origin || "+input"); - }, - replaceSelections: docMethodOp(function(code, collapse, origin) { - var changes = [], sel = this.sel; - for (var i = 0; i < sel.ranges.length; i++) { - var range = sel.ranges[i]; - changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin}; - } - var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); - for (var i$1 = changes.length - 1; i$1 >= 0; i$1--) - { makeChange(this, changes[i$1]); } - if (newSel) { setSelectionReplaceHistory(this, newSel); } - else if (this.cm) { ensureCursorVisible(this.cm); } - }), - undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), - redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), - undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), - redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), - - setExtending: function(val) {this.extend = val;}, - getExtending: function() {return this.extend}, - - historySize: function() { - var hist = this.history, done = 0, undone = 0; - for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } } - for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } } - return {undo: done, redo: undone} - }, - clearHistory: function() { - var this$1 = this; - - this.history = new History(this.history); - linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true); - }, - - markClean: function() { - this.cleanGeneration = this.changeGeneration(true); - }, - changeGeneration: function(forceSplit) { - if (forceSplit) - { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; } - return this.history.generation - }, - isClean: function (gen) { - return this.history.generation == (gen || this.cleanGeneration) - }, - - getHistory: function() { - return {done: copyHistoryArray(this.history.done), - undone: copyHistoryArray(this.history.undone)} - }, - setHistory: function(histData) { - var hist = this.history = new History(this.history); - hist.done = copyHistoryArray(histData.done.slice(0), null, true); - hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); - }, - - setGutterMarker: docMethodOp(function(line, gutterID, value) { - return changeLine(this, line, "gutter", function (line) { - var markers = line.gutterMarkers || (line.gutterMarkers = {}); - markers[gutterID] = value; - if (!value && isEmpty(markers)) { line.gutterMarkers = null; } - return true - }) - }), - - clearGutter: docMethodOp(function(gutterID) { - var this$1 = this; - - this.iter(function (line) { - if (line.gutterMarkers && line.gutterMarkers[gutterID]) { - changeLine(this$1, line, "gutter", function () { - line.gutterMarkers[gutterID] = null; - if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; } - return true - }); - } - }); - }), - - lineInfo: function(line) { - var n; - if (typeof line == "number") { - if (!isLine(this, line)) { return null } - n = line; - line = getLine(this, line); - if (!line) { return null } - } else { - n = lineNo(line); - if (n == null) { return null } - } - return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, - textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, - widgets: line.widgets} - }, - - addLineClass: docMethodOp(function(handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { - var prop = where == "text" ? "textClass" - : where == "background" ? "bgClass" - : where == "gutter" ? "gutterClass" : "wrapClass"; - if (!line[prop]) { line[prop] = cls; } - else if (classTest(cls).test(line[prop])) { return false } - else { line[prop] += " " + cls; } - return true - }) - }), - removeLineClass: docMethodOp(function(handle, where, cls) { - return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { - var prop = where == "text" ? "textClass" - : where == "background" ? "bgClass" - : where == "gutter" ? "gutterClass" : "wrapClass"; - var cur = line[prop]; - if (!cur) { return false } - else if (cls == null) { line[prop] = null; } - else { - var found = cur.match(classTest(cls)); - if (!found) { return false } - var end = found.index + found[0].length; - line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; - } - return true - }) - }), - - addLineWidget: docMethodOp(function(handle, node, options) { - return addLineWidget(this, handle, node, options) - }), - removeLineWidget: function(widget) { widget.clear(); }, - - markText: function(from, to, options) { - return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range") - }, - setBookmark: function(pos, options) { - var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), - insertLeft: options && options.insertLeft, - clearWhenEmpty: false, shared: options && options.shared, - handleMouseEvents: options && options.handleMouseEvents}; - pos = clipPos(this, pos); - return markText(this, pos, pos, realOpts, "bookmark") - }, - findMarksAt: function(pos) { - pos = clipPos(this, pos); - var markers = [], spans = getLine(this, pos.line).markedSpans; - if (spans) { for (var i = 0; i < spans.length; ++i) { - var span = spans[i]; - if ((span.from == null || span.from <= pos.ch) && - (span.to == null || span.to >= pos.ch)) - { markers.push(span.marker.parent || span.marker); } - } } - return markers - }, - findMarks: function(from, to, filter) { - from = clipPos(this, from); to = clipPos(this, to); - var found = [], lineNo = from.line; - this.iter(from.line, to.line + 1, function (line) { - var spans = line.markedSpans; - if (spans) { for (var i = 0; i < spans.length; i++) { - var span = spans[i]; - if (!(span.to != null && lineNo == from.line && from.ch >= span.to || - span.from == null && lineNo != from.line || - span.from != null && lineNo == to.line && span.from >= to.ch) && - (!filter || filter(span.marker))) - { found.push(span.marker.parent || span.marker); } - } } - ++lineNo; - }); - return found - }, - getAllMarks: function() { - var markers = []; - this.iter(function (line) { - var sps = line.markedSpans; - if (sps) { for (var i = 0; i < sps.length; ++i) - { if (sps[i].from != null) { markers.push(sps[i].marker); } } } - }); - return markers - }, - - posFromIndex: function(off) { - var ch, lineNo = this.first, sepSize = this.lineSeparator().length; - this.iter(function (line) { - var sz = line.text.length + sepSize; - if (sz > off) { ch = off; return true } - off -= sz; - ++lineNo; - }); - return clipPos(this, Pos(lineNo, ch)) - }, - indexFromPos: function (coords) { - coords = clipPos(this, coords); - var index = coords.ch; - if (coords.line < this.first || coords.ch < 0) { return 0 } - var sepSize = this.lineSeparator().length; - this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value - index += line.text.length + sepSize; - }); - return index - }, - - copy: function(copyHistory) { - var doc = new Doc(getLines(this, this.first, this.first + this.size), - this.modeOption, this.first, this.lineSep, this.direction); - doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; - doc.sel = this.sel; - doc.extend = false; - if (copyHistory) { - doc.history.undoDepth = this.history.undoDepth; - doc.setHistory(this.getHistory()); - } - return doc - }, - - linkedDoc: function(options) { - if (!options) { options = {}; } - var from = this.first, to = this.first + this.size; - if (options.from != null && options.from > from) { from = options.from; } - if (options.to != null && options.to < to) { to = options.to; } - var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction); - if (options.sharedHist) { copy.history = this.history - ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); - copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; - copySharedMarkers(copy, findSharedMarkers(this)); - return copy - }, - unlinkDoc: function(other) { - if (other instanceof CodeMirror) { other = other.doc; } - if (this.linked) { for (var i = 0; i < this.linked.length; ++i) { - var link = this.linked[i]; - if (link.doc != other) { continue } - this.linked.splice(i, 1); - other.unlinkDoc(this); - detachSharedMarkers(findSharedMarkers(this)); - break - } } - // If the histories were shared, split them again - if (other.history == this.history) { - var splitIds = [other.id]; - linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true); - other.history = new History(null); - other.history.done = copyHistoryArray(this.history.done, splitIds); - other.history.undone = copyHistoryArray(this.history.undone, splitIds); - } - }, - iterLinkedDocs: function(f) {linkedDocs(this, f);}, - - getMode: function() {return this.mode}, - getEditor: function() {return this.cm}, - - splitLines: function(str) { - if (this.lineSep) { return str.split(this.lineSep) } - return splitLinesAuto(str) - }, - lineSeparator: function() { return this.lineSep || "\n" }, - - setDirection: docMethodOp(function (dir) { - if (dir != "rtl") { dir = "ltr"; } - if (dir == this.direction) { return } - this.direction = dir; - this.iter(function (line) { return line.order = null; }); - if (this.cm) { directionChanged(this.cm); } - }) - }); - - // Public alias. - Doc.prototype.eachLine = Doc.prototype.iter; - - // Kludge to work around strange IE behavior where it'll sometimes - // re-fire a series of drag-related events right after the drop (#1551) - var lastDrop = 0; - - function onDrop(e) { - var cm = this; - clearDragCursor(cm); - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) - { return } - e_preventDefault(e); - if (ie) { lastDrop = +new Date; } - var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; - if (!pos || cm.isReadOnly()) { return } - // Might be a file drop, in which case we simply extract the text - // and insert it. - if (files && files.length && window.FileReader && window.File) { - var n = files.length, text = Array(n), read = 0; - var markAsReadAndPasteIfAllFilesAreRead = function () { - if (++read == n) { - operation(cm, function () { - pos = clipPos(cm.doc, pos); - var change = {from: pos, to: pos, - text: cm.doc.splitLines( - text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())), - origin: "paste"}; - makeChange(cm.doc, change); - setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change)))); - })(); - } - }; - var readTextFromFile = function (file, i) { - if (cm.options.allowDropFileTypes && - indexOf(cm.options.allowDropFileTypes, file.type) == -1) { - markAsReadAndPasteIfAllFilesAreRead(); - return - } - var reader = new FileReader; - reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); }; - reader.onload = function () { - var content = reader.result; - if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { - markAsReadAndPasteIfAllFilesAreRead(); - return - } - text[i] = content; - markAsReadAndPasteIfAllFilesAreRead(); - }; - reader.readAsText(file); - }; - for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); } - } else { // Normal drop - // Don't do a replace if the drop happened inside of the selected text. - if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { - cm.state.draggingText(e); - // Ensure the editor is re-focused - setTimeout(function () { return cm.display.input.focus(); }, 20); - return - } - try { - var text$1 = e.dataTransfer.getData("Text"); - if (text$1) { - var selected; - if (cm.state.draggingText && !cm.state.draggingText.copy) - { selected = cm.listSelections(); } - setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); - if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1) - { replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag"); } } - cm.replaceSelection(text$1, "around", "paste"); - cm.display.input.focus(); - } - } - catch(e$1){} - } - } - - function onDragStart(cm, e) { - if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return } - if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return } - - e.dataTransfer.setData("Text", cm.getSelection()); - e.dataTransfer.effectAllowed = "copyMove"; - - // Use dummy image instead of default browsers image. - // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. - if (e.dataTransfer.setDragImage && !safari) { - var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); - img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; - if (presto) { - img.width = img.height = 1; - cm.display.wrapper.appendChild(img); - // Force a relayout, or Opera won't use our image for some obscure reason - img._top = img.offsetTop; - } - e.dataTransfer.setDragImage(img, 0, 0); - if (presto) { img.parentNode.removeChild(img); } - } - } - - function onDragOver(cm, e) { - var pos = posFromMouse(cm, e); - if (!pos) { return } - var frag = document.createDocumentFragment(); - drawSelectionCursor(cm, pos, frag); - if (!cm.display.dragCursor) { - cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors"); - cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv); - } - removeChildrenAndAdd(cm.display.dragCursor, frag); - } - - function clearDragCursor(cm) { - if (cm.display.dragCursor) { - cm.display.lineSpace.removeChild(cm.display.dragCursor); - cm.display.dragCursor = null; - } - } - - // These must be handled carefully, because naively registering a - // handler for each editor will cause the editors to never be - // garbage collected. - - function forEachCodeMirror(f) { - if (!document.getElementsByClassName) { return } - var byClass = document.getElementsByClassName("CodeMirror"), editors = []; - for (var i = 0; i < byClass.length; i++) { - var cm = byClass[i].CodeMirror; - if (cm) { editors.push(cm); } - } - if (editors.length) { editors[0].operation(function () { - for (var i = 0; i < editors.length; i++) { f(editors[i]); } - }); } - } - - var globalsRegistered = false; - function ensureGlobalHandlers() { - if (globalsRegistered) { return } - registerGlobalHandlers(); - globalsRegistered = true; - } - function registerGlobalHandlers() { - // When the window resizes, we need to refresh active editors. - var resizeTimer; - on(window, "resize", function () { - if (resizeTimer == null) { resizeTimer = setTimeout(function () { - resizeTimer = null; - forEachCodeMirror(onResize); - }, 100); } - }); - // When the window loses focus, we want to show the editor as blurred - on(window, "blur", function () { return forEachCodeMirror(onBlur); }); - } - // Called when the window resizes - function onResize(cm) { - var d = cm.display; - // Might be a text scaling operation, clear size caches. - d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; - d.scrollbarsClipped = false; - cm.setSize(); - } - - var keyNames = { - 3: "Pause", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", - 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", - 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", - 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", - 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 145: "ScrollLock", - 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", - 221: "]", 222: "'", 224: "Mod", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", - 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" - }; - - // Number keys - for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); } - // Alphabetic keys - for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); } - // Function keys - for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2; } - - var keyMap = {}; - - keyMap.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" - }; - // Note that the save and find-related commands aren't defined by - // default. User code or addons can define them. Unknown commands - // are simply ignored. - keyMap.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" - }; - // Very basic readline/emacs-style bindings, which are standard on Mac. - keyMap.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" - }; - keyMap.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"] - }; - keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; - - // KEYMAP DISPATCH - - function normalizeKeyName(name) { - var parts = name.split(/-(?!$)/); - name = parts[parts.length - 1]; - var alt, ctrl, shift, cmd; - for (var i = 0; i < parts.length - 1; i++) { - var mod = parts[i]; - if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; } - else if (/^a(lt)?$/i.test(mod)) { alt = true; } - else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; } - else if (/^s(hift)?$/i.test(mod)) { shift = true; } - else { throw new Error("Unrecognized modifier name: " + mod) } - } - if (alt) { name = "Alt-" + name; } - if (ctrl) { name = "Ctrl-" + name; } - if (cmd) { name = "Cmd-" + name; } - if (shift) { name = "Shift-" + name; } - return name - } - - // This is a kludge to keep keymaps mostly working as raw objects - // (backwards compatibility) while at the same time support features - // like normalization and multi-stroke key bindings. It compiles a - // new normalized keymap, and then updates the old object to reflect - // this. - function normalizeKeyMap(keymap) { - var copy = {}; - for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) { - var value = keymap[keyname]; - if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue } - if (value == "...") { delete keymap[keyname]; continue } - - var keys = map(keyname.split(" "), normalizeKeyName); - for (var i = 0; i < keys.length; i++) { - var val = (void 0), name = (void 0); - if (i == keys.length - 1) { - name = keys.join(" "); - val = value; - } else { - name = keys.slice(0, i + 1).join(" "); - val = "..."; - } - var prev = copy[name]; - if (!prev) { copy[name] = val; } - else if (prev != val) { throw new Error("Inconsistent bindings for " + name) } - } - delete keymap[keyname]; - } } - for (var prop in copy) { keymap[prop] = copy[prop]; } - return keymap - } - - function lookupKey(key, map, handle, context) { - map = getKeyMap(map); - var found = map.call ? map.call(key, context) : map[key]; - if (found === false) { return "nothing" } - if (found === "...") { return "multi" } - if (found != null && handle(found)) { return "handled" } - - if (map.fallthrough) { - if (Object.prototype.toString.call(map.fallthrough) != "[object Array]") - { return lookupKey(key, map.fallthrough, handle, context) } - for (var i = 0; i < map.fallthrough.length; i++) { - var result = lookupKey(key, map.fallthrough[i], handle, context); - if (result) { return result } - } - } - } - - // Modifier key presses don't count as 'real' key presses for the - // purpose of keymap fallthrough. - function isModifierKey(value) { - var name = typeof value == "string" ? value : keyNames[value.keyCode]; - return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod" - } - - function addModifierNames(name, event, noShift) { - var base = name; - if (event.altKey && base != "Alt") { name = "Alt-" + name; } - if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name; } - if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Mod") { name = "Cmd-" + name; } - if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name; } - return name - } - - // Look up the name of a key as indicated by an event object. - function keyName(event, noShift) { - if (presto && event.keyCode == 34 && event["char"]) { return false } - var name = keyNames[event.keyCode]; - if (name == null || event.altGraphKey) { return false } - // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause, - // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+) - if (event.keyCode == 3 && event.code) { name = event.code; } - return addModifierNames(name, event, noShift) - } - - function getKeyMap(val) { - return typeof val == "string" ? keyMap[val] : val - } - - // Helper for deleting text near the selection(s), used to implement - // backspace, delete, and similar functionality. - function deleteNearSelection(cm, compute) { - var ranges = cm.doc.sel.ranges, kill = []; - // Build up a set of ranges to kill first, merging overlapping - // ranges. - for (var i = 0; i < ranges.length; i++) { - var toKill = compute(ranges[i]); - while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { - var replaced = kill.pop(); - if (cmp(replaced.from, toKill.from) < 0) { - toKill.from = replaced.from; - break - } - } - kill.push(toKill); - } - // Next, remove those actual ranges. - runInOp(cm, function () { - for (var i = kill.length - 1; i >= 0; i--) - { replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); } - ensureCursorVisible(cm); - }); - } - - function moveCharLogically(line, ch, dir) { - var target = skipExtendingChars(line.text, ch + dir, dir); - return target < 0 || target > line.text.length ? null : target - } - - function moveLogically(line, start, dir) { - var ch = moveCharLogically(line, start.ch, dir); - return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before") - } - - function endOfLine(visually, cm, lineObj, lineNo, dir) { - if (visually) { - if (cm.doc.direction == "rtl") { dir = -dir; } - var order = getOrder(lineObj, cm.doc.direction); - if (order) { - var part = dir < 0 ? lst(order) : order[0]; - var moveInStorageOrder = (dir < 0) == (part.level == 1); - var sticky = moveInStorageOrder ? "after" : "before"; - var ch; - // With a wrapped rtl chunk (possibly spanning multiple bidi parts), - // it could be that the last bidi part is not on the last visual line, - // since visual lines contain content order-consecutive chunks. - // Thus, in rtl, we are looking for the first (content-order) character - // in the rtl chunk that is on the last line (that is, the same line - // as the last (content-order) character). - if (part.level > 0 || cm.doc.direction == "rtl") { - var prep = prepareMeasureForLine(cm, lineObj); - ch = dir < 0 ? lineObj.text.length - 1 : 0; - var targetTop = measureCharPrepared(cm, prep, ch).top; - ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch); - if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1); } - } else { ch = dir < 0 ? part.to : part.from; } - return new Pos(lineNo, ch, sticky) - } - } - return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after") - } - - function moveVisually(cm, line, start, dir) { - var bidi = getOrder(line, cm.doc.direction); - if (!bidi) { return moveLogically(line, start, dir) } - if (start.ch >= line.text.length) { - start.ch = line.text.length; - start.sticky = "before"; - } else if (start.ch <= 0) { - start.ch = 0; - start.sticky = "after"; - } - var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos]; - if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) { - // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines, - // nothing interesting happens. - return moveLogically(line, start, dir) - } - - var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); }; - var prep; - var getWrappedLineExtent = function (ch) { - if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} } - prep = prep || prepareMeasureForLine(cm, line); - return wrappedLineExtentChar(cm, line, prep, ch) - }; - var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch); - - if (cm.doc.direction == "rtl" || part.level == 1) { - var moveInStorageOrder = (part.level == 1) == (dir < 0); - var ch = mv(start, moveInStorageOrder ? 1 : -1); - if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) { - // Case 2: We move within an rtl part or in an rtl editor on the same visual line - var sticky = moveInStorageOrder ? "before" : "after"; - return new Pos(start.line, ch, sticky) - } - } - - // Case 3: Could not move within this bidi part in this visual line, so leave - // the current bidi part - - var searchInVisualLine = function (partPos, dir, wrappedLineExtent) { - var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder - ? new Pos(start.line, mv(ch, 1), "before") - : new Pos(start.line, ch, "after"); }; - - for (; partPos >= 0 && partPos < bidi.length; partPos += dir) { - var part = bidi[partPos]; - var moveInStorageOrder = (dir > 0) == (part.level != 1); - var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1); - if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) } - ch = moveInStorageOrder ? part.from : mv(part.to, -1); - if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) } - } - }; - - // Case 3a: Look for other bidi parts on the same visual line - var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent); - if (res) { return res } - - // Case 3b: Look for other bidi parts on the next visual line - var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1); - if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) { - res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh)); - if (res) { return res } - } - - // Case 4: Nowhere to move - return null - } - - // Commands are parameter-less actions that can be performed on an - // editor, mostly used for keybindings. - var commands = { - selectAll: selectAll, - singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); }, - killLine: function (cm) { return deleteNearSelection(cm, function (range) { - if (range.empty()) { - var len = getLine(cm.doc, range.head.line).text.length; - if (range.head.ch == len && range.head.line < cm.lastLine()) - { return {from: range.head, to: Pos(range.head.line + 1, 0)} } - else - { return {from: range.head, to: Pos(range.head.line, len)} } - } else { - return {from: range.from(), to: range.to()} - } - }); }, - deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({ - from: Pos(range.from().line, 0), - to: clipPos(cm.doc, Pos(range.to().line + 1, 0)) - }); }); }, - delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({ - from: Pos(range.from().line, 0), to: range.from() - }); }); }, - delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { - var top = cm.charCoords(range.head, "div").top + 5; - var leftPos = cm.coordsChar({left: 0, top: top}, "div"); - return {from: leftPos, to: range.from()} - }); }, - delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) { - var top = cm.charCoords(range.head, "div").top + 5; - var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); - return {from: range.from(), to: rightPos } - }); }, - undo: function (cm) { return cm.undo(); }, - redo: function (cm) { return cm.redo(); }, - undoSelection: function (cm) { return cm.undoSelection(); }, - redoSelection: function (cm) { return cm.redoSelection(); }, - goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); }, - goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); }, - goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); }, - {origin: "+move", bias: 1} - ); }, - goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); }, - {origin: "+move", bias: 1} - ); }, - goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); }, - {origin: "+move", bias: -1} - ); }, - goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) { - var top = cm.cursorCoords(range.head, "div").top + 5; - return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div") - }, sel_move); }, - goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) { - var top = cm.cursorCoords(range.head, "div").top + 5; - return cm.coordsChar({left: 0, top: top}, "div") - }, sel_move); }, - goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) { - var top = cm.cursorCoords(range.head, "div").top + 5; - var pos = cm.coordsChar({left: 0, top: top}, "div"); - if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) } - return pos - }, sel_move); }, - goLineUp: function (cm) { return cm.moveV(-1, "line"); }, - goLineDown: function (cm) { return cm.moveV(1, "line"); }, - goPageUp: function (cm) { return cm.moveV(-1, "page"); }, - goPageDown: function (cm) { return cm.moveV(1, "page"); }, - goCharLeft: function (cm) { return cm.moveH(-1, "char"); }, - goCharRight: function (cm) { return cm.moveH(1, "char"); }, - goColumnLeft: function (cm) { return cm.moveH(-1, "column"); }, - goColumnRight: function (cm) { return cm.moveH(1, "column"); }, - goWordLeft: function (cm) { return cm.moveH(-1, "word"); }, - goGroupRight: function (cm) { return cm.moveH(1, "group"); }, - goGroupLeft: function (cm) { return cm.moveH(-1, "group"); }, - goWordRight: function (cm) { return cm.moveH(1, "word"); }, - delCharBefore: function (cm) { return cm.deleteH(-1, "codepoint"); }, - delCharAfter: function (cm) { return cm.deleteH(1, "char"); }, - delWordBefore: function (cm) { return cm.deleteH(-1, "word"); }, - delWordAfter: function (cm) { return cm.deleteH(1, "word"); }, - delGroupBefore: function (cm) { return cm.deleteH(-1, "group"); }, - delGroupAfter: function (cm) { return cm.deleteH(1, "group"); }, - indentAuto: function (cm) { return cm.indentSelection("smart"); }, - indentMore: function (cm) { return cm.indentSelection("add"); }, - indentLess: function (cm) { return cm.indentSelection("subtract"); }, - insertTab: function (cm) { return cm.replaceSelection("\t"); }, - insertSoftTab: function (cm) { - var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; - for (var i = 0; i < ranges.length; i++) { - var pos = ranges[i].from(); - var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); - spaces.push(spaceStr(tabSize - col % tabSize)); - } - cm.replaceSelections(spaces); - }, - defaultTab: function (cm) { - if (cm.somethingSelected()) { cm.indentSelection("add"); } - else { cm.execCommand("insertTab"); } - }, - // Swap the two chars left and right of each selection's head. - // Move cursor behind the two swapped characters afterwards. - // - // Doesn't consider line feeds a character. - // Doesn't scan more than one line above to find a character. - // Doesn't do anything on an empty line. - // Doesn't do anything with non-empty selections. - transposeChars: function (cm) { return runInOp(cm, function () { - var ranges = cm.listSelections(), newSel = []; - for (var i = 0; i < ranges.length; i++) { - if (!ranges[i].empty()) { continue } - var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; - if (line) { - if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); } - if (cur.ch > 0) { - cur = new Pos(cur.line, cur.ch + 1); - cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), - Pos(cur.line, cur.ch - 2), cur, "+transpose"); - } else if (cur.line > cm.doc.first) { - var prev = getLine(cm.doc, cur.line - 1).text; - if (prev) { - cur = new Pos(cur.line, 1); - cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + - prev.charAt(prev.length - 1), - Pos(cur.line - 1, prev.length - 1), cur, "+transpose"); - } - } - } - newSel.push(new Range(cur, cur)); - } - cm.setSelections(newSel); - }); }, - newlineAndIndent: function (cm) { return runInOp(cm, function () { - var sels = cm.listSelections(); - for (var i = sels.length - 1; i >= 0; i--) - { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input"); } - sels = cm.listSelections(); - for (var i$1 = 0; i$1 < sels.length; i$1++) - { cm.indentLine(sels[i$1].from().line, null, true); } - ensureCursorVisible(cm); - }); }, - openLine: function (cm) { return cm.replaceSelection("\n", "start"); }, - toggleOverwrite: function (cm) { return cm.toggleOverwrite(); } - }; - - - function lineStart(cm, lineN) { - var line = getLine(cm.doc, lineN); - var visual = visualLine(line); - if (visual != line) { lineN = lineNo(visual); } - return endOfLine(true, cm, visual, lineN, 1) - } - function lineEnd(cm, lineN) { - var line = getLine(cm.doc, lineN); - var visual = visualLineEnd(line); - if (visual != line) { lineN = lineNo(visual); } - return endOfLine(true, cm, line, lineN, -1) - } - function lineStartSmart(cm, pos) { - var start = lineStart(cm, pos.line); - var line = getLine(cm.doc, start.line); - var order = getOrder(line, cm.doc.direction); - if (!order || order[0].level == 0) { - var firstNonWS = Math.max(start.ch, line.text.search(/\S/)); - var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; - return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky) - } - return start - } - - // Run a handler that was bound to a key. - function doHandleBinding(cm, bound, dropShift) { - if (typeof bound == "string") { - bound = commands[bound]; - if (!bound) { return false } - } - // Ensure previous input has been read, so that the handler sees a - // consistent view of the document - cm.display.input.ensurePolled(); - var prevShift = cm.display.shift, done = false; - try { - if (cm.isReadOnly()) { cm.state.suppressEdits = true; } - if (dropShift) { cm.display.shift = false; } - done = bound(cm) != Pass; - } finally { - cm.display.shift = prevShift; - cm.state.suppressEdits = false; - } - return done - } - - function lookupKeyForEditor(cm, name, handle) { - for (var i = 0; i < cm.state.keyMaps.length; i++) { - var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); - if (result) { return result } - } - return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) - || lookupKey(name, cm.options.keyMap, handle, cm) - } - - // Note that, despite the name, this function is also used to check - // for bound mouse clicks. - - var stopSeq = new Delayed; - - function dispatchKey(cm, name, e, handle) { - var seq = cm.state.keySeq; - if (seq) { - if (isModifierKey(name)) { return "handled" } - if (/\'$/.test(name)) - { cm.state.keySeq = null; } - else - { stopSeq.set(50, function () { - if (cm.state.keySeq == seq) { - cm.state.keySeq = null; - cm.display.input.reset(); - } - }); } - if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true } - } - return dispatchKeyInner(cm, name, e, handle) - } - - function dispatchKeyInner(cm, name, e, handle) { - var result = lookupKeyForEditor(cm, name, handle); - - if (result == "multi") - { cm.state.keySeq = name; } - if (result == "handled") - { signalLater(cm, "keyHandled", cm, name, e); } - - if (result == "handled" || result == "multi") { - e_preventDefault(e); - restartBlink(cm); - } - - return !!result - } - - // Handle a key from the keydown event. - function handleKeyBinding(cm, e) { - var name = keyName(e, true); - if (!name) { return false } - - if (e.shiftKey && !cm.state.keySeq) { - // First try to resolve full name (including 'Shift-'). Failing - // that, see if there is a cursor-motion command (starting with - // 'go') bound to the keyname without 'Shift-'. - return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); }) - || dispatchKey(cm, name, e, function (b) { - if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) - { return doHandleBinding(cm, b) } - }) - } else { - return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); }) - } - } - - // Handle a key from the keypress event - function handleCharBinding(cm, e, ch) { - return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); }) - } - - var lastStoppedKey = null; - function onKeyDown(e) { - var cm = this; - if (e.target && e.target != cm.display.input.getField()) { return } - cm.curOp.focus = activeElt(doc(cm)); - if (signalDOMEvent(cm, e)) { return } - // IE does strange things with escape. - if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; } - var code = e.keyCode; - cm.display.shift = code == 16 || e.shiftKey; - var handled = handleKeyBinding(cm, e); - if (presto) { - lastStoppedKey = handled ? code : null; - // Opera has no cut event... we try to at least catch the key combo - if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) - { cm.replaceSelection("", null, "cut"); } - } - if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand) - { document.execCommand("cut"); } - - // Turn mouse into crosshair when Alt is held on Mac. - if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) - { showCrossHair(cm); } - } - - function showCrossHair(cm) { - var lineDiv = cm.display.lineDiv; - addClass(lineDiv, "CodeMirror-crosshair"); - - function up(e) { - if (e.keyCode == 18 || !e.altKey) { - rmClass(lineDiv, "CodeMirror-crosshair"); - off(document, "keyup", up); - off(document, "mouseover", up); - } - } - on(document, "keyup", up); - on(document, "mouseover", up); - } - - function onKeyUp(e) { - if (e.keyCode == 16) { this.doc.sel.shift = false; } - signalDOMEvent(this, e); - } - - function onKeyPress(e) { - var cm = this; - if (e.target && e.target != cm.display.input.getField()) { return } - if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return } - var keyCode = e.keyCode, charCode = e.charCode; - if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return} - if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return } - var ch = String.fromCharCode(charCode == null ? keyCode : charCode); - // Some browsers fire keypress events for backspace - if (ch == "\x08") { return } - if (handleCharBinding(cm, e, ch)) { return } - cm.display.input.onKeyPress(e); - } - - var DOUBLECLICK_DELAY = 400; - - var PastClick = function(time, pos, button) { - this.time = time; - this.pos = pos; - this.button = button; - }; - - PastClick.prototype.compare = function (time, pos, button) { - return this.time + DOUBLECLICK_DELAY > time && - cmp(pos, this.pos) == 0 && button == this.button - }; - - var lastClick, lastDoubleClick; - function clickRepeat(pos, button) { - var now = +new Date; - if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) { - lastClick = lastDoubleClick = null; - return "triple" - } else if (lastClick && lastClick.compare(now, pos, button)) { - lastDoubleClick = new PastClick(now, pos, button); - lastClick = null; - return "double" - } else { - lastClick = new PastClick(now, pos, button); - lastDoubleClick = null; - return "single" - } - } - - // A mouse down can be a single click, double click, triple click, - // start of selection drag, start of text drag, new cursor - // (ctrl-click), rectangle drag (alt-drag), or xwin - // middle-click-paste. Or it might be a click on something we should - // not interfere with, such as a scrollbar or widget. - function onMouseDown(e) { - var cm = this, display = cm.display; - if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return } - display.input.ensurePolled(); - display.shift = e.shiftKey; - - if (eventInWidget(display, e)) { - if (!webkit) { - // Briefly turn off draggability, to allow widgets to do - // normal dragging things. - display.scroller.draggable = false; - setTimeout(function () { return display.scroller.draggable = true; }, 100); - } - return - } - if (clickInGutter(cm, e)) { return } - var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single"; - win(cm).focus(); - - // #3261: make sure, that we're not starting a second selection - if (button == 1 && cm.state.selectingText) - { cm.state.selectingText(e); } - - if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return } - - if (button == 1) { - if (pos) { leftButtonDown(cm, pos, repeat, e); } - else if (e_target(e) == display.scroller) { e_preventDefault(e); } - } else if (button == 2) { - if (pos) { extendSelection(cm.doc, pos); } - setTimeout(function () { return display.input.focus(); }, 20); - } else if (button == 3) { - if (captureRightClick) { cm.display.input.onContextMenu(e); } - else { delayBlurEvent(cm); } - } - } - - function handleMappedButton(cm, button, pos, repeat, event) { - var name = "Click"; - if (repeat == "double") { name = "Double" + name; } - else if (repeat == "triple") { name = "Triple" + name; } - name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name; - - return dispatchKey(cm, addModifierNames(name, event), event, function (bound) { - if (typeof bound == "string") { bound = commands[bound]; } - if (!bound) { return false } - var done = false; - try { - if (cm.isReadOnly()) { cm.state.suppressEdits = true; } - done = bound(cm, pos) != Pass; - } finally { - cm.state.suppressEdits = false; - } - return done - }) - } - - function configureMouse(cm, repeat, event) { - var option = cm.getOption("configureMouse"); - var value = option ? option(cm, repeat, event) : {}; - if (value.unit == null) { - var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey; - value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line"; - } - if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; } - if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; } - if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); } - return value - } - - function leftButtonDown(cm, pos, repeat, event) { - if (ie) { setTimeout(bind(ensureFocus, cm), 0); } - else { cm.curOp.focus = activeElt(doc(cm)); } - - var behavior = configureMouse(cm, repeat, event); - - var sel = cm.doc.sel, contained; - if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && - repeat == "single" && (contained = sel.contains(pos)) > -1 && - (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && - (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) - { leftButtonStartDrag(cm, event, pos, behavior); } - else - { leftButtonSelect(cm, event, pos, behavior); } - } - - // Start a text drag. When it ends, see if any dragging actually - // happen, and treat as a click if it didn't. - function leftButtonStartDrag(cm, event, pos, behavior) { - var display = cm.display, moved = false; - var dragEnd = operation(cm, function (e) { - if (webkit) { display.scroller.draggable = false; } - cm.state.draggingText = false; - if (cm.state.delayingBlurEvent) { - if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; } - else { delayBlurEvent(cm); } - } - off(display.wrapper.ownerDocument, "mouseup", dragEnd); - off(display.wrapper.ownerDocument, "mousemove", mouseMove); - off(display.scroller, "dragstart", dragStart); - off(display.scroller, "drop", dragEnd); - if (!moved) { - e_preventDefault(e); - if (!behavior.addNew) - { extendSelection(cm.doc, pos, null, null, behavior.extend); } - // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) - if ((webkit && !safari) || ie && ie_version == 9) - { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); } - else - { display.input.focus(); } - } - }); - var mouseMove = function(e2) { - moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10; - }; - var dragStart = function () { return moved = true; }; - // Let the drag handler handle this. - if (webkit) { display.scroller.draggable = true; } - cm.state.draggingText = dragEnd; - dragEnd.copy = !behavior.moveOnDrag; - on(display.wrapper.ownerDocument, "mouseup", dragEnd); - on(display.wrapper.ownerDocument, "mousemove", mouseMove); - on(display.scroller, "dragstart", dragStart); - on(display.scroller, "drop", dragEnd); - - cm.state.delayingBlurEvent = true; - setTimeout(function () { return display.input.focus(); }, 20); - // IE's approach to draggable - if (display.scroller.dragDrop) { display.scroller.dragDrop(); } - } - - function rangeForUnit(cm, pos, unit) { - if (unit == "char") { return new Range(pos, pos) } - if (unit == "word") { return cm.findWordAt(pos) } - if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) } - var result = unit(cm, pos); - return new Range(result.from, result.to) - } - - // Normal selection, as opposed to text dragging. - function leftButtonSelect(cm, event, start, behavior) { - if (ie) { delayBlurEvent(cm); } - var display = cm.display, doc$1 = cm.doc; - e_preventDefault(event); - - var ourRange, ourIndex, startSel = doc$1.sel, ranges = startSel.ranges; - if (behavior.addNew && !behavior.extend) { - ourIndex = doc$1.sel.contains(start); - if (ourIndex > -1) - { ourRange = ranges[ourIndex]; } - else - { ourRange = new Range(start, start); } - } else { - ourRange = doc$1.sel.primary(); - ourIndex = doc$1.sel.primIndex; - } - - if (behavior.unit == "rectangle") { - if (!behavior.addNew) { ourRange = new Range(start, start); } - start = posFromMouse(cm, event, true, true); - ourIndex = -1; - } else { - var range = rangeForUnit(cm, start, behavior.unit); - if (behavior.extend) - { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); } - else - { ourRange = range; } - } - - if (!behavior.addNew) { - ourIndex = 0; - setSelection(doc$1, new Selection([ourRange], 0), sel_mouse); - startSel = doc$1.sel; - } else if (ourIndex == -1) { - ourIndex = ranges.length; - setSelection(doc$1, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex), - {scroll: false, origin: "*mouse"}); - } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { - setSelection(doc$1, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), - {scroll: false, origin: "*mouse"}); - startSel = doc$1.sel; - } else { - replaceOneSelection(doc$1, ourIndex, ourRange, sel_mouse); - } - - var lastPos = start; - function extendTo(pos) { - if (cmp(lastPos, pos) == 0) { return } - lastPos = pos; - - if (behavior.unit == "rectangle") { - var ranges = [], tabSize = cm.options.tabSize; - var startCol = countColumn(getLine(doc$1, start.line).text, start.ch, tabSize); - var posCol = countColumn(getLine(doc$1, pos.line).text, pos.ch, tabSize); - var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); - for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); - line <= end; line++) { - var text = getLine(doc$1, line).text, leftPos = findColumn(text, left, tabSize); - if (left == right) - { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); } - else if (text.length > leftPos) - { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); } - } - if (!ranges.length) { ranges.push(new Range(start, start)); } - setSelection(doc$1, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), - {origin: "*mouse", scroll: false}); - cm.scrollIntoView(pos); - } else { - var oldRange = ourRange; - var range = rangeForUnit(cm, pos, behavior.unit); - var anchor = oldRange.anchor, head; - if (cmp(range.anchor, anchor) > 0) { - head = range.head; - anchor = minPos(oldRange.from(), range.anchor); - } else { - head = range.anchor; - anchor = maxPos(oldRange.to(), range.head); - } - var ranges$1 = startSel.ranges.slice(0); - ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc$1, anchor), head)); - setSelection(doc$1, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse); - } - } - - var editorSize = display.wrapper.getBoundingClientRect(); - // Used to ensure timeout re-tries don't fire when another extend - // happened in the meantime (clearTimeout isn't reliable -- at - // least on Chrome, the timeouts still happen even when cleared, - // if the clear happens after their scheduled firing time). - var counter = 0; - - function extend(e) { - var curCount = ++counter; - var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle"); - if (!cur) { return } - if (cmp(cur, lastPos) != 0) { - cm.curOp.focus = activeElt(doc(cm)); - extendTo(cur); - var visible = visibleLines(display, doc$1); - if (cur.line >= visible.to || cur.line < visible.from) - { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); } - } else { - var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; - if (outside) { setTimeout(operation(cm, function () { - if (counter != curCount) { return } - display.scroller.scrollTop += outside; - extend(e); - }), 50); } - } - } - - function done(e) { - cm.state.selectingText = false; - counter = Infinity; - // If e is null or undefined we interpret this as someone trying - // to explicitly cancel the selection rather than the user - // letting go of the mouse button. - if (e) { - e_preventDefault(e); - display.input.focus(); - } - off(display.wrapper.ownerDocument, "mousemove", move); - off(display.wrapper.ownerDocument, "mouseup", up); - doc$1.history.lastSelOrigin = null; - } - - var move = operation(cm, function (e) { - if (e.buttons === 0 || !e_button(e)) { done(e); } - else { extend(e); } - }); - var up = operation(cm, done); - cm.state.selectingText = up; - on(display.wrapper.ownerDocument, "mousemove", move); - on(display.wrapper.ownerDocument, "mouseup", up); - } - - // Used when mouse-selecting to adjust the anchor to the proper side - // of a bidi jump depending on the visual position of the head. - function bidiSimplify(cm, range) { - var anchor = range.anchor; - var head = range.head; - var anchorLine = getLine(cm.doc, anchor.line); - if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range } - var order = getOrder(anchorLine); - if (!order) { return range } - var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index]; - if (part.from != anchor.ch && part.to != anchor.ch) { return range } - var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1); - if (boundary == 0 || boundary == order.length) { return range } - - // Compute the relative visual position of the head compared to the - // anchor (<0 is to the left, >0 to the right) - var leftSide; - if (head.line != anchor.line) { - leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0; - } else { - var headIndex = getBidiPartAt(order, head.ch, head.sticky); - var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1); - if (headIndex == boundary - 1 || headIndex == boundary) - { leftSide = dir < 0; } - else - { leftSide = dir > 0; } - } - - var usePart = order[boundary + (leftSide ? -1 : 0)]; - var from = leftSide == (usePart.level == 1); - var ch = from ? usePart.from : usePart.to, sticky = from ? "after" : "before"; - return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head) - } - - - // Determines whether an event happened in the gutter, and fires the - // handlers for the corresponding event. - function gutterEvent(cm, e, type, prevent) { - var mX, mY; - if (e.touches) { - mX = e.touches[0].clientX; - mY = e.touches[0].clientY; - } else { - try { mX = e.clientX; mY = e.clientY; } - catch(e$1) { return false } - } - if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false } - if (prevent) { e_preventDefault(e); } - - var display = cm.display; - var lineBox = display.lineDiv.getBoundingClientRect(); - - if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) } - mY -= lineBox.top - display.viewOffset; - - for (var i = 0; i < cm.display.gutterSpecs.length; ++i) { - var g = display.gutters.childNodes[i]; - if (g && g.getBoundingClientRect().right >= mX) { - var line = lineAtHeight(cm.doc, mY); - var gutter = cm.display.gutterSpecs[i]; - signal(cm, type, cm, line, gutter.className, e); - return e_defaultPrevented(e) - } - } - } - - function clickInGutter(cm, e) { - return gutterEvent(cm, e, "gutterClick", true) - } - - // CONTEXT MENU HANDLING - - // To make the context menu work, we need to briefly unhide the - // textarea (making it as unobtrusive as possible) to let the - // right-click take effect on it. - function onContextMenu(cm, e) { - if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return } - if (signalDOMEvent(cm, e, "contextmenu")) { return } - if (!captureRightClick) { cm.display.input.onContextMenu(e); } - } - - function contextMenuInGutter(cm, e) { - if (!hasHandler(cm, "gutterContextMenu")) { return false } - return gutterEvent(cm, e, "gutterContextMenu", false) - } - - function themeChanged(cm) { - cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + - cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); - clearCaches(cm); - } - - var Init = {toString: function(){return "CodeMirror.Init"}}; - - var defaults = {}; - var optionHandlers = {}; - - function defineOptions(CodeMirror) { - var optionHandlers = CodeMirror.optionHandlers; - - function option(name, deflt, handle, notOnInit) { - CodeMirror.defaults[name] = deflt; - if (handle) { optionHandlers[name] = - notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; } - } - - CodeMirror.defineOption = option; - - // Passed to option handlers when there is no old value. - CodeMirror.Init = Init; - - // These two are, on init, called from the constructor because they - // have to be initialized before the editor can start at all. - option("value", "", function (cm, val) { return cm.setValue(val); }, true); - option("mode", null, function (cm, val) { - cm.doc.modeOption = val; - loadMode(cm); - }, true); - - option("indentUnit", 2, loadMode, true); - option("indentWithTabs", false); - option("smartIndent", true); - option("tabSize", 4, function (cm) { - resetModeState(cm); - clearCaches(cm); - regChange(cm); - }, true); - - option("lineSeparator", null, function (cm, val) { - cm.doc.lineSep = val; - if (!val) { return } - var newBreaks = [], lineNo = cm.doc.first; - cm.doc.iter(function (line) { - for (var pos = 0;;) { - var found = line.text.indexOf(val, pos); - if (found == -1) { break } - pos = found + val.length; - newBreaks.push(Pos(lineNo, found)); - } - lineNo++; - }); - for (var i = newBreaks.length - 1; i >= 0; i--) - { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); } - }); - option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g, function (cm, val, old) { - cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); - if (old != Init) { cm.refresh(); } - }); - option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true); - option("electricChars", true); - option("inputStyle", mobile ? "contenteditable" : "textarea", function () { - throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME - }, true); - option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true); - option("autocorrect", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true); - option("autocapitalize", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true); - option("rtlMoveVisually", !windows); - option("wholeLineUpdateBefore", true); - - option("theme", "default", function (cm) { - themeChanged(cm); - updateGutters(cm); - }, true); - option("keyMap", "default", function (cm, val, old) { - var next = getKeyMap(val); - var prev = old != Init && getKeyMap(old); - if (prev && prev.detach) { prev.detach(cm, next); } - if (next.attach) { next.attach(cm, prev || null); } - }); - option("extraKeys", null); - option("configureMouse", null); - - option("lineWrapping", false, wrappingChanged, true); - option("gutters", [], function (cm, val) { - cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers); - updateGutters(cm); - }, true); - option("fixedGutter", true, function (cm, val) { - cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; - cm.refresh(); - }, true); - option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true); - option("scrollbarStyle", "native", function (cm) { - initScrollbars(cm); - updateScrollbars(cm); - cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); - cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); - }, true); - option("lineNumbers", false, function (cm, val) { - cm.display.gutterSpecs = getGutters(cm.options.gutters, val); - updateGutters(cm); - }, true); - option("firstLineNumber", 1, updateGutters, true); - option("lineNumberFormatter", function (integer) { return integer; }, updateGutters, true); - option("showCursorWhenSelecting", false, updateSelection, true); - - option("resetSelectionOnContextMenu", true); - option("lineWiseCopyCut", true); - option("pasteLinesPerSelection", true); - option("selectionsMayTouch", false); - - option("readOnly", false, function (cm, val) { - if (val == "nocursor") { - onBlur(cm); - cm.display.input.blur(); - } - cm.display.input.readOnlyChanged(val); - }); - - option("screenReaderLabel", null, function (cm, val) { - val = (val === '') ? null : val; - cm.display.input.screenReaderLabelChanged(val); - }); - - option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true); - option("dragDrop", true, dragDropChanged); - option("allowDropFileTypes", null); - - option("cursorBlinkRate", 530); - option("cursorScrollMargin", 0); - option("cursorHeight", 1, updateSelection, true); - option("singleCursorHeightPerLine", true, updateSelection, true); - option("workTime", 100); - option("workDelay", 100); - option("flattenSpans", true, resetModeState, true); - option("addModeClass", false, resetModeState, true); - option("pollInterval", 100); - option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; }); - option("historyEventDelay", 1250); - option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true); - option("maxHighlightLength", 10000, resetModeState, true); - option("moveInputWithCursor", true, function (cm, val) { - if (!val) { cm.display.input.resetPosition(); } - }); - - option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; }); - option("autofocus", null); - option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true); - option("phrases", null); - } - - function dragDropChanged(cm, value, old) { - var wasOn = old && old != Init; - if (!value != !wasOn) { - var funcs = cm.display.dragFunctions; - var toggle = value ? on : off; - toggle(cm.display.scroller, "dragstart", funcs.start); - toggle(cm.display.scroller, "dragenter", funcs.enter); - toggle(cm.display.scroller, "dragover", funcs.over); - toggle(cm.display.scroller, "dragleave", funcs.leave); - toggle(cm.display.scroller, "drop", funcs.drop); - } - } - - function wrappingChanged(cm) { - if (cm.options.lineWrapping) { - addClass(cm.display.wrapper, "CodeMirror-wrap"); - cm.display.sizer.style.minWidth = ""; - cm.display.sizerWidth = null; - } else { - rmClass(cm.display.wrapper, "CodeMirror-wrap"); - findMaxLine(cm); - } - estimateLineHeights(cm); - regChange(cm); - clearCaches(cm); - setTimeout(function () { return updateScrollbars(cm); }, 100); - } - - // A CodeMirror instance represents an editor. This is the object - // that user code is usually dealing with. - - function CodeMirror(place, options) { - var this$1 = this; - - if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) } - - this.options = options = options ? copyObj(options) : {}; - // Determine effective options based on given values and defaults. - copyObj(defaults, options, false); - - var doc = options.value; - if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); } - else if (options.mode) { doc.modeOption = options.mode; } - this.doc = doc; - - var input = new CodeMirror.inputStyles[options.inputStyle](this); - var display = this.display = new Display(place, doc, input, options); - display.wrapper.CodeMirror = this; - themeChanged(this); - if (options.lineWrapping) - { this.display.wrapper.className += " CodeMirror-wrap"; } - initScrollbars(this); - - this.state = { - keyMaps: [], // stores maps added by addKeyMap - overlays: [], // highlighting overlays, as added by addOverlay - modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info - overwrite: false, - delayingBlurEvent: false, - focused: false, - suppressEdits: false, // used to disable editing during key handlers when in readOnly mode - pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll - selectingText: false, - draggingText: false, - highlight: new Delayed(), // stores highlight worker timeout - keySeq: null, // Unfinished key sequence - specialChars: null - }; - - if (options.autofocus && !mobile) { display.input.focus(); } - - // Override magic textarea content restore that IE sometimes does - // on our hidden textarea on reload - if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); } - - registerEventHandlers(this); - ensureGlobalHandlers(); - - startOperation(this); - this.curOp.forceUpdate = true; - attachDoc(this, doc); - - if ((options.autofocus && !mobile) || this.hasFocus()) - { setTimeout(function () { - if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); } - }, 20); } - else - { onBlur(this); } - - for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt)) - { optionHandlers[opt](this, options[opt], Init); } } - maybeUpdateLineNumberWidth(this); - if (options.finishInit) { options.finishInit(this); } - for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); } - endOperation(this); - // Suppress optimizelegibility in Webkit, since it breaks text - // measuring on line wrapping boundaries. - if (webkit && options.lineWrapping && - getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") - { display.lineDiv.style.textRendering = "auto"; } - } - - // The default configuration options. - CodeMirror.defaults = defaults; - // Functions to run when options are changed. - CodeMirror.optionHandlers = optionHandlers; - - // Attach the necessary event handlers when initializing the editor - function registerEventHandlers(cm) { - var d = cm.display; - on(d.scroller, "mousedown", operation(cm, onMouseDown)); - // Older IE's will not fire a second mousedown for a double click - if (ie && ie_version < 11) - { on(d.scroller, "dblclick", operation(cm, function (e) { - if (signalDOMEvent(cm, e)) { return } - var pos = posFromMouse(cm, e); - if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return } - e_preventDefault(e); - var word = cm.findWordAt(pos); - extendSelection(cm.doc, word.anchor, word.head); - })); } - else - { on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); } - // Some browsers fire contextmenu *after* opening the menu, at - // which point we can't mess with it anymore. Context menu is - // handled in onMouseDown for these browsers. - on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); }); - on(d.input.getField(), "contextmenu", function (e) { - if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); } - }); - - // Used to suppress mouse event handling when a touch happens - var touchFinished, prevTouch = {end: 0}; - function finishTouch() { - if (d.activeTouch) { - touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000); - prevTouch = d.activeTouch; - prevTouch.end = +new Date; - } - } - function isMouseLikeTouchEvent(e) { - if (e.touches.length != 1) { return false } - var touch = e.touches[0]; - return touch.radiusX <= 1 && touch.radiusY <= 1 - } - function farAway(touch, other) { - if (other.left == null) { return true } - var dx = other.left - touch.left, dy = other.top - touch.top; - return dx * dx + dy * dy > 20 * 20 - } - on(d.scroller, "touchstart", function (e) { - if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) { - d.input.ensurePolled(); - clearTimeout(touchFinished); - var now = +new Date; - d.activeTouch = {start: now, moved: false, - prev: now - prevTouch.end <= 300 ? prevTouch : null}; - if (e.touches.length == 1) { - d.activeTouch.left = e.touches[0].pageX; - d.activeTouch.top = e.touches[0].pageY; - } - } - }); - on(d.scroller, "touchmove", function () { - if (d.activeTouch) { d.activeTouch.moved = true; } - }); - on(d.scroller, "touchend", function (e) { - var touch = d.activeTouch; - if (touch && !eventInWidget(d, e) && touch.left != null && - !touch.moved && new Date - touch.start < 300) { - var pos = cm.coordsChar(d.activeTouch, "page"), range; - if (!touch.prev || farAway(touch, touch.prev)) // Single tap - { range = new Range(pos, pos); } - else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap - { range = cm.findWordAt(pos); } - else // Triple tap - { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); } - cm.setSelection(range.anchor, range.head); - cm.focus(); - e_preventDefault(e); - } - finishTouch(); - }); - on(d.scroller, "touchcancel", finishTouch); - - // Sync scrolling between fake scrollbars and real scrollable - // area, ensure viewport is updated when scrolling. - on(d.scroller, "scroll", function () { - if (d.scroller.clientHeight) { - updateScrollTop(cm, d.scroller.scrollTop); - setScrollLeft(cm, d.scroller.scrollLeft, true); - signal(cm, "scroll", cm); - } - }); - - // Listen to wheel events in order to try and update the viewport on time. - on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); }); - on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); }); - - // Prevent wrapper from ever scrolling - on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); - - d.dragFunctions = { - enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }}, - over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }}, - start: function (e) { return onDragStart(cm, e); }, - drop: operation(cm, onDrop), - leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }} - }; - - var inp = d.input.getField(); - on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); }); - on(inp, "keydown", operation(cm, onKeyDown)); - on(inp, "keypress", operation(cm, onKeyPress)); - on(inp, "focus", function (e) { return onFocus(cm, e); }); - on(inp, "blur", function (e) { return onBlur(cm, e); }); - } - - var initHooks = []; - CodeMirror.defineInitHook = function (f) { return initHooks.push(f); }; - - // Indent the given line. The how parameter can be "smart", - // "add"/null, "subtract", or "prev". When aggressive is false - // (typically set to true for forced single-line indents), empty - // lines are not indented, and places where the mode returns Pass - // are left alone. - function indentLine(cm, n, how, aggressive) { - var doc = cm.doc, state; - if (how == null) { how = "add"; } - if (how == "smart") { - // Fall back to "prev" when the mode doesn't have an indentation - // method. - if (!doc.mode.indent) { how = "prev"; } - else { state = getContextBefore(cm, n).state; } - } - - var tabSize = cm.options.tabSize; - var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); - if (line.stateAfter) { line.stateAfter = null; } - var curSpaceString = line.text.match(/^\s*/)[0], indentation; - if (!aggressive && !/\S/.test(line.text)) { - indentation = 0; - how = "not"; - } else if (how == "smart") { - indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); - if (indentation == Pass || indentation > 150) { - if (!aggressive) { return } - how = "prev"; - } - } - if (how == "prev") { - if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); } - else { indentation = 0; } - } else if (how == "add") { - indentation = curSpace + cm.options.indentUnit; - } else if (how == "subtract") { - indentation = curSpace - cm.options.indentUnit; - } else if (typeof how == "number") { - indentation = curSpace + how; - } - indentation = Math.max(0, indentation); - - var indentString = "", pos = 0; - if (cm.options.indentWithTabs) - { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} } - if (pos < indentation) { indentString += spaceStr(indentation - pos); } - - if (indentString != curSpaceString) { - replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); - line.stateAfter = null; - return true - } else { - // Ensure that, if the cursor was in the whitespace at the start - // of the line, it is moved to the end of that space. - for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) { - var range = doc.sel.ranges[i$1]; - if (range.head.line == n && range.head.ch < curSpaceString.length) { - var pos$1 = Pos(n, curSpaceString.length); - replaceOneSelection(doc, i$1, new Range(pos$1, pos$1)); - break - } - } - } - } - - // This will be set to a {lineWise: bool, text: [string]} object, so - // that, when pasting, we know what kind of selections the copied - // text was made out of. - var lastCopied = null; - - function setLastCopied(newLastCopied) { - lastCopied = newLastCopied; - } - - function applyTextInput(cm, inserted, deleted, sel, origin) { - var doc = cm.doc; - cm.display.shift = false; - if (!sel) { sel = doc.sel; } - - var recent = +new Date - 200; - var paste = origin == "paste" || cm.state.pasteIncoming > recent; - var textLines = splitLinesAuto(inserted), multiPaste = null; - // When pasting N lines into N selections, insert one line per selection - if (paste && sel.ranges.length > 1) { - if (lastCopied && lastCopied.text.join("\n") == inserted) { - if (sel.ranges.length % lastCopied.text.length == 0) { - multiPaste = []; - for (var i = 0; i < lastCopied.text.length; i++) - { multiPaste.push(doc.splitLines(lastCopied.text[i])); } - } - } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) { - multiPaste = map(textLines, function (l) { return [l]; }); - } - } - - var updateInput = cm.curOp.updateInput; - // Normal behavior is to insert the new text into every selection - for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) { - var range = sel.ranges[i$1]; - var from = range.from(), to = range.to(); - if (range.empty()) { - if (deleted && deleted > 0) // Handle deletion - { from = Pos(from.line, from.ch - deleted); } - else if (cm.state.overwrite && !paste) // Handle overwrite - { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); } - else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == textLines.join("\n")) - { from = to = Pos(from.line, 0); } - } - var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines, - origin: origin || (paste ? "paste" : cm.state.cutIncoming > recent ? "cut" : "+input")}; - makeChange(cm.doc, changeEvent); - signalLater(cm, "inputRead", cm, changeEvent); - } - if (inserted && !paste) - { triggerElectric(cm, inserted); } - - ensureCursorVisible(cm); - if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; } - cm.curOp.typing = true; - cm.state.pasteIncoming = cm.state.cutIncoming = -1; - } - - function handlePaste(e, cm) { - var pasted = e.clipboardData && e.clipboardData.getData("Text"); - if (pasted) { - e.preventDefault(); - if (!cm.isReadOnly() && !cm.options.disableInput && cm.hasFocus()) - { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }); } - return true - } - } - - function triggerElectric(cm, inserted) { - // When an 'electric' character is inserted, immediately trigger a reindent - if (!cm.options.electricChars || !cm.options.smartIndent) { return } - var sel = cm.doc.sel; - - for (var i = sel.ranges.length - 1; i >= 0; i--) { - var range = sel.ranges[i]; - if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue } - var mode = cm.getModeAt(range.head); - var indented = false; - if (mode.electricChars) { - for (var j = 0; j < mode.electricChars.length; j++) - { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { - indented = indentLine(cm, range.head.line, "smart"); - break - } } - } else if (mode.electricInput) { - if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch))) - { indented = indentLine(cm, range.head.line, "smart"); } - } - if (indented) { signalLater(cm, "electricInput", cm, range.head.line); } - } - } - - function copyableRanges(cm) { - var text = [], ranges = []; - for (var i = 0; i < cm.doc.sel.ranges.length; i++) { - var line = cm.doc.sel.ranges[i].head.line; - var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; - ranges.push(lineRange); - text.push(cm.getRange(lineRange.anchor, lineRange.head)); - } - return {text: text, ranges: ranges} - } - - function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) { - field.setAttribute("autocorrect", autocorrect ? "on" : "off"); - field.setAttribute("autocapitalize", autocapitalize ? "on" : "off"); - field.setAttribute("spellcheck", !!spellcheck); - } - - function hiddenTextarea() { - var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"); - var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); - // The textarea is kept positioned near the cursor to prevent the - // fact that it'll be scrolled into view on input from scrolling - // our fake cursor out of view. On webkit, when wrap=off, paste is - // very slow. So make the area wide instead. - if (webkit) { te.style.width = "1000px"; } - else { te.setAttribute("wrap", "off"); } - // If border: 0; -- iOS fails to open keyboard (issue #1287) - if (ios) { te.style.border = "1px solid black"; } - return div - } - - // The publicly visible API. Note that methodOp(f) means - // 'wrap f in an operation, performed on its `this` parameter'. - - // This is not the complete set of editor methods. Most of the - // methods defined on the Doc type are also injected into - // CodeMirror.prototype, for backwards compatibility and - // convenience. - - function addEditorMethods(CodeMirror) { - var optionHandlers = CodeMirror.optionHandlers; - - var helpers = CodeMirror.helpers = {}; - - CodeMirror.prototype = { - constructor: CodeMirror, - focus: function(){win(this).focus(); this.display.input.focus();}, - - setOption: function(option, value) { - var options = this.options, old = options[option]; - if (options[option] == value && option != "mode") { return } - options[option] = value; - if (optionHandlers.hasOwnProperty(option)) - { operation(this, optionHandlers[option])(this, value, old); } - signal(this, "optionChange", this, option); - }, - - getOption: function(option) {return this.options[option]}, - getDoc: function() {return this.doc}, - - addKeyMap: function(map, bottom) { - this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map)); - }, - removeKeyMap: function(map) { - var maps = this.state.keyMaps; - for (var i = 0; i < maps.length; ++i) - { if (maps[i] == map || maps[i].name == map) { - maps.splice(i, 1); - return true - } } - }, - - addOverlay: methodOp(function(spec, options) { - var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); - if (mode.startState) { throw new Error("Overlays may not be stateful.") } - insertSorted(this.state.overlays, - {mode: mode, modeSpec: spec, opaque: options && options.opaque, - priority: (options && options.priority) || 0}, - function (overlay) { return overlay.priority; }); - this.state.modeGen++; - regChange(this); - }), - removeOverlay: methodOp(function(spec) { - var overlays = this.state.overlays; - for (var i = 0; i < overlays.length; ++i) { - var cur = overlays[i].modeSpec; - if (cur == spec || typeof spec == "string" && cur.name == spec) { - overlays.splice(i, 1); - this.state.modeGen++; - regChange(this); - return - } - } - }), - - indentLine: methodOp(function(n, dir, aggressive) { - if (typeof dir != "string" && typeof dir != "number") { - if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev"; } - else { dir = dir ? "add" : "subtract"; } - } - if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); } - }), - indentSelection: methodOp(function(how) { - var ranges = this.doc.sel.ranges, end = -1; - for (var i = 0; i < ranges.length; i++) { - var range = ranges[i]; - if (!range.empty()) { - var from = range.from(), to = range.to(); - var start = Math.max(end, from.line); - end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; - for (var j = start; j < end; ++j) - { indentLine(this, j, how); } - var newRanges = this.doc.sel.ranges; - if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) - { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); } - } else if (range.head.line > end) { - indentLine(this, range.head.line, how, true); - end = range.head.line; - if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); } - } - } - }), - - // Fetch the parser token for a given character. Useful for hacks - // that want to inspect the mode state (say, for completion). - getTokenAt: function(pos, precise) { - return takeToken(this, pos, precise) - }, - - getLineTokens: function(line, precise) { - return takeToken(this, Pos(line), precise, true) - }, - - getTokenTypeAt: function(pos) { - pos = clipPos(this.doc, pos); - var styles = getLineStyles(this, getLine(this.doc, pos.line)); - var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; - var type; - if (ch == 0) { type = styles[2]; } - else { for (;;) { - var mid = (before + after) >> 1; - if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; } - else if (styles[mid * 2 + 1] < ch) { before = mid + 1; } - else { type = styles[mid * 2 + 2]; break } - } } - var cut = type ? type.indexOf("overlay ") : -1; - return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1) - }, - - getModeAt: function(pos) { - var mode = this.doc.mode; - if (!mode.innerMode) { return mode } - return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode - }, - - getHelper: function(pos, type) { - return this.getHelpers(pos, type)[0] - }, - - getHelpers: function(pos, type) { - var found = []; - if (!helpers.hasOwnProperty(type)) { return found } - var help = helpers[type], mode = this.getModeAt(pos); - if (typeof mode[type] == "string") { - if (help[mode[type]]) { found.push(help[mode[type]]); } - } else if (mode[type]) { - for (var i = 0; i < mode[type].length; i++) { - var val = help[mode[type][i]]; - if (val) { found.push(val); } - } - } else if (mode.helperType && help[mode.helperType]) { - found.push(help[mode.helperType]); - } else if (help[mode.name]) { - found.push(help[mode.name]); - } - for (var i$1 = 0; i$1 < help._global.length; i$1++) { - var cur = help._global[i$1]; - if (cur.pred(mode, this) && indexOf(found, cur.val) == -1) - { found.push(cur.val); } - } - return found - }, - - getStateAfter: function(line, precise) { - var doc = this.doc; - line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); - return getContextBefore(this, line + 1, precise).state - }, - - cursorCoords: function(start, mode) { - var pos, range = this.doc.sel.primary(); - if (start == null) { pos = range.head; } - else if (typeof start == "object") { pos = clipPos(this.doc, start); } - else { pos = start ? range.from() : range.to(); } - return cursorCoords(this, pos, mode || "page") - }, - - charCoords: function(pos, mode) { - return charCoords(this, clipPos(this.doc, pos), mode || "page") - }, - - coordsChar: function(coords, mode) { - coords = fromCoordSystem(this, coords, mode || "page"); - return coordsChar(this, coords.left, coords.top) - }, - - lineAtHeight: function(height, mode) { - height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top; - return lineAtHeight(this.doc, height + this.display.viewOffset) - }, - heightAtLine: function(line, mode, includeWidgets) { - var end = false, lineObj; - if (typeof line == "number") { - var last = this.doc.first + this.doc.size - 1; - if (line < this.doc.first) { line = this.doc.first; } - else if (line > last) { line = last; end = true; } - lineObj = getLine(this.doc, line); - } else { - lineObj = line; - } - return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets || end).top + - (end ? this.doc.height - heightAtLine(lineObj) : 0) - }, - - defaultTextHeight: function() { return textHeight(this.display) }, - defaultCharWidth: function() { return charWidth(this.display) }, - - getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}}, - - addWidget: function(pos, node, scroll, vert, horiz) { - var display = this.display; - pos = cursorCoords(this, clipPos(this.doc, pos)); - var top = pos.bottom, left = pos.left; - node.style.position = "absolute"; - node.setAttribute("cm-ignore-events", "true"); - this.display.input.setUneditable(node); - display.sizer.appendChild(node); - if (vert == "over") { - top = pos.top; - } else if (vert == "above" || vert == "near") { - var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), - hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); - // Default to positioning above (if specified and possible); otherwise default to positioning below - if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) - { top = pos.top - node.offsetHeight; } - else if (pos.bottom + node.offsetHeight <= vspace) - { top = pos.bottom; } - if (left + node.offsetWidth > hspace) - { left = hspace - node.offsetWidth; } - } - node.style.top = top + "px"; - node.style.left = node.style.right = ""; - if (horiz == "right") { - left = display.sizer.clientWidth - node.offsetWidth; - node.style.right = "0px"; - } else { - if (horiz == "left") { left = 0; } - else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; } - node.style.left = left + "px"; - } - if (scroll) - { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); } - }, - - triggerOnKeyDown: methodOp(onKeyDown), - triggerOnKeyPress: methodOp(onKeyPress), - triggerOnKeyUp: onKeyUp, - triggerOnMouseDown: methodOp(onMouseDown), - - execCommand: function(cmd) { - if (commands.hasOwnProperty(cmd)) - { return commands[cmd].call(null, this) } - }, - - triggerElectric: methodOp(function(text) { triggerElectric(this, text); }), - - findPosH: function(from, amount, unit, visually) { - var dir = 1; - if (amount < 0) { dir = -1; amount = -amount; } - var cur = clipPos(this.doc, from); - for (var i = 0; i < amount; ++i) { - cur = findPosH(this.doc, cur, dir, unit, visually); - if (cur.hitSide) { break } - } - return cur - }, - - moveH: methodOp(function(dir, unit) { - var this$1 = this; - - this.extendSelectionsBy(function (range) { - if (this$1.display.shift || this$1.doc.extend || range.empty()) - { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) } - else - { return dir < 0 ? range.from() : range.to() } - }, sel_move); - }), - - deleteH: methodOp(function(dir, unit) { - var sel = this.doc.sel, doc = this.doc; - if (sel.somethingSelected()) - { doc.replaceSelection("", null, "+delete"); } - else - { deleteNearSelection(this, function (range) { - var other = findPosH(doc, range.head, dir, unit, false); - return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other} - }); } - }), - - findPosV: function(from, amount, unit, goalColumn) { - var dir = 1, x = goalColumn; - if (amount < 0) { dir = -1; amount = -amount; } - var cur = clipPos(this.doc, from); - for (var i = 0; i < amount; ++i) { - var coords = cursorCoords(this, cur, "div"); - if (x == null) { x = coords.left; } - else { coords.left = x; } - cur = findPosV(this, coords, dir, unit); - if (cur.hitSide) { break } - } - return cur - }, - - moveV: methodOp(function(dir, unit) { - var this$1 = this; - - var doc = this.doc, goals = []; - var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected(); - doc.extendSelectionsBy(function (range) { - if (collapse) - { return dir < 0 ? range.from() : range.to() } - var headPos = cursorCoords(this$1, range.head, "div"); - if (range.goalColumn != null) { headPos.left = range.goalColumn; } - goals.push(headPos.left); - var pos = findPosV(this$1, headPos, dir, unit); - if (unit == "page" && range == doc.sel.primary()) - { addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top); } - return pos - }, sel_move); - if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++) - { doc.sel.ranges[i].goalColumn = goals[i]; } } - }), - - // Find the word at the given position (as returned by coordsChar). - findWordAt: function(pos) { - var doc = this.doc, line = getLine(doc, pos.line).text; - var start = pos.ch, end = pos.ch; - if (line) { - var helper = this.getHelper(pos, "wordChars"); - if ((pos.sticky == "before" || end == line.length) && start) { --start; } else { ++end; } - var startChar = line.charAt(start); - var check = isWordChar(startChar, helper) - ? function (ch) { return isWordChar(ch, helper); } - : /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); } - : function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); }; - while (start > 0 && check(line.charAt(start - 1))) { --start; } - while (end < line.length && check(line.charAt(end))) { ++end; } - } - return new Range(Pos(pos.line, start), Pos(pos.line, end)) - }, - - toggleOverwrite: function(value) { - if (value != null && value == this.state.overwrite) { return } - if (this.state.overwrite = !this.state.overwrite) - { addClass(this.display.cursorDiv, "CodeMirror-overwrite"); } - else - { rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); } - - signal(this, "overwriteToggle", this, this.state.overwrite); - }, - hasFocus: function() { return this.display.input.getField() == activeElt(doc(this)) }, - isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) }, - - scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }), - getScrollInfo: function() { - var scroller = this.display.scroller; - return {left: scroller.scrollLeft, top: scroller.scrollTop, - height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, - width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, - clientHeight: displayHeight(this), clientWidth: displayWidth(this)} - }, - - scrollIntoView: methodOp(function(range, margin) { - if (range == null) { - range = {from: this.doc.sel.primary().head, to: null}; - if (margin == null) { margin = this.options.cursorScrollMargin; } - } else if (typeof range == "number") { - range = {from: Pos(range, 0), to: null}; - } else if (range.from == null) { - range = {from: range, to: null}; - } - if (!range.to) { range.to = range.from; } - range.margin = margin || 0; - - if (range.from.line != null) { - scrollToRange(this, range); - } else { - scrollToCoordsRange(this, range.from, range.to, range.margin); - } - }), - - setSize: methodOp(function(width, height) { - var this$1 = this; - - var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; }; - if (width != null) { this.display.wrapper.style.width = interpret(width); } - if (height != null) { this.display.wrapper.style.height = interpret(height); } - if (this.options.lineWrapping) { clearLineMeasurementCache(this); } - var lineNo = this.display.viewFrom; - this.doc.iter(lineNo, this.display.viewTo, function (line) { - if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) - { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, "widget"); break } } } - ++lineNo; - }); - this.curOp.forceUpdate = true; - signal(this, "refresh", this); - }), - - operation: function(f){return runInOp(this, f)}, - startOperation: function(){return startOperation(this)}, - endOperation: function(){return endOperation(this)}, - - refresh: methodOp(function() { - var oldHeight = this.display.cachedTextHeight; - regChange(this); - this.curOp.forceUpdate = true; - clearCaches(this); - scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop); - updateGutterSpace(this.display); - if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping) - { estimateLineHeights(this); } - signal(this, "refresh", this); - }), - - swapDoc: methodOp(function(doc) { - var old = this.doc; - old.cm = null; - // Cancel the current text selection if any (#5821) - if (this.state.selectingText) { this.state.selectingText(); } - attachDoc(this, doc); - clearCaches(this); - this.display.input.reset(); - scrollToCoords(this, doc.scrollLeft, doc.scrollTop); - this.curOp.forceScroll = true; - signalLater(this, "swapDoc", this, old); - return old - }), - - phrase: function(phraseText) { - var phrases = this.options.phrases; - return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText - }, - - 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} - }; - eventMixin(CodeMirror); - - CodeMirror.registerHelper = function(type, name, value) { - if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; } - helpers[type][name] = value; - }; - CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { - CodeMirror.registerHelper(type, name, value); - helpers[type]._global.push({pred: predicate, val: value}); - }; - } - - // Used for horizontal relative motion. Dir is -1 or 1 (left or - // right), unit can be "codepoint", "char", "column" (like char, but - // doesn't cross line boundaries), "word" (across next word), or - // "group" (to the start of next group of word or - // non-word-non-whitespace chars). The visually param controls - // whether, in right-to-left text, direction 1 means to move towards - // the next index in the string, or towards the character to the right - // of the current position. The resulting position will have a - // hitSide=true property if it reached the end of the document. - function findPosH(doc, pos, dir, unit, visually) { - var oldPos = pos; - var origDir = dir; - var lineObj = getLine(doc, pos.line); - var lineDir = visually && doc.direction == "rtl" ? -dir : dir; - function findNextLine() { - var l = pos.line + lineDir; - if (l < doc.first || l >= doc.first + doc.size) { return false } - pos = new Pos(l, pos.ch, pos.sticky); - return lineObj = getLine(doc, l) - } - function moveOnce(boundToLine) { - var next; - if (unit == "codepoint") { - var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1)); - if (isNaN(ch)) { - next = null; - } else { - var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF; - next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir); - } - } else if (visually) { - next = moveVisually(doc.cm, lineObj, pos, dir); - } else { - next = moveLogically(lineObj, pos, dir); - } - if (next == null) { - if (!boundToLine && findNextLine()) - { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); } - else - { return false } - } else { - pos = next; - } - return true - } - - if (unit == "char" || unit == "codepoint") { - moveOnce(); - } else if (unit == "column") { - moveOnce(true); - } else if (unit == "word" || unit == "group") { - var sawType = null, group = unit == "group"; - var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); - for (var first = true;; first = false) { - if (dir < 0 && !moveOnce(!first)) { break } - var cur = lineObj.text.charAt(pos.ch) || "\n"; - var type = isWordChar(cur, helper) ? "w" - : group && cur == "\n" ? "n" - : !group || /\s/.test(cur) ? null - : "p"; - if (group && !first && !type) { type = "s"; } - if (sawType && sawType != type) { - if (dir < 0) {dir = 1; moveOnce(); pos.sticky = "after";} - break - } - - if (type) { sawType = type; } - if (dir > 0 && !moveOnce(!first)) { break } - } - } - var result = skipAtomic(doc, pos, oldPos, origDir, true); - if (equalCursorPos(oldPos, result)) { result.hitSide = true; } - return result - } - - // For relative vertical movement. Dir may be -1 or 1. Unit can be - // "page" or "line". The resulting position will have a hitSide=true - // property if it reached the end of the document. - function findPosV(cm, pos, dir, unit) { - var doc = cm.doc, x = pos.left, y; - if (unit == "page") { - var pageSize = Math.min(cm.display.wrapper.clientHeight, win(cm).innerHeight || doc(cm).documentElement.clientHeight); - var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3); - y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount; - - } else if (unit == "line") { - y = dir > 0 ? pos.bottom + 3 : pos.top - 3; - } - var target; - for (;;) { - target = coordsChar(cm, x, y); - if (!target.outside) { break } - if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break } - y += dir * 5; - } - return target - } - - // CONTENTEDITABLE INPUT STYLE - - var ContentEditableInput = function(cm) { - this.cm = cm; - this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; - this.polling = new Delayed(); - this.composing = null; - this.gracePeriod = false; - this.readDOMTimeout = null; - }; - - ContentEditableInput.prototype.init = function (display) { - var this$1 = this; - - var input = this, cm = input.cm; - var div = input.div = display.lineDiv; - div.contentEditable = true; - disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize); - - function belongsToInput(e) { - for (var t = e.target; t; t = t.parentNode) { - if (t == div) { return true } - if (/\bCodeMirror-(?:line)?widget\b/.test(t.className)) { break } - } - return false - } - - on(div, "paste", function (e) { - if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } - // IE doesn't fire input events, so we schedule a read for the pasted content in this way - if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); } - }); - - on(div, "compositionstart", function (e) { - this$1.composing = {data: e.data, done: false}; - }); - on(div, "compositionupdate", function (e) { - if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; } - }); - on(div, "compositionend", function (e) { - if (this$1.composing) { - if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); } - this$1.composing.done = true; - } - }); - - on(div, "touchstart", function () { return input.forceCompositionEnd(); }); - - on(div, "input", function () { - if (!this$1.composing) { this$1.readFromDOMSoon(); } - }); - - function onCopyCut(e) { - if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return } - if (cm.somethingSelected()) { - setLastCopied({lineWise: false, text: cm.getSelections()}); - if (e.type == "cut") { cm.replaceSelection("", null, "cut"); } - } else if (!cm.options.lineWiseCopyCut) { - return - } else { - var ranges = copyableRanges(cm); - setLastCopied({lineWise: true, text: ranges.text}); - if (e.type == "cut") { - cm.operation(function () { - cm.setSelections(ranges.ranges, 0, sel_dontScroll); - cm.replaceSelection("", null, "cut"); - }); - } - } - if (e.clipboardData) { - e.clipboardData.clearData(); - var content = lastCopied.text.join("\n"); - // iOS exposes the clipboard API, but seems to discard content inserted into it - e.clipboardData.setData("Text", content); - if (e.clipboardData.getData("Text") == content) { - e.preventDefault(); - return - } - } - // Old-fashioned briefly-focus-a-textarea hack - var kludge = hiddenTextarea(), te = kludge.firstChild; - disableBrowserMagic(te); - cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); - te.value = lastCopied.text.join("\n"); - var hadFocus = activeElt(div.ownerDocument); - selectInput(te); - setTimeout(function () { - cm.display.lineSpace.removeChild(kludge); - hadFocus.focus(); - if (hadFocus == div) { input.showPrimarySelection(); } - }, 50); - } - on(div, "copy", onCopyCut); - on(div, "cut", onCopyCut); - }; - - ContentEditableInput.prototype.screenReaderLabelChanged = function (label) { - // Label for screenreaders, accessibility - if(label) { - this.div.setAttribute('aria-label', label); - } else { - this.div.removeAttribute('aria-label'); - } - }; - - ContentEditableInput.prototype.prepareSelection = function () { - var result = prepareSelection(this.cm, false); - result.focus = activeElt(this.div.ownerDocument) == this.div; - return result - }; - - ContentEditableInput.prototype.showSelection = function (info, takeFocus) { - if (!info || !this.cm.display.view.length) { return } - if (info.focus || takeFocus) { this.showPrimarySelection(); } - this.showMultipleSelections(info); - }; - - ContentEditableInput.prototype.getSelection = function () { - return this.cm.display.wrapper.ownerDocument.getSelection() - }; - - ContentEditableInput.prototype.showPrimarySelection = function () { - var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary(); - var from = prim.from(), to = prim.to(); - - if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) { - sel.removeAllRanges(); - return - } - - var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); - var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset); - if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && - cmp(minPos(curAnchor, curFocus), from) == 0 && - cmp(maxPos(curAnchor, curFocus), to) == 0) - { return } - - var view = cm.display.view; - var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) || - {node: view[0].measure.map[2], offset: 0}; - var end = to.line < cm.display.viewTo && posToDOM(cm, to); - if (!end) { - var measure = view[view.length - 1].measure; - var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; - end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}; - } - - if (!start || !end) { - sel.removeAllRanges(); - return - } - - var old = sel.rangeCount && sel.getRangeAt(0), rng; - try { rng = range(start.node, start.offset, end.offset, end.node); } - catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible - if (rng) { - if (!gecko && cm.state.focused) { - sel.collapse(start.node, start.offset); - if (!rng.collapsed) { - sel.removeAllRanges(); - sel.addRange(rng); - } - } else { - sel.removeAllRanges(); - sel.addRange(rng); - } - if (old && sel.anchorNode == null) { sel.addRange(old); } - else if (gecko) { this.startGracePeriod(); } - } - this.rememberSelection(); - }; - - ContentEditableInput.prototype.startGracePeriod = function () { - var this$1 = this; - - clearTimeout(this.gracePeriod); - this.gracePeriod = setTimeout(function () { - this$1.gracePeriod = false; - if (this$1.selectionChanged()) - { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); } - }, 20); - }; - - ContentEditableInput.prototype.showMultipleSelections = function (info) { - removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); - removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); - }; - - ContentEditableInput.prototype.rememberSelection = function () { - var sel = this.getSelection(); - this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset; - this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset; - }; - - ContentEditableInput.prototype.selectionInEditor = function () { - var sel = this.getSelection(); - if (!sel.rangeCount) { return false } - var node = sel.getRangeAt(0).commonAncestorContainer; - return contains(this.div, node) - }; - - ContentEditableInput.prototype.focus = function () { - if (this.cm.options.readOnly != "nocursor") { - if (!this.selectionInEditor() || activeElt(this.div.ownerDocument) != this.div) - { this.showSelection(this.prepareSelection(), true); } - this.div.focus(); - } - }; - ContentEditableInput.prototype.blur = function () { this.div.blur(); }; - ContentEditableInput.prototype.getField = function () { return this.div }; - - ContentEditableInput.prototype.supportsTouch = function () { return true }; - - ContentEditableInput.prototype.receivedFocus = function () { - var this$1 = this; - - var input = this; - if (this.selectionInEditor()) - { setTimeout(function () { return this$1.pollSelection(); }, 20); } - else - { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); } - - function poll() { - if (input.cm.state.focused) { - input.pollSelection(); - input.polling.set(input.cm.options.pollInterval, poll); - } - } - this.polling.set(this.cm.options.pollInterval, poll); - }; - - ContentEditableInput.prototype.selectionChanged = function () { - var sel = this.getSelection(); - return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || - sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset - }; - - ContentEditableInput.prototype.pollSelection = function () { - if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return } - var sel = this.getSelection(), cm = this.cm; - // On Android Chrome (version 56, at least), backspacing into an - // uneditable block element will put the cursor in that element, - // and then, because it's not editable, hide the virtual keyboard. - // Because Android doesn't allow us to actually detect backspace - // presses in a sane way, this code checks for when that happens - // and simulates a backspace press in this case. - if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) { - this.cm.triggerOnKeyDown({type: "keydown", keyCode: 8, preventDefault: Math.abs}); - this.blur(); - this.focus(); - return - } - if (this.composing) { return } - this.rememberSelection(); - var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); - var head = domToPos(cm, sel.focusNode, sel.focusOffset); - if (anchor && head) { runInOp(cm, function () { - setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); - if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; } - }); } - }; - - ContentEditableInput.prototype.pollContent = function () { - if (this.readDOMTimeout != null) { - clearTimeout(this.readDOMTimeout); - this.readDOMTimeout = null; - } - - var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary(); - var from = sel.from(), to = sel.to(); - if (from.ch == 0 && from.line > cm.firstLine()) - { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); } - if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine()) - { to = Pos(to.line + 1, 0); } - if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false } - - var fromIndex, fromLine, fromNode; - if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { - fromLine = lineNo(display.view[0].line); - fromNode = display.view[0].node; - } else { - fromLine = lineNo(display.view[fromIndex].line); - fromNode = display.view[fromIndex - 1].node.nextSibling; - } - var toIndex = findViewIndex(cm, to.line); - var toLine, toNode; - if (toIndex == display.view.length - 1) { - toLine = display.viewTo - 1; - toNode = display.lineDiv.lastChild; - } else { - toLine = lineNo(display.view[toIndex + 1].line) - 1; - toNode = display.view[toIndex + 1].node.previousSibling; - } - - if (!fromNode) { return false } - var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); - var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); - while (newText.length > 1 && oldText.length > 1) { - if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; } - else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; } - else { break } - } - - var cutFront = 0, cutEnd = 0; - var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length); - while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) - { ++cutFront; } - var newBot = lst(newText), oldBot = lst(oldText); - var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), - oldBot.length - (oldText.length == 1 ? cutFront : 0)); - while (cutEnd < maxCutEnd && - newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) - { ++cutEnd; } - // Try to move start of change to start of selection if ambiguous - if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) { - while (cutFront && cutFront > from.ch && - newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { - cutFront--; - cutEnd++; - } - } - - newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, ""); - newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, ""); - - var chFrom = Pos(fromLine, cutFront); - var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); - if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { - replaceRange(cm.doc, newText, chFrom, chTo, "+input"); - return true - } - }; - - ContentEditableInput.prototype.ensurePolled = function () { - this.forceCompositionEnd(); - }; - ContentEditableInput.prototype.reset = function () { - this.forceCompositionEnd(); - }; - ContentEditableInput.prototype.forceCompositionEnd = function () { - if (!this.composing) { return } - clearTimeout(this.readDOMTimeout); - this.composing = null; - this.updateFromDOM(); - this.div.blur(); - this.div.focus(); - }; - ContentEditableInput.prototype.readFromDOMSoon = function () { - var this$1 = this; - - if (this.readDOMTimeout != null) { return } - this.readDOMTimeout = setTimeout(function () { - this$1.readDOMTimeout = null; - if (this$1.composing) { - if (this$1.composing.done) { this$1.composing = null; } - else { return } - } - this$1.updateFromDOM(); - }, 80); - }; - - ContentEditableInput.prototype.updateFromDOM = function () { - var this$1 = this; - - if (this.cm.isReadOnly() || !this.pollContent()) - { runInOp(this.cm, function () { return regChange(this$1.cm); }); } - }; - - ContentEditableInput.prototype.setUneditable = function (node) { - node.contentEditable = "false"; - }; - - ContentEditableInput.prototype.onKeyPress = function (e) { - if (e.charCode == 0 || this.composing) { return } - e.preventDefault(); - if (!this.cm.isReadOnly()) - { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); } - }; - - ContentEditableInput.prototype.readOnlyChanged = function (val) { - this.div.contentEditable = String(val != "nocursor"); - }; - - ContentEditableInput.prototype.onContextMenu = function () {}; - ContentEditableInput.prototype.resetPosition = function () {}; - - ContentEditableInput.prototype.needsContentAttribute = true; - - function posToDOM(cm, pos) { - var view = findViewForLine(cm, pos.line); - if (!view || view.hidden) { return null } - var line = getLine(cm.doc, pos.line); - var info = mapFromLineView(view, line, pos.line); - - var order = getOrder(line, cm.doc.direction), side = "left"; - if (order) { - var partPos = getBidiPartAt(order, pos.ch); - side = partPos % 2 ? "right" : "left"; - } - var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); - result.offset = result.collapse == "right" ? result.end : result.start; - return result - } - - function isInGutter(node) { - for (var scan = node; scan; scan = scan.parentNode) - { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } } - return false - } - - function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos } - - function domTextBetween(cm, from, to, fromLine, toLine) { - var text = "", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false; - function recognizeMarker(id) { return function (marker) { return marker.id == id; } } - function close() { - if (closing) { - text += lineSep; - if (extraLinebreak) { text += lineSep; } - closing = extraLinebreak = false; - } - } - function addText(str) { - if (str) { - close(); - text += str; - } - } - function walk(node) { - if (node.nodeType == 1) { - var cmText = node.getAttribute("cm-text"); - if (cmText) { - addText(cmText); - return - } - var markerID = node.getAttribute("cm-marker"), range; - if (markerID) { - var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); - if (found.length && (range = found[0].find(0))) - { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); } - return - } - if (node.getAttribute("contenteditable") == "false") { return } - var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName); - if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return } - - if (isBlock) { close(); } - for (var i = 0; i < node.childNodes.length; i++) - { walk(node.childNodes[i]); } - - if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; } - if (isBlock) { closing = true; } - } else if (node.nodeType == 3) { - addText(node.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " ")); - } - } - for (;;) { - walk(from); - if (from == to) { break } - from = from.nextSibling; - extraLinebreak = false; - } - return text - } - - function domToPos(cm, node, offset) { - var lineNode; - if (node == cm.display.lineDiv) { - lineNode = cm.display.lineDiv.childNodes[offset]; - if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) } - node = null; offset = 0; - } else { - for (lineNode = node;; lineNode = lineNode.parentNode) { - if (!lineNode || lineNode == cm.display.lineDiv) { return null } - if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break } - } - } - for (var i = 0; i < cm.display.view.length; i++) { - var lineView = cm.display.view[i]; - if (lineView.node == lineNode) - { return locateNodeInLineView(lineView, node, offset) } - } - } - - function locateNodeInLineView(lineView, node, offset) { - var wrapper = lineView.text.firstChild, bad = false; - if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) } - if (node == wrapper) { - bad = true; - node = wrapper.childNodes[offset]; - offset = 0; - if (!node) { - var line = lineView.rest ? lst(lineView.rest) : lineView.line; - return badPos(Pos(lineNo(line), line.text.length), bad) - } - } - - var textNode = node.nodeType == 3 ? node : null, topNode = node; - if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { - textNode = node.firstChild; - if (offset) { offset = textNode.nodeValue.length; } - } - while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; } - var measure = lineView.measure, maps = measure.maps; - - function find(textNode, topNode, offset) { - for (var i = -1; i < (maps ? maps.length : 0); i++) { - var map = i < 0 ? measure.map : maps[i]; - for (var j = 0; j < map.length; j += 3) { - var curNode = map[j + 2]; - if (curNode == textNode || curNode == topNode) { - var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]); - var ch = map[j] + offset; - if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; } - return Pos(line, ch) - } - } - } - } - var found = find(textNode, topNode, offset); - if (found) { return badPos(found, bad) } - - // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems - for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { - found = find(after, after.firstChild, 0); - if (found) - { return badPos(Pos(found.line, found.ch - dist), bad) } - else - { dist += after.textContent.length; } - } - for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) { - found = find(before, before.firstChild, -1); - if (found) - { return badPos(Pos(found.line, found.ch + dist$1), bad) } - else - { dist$1 += before.textContent.length; } - } - } - - // TEXTAREA INPUT STYLE - - var TextareaInput = function(cm) { - this.cm = cm; - // See input.poll and input.reset - this.prevInput = ""; - - // Flag that indicates whether we expect input to appear real soon - // now (after some event like 'keypress' or 'input') and are - // polling intensively. - this.pollingFast = false; - // Self-resetting timeout for the poller - this.polling = new Delayed(); - // Used to work around IE issue with selection being forgotten when focus moves away from textarea - this.hasSelection = false; - this.composing = null; - this.resetting = false; - }; - - TextareaInput.prototype.init = function (display) { - var this$1 = this; - - var input = this, cm = this.cm; - this.createField(display); - var te = this.textarea; - - display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild); - - // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) - if (ios) { te.style.width = "0px"; } - - on(te, "input", function () { - if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; } - input.poll(); - }); - - on(te, "paste", function (e) { - if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } - - cm.state.pasteIncoming = +new Date; - input.fastPoll(); - }); - - function prepareCopyCut(e) { - if (signalDOMEvent(cm, e)) { return } - if (cm.somethingSelected()) { - setLastCopied({lineWise: false, text: cm.getSelections()}); - } else if (!cm.options.lineWiseCopyCut) { - return - } else { - var ranges = copyableRanges(cm); - setLastCopied({lineWise: true, text: ranges.text}); - if (e.type == "cut") { - cm.setSelections(ranges.ranges, null, sel_dontScroll); - } else { - input.prevInput = ""; - te.value = ranges.text.join("\n"); - selectInput(te); - } - } - if (e.type == "cut") { cm.state.cutIncoming = +new Date; } - } - on(te, "cut", prepareCopyCut); - on(te, "copy", prepareCopyCut); - - on(display.scroller, "paste", function (e) { - if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return } - if (!te.dispatchEvent) { - cm.state.pasteIncoming = +new Date; - input.focus(); - return - } - - // Pass the `paste` event to the textarea so it's handled by its event listener. - var event = new Event("paste"); - event.clipboardData = e.clipboardData; - te.dispatchEvent(event); - }); - - // Prevent normal selection in the editor (we handle our own) - on(display.lineSpace, "selectstart", function (e) { - if (!eventInWidget(display, e)) { e_preventDefault(e); } - }); - - on(te, "compositionstart", function () { - var start = cm.getCursor("from"); - if (input.composing) { input.composing.range.clear(); } - input.composing = { - start: start, - range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) - }; - }); - on(te, "compositionend", function () { - if (input.composing) { - input.poll(); - input.composing.range.clear(); - input.composing = null; - } - }); - }; - - TextareaInput.prototype.createField = function (_display) { - // Wraps and hides input textarea - this.wrapper = hiddenTextarea(); - // The semihidden textarea that is focused when the editor is - // focused, and receives input. - this.textarea = this.wrapper.firstChild; - var opts = this.cm.options; - disableBrowserMagic(this.textarea, opts.spellcheck, opts.autocorrect, opts.autocapitalize); - }; - - TextareaInput.prototype.screenReaderLabelChanged = function (label) { - // Label for screenreaders, accessibility - if(label) { - this.textarea.setAttribute('aria-label', label); - } else { - this.textarea.removeAttribute('aria-label'); - } - }; - - TextareaInput.prototype.prepareSelection = function () { - // Redraw the selection and/or cursor - var cm = this.cm, display = cm.display, doc = cm.doc; - var result = prepareSelection(cm); - - // Move the hidden textarea near the cursor to prevent scrolling artifacts - if (cm.options.moveInputWithCursor) { - var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); - var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); - result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, - headPos.top + lineOff.top - wrapOff.top)); - result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, - headPos.left + lineOff.left - wrapOff.left)); - } - - return result - }; - - TextareaInput.prototype.showSelection = function (drawn) { - var cm = this.cm, display = cm.display; - removeChildrenAndAdd(display.cursorDiv, drawn.cursors); - removeChildrenAndAdd(display.selectionDiv, drawn.selection); - if (drawn.teTop != null) { - this.wrapper.style.top = drawn.teTop + "px"; - this.wrapper.style.left = drawn.teLeft + "px"; - } - }; - - // Reset the input to correspond to the selection (or to be empty, - // when not typing and nothing is selected) - TextareaInput.prototype.reset = function (typing) { - if (this.contextMenuPending || this.composing && typing) { return } - var cm = this.cm; - this.resetting = true; - if (cm.somethingSelected()) { - this.prevInput = ""; - var content = cm.getSelection(); - this.textarea.value = content; - if (cm.state.focused) { selectInput(this.textarea); } - if (ie && ie_version >= 9) { this.hasSelection = content; } - } else if (!typing) { - this.prevInput = this.textarea.value = ""; - if (ie && ie_version >= 9) { this.hasSelection = null; } - } - this.resetting = false; - }; - - TextareaInput.prototype.getField = function () { return this.textarea }; - - TextareaInput.prototype.supportsTouch = function () { return false }; - - TextareaInput.prototype.focus = function () { - if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt(this.textarea.ownerDocument) != this.textarea)) { - try { this.textarea.focus(); } - catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM - } - }; - - TextareaInput.prototype.blur = function () { this.textarea.blur(); }; - - TextareaInput.prototype.resetPosition = function () { - this.wrapper.style.top = this.wrapper.style.left = 0; - }; - - TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); }; - - // Poll for input changes, using the normal rate of polling. This - // runs as long as the editor is focused. - TextareaInput.prototype.slowPoll = function () { - var this$1 = this; - - if (this.pollingFast) { return } - this.polling.set(this.cm.options.pollInterval, function () { - this$1.poll(); - if (this$1.cm.state.focused) { this$1.slowPoll(); } - }); - }; - - // When an event has just come in that is likely to add or change - // something in the input textarea, we poll faster, to ensure that - // the change appears on the screen quickly. - TextareaInput.prototype.fastPoll = function () { - var missed = false, input = this; - input.pollingFast = true; - function p() { - var changed = input.poll(); - if (!changed && !missed) {missed = true; input.polling.set(60, p);} - else {input.pollingFast = false; input.slowPoll();} - } - input.polling.set(20, p); - }; - - // Read input from the textarea, and update the document to match. - // When something is selected, it is present in the textarea, and - // selected (unless it is huge, in which case a placeholder is - // used). When nothing is selected, the cursor sits after previously - // seen text (can be empty), which is stored in prevInput (we must - // not reset the textarea when typing, because that breaks IME). - TextareaInput.prototype.poll = function () { - var this$1 = this; - - var cm = this.cm, input = this.textarea, prevInput = this.prevInput; - // Since this is called a *lot*, try to bail out as cheaply as - // possible when it is clear that nothing happened. hasSelection - // will be the case when there is a lot of text in the textarea, - // in which case reading its value would be expensive. - if (this.contextMenuPending || this.resetting || !cm.state.focused || - (hasSelection(input) && !prevInput && !this.composing) || - cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) - { return false } - - var text = input.value; - // If nothing changed, bail. - if (text == prevInput && !cm.somethingSelected()) { return false } - // Work around nonsensical selection resetting in IE9/10, and - // inexplicable appearance of private area unicode characters on - // some key combos in Mac (#2689). - if (ie && ie_version >= 9 && this.hasSelection === text || - mac && /[\uf700-\uf7ff]/.test(text)) { - cm.display.input.reset(); - return false - } - - if (cm.doc.sel == cm.display.selForContextMenu) { - var first = text.charCodeAt(0); - if (first == 0x200b && !prevInput) { prevInput = "\u200b"; } - if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") } - } - // Find the part of the input that is actually new - var same = 0, l = Math.min(prevInput.length, text.length); - while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; } - - runInOp(cm, function () { - applyTextInput(cm, text.slice(same), prevInput.length - same, - null, this$1.composing ? "*compose" : null); - - // Don't leave long text in the textarea, since it makes further polling slow - if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = ""; } - else { this$1.prevInput = text; } - - if (this$1.composing) { - this$1.composing.range.clear(); - this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"), - {className: "CodeMirror-composing"}); - } - }); - return true - }; - - TextareaInput.prototype.ensurePolled = function () { - if (this.pollingFast && this.poll()) { this.pollingFast = false; } - }; - - TextareaInput.prototype.onKeyPress = function () { - if (ie && ie_version >= 9) { this.hasSelection = null; } - this.fastPoll(); - }; - - TextareaInput.prototype.onContextMenu = function (e) { - var input = this, cm = input.cm, display = cm.display, te = input.textarea; - if (input.contextMenuPending) { input.contextMenuPending(); } - var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; - if (!pos || presto) { return } // Opera is difficult. - - // Reset the current text selection only if the click is done outside of the selection - // and 'resetSelectionOnContextMenu' option is true. - var reset = cm.options.resetSelectionOnContextMenu; - if (reset && cm.doc.sel.contains(pos) == -1) - { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); } - - var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText; - var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect(); - input.wrapper.style.cssText = "position: static"; - te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; - var oldScrollY; - if (webkit) { oldScrollY = te.ownerDocument.defaultView.scrollY; } // Work around Chrome issue (#2712) - display.input.focus(); - if (webkit) { te.ownerDocument.defaultView.scrollTo(null, oldScrollY); } - display.input.reset(); - // Adds "Select all" to context menu in FF - if (!cm.somethingSelected()) { te.value = input.prevInput = " "; } - input.contextMenuPending = rehide; - display.selForContextMenu = cm.doc.sel; - clearTimeout(display.detectingSelectAll); - - // Select-all will be greyed out if there's nothing to select, so - // this adds a zero-width space so that we can later check whether - // it got selected. - function prepareSelectAllHack() { - if (te.selectionStart != null) { - var selected = cm.somethingSelected(); - var extval = "\u200b" + (selected ? te.value : ""); - te.value = "\u21da"; // Used to catch context-menu undo - te.value = extval; - input.prevInput = selected ? "" : "\u200b"; - te.selectionStart = 1; te.selectionEnd = extval.length; - // Re-set this, in case some other handler touched the - // selection in the meantime. - display.selForContextMenu = cm.doc.sel; - } - } - function rehide() { - if (input.contextMenuPending != rehide) { return } - input.contextMenuPending = false; - input.wrapper.style.cssText = oldWrapperCSS; - te.style.cssText = oldCSS; - if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); } - - // Try to detect the user choosing select-all - if (te.selectionStart != null) { - if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); } - var i = 0, poll = function () { - if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && - te.selectionEnd > 0 && input.prevInput == "\u200b") { - operation(cm, selectAll)(cm); - } else if (i++ < 10) { - display.detectingSelectAll = setTimeout(poll, 500); - } else { - display.selForContextMenu = null; - display.input.reset(); - } - }; - display.detectingSelectAll = setTimeout(poll, 200); - } - } - - if (ie && ie_version >= 9) { prepareSelectAllHack(); } - if (captureRightClick) { - e_stop(e); - var mouseup = function () { - off(window, "mouseup", mouseup); - setTimeout(rehide, 20); - }; - on(window, "mouseup", mouseup); - } else { - setTimeout(rehide, 50); - } - }; - - TextareaInput.prototype.readOnlyChanged = function (val) { - if (!val) { this.reset(); } - this.textarea.disabled = val == "nocursor"; - this.textarea.readOnly = !!val; - }; - - TextareaInput.prototype.setUneditable = function () {}; - - TextareaInput.prototype.needsContentAttribute = false; - - function fromTextArea(textarea, options) { - options = options ? copyObj(options) : {}; - options.value = textarea.value; - if (!options.tabindex && textarea.tabIndex) - { options.tabindex = textarea.tabIndex; } - if (!options.placeholder && textarea.placeholder) - { options.placeholder = textarea.placeholder; } - // Set autofocus to true if this textarea is focused, or if it has - // autofocus and no other element is focused. - if (options.autofocus == null) { - var hasFocus = activeElt(textarea.ownerDocument); - options.autofocus = hasFocus == textarea || - textarea.getAttribute("autofocus") != null && hasFocus == document.body; - } - - function save() {textarea.value = cm.getValue();} - - var realSubmit; - if (textarea.form) { - on(textarea.form, "submit", save); - // Deplorable hack to make the submit method do the right thing. - if (!options.leaveSubmitMethodAlone) { - var form = textarea.form; - realSubmit = form.submit; - try { - var wrappedSubmit = form.submit = function () { - save(); - form.submit = realSubmit; - form.submit(); - form.submit = wrappedSubmit; - }; - } catch(e) {} - } - } - - options.finishInit = function (cm) { - cm.save = save; - cm.getTextArea = function () { return textarea; }; - cm.toTextArea = function () { - cm.toTextArea = isNaN; // Prevent this from being ran twice - save(); - textarea.parentNode.removeChild(cm.getWrapperElement()); - textarea.style.display = ""; - if (textarea.form) { - off(textarea.form, "submit", save); - if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == "function") - { textarea.form.submit = realSubmit; } - } - }; - }; - - textarea.style.display = "none"; - var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); }, - options); - return cm - } - - function addLegacyProps(CodeMirror) { - CodeMirror.off = off; - CodeMirror.on = on; - CodeMirror.wheelEventPixels = wheelEventPixels; - CodeMirror.Doc = Doc; - CodeMirror.splitLines = splitLinesAuto; - CodeMirror.countColumn = countColumn; - CodeMirror.findColumn = findColumn; - CodeMirror.isWordChar = isWordCharBasic; - CodeMirror.Pass = Pass; - CodeMirror.signal = signal; - CodeMirror.Line = Line; - CodeMirror.changeEnd = changeEnd; - CodeMirror.scrollbarModel = scrollbarModel; - CodeMirror.Pos = Pos; - CodeMirror.cmpPos = cmp; - CodeMirror.modes = modes; - CodeMirror.mimeModes = mimeModes; - CodeMirror.resolveMode = resolveMode; - CodeMirror.getMode = getMode; - CodeMirror.modeExtensions = modeExtensions; - CodeMirror.extendMode = extendMode; - CodeMirror.copyState = copyState; - CodeMirror.startState = startState; - CodeMirror.innerMode = innerMode; - CodeMirror.commands = commands; - CodeMirror.keyMap = keyMap; - CodeMirror.keyName = keyName; - CodeMirror.isModifierKey = isModifierKey; - CodeMirror.lookupKey = lookupKey; - CodeMirror.normalizeKeyMap = normalizeKeyMap; - CodeMirror.StringStream = StringStream; - CodeMirror.SharedTextMarker = SharedTextMarker; - CodeMirror.TextMarker = TextMarker; - CodeMirror.LineWidget = LineWidget; - CodeMirror.e_preventDefault = e_preventDefault; - CodeMirror.e_stopPropagation = e_stopPropagation; - CodeMirror.e_stop = e_stop; - CodeMirror.addClass = addClass; - CodeMirror.contains = contains; - CodeMirror.rmClass = rmClass; - CodeMirror.keyNames = keyNames; - } - - // EDITOR CONSTRUCTOR - - defineOptions(CodeMirror); - - addEditorMethods(CodeMirror); - - // Set up methods on CodeMirror's prototype to redirect to the editor's document. - var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); - for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) - { CodeMirror.prototype[prop] = (function(method) { - return function() {return method.apply(this.doc, arguments)} - })(Doc.prototype[prop]); } } - - eventMixin(Doc); - CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}; - - // Extra arguments are stored as the mode's dependencies, which is - // used by (legacy) mechanisms like loadmode.js to automatically - // load a mode. (Preferred mechanism is the require/define calls.) - CodeMirror.defineMode = function(name/*, mode, …*/) { - if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name; } - defineMode.apply(this, arguments); - }; - - CodeMirror.defineMIME = defineMIME; - - // Minimal default mode. - CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); }); - CodeMirror.defineMIME("text/plain", "null"); - - // EXTENSIONS - - CodeMirror.defineExtension = function (name, func) { - CodeMirror.prototype[name] = func; - }; - CodeMirror.defineDocExtension = function (name, func) { - Doc.prototype[name] = func; - }; - - CodeMirror.fromTextArea = fromTextArea; - - addLegacyProps(CodeMirror); - - CodeMirror.version = "5.65.15"; - - return CodeMirror; - -}))); - - -/***/ }), - -/***/ 629: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: https://codemirror.net/5/LICENSE - -(function(mod) { - if (true) // CommonJS - mod(__webpack_require__(631)); - else {} -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("css", function(config, parserConfig) { - var inline = parserConfig.inline - if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode("text/css"); - - var indentUnit = config.indentUnit, - tokenHooks = parserConfig.tokenHooks, - documentTypes = parserConfig.documentTypes || {}, - mediaTypes = parserConfig.mediaTypes || {}, - mediaFeatures = parserConfig.mediaFeatures || {}, - mediaValueKeywords = parserConfig.mediaValueKeywords || {}, - propertyKeywords = parserConfig.propertyKeywords || {}, - nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {}, - fontProperties = parserConfig.fontProperties || {}, - counterDescriptors = parserConfig.counterDescriptors || {}, - colorKeywords = parserConfig.colorKeywords || {}, - valueKeywords = parserConfig.valueKeywords || {}, - allowNested = parserConfig.allowNested, - lineComment = parserConfig.lineComment, - supportsAtComponent = parserConfig.supportsAtComponent === true, - highlightNonStandardPropertyKeywords = config.highlightNonStandardPropertyKeywords !== false; - - var type, override; - function ret(style, tp) { type = tp; return style; } - - // Tokenizers - - function tokenBase(stream, state) { - var ch = stream.next(); - if (tokenHooks[ch]) { - var result = tokenHooks[ch](stream, state); - if (result !== false) return result; - } - if (ch == "@") { - stream.eatWhile(/[\w\\\-]/); - return ret("def", stream.current()); - } else if (ch == "=" || (ch == "~" || ch == "|") && stream.eat("=")) { - return ret(null, "compare"); - } else if (ch == "\"" || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } else if (ch == "#") { - stream.eatWhile(/[\w\\\-]/); - return ret("atom", "hash"); - } else if (ch == "!") { - stream.match(/^\s*\w*/); - return ret("keyword", "important"); - } else if (/\d/.test(ch) || ch == "." && stream.eat(/\d/)) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } else if (ch === "-") { - if (/[\d.]/.test(stream.peek())) { - stream.eatWhile(/[\w.%]/); - return ret("number", "unit"); - } else if (stream.match(/^-[\w\\\-]*/)) { - stream.eatWhile(/[\w\\\-]/); - if (stream.match(/^\s*:/, false)) - return ret("variable-2", "variable-definition"); - return ret("variable-2", "variable"); - } else if (stream.match(/^\w+-/)) { - return ret("meta", "meta"); - } - } else if (/[,+>*\/]/.test(ch)) { - return ret(null, "select-op"); - } else if (ch == "." && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) { - return ret("qualifier", "qualifier"); - } else if (/[:;{}\[\]\(\)]/.test(ch)) { - return ret(null, ch); - } else if (stream.match(/^[\w-.]+(?=\()/)) { - if (/^(url(-prefix)?|domain|regexp)$/i.test(stream.current())) { - state.tokenize = tokenParenthesized; - } - return ret("variable callee", "variable"); - } else if (/[\w\\\-]/.test(ch)) { - stream.eatWhile(/[\w\\\-]/); - return ret("property", "word"); - } else { - return ret(null, null); - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, ch; - while ((ch = stream.next()) != null) { - if (ch == quote && !escaped) { - if (quote == ")") stream.backUp(1); - break; - } - escaped = !escaped && ch == "\\"; - } - if (ch == quote || !escaped && quote != ")") state.tokenize = null; - return ret("string", "string"); - }; - } - - function tokenParenthesized(stream, state) { - stream.next(); // Must be '(' - if (!stream.match(/^\s*[\"\')]/, false)) - state.tokenize = tokenString(")"); - else - state.tokenize = null; - return ret(null, "("); - } - - // Context management - - function Context(type, indent, prev) { - this.type = type; - this.indent = indent; - this.prev = prev; - } - - function pushContext(state, stream, type, indent) { - state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context); - return type; - } - - function popContext(state) { - if (state.context.prev) - state.context = state.context.prev; - return state.context.type; - } - - function pass(type, stream, state) { - return states[state.context.type](type, stream, state); - } - function popAndPass(type, stream, state, n) { - for (var i = n || 1; i > 0; i--) - state.context = state.context.prev; - return pass(type, stream, state); - } - - // Parser - - function wordAsValue(stream) { - var word = stream.current().toLowerCase(); - if (valueKeywords.hasOwnProperty(word)) - override = "atom"; - else if (colorKeywords.hasOwnProperty(word)) - override = "keyword"; - else - override = "variable"; - } - - var states = {}; - - states.top = function(type, stream, state) { - if (type == "{") { - return pushContext(state, stream, "block"); - } else if (type == "}" && state.context.prev) { - return popContext(state); - } else if (supportsAtComponent && /@component/i.test(type)) { - return pushContext(state, stream, "atComponentBlock"); - } else if (/^@(-moz-)?document$/i.test(type)) { - return pushContext(state, stream, "documentTypes"); - } else if (/^@(media|supports|(-moz-)?document|import)$/i.test(type)) { - return pushContext(state, stream, "atBlock"); - } else if (/^@(font-face|counter-style)/i.test(type)) { - state.stateArg = type; - return "restricted_atBlock_before"; - } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(type)) { - return "keyframes"; - } else if (type && type.charAt(0) == "@") { - return pushContext(state, stream, "at"); - } else if (type == "hash") { - override = "builtin"; - } else if (type == "word") { - override = "tag"; - } else if (type == "variable-definition") { - return "maybeprop"; - } else if (type == "interpolation") { - return pushContext(state, stream, "interpolation"); - } else if (type == ":") { - return "pseudo"; - } else if (allowNested && type == "(") { - return pushContext(state, stream, "parens"); - } - return state.context.type; - }; - - states.block = function(type, stream, state) { - if (type == "word") { - var word = stream.current().toLowerCase(); - if (propertyKeywords.hasOwnProperty(word)) { - override = "property"; - return "maybeprop"; - } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) { - override = highlightNonStandardPropertyKeywords ? "string-2" : "property"; - return "maybeprop"; - } else if (allowNested) { - override = stream.match(/^\s*:(?:\s|$)/, false) ? "property" : "tag"; - return "block"; - } else { - override += " error"; - return "maybeprop"; - } - } else if (type == "meta") { - return "block"; - } else if (!allowNested && (type == "hash" || type == "qualifier")) { - override = "error"; - return "block"; - } else { - return states.top(type, stream, state); - } - }; - - states.maybeprop = function(type, stream, state) { - if (type == ":") return pushContext(state, stream, "prop"); - return pass(type, stream, state); - }; - - states.prop = function(type, stream, state) { - if (type == ";") return popContext(state); - if (type == "{" && allowNested) return pushContext(state, stream, "propBlock"); - if (type == "}" || type == "{") return popAndPass(type, stream, state); - if (type == "(") return pushContext(state, stream, "parens"); - - if (type == "hash" && !/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(stream.current())) { - override += " error"; - } else if (type == "word") { - wordAsValue(stream); - } else if (type == "interpolation") { - return pushContext(state, stream, "interpolation"); - } - return "prop"; - }; - - states.propBlock = function(type, _stream, state) { - if (type == "}") return popContext(state); - if (type == "word") { override = "property"; return "maybeprop"; } - return state.context.type; - }; - - states.parens = function(type, stream, state) { - if (type == "{" || type == "}") return popAndPass(type, stream, state); - if (type == ")") return popContext(state); - if (type == "(") return pushContext(state, stream, "parens"); - if (type == "interpolation") return pushContext(state, stream, "interpolation"); - if (type == "word") wordAsValue(stream); - return "parens"; - }; - - states.pseudo = function(type, stream, state) { - if (type == "meta") return "pseudo"; - - if (type == "word") { - override = "variable-3"; - return state.context.type; - } - return pass(type, stream, state); - }; - - states.documentTypes = function(type, stream, state) { - if (type == "word" && documentTypes.hasOwnProperty(stream.current())) { - override = "tag"; - return state.context.type; - } else { - return states.atBlock(type, stream, state); - } - }; - - states.atBlock = function(type, stream, state) { - if (type == "(") return pushContext(state, stream, "atBlock_parens"); - if (type == "}" || type == ";") return popAndPass(type, stream, state); - if (type == "{") return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top"); - - if (type == "interpolation") return pushContext(state, stream, "interpolation"); - - if (type == "word") { - var word = stream.current().toLowerCase(); - if (word == "only" || word == "not" || word == "and" || word == "or") - override = "keyword"; - else if (mediaTypes.hasOwnProperty(word)) - override = "attribute"; - else if (mediaFeatures.hasOwnProperty(word)) - override = "property"; - else if (mediaValueKeywords.hasOwnProperty(word)) - override = "keyword"; - else if (propertyKeywords.hasOwnProperty(word)) - override = "property"; - else if (nonStandardPropertyKeywords.hasOwnProperty(word)) - override = highlightNonStandardPropertyKeywords ? "string-2" : "property"; - else if (valueKeywords.hasOwnProperty(word)) - override = "atom"; - else if (colorKeywords.hasOwnProperty(word)) - override = "keyword"; - else - override = "error"; - } - return state.context.type; - }; - - states.atComponentBlock = function(type, stream, state) { - if (type == "}") - return popAndPass(type, stream, state); - if (type == "{") - return popContext(state) && pushContext(state, stream, allowNested ? "block" : "top", false); - if (type == "word") - override = "error"; - return state.context.type; - }; - - states.atBlock_parens = function(type, stream, state) { - if (type == ")") return popContext(state); - if (type == "{" || type == "}") return popAndPass(type, stream, state, 2); - return states.atBlock(type, stream, state); - }; - - states.restricted_atBlock_before = function(type, stream, state) { - if (type == "{") - return pushContext(state, stream, "restricted_atBlock"); - if (type == "word" && state.stateArg == "@counter-style") { - override = "variable"; - return "restricted_atBlock_before"; - } - return pass(type, stream, state); - }; - - states.restricted_atBlock = function(type, stream, state) { - if (type == "}") { - state.stateArg = null; - return popContext(state); - } - if (type == "word") { - if ((state.stateArg == "@font-face" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) || - (state.stateArg == "@counter-style" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase()))) - override = "error"; - else - override = "property"; - return "maybeprop"; - } - return "restricted_atBlock"; - }; - - states.keyframes = function(type, stream, state) { - if (type == "word") { override = "variable"; return "keyframes"; } - if (type == "{") return pushContext(state, stream, "top"); - return pass(type, stream, state); - }; - - states.at = function(type, stream, state) { - if (type == ";") return popContext(state); - if (type == "{" || type == "}") return popAndPass(type, stream, state); - if (type == "word") override = "tag"; - else if (type == "hash") override = "builtin"; - return "at"; - }; - - states.interpolation = function(type, stream, state) { - if (type == "}") return popContext(state); - if (type == "{" || type == ";") return popAndPass(type, stream, state); - if (type == "word") override = "variable"; - else if (type != "variable" && type != "(" && type != ")") override = "error"; - return "interpolation"; - }; - - return { - startState: function(base) { - return {tokenize: null, - state: inline ? "block" : "top", - stateArg: null, - context: new Context(inline ? "block" : "top", base || 0, null)}; - }, - - token: function(stream, state) { - if (!state.tokenize && stream.eatSpace()) return null; - var style = (state.tokenize || tokenBase)(stream, state); - if (style && typeof style == "object") { - type = style[1]; - style = style[0]; - } - override = style; - if (type != "comment") - state.state = states[state.state](type, stream, state); - return override; - }, - - indent: function(state, textAfter) { - var cx = state.context, ch = textAfter && textAfter.charAt(0); - var indent = cx.indent; - if (cx.type == "prop" && (ch == "}" || ch == ")")) cx = cx.prev; - if (cx.prev) { - if (ch == "}" && (cx.type == "block" || cx.type == "top" || - cx.type == "interpolation" || cx.type == "restricted_atBlock")) { - // Resume indentation from parent context. - cx = cx.prev; - indent = cx.indent; - } else if (ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") || - ch == "{" && (cx.type == "at" || cx.type == "atBlock")) { - // Dedent relative to current context. - indent = Math.max(0, cx.indent - indentUnit); - } - } - return indent; - }, - - electricChars: "}", - blockCommentStart: "/*", - blockCommentEnd: "*/", - blockCommentContinue: " * ", - lineComment: lineComment, - fold: "brace" - }; -}); - - function keySet(array) { - var keys = {}; - for (var i = 0; i < array.length; ++i) { - keys[array[i].toLowerCase()] = true; - } - return keys; - } - - var documentTypes_ = [ - "domain", "regexp", "url", "url-prefix" - ], documentTypes = keySet(documentTypes_); - - var mediaTypes_ = [ - "all", "aural", "braille", "handheld", "print", "projection", "screen", - "tty", "tv", "embossed" - ], mediaTypes = keySet(mediaTypes_); - - var mediaFeatures_ = [ - "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", - "dynamic-range", "video-dynamic-range" - ], mediaFeatures = keySet(mediaFeatures_); - - var mediaValueKeywords_ = [ - "landscape", "portrait", "none", "coarse", "fine", "on-demand", "hover", - "interlace", "progressive", - "dark", "light", - "standard", "high" - ], mediaValueKeywords = keySet(mediaValueKeywords_); - - var propertyKeywords_ = [ - "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", - // SVG-specific - "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", - ], propertyKeywords = keySet(propertyKeywords_); - - var nonStandardPropertyKeywords_ = [ - "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" - ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_); - - var fontProperties_ = [ - "font-display", "font-family", "src", "unicode-range", "font-variant", - "font-feature-settings", "font-stretch", "font-weight", "font-style" - ], fontProperties = keySet(fontProperties_); - - var counterDescriptors_ = [ - "additive-symbols", "fallback", "negative", "pad", "prefix", "range", - "speak-as", "suffix", "symbols", "system" - ], counterDescriptors = keySet(counterDescriptors_); - - var colorKeywords_ = [ - "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" - ], colorKeywords = keySet(colorKeywords_); - - var valueKeywords_ = [ - "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", - "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", "conic-gradient", "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-play-button", "media-slider", "media-sliderthumb", - "media-volume-slider", "media-volume-sliderthumb", "medium", - "menu", "menulist", "menulist-button", - "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", - "repeating-conic-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" - ], valueKeywords = keySet(valueKeywords_); - - var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_) - .concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_) - .concat(valueKeywords_); - CodeMirror.registerHelper("hintWords", "css", allWords); - - function tokenCComment(stream, state) { - var maybeEnd = false, ch; - while ((ch = stream.next()) != null) { - if (maybeEnd && ch == "/") { - state.tokenize = null; - break; - } - maybeEnd = (ch == "*"); - } - return ["comment", "comment"]; - } - - CodeMirror.defineMIME("text/css", { - documentTypes: documentTypes, - mediaTypes: mediaTypes, - mediaFeatures: mediaFeatures, - mediaValueKeywords: mediaValueKeywords, - propertyKeywords: propertyKeywords, - nonStandardPropertyKeywords: nonStandardPropertyKeywords, - fontProperties: fontProperties, - counterDescriptors: counterDescriptors, - colorKeywords: colorKeywords, - valueKeywords: valueKeywords, - tokenHooks: { - "/": function(stream, state) { - if (!stream.eat("*")) return false; - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - }, - name: "css" - }); - - CodeMirror.defineMIME("text/x-scss", { - mediaTypes: mediaTypes, - mediaFeatures: mediaFeatures, - mediaValueKeywords: mediaValueKeywords, - propertyKeywords: propertyKeywords, - nonStandardPropertyKeywords: nonStandardPropertyKeywords, - colorKeywords: colorKeywords, - valueKeywords: valueKeywords, - fontProperties: fontProperties, - allowNested: true, - lineComment: "//", - tokenHooks: { - "/": function(stream, state) { - if (stream.eat("/")) { - stream.skipToEnd(); - return ["comment", "comment"]; - } else if (stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } else { - return ["operator", "operator"]; - } - }, - ":": function(stream) { - if (stream.match(/^\s*\{/, false)) - return [null, null] - return false; - }, - "$": function(stream) { - stream.match(/^[\w-]+/); - if (stream.match(/^\s*:/, false)) - return ["variable-2", "variable-definition"]; - return ["variable-2", "variable"]; - }, - "#": function(stream) { - if (!stream.eat("{")) return false; - return [null, "interpolation"]; - } - }, - name: "css", - helperType: "scss" - }); - - CodeMirror.defineMIME("text/x-less", { - mediaTypes: mediaTypes, - mediaFeatures: mediaFeatures, - mediaValueKeywords: mediaValueKeywords, - propertyKeywords: propertyKeywords, - nonStandardPropertyKeywords: nonStandardPropertyKeywords, - colorKeywords: colorKeywords, - valueKeywords: valueKeywords, - fontProperties: fontProperties, - allowNested: true, - lineComment: "//", - tokenHooks: { - "/": function(stream, state) { - if (stream.eat("/")) { - stream.skipToEnd(); - return ["comment", "comment"]; - } else if (stream.eat("*")) { - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } else { - return ["operator", "operator"]; - } - }, - "@": function(stream) { - if (stream.eat("{")) return [null, "interpolation"]; - if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i, false)) return false; - stream.eatWhile(/[\w\\\-]/); - if (stream.match(/^\s*:/, false)) - return ["variable-2", "variable-definition"]; - return ["variable-2", "variable"]; - }, - "&": function() { - return ["atom", "atom"]; - } - }, - name: "css", - helperType: "less" - }); - - CodeMirror.defineMIME("text/x-gss", { - documentTypes: documentTypes, - mediaTypes: mediaTypes, - mediaFeatures: mediaFeatures, - propertyKeywords: propertyKeywords, - nonStandardPropertyKeywords: nonStandardPropertyKeywords, - fontProperties: fontProperties, - counterDescriptors: counterDescriptors, - colorKeywords: colorKeywords, - valueKeywords: valueKeywords, - supportsAtComponent: true, - tokenHooks: { - "/": function(stream, state) { - if (!stream.eat("*")) return false; - state.tokenize = tokenCComment; - return tokenCComment(stream, state); - } - }, - name: "css", - helperType: "gss" - }); - -}); - - -/***/ }), - -/***/ 531: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: https://codemirror.net/5/LICENSE - -(function(mod) { - if (true) // CommonJS - mod(__webpack_require__(631), __webpack_require__(589), __webpack_require__(876), __webpack_require__(629)); - else {} -})(function(CodeMirror) { - "use strict"; - - var defaultTags = { - 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 maybeBackup(stream, pat, style) { - var cur = stream.current(), close = cur.search(pat); - if (close > -1) { - stream.backUp(cur.length - close); - } else if (cur.match(/<\/?$/)) { - stream.backUp(cur.length); - if (!stream.match(pat, false)) stream.match(cur); - } - return style; - } - - var attrRegexpCache = {}; - function getAttrRegexp(attr) { - var regexp = attrRegexpCache[attr]; - if (regexp) return regexp; - return attrRegexpCache[attr] = new RegExp("\\s+" + attr + "\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"); - } - - function getAttrValue(text, attr) { - var match = text.match(getAttrRegexp(attr)) - return match ? /^\s*(.*?)\s*$/.exec(match[2])[1] : "" - } - - function getTagRegexp(tagName, anchored) { - return new RegExp((anchored ? "^" : "") + "<\/\\s*" + tagName + "\\s*>", "i"); - } - - function addTags(from, to) { - for (var tag in from) { - var dest = to[tag] || (to[tag] = []); - var source = from[tag]; - for (var i = source.length - 1; i >= 0; i--) - dest.unshift(source[i]) - } - } - - function findMatchingMode(tagInfo, tagText) { - for (var i = 0; i < tagInfo.length; i++) { - var spec = tagInfo[i]; - if (!spec[0] || spec[1].test(getAttrValue(tagText, spec[0]))) return spec[2]; - } - } - - CodeMirror.defineMode("htmlmixed", function (config, parserConfig) { - var htmlMode = CodeMirror.getMode(config, { - name: "xml", - htmlMode: true, - multilineTagIndentFactor: parserConfig.multilineTagIndentFactor, - multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag, - allowMissingTagName: parserConfig.allowMissingTagName, - }); - - var tags = {}; - var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes; - addTags(defaultTags, tags); - if (configTags) addTags(configTags, tags); - if (configScript) for (var i = configScript.length - 1; i >= 0; i--) - tags.script.unshift(["type", configScript[i].matches, configScript[i].mode]) - - function html(stream, state) { - var style = htmlMode.token(stream, state.htmlState), tag = /\btag\b/.test(style), tagName - if (tag && !/[<>\s\/]/.test(stream.current()) && - (tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase()) && - tags.hasOwnProperty(tagName)) { - state.inTag = tagName + " " - } else if (state.inTag && tag && />$/.test(stream.current())) { - var inTag = /^([\S]+) (.*)/.exec(state.inTag) - state.inTag = null - var modeSpec = stream.current() == ">" && findMatchingMode(tags[inTag[1]], inTag[2]) - var mode = CodeMirror.getMode(config, modeSpec) - var endTagA = getTagRegexp(inTag[1], true), endTag = getTagRegexp(inTag[1], false); - state.token = function (stream, state) { - if (stream.match(endTagA, false)) { - state.token = html; - state.localState = state.localMode = null; - return null; - } - return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState)); - }; - state.localMode = mode; - state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, "", "")); - } else if (state.inTag) { - state.inTag += stream.current() - if (stream.eol()) state.inTag += " " - } - return style; - }; - - return { - startState: function () { - var state = CodeMirror.startState(htmlMode); - return {token: html, inTag: null, localMode: null, localState: null, htmlState: state}; - }, - - copyState: function (state) { - var local; - if (state.localState) { - local = CodeMirror.copyState(state.localMode, state.localState); - } - return {token: state.token, inTag: state.inTag, - localMode: state.localMode, localState: local, - htmlState: CodeMirror.copyState(htmlMode, state.htmlState)}; - }, - - token: function (stream, state) { - return state.token(stream, state); - }, - - indent: function (state, textAfter, line) { - if (!state.localMode || /^\s*<\//.test(textAfter)) - return htmlMode.indent(state.htmlState, textAfter, line); - else if (state.localMode.indent) - return state.localMode.indent(state.localState, textAfter, line); - else - return CodeMirror.Pass; - }, - - innerMode: function (state) { - return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode}; - } - }; - }, "xml", "javascript", "css"); - - CodeMirror.defineMIME("text/html", "htmlmixed"); -}); - - -/***/ }), - -/***/ 876: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: https://codemirror.net/5/LICENSE - -(function(mod) { - if (true) // CommonJS - mod(__webpack_require__(631)); - else {} -})(function(CodeMirror) { -"use strict"; - -CodeMirror.defineMode("javascript", function(config, parserConfig) { - var indentUnit = config.indentUnit; - var statementIndent = parserConfig.statementIndent; - var jsonldMode = parserConfig.jsonld; - var jsonMode = parserConfig.json || jsonldMode; - var trackScope = parserConfig.trackScope !== false - var isTS = parserConfig.typescript; - var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/; - - // Tokenizer - - var keywords = function(){ - function kw(type) {return {type: type, style: "keyword"};} - var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d"); - var operator = kw("operator"), atom = {type: "atom", style: "atom"}; - - return { - "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, - "return": D, "break": D, "continue": D, "new": kw("new"), "delete": C, "void": C, "throw": C, - "debugger": kw("debugger"), "var": kw("var"), "const": kw("var"), "let": kw("var"), - "function": kw("function"), "catch": kw("catch"), - "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), - "in": operator, "typeof": operator, "instanceof": operator, - "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, - "this": kw("this"), "class": kw("class"), "super": kw("atom"), - "yield": C, "export": kw("export"), "import": kw("import"), "extends": C, - "await": C - }; - }(); - - var isOperatorChar = /[+\-*&%=<>!?|~^@]/; - var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; - - function readRegexp(stream) { - var escaped = false, next, inSet = false; - while ((next = stream.next()) != null) { - if (!escaped) { - if (next == "/" && !inSet) return; - if (next == "[") inSet = true; - else if (inSet && next == "]") inSet = false; - } - escaped = !escaped && next == "\\"; - } - } - - // Used as scratch variables to communicate multiple values without - // consing up tons of objects. - var type, content; - function ret(tp, style, cont) { - type = tp; content = cont; - return style; - } - function tokenBase(stream, state) { - var ch = stream.next(); - if (ch == '"' || ch == "'") { - state.tokenize = tokenString(ch); - return state.tokenize(stream, state); - } else if (ch == "." && stream.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) { - return ret("number", "number"); - } else if (ch == "." && stream.match("..")) { - return ret("spread", "meta"); - } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { - return ret(ch); - } else if (ch == "=" && stream.eat(">")) { - return ret("=>", "operator"); - } else if (ch == "0" && stream.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) { - return ret("number", "number"); - } else if (/\d/.test(ch)) { - stream.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/); - return ret("number", "number"); - } else if (ch == "/") { - if (stream.eat("*")) { - state.tokenize = tokenComment; - return tokenComment(stream, state); - } else if (stream.eat("/")) { - stream.skipToEnd(); - return ret("comment", "comment"); - } else if (expressionAllowed(stream, state, 1)) { - readRegexp(stream); - stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/); - return ret("regexp", "string-2"); - } else { - stream.eat("="); - return ret("operator", "operator", stream.current()); - } - } else if (ch == "`") { - state.tokenize = tokenQuasi; - return tokenQuasi(stream, state); - } else if (ch == "#" && stream.peek() == "!") { - stream.skipToEnd(); - return ret("meta", "meta"); - } else if (ch == "#" && stream.eatWhile(wordRE)) { - return ret("variable", "property") - } else if (ch == "<" && stream.match("!--") || - (ch == "-" && stream.match("->") && !/\S/.test(stream.string.slice(0, stream.start)))) { - stream.skipToEnd() - return ret("comment", "comment") - } else if (isOperatorChar.test(ch)) { - if (ch != ">" || !state.lexical || state.lexical.type != ">") { - if (stream.eat("=")) { - if (ch == "!" || ch == "=") stream.eat("=") - } else if (/[<>*+\-|&?]/.test(ch)) { - stream.eat(ch) - if (ch == ">") stream.eat(ch) - } - } - if (ch == "?" && stream.eat(".")) return ret(".") - return ret("operator", "operator", stream.current()); - } else if (wordRE.test(ch)) { - stream.eatWhile(wordRE); - var word = stream.current() - if (state.lastType != ".") { - if (keywords.propertyIsEnumerable(word)) { - var kw = keywords[word] - return ret(kw.type, kw.style, word) - } - if (word == "async" && stream.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/, false)) - return ret("async", "keyword", word) - } - return ret("variable", "variable", word) - } - } - - function tokenString(quote) { - return function(stream, state) { - var escaped = false, next; - if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){ - state.tokenize = tokenBase; - return ret("jsonld-keyword", "meta"); - } - while ((next = stream.next()) != null) { - if (next == quote && !escaped) break; - escaped = !escaped && next == "\\"; - } - if (!escaped) state.tokenize = tokenBase; - return ret("string", "string"); - }; - } - - function tokenComment(stream, state) { - var maybeEnd = false, ch; - while (ch = stream.next()) { - if (ch == "/" && maybeEnd) { - state.tokenize = tokenBase; - break; - } - maybeEnd = (ch == "*"); - } - return ret("comment", "comment"); - } - - function tokenQuasi(stream, state) { - var escaped = false, next; - while ((next = stream.next()) != null) { - if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) { - state.tokenize = tokenBase; - break; - } - escaped = !escaped && next == "\\"; - } - return ret("quasi", "string-2", stream.current()); - } - - var brackets = "([{}])"; - // This is a crude lookahead trick to try and notice that we're - // parsing the argument patterns for a fat-arrow function before we - // actually hit the arrow token. It only works if the arrow is on - // the same line as the arguments and there's no strange noise - // (comments) in between. Fallback is to only notice when we hit the - // arrow, and not declare the arguments as locals for the arrow - // body. - function findFatArrow(stream, state) { - if (state.fatArrowAt) state.fatArrowAt = null; - var arrow = stream.string.indexOf("=>", stream.start); - if (arrow < 0) return; - - if (isTS) { // Try to skip TypeScript return type declarations after the arguments - var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow)) - if (m) arrow = m.index - } - - var depth = 0, sawSomething = false; - for (var pos = arrow - 1; pos >= 0; --pos) { - var ch = stream.string.charAt(pos); - var bracket = brackets.indexOf(ch); - if (bracket >= 0 && bracket < 3) { - if (!depth) { ++pos; break; } - if (--depth == 0) { if (ch == "(") sawSomething = true; break; } - } else if (bracket >= 3 && bracket < 6) { - ++depth; - } else if (wordRE.test(ch)) { - sawSomething = true; - } else if (/["'\/`]/.test(ch)) { - for (;; --pos) { - if (pos == 0) return - var next = stream.string.charAt(pos - 1) - if (next == ch && stream.string.charAt(pos - 2) != "\\") { pos--; break } - } - } else if (sawSomething && !depth) { - ++pos; - break; - } - } - if (sawSomething && !depth) state.fatArrowAt = pos; - } - - // Parser - - var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, - "regexp": true, "this": true, "import": true, "jsonld-keyword": true}; - - function JSLexical(indented, column, type, align, prev, info) { - this.indented = indented; - this.column = column; - this.type = type; - this.prev = prev; - this.info = info; - if (align != null) this.align = align; - } - - function inScope(state, varname) { - if (!trackScope) return false - for (var v = state.localVars; v; v = v.next) - if (v.name == varname) return true; - for (var cx = state.context; cx; cx = cx.prev) { - for (var v = cx.vars; v; v = v.next) - if (v.name == varname) return true; - } - } - - function parseJS(state, style, type, content, stream) { - var cc = state.cc; - // Communicate our context to the combinators. - // (Less wasteful than consing up a hundred closures on every call.) - cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style; - - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = true; - - while(true) { - var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; - if (combinator(type, content)) { - while(cc.length && cc[cc.length - 1].lex) - cc.pop()(); - if (cx.marked) return cx.marked; - if (type == "variable" && inScope(state, content)) return "variable-2"; - return style; - } - } - } - - // Combinator utils - - var cx = {state: null, column: null, marked: null, cc: null}; - function pass() { - for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); - } - function cont() { - pass.apply(null, arguments); - return true; - } - function inList(name, list) { - for (var v = list; v; v = v.next) if (v.name == name) return true - return false; - } - function register(varname) { - var state = cx.state; - cx.marked = "def"; - if (!trackScope) return - if (state.context) { - if (state.lexical.info == "var" && state.context && state.context.block) { - // FIXME function decls are also not block scoped - var newContext = registerVarScoped(varname, state.context) - if (newContext != null) { - state.context = newContext - return - } - } else if (!inList(varname, state.localVars)) { - state.localVars = new Var(varname, state.localVars) - return - } - } - // Fall through means this is global - if (parserConfig.globalVars && !inList(varname, state.globalVars)) - state.globalVars = new Var(varname, state.globalVars) - } - function registerVarScoped(varname, context) { - if (!context) { - return null - } else if (context.block) { - var inner = registerVarScoped(varname, context.prev) - if (!inner) return null - if (inner == context.prev) return context - return new Context(inner, context.vars, true) - } else if (inList(varname, context.vars)) { - return context - } else { - return new Context(context.prev, new Var(varname, context.vars), false) - } - } - - function isModifier(name) { - return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly" - } - - // Combinators - - function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block } - function Var(name, next) { this.name = name; this.next = next } - - var defaultVars = new Var("this", new Var("arguments", null)) - function pushcontext() { - cx.state.context = new Context(cx.state.context, cx.state.localVars, false) - cx.state.localVars = defaultVars - } - function pushblockcontext() { - cx.state.context = new Context(cx.state.context, cx.state.localVars, true) - cx.state.localVars = null - } - pushcontext.lex = pushblockcontext.lex = true - function popcontext() { - cx.state.localVars = cx.state.context.vars - cx.state.context = cx.state.context.prev - } - popcontext.lex = true - function pushlex(type, info) { - var result = function() { - var state = cx.state, indent = state.indented; - if (state.lexical.type == "stat") indent = state.lexical.indented; - else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev) - indent = outer.indented; - state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info); - }; - result.lex = true; - return result; - } - function poplex() { - var state = cx.state; - if (state.lexical.prev) { - if (state.lexical.type == ")") - state.indented = state.lexical.indented; - state.lexical = state.lexical.prev; - } - } - poplex.lex = true; - - function expect(wanted) { - function exp(type) { - if (type == wanted) return cont(); - else if (wanted == ";" || type == "}" || type == ")" || type == "]") return pass(); - else return cont(exp); - }; - return exp; - } - - function statement(type, value) { - if (type == "var") return cont(pushlex("vardef", value), vardef, expect(";"), poplex); - if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex); - if (type == "keyword b") return cont(pushlex("form"), statement, poplex); - if (type == "keyword d") return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex); - if (type == "debugger") return cont(expect(";")); - if (type == "{") return cont(pushlex("}"), pushblockcontext, block, poplex, popcontext); - if (type == ";") return cont(); - if (type == "if") { - if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) - cx.state.cc.pop()(); - return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse); - } - if (type == "function") return cont(functiondef); - if (type == "for") return cont(pushlex("form"), pushblockcontext, forspec, statement, popcontext, poplex); - if (type == "class" || (isTS && value == "interface")) { - cx.marked = "keyword" - return cont(pushlex("form", type == "class" ? type : value), className, poplex) - } - if (type == "variable") { - if (isTS && value == "declare") { - cx.marked = "keyword" - return cont(statement) - } else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) { - cx.marked = "keyword" - if (value == "enum") return cont(enumdef); - else if (value == "type") return cont(typename, expect("operator"), typeexpr, expect(";")); - else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex) - } else if (isTS && value == "namespace") { - cx.marked = "keyword" - return cont(pushlex("form"), expression, statement, poplex) - } else if (isTS && value == "abstract") { - cx.marked = "keyword" - return cont(statement) - } else { - return cont(pushlex("stat"), maybelabel); - } - } - if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"), pushblockcontext, - block, poplex, poplex, popcontext); - if (type == "case") return cont(expression, expect(":")); - if (type == "default") return cont(expect(":")); - if (type == "catch") return cont(pushlex("form"), pushcontext, maybeCatchBinding, statement, poplex, popcontext); - if (type == "export") return cont(pushlex("stat"), afterExport, poplex); - if (type == "import") return cont(pushlex("stat"), afterImport, poplex); - if (type == "async") return cont(statement) - if (value == "@") return cont(expression, statement) - return pass(pushlex("stat"), expression, expect(";"), poplex); - } - function maybeCatchBinding(type) { - if (type == "(") return cont(funarg, expect(")")) - } - function expression(type, value) { - return expressionInner(type, value, false); - } - function expressionNoComma(type, value) { - return expressionInner(type, value, true); - } - function parenExpr(type) { - if (type != "(") return pass() - return cont(pushlex(")"), maybeexpression, expect(")"), poplex) - } - function expressionInner(type, value, noComma) { - if (cx.state.fatArrowAt == cx.stream.start) { - var body = noComma ? arrowBodyNoComma : arrowBody; - if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext); - else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); - } - - var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; - if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); - if (type == "function") return cont(functiondef, maybeop); - if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), classExpression, poplex); } - if (type == "keyword c" || type == "async") return cont(noComma ? expressionNoComma : expression); - if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop); - if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); - if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); - if (type == "{") return contCommasep(objprop, "}", null, maybeop); - if (type == "quasi") return pass(quasi, maybeop); - if (type == "new") return cont(maybeTarget(noComma)); - return cont(); - } - function maybeexpression(type) { - if (type.match(/[;\}\)\],]/)) return pass(); - return pass(expression); - } - - function maybeoperatorComma(type, value) { - if (type == ",") return cont(maybeexpression); - return maybeoperatorNoComma(type, value, false); - } - function maybeoperatorNoComma(type, value, noComma) { - var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma; - var expr = noComma == false ? expression : expressionNoComma; - if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); - if (type == "operator") { - if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me); - if (isTS && value == "<" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/, false)) - return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me); - if (value == "?") return cont(expression, expect(":"), expr); - return cont(expr); - } - if (type == "quasi") { return pass(quasi, me); } - if (type == ";") return; - if (type == "(") return contCommasep(expressionNoComma, ")", "call", me); - if (type == ".") return cont(property, me); - if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); - if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) } - if (type == "regexp") { - cx.state.lastType = cx.marked = "operator" - cx.stream.backUp(cx.stream.pos - cx.stream.start - 1) - return cont(expr) - } - } - function quasi(type, value) { - if (type != "quasi") return pass(); - if (value.slice(value.length - 2) != "${") return cont(quasi); - return cont(maybeexpression, continueQuasi); - } - function continueQuasi(type) { - if (type == "}") { - cx.marked = "string-2"; - cx.state.tokenize = tokenQuasi; - return cont(quasi); - } - } - function arrowBody(type) { - findFatArrow(cx.stream, cx.state); - return pass(type == "{" ? statement : expression); - } - function arrowBodyNoComma(type) { - findFatArrow(cx.stream, cx.state); - return pass(type == "{" ? statement : expressionNoComma); - } - function maybeTarget(noComma) { - return function(type) { - if (type == ".") return cont(noComma ? targetNoComma : target); - else if (type == "variable" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma) - else return pass(noComma ? expressionNoComma : expression); - }; - } - function target(_, value) { - if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); } - } - function targetNoComma(_, value) { - if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); } - } - function maybelabel(type) { - if (type == ":") return cont(poplex, statement); - return pass(maybeoperatorComma, expect(";"), poplex); - } - function property(type) { - if (type == "variable") {cx.marked = "property"; return cont();} - } - function objprop(type, value) { - if (type == "async") { - cx.marked = "property"; - return cont(objprop); - } else if (type == "variable" || cx.style == "keyword") { - cx.marked = "property"; - if (value == "get" || value == "set") return cont(getterSetter); - var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params - if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false))) - cx.state.fatArrowAt = cx.stream.pos + m[0].length - return cont(afterprop); - } else if (type == "number" || type == "string") { - cx.marked = jsonldMode ? "property" : (cx.style + " property"); - return cont(afterprop); - } else if (type == "jsonld-keyword") { - return cont(afterprop); - } else if (isTS && isModifier(value)) { - cx.marked = "keyword" - return cont(objprop) - } else if (type == "[") { - return cont(expression, maybetype, expect("]"), afterprop); - } else if (type == "spread") { - return cont(expressionNoComma, afterprop); - } else if (value == "*") { - cx.marked = "keyword"; - return cont(objprop); - } else if (type == ":") { - return pass(afterprop) - } - } - function getterSetter(type) { - if (type != "variable") return pass(afterprop); - cx.marked = "property"; - return cont(functiondef); - } - function afterprop(type) { - if (type == ":") return cont(expressionNoComma); - if (type == "(") return pass(functiondef); - } - function commasep(what, end, sep) { - function proceed(type, value) { - if (sep ? sep.indexOf(type) > -1 : type == ",") { - var lex = cx.state.lexical; - if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; - return cont(function(type, value) { - if (type == end || value == end) return pass() - return pass(what) - }, proceed); - } - if (type == end || value == end) return cont(); - if (sep && sep.indexOf(";") > -1) return pass(what) - return cont(expect(end)); - } - return function(type, value) { - if (type == end || value == end) return cont(); - return pass(what, proceed); - }; - } - function contCommasep(what, end, info) { - for (var i = 3; i < arguments.length; i++) - cx.cc.push(arguments[i]); - return cont(pushlex(end, info), commasep(what, end), poplex); - } - function block(type) { - if (type == "}") return cont(); - return pass(statement, block); - } - function maybetype(type, value) { - if (isTS) { - if (type == ":") return cont(typeexpr); - if (value == "?") return cont(maybetype); - } - } - function maybetypeOrIn(type, value) { - if (isTS && (type == ":" || value == "in")) return cont(typeexpr) - } - function mayberettype(type) { - if (isTS && type == ":") { - if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr) - else return cont(typeexpr) - } - } - function isKW(_, value) { - if (value == "is") { - cx.marked = "keyword" - return cont() - } - } - function typeexpr(type, value) { - if (value == "keyof" || value == "typeof" || value == "infer" || value == "readonly") { - cx.marked = "keyword" - return cont(value == "typeof" ? expressionNoComma : typeexpr) - } - if (type == "variable" || value == "void") { - cx.marked = "type" - return cont(afterType) - } - if (value == "|" || value == "&") return cont(typeexpr) - if (type == "string" || type == "number" || type == "atom") return cont(afterType); - if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType) - if (type == "{") return cont(pushlex("}"), typeprops, poplex, afterType) - if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType) - if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr) - if (type == "quasi") { return pass(quasiType, afterType); } - } - function maybeReturnType(type) { - if (type == "=>") return cont(typeexpr) - } - function typeprops(type) { - if (type.match(/[\}\)\]]/)) return cont() - if (type == "," || type == ";") return cont(typeprops) - return pass(typeprop, typeprops) - } - function typeprop(type, value) { - if (type == "variable" || cx.style == "keyword") { - cx.marked = "property" - return cont(typeprop) - } else if (value == "?" || type == "number" || type == "string") { - return cont(typeprop) - } else if (type == ":") { - return cont(typeexpr) - } else if (type == "[") { - return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop) - } else if (type == "(") { - return pass(functiondecl, typeprop) - } else if (!type.match(/[;\}\)\],]/)) { - return cont() - } - } - function quasiType(type, value) { - if (type != "quasi") return pass(); - if (value.slice(value.length - 2) != "${") return cont(quasiType); - return cont(typeexpr, continueQuasiType); - } - function continueQuasiType(type) { - if (type == "}") { - cx.marked = "string-2"; - cx.state.tokenize = tokenQuasi; - return cont(quasiType); - } - } - function typearg(type, value) { - if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg) - if (type == ":") return cont(typeexpr) - if (type == "spread") return cont(typearg) - return pass(typeexpr) - } - function afterType(type, value) { - if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) - if (value == "|" || type == "." || value == "&") return cont(typeexpr) - if (type == "[") return cont(typeexpr, expect("]"), afterType) - if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) } - if (value == "?") return cont(typeexpr, expect(":"), typeexpr) - } - function maybeTypeArgs(_, value) { - if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) - } - function typeparam() { - return pass(typeexpr, maybeTypeDefault) - } - function maybeTypeDefault(_, value) { - if (value == "=") return cont(typeexpr) - } - function vardef(_, value) { - if (value == "enum") {cx.marked = "keyword"; return cont(enumdef)} - return pass(pattern, maybetype, maybeAssign, vardefCont); - } - function pattern(type, value) { - if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(pattern) } - if (type == "variable") { register(value); return cont(); } - if (type == "spread") return cont(pattern); - if (type == "[") return contCommasep(eltpattern, "]"); - if (type == "{") return contCommasep(proppattern, "}"); - } - function proppattern(type, value) { - if (type == "variable" && !cx.stream.match(/^\s*:/, false)) { - register(value); - return cont(maybeAssign); - } - if (type == "variable") cx.marked = "property"; - if (type == "spread") return cont(pattern); - if (type == "}") return pass(); - if (type == "[") return cont(expression, expect(']'), expect(':'), proppattern); - return cont(expect(":"), pattern, maybeAssign); - } - function eltpattern() { - return pass(pattern, maybeAssign) - } - function maybeAssign(_type, value) { - if (value == "=") return cont(expressionNoComma); - } - function vardefCont(type) { - if (type == ",") return cont(vardef); - } - function maybeelse(type, value) { - if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex); - } - function forspec(type, value) { - if (value == "await") return cont(forspec); - if (type == "(") return cont(pushlex(")"), forspec1, poplex); - } - function forspec1(type) { - if (type == "var") return cont(vardef, forspec2); - if (type == "variable") return cont(forspec2); - return pass(forspec2) - } - function forspec2(type, value) { - if (type == ")") return cont() - if (type == ";") return cont(forspec2) - if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression, forspec2) } - return pass(expression, forspec2) - } - function functiondef(type, value) { - if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} - if (type == "variable") {register(value); return cont(functiondef);} - if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext); - if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef) - } - function functiondecl(type, value) { - if (value == "*") {cx.marked = "keyword"; return cont(functiondecl);} - if (type == "variable") {register(value); return cont(functiondecl);} - if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, popcontext); - if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondecl) - } - function typename(type, value) { - if (type == "keyword" || type == "variable") { - cx.marked = "type" - return cont(typename) - } else if (value == "<") { - return cont(pushlex(">"), commasep(typeparam, ">"), poplex) - } - } - function funarg(type, value) { - if (value == "@") cont(expression, funarg) - if (type == "spread") return cont(funarg); - if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); } - if (isTS && type == "this") return cont(maybetype, maybeAssign) - return pass(pattern, maybetype, maybeAssign); - } - function classExpression(type, value) { - // Class expressions may have an optional name. - if (type == "variable") return className(type, value); - return classNameAfter(type, value); - } - function className(type, value) { - if (type == "variable") {register(value); return cont(classNameAfter);} - } - function classNameAfter(type, value) { - if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter) - if (value == "extends" || value == "implements" || (isTS && type == ",")) { - if (value == "implements") cx.marked = "keyword"; - return cont(isTS ? typeexpr : expression, classNameAfter); - } - if (type == "{") return cont(pushlex("}"), classBody, poplex); - } - function classBody(type, value) { - if (type == "async" || - (type == "variable" && - (value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) && - cx.stream.match(/^\s+#?[\w$\xa1-\uffff]/, false))) { - cx.marked = "keyword"; - return cont(classBody); - } - if (type == "variable" || cx.style == "keyword") { - cx.marked = "property"; - return cont(classfield, classBody); - } - if (type == "number" || type == "string") return cont(classfield, classBody); - if (type == "[") - return cont(expression, maybetype, expect("]"), classfield, classBody) - if (value == "*") { - cx.marked = "keyword"; - return cont(classBody); - } - if (isTS && type == "(") return pass(functiondecl, classBody) - if (type == ";" || type == ",") return cont(classBody); - if (type == "}") return cont(); - if (value == "@") return cont(expression, classBody) - } - function classfield(type, value) { - if (value == "!") return cont(classfield) - if (value == "?") return cont(classfield) - if (type == ":") return cont(typeexpr, maybeAssign) - if (value == "=") return cont(expressionNoComma) - var context = cx.state.lexical.prev, isInterface = context && context.info == "interface" - return pass(isInterface ? functiondecl : functiondef) - } - function afterExport(type, value) { - if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } - if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); } - if (type == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";")); - return pass(statement); - } - function exportField(type, value) { - if (value == "as") { cx.marked = "keyword"; return cont(expect("variable")); } - if (type == "variable") return pass(expressionNoComma, exportField); - } - function afterImport(type) { - if (type == "string") return cont(); - if (type == "(") return pass(expression); - if (type == ".") return pass(maybeoperatorComma); - return pass(importSpec, maybeMoreImports, maybeFrom); - } - function importSpec(type, value) { - if (type == "{") return contCommasep(importSpec, "}"); - if (type == "variable") register(value); - if (value == "*") cx.marked = "keyword"; - return cont(maybeAs); - } - function maybeMoreImports(type) { - if (type == ",") return cont(importSpec, maybeMoreImports) - } - function maybeAs(_type, value) { - if (value == "as") { cx.marked = "keyword"; return cont(importSpec); } - } - function maybeFrom(_type, value) { - if (value == "from") { cx.marked = "keyword"; return cont(expression); } - } - function arrayLiteral(type) { - if (type == "]") return cont(); - return pass(commasep(expressionNoComma, "]")); - } - function enumdef() { - return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex) - } - function enummember() { - return pass(pattern, maybeAssign); - } - - function isContinuedStatement(state, textAfter) { - return state.lastType == "operator" || state.lastType == "," || - isOperatorChar.test(textAfter.charAt(0)) || - /[,.]/.test(textAfter.charAt(0)); - } - - function expressionAllowed(stream, state, backUp) { - return state.tokenize == tokenBase && - /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) || - (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0)))) - } - - // Interface - - return { - startState: function(basecolumn) { - var state = { - tokenize: tokenBase, - lastType: "sof", - cc: [], - lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), - localVars: parserConfig.localVars, - context: parserConfig.localVars && new Context(null, null, false), - indented: basecolumn || 0 - }; - if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") - state.globalVars = parserConfig.globalVars; - return state; - }, - - token: function(stream, state) { - if (stream.sol()) { - if (!state.lexical.hasOwnProperty("align")) - state.lexical.align = false; - state.indented = stream.indentation(); - findFatArrow(stream, state); - } - if (state.tokenize != tokenComment && stream.eatSpace()) return null; - var style = state.tokenize(stream, state); - if (type == "comment") return style; - state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; - return parseJS(state, style, type, content, stream); - }, - - indent: function(state, textAfter) { - if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass; - if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top - // Kludge to prevent 'maybelse' from blocking lexical scope pops - if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) { - var c = state.cc[i]; - if (c == poplex) lexical = lexical.prev; - else if (c != maybeelse && c != popcontext) break; - } - while ((lexical.type == "stat" || lexical.type == "form") && - (firstChar == "}" || ((top = state.cc[state.cc.length - 1]) && - (top == maybeoperatorComma || top == maybeoperatorNoComma) && - !/^[,\.=+\-*:?[\(]/.test(textAfter)))) - lexical = lexical.prev; - if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") - lexical = lexical.prev; - var type = lexical.type, closing = firstChar == type; - - if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info.length + 1 : 0); - else if (type == "form" && firstChar == "{") return lexical.indented; - else if (type == "form") return lexical.indented + indentUnit; - else if (type == "stat") - return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0); - else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) - return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); - else if (lexical.align) return lexical.column + (closing ? 0 : 1); - else return lexical.indented + (closing ? 0 : indentUnit); - }, - - electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, - blockCommentStart: jsonMode ? null : "/*", - blockCommentEnd: jsonMode ? null : "*/", - blockCommentContinue: jsonMode ? null : " * ", - lineComment: jsonMode ? null : "//", - fold: "brace", - closeBrackets: "()[]{}''\"\"``", - - helperType: jsonMode ? "json" : "javascript", - jsonldMode: jsonldMode, - jsonMode: jsonMode, - - expressionAllowed: expressionAllowed, - - skipExpression: function(state) { - parseJS(state, "atom", "atom", "true", new CodeMirror.StringStream("", 2, null)) - } - }; -}); - -CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/); - -CodeMirror.defineMIME("text/javascript", "javascript"); -CodeMirror.defineMIME("text/ecmascript", "javascript"); -CodeMirror.defineMIME("application/javascript", "javascript"); -CodeMirror.defineMIME("application/x-javascript", "javascript"); -CodeMirror.defineMIME("application/ecmascript", "javascript"); -CodeMirror.defineMIME("application/json", { name: "javascript", json: true }); -CodeMirror.defineMIME("application/x-json", { name: "javascript", json: true }); -CodeMirror.defineMIME("application/manifest+json", { name: "javascript", json: true }) -CodeMirror.defineMIME("application/ld+json", { name: "javascript", jsonld: true }); -CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); -CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); - -}); - - -/***/ }), - -/***/ 589: -/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { - -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: https://codemirror.net/5/LICENSE - -(function(mod) { - if (true) // CommonJS - mod(__webpack_require__(631)); - else {} -})(function(CodeMirror) { -"use strict"; - -var htmlConfig = { - autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, - 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, - 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, - 'track': true, 'wbr': true, 'menuitem': true}, - implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, - 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, - 'th': true, 'tr': true}, - contextGrabbers: { - 'dd': {'dd': true, 'dt': true}, - 'dt': {'dd': true, 'dt': true}, - 'li': {'li': true}, - 'option': {'option': true, 'optgroup': true}, - 'optgroup': {'optgroup': true}, - 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, - 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, - 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, - 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, - 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, - 'rp': {'rp': true, 'rt': true}, - 'rt': {'rp': true, 'rt': true}, - 'tbody': {'tbody': true, 'tfoot': true}, - 'td': {'td': true, 'th': true}, - 'tfoot': {'tbody': true}, - 'th': {'td': true, 'th': true}, - 'thead': {'tbody': true, 'tfoot': true}, - 'tr': {'tr': true} - }, - doNotIndent: {"pre": true}, - allowUnquoted: true, - allowMissing: true, - caseFold: true -} - -var xmlConfig = { - autoSelfClosers: {}, - implicitlyClosed: {}, - contextGrabbers: {}, - doNotIndent: {}, - allowUnquoted: false, - allowMissing: false, - allowMissingTagName: false, - caseFold: false -} - -CodeMirror.defineMode("xml", function(editorConf, config_) { - var indentUnit = editorConf.indentUnit - var config = {} - var defaults = config_.htmlMode ? htmlConfig : xmlConfig - for (var prop in defaults) config[prop] = defaults[prop] - for (var prop in config_) config[prop] = config_[prop] - - // Return variables for tokenizers - var type, setStyle; - - function inText(stream, state) { - function chain(parser) { - state.tokenize = parser; - return parser(stream, state); - } - - var ch = stream.next(); - if (ch == "<") { - if (stream.eat("!")) { - if (stream.eat("[")) { - if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>")); - else return null; - } else if (stream.match("--")) { - return chain(inBlock("comment", "-->")); - } else if (stream.match("DOCTYPE", true, true)) { - stream.eatWhile(/[\w\._\-]/); - return chain(doctype(1)); - } else { - return null; - } - } else if (stream.eat("?")) { - stream.eatWhile(/[\w\._\-]/); - state.tokenize = inBlock("meta", "?>"); - return "meta"; - } else { - type = stream.eat("/") ? "closeTag" : "openTag"; - state.tokenize = inTag; - return "tag bracket"; - } - } else if (ch == "&") { - var ok; - if (stream.eat("#")) { - if (stream.eat("x")) { - ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";"); - } else { - ok = stream.eatWhile(/[\d]/) && stream.eat(";"); - } - } else { - ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";"); - } - return ok ? "atom" : "error"; - } else { - stream.eatWhile(/[^&<]/); - return null; - } - } - inText.isInText = true; - - function inTag(stream, state) { - var ch = stream.next(); - if (ch == ">" || (ch == "/" && stream.eat(">"))) { - state.tokenize = inText; - type = ch == ">" ? "endTag" : "selfcloseTag"; - return "tag bracket"; - } else if (ch == "=") { - type = "equals"; - return null; - } else if (ch == "<") { - state.tokenize = inText; - state.state = baseState; - state.tagName = state.tagStart = null; - var next = state.tokenize(stream, state); - return next ? next + " tag error" : "tag error"; - } else if (/[\'\"]/.test(ch)) { - state.tokenize = inAttribute(ch); - state.stringStartCol = stream.column(); - return state.tokenize(stream, state); - } else { - stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/); - return "word"; - } - } - - function inAttribute(quote) { - var closure = function(stream, state) { - while (!stream.eol()) { - if (stream.next() == quote) { - state.tokenize = inTag; - break; - } - } - return "string"; - }; - closure.isInAttribute = true; - return closure; - } - - function inBlock(style, terminator) { - return function(stream, state) { - while (!stream.eol()) { - if (stream.match(terminator)) { - state.tokenize = inText; - break; - } - stream.next(); - } - return style; - } - } - - function doctype(depth) { - return function(stream, state) { - var ch; - while ((ch = stream.next()) != null) { - if (ch == "<") { - state.tokenize = doctype(depth + 1); - return state.tokenize(stream, state); - } else if (ch == ">") { - if (depth == 1) { - state.tokenize = inText; - break; - } else { - state.tokenize = doctype(depth - 1); - return state.tokenize(stream, state); - } - } - } - return "meta"; - }; - } - - function lower(tagName) { - return tagName && tagName.toLowerCase(); - } - - function Context(state, tagName, startOfLine) { - this.prev = state.context; - this.tagName = tagName || ""; - this.indent = state.indented; - this.startOfLine = startOfLine; - if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) - this.noIndent = true; - } - function popContext(state) { - if (state.context) state.context = state.context.prev; - } - function maybePopContext(state, nextTagName) { - var parentTagName; - while (true) { - if (!state.context) { - return; - } - parentTagName = state.context.tagName; - if (!config.contextGrabbers.hasOwnProperty(lower(parentTagName)) || - !config.contextGrabbers[lower(parentTagName)].hasOwnProperty(lower(nextTagName))) { - return; - } - popContext(state); - } - } - - function baseState(type, stream, state) { - if (type == "openTag") { - state.tagStart = stream.column(); - return tagNameState; - } else if (type == "closeTag") { - return closeTagNameState; - } else { - return baseState; - } - } - function tagNameState(type, stream, state) { - if (type == "word") { - state.tagName = stream.current(); - setStyle = "tag"; - return attrState; - } else if (config.allowMissingTagName && type == "endTag") { - setStyle = "tag bracket"; - return attrState(type, stream, state); - } else { - setStyle = "error"; - return tagNameState; - } - } - function closeTagNameState(type, stream, state) { - if (type == "word") { - var tagName = stream.current(); - if (state.context && state.context.tagName != tagName && - config.implicitlyClosed.hasOwnProperty(lower(state.context.tagName))) - popContext(state); - if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) { - setStyle = "tag"; - return closeState; - } else { - setStyle = "tag error"; - return closeStateErr; - } - } else if (config.allowMissingTagName && type == "endTag") { - setStyle = "tag bracket"; - return closeState(type, stream, state); - } else { - setStyle = "error"; - return closeStateErr; - } - } - - function closeState(type, _stream, state) { - if (type != "endTag") { - setStyle = "error"; - return closeState; - } - popContext(state); - return baseState; - } - function closeStateErr(type, stream, state) { - setStyle = "error"; - return closeState(type, stream, state); - } - - function attrState(type, _stream, state) { - if (type == "word") { - setStyle = "attribute"; - return attrEqState; - } else if (type == "endTag" || type == "selfcloseTag") { - var tagName = state.tagName, tagStart = state.tagStart; - state.tagName = state.tagStart = null; - if (type == "selfcloseTag" || - config.autoSelfClosers.hasOwnProperty(lower(tagName))) { - maybePopContext(state, tagName); - } else { - maybePopContext(state, tagName); - state.context = new Context(state, tagName, tagStart == state.indented); - } - return baseState; - } - setStyle = "error"; - return attrState; - } - function attrEqState(type, stream, state) { - if (type == "equals") return attrValueState; - if (!config.allowMissing) setStyle = "error"; - return attrState(type, stream, state); - } - function attrValueState(type, stream, state) { - if (type == "string") return attrContinuedState; - if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;} - setStyle = "error"; - return attrState(type, stream, state); - } - function attrContinuedState(type, stream, state) { - if (type == "string") return attrContinuedState; - return attrState(type, stream, state); - } - - return { - startState: function(baseIndent) { - var state = {tokenize: inText, - state: baseState, - indented: baseIndent || 0, - tagName: null, tagStart: null, - context: null} - if (baseIndent != null) state.baseIndent = baseIndent - return state - }, - - token: function(stream, state) { - if (!state.tagName && stream.sol()) - state.indented = stream.indentation(); - - if (stream.eatSpace()) return null; - type = null; - var style = state.tokenize(stream, state); - if ((style || type) && style != "comment") { - setStyle = null; - state.state = state.state(type || style, stream, state); - if (setStyle) - style = setStyle == "error" ? style + " error" : setStyle; - } - return style; - }, - - indent: function(state, textAfter, fullLine) { - var context = state.context; - // Indent multi-line strings (e.g. css). - if (state.tokenize.isInAttribute) { - if (state.tagStart == state.indented) - return state.stringStartCol + 1; - else - return state.indented + indentUnit; - } - if (context && context.noIndent) return CodeMirror.Pass; - if (state.tokenize != inTag && state.tokenize != inText) - return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; - // Indent the starts of attribute names. - if (state.tagName) { - if (config.multilineTagIndentPastTag !== false) - return state.tagStart + state.tagName.length + 2; - else - return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1); - } - if (config.alignCDATA && /$/, - blockCommentStart: "", - - configuration: config.htmlMode ? "html" : "xml", - helperType: config.htmlMode ? "html" : "xml", - - skipAttribute: function(state) { - if (state.state == attrValueState) - state.state = attrState - }, - - xmlCurrentTag: function(state) { - return state.tagName ? {name: state.tagName, close: state.type == "closeTag"} : null - }, - - xmlCurrentContext: function(state) { - var context = [] - for (var cx = state.context; cx; cx = cx.prev) - context.push(cx.tagName) - return context.reverse() - } - }; -}); - -CodeMirror.defineMIME("text/xml", "xml"); -CodeMirror.defineMIME("application/xml", "xml"); -if (!CodeMirror.mimeModes.hasOwnProperty("text/html")) - CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true}); - -}); - - -/***/ }), - -/***/ 642: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(346); -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ModuleModel = /** @class */ (function (_super) { - __extends(ModuleModel, _super); - function ModuleModel(module, attributes, options) { - var _this = _super.call(this, attributes, options) || this; - _this._module = module; - return _this; - } - Object.defineProperty(ModuleModel.prototype, "module", { - get: function () { - return this._module; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ModuleModel.prototype, "config", { - get: function () { - return this._module.config; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ModuleModel.prototype, "em", { - get: function () { - return this._module.em; - }, - enumerable: false, - configurable: true - }); - return ModuleModel; -}(_common__WEBPACK_IMPORTED_MODULE_0__/* .Model */ .Hn)); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ModuleModel); - - -/***/ }), - -/***/ 675: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__), -/* harmony export */ q: () => (/* binding */ CanvasSpotBuiltInTypes) -/* harmony export */ }); -/* harmony import */ var _abstract__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(642); -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var CanvasSpotBuiltInTypes; -(function (CanvasSpotBuiltInTypes) { - CanvasSpotBuiltInTypes["Select"] = "select"; - CanvasSpotBuiltInTypes["Hover"] = "hover"; - CanvasSpotBuiltInTypes["Spacing"] = "spacing"; - CanvasSpotBuiltInTypes["Target"] = "target"; - CanvasSpotBuiltInTypes["Resize"] = "resize"; -})(CanvasSpotBuiltInTypes || (CanvasSpotBuiltInTypes = {})); -/** - * Canvas spots are elements drawn on top of the canvas. They can be used to represent anything you - * might need but the most common use case of canvas spots is rendering information and managing - * components rendered in the canvas. - * Read here for more information about [Canvas Spots](https://grapesjs.com/docs/modules/Canvas.html#canvas-spots) - * - * [Component]: component.html - * - * @property {String} id Spot ID. - * @property {String} type Spot type. - * @property {[Component]} [component] Component to which the spot will be attached. - * @property {ComponentView} [componentView] ComponentView to which the spot will be attached. - * @property {Object} [boxRect] Fixed box rect of the spot, eg. `{ width: 100, height: 100, x: 0, y: 0 }`. - * - */ -var CanvasSpot = /** @class */ (function (_super) { - __extends(CanvasSpot, _super); - function CanvasSpot() { - return _super !== null && _super.apply(this, arguments) || this; - } - CanvasSpot.prototype.defaults = function () { - return { - id: '', - type: '', - }; - }; - Object.defineProperty(CanvasSpot.prototype, "type", { - get: function () { - return this.get('type') || ''; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CanvasSpot.prototype, "component", { - get: function () { - var _a; - var cmp = this.get('component'); - return cmp || ((_a = this.get('componentView')) === null || _a === void 0 ? void 0 : _a.model); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CanvasSpot.prototype, "componentView", { - get: function () { - var _a; - var cmpView = this.get('componentView'); - return cmpView || ((_a = this.get('component')) === null || _a === void 0 ? void 0 : _a.getView()); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CanvasSpot.prototype, "el", { - get: function () { - var _a; - return (_a = this.componentView) === null || _a === void 0 ? void 0 : _a.el; - }, - enumerable: false, - configurable: true - }); - /** - * Get the box rect of the spot. - * @param {Object} [opts={}] - * @returns {Object} The box rect object - * @example - * canvasSpot.getBoxRect(); - * // { width: 100, height: 50, x: 0, y: 0 } - */ - CanvasSpot.prototype.getBoxRect = function (opts) { - var _a = this, el = _a.el, em = _a.em; - var cvView = em.Canvas.getCanvasView(); - var boxRect = this.get('boxRect'); - if (boxRect) { - return boxRect; - } - else if (el && cvView) { - return cvView.getElBoxRect(el, opts); - } - return { - x: 0, - y: 0, - width: 0, - height: 0, - }; - }; - /** - * Get the style object of the spot. - * @param {Object} [opts={}] - * @returns {CSSStyleDeclaration} [opts] - * @example - * canvasSpot.getStyle(); - * // { width: '100px', height: '...', ... } - */ - CanvasSpot.prototype.getStyle = function (opts) { - if (opts === void 0) { opts = {}; } - var _a = opts.boxRect || this.getBoxRect(opts), width = _a.width, height = _a.height, x = _a.x, y = _a.y; - return { - width: "".concat(width, "px"), - height: "".concat(height, "px"), - top: '0', - left: '0', - position: 'absolute', - translate: "".concat(x, "px ").concat(y, "px"), - }; - }; - /** - * Check the spot type. - * @param {String} type - * @returns {Boolean} - * @example - * canvasSpot.isType('select'); - */ - CanvasSpot.prototype.isType = function (type) { - return this.type === type; - }; - return CanvasSpot; -}(_abstract__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z)); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CanvasSpot); - - -/***/ }), - -/***/ 713: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* unused harmony export CommandsEvents */ -/**{START_EVENTS}*/ -var CommandsEvents; -(function (CommandsEvents) { - /** - * @event `command:run` Triggered on run of any command. - * @example - * editor.on('command:run', ({ id, result, options }) => { - * console.log('Command id', id, 'command result', result); - * }); - */ - CommandsEvents["run"] = "command:run"; - CommandsEvents["_run"] = "run"; - /** - * @event `command:run:COMMAND_ID` Triggered on run of a specific command. - * @example - * editor.on('command:run:my-command', ({ result, options }) => { ... }); - */ - CommandsEvents["runCommand"] = "command:run:"; - CommandsEvents["_runCommand"] = "run:"; - /** - * @event `command:run:before:COMMAND_ID` Triggered before the command is called. - * @example - * editor.on('command:run:before:my-command', ({ options }) => { ... }); - */ - CommandsEvents["runBeforeCommand"] = "command:run:before:"; - /** - * @event `command:abort:COMMAND_ID` Triggered when the command execution is aborted. - * @example - * editor.on('command:abort:my-command', ({ options }) => { ... }); - * - * // The command could be aborted during the before event - * editor.on('command:run:before:my-command', ({ options }) => { - * if (someCondition) { - * options.abort = true; - * } - * }); - */ - CommandsEvents["abort"] = "command:abort:"; - CommandsEvents["_abort"] = "abort:"; - /** - * @event `command:stop` Triggered on stop of any command. - * @example - * editor.on('command:stop', ({ id, result, options }) => { - * console.log('Command id', id, 'command result', result); - * }); - */ - CommandsEvents["stop"] = "command:stop"; - CommandsEvents["_stop"] = "stop"; - /** - * @event `command:stop:COMMAND_ID` Triggered on stop of a specific command. - * @example - * editor.on('command:run:my-command', ({ result, options }) => { ... }); - */ - CommandsEvents["stopCommand"] = "command:stop:"; - CommandsEvents["_stopCommand"] = "stop:"; - /** - * @event `command:stop:before:COMMAND_ID` Triggered before the command is called to stop. - * @example - * editor.on('command:stop:before:my-command', ({ options }) => { ... }); - */ - CommandsEvents["stopBeforeCommand"] = "command:stop:before:"; -})(CommandsEvents || (CommandsEvents = {})); -/**{END_EVENTS}*/ -// need this to avoid the TS documentation generator to break -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CommandsEvents); - - -/***/ }), - -/***/ 858: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (ed) { - ed.Components.clear(); - ed.Css.clear(); - }, -}); - - -/***/ }), - -/***/ 884: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); -/* harmony import */ var _utils_Dragger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(668); -/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(491); - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (ed) { - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.bindAll)(this, 'onKeyUp', 'enableDragger', 'disableDragger'); - this.editor = ed; - this.canvasModel = this.canvas.getCanvasView().model; - this.toggleMove(1); - }, - stop: function (ed) { - this.toggleMove(); - this.disableDragger(); - }, - onKeyUp: function (ev) { - if ((0,_utils_dom__WEBPACK_IMPORTED_MODULE_1__/* .getKeyChar */ .sN)(ev) === ' ') { - this.editor.stopCommand(this.id); - } - }, - enableDragger: function (ev) { - this.toggleDragger(1, ev); - }, - disableDragger: function (ev) { - this.toggleDragger(0, ev); - }, - toggleDragger: function (enable, ev) { - var _a = this, canvasModel = _a.canvasModel, em = _a.em; - var dragger = this.dragger; - var methodCls = enable ? 'add' : 'remove'; - this.getCanvas().classList[methodCls]("".concat(this.ppfx, "is__grabbing")); - if (!dragger) { - dragger = new _utils_Dragger__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z({ - getPosition: function () { - return { - x: canvasModel.get('x'), - y: canvasModel.get('y'), - }; - }, - setPosition: function (_a) { - var x = _a.x, y = _a.y; - canvasModel.set({ x: x, y: y }); - }, - onStart: function (ev, dragger) { - em.trigger('canvas:move:start', dragger); - }, - onDrag: function (ev, dragger) { - em.trigger('canvas:move', dragger); - }, - onEnd: function (ev, dragger) { - em.trigger('canvas:move:end', dragger); - }, - }); - this.dragger = dragger; - } - enable ? dragger.start(ev) : dragger.stop(); - }, - toggleMove: function (enable) { - var ppfx = this.ppfx; - var methodCls = enable ? 'add' : 'remove'; - var methodEv = enable ? 'on' : 'off'; - var methodsEv = { on: _utils_dom__WEBPACK_IMPORTED_MODULE_1__.on, off: _utils_dom__WEBPACK_IMPORTED_MODULE_1__/* .off */ .S1 }; - var canvas = this.getCanvas(); - var classes = ["".concat(ppfx, "is__grab")]; - !enable && classes.push("".concat(ppfx, "is__grabbing")); - classes.forEach(function (cls) { return canvas.classList[methodCls](cls); }); - methodsEv[methodEv](document, 'keyup', this.onKeyUp); - methodsEv[methodEv](canvas, 'mousedown', this.enableDragger); - methodsEv[methodEv](document, 'mouseup', this.disableDragger); - }, -}); - - -/***/ }), - -/***/ 790: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), -/* harmony export */ defineCommand: () => (/* binding */ defineCommand) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(346); -/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(713); -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -function defineCommand(def) { - return def; -} -var CommandAbstract = /** @class */ (function (_super) { - __extends(CommandAbstract, _super); - function CommandAbstract(o) { - var _this = _super.call(this, 0) || this; - _this.config = o || {}; - _this.em = _this.config.em || {}; - var pfx = _this.config.stylePrefix; - _this.pfx = pfx; - _this.ppfx = _this.config.pStylePrefix; - _this.hoverClass = "".concat(pfx, "hover"); - _this.badgeClass = "".concat(pfx, "badge"); - _this.plhClass = "".concat(pfx, "placeholder"); - _this.freezClass = "".concat(_this.ppfx, "freezed"); - _this.canvas = _this.em.Canvas; - _this.init(_this.config); - return _this; - } - /** - * On frame scroll callback - * @param {[type]} e [description] - * @return {[type]} [description] - */ - CommandAbstract.prototype.onFrameScroll = function (e) { }; - /** - * Returns canval element - * @return {HTMLElement} - */ - CommandAbstract.prototype.getCanvas = function () { - return this.canvas.getElement(); - }; - /** - * Get canvas body element - * @return {HTMLElement} - */ - CommandAbstract.prototype.getCanvasBody = function () { - return this.canvas.getBody(); - }; - /** - * Get canvas wrapper element - * @return {HTMLElement} - */ - CommandAbstract.prototype.getCanvasTools = function () { - return this.canvas.getToolsEl(); - }; - /** - * Get the offset of the element - * @param {HTMLElement} el - * @return {Object} - */ - CommandAbstract.prototype.offset = function (el) { - var rect = el.getBoundingClientRect(); - return { - top: rect.top + el.ownerDocument.body.scrollTop, - left: rect.left + el.ownerDocument.body.scrollLeft, - }; - }; - /** - * Callback triggered after initialize - * @param {Object} o Options - * @private - * */ - CommandAbstract.prototype.init = function (o) { }; - /** - * Method that run command - * @param {Object} editor Editor instance - * @param {Object} [options={}] Options - * @private - * */ - CommandAbstract.prototype.callRun = function (editor, options) { - if (options === void 0) { options = {}; } - var id = this.id; - editor.trigger("".concat(_types__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.runBeforeCommand).concat(id), { options: options }); - editor.trigger("".concat(_types__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z._runCommand).concat(id, ":before"), options); - if (options.abort) { - editor.trigger("".concat(_types__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.abort).concat(id), { options: options }); - editor.trigger("".concat(_types__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z._abort).concat(id), options); - return; - } - var sender = options.sender || editor; - var result = this.run(editor, sender, options); - var data = { id: id, result: result, options: options }; - editor.trigger("".concat(_types__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.runCommand).concat(id), data); - editor.trigger(_types__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.run, data); - // deprecated - editor.trigger("".concat(_types__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z._runCommand).concat(id), result, options); - editor.trigger(_types__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z._run, id, result, options); - return result; - }; - /** - * Method that run command - * @param {Object} editor Editor instance - * @param {Object} [options={}] Options - * @private - * */ - CommandAbstract.prototype.callStop = function (editor, options) { - if (options === void 0) { options = {}; } - var id = this.id; - var sender = options.sender || editor; - editor.trigger("".concat(_types__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.stopBeforeCommand).concat(id), { options: options }); - editor.trigger("".concat(_types__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z._stopCommand).concat(id, ":before"), options); - var result = this.stop(editor, sender, options); - var data = { id: id, result: result, options: options }; - editor.trigger("".concat(_types__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.stopCommand).concat(id), data); - editor.trigger(_types__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z.stop, data); - // deprecated - editor.trigger("".concat(_types__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z._stopCommand).concat(id), result, options); - editor.trigger(_types__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z._stop, id, result, options); - return result; - }; - /** - * Stop current command - */ - CommandAbstract.prototype.stopCommand = function (opts) { - this.em.Commands.stop(this.id, opts); - }; - /** - * Method that run command - * @param {Object} em Editor model - * @param {Object} sender Button sender - * @private - * */ - CommandAbstract.prototype.run = function (em, sender, options) { }; - /** - * Method that stop command - * @param {Object} em Editor model - * @param {Object} sender Button sender - * @private - * */ - CommandAbstract.prototype.stop = function (em, sender, options) { }; - return CommandAbstract; -}(_common__WEBPACK_IMPORTED_MODULE_1__/* .Model */ .Hn)); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CommandAbstract); - - -/***/ }), - -/***/ 180: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); -var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - -var command = { - run: function (ed, s, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - var removed = []; - var components = opts.component || ed.getSelectedAll(); - components = (0,underscore__WEBPACK_IMPORTED_MODULE_0__.isArray)(components) ? __spreadArray([], components, true) : [components]; - components.filter(Boolean).forEach(function (component) { - var _a, _b; - if (!component.get('removable')) { - return _this.em.logWarning('The element is not removable', { - component: component, - }); - } - removed.push(component); - var cmp = ((_b = (_a = component.delegate) === null || _a === void 0 ? void 0 : _a.remove) === null || _b === void 0 ? void 0 : _b.call(_a, component)) || component; - cmp.remove(); - }); - ed.selectRemove(removed); - return removed; - }, -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (command); - - -/***/ }), - -/***/ 544: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); -/* harmony import */ var _utils_Dragger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(668); -var __assign = (undefined && undefined.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; - - -var evName = 'dmode'; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (editor, sender, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.bindAll)(this, 'setPosition', 'onStart', 'onDrag', 'onEnd', 'getPosition', 'getGuidesStatic', 'renderGuide', 'getGuidesTarget'); - var target = opts.target, event = opts.event, mode = opts.mode, _a = opts.dragger, dragger = _a === void 0 ? {} : _a; - var el = target.getEl(); - var config = __assign({ doc: el.ownerDocument, onStart: this.onStart, onEnd: this.onEnd, onDrag: this.onDrag, getPosition: this.getPosition, setPosition: this.setPosition, guidesStatic: function () { return _this.guidesStatic; }, guidesTarget: function () { return _this.guidesTarget; } }, dragger); - this.setupGuides(); - this.opts = opts; - this.editor = editor; - this.em = editor.getModel(); - this.target = target; - this.isTran = mode == 'translate'; - this.guidesContainer = this.getGuidesContainer(); - this.guidesTarget = this.getGuidesTarget(); - this.guidesStatic = this.getGuidesStatic(); - var drg = this.dragger; - if (!drg) { - drg = new _utils_Dragger__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z(config); - this.dragger = drg; - } - else { - drg.setOptions(config); - } - event && drg.start(event); - this.toggleDrag(1); - this.em.trigger("".concat(evName, ":start"), this.getEventOpts()); - return drg; - }, - getEventOpts: function () { - return { - mode: this.opts.mode, - target: this.target, - guidesTarget: this.guidesTarget, - guidesStatic: this.guidesStatic, - }; - }, - stop: function () { - this.toggleDrag(); - }, - setupGuides: function () { - (this.guides || []).forEach(function (item) { - var guide = item.guide; - guide && guide.parentNode.removeChild(guide); - }); - this.guides = []; - }, - getGuidesContainer: function () { - var _this = this; - var guidesEl = this.guidesEl; - if (!guidesEl) { - var _a = this, editor = _a.editor, em = _a.em, opts_1 = _a.opts; - var pfx = editor.getConfig().stylePrefix; - var elInfoX = document.createElement('div'); - var elInfoY = document.createElement('div'); - var guideContent = "
\n
\n
"); - guidesEl = document.createElement('div'); - guidesEl.className = "".concat(pfx, "guides"); - elInfoX.className = "".concat(pfx, "guide-info ").concat(pfx, "guide-info__x"); - elInfoY.className = "".concat(pfx, "guide-info ").concat(pfx, "guide-info__y"); - elInfoX.innerHTML = guideContent; - elInfoY.innerHTML = guideContent; - guidesEl.appendChild(elInfoX); - guidesEl.appendChild(elInfoY); - editor.Canvas.getGlobalToolsEl().appendChild(guidesEl); - this.guidesEl = guidesEl; - this.elGuideInfoX = elInfoX; - this.elGuideInfoY = elInfoY; - this.elGuideInfoContentX = elInfoX.querySelector(".".concat(pfx, "guide-info__content")); - this.elGuideInfoContentY = elInfoY.querySelector(".".concat(pfx, "guide-info__content")); - em.on('canvas:update frame:scroll', (0,underscore__WEBPACK_IMPORTED_MODULE_0__.debounce)(function () { - var _a; - _this.updateGuides(); - opts_1.debug && ((_a = _this.guides) === null || _a === void 0 ? void 0 : _a.forEach(function (item) { return _this.renderGuide(item); })); - }, 200)); - } - return guidesEl; - }, - getGuidesStatic: function () { - var _this = this; - var result = []; - var el = this.target.getEl(); - var _a = el.parentNode, parentNode = _a === void 0 ? {} : _a; - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.each)(parentNode.children, function (item) { return (result = result.concat(el !== item ? _this.getElementGuides(item) : [])); }); - return result.concat(this.getElementGuides(parentNode)); - }, - getGuidesTarget: function () { - return this.getElementGuides(this.target.getEl()); - }, - updateGuides: function (guides) { - var _this = this; - var lastEl; - var lastPos; - (guides || this.guides).forEach(function (item) { - var origin = item.origin; - var pos = lastEl === origin ? lastPos : _this.getElementPos(origin); - lastEl = origin; - lastPos = pos; - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.each)(_this.getGuidePosUpdate(item, pos), function (val, key) { return (item[key] = val); }); - item.originRect = pos; - }); - }, - getGuidePosUpdate: function (item, rect) { - var result = {}; - var top = rect.top, height = rect.height, left = rect.left, width = rect.width; - switch (item.type) { - case 't': - result.y = top; - break; - case 'b': - result.y = top + height; - break; - case 'l': - result.x = left; - break; - case 'r': - result.x = left + width; - break; - case 'x': - result.x = left + width / 2; - break; - case 'y': - result.y = top + height / 2; - break; - } - return result; - }, - renderGuide: function (item) { - if (item === void 0) { item = {}; } - var el = item.guide || document.createElement('div'); - var un = 'px'; - var guideSize = item.active ? 2 : 1; - var numEl = el.children[0]; - el.style = "position: absolute; background-color: ".concat(item.active ? 'green' : 'red', ";"); - if (!el.children.length) { - numEl = document.createElement('div'); - numEl.style = 'position: absolute; color: red; padding: 5px; top: 0; left: 0;'; - el.appendChild(numEl); - } - if (item.y) { - el.style.width = '100%'; - el.style.height = "".concat(guideSize).concat(un); - el.style.top = "".concat(item.y).concat(un); - el.style.left = 0; - } - else { - el.style.width = "".concat(guideSize).concat(un); - el.style.height = '100%'; - el.style.left = "".concat(item.x).concat(un); - el.style.top = "0".concat(un); - } - !item.guide && this.guidesContainer.appendChild(el); - return el; - }, - getElementPos: function (el) { - return this.editor.Canvas.getElementPos(el, { noScroll: 1 }); - }, - getElementGuides: function (el) { - var _this = this; - var opts = this.opts; - var originRect = this.getElementPos(el); - var top = originRect.top, height = originRect.height, left = originRect.left, width = originRect.width; - // @ts-ignore - var guides = [ - { type: 't', y: top }, - { type: 'b', y: top + height }, - { type: 'l', x: left }, - { type: 'r', x: left + width }, - { type: 'x', x: left + width / 2 }, - { type: 'y', y: top + height / 2 }, // Mid y - ].map(function (item) { return (__assign(__assign({}, item), { origin: el, originRect: originRect, guide: opts.debug && _this.renderGuide(item) })); }); - guides.forEach(function (item) { var _a; return (_a = _this.guides) === null || _a === void 0 ? void 0 : _a.push(item); }); - return guides; - }, - getTranslate: function (transform, axis) { - if (axis === void 0) { axis = 'x'; } - var result = 0; - (transform || '').split(' ').forEach(function (item) { - var itemStr = item.trim(); - var fn = "translate".concat(axis.toUpperCase(), "("); - if (itemStr.indexOf(fn) === 0) - result = parseFloat(itemStr.replace(fn, '')); - }); - return result; - }, - setTranslate: function (transform, axis, value) { - var fn = "translate".concat(axis.toUpperCase(), "("); - var val = "".concat(fn).concat(value, ")"); - var result = (transform || '') - .split(' ') - .map(function (item) { - var itemStr = item.trim(); - if (itemStr.indexOf(fn) === 0) - item = val; - return item; - }) - .join(' '); - if (result.indexOf(fn) < 0) - result += " ".concat(val); - return result; - }, - getPosition: function () { - var _a = this, target = _a.target, isTran = _a.isTran; - var _b = target.getStyle(), left = _b.left, top = _b.top, transform = _b.transform; - var x = 0; - var y = 0; - if (isTran) { - x = this.getTranslate(transform); - y = this.getTranslate(transform, 'y'); - } - else { - x = parseFloat(left || 0); - y = parseFloat(top || 0); - } - return { x: x, y: y }; - }, - setPosition: function (_a) { - var x = _a.x, y = _a.y, end = _a.end, position = _a.position, width = _a.width, height = _a.height; - var _b = this, target = _b.target, isTran = _b.isTran, em = _b.em; - var unit = 'px'; - var __p = !end; // Indicate if partial change - var left = "".concat(parseInt(x, 10)).concat(unit); - var top = "".concat(parseInt(y, 10)).concat(unit); - var styleUp = {}; - if (isTran) { - var transform = target.getStyle()['transform'] || ''; - transform = this.setTranslate(transform, 'x', left); - transform = this.setTranslate(transform, 'y', top); - styleUp = { transform: transform, __p: __p }; - target.addStyle(styleUp, { avoidStore: !end }); - } - else { - var adds_1 = { position: position, width: width, height: height }; - var style_1 = { left: left, top: top, __p: __p }; - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.keys)(adds_1).forEach(function (add) { - var prop = adds_1[add]; - if (prop) - style_1[add] = prop; - }); - styleUp = style_1; - target.addStyle(styleUp, { avoidStore: !end }); - } - em === null || em === void 0 ? void 0 : em.Styles.__emitCmpStyleUpdate(styleUp, { components: em.getSelected() }); - }, - _getDragData: function () { - var target = this.target; - return { - target: target, - parent: target.parent(), - index: target.index(), - }; - }, - onStart: function (event) { - var _a = this, target = _a.target, editor = _a.editor, isTran = _a.isTran, opts = _a.opts; - var center = opts.center, onStart = opts.onStart; - var Canvas = editor.Canvas; - var style = target.getStyle(); - var position = 'absolute'; - var relPos = [position, 'relative']; - onStart && onStart(this._getDragData()); - if (isTran) - return; - if (style.position !== position) { - var _b = Canvas.offset(target.getEl()), left = _b.left, top_1 = _b.top, width = _b.width, height = _b.height; - var parent_1 = target.parent(); - var parentRel = void 0; - // Check for the relative parent - do { - var pStyle = parent_1.getStyle(); - parentRel = relPos.indexOf(pStyle.position) >= 0 ? parent_1 : null; - parent_1 = parent_1.parent(); - } while (parent_1 && !parentRel); - // Center the target to the pointer position (used in Droppable for Blocks) - if (center) { - var _c = Canvas.getMouseRelativeCanvas(event), x = _c.x, y = _c.y; - left = x; - top_1 = y; - } - else if (parentRel) { - var offsetP = Canvas.offset(parentRel.getEl()); - left = left - offsetP.left; - top_1 = top_1 - offsetP.top; - } - this.setPosition({ - x: left, - y: top_1, - width: "".concat(width, "px"), - height: "".concat(height, "px"), - position: position, - }); - } - }, - onDrag: function () { - var _this = this; - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var _a = this, guidesTarget = _a.guidesTarget, opts = _a.opts; - var onDrag = opts.onDrag; - this.updateGuides(guidesTarget); - opts.debug && guidesTarget.forEach(function (item) { return _this.renderGuide(item); }); - opts.guidesInfo && this.renderGuideInfo(guidesTarget.filter(function (item) { return item.active; })); - onDrag && onDrag(this._getDragData()); - }, - onEnd: function (ev, dragger, opt) { - if (opt === void 0) { opt = {}; } - var _a = this, editor = _a.editor, opts = _a.opts, id = _a.id; - var onEnd = opts.onEnd; - onEnd && onEnd(ev, opt, __assign(__assign({ event: ev }, opt), this._getDragData())); - editor.stopCommand(id); - this.hideGuidesInfo(); - this.em.trigger("".concat(evName, ":end"), this.getEventOpts()); - }, - hideGuidesInfo: function () { - var _this = this; - ['X', 'Y'].forEach(function (item) { - var guide = _this["elGuideInfo".concat(item)]; - if (guide) - guide.style.display = 'none'; - }); - }, - /** - * Render guides with spacing information - */ - renderGuideInfo: function (guides) { - var _this = this; - if (guides === void 0) { guides = []; } - var guidesStatic = this.guidesStatic; - this.hideGuidesInfo(); - guides.forEach(function (item) { - var origin = item.origin, x = item.x; - var rectOrigin = _this.getElementPos(origin); - var axis = (0,underscore__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(x) ? 'y' : 'x'; - var isY = axis === 'y'; - var origEdge1 = rectOrigin[isY ? 'left' : 'top']; - var origEdge1Raw = rectOrigin.rect[isY ? 'left' : 'top']; - var origEdge2 = isY ? origEdge1 + rectOrigin.width : origEdge1 + rectOrigin.height; - var origEdge2Raw = isY ? origEdge1Raw + rectOrigin.rect.width : origEdge1Raw + rectOrigin.rect.height; - var elGuideInfo = _this["elGuideInfo".concat(axis.toUpperCase())]; - var elGuideInfoCnt = _this["elGuideInfoContent".concat(axis.toUpperCase())]; - var guideInfoStyle = elGuideInfo.style; - // Find the nearest element - var res = guidesStatic === null || guidesStatic === void 0 ? void 0 : guidesStatic.filter(function (stat) { return stat.type === item.type; }).map(function (stat) { - var _a = stat.originRect, left = _a.left, width = _a.width, top = _a.top, height = _a.height; - var statEdge1 = isY ? left : top; - var statEdge2 = isY ? left + width : top + height; - return { - gap: statEdge2 < origEdge1 ? origEdge1 - statEdge2 : statEdge1 - origEdge2, - guide: stat, - }; - }).filter(function (item) { return item.gap > 0; }).sort(function (a, b) { return a.gap - b.gap; }).map(function (item) { return item.guide; })[0]; - if (res) { - var _a = res.originRect, left = _a.left, width = _a.width, top_2 = _a.top, height = _a.height, rect = _a.rect; - var isEdge1 = isY ? left < rectOrigin.left : top_2 < rectOrigin.top; - var statEdge1 = isY ? left : top_2; - var statEdge1Raw = isY ? rect.left : rect.top; - var statEdge2 = isY ? left + width : top_2 + height; - var statEdge2Raw = isY ? rect.left + rect.width : rect.top + rect.height; - var posFirst = isY ? item.y : item.x; - var posSecond = isEdge1 ? statEdge2 : origEdge2; - var pos2 = "".concat(posFirst, "px"); - var size = isEdge1 ? origEdge1 - statEdge2 : statEdge1 - origEdge2; - var sizeRaw = isEdge1 ? origEdge1Raw - statEdge2Raw : statEdge1Raw - origEdge2Raw; - guideInfoStyle.display = ''; - guideInfoStyle[isY ? 'top' : 'left'] = pos2; - guideInfoStyle[isY ? 'left' : 'top'] = "".concat(posSecond, "px"); - guideInfoStyle[isY ? 'width' : 'height'] = "".concat(size, "px"); - elGuideInfoCnt.innerHTML = "".concat(Math.round(sizeRaw), "px"); - _this.em.trigger("".concat(evName, ":active"), __assign(__assign({}, _this.getEventOpts()), { guide: item, guidesStatic: guidesStatic, matched: res, posFirst: posFirst, posSecond: posSecond, size: size, sizeRaw: sizeRaw, elGuideInfo: elGuideInfo, elGuideInfoCnt: elGuideInfoCnt })); - } - }); - }, - toggleDrag: function (enable) { - var _a = this, ppfx = _a.ppfx, editor = _a.editor; - var methodCls = enable ? 'add' : 'remove'; - var classes = ["".concat(ppfx, "is__grabbing")]; - var Canvas = editor.Canvas; - var body = Canvas.getBody(); - classes.forEach(function (cls) { return body.classList[methodCls](cls); }); - Canvas[enable ? 'startAutoscroll' : 'stopAutoscroll'](); - }, -}); - - -/***/ }), - -/***/ 236: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (ed) { - if (!ed.Canvas.hasFocus()) - return; - var toSelect = []; - ed.getSelectedAll().forEach(function (component) { - var coll = component.components(); - var next = coll && coll.filter(function (c) { return c.get('selectable'); })[0]; - next && toSelect.push(next); - }); - toSelect.length && ed.select(toSelect); - }, -}); - - -/***/ }), - -/***/ 368: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (ed, snd, opts) { - if (opts === void 0) { opts = {}; } - if (!ed.Canvas.hasFocus() && !opts.force) - return; - var toSelect = []; - ed.getSelectedAll().forEach(function (component) { - var next = component.parent(); - // Recurse through the parent() chain until a selectable parent is found - while (next && !next.get('selectable')) { - next = next.parent(); - } - next && toSelect.push(next); - }); - toSelect.length && ed.select(toSelect); - }, -}); - - -/***/ }), - -/***/ 243: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (ed) { - if (!ed.Canvas.hasFocus()) - return; - var toSelect = []; - ed.getSelectedAll().forEach(function (cmp) { - var parent = cmp.parent(); - if (!parent) - return; - var len = parent.components().length; - var incr = 0; - var at = 0; - var next; - // Get the next selectable component - do { - incr++; - at = cmp.index() + incr; - next = at <= len ? parent.getChildAt(at) : null; - } while (next && !next.get('selectable')); - toSelect.push(next || cmp); - }); - toSelect.length && ed.select(toSelect); - }, -}); - - -/***/ }), - -/***/ 400: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (ed) { - if (!ed.Canvas.hasFocus()) - return; - var toSelect = []; - ed.getSelectedAll().forEach(function (cmp) { - var parent = cmp.parent(); - if (!parent) - return; - var incr = 0; - var at = 0; - var next; - // Get the first selectable component - do { - incr++; - at = cmp.index() - incr; - next = at >= 0 ? parent.getChildAt(at) : null; - } while (next && !next.get('selectable')); - toSelect.push(next || cmp); - }); - toSelect.length && ed.select(toSelect); - }, -}); - - -/***/ }), - -/***/ 910: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (ed, s, opts) { - if (opts === void 0) { opts = {}; } - var target = opts.target; - var toRemove = []; - if (!target.get('styles')) - return toRemove; - // Find all components in the project, of the target component type - var type = target.get('type'); - var wrappers = ed.Pages.getAllWrappers(); - var len = (0,underscore__WEBPACK_IMPORTED_MODULE_0__.flatten)(wrappers.map(function (wrp) { return wrp.findType(type); })).length; - // Remove component related styles only if there are no more components - // of that type in the project - if (!len) { - var rules = ed.CssComposer.getAll(); - toRemove = rules.filter(function (rule) { return rule.get('group') === "cmp:".concat(type); }); - rules.remove(toRemove); - } - return toRemove; - }, -}); - - -/***/ }), - -/***/ 744: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (ed) { - var em = ed.getModel(); - var models = __spreadArray([], ed.getSelectedAll(), true).map(function (md) { var _a, _b; return ((_b = (_a = md.delegate) === null || _a === void 0 ? void 0 : _a.copy) === null || _b === void 0 ? void 0 : _b.call(_a, md)) || md; }).filter(Boolean); - models.length && em.set('clipboard', models); - }, -}); - - -/***/ }), - -/***/ 457: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(491); - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (editor, sender, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - sender && sender.set && sender.set('active', 0); - var config = editor.getConfig(); - var modal = editor.Modal; - var pfx = config.stylePrefix; - this.cm = editor.CodeManager || null; - if (!this.editors) { - var oHtmlEd = this.buildEditor('htmlmixed', 'hopscotch', 'HTML'); - var oCsslEd = this.buildEditor('css', 'hopscotch', 'CSS'); - this.htmlEditor = oHtmlEd.model; - this.cssEditor = oCsslEd.model; - var editors = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_0__/* .createEl */ .ut)('div', { class: "".concat(pfx, "export-dl") }); - editors.appendChild(oHtmlEd.el); - editors.appendChild(oCsslEd.el); - this.editors = editors; - } - modal - .open({ - title: config.textViewCode, - content: this.editors, - }) - .getModel() - .once('change:open', function () { return editor.stopCommand("".concat(_this.id)); }); - this.htmlEditor.setContent(editor.getHtml(opts.optsHtml)); - this.cssEditor.setContent(editor.getCss(opts.optsCss)); - }, - stop: function (editor) { - var modal = editor.Modal; - modal && modal.close(); - }, - buildEditor: function (codeName, theme, label) { - var cm = this.em.CodeManager; - var model = cm.createViewer({ - label: label, - codeName: codeName, - theme: theme, - }); - var el = new cm.EditorView({ - model: model, - config: cm.getConfig(), - }).render().el; - return { model: model, el: el }; - }, -}); - - -/***/ }), - -/***/ 975: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - /** - * Check if fullscreen mode is enabled - * @return {Boolean} - */ - isEnabled: function () { - var d = document; - // @ts-ignore - if (d.fullscreenElement || d.webkitFullscreenElement || d.mozFullScreenElement) { - return true; - } - return false; - }, - /** - * Enable fullscreen mode and return browser prefix - * @param {HTMLElement} el - * @return {string} - */ - enable: function (el) { - var pfx = ''; - if (el.requestFullscreen) { - el.requestFullscreen(); - } - else if (el.webkitRequestFullscreen) { - pfx = 'webkit'; - el.webkitRequestFullscreen(); - } - else if (el.mozRequestFullScreen) { - pfx = 'moz'; - el.mozRequestFullScreen(); - } - else if (el.msRequestFullscreen) { - el.msRequestFullscreen(); - } - return pfx; - }, - /** - * Disable fullscreen mode - */ - disable: function () { - var d = document; - if (this.isEnabled()) { - if (d.exitFullscreen) - d.exitFullscreen(); - else if (d.webkitExitFullscreen) - d.webkitExitFullscreen(); - else if (d.mozCancelFullScreen) - d.mozCancelFullScreen(); - else if (d.msExitFullscreen) - d.msExitFullscreen(); - } - }, - /** - * Triggered when the state of the fullscreen is changed. Inside detects if - * it's enabled - * @param {strinf} pfx Browser prefix - * @param {Event} e - */ - fsChanged: function (pfx) { - if (!this.isEnabled()) { - this.stopCommand({ sender: this.sender }); - document.removeEventListener("".concat(pfx || '', "fullscreenchange"), this.fsChanged); - } - }, - run: function (editor, sender, opts) { - if (opts === void 0) { opts = {}; } - this.sender = sender; - var target = opts.target; - var targetEl = (0,underscore__WEBPACK_IMPORTED_MODULE_0__.isElement)(target) ? target : document.querySelector(target); - var pfx = this.enable(targetEl || editor.getContainer()); - this.fsChanged = this.fsChanged.bind(this, pfx); - document.addEventListener(pfx + 'fullscreenchange', this.fsChanged); - }, - stop: function (editor, sender) { - if (sender && sender.set) - sender.set('active', false); - this.disable(); - }, -}); - - -/***/ }), - -/***/ 191: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(895); -/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(491); -/* harmony import */ var _SelectComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(407); -/* harmony import */ var _SelectPosition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(189); - - - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,underscore__WEBPACK_IMPORTED_MODULE_0__.extend)({}, _SelectPosition__WEBPACK_IMPORTED_MODULE_1__["default"], _SelectComponent__WEBPACK_IMPORTED_MODULE_2__["default"], { - init: function (o) { - _SelectComponent__WEBPACK_IMPORTED_MODULE_2__["default"].init.apply(this, arguments); - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.bindAll)(this, 'initSorter', 'rollback', 'onEndMove'); - this.opt = o; - this.hoverClass = this.ppfx + 'highlighter-warning'; - this.badgeClass = this.ppfx + 'badge-warning'; - this.noSelClass = this.ppfx + 'no-select'; - }, - enable: function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - _SelectComponent__WEBPACK_IMPORTED_MODULE_2__["default"].enable.apply(this, args); - this.getBadgeEl().addClass(this.badgeClass); - this.getHighlighterEl().addClass(this.hoverClass); - var wp = this.$wrapper; - wp.css('cursor', 'move'); - wp.on('mousedown', this.initSorter); - // Avoid strange moving behavior - wp.addClass(this.noSelClass); - }, - /** - * Overwrite for doing nothing - * @private - */ - toggleClipboard: function () { }, - /** - * Delegate sorting - * @param {Event} e - * @private - * */ - initSorter: function (e) { - var el = (0,_common__WEBPACK_IMPORTED_MODULE_3__["default"])(e.target).data('model'); - var drag = el.get('draggable'); - if (!drag) - return; - // Avoid badge showing on move - this.cacheEl = null; - this.startSelectPosition(e.target, this.frameEl.contentDocument); - this.sorter.draggable = drag; - this.sorter.onEndMove = this.onEndMove.bind(this); - this.stopSelectComponent(); - this.$wrapper.off('mousedown', this.initSorter); - (0,_utils_dom__WEBPACK_IMPORTED_MODULE_4__.on)(this.getContentWindow(), 'keydown', this.rollback); - }, - /** - * Init sorter from model - * @param {Object} model - * @private - */ - initSorterFromModel: function (model) { - var drag = model.get('draggable'); - if (!drag) - return; - // Avoid badge showing on move - this.cacheEl = null; - // @ts-ignore - var el = model.view.el; - this.startSelectPosition(el, this.frameEl.contentDocument); - this.sorter.draggable = drag; - this.sorter.onEndMove = this.onEndMoveFromModel.bind(this); - /* - this.sorter.setDragHelper(el); - var dragHelper = this.sorter.dragHelper; - dragHelper.className = this.ppfx + 'drag-helper'; - dragHelper.innerHTML = ''; - dragHelper.backgroundColor = 'white'; - */ - this.stopSelectComponent(); - (0,_utils_dom__WEBPACK_IMPORTED_MODULE_4__.on)(this.getContentWindow(), 'keydown', this.rollback); - }, - /** - * Init sorter from models - * @param {Object} model - * @private - */ - initSorterFromModels: function (models) { - // TODO: if one only check for `draggable` - // Avoid badge showing on move - this.cacheEl = null; - var lastModel = models[models.length - 1]; - var frameView = this.em.getCurrentFrame(); - var el = lastModel.getEl(frameView === null || frameView === void 0 ? void 0 : frameView.model); - var doc = el.ownerDocument; - this.startSelectPosition(el, doc, { onStart: this.onStart }); - this.sorter.draggable = lastModel.get('draggable'); - this.sorter.toMove = models; - this.sorter.onMoveClb = this.onDrag; - this.sorter.onEndMove = this.onEndMoveFromModel.bind(this); - this.stopSelectComponent(); - (0,_utils_dom__WEBPACK_IMPORTED_MODULE_4__.on)(this.getContentWindow(), 'keydown', this.rollback); - }, - onEndMoveFromModel: function () { - (0,_utils_dom__WEBPACK_IMPORTED_MODULE_4__/* .off */ .S1)(this.getContentWindow(), 'keydown', this.rollback); - }, - /** - * Callback after sorting - * @private - */ - onEndMove: function () { - this.enable(); - (0,_utils_dom__WEBPACK_IMPORTED_MODULE_4__/* .off */ .S1)(this.getContentWindow(), 'keydown', this.rollback); - }, - /** - * Say what to do after the component was selected (selectComponent) - * @param {Event} e - * @param {Object} Selected element - * @private - * */ - onSelect: function (e, el) { }, - /** - * Used to bring the previous situation before start moving the component - * @param {Event} e - * @param {Boolean} Indicates if rollback in anycase - * @private - * */ - rollback: function (e, force) { - var key = e.which || e.keyCode; - if (key == 27 || force) { - this.sorter.moved = false; - this.sorter.endMove(); - } - return; - }, - /** - * Returns badge element - * @return {HTMLElement} - * @private - */ - getBadgeEl: function () { - if (!this.$badge) - this.$badge = (0,_common__WEBPACK_IMPORTED_MODULE_3__["default"])(this.getBadge()); - return this.$badge; - }, - /** - * Returns highlighter element - * @return {HTMLElement} - * @private - */ - getHighlighterEl: function () { - if (!this.$hl) - this.$hl = (0,_common__WEBPACK_IMPORTED_MODULE_3__["default"])(this.canvas.getHighlighter()); - return this.$hl; - }, - stop: function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - // @ts-ignore - _SelectComponent__WEBPACK_IMPORTED_MODULE_2__["default"].stop.apply(this, args); - this.getBadgeEl().removeClass(this.badgeClass); - this.getHighlighterEl().removeClass(this.hoverClass); - var wp = this.$wrapper; - wp.css('cursor', '').unbind().removeClass(this.noSelClass); - }, -})); - - -/***/ }), - -/***/ 912: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); -/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(491); - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - open: function (content) { - var _this = this; - var _a = this, editor = _a.editor, title = _a.title, config = _a.config, am = _a.am; - var custom = config.custom; - if ((0,underscore__WEBPACK_IMPORTED_MODULE_0__.isFunction)(custom.open)) { - return custom.open(am.__customData()); - } - var Modal = editor.Modal; - Modal.open({ title: title, content: content }).onceClose(function () { return editor.stopCommand(_this.id); }); - }, - close: function () { - var custom = this.config.custom; - if ((0,underscore__WEBPACK_IMPORTED_MODULE_0__.isFunction)(custom.close)) { - return custom.close(this.am.__customData()); - } - var Modal = this.editor.Modal; - Modal && Modal.close(); - }, - run: function (editor, sender, opts) { - if (opts === void 0) { opts = {}; } - var am = editor.AssetManager; - var config = am.getConfig(); - var _a = opts.types, types = _a === void 0 ? [] : _a, accept = opts.accept, select = opts.select; - this.title = opts.modalTitle || editor.t('assetManager.modalTitle') || ''; - this.editor = editor; - this.config = config; - this.am = am; - am.setTarget(opts.target); - am.onClick(opts.onClick); - am.onDblClick(opts.onDblClick); - am.onSelect(opts.onSelect); - am.__behaviour({ - select: select, - types: types, - options: opts, - }); - if (config.custom) { - this.rendered = this.rendered || (0,_utils_dom__WEBPACK_IMPORTED_MODULE_1__/* .createEl */ .ut)('div'); - this.rendered.className = "".concat(config.stylePrefix, "custom-wrp"); - am.__behaviour({ container: this.rendered }); - am.__trgCustom(); - } - else { - if (!this.rendered || types) { - var assets = am.getAll().filter(function (i) { return i; }); - if (types && types.length) { - assets = assets.filter(function (a) { return types.indexOf(a.get('type')) !== -1; }); - } - am.render(assets); - this.rendered = am.getContainer(); - } - if (accept) { - var uploadEl = this.rendered.querySelector("input#".concat(config.stylePrefix, "uploadFile")); - uploadEl && uploadEl.setAttribute('accept', accept); - } - } - this.open(this.rendered); - return this; - }, - stop: function (editor) { - this.editor = editor; - this.close(this.rendered); - }, -}); - - -/***/ }), - -/***/ 117: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); -/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(491); - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - open: function () { - var _a = this, container = _a.container, editor = _a.editor, bm = _a.bm, config = _a.config; - var custom = config.custom, appendTo = config.appendTo; - if ((0,underscore__WEBPACK_IMPORTED_MODULE_0__.isFunction)(custom.open)) { - return custom.open(bm.__customData()); - } - if (this.firstRender && !appendTo) { - var id = 'views-container'; - var pn = editor.Panels; - var panels = pn.getPanel(id) || pn.addPanel({ id: id }); - panels.set('appendContent', container).trigger('change:appendContent'); - if (!custom) - container.appendChild(bm.render()); - } - if (container) - container.style.display = 'block'; - }, - close: function () { - var _a = this, container = _a.container, config = _a.config; - var custom = config.custom; - if ((0,underscore__WEBPACK_IMPORTED_MODULE_0__.isFunction)(custom.close)) { - return custom.close(this.bm.__customData()); - } - if (container) - container.style.display = 'none'; - }, - run: function (editor) { - var bm = editor.Blocks; - this.config = bm.getConfig(); - this.firstRender = !this.container; - this.container = this.container || (0,_utils_dom__WEBPACK_IMPORTED_MODULE_1__/* .createEl */ .ut)('div'); - this.editor = editor; - this.bm = bm; - var container = this.container; - bm.__behaviour({ - container: container, - }); - if (this.config.custom) { - bm.__trgCustom(); - } - this.open(); - }, - stop: function () { - this.close(); - }, -}); - - -/***/ }), - -/***/ 614: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (editor) { - var lm = editor.LayerManager; - var pn = editor.Panels; - var lmConfig = lm.getConfig(); - if (lmConfig.appendTo) - return; - if (!this.layers) { - var id = 'views-container'; - var layers = document.createElement('div'); - // @ts-ignore - var panels = pn.getPanel(id) || pn.addPanel({ id: id }); - if (lmConfig.custom) { - lm.__trgCustom({ container: layers }); - } - else { - layers.appendChild(lm.render()); - } - panels.set('appendContent', layers).trigger('change:appendContent'); - this.layers = layers; - } - this.layers.style.display = 'block'; - }, - stop: function () { - var layers = this.layers; - layers && (layers.style.display = 'none'); - }, -}); - - -/***/ }), - -/***/ 801: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(895); - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (editor, sender) { - this.sender = sender; - if (!this.$cnt) { - var config = editor.getConfig(); - var Panels = editor.Panels, DeviceManager = editor.DeviceManager, SelectorManager = editor.SelectorManager, StyleManager = editor.StyleManager; - var trgEvCnt = 'change:appendContent'; - var $cnt = (0,_common__WEBPACK_IMPORTED_MODULE_0__["default"])('
'); - var $cntInner = (0,_common__WEBPACK_IMPORTED_MODULE_0__["default"])('
'); - var $cntSlm = (0,_common__WEBPACK_IMPORTED_MODULE_0__["default"])('
'); - var $cntSm = (0,_common__WEBPACK_IMPORTED_MODULE_0__["default"])('
'); - this.$cnt = $cnt; - this.$cntInner = $cntInner; - $cntInner.append($cntSlm); - $cntInner.append($cntSm); - $cnt.append($cntInner); - // Device Manager - if (DeviceManager && config.showDevices) { - var devicePanel = Panels.addPanel({ id: 'devices-c' }); - var dvEl = DeviceManager.render(); - devicePanel.set('appendContent', dvEl).trigger(trgEvCnt); - } - // Selector Manager container - var slmConfig = SelectorManager.getConfig(); - if (slmConfig.custom) { - SelectorManager.__trgCustom({ container: $cntSlm.get(0) }); - } - else if (!slmConfig.appendTo) { - $cntSlm.append(SelectorManager.render([])); - } - // Style Manager - this.sm = StyleManager; - var smConfig = StyleManager.getConfig(); - var pfx = smConfig.stylePrefix; - this.$header = (0,_common__WEBPACK_IMPORTED_MODULE_0__["default"])("
").concat(editor.t('styleManager.empty'), "
")); - $cnt.append(this.$header); - if (smConfig.custom) { - StyleManager.__trgCustom({ container: $cntSm.get(0) }); - } - else if (!smConfig.appendTo) { - $cntSm.append(StyleManager.render()); - } - // Create panel if not exists - var pnCnt = 'views-container'; - var pnl = Panels.getPanel(pnCnt) || Panels.addPanel({ id: pnCnt }); - // Add all containers to the panel - pnl.set('appendContent', $cnt).trigger(trgEvCnt); - // Toggle Style Manager on target selection - var em = editor.getModel(); - this.listenTo(em, StyleManager.events.target, this.toggleSm); - } - this.toggleSm(); - }, - /** - * Toggle Style Manager visibility - * @private - */ - toggleSm: function () { - var _a = this, sender = _a.sender, sm = _a.sm, $cntInner = _a.$cntInner, $header = _a.$header; - if ((sender && sender.get && !sender.get('active')) || !sm) - return; - if (sm.getSelected()) { - $cntInner === null || $cntInner === void 0 ? void 0 : $cntInner.show(); - $header === null || $header === void 0 ? void 0 : $header.hide(); - } - else { - $cntInner === null || $cntInner === void 0 ? void 0 : $cntInner.hide(); - $header === null || $header === void 0 ? void 0 : $header.show(); - } - }, - stop: function () { - var _a, _b; - (_a = this.$cntInner) === null || _a === void 0 ? void 0 : _a.hide(); - (_b = this.$header) === null || _b === void 0 ? void 0 : _b.hide(); - }, -}); - - -/***/ }), - -/***/ 395: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(895); - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (editor, sender) { - this.sender = sender; - var em = editor.getModel(); - var config = editor.Config; - var pfx = config.stylePrefix; - var tm = editor.TraitManager; - var confTm = tm.getConfig(); - var panelC; - if (confTm.appendTo) - return; - if (!this.$cn) { - this.$cn = (0,_common__WEBPACK_IMPORTED_MODULE_0__["default"])('
'); - this.$cn2 = (0,_common__WEBPACK_IMPORTED_MODULE_0__["default"])('
'); - this.$cn.append(this.$cn2); - this.$header = (0,_common__WEBPACK_IMPORTED_MODULE_0__["default"])('
').append("
").concat(em.t('traitManager.empty'), "
")); - this.$cn.append(this.$header); - if (confTm.custom) { - tm.__trgCustom({ container: this.$cn2.get(0) }); - } - else { - this.$cn2.append("
").concat(em.t('traitManager.label'), "
")); - this.$cn2.append(tm.render()); - } - var panels = editor.Panels; - if (!panels.getPanel('views-container')) { - // @ts-ignore - panelC = panels.addPanel({ id: 'views-container' }); - } - else { - panelC = panels.getPanel('views-container'); - } - panelC === null || panelC === void 0 ? void 0 : panelC.set('appendContent', this.$cn.get(0)).trigger('change:appendContent'); - this.target = editor.getModel(); - this.listenTo(this.target, 'component:toggled', this.toggleTm); - } - this.toggleTm(); - }, - /** - * Toggle Trait Manager visibility - * @private - */ - toggleTm: function () { - var sender = this.sender; - if (sender && sender.get && !sender.get('active')) - return; - if (this.target.getSelectedAll().length === 1) { - this.$cn2.show(); - this.$header.hide(); - } - else { - this.$cn2.hide(); - this.$header.show(); - } - }, - stop: function () { - this.$cn2 && this.$cn2.hide(); - this.$header && this.$header.hide(); - }, -}); - - -/***/ }), - -/***/ 98: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (ed, s, opts) { - if (opts === void 0) { opts = {}; } - var em = ed.getModel(); - var clp = em.get('clipboard'); - var lastSelected = ed.getSelected(); - if ((clp === null || clp === void 0 ? void 0 : clp.length) && lastSelected) { - ed.getSelectedAll().forEach(function (sel) { - var _a, _b, _c; - var selected = ((_b = (_a = sel.delegate) === null || _a === void 0 ? void 0 : _a.copy) === null || _b === void 0 ? void 0 : _b.call(_a, sel)) || sel; - var collection = selected.collection; - var added; - if (collection) { - var at = selected.index() + 1; - var addOpts = { at: at, action: opts.action || 'paste-component' }; - if ((0,underscore__WEBPACK_IMPORTED_MODULE_0__.contains)(clp, selected) && selected.get('copyable')) { - added = collection.add(selected.clone(), addOpts); - } - else { - added = doAdd(ed, clp, selected.parent(), addOpts); - } - } - else { - // Page body is selected - // Paste at the end of the body - var pageBody = (_c = em.Pages.getSelected()) === null || _c === void 0 ? void 0 : _c.getMainComponent(); - var addOpts = { at: (pageBody === null || pageBody === void 0 ? void 0 : pageBody.components().length) || 0, action: opts.action || 'paste-component' }; - added = doAdd(ed, clp, pageBody, addOpts); - } - added = (0,underscore__WEBPACK_IMPORTED_MODULE_0__.isArray)(added) ? added : [added]; - added.forEach(function (add) { return ed.trigger('component:paste', add); }); - }); - lastSelected.emitUpdate(); - } - }, -}); -function doAdd(ed, clp, parent, addOpts) { - var copyable = clp.filter(function (cop) { return cop.get('copyable'); }); - var pasteable = copyable.filter(function (cop) { return ed.Components.canMove(parent, cop).result; }); - return parent.components().add(pasteable.map(function (cop) { return cop.clone(); }), addOpts); -} - - -/***/ }), - -/***/ 129: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); -var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - -var cmdOutline = 'core:component-outline'; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - getPanels: function (editor) { - if (!this.panels) { - this.panels = editor.Panels.getPanels(); - } - return this.panels; - }, - preventDrag: function (opts) { - opts.abort = 1; - }, - tglEffects: function (on) { - var em = this.em; - var mthEv = on ? 'on' : 'off'; - if (em) { - var canvas = em.Canvas; - var body = canvas.getBody(); - var tlb = canvas.getToolbarEl(); - tlb && (tlb.style.display = on ? 'none' : ''); - var elP = body.querySelectorAll(".".concat(this.ppfx, "no-pointer")); - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.each)(elP, function (item) { return (item.style.pointerEvents = on ? 'all' : ''); }); - em[mthEv]('run:tlb-move:before', this.preventDrag); - } - }, - run: function (editor, sender) { - var _this = this; - this.sender = sender; - this.selected = __spreadArray([], editor.getSelectedAll(), true); - editor.select(); - if (!this.shouldRunSwVisibility) { - this.shouldRunSwVisibility = editor.Commands.isActive(cmdOutline); - } - this.shouldRunSwVisibility && editor.stopCommand(cmdOutline); - editor.getModel().stopDefault(); - var panels = this.getPanels(editor); - var canvas = editor.Canvas.getElement(); - var editorEl = editor.getEl(); - var pfx = editor.Config.stylePrefix; - if (!this.helper) { - var helper = document.createElement('span'); - helper.className = "".concat(pfx, "off-prv fa fa-eye-slash"); - editorEl.appendChild(helper); - helper.onclick = function () { return _this.stopCommand(); }; - this.helper = helper; - } - this.helper.style.display = 'inline-block'; - panels.forEach(function (panel) { return panel.set('visible', false); }); - var canvasS = canvas.style; - canvasS.width = '100%'; - canvasS.height = '100%'; - canvasS.top = '0'; - canvasS.left = '0'; - canvasS.padding = '0'; - canvasS.margin = '0'; - editor.refresh(); - this.tglEffects(1); - }, - stop: function (editor) { - var _a = this, _b = _a.sender, sender = _b === void 0 ? {} : _b, selected = _a.selected; - sender.set && sender.set('active', 0); - var panels = this.getPanels(editor); - if (this.shouldRunSwVisibility) { - editor.runCommand(cmdOutline); - this.shouldRunSwVisibility = false; - } - editor.getModel().runDefault(); - panels.forEach(function (panel) { return panel.set('visible', true); }); - var canvas = editor.Canvas.getElement(); - canvas.setAttribute('style', ''); - selected && editor.select(selected); - delete this.selected; - if (this.helper) { - this.helper.style.display = 'none'; - } - editor.refresh(); - this.tglEffects(); - }, -}); - - -/***/ }), - -/***/ 116: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -var __assign = (undefined && undefined.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - run: function (editor, sender, opts) { - var opt = opts || {}; - var canvas = editor.Canvas; - var canvasView = canvas.getCanvasView(); - var options = __assign({ appendTo: canvas.getResizerEl(), prefix: editor.getConfig().stylePrefix, posFetcher: canvasView.getElementPos.bind(canvasView), mousePosFetcher: canvas.getMouseRelativePos.bind(canvas) }, (opt.options || {})); - var canvasResizer = this.canvasResizer; - // Create the resizer for the canvas if not yet created - if (!canvasResizer || opt.forceNew) { - this.canvasResizer = new editor.Utils.Resizer(options); - canvasResizer = this.canvasResizer; - } - canvasResizer.setOptions(options, true); - canvasResizer.blur(); - canvasResizer.focus(opt.el); - return canvasResizer; - }, - stop: function () { - var _a; - (_a = this.canvasResizer) === null || _a === void 0 ? void 0 : _a.blur(); - }, -}); - - -/***/ }), - -/***/ 407: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXPORTS -__webpack_require__.d(__webpack_exports__, { - "default": () => (/* binding */ SelectComponent) -}); - -// EXTERNAL MODULE: ./node_modules/underscore/modules/index-all.js + 160 modules -var index_all = __webpack_require__(50); -// EXTERNAL MODULE: ./src/common/index.ts -var common = __webpack_require__(346); -;// CONCATENATED MODULE: ./src/dom_components/model/ToolbarButton.ts -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ToolbarButton = /** @class */ (function (_super) { - __extends(ToolbarButton, _super); - function ToolbarButton() { - return _super !== null && _super.apply(this, arguments) || this; - } - ToolbarButton.prototype.defaults = function () { - return { - command: '', - attributes: {}, - }; - }; - return ToolbarButton; -}(common/* Model */.Hn)); -/* harmony default export */ const model_ToolbarButton = (ToolbarButton); - -;// CONCATENATED MODULE: ./src/dom_components/model/Toolbar.ts -var Toolbar_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var Toolbar = /** @class */ (function (_super) { - Toolbar_extends(Toolbar, _super); - function Toolbar() { - return _super !== null && _super.apply(this, arguments) || this; - } - return Toolbar; -}(common/* Collection */.FE)); -/* harmony default export */ const model_Toolbar = (Toolbar); -Toolbar.prototype.model = model_ToolbarButton; - -// EXTERNAL MODULE: ./src/domain_abstract/view/DomainViews.ts -var DomainViews = __webpack_require__(330); -;// CONCATENATED MODULE: ./src/dom_components/view/ToolbarButtonView.ts -var ToolbarButtonView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __assign = (undefined && undefined.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; - - -var ToolbarButtonView = /** @class */ (function (_super) { - ToolbarButtonView_extends(ToolbarButtonView, _super); - function ToolbarButtonView(props) { - var _this = _super.call(this, props) || this; - _this.em = props.config.em; - return _this; - } - ToolbarButtonView.prototype.events = function () { - return (this.model.get('events') || { - mousedown: 'handleClick', - }); - }; - // @ts-ignore - ToolbarButtonView.prototype.attributes = function () { - return this.model.get('attributes'); - }; - ToolbarButtonView.prototype.handleClick = function (event) { - event.preventDefault(); - event.stopPropagation(); - /* - * Since the toolbar lives outside the canvas frame, the event's - * generated on it have clientX and clientY relative to the page. - * - * This causes issues during events like dragging, where they depend - * on the clientX and clientY. - * - * This makes sure the offsets are calculated. - * - * More information on - * https://github.com/GrapesJS/grapesjs/issues/2372 - * https://github.com/GrapesJS/grapesjs/issues/2207 - */ - var em = this.em; - var _a = em.Canvas.getFrameEl().getBoundingClientRect(), left = _a.left, top = _a.top; - var ev = __assign(__assign({}, event), { clientX: event.clientX - left, clientY: event.clientY - top }); - em.trigger('toolbar:run:before', { event: ev }); - this.execCommand(ev); - }; - ToolbarButtonView.prototype.execCommand = function (event) { - var _a = this, em = _a.em, model = _a.model; - var opts = { event: event }; - var command = model.get('command'); - var editor = em.Editor; - if ((0,index_all.isFunction)(command)) { - command(editor, null, opts); - } - if ((0,index_all.isString)(command)) { - editor.runCommand(command, opts); - } - }; - ToolbarButtonView.prototype.render = function () { - var _a = this, em = _a.em, $el = _a.$el, model = _a.model; - var id = model.get('id'); - var label = model.get('label'); - var pfx = em.getConfig().stylePrefix; - $el.addClass("".concat(pfx, "toolbar-item")); - id && $el.addClass("".concat(pfx, "toolbar-item__").concat(id)); - label && $el.append(label); - return this; - }; - return ToolbarButtonView; -}(common/* View */.G7)); -/* harmony default export */ const view_ToolbarButtonView = (ToolbarButtonView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ToolbarView.ts -var ToolbarView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var ToolbarView = /** @class */ (function (_super) { - ToolbarView_extends(ToolbarView, _super); - function ToolbarView(opts) { - var _this = _super.call(this, opts) || this; - var em = opts.em; - _this.em = em; - _this.config = { em: em }; - _this.listenTo(_this.collection, 'reset', _this.render); - return _this; - } - ToolbarView.prototype.onRender = function () { - var pfx = this.em.config.stylePrefix; - this.el.className = "".concat(pfx, "toolbar-items"); - }; - return ToolbarView; -}(DomainViews/* default */.Z)); -/* harmony default export */ const view_ToolbarView = (ToolbarView); -// @ts-ignore -ToolbarView.prototype.itemView = view_ToolbarButtonView; - -// EXTERNAL MODULE: ./src/utils/dom.ts -var dom = __webpack_require__(491); -// EXTERNAL MODULE: ./src/utils/mixins.ts -var mixins = __webpack_require__(163); -// EXTERNAL MODULE: ./src/canvas/model/CanvasSpot.ts -var CanvasSpot = __webpack_require__(675); -// EXTERNAL MODULE: ./src/dom_components/types.ts -var types = __webpack_require__(184); -;// CONCATENATED MODULE: ./src/commands/view/SelectComponent.ts -var SelectComponent_assign = (undefined && undefined.__assign) || function () { - SelectComponent_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return SelectComponent_assign.apply(this, arguments); -}; -var __rest = (undefined && undefined.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -}; - - - - - - - -var showOffsets; -/** - * This command is responsible for show selecting components and displaying - * all the necessary tools around (component toolbar, badge, highlight box, etc.) - * - * The command manages different boxes to display tools and when something in - * the canvas is updated, the command triggers the appropriate method to update - * their position (across multiple frames/components): - * - Global Tools (updateToolsGlobal/updateGlobalPos) - * This box contains tools intended to be displayed only on ONE component per time, - * like Component Toolbar (updated by updateToolbar/updateToolbarPos), this means - * you won't be able to see more than one Component Toolbar (even with multiple - * frames or multiple selected components) - * - Local Tools (updateToolsLocal/updateLocalPos) - * Each frame in the canvas has its own local box, so we're able to see more than - * one active container at the same time. When you put a mouse over an element - * you can see stuff like the highlight box, badge, margins/paddings offsets, etc. - * so those elements are inside the Local Tools box - * - * - */ -/* harmony default export */ const SelectComponent = ({ - activeResizer: false, - init: function () { - this.onSelect = (0,index_all.debounce)(this.onSelect, 0); - (0,index_all.bindAll)(this, 'onHover', 'onOut', 'onClick', 'onFrameScroll', 'onFrameResize', 'onFrameUpdated', 'onContainerChange'); - }, - enable: function () { - this.frameOff = this.canvasOff = this.adjScroll = null; - this.startSelectComponent(); - showOffsets = true; - }, - /** - * Start select component event - * @private - * */ - startSelectComponent: function () { - this.toggleSelectComponent(1); - this.em.getSelected() && this.onSelect(); - }, - /** - * Stop select component event - * @private - * */ - stopSelectComponent: function () { - this.toggleSelectComponent(); - }, - /** - * Toggle select component event - * @private - * */ - toggleSelectComponent: function (enable) { - var _this = this; - var em = this.em; - var listenToEl = em.getConfig().listenToEl; - var parentNode = em.getContainer().parentNode; - var method = enable ? 'on' : 'off'; - var methods = { on: dom.on, off: dom/* off */.S1 }; - var eventCmpUpdate = types/* ComponentsEvents */.g.update; - !listenToEl.length && parentNode && listenToEl.push(parentNode); - var trigger = function (win, body) { - methods[method](body, 'mouseover', _this.onHover); - methods[method](body, 'mouseleave', _this.onOut); - methods[method](body, 'click', _this.onClick); - methods[method](win, 'scroll', _this.onFrameScroll, true); - methods[method](win, 'resize', _this.onFrameResize); - }; - methods[method](window, 'resize', this.onFrameUpdated); - methods[method](listenToEl, 'scroll', this.onContainerChange); - em[method]("component:toggled ".concat(eventCmpUpdate, " undo redo"), this.onSelect, this); - em[method]('change:componentHovered', this.onHovered, this); - em[method]('component:resize styleable:change component:input', this.updateGlobalPos, this); - em[method]("".concat(eventCmpUpdate, ":toolbar"), this._upToolbar, this); - em[method]('frame:updated', this.onFrameUpdated, this); - em[method]('canvas:updateTools', this.onFrameUpdated, this); - em[method](em.Canvas.events.refresh, this.updateAttached, this); - em.Canvas.getFrames().forEach(function (frame) { - var view = frame.view; - var win = view === null || view === void 0 ? void 0 : view.getWindow(); - win && trigger(win, view === null || view === void 0 ? void 0 : view.getBody()); - }); - }, - /** - * Hover command - * @param {Object} e - * @private - */ - onHover: function (ev) { - ev.stopPropagation(); - var em = this.em; - var el = ev.target; - var view = (0,mixins.getComponentView)(el); - var frameView = view === null || view === void 0 ? void 0 : view.frameView; - var model = view === null || view === void 0 ? void 0 : view.model; - // Get first valid model - if (!model) { - var parentEl = el.parentNode; - while (!model && parentEl && !(0,dom/* isDoc */.Mx)(parentEl)) { - model = (0,mixins.getComponentModel)(parentEl); - parentEl = parentEl.parentNode; - } - } - this.currentDoc = el.ownerDocument; - em.setHovered(model, { useValid: true }); - frameView && em.setCurrentFrame(frameView); - }, - onFrameUpdated: function () { - this.updateLocalPos(); - this.updateGlobalPos(); - }, - onHovered: function (em, component) { - var _this = this; - var _a; - var result = {}; - if (component) { - (_a = component.views) === null || _a === void 0 ? void 0 : _a.forEach(function (view) { - var el = view.el; - var pos = _this.getElementPos(el); - result = { el: el, pos: pos, component: component, view: (0,mixins.getViewEl)(el) }; - if (el.ownerDocument === _this.currentDoc) { - _this.elHovered = result; - } - _this.updateToolsLocal(result); - }); - } - else { - this.currentDoc = null; - this.elHovered = 0; - this.updateToolsLocal(); - this.canvas.getFrames().forEach(function (frame) { - var view = frame.view; - var el = view && view.getToolsEl(); - el && _this.toggleToolsEl(0, 0, { el: el }); - }); - } - }, - /** - * Say what to do after the component was selected - * @param {Object} e - * @param {Object} el - * @private - * */ - onSelect: function () { - var em = this.em; - var component = em.getSelected(); - var currentFrame = em.getCurrentFrame(); - var view = component && component.getView(currentFrame === null || currentFrame === void 0 ? void 0 : currentFrame.model); - var el = view && view.el; - var result = {}; - if (el && (0,dom/* isVisible */.pn)(el)) { - var pos = this.getElementPos(el); - result = { el: el, pos: pos, component: component, view: (0,mixins.getViewEl)(el) }; - } - this.elSelected = result; - this.updateToolsGlobal(); - // This will hide some elements from the select component - this.updateLocalPos(result); - this.initResize(component); - }, - updateGlobalPos: function () { - var sel = this.getElSelected(); - if (!sel.el) - return; - sel.pos = this.getElementPos(sel.el); - this.updateToolsGlobal(); - }, - updateLocalPos: function (data) { - var sel = this.getElHovered(); - if (!sel.el) - return; - sel.pos = this.getElementPos(sel.el); - this.updateToolsLocal(data); - }, - getElHovered: function () { - return this.elHovered || {}; - }, - getElSelected: function () { - return this.elSelected || {}; - }, - onOut: function () { - this.em.setHovered(); - }, - toggleToolsEl: function (on, view, opts) { - if (opts === void 0) { opts = {}; } - var el = opts.el || this.canvas.getToolsEl(view); - el && (el.style.display = on ? '' : 'none'); - return el || {}; - }, - /** - * Show element offset viewer - * @param {HTMLElement} el - * @param {Object} pos - */ - showElementOffset: function (el, pos, opts) { - if (opts === void 0) { opts = {}; } - if (!showOffsets) - return; - this.editor.runCommand('show-offset', { - el: el, - elPos: pos, - view: opts.view, - force: 1, - top: 0, - left: 0, - }); - }, - /** - * Hide element offset viewer - * @param {HTMLElement} el - * @param {Object} pos - */ - hideElementOffset: function (view) { - this.editor.stopCommand('show-offset', { - view: view, - }); - }, - /** - * Show fixed element offset viewer - * @param {HTMLElement} el - * @param {Object} pos - */ - showFixedElementOffset: function (el, pos) { - this.editor.runCommand('show-offset', { - el: el, - elPos: pos, - state: 'Fixed', - }); - }, - /** - * Hide fixed element offset viewer - * @param {HTMLElement} el - * @param {Object} pos - */ - hideFixedElementOffset: function () { - if (this.editor) - this.editor.stopCommand('show-offset', { state: 'Fixed' }); - }, - /** - * Hide Highlighter element - */ - hideHighlighter: function (view) { - this.canvas.getHighlighter(view).style.opacity = 0; - }, - /** - * On element click - * @param {Event} e - * @private - */ - onClick: function (ev) { - ev.stopPropagation(); - ev.preventDefault(); - var em = this.em; - if (em.get('_cmpDrag')) - return em.set('_cmpDrag'); - var el = ev.target; - var cmp = (0,mixins.getComponentModel)(el); - if (!cmp) { - var parentEl = el.parentNode; - while (!cmp && parentEl && !(0,dom/* isDoc */.Mx)(parentEl)) { - cmp = (0,mixins.getComponentModel)(parentEl); - parentEl = parentEl.parentNode; - } - } - if (cmp) { - if (em.isEditing() && - // Avoid selection of inner text components during editing - ((!cmp.get('textable') && cmp.isChildOf('text')) || - // Prevents selecting another component if the pointer was pressed and - // dragged outside of the editing component - em.getEditing() !== cmp)) { - return; - } - this.select(cmp, ev); - } - }, - /** - * Select component - * @param {Component} model - * @param {Event} event - */ - select: function (model, event) { - if (event === void 0) { event = {}; } - if (!model) - return; - this.editor.select(model, { event: event, useValid: true }); - this.initResize(model); - }, - /** - * Update badge for the component - * @param {Object} Component - * @param {Object} pos Position object - * @private - * */ - updateBadge: function (el, pos, opts) { - if (opts === void 0) { opts = {}; } - var canvas = this.canvas; - var model = (0,mixins.getComponentModel)(el); - var badge = this.getBadge(opts); - var bStyle = badge.style; - if (!model || !model.get('badgable')) { - bStyle.display = 'none'; - return; - } - if (!opts.posOnly) { - var config = this.canvas.getConfig(); - var icon = model.getIcon(); - var ppfx = config.pStylePrefix || ''; - var clsBadge = "".concat(ppfx, "badge"); - var customeLabel = config.customBadgeLabel; - var badgeLabel = "".concat(icon ? "
").concat(icon, "
") : '', "\n
").concat(model.getName(), "
"); - badge.innerHTML = customeLabel ? customeLabel(model) : badgeLabel; - } - var un = 'px'; - bStyle.display = 'block'; - var targetToElem = canvas.getTargetToElementFixed(el, badge, { - pos: pos, - }); - var top = targetToElem.top; //opts.topOff - badgeH < 0 ? -opts.topOff : posTop; - var left = opts.leftOff < 0 ? -opts.leftOff : 0; - bStyle.top = top + un; - bStyle.left = left + un; - }, - /** - * Update highlighter element - * @param {HTMLElement} el - * @param {Object} pos Position object - * @private - */ - showHighlighter: function (view) { - this.canvas.getHighlighter(view).style.opacity = ''; - }, - /** - * Init resizer on the element if possible - * @param {HTMLElement|Component} elem - * @private - */ - initResize: function (elem) { - var _a = this, em = _a.em, canvas = _a.canvas; - var editor = em.Editor; - var model = !(0,index_all.isElement)(elem) && (0,dom/* isTaggableNode */.o5)(elem) ? elem : em.getSelected(); - var resizable = model === null || model === void 0 ? void 0 : model.get('resizable'); - var spotTypeResize = CanvasSpot/* CanvasSpotBuiltInTypes */.q.Resize; - var hasCustomResize = canvas.hasCustomSpot(spotTypeResize); - canvas.removeSpots({ type: spotTypeResize }); - if (model && resizable) { - canvas.addSpot({ type: spotTypeResize, component: model }); - var el = (0,index_all.isElement)(elem) ? elem : model.getEl(); - var _b = (0,mixins.isObject)(resizable) ? resizable : {}, _c = _b.onStart, onStart_1 = _c === void 0 ? function () { } : _c, _d = _b.onMove, onMove_1 = _d === void 0 ? function () { } : _d, _e = _b.onEnd, onEnd_1 = _e === void 0 ? function () { } : _e, _f = _b.updateTarget, updateTarget_1 = _f === void 0 ? function () { } : _f, resizableOpts = __rest(_b, ["onStart", "onMove", "onEnd", "updateTarget"]); - if (hasCustomResize || !el || this.activeResizer) - return; - var modelToStyle_1; - var config = em.config; - var pfx = config.stylePrefix || ''; - var resizeClass_1 = "".concat(pfx, "resizing"); - var self_1 = this; - var resizeEventOpts_1 = { - component: model, - el: el, - }; - var toggleBodyClass_1 = function (method, e, opts) { - var docs = opts.docs; - docs && - docs.forEach(function (doc) { - var body = doc.body; - var cls = body.className || ''; - body.className = (method == 'add' ? "".concat(cls, " ").concat(resizeClass_1) : cls.replace(resizeClass_1, '')).trim(); - }); - }; - var options = SelectComponent_assign({ - // Here the resizer is updated with the current element height and width - onStart: function (ev, opts) { - onStart_1(ev, opts); - var el = opts.el, config = opts.config, resizer = opts.resizer; - var keyHeight = config.keyHeight, keyWidth = config.keyWidth, currentUnit = config.currentUnit, keepAutoHeight = config.keepAutoHeight, keepAutoWidth = config.keepAutoWidth; - toggleBodyClass_1('add', ev, opts); - modelToStyle_1 = em.Styles.getModelToStyle(model); - canvas.toggleFramesEvents(false); - var computedStyle = getComputedStyle(el); - var modelStyle = modelToStyle_1.getStyle(); - var currentWidth = modelStyle[keyWidth]; - config.autoWidth = keepAutoWidth && currentWidth === 'auto'; - if (isNaN(parseFloat(currentWidth))) { - currentWidth = computedStyle[keyWidth]; - } - var currentHeight = modelStyle[keyHeight]; - config.autoHeight = keepAutoHeight && currentHeight === 'auto'; - if (isNaN(parseFloat(currentHeight))) { - currentHeight = computedStyle[keyHeight]; - } - resizer.startDim.w = parseFloat(currentWidth); - resizer.startDim.h = parseFloat(currentHeight); - showOffsets = false; - if (currentUnit) { - config.unitHeight = (0,mixins.getUnitFromValue)(currentHeight); - config.unitWidth = (0,mixins.getUnitFromValue)(currentWidth); - } - self_1.activeResizer = true; - editor.trigger('component:resize', SelectComponent_assign(SelectComponent_assign({}, resizeEventOpts_1), { type: 'start' })); - }, - // Update all positioned elements (eg. component toolbar) - onMove: function (ev) { - onMove_1(ev); - editor.trigger('component:resize', SelectComponent_assign(SelectComponent_assign({}, resizeEventOpts_1), { type: 'move' })); - }, onEnd: function (ev, opts) { - onEnd_1(ev, opts); - toggleBodyClass_1('remove', ev, opts); - editor.trigger('component:resize', SelectComponent_assign(SelectComponent_assign({}, resizeEventOpts_1), { type: 'end' })); - canvas.toggleFramesEvents(true); - showOffsets = true; - self_1.activeResizer = false; - }, updateTarget: function (el, rect, options) { - updateTarget_1(el, rect, options); - if (!modelToStyle_1) { - return; - } - var store = options.store, selectedHandler = options.selectedHandler, config = options.config; - var keyHeight = config.keyHeight, keyWidth = config.keyWidth, autoHeight = config.autoHeight, autoWidth = config.autoWidth, unitWidth = config.unitWidth, unitHeight = config.unitHeight; - var onlyHeight = ['tc', 'bc'].indexOf(selectedHandler) >= 0; - var onlyWidth = ['cl', 'cr'].indexOf(selectedHandler) >= 0; - var style = {}; - if (!onlyHeight) { - var bodyw = canvas.getBody().offsetWidth; - var width = rect.w < bodyw ? rect.w : bodyw; - style[keyWidth] = autoWidth ? 'auto' : "".concat(width).concat(unitWidth); - } - if (!onlyWidth) { - style[keyHeight] = autoHeight ? 'auto' : "".concat(rect.h).concat(unitHeight); - } - if (em.getDragMode(model)) { - style.top = "".concat(rect.t).concat(unitHeight); - style.left = "".concat(rect.l).concat(unitWidth); - } - var finalStyle = SelectComponent_assign(SelectComponent_assign({}, style), { - // value for the partial update - __p: !store }); - modelToStyle_1.addStyle(finalStyle, { avoidStore: !store }); - em.Styles.__emitCmpStyleUpdate(finalStyle, { components: em.getSelected() }); - } }, resizableOpts); - this.resizer = editor.runCommand('resize', { el: el, options: options, force: 1 }); - } - else { - if (hasCustomResize) - return; - editor.stopCommand('resize'); - this.resizer = null; - } - }, - /** - * Update toolbar if the component has one - * @param {Object} mod - */ - updateToolbar: function (mod) { - var canvas = this.canvas; - var em = this.config.em; - var model = mod === em ? em.getSelected() : mod; - var toolbarEl = canvas.getToolbarEl(); - var toolbarStyle = toolbarEl.style; - var toolbar = model.get('toolbar'); - var showToolbar = em.config.showToolbar; - var noCustomSpotSelect = !canvas.hasCustomSpot(CanvasSpot/* CanvasSpotBuiltInTypes */.q.Select); - if (model && showToolbar && toolbar && toolbar.length && noCustomSpotSelect) { - toolbarStyle.display = ''; - if (!this.toolbar) { - toolbarEl.innerHTML = ''; - this.toolbar = new model_Toolbar(toolbar); - // @ts-ignore - var toolbarView = new view_ToolbarView({ collection: this.toolbar, em: em }); - toolbarEl.appendChild(toolbarView.render().el); - } - this.toolbar.reset(toolbar); - toolbarStyle.top = '-100px'; - toolbarStyle.left = '0'; - } - else { - toolbarStyle.display = 'none'; - } - }, - /** - * Update toolbar positions - * @param {HTMLElement} el - * @param {Object} pos - */ - updateToolbarPos: function (pos) { - var unit = 'px'; - var style = this.canvas.getToolbarEl().style; - style.top = "".concat(pos.top).concat(unit); - style.left = "".concat(pos.left).concat(unit); - style.opacity = ''; - }, - /** - * Return canvas dimensions and positions - * @return {Object} - */ - getCanvasPosition: function () { - return this.canvas.getCanvasView().getPosition(); - }, - /** - * Returns badge element - * @return {HTMLElement} - * @private - */ - getBadge: function (opts) { - if (opts === void 0) { opts = {}; } - return this.canvas.getBadgeEl(opts.view); - }, - /** - * On frame scroll callback - * @private - */ - onFrameScroll: function () { - this.updateTools(); - this.canvas.refreshSpots(); - }, - onFrameResize: function () { - this.canvas.refresh({ all: true }); - }, - updateTools: function () { - this.updateLocalPos(); - this.updateGlobalPos(); - }, - isCompSelected: function (comp) { - return comp && comp.get('status') === 'selected'; - }, - /** - * Update tools visible on hover - * @param {HTMLElement} el - * @param {Object} pos - */ - updateToolsLocal: function (data) { - var config = this.em.getConfig(); - var _a = data || this.getElHovered(), el = _a.el, pos = _a.pos, view = _a.view, component = _a.component; - if (!el) { - this.lastHovered = 0; - return; - } - var isHoverEn = component.get('hoverable'); - var isNewEl = this.lastHovered !== el; - var badgeOpts = isNewEl ? {} : { posOnly: 1 }; - var customHoverSpot = this.canvas.hasCustomSpot(CanvasSpot/* CanvasSpotBuiltInTypes */.q.Hover); - if (isNewEl && isHoverEn) { - this.lastHovered = el; - customHoverSpot ? this.hideHighlighter(view) : this.showHighlighter(view); - this.showElementOffset(el, pos, { view: view }); - } - if (this.isCompSelected(component)) { - this.hideHighlighter(view); - !config.showOffsetsSelected && this.hideElementOffset(view); - } - var unit = 'px'; - var toolsEl = this.toggleToolsEl(1, view); - var style = toolsEl.style; - var frameOff = this.canvas.canvasRectOffset(el, pos); - var topOff = frameOff.top; - var leftOff = frameOff.left; - !customHoverSpot && - this.updateBadge(el, pos, SelectComponent_assign(SelectComponent_assign({}, badgeOpts), { view: view, topOff: topOff, leftOff: leftOff })); - style.top = topOff + unit; - style.left = leftOff + unit; - style.width = pos.width + unit; - style.height = pos.height + unit; - this._trgToolUp('local', { - component: component, - el: toolsEl, - top: topOff, - left: leftOff, - width: pos.width, - height: pos.height, - }); - }, - _upToolbar: (0,index_all.debounce)(function () { - // @ts-ignore - this.updateToolsGlobal({ force: 1 }); - }, 0), - _trgToolUp: function (type, opts) { - if (opts === void 0) { opts = {}; } - this.em.trigger('canvas:tools:update', SelectComponent_assign({ type: type }, opts)); - }, - updateToolsGlobal: function (opts) { - if (opts === void 0) { opts = {}; } - var _a = this.getElSelected(), el = _a.el, pos = _a.pos, component = _a.component; - if (!el) { - this.toggleToolsEl(); // Hides toolbar - this.lastSelected = 0; - return; - } - var canvas = this.canvas; - var isNewEl = this.lastSelected !== el; - if (isNewEl || opts.force) { - this.lastSelected = el; - this.updateToolbar(component); - } - var unit = 'px'; - var toolsEl = this.toggleToolsEl(1); - var style = toolsEl.style; - var targetToElem = canvas.getTargetToElementFixed(el, canvas.getToolbarEl(), { pos: pos }); - var topOff = targetToElem.canvasOffsetTop; - var leftOff = targetToElem.canvasOffsetLeft; - style.top = topOff + unit; - style.left = leftOff + unit; - style.width = pos.width + unit; - style.height = pos.height + unit; - this.updateToolbarPos({ top: targetToElem.top, left: targetToElem.left }); - this._trgToolUp('global', { - component: component, - el: toolsEl, - top: topOff, - left: leftOff, - width: pos.width, - height: pos.height, - }); - }, - /** - * Update attached elements, eg. component toolbar - */ - updateAttached: (0,index_all.debounce)(function () { - // @ts-ignore - this.updateGlobalPos(); - }, 0), - onContainerChange: (0,index_all.debounce)(function () { - // @ts-ignore - this.em.refreshCanvas(); - }, 150), - /** - * Returns element's data info - * @param {HTMLElement} el - * @return {Object} - * @private - */ - getElementPos: function (el) { - return this.canvas.getCanvasView().getElementPos(el, { noScroll: true }); - }, - /** - * Hide badge - * @private - * */ - hideBadge: function () { - this.getBadge().style.display = 'none'; - }, - /** - * Clean previous model from different states - * @param {Component} model - * @private - */ - cleanPrevious: function (model) { - model && - model.set({ - status: '', - state: '', - }); - }, - /** - * Returns content window - * @private - */ - getContentWindow: function () { - return this.canvas.getWindow(); - }, - run: function (editor) { - if (!(0,mixins.hasWin)()) - return; - // @ts-ignore - this.editor = editor && editor.get('Editor'); - this.enable(); - }, - stop: function (ed, sender, opts) { - if (opts === void 0) { opts = {}; } - if (!(0,mixins.hasWin)()) - return; - var _a = this, em = _a.em, editor = _a.editor; - this.onHovered(); // force to hide toolbar - this.stopSelectComponent(); - !opts.preserveSelected && em.setSelected(); - this.toggleToolsEl(); - editor && editor.stopCommand('resize'); - }, -}); - - -/***/ }), - -/***/ 189: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(895); - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - /** - * Start select position event - * @param {HTMLElement} trg - * @private - * */ - startSelectPosition: function (trg, doc, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - this.isPointed = false; - var utils = this.em.Utils; - var container = trg.ownerDocument.body; - if (utils && !this.sorter) - this.sorter = new utils.Sorter({ - // @ts-ignore - container: container, - placer: this.canvas.getPlacerEl(), - containerSel: '*', - itemSel: '*', - pfx: this.ppfx, - direction: 'a', - document: doc, - wmargin: 1, - nested: 1, - em: this.em, - canvasRelative: 1, - scale: function () { return _this.em.getZoomDecimal(); }, - }); - if (opts.onStart) - this.sorter.onStart = opts.onStart; - trg && this.sorter.startSort(trg, { container: container }); - }, - /** - * Get frame position - * @return {Object} - * @private - */ - getOffsetDim: function () { - var frameOff = this.offset(this.canvas.getFrameEl()); - var canvasOff = this.offset(this.canvas.getElement()); - var top = frameOff.top - canvasOff.top; - var left = frameOff.left - canvasOff.left; - return { top: top, left: left }; - }, - /** - * Stop select position event - * @private - * */ - stopSelectPosition: function () { - this.posTargetCollection = null; - this.posIndex = this.posMethod == 'after' && this.cDim.length !== 0 ? this.posIndex + 1 : this.posIndex; //Normalize - if (this.sorter) { - this.sorter.moved = 0; - this.sorter.endMove(); - } - if (this.cDim) { - this.posIsLastEl = this.cDim.length !== 0 && this.posMethod == 'after' && this.posIndex == this.cDim.length; - this.posTargetEl = - this.cDim.length === 0 - ? (0,_common__WEBPACK_IMPORTED_MODULE_0__["default"])(this.outsideElem) - : !this.posIsLastEl && this.cDim[this.posIndex] - ? (0,_common__WEBPACK_IMPORTED_MODULE_0__["default"])(this.cDim[this.posIndex][5]).parent() - : (0,_common__WEBPACK_IMPORTED_MODULE_0__["default"])(this.outsideElem); - this.posTargetModel = this.posTargetEl.data('model'); - this.posTargetCollection = this.posTargetEl.data('model-comp'); - } - }, - /** - * Enabel select position - * @private - */ - enable: function () { - this.startSelectPosition(); - }, - /** - * Check if the pointer is near to the float component - * @param {number} index - * @param {string} method - * @param {Array} dims - * @return {Boolean} - * @private - * */ - nearFloat: function (index, method, dims) { - var i = index || 0; - var m = method || 'before'; - var len = dims.length; - var isLast = len !== 0 && m == 'after' && i == len; - if (len !== 0 && ((!isLast && !dims[i][4]) || (dims[i - 1] && !dims[i - 1][4]) || (isLast && !dims[i - 1][4]))) - return 1; - return 0; - }, - run: function () { - this.enable(); - }, - stop: function () { - this.stopSelectPosition(); - this.$wrapper.css('cursor', ''); - this.$wrapper.unbind(); - }, -}); - - -/***/ }), - -/***/ 804: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); -/* harmony import */ var _canvas_model_CanvasSpot__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(675); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(895); -var __assign = (undefined && undefined.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; - - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - getOffsetMethod: function (state) { - var method = state || ''; - return 'get' + method + 'OffsetViewerEl'; - }, - run: function (editor, sender, opts) { - var canvas = this.canvas; - var opt = opts || {}; - var state = opt.state || ''; - var config = editor.getConfig(); - var zoom = this.em.getZoomDecimal(); - var el = opt.el; - if (!config.showOffsets || !(el instanceof HTMLElement) || (!config.showOffsetsSelected && state == 'Fixed')) { - editor.stopCommand("".concat(this.id), opts); - return; - } - if (canvas.hasCustomSpot(_canvas_model_CanvasSpot__WEBPACK_IMPORTED_MODULE_1__/* .CanvasSpotBuiltInTypes */ .q.Spacing)) { - return; - } - var pos = __assign({}, (opt.elPos || canvas.getElementPos(el))); - if (!(0,underscore__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(opt.top)) { - pos.top = opt.top; - } - if (!(0,underscore__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(opt.left)) { - pos.left = opt.left; - } - var style = window.getComputedStyle(el); - var ppfx = this.ppfx; - var stateVar = state + 'State'; - var method = this.getOffsetMethod(state); - // @ts-ignore - var offsetViewer = canvas[method](opts.view); - offsetViewer.style.opacity = ''; - var marginT = this['marginT' + state]; - var marginB = this['marginB' + state]; - var marginL = this['marginL' + state]; - var marginR = this['marginR' + state]; - var padT = this['padT' + state]; - var padB = this['padB' + state]; - var padL = this['padL' + state]; - var padR = this['padR' + state]; - if (offsetViewer.childNodes.length) { - this[stateVar] = '1'; - marginT = offsetViewer.querySelector('[data-offset-m-t]'); - marginB = offsetViewer.querySelector('[data-offset-m-b]'); - marginL = offsetViewer.querySelector('[data-offset-m-l]'); - marginR = offsetViewer.querySelector('[data-offset-m-r]'); - padT = offsetViewer.querySelector('[data-offset-p-t]'); - padB = offsetViewer.querySelector('[data-offset-p-b]'); - padL = offsetViewer.querySelector('[data-offset-p-l]'); - padR = offsetViewer.querySelector('[data-offset-p-r]'); - } - if (!this[stateVar]) { - var stateLow = state.toLowerCase(); - var marginName = stateLow + 'margin-v'; - var paddingName = stateLow + 'padding-v'; - var marginV = (0,_common__WEBPACK_IMPORTED_MODULE_2__["default"])("
")).get(0); - var paddingV = (0,_common__WEBPACK_IMPORTED_MODULE_2__["default"])("
")).get(0); - var marginEls = ppfx + marginName + '-el'; - var paddingEls = ppfx + paddingName + '-el'; - var fullMargName = "".concat(marginEls, " ").concat(ppfx + marginName); - var fullPadName = "".concat(paddingEls, " ").concat(ppfx + paddingName); - marginT = (0,_common__WEBPACK_IMPORTED_MODULE_2__["default"])("
")).get(0); - marginB = (0,_common__WEBPACK_IMPORTED_MODULE_2__["default"])("
")).get(0); - marginL = (0,_common__WEBPACK_IMPORTED_MODULE_2__["default"])("
")).get(0); - marginR = (0,_common__WEBPACK_IMPORTED_MODULE_2__["default"])("
")).get(0); - padT = (0,_common__WEBPACK_IMPORTED_MODULE_2__["default"])("
")).get(0); - padB = (0,_common__WEBPACK_IMPORTED_MODULE_2__["default"])("
")).get(0); - padL = (0,_common__WEBPACK_IMPORTED_MODULE_2__["default"])("
")).get(0); - padR = (0,_common__WEBPACK_IMPORTED_MODULE_2__["default"])("
")).get(0); - this['marginT' + state] = marginT; - this['marginB' + state] = marginB; - this['marginL' + state] = marginL; - this['marginR' + state] = marginR; - this['padT' + state] = padT; - this['padB' + state] = padB; - this['padL' + state] = padL; - this['padR' + state] = padR; - marginV.appendChild(marginT); - marginV.appendChild(marginB); - marginV.appendChild(marginL); - marginV.appendChild(marginR); - paddingV.appendChild(padT); - paddingV.appendChild(padB); - paddingV.appendChild(padL); - paddingV.appendChild(padR); - offsetViewer.appendChild(marginV); - offsetViewer.appendChild(paddingV); - this[stateVar] = '1'; - } - var unit = 'px'; - var marginLeftSt = parseFloat(style.marginLeft.replace(unit, '')) * zoom; - var marginRightSt = parseFloat(style.marginRight.replace(unit, '')) * zoom; - var marginTopSt = parseFloat(style.marginTop.replace(unit, '')) * zoom; - var marginBottomSt = parseFloat(style.marginBottom.replace(unit, '')) * zoom; - var mtStyle = marginT.style; - var mbStyle = marginB.style; - var mlStyle = marginL.style; - var mrStyle = marginR.style; - var ptStyle = padT.style; - var pbStyle = padB.style; - var plStyle = padL.style; - var prStyle = padR.style; - var posLeft = parseFloat(pos.left); - var widthEl = parseFloat(style.width) * zoom + unit; - // Margin style - mtStyle.height = marginTopSt + unit; - mtStyle.width = widthEl; - mtStyle.top = pos.top - marginTopSt + unit; - mtStyle.left = posLeft + unit; - mbStyle.height = marginBottomSt + unit; - mbStyle.width = widthEl; - mbStyle.top = pos.top + pos.height + unit; - mbStyle.left = posLeft + unit; - var marginSideH = pos.height + marginTopSt + marginBottomSt + unit; - var marginSideT = pos.top - marginTopSt + unit; - mlStyle.height = marginSideH; - mlStyle.width = marginLeftSt + unit; - mlStyle.top = marginSideT; - mlStyle.left = posLeft - marginLeftSt + unit; - mrStyle.height = marginSideH; - mrStyle.width = marginRightSt + unit; - mrStyle.top = marginSideT; - mrStyle.left = posLeft + pos.width + unit; - // Padding style - var padTop = parseFloat(style.paddingTop) * zoom; - ptStyle.height = padTop + unit; - // ptStyle.width = widthEl; - // ptStyle.top = pos.top + unit; - // ptStyle.left = posLeft + unit; - var padBot = parseFloat(style.paddingBottom) * zoom; - pbStyle.height = padBot + unit; - // pbStyle.width = widthEl; - // pbStyle.top = pos.top + pos.height - padBot + unit; - // pbStyle.left = posLeft + unit; - var padSideH = pos.height - padBot - padTop + unit; - var padSideT = pos.top + padTop + unit; - plStyle.height = padSideH; - plStyle.width = parseFloat(style.paddingLeft) * zoom + unit; - plStyle.top = padSideT; - // plStyle.left = pos.left + unit; - // plStyle.right = 0; - var padRight = parseFloat(style.paddingRight) * zoom; - prStyle.height = padSideH; - prStyle.width = padRight + unit; - prStyle.top = padSideT; - // prStyle.left = pos.left + pos.width - padRight + unit; - // prStyle.left = 0; - }, - stop: function (editor, sender, opts) { - if (opts === void 0) { opts = {}; } - var opt = opts || {}; - var state = opt.state || ''; - var method = this.getOffsetMethod(state); - var view = opts.view; - var canvas = this.canvas; - // @ts-ignore - var offsetViewer = canvas[method](view); - offsetViewer.style.opacity = 0; - }, -}); - - -/***/ }), - -/***/ 434: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); -/* harmony import */ var _utils_mixins__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(163); - - -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ - init: function () { - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.bindAll)(this, '_onFramesChange'); - }, - run: function (ed) { - this.toggleVis(ed, true); - }, - stop: function (ed) { - this.toggleVis(ed, false); - }, - toggleVis: function (ed, active) { - if (active === void 0) { active = true; } - if (!ed.Commands.isActive('preview')) { - var cv = ed.Canvas; - var mth = active ? 'on' : 'off'; - var canvasModel = cv.getModel(); - canvasModel[mth]('change:frames', this._onFramesChange); - this.handleFrames(cv.getFrames(), active); - } - }, - handleFrames: function (frames, active) { - var _this = this; - frames.forEach(function (frame) { - var _a; - ((_a = frame.view) === null || _a === void 0 ? void 0 : _a.loaded) && _this._upFrame(frame, active); - if (!frame.__ol) { - frame.on('loaded', function () { return _this._upFrame(frame); }); - frame.__ol = true; - } - }); - }, - _onFramesChange: function (_, frames) { - this.handleFrames(frames); - }, - _upFrame: function (frame, active) { - var _a; - var _b = this, ppfx = _b.ppfx, em = _b.em, id = _b.id; - var isActive = (0,_utils_mixins__WEBPACK_IMPORTED_MODULE_1__.isDef)(active) ? active : em.Commands.isActive(id); - var method = isActive ? 'add' : 'remove'; - var cls = "".concat(ppfx, "dashed"); - (_a = frame.view) === null || _a === void 0 ? void 0 : _a.getBody().classList[method](cls); - }, -}); - - -/***/ }), - -/***/ 346: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ FE: () => (/* binding */ Collection), -/* harmony export */ G7: () => (/* binding */ View), -/* harmony export */ Hn: () => (/* binding */ Model), -/* harmony export */ pH: () => (/* binding */ DEFAULT_COORDS), -/* harmony export */ vA: () => (/* binding */ CoordinatesTypes) -/* harmony export */ }); -/* unused harmony export DEFAULT_BOXRECT */ -/* harmony import */ var backbone__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(316); -/* harmony import */ var backbone__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(backbone__WEBPACK_IMPORTED_MODULE_0__); -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __assign = (undefined && undefined.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; - - -var Model = /** @class */ (function (_super) { - __extends(Model, _super); - function Model() { - return _super !== null && _super.apply(this, arguments) || this; - } - return Model; -}((backbone__WEBPACK_IMPORTED_MODULE_0___default().Model))); - -var Collection = /** @class */ (function (_super) { - __extends(Collection, _super); - function Collection() { - return _super !== null && _super.apply(this, arguments) || this; - } - return Collection; -}((backbone__WEBPACK_IMPORTED_MODULE_0___default().Collection))); - -var View = /** @class */ (function (_super) { - __extends(View, _super); - function View() { - return _super !== null && _super.apply(this, arguments) || this; - } - return View; -}((backbone__WEBPACK_IMPORTED_MODULE_0___default().View))); - -var CoordinatesTypes; -(function (CoordinatesTypes) { - CoordinatesTypes["Screen"] = "screen"; - CoordinatesTypes["World"] = "world"; -})(CoordinatesTypes || (CoordinatesTypes = {})); -var DEFAULT_COORDS = { - x: 0, - y: 0, -}; -var DEFAULT_BOXRECT = __assign(__assign({}, DEFAULT_COORDS), { width: 0, height: 0 }); - - -/***/ }), - -/***/ 184: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ W: () => (/* binding */ ActionLabelComponents), -/* harmony export */ g: () => (/* binding */ ComponentsEvents) -/* harmony export */ }); -var ActionLabelComponents; -(function (ActionLabelComponents) { - ActionLabelComponents["remove"] = "component:remove"; - ActionLabelComponents["add"] = "component:add"; - ActionLabelComponents["move"] = "component:move"; -})(ActionLabelComponents || (ActionLabelComponents = {})); -var ComponentsEvents; -(function (ComponentsEvents) { - /** - * @event `component:add` New component added. - * @example - * editor.on('component:add', (component) => { ... }); - */ - ComponentsEvents["add"] = "component:add"; - /** - * @event `component:remove` Component removed. - * @example - * editor.on('component:remove', (component) => { ... }); - */ - ComponentsEvents["remove"] = "component:remove"; - ComponentsEvents["removeBefore"] = "component:remove:before"; - /** - * @event `component:create` Component created. - * @example - * editor.on('component:create', (component) => { ... }); - */ - ComponentsEvents["create"] = "component:create"; - /** - * @event `component:update` Component is updated, the component is passed as an argument to the callback. - * @example - * editor.on('component:update', (component) => { ... }); - */ - ComponentsEvents["update"] = "component:update"; - ComponentsEvents["updateInside"] = "component:update-inside"; - /** - * @event `symbol:main:add` Added new main symbol. - * @example - * editor.on('symbol:main:add', ({ component }) => { ... }); - */ - ComponentsEvents["symbolMainAdd"] = "symbol:main:add"; - /** - * @event `symbol:main:update` Main symbol updated. - * @example - * editor.on('symbol:main:update', ({ component }) => { ... }); - */ - ComponentsEvents["symbolMainUpdate"] = "symbol:main:update"; - ComponentsEvents["symbolMainUpdateDeep"] = "symbol:main:update-deep"; - /** - * @event `symbol:main:remove` Main symbol removed. - * @example - * editor.on('symbol:main:remove', ({ component }) => { ... }); - */ - ComponentsEvents["symbolMainRemove"] = "symbol:main:remove"; - /** - * @event `symbol:main` Catch-all event related to main symbol updates. - * @example - * editor.on('symbol:main', ({ event, component }) => { ... }); - */ - ComponentsEvents["symbolMain"] = "symbol:main"; - /** - * @event `symbol:instance:add` Added new root instance symbol. - * @example - * editor.on('symbol:instance:add', ({ component }) => { ... }); - */ - ComponentsEvents["symbolInstanceAdd"] = "symbol:instance:add"; - /** - * @event `symbol:instance:remove` Root instance symbol removed. - * @example - * editor.on('symbol:instance:remove', ({ component }) => { ... }); - */ - ComponentsEvents["symbolInstanceRemove"] = "symbol:instance:remove"; - /** - * @event `symbol:instance` Catch-all event related to instance symbol updates. - * @example - * editor.on('symbol:instance', ({ event, component }) => { ... }); - */ - ComponentsEvents["symbolInstance"] = "symbol:instance"; - /** - * @event `symbol` Catch-all event for any symbol update (main or instance). - * @example - * editor.on('symbol', () => { ... }); - */ - ComponentsEvents["symbol"] = "symbol"; -})(ComponentsEvents || (ComponentsEvents = {})); - - -/***/ }), - -/***/ 330: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); -/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(346); -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var DomainViews = /** @class */ (function (_super) { - __extends(DomainViews, _super); - function DomainViews(opts, config, autoAdd) { - if (opts === void 0) { opts = {}; } - if (autoAdd === void 0) { autoAdd = false; } - var _this = _super.call(this, opts) || this; - // Defines the View per type - _this.itemsView = ''; - _this.itemType = 'type'; - _this.reuseView = false; - _this.config = config || opts.config || {}; - autoAdd && _this.listenTo(_this.collection, 'add', _this.addTo); - _this.items = []; - return _this; - } - /** - * Add new model to the collection - * @param {Model} model - * @private - * */ - DomainViews.prototype.addTo = function (model) { - this.add(model); - }; - DomainViews.prototype.itemViewNotFound = function (type) { - var _a = this, config = _a.config, ns = _a.ns; - var em = config.em; - var warn = "".concat(ns ? "[".concat(ns, "]: ") : '', "'").concat(type, "' type not found"); - em && em.logWarning(warn); - }; - /** - * Render new model inside the view - * @param {Model} model - * @param {Object} fragment Fragment collection - * @private - * */ - DomainViews.prototype.add = function (model, fragment) { - var _a = this, config = _a.config, reuseView = _a.reuseView, items = _a.items; - var itemsView = (this.itemsView || {}); - var inputTypes = [ - 'button', - 'checkbox', - 'color', - 'date', - 'datetime-local', - 'email', - 'file', - 'hidden', - 'image', - 'month', - 'number', - 'password', - 'radio', - 'range', - 'reset', - 'search', - 'submit', - 'tel', - 'text', - 'time', - 'url', - 'week', - ]; - var frag = fragment || null; - var itemView = this.itemView; - var typeField = model.get(this.itemType); - var view; - if (itemsView[typeField]) { - itemView = itemsView[typeField]; - } - else if (typeField && !itemsView[typeField] && !(0,underscore__WEBPACK_IMPORTED_MODULE_0__.includes)(inputTypes, typeField)) { - this.itemViewNotFound(typeField); - } - if (model.view && reuseView) { - view = model.view; - } - else { - view = new itemView({ model: model, config: config }, config); - } - items && items.push(view); - var rendered = view.render().el; - if (frag) - frag.appendChild(rendered); - else - this.$el.append(rendered); - }; - DomainViews.prototype.render = function () { - var frag = document.createDocumentFragment(); - this.clearItems(); - this.$el.empty(); - if (this.collection.length) - this.collection.each(function (model) { - // @ts-ignore - this.add(model, frag); - }, this); - this.$el.append(frag); - this.onRender(); - return this; - }; - DomainViews.prototype.onRender = function () { }; - DomainViews.prototype.onRemoveBefore = function (items, opts) { }; - DomainViews.prototype.onRemove = function (items, opts) { }; - DomainViews.prototype.remove = function (opts) { - if (opts === void 0) { opts = {}; } - var items = this.items; - this.onRemoveBefore(items, opts); - this.clearItems(); - _super.prototype.remove.call(this); - this.onRemove(items, opts); - return this; - }; - DomainViews.prototype.clearItems = function () { - var items = this.items || []; - // TODO Traits do not update the target anymore - // items.forEach(item => item.remove()); - // this.items = []; - }; - return DomainViews; -}(_common__WEBPACK_IMPORTED_MODULE_1__/* .View */ .G7)); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DomainViews); -// Default view -DomainViews.prototype.itemView = ''; - - -/***/ }), - -/***/ 668: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Z: () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); -/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(491); -var __assign = (undefined && undefined.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; - - -var resetPos = function () { return ({ x: 0, y: 0 }); }; -var xyArr = ['x', 'y']; -var Dragger = /** @class */ (function () { - /** - * Init the dragger - * @param {Object} opts - */ - function Dragger(opts) { - if (opts === void 0) { opts = {}; } - this.opts = { - snapOffset: 5, - scale: 1, - }; - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.bindAll)(this, 'drag', 'stop', 'keyHandle', 'handleScroll'); - this.setOptions(opts); - this.delta = resetPos(); - this.lastScroll = resetPos(); - this.lastScrollDiff = resetPos(); - this.startPointer = resetPos(); - this.startPosition = resetPos(); - this.globScrollDiff = resetPos(); - this.currentPointer = resetPos(); - this.position = resetPos(); - this.guidesStatic = []; - this.guidesTarget = []; - this.docs = []; - return this; - } - /** - * Update options - * @param {Object} options - */ - Dragger.prototype.setOptions = function (opts) { - if (opts === void 0) { opts = {}; } - this.opts = __assign(__assign({}, this.opts), opts); - }; - Dragger.prototype.toggleDrag = function (enable) { - var docs = this.getDocumentEl(); - var container = this.getContainerEl(); - var win = this.getWindowEl(); - var method = enable ? 'on' : 'off'; - var methods = { on: _dom__WEBPACK_IMPORTED_MODULE_1__.on, off: _dom__WEBPACK_IMPORTED_MODULE_1__/* .off */ .S1 }; - methods[method](container, 'mousemove dragover', this.drag); - methods[method](docs, 'mouseup dragend touchend', this.stop); - methods[method](docs, 'keydown', this.keyHandle); - methods[method](win, 'scroll', this.handleScroll); - }; - Dragger.prototype.handleScroll = function () { - var _a = this, lastScroll = _a.lastScroll, delta = _a.delta; - var actualScroll = this.getScrollInfo(); - var scrollDiff = { - x: actualScroll.x - lastScroll.x, - y: actualScroll.y - lastScroll.y, - }; - this.move(delta.x + scrollDiff.x, delta.y + scrollDiff.y); - this.lastScrollDiff = scrollDiff; - }; - /** - * Start dragging - * @param {Event} e - */ - Dragger.prototype.start = function (ev) { - var opts = this.opts; - var onStart = opts.onStart; - this.toggleDrag(true); - this.startPointer = this.getPointerPos(ev); - this.guidesStatic = (0,underscore__WEBPACK_IMPORTED_MODULE_0__.result)(opts, 'guidesStatic') || []; - this.guidesTarget = (0,underscore__WEBPACK_IMPORTED_MODULE_0__.result)(opts, 'guidesTarget') || []; - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.isFunction)(onStart) && onStart(ev, this); - this.startPosition = this.getStartPosition(); - this.lastScrollDiff = resetPos(); - this.globScrollDiff = resetPos(); - this.drag(ev); - }; - /** - * Drag event - * @param {Event} event - */ - Dragger.prototype.drag = function (ev) { - var _this = this; - var _a = this, opts = _a.opts, lastScrollDiff = _a.lastScrollDiff, globScrollDiff = _a.globScrollDiff; - var onDrag = opts.onDrag; - var startPointer = this.startPointer; - var currentPos = this.getPointerPos(ev); - var glDiff = { - x: globScrollDiff.x + lastScrollDiff.x, - y: globScrollDiff.y + lastScrollDiff.y, - }; - this.globScrollDiff = glDiff; - var delta = { - x: currentPos.x - startPointer.x + glDiff.x, - y: currentPos.y - startPointer.y + glDiff.y, - }; - this.lastScrollDiff = resetPos(); - var lockedAxis = this.lockedAxis; - // @ts-ignore Lock one axis - if (ev.shiftKey) { - lockedAxis = !lockedAxis && this.detectAxisLock(delta.x, delta.y); - } - else { - lockedAxis = null; - } - if (lockedAxis === 'x') { - delta.x = startPointer.x; - } - else if (lockedAxis === 'y') { - delta.y = startPointer.y; - } - var moveDelta = function (delta) { - xyArr.forEach(function (co) { return (delta[co] = delta[co] * (0,underscore__WEBPACK_IMPORTED_MODULE_0__.result)(opts, 'scale')); }); - _this.delta = delta; - _this.move(delta.x, delta.y); - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.isFunction)(onDrag) && onDrag(ev, _this); - }; - var deltaPre = __assign({}, delta); - this.currentPointer = currentPos; - this.lockedAxis = lockedAxis; - this.lastScroll = this.getScrollInfo(); - moveDelta(delta); - if (this.guidesTarget.length) { - var _b = this.snapGuides(deltaPre), newDelta = _b.newDelta, trgX = _b.trgX, trgY = _b.trgY; - (trgX || trgY) && moveDelta(newDelta); - } - // @ts-ignore In case the mouse button was released outside of the window - ev.which === 0 && this.stop(ev); - }; - /** - * Check if the delta hits some guide - */ - Dragger.prototype.snapGuides = function (delta) { - var _this = this; - var newDelta = delta; - var _a = this, trgX = _a.trgX, trgY = _a.trgY; - this.guidesTarget.forEach(function (trg) { - // Skip the guide if its locked axis already exists - if ((trg.x && _this.trgX) || (trg.y && _this.trgY)) - return; - trg.active = false; - _this.guidesStatic.forEach(function (stat) { - if ((trg.y && stat.x) || (trg.x && stat.y)) - return; - var isY = trg.y && stat.y; - var axs = isY ? 'y' : 'x'; - var trgPoint = trg[axs]; - var statPoint = stat[axs]; - var deltaPoint = delta[axs]; - var trgGuide = isY ? trgY : trgX; - if (_this.isPointIn(trgPoint, statPoint)) { - if ((0,underscore__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(trgGuide)) { - var trgValue = deltaPoint - (trgPoint - statPoint); - _this.setGuideLock(trg, trgValue); - } - } - }); - }); - trgX = this.trgX; - trgY = this.trgY; - xyArr.forEach(function (co) { - var axis = co.toUpperCase(); - // @ts-ignore - var trg = _this["trg".concat(axis)]; - if (trg && !_this.isPointIn(delta[co], trg.lock)) { - _this.setGuideLock(trg, null); - trg = null; - } - if (trg && !(0,underscore__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(trg.lock)) { - newDelta[co] = trg.lock; - } - }); - return { - newDelta: newDelta, - trgX: this.trgX, - trgY: this.trgY, - }; - }; - Dragger.prototype.isPointIn = function (src, trg, _a) { - var _b = _a === void 0 ? {} : _a, offset = _b.offset; - var ofst = offset || this.opts.snapOffset || 0; - return (src >= trg && src <= trg + ofst) || (src <= trg && src >= trg - ofst); - }; - Dragger.prototype.setGuideLock = function (guide, value) { - var axis = !(0,underscore__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(guide.x) ? 'X' : 'Y'; - var trgName = "trg".concat(axis); - if (value !== null) { - guide.active = true; - guide.lock = value; - // @ts-ignore - this[trgName] = guide; - } - else { - delete guide.active; - delete guide.lock; - // @ts-ignore - delete this[trgName]; - } - return guide; - }; - /** - * Stop dragging - */ - Dragger.prototype.stop = function (ev, opts) { - if (opts === void 0) { opts = {}; } - var delta = this.delta; - var cancelled = !!opts.cancel; - var x = cancelled ? 0 : delta.x; - var y = cancelled ? 0 : delta.y; - this.toggleDrag(); - this.lockedAxis = null; - this.move(x, y, true); - var onEnd = this.opts.onEnd; - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.isFunction)(onEnd) && onEnd(ev, this, { cancelled: cancelled }); - }; - Dragger.prototype.keyHandle = function (ev) { - if ((0,_dom__WEBPACK_IMPORTED_MODULE_1__/* .isEscKey */ .kl)(ev)) { - this.stop(ev, { cancel: true }); - } - }; - /** - * Move the element - * @param {integer} x - * @param {integer} y - */ - Dragger.prototype.move = function (x, y, end) { - var _a = this, el = _a.el, opts = _a.opts; - var pos = this.startPosition; - if (!pos) - return; - var setPosition = opts.setPosition; - var xPos = pos.x + x; - var yPos = pos.y + y; - this.position = { - x: xPos, - y: yPos, - end: end, - }; - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.isFunction)(setPosition) && setPosition(this.position); - if (el) { - el.style.left = "".concat(xPos, "px"); - el.style.top = "".concat(yPos, "px"); - } - }; - Dragger.prototype.getContainerEl = function () { - var container = this.opts.container; - return container ? [container] : this.getDocumentEl(); - }; - Dragger.prototype.getWindowEl = function () { - var cont = this.getContainerEl(); - return cont.map(function (item) { - var doc = item.ownerDocument || item; - // @ts-ignore - return doc.defaultView || doc.parentWindow; - }); - }; - /** - * Returns documents - */ - Dragger.prototype.getDocumentEl = function (el) { - var doc = this.opts.doc; - el = el || this.el; - if (!this.docs.length) { - var docs = [document]; - el && docs.push(el.ownerDocument); - doc && docs.push(doc); - this.docs = docs; - } - return this.docs; - }; - /** - * Get mouse coordinates - * @param {Event} event - * @return {Object} - */ - Dragger.prototype.getPointerPos = function (ev) { - var getPos = this.opts.getPointerPosition; - var pEv = (0,_dom__WEBPACK_IMPORTED_MODULE_1__/* .getPointerEvent */ .VB)(ev); - return getPos - ? getPos(ev) - : { - x: pEv.clientX, - y: pEv.clientY, - }; - }; - Dragger.prototype.getStartPosition = function () { - var _a = this, el = _a.el, opts = _a.opts; - var getPos = opts.getPosition; - var result = resetPos(); - if ((0,underscore__WEBPACK_IMPORTED_MODULE_0__.isFunction)(getPos)) { - result = getPos(); - } - else if (el) { - result = { - x: parseFloat(el.style.left), - y: parseFloat(el.style.top), - }; - } - return result; - }; - Dragger.prototype.getScrollInfo = function () { - var doc = this.opts.doc; - var body = doc && doc.body; - return { - y: body ? body.scrollTop : 0, - x: body ? body.scrollLeft : 0, - }; - }; - Dragger.prototype.detectAxisLock = function (x, y) { - var relX = x; - var relY = y; - var absX = Math.abs(relX); - var absY = Math.abs(relY); - // Vertical or Horizontal lock - if (relY >= absX || relY <= -absX) { - return 'x'; - } - else if (relX > absY || relX < -absY) { - return 'y'; - } - }; - return Dragger; -}()); -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Dragger); - - -/***/ }), - -/***/ 895: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) -/* harmony export */ }); -// @ts-nocheck -/* Adapted for headless */ -/* MIT https://github.com/kenwheeler/cash */ - -var doc = typeof document !== 'undefined' ? document : null, win = typeof window !== 'undefined' ? window : null, _Array$prototype = Array.prototype, filter = _Array$prototype.filter, indexOf = _Array$prototype.indexOf, map = _Array$prototype.map, push = _Array$prototype.push, reverse = _Array$prototype.reverse, slice = _Array$prototype.slice, splice = _Array$prototype.splice; -var idRe = /^#[\w-]*$/, classRe = /^\.[\w-]*$/, htmlRe = /<.+>/, tagRe = /^\w+$/; // @require ./variables.js -function find(selector, context) { - if (context === void 0) { - context = doc; - } - return classRe.test(selector) - ? context.getElementsByClassName(selector.slice(1)) - : tagRe.test(selector) - ? context.getElementsByTagName(selector) - : context.querySelectorAll(selector); -} // @require ./find.js -// @require ./variables.js -function Cash(selector, context) { - if (context === void 0) { - context = doc; - } - if (!selector) - return; - if (selector.__cash) - return selector; - var eles = selector; - if (isString(selector)) { - if (context.__cash) - context = context[0]; - eles = idRe.test(selector) - ? context.getElementById(selector.slice(1)) - : htmlRe.test(selector) - ? parseHTML(selector) - : find(selector, context); - if (!eles) - return; - } - else if (isFunction(selector)) { - return this.ready(selector); //FIXME: `fn.ready` is not included in `core`, but it's actually a core functionality - } - if (eles.nodeType || eles === win) - eles = [eles]; - this.length = eles.length; - for (var i = 0, l = this.length; i < l; i++) { - this[i] = eles[i]; - } -} -function cash(selector, context) { - return new Cash(selector, context); -} -/* PROTOTYPE */ -var fn = (cash.fn = - cash.prototype = - Cash.prototype = - { - constructor: cash, - __cash: true, - length: 0, - splice: splice, // Ensures a cash collection gets printed as array-like in Chrome - }); // @require core/cash.js -// @require core/variables.js -fn.get = function (index) { - if (index === undefined) - return slice.call(this); - return this[index < 0 ? index + this.length : index]; -}; // @require core/cash.js -// @require ./get.js -fn.eq = function (index) { - return cash(this.get(index)); -}; // @require core/cash.js -// @require ./eq.js -fn.first = function () { - return this.eq(0); -}; // @require core/cash.js -// @require ./eq.js -fn.last = function () { - return this.eq(-1); -}; // @require core/cash.js -// @require core/variables.js -fn.map = function (callback) { - return cash(map.call(this, function (ele, i) { - return callback.call(ele, i, ele); - })); -}; // @require core/cash.js -// @require core/variables.js -fn.slice = function () { - return cash(slice.apply(this, arguments)); -}; // @require ./cash.js -var camelCaseRe = /(?:^\w|[A-Z]|\b\w)/g, camelCaseWhitespaceRe = /[\s-_]+/g; -function camelCase(str) { - return str - .replace(camelCaseRe, function (letter, index) { - return letter[!index ? 'toLowerCase' : 'toUpperCase'](); - }) - .replace(camelCaseWhitespaceRe, ''); -} -cash.camelCase = camelCase; // @require ./cash.js -function each(arr, callback) { - for (var i = 0, l = arr.length; i < l; i++) { - if (callback.call(arr[i], arr[i], i, arr) === false) - break; - } -} -cash.each = each; // @require core/cash.js -// @require core/each.js -fn.each = function (callback) { - each(this, function (ele, i) { - return callback.call(ele, i, ele); - }); - return this; -}; // @require core/cash.js -// @require collection/each.js -fn.removeProp = function (prop) { - return this.each(function (i, ele) { - delete ele[prop]; - }); -}; // @require ./cash.js -function extend(target) { - if (target === void 0) { - target = this; - } - var args = arguments, length = args.length; - for (var i = length < 2 ? 0 : 1; i < length; i++) { - for (var key in args[i]) { - target[key] = args[i][key]; - } - } - return target; -} -cash.extend = fn.extend = extend; // @require ./cash.js -var guid = 1; -cash.guid = guid; // @require ./cash.js -function matches(ele, selector) { - var matches = ele && - (ele.matches || - ele.webkitMatchesSelector || - ele.mozMatchesSelector || - ele.msMatchesSelector || - ele.oMatchesSelector); - return !!matches && matches.call(ele, selector); -} -cash.matches = matches; // @require ./cash.js -function isFunction(x) { - return typeof x === 'function'; -} -cash.isFunction = isFunction; -function isString(x) { - return typeof x === 'string'; -} -cash.isString = isString; -function isNumeric(x) { - return !isNaN(parseFloat(x)) && isFinite(x); -} -cash.isNumeric = isNumeric; -var isArray = Array.isArray; -cash.isArray = isArray; // @require core/cash.js -// @require core/type_checking.js -// @require collection/each.js -fn.prop = function (prop, value) { - if (!prop) - return; - if (isString(prop)) { - if (arguments.length < 2) - return this[0] && this[0][prop]; - return this.each(function (i, ele) { - ele[prop] = value; - }); - } - for (var key in prop) { - this.prop(key, prop[key]); - } - return this; -}; // @require ./matches.js -// @require ./type_checking.js -function getCompareFunction(selector) { - return isString(selector) - ? function (i, ele) { - return matches(ele, selector); - } - : selector.__cash - ? function (i, ele) { - return selector.is(ele); - } - : function (i, ele, selector) { - return ele === selector; - }; -} // @require core/cash.js -// @require core/get_compare_function.js -// @require core/type_checking.js -// @require core/variables.js -// @require collection/get.js -fn.filter = function (selector) { - if (!selector) - return cash(); - var comparator = isFunction(selector) ? selector : getCompareFunction(selector); - return cash(filter.call(this, function (ele, i) { - return comparator.call(ele, i, ele, selector); - })); -}; // @require ./type_checking.js -var splitValuesRe = /\S+/g; -function getSplitValues(str) { - return isString(str) ? str.match(splitValuesRe) || [] : []; -} // @require core/cash.js -// @require core/get_split_values.js -// @require collection/each.js -fn.hasClass = function (cls) { - var classes = getSplitValues(cls); - var check = false; - if (classes.length) { - this.each(function (i, ele) { - check = ele.classList.contains(classes[0]); - return !check; - }); - } - return check; -}; // @require core/cash.js -// @require core/get_split_values.js -// @require collection/each.js -fn.removeAttr = function (attr) { - var attrs = getSplitValues(attr); - if (!attrs.length) - return this; - return this.each(function (i, ele) { - each(attrs, function (a) { - ele.removeAttribute(a); - }); - }); -}; // @require core/cash.js -// @require core/type_checking.js -// @require collection/each.js -// @require ./remove_attr.js -fn.attr = function (attr, value) { - if (!attr) - return; - if (isString(attr)) { - if (arguments.length < 2) { - if (!this[0]) - return; - var _value = this[0].getAttribute(attr); - return _value === null ? undefined : _value; - } - if (value === null) - return this.removeAttr(attr); - return this.each(function (i, ele) { - ele.setAttribute(attr, value); - }); - } - for (var key in attr) { - this.attr(key, attr[key]); - } - return this; -}; // @require core/cash.js -// @require core/each.js -// @require core/get_split_values.js -// @require collection/each.js -fn.toggleClass = function (cls, force) { - var classes = getSplitValues(cls), isForce = force !== undefined; - if (!classes.length) - return this; - return this.each(function (i, ele) { - each(classes, function (c) { - if (isForce) { - force ? ele.classList.add(c) : ele.classList.remove(c); - } - else { - ele.classList.toggle(c); - } - }); - }); -}; // @require core/cash.js -// @require ./toggle_class.js -fn.addClass = function (cls) { - return this.toggleClass(cls, true); -}; // @require core/cash.js -// @require ./attr.js -// @require ./toggle_class.js -fn.removeClass = function (cls) { - return !arguments.length ? this.attr('class', '') : this.toggleClass(cls, false); -}; // @optional ./add_class.js -// @optional ./attr.js -// @optional ./has_class.js -// @optional ./prop.js -// @optional ./remove_attr.js -// @optional ./remove_class.js -// @optional ./remove_prop.js -// @optional ./toggle_class.js -// @require ./cash.js -function unique(arr) { - return arr.filter(function (item, index, self) { - return self.indexOf(item) === index; - }); -} -cash.unique = unique; // @require core/cash.js -// @require core/unique.js -// @require ./get.js -fn.add = function (selector, context) { - return cash(unique(this.get().concat(cash(selector, context).get()))); -}; // @require core/variables.js -function computeStyle(ele, prop, isVariable) { - if (ele.nodeType !== 1) - return; - var style = win.getComputedStyle(ele, null); - return prop ? (isVariable ? style.getPropertyValue(prop) : style[prop]) : style; -} // @require ./compute_style.js -function computeStyleInt(ele, prop) { - return parseInt(computeStyle(ele, prop), 10) || 0; -} -var cssVariableRe = /^--/; // @require ./variables.js -function isCSSVariable(prop) { - return cssVariableRe.test(prop); -} // @require core/camel_case.js -// @require core/cash.js -// @require core/each.js -// @require core/variables.js -// @require ./is_css_variable.js -var prefixedProps = {}, docEl = doc && doc.createElement('div'), style = docEl ? docEl.style : {}, vendorsPrefixes = ['webkit', 'moz', 'ms', 'o']; -function getPrefixedProp(prop, isVariable) { - if (isVariable === void 0) { - isVariable = isCSSVariable(prop); - } - if (isVariable) - return prop; - if (!prefixedProps[prop]) { - var propCC = camelCase(prop), propUC = '' + propCC.charAt(0).toUpperCase() + propCC.slice(1), props = (propCC + ' ' + vendorsPrefixes.join(propUC + ' ') + propUC).split(' '); - each(props, function (p) { - if (p in style) { - prefixedProps[prop] = p; - return false; - } - }); - } - return prefixedProps[prop]; -} -cash.prefixedProp = getPrefixedProp; // @require core/type_checking.js -// @require ./is_css_variable.js -var numericProps = { - animationIterationCount: true, - columnCount: true, - flexGrow: true, - flexShrink: true, - fontWeight: true, - lineHeight: true, - opacity: true, - order: true, - orphans: true, - widows: true, - zIndex: true, -}; -function getSuffixedValue(prop, value, isVariable) { - if (isVariable === void 0) { - isVariable = isCSSVariable(prop); - } - return !isVariable && !numericProps[prop] && isNumeric(value) ? value + 'px' : value; -} // @require core/cash.js -// @require core/type_checking.js -// @require collection/each.js -// @require ./helpers/compute_style.js -// @require ./helpers/get_prefixed_prop.js -// @require ./helpers/get_suffixed_value.js -// @require ./helpers/is_css_variable.js -fn.css = function (prop, value) { - if (isString(prop)) { - var isVariable = isCSSVariable(prop); - prop = getPrefixedProp(prop, isVariable); - if (arguments.length < 2) - return this[0] && computeStyle(this[0], prop, isVariable); - if (!prop) - return this; - value = getSuffixedValue(prop, value, isVariable); - return this.each(function (i, ele) { - if (ele.nodeType !== 1) - return; - if (isVariable) { - ele.style.setProperty(prop, value); - } - else { - ele.style[prop] = value; - } - }); - } - for (var key in prop) { - this.css(key, prop[key]); - } - return this; -}; // @optional ./css.js -var dataNamespace = '__cashData', dataAttributeRe = /^data-(.*)/; // @require core/cash.js -// @require ./helpers/variables.js -cash.hasData = function (ele) { - return dataNamespace in ele; -}; // @require ./variables.js -function getDataCache(ele) { - return (ele[dataNamespace] = ele[dataNamespace] || {}); -} // @require attributes/attr.js -// @require ./get_data_cache.js -function getData(ele, key) { - var cache = getDataCache(ele); - if (key) { - if (!(key in cache)) { - var value = ele.dataset ? ele.dataset[key] || ele.dataset[camelCase(key)] : cash(ele).attr('data-' + key); - if (value !== undefined) { - try { - value = JSON.parse(value); - } - catch (e) { } - cache[key] = value; - } - } - return cache[key]; - } - return cache; -} // @require ./variables.js -// @require ./get_data_cache.js -function removeData(ele, key) { - if (key === undefined) { - delete ele[dataNamespace]; - } - else { - delete getDataCache(ele)[key]; - } -} // @require ./get_data_cache.js -function setData(ele, key, value) { - getDataCache(ele)[key] = value; -} // @require core/cash.js -// @require core/type_checking.js -// @require collection/each.js -// @require ./helpers/get_data.js -// @require ./helpers/set_data.js -// @require ./helpers/variables.js -fn.data = function (name, value) { - var _this = this; - if (!name) { - if (!this[0]) - return; - each(this[0].attributes, function (attr) { - var match = attr.name.match(dataAttributeRe); - if (!match) - return; - _this.data(match[1]); - }); - return getData(this[0]); - } - if (isString(name)) { - if (value === undefined) - return this[0] && getData(this[0], name); - return this.each(function (i, ele) { - return setData(ele, name, value); - }); - } - for (var key in name) { - this.data(key, name[key]); - } - return this; -}; // @require core/cash.js -// @require collection/each.js -// @require ./helpers/remove_data.js -fn.removeData = function (key) { - return this.each(function (i, ele) { - return removeData(ele, key); - }); -}; // @optional ./data.js -// @optional ./remove_data.js -// @require css/helpers/compute_style_int.js -function getExtraSpace(ele, xAxis) { - return (computeStyleInt(ele, 'border' + (xAxis ? 'Left' : 'Top') + 'Width') + - computeStyleInt(ele, 'padding' + (xAxis ? 'Left' : 'Top')) + - computeStyleInt(ele, 'padding' + (xAxis ? 'Right' : 'Bottom')) + - computeStyleInt(ele, 'border' + (xAxis ? 'Right' : 'Bottom') + 'Width')); -} // @require core/cash.js -// @require core/each.js -// @require core/variables.js -each(['Width', 'Height'], function (prop) { - fn['inner' + prop] = function () { - if (!this[0]) - return; - if (this[0] === win) - return win['inner' + prop]; - return this[0]['client' + prop]; - }; -}); // @require core/camel_case.js -// @require core/cash.js -// @require core/each.js -// @require core/variables.js -// @require css/helpers/compute_style.js -// @require css/helpers/get_suffixed_value.js -// @require ./helpers/get_extra_space.js -each(['width', 'height'], function (prop, index) { - fn[prop] = function (value) { - if (!this[0]) - return value === undefined ? undefined : this; - if (!arguments.length) { - if (this[0] === win) - return this[0][camelCase('outer-' + prop)]; - return this[0].getBoundingClientRect()[prop] - getExtraSpace(this[0], !index); - } - value = parseInt(value, 10); - return this.each(function (i, ele) { - if (ele.nodeType !== 1) - return; - var boxSizing = computeStyle(ele, 'boxSizing'); - ele.style[prop] = getSuffixedValue(prop, value + (boxSizing === 'border-box' ? getExtraSpace(ele, !index) : 0)); - }); - }; -}); // @require core/cash.js -// @require core/each.js -// @require core/variables.js -// @require css/helpers/compute_style_int.js -each(['Width', 'Height'], function (prop, index) { - fn['outer' + prop] = function (includeMargins) { - if (!this[0]) - return; - if (this[0] === win) - return win['outer' + prop]; - return (this[0]['offset' + prop] + - (includeMargins - ? computeStyleInt(this[0], 'margin' + (!index ? 'Left' : 'Top')) + - computeStyleInt(this[0], 'margin' + (!index ? 'Right' : 'Bottom')) - : 0)); - }; -}); // @optional ./inner.js -// @optional ./normal.js -// @optional ./outer.js -function hasNamespaces(ns1, ns2) { - for (var i = 0, l = ns2.length; i < l; i++) { - if (ns1.indexOf(ns2[i]) < 0) - return false; - } - return true; -} // @require core/each.js -function removeEventListeners(cache, ele, name) { - each(cache[name], function (_ref) { - var namespaces = _ref[0], callback = _ref[1]; - ele.removeEventListener(name, callback); - }); - delete cache[name]; -} -var eventsNamespace = '__cashEvents', eventsNamespacesSeparator = '.'; // @require ./variables.js -function getEventsCache(ele) { - return (ele[eventsNamespace] = ele[eventsNamespace] || {}); -} // @require core/guid.js -// @require events/helpers/get_events_cache.js -function addEvent(ele, name, namespaces, callback) { - callback.guid = callback.guid || guid++; - var eventCache = getEventsCache(ele); - eventCache[name] = eventCache[name] || []; - eventCache[name].push([namespaces, callback]); - ele.addEventListener(name, callback); -} // @require ./variables.js -function parseEventName(eventName) { - var parts = eventName.split(eventsNamespacesSeparator); - return [parts[0], parts.slice(1).sort()]; // [name, namespaces] -} // @require core/guid.js -// @require ./get_events_cache.js -// @require ./has_namespaces.js -// @require ./parse_event_name.js -// @require ./remove_event_listeners.js -function removeEvent(ele, name, namespaces, callback) { - var cache = getEventsCache(ele); - if (!name) { - if (!namespaces || !namespaces.length) { - for (name in cache) { - removeEventListeners(cache, ele, name); - } - } - else { - for (name in cache) { - removeEvent(ele, name, namespaces, callback); - } - } - } - else { - var eventCache = cache[name]; - if (!eventCache) - return; - if (callback) - callback.guid = callback.guid || guid++; - cache[name] = eventCache.filter(function (_ref2) { - var ns = _ref2[0], cb = _ref2[1]; - if ((callback && cb.guid !== callback.guid) || !hasNamespaces(ns, namespaces)) - return true; - ele.removeEventListener(name, cb); - }); - } -} // @require core/cash.js -// @require core/each.js -// @require collection/each.js -// @require ./helpers/parse_event_name.js -// @require ./helpers/remove_event.js -fn.off = function (eventFullName, callback) { - var _this2 = this; - if (eventFullName === undefined) { - this.each(function (i, ele) { - return removeEvent(ele); - }); - } - else { - each(getSplitValues(eventFullName), function (eventFullName) { - var _parseEventName = parseEventName(eventFullName), name = _parseEventName[0], namespaces = _parseEventName[1]; - _this2.each(function (i, ele) { - return removeEvent(ele, name, namespaces, callback); - }); - }); - } - return this; -}; // @require core/cash.js -// @require core/get_split_values.js -// @require core/guid.js -// @require core/matches.js -// @require core/type_checking.js -// @require collection/each.js -// @require ./helpers/variables.js -// @require ./helpers/add_event.js -// @require ./helpers/has_namespaces.js -// @require ./helpers/parse_event_name.js -// @require ./helpers/remove_event.js -fn.on = function (eventFullName, selector, callback, _one) { - var _this3 = this; - if (!isString(eventFullName)) { - for (var key in eventFullName) { - this.on(key, selector, eventFullName[key]); - } - return this; - } - if (isFunction(selector)) { - callback = selector; - selector = false; - } - each(getSplitValues(eventFullName), function (eventFullName) { - var _parseEventName2 = parseEventName(eventFullName), name = _parseEventName2[0], namespaces = _parseEventName2[1]; - _this3.each(function (i, ele) { - var finalCallback = function finalCallback(event) { - if (event.namespace && !hasNamespaces(namespaces, event.namespace.split(eventsNamespacesSeparator))) - return; - var thisArg = ele; - if (selector) { - var target = event.target; - while (!matches(target, selector)) { - if (target === ele) - return; - target = target.parentNode; - if (!target) - return; - } - thisArg = target; - } - event.namespace = event.namespace || ''; - var returnValue = callback.call(thisArg, event, event.data); - if (_one) { - removeEvent(ele, name, namespaces, finalCallback); - } - if (returnValue === false) { - event.preventDefault(); - event.stopPropagation(); - } - }; - finalCallback.guid = callback.guid = callback.guid || guid++; - addEvent(ele, name, namespaces, finalCallback); - }); - }); - return this; -}; // @require core/cash.js -// @require ./on.js -fn.one = function (eventFullName, delegate, callback) { - return this.on(eventFullName, delegate, callback, true); -}; // @require core/cash.js -// @require core/variables.js -fn.ready = function (callback) { - var finalCallback = function finalCallback() { - return callback(cash); - }; - if (doc.readyState !== 'loading') { - setTimeout(finalCallback); - } - else { - doc.addEventListener('DOMContentLoaded', finalCallback); - } - return this; -}; // @require core/cash.js -// @require core/type_checking.js -// @require core/variables.js -// @require collection/each.js -// @require ./helpers/parse_event_name.js -// @require ./helpers/variables.js -fn.trigger = function (eventFullName, data) { - var evt = eventFullName; - if (isString(eventFullName)) { - var _parseEventName3 = parseEventName(eventFullName), name = _parseEventName3[0], namespaces = _parseEventName3[1]; - evt = doc.createEvent('HTMLEvents'); - evt.initEvent(name, true, true); - evt.namespace = namespaces.join(eventsNamespacesSeparator); - } - evt.data = data; - return this.each(function (i, ele) { - ele.dispatchEvent(evt); - }); -}; // @optional ./off.js -// @optional ./on.js -// @optional ./one.js -// @optional ./ready.js -// @optional ./trigger.js -// @require core/each.js -function getValueSelectMultiple(ele) { - var values = []; - each(ele.options, function (option) { - if (option.selected && !option.disabled && !option.parentNode.disabled) { - values.push(option.value); - } - }); - return values; -} -function getValueSelectSingle(ele) { - return ele.selectedIndex < 0 ? null : ele.options[ele.selectedIndex].value; -} // @require ./get_value_select_single.js -// @require ./get_value_select_multiple.js -var selectOneRe = /select-one/i, selectMultipleRe = /select-multiple/i; -function getValue(ele) { - var type = ele.type; - if (selectOneRe.test(type)) - return getValueSelectSingle(ele); - if (selectMultipleRe.test(type)) - return getValueSelectMultiple(ele); - return ele.value; -} -var queryEncodeSpaceRe = /%20/g; -function queryEncode(prop, value) { - return '&' + encodeURIComponent(prop) + '=' + encodeURIComponent(value).replace(queryEncodeSpaceRe, '+'); -} // @require core/cash.js -// @require core/each.js -// @require core/type_checking.js -// @require ./helpers/get_value.js -// @require ./helpers/query_encode.js -var skippableRe = /file|reset|submit|button|image/i, checkableRe = /radio|checkbox/i; -fn.serialize = function () { - var query = ''; - this.each(function (i, ele) { - each(ele.elements || [ele], function (ele) { - if (ele.disabled || !ele.name || ele.tagName === 'FIELDSET') - return; - if (skippableRe.test(ele.type)) - return; - if (checkableRe.test(ele.type) && !ele.checked) - return; - var value = getValue(ele); - if (value === undefined) - return; - var values = isArray(value) ? value : [value]; - each(values, function (value) { - query += queryEncode(ele.name, value); - }); - }); - }); - return query.substr(1); -}; // @require core/cash.js -// @require core/each.js -// @require core/type_checking.js -// @require collection/each.js -// @require ./helpers/get_value.js -fn.val = function (value) { - if (value === undefined) - return this[0] && getValue(this[0]); - return this.each(function (i, ele) { - var isMultiple = selectMultipleRe.test(ele.type), eleValue = value === null ? (isMultiple ? [] : '') : value; - if (isMultiple && isArray(eleValue)) { - each(ele.options, function (option) { - option.selected = eleValue.indexOf(option.value) >= 0; - }); - } - else { - ele.value = eleValue; - } - }); -}; // @optional ./serialize.js -// @optional ./val.js -// @require core/cash.js -// @require collection/map.js -fn.clone = function () { - return this.map(function (i, ele) { - return ele.cloneNode(true); - }); -}; // @require core/cash.js -// @require collection/each.js -fn.detach = function () { - return this.each(function (i, ele) { - if (ele.parentNode) { - ele.parentNode.removeChild(ele); - } - }); -}; // @require ./cash.js -// @require ./variables.js -// @require ./type_checking.js -// @require collection/get.js -// @require manipulation/detach.js -var fragmentRe = /^\s*<(\w+)[^>]*>/, singleTagRe = /^\s*<(\w+)\s*\/?>(?:<\/\1>)?\s*$/; -var containers; -function initContainers() { - if (containers) - return; - var table = doc.createElement('table'), tr = doc.createElement('tr'); - containers = { - '*': doc.createElement('div'), - tr: doc.createElement('tbody'), - td: tr, - th: tr, - thead: table, - tbody: table, - tfoot: table, - }; -} -function parseHTML(html) { - initContainers(); - if (!isString(html)) - return []; - if (singleTagRe.test(html)) - return [doc.createElement(RegExp.$1)]; - var fragment = fragmentRe.test(html) && RegExp.$1, container = containers[fragment] || containers['*']; - container.innerHTML = html; - return cash(container.childNodes).detach().get(); -} -cash.parseHTML = parseHTML; // @optional ./camel_case.js -// @optional ./each.js -// @optional ./export.js -// @optional ./extend.js -// @optional ./find.js -// @optional ./get_compare_function.js -// @optional ./get_split_values.js -// @optional ./guid.js -// @optional ./matches.js -// @optional ./parse_html.js -// @optional ./unique.js -// @optional ./variables.js -// @require ./cash.js -// @require ./type_checking.js -// @require core/cash.js -fn.empty = function () { - var ele = this[0]; - if (ele) { - while (ele.firstChild) { - ele.removeChild(ele.firstChild); - } - } - return this; -}; -function insertElement(ele, child, prepend) { - if (prepend) { - ele.insertBefore(child, ele.childNodes[0]); - } - else { - ele.appendChild(child); - } -} // @require core/each.js -// @require core/type_checking.js -// @require ./insert_element.js -function insertContent(parent, child, prepend) { - if (child === undefined) - return; - var isStr = isString(child); - if (!isStr && child.length) { - each(child, function (ele) { - return insertContent(parent, ele, prepend); - }); - } - else { - each(parent, isStr - ? function (ele) { - ele.insertAdjacentHTML(prepend ? 'afterbegin' : 'beforeend', child); - } - : function (ele, index) { - return insertElement(ele, !index ? child : child.cloneNode(true), prepend); - }); - } -} // @require core/cash.js -// @require core/each.js -// @require ./helpers/insert_content.js -fn.append = function () { - var _this4 = this; - each(arguments, function (content) { - insertContent(_this4, content); - }); - return this; -}; // @require core/cash.js -// @require ./helpers/insert_content.js -fn.appendTo = function (parent) { - insertContent(cash(parent), this); - return this; -}; // @require core/cash.js -// @require collection/each.js -fn.html = function (content) { - if (content === undefined) - return this[0] && this[0].innerHTML; - var source = content.nodeType ? content[0].outerHTML : content; - return this.each(function (i, ele) { - ele.innerHTML = source; - }); -}; // @require core/cash.js -// @require collection/each.js -fn.insertAfter = function (content) { - var _this5 = this; - cash(content).each(function (index, ele) { - var parent = ele.parentNode; - _this5.each(function (i, e) { - parent.insertBefore(!index ? e : e.cloneNode(true), ele.nextSibling); - }); - }); - return this; -}; // @require core/cash.js -// @require core/each.js -// @require core/variables.js -// @require collection/slice.js -// @require ./insert_after.js -fn.after = function () { - var _this6 = this; - each(reverse.apply(arguments), function (content) { - reverse.apply(cash(content).slice()).insertAfter(_this6); - }); - return this; -}; // @require core/cash.js -// @require collection/each.js -fn.insertBefore = function (selector) { - var _this7 = this; - cash(selector).each(function (index, ele) { - var parent = ele.parentNode; - _this7.each(function (i, e) { - parent.insertBefore(!index ? e : e.cloneNode(true), ele); - }); - }); - return this; -}; // @require core/cash.js -// @require core/each.js -// @require ./insert_before.js -fn.before = function () { - var _this8 = this; - each(arguments, function (content) { - cash(content).insertBefore(_this8); - }); - return this; -}; // @require core/cash.js -// @require core/each.js -// @require ./helpers/insert_content.js -fn.prepend = function () { - var _this9 = this; - each(arguments, function (content) { - insertContent(_this9, content, true); - }); - return this; -}; // @require core/cash.js -// @require core/variables.js -// @require collection/slice.js -// @require ./helpers/insert_content.js -fn.prependTo = function (parent) { - insertContent(cash(parent), reverse.apply(this.slice()), true); - return this; -}; // @require core/cash.js -// @require events/off.js -// @require ./detach.js -fn.remove = function () { - return this.detach().off(); -}; // @require core/cash.js -// @require collection/each.js -// @require collection/slice.js -// @require ./after.js -// @require ./remove.js -fn.replaceWith = function (content) { - var _this10 = this; - return this.each(function (i, ele) { - var parent = ele.parentNode; - if (!parent) - return; - var $eles = i ? cash(content).clone() : cash(content); - if (!$eles[0]) { - _this10.remove(); - return false; - } - parent.replaceChild($eles[0], ele); - cash($eles[0]).after($eles.slice(1)); - }); -}; // @require core/cash.js -// @require ./replace_with.js -fn.replaceAll = function (content) { - cash(content).replaceWith(this); - return this; -}; // @require core/cash.js -// @require collection/each.js -fn.text = function (content) { - if (content === undefined) - return this[0] ? this[0].textContent : ''; - return this.each(function (i, ele) { - ele.textContent = content; - }); -}; // @optional ./after.js -// @optional ./append.js -// @optional ./append_to.js -// @optional ./before.js -// @optional ./clone.js -// @optional ./detach.js -// @optional ./empty.js -// @optional ./html.js -// @optional ./insert_after.js -// @optional ./insert_before.js -// @optional ./prepend.js -// @optional ./prepend_to.js -// @optional ./remove.js -// @optional ./replace_all.js -// @optional ./replace_with.js -// @optional ./text.js -// @require core/cash.js -// @require core/variables.js -var docEle = doc && doc.documentElement; -fn.offset = function () { - var ele = this[0]; - if (!ele) - return; - var rect = ele.getBoundingClientRect(); - return { - top: rect.top + win.pageYOffset - docEle.clientTop, - left: rect.left + win.pageXOffset - docEle.clientLeft, - }; -}; // @require core/cash.js -fn.offsetParent = function () { - return cash(this[0] && this[0].offsetParent); -}; // @require core/cash.js -fn.position = function () { - var ele = this[0]; - if (!ele) - return; - return { - left: ele.offsetLeft, - top: ele.offsetTop, - }; -}; // @optional ./offset.js -// @optional ./offset_parent.js -// @optional ./position.js -// @require core/cash.js -// @require core/matches.js -// @require core/unique.js -// @require collection/each.js -// @require collection/filter.js -fn.children = function (selector) { - var result = []; - this.each(function (i, ele) { - push.apply(result, ele.children); - }); - result = cash(unique(result)); - if (!selector) - return result; - return result.filter(function (i, ele) { - return matches(ele, selector); - }); -}; // @require core/cash.js -// @require core/unique.js -// @require collection/each.js -fn.contents = function () { - var result = []; - this.each(function (i, ele) { - push.apply(result, ele.tagName === 'IFRAME' ? [ele.contentDocument] : ele.childNodes); - }); - return cash(result.length && unique(result)); -}; // @require core/cash.js -// @require core/unique.js -// @require core/find.js -// @require core/variables.js -fn.find = function (selector) { - var result = []; - for (var i = 0, l = this.length; i < l; i++) { - var found = find(selector, this[i]); - if (found.length) { - push.apply(result, found); - } - } - return cash(result.length && unique(result)); -}; // @require core/cash.js -// @require core/find.js -// @require core/type_checking.js -// @require collection/filter.js -fn.has = function (selector) { - var comparator = isString(selector) - ? function (i, ele) { - return !!find(selector, ele).length; - } - : function (i, ele) { - return ele.contains(selector); - }; - return this.filter(comparator); -}; // @require core/cash.js -// @require core/get_compare_function.js -// @require collection/each.js -fn.is = function (selector) { - if (!selector || !this[0]) - return false; - var comparator = getCompareFunction(selector); - var check = false; - this.each(function (i, ele) { - check = comparator(i, ele, selector); - return !check; - }); - return check; -}; // @require core/cash.js -fn.next = function () { - return cash(this[0] && this[0].nextElementSibling); -}; // @require core/cash.js -// @require core/get_compare_function.js -// @require collection/filter.js -fn.not = function (selector) { - if (!selector || !this[0]) - return this; - var comparator = getCompareFunction(selector); - return this.filter(function (i, ele) { - return !comparator(i, ele, selector); - }); -}; // @require core/cash.js -// @require core/unique.js -// @require collection/each.js -fn.parent = function () { - var result = []; - this.each(function (i, ele) { - if (ele && ele.parentNode) { - result.push(ele.parentNode); - } - }); - return cash(unique(result)); -}; // @require core/cash.js -// @require core/variables.js -// @require traversal/children.js -// @require traversal/parent.js -// @require ./get.js -//FIXME Ugly file name, is there a better option? -fn.index = function (ele) { - var child = ele ? cash(ele)[0] : this[0], collection = ele ? this : cash(child).parent().children(); - return indexOf.call(collection, child); -}; // @optional ./add.js -// @optional ./each.js -// @optional ./eq.js -// @optional ./filter.js -// @optional ./first.js -// @optional ./get.js -// @optional ./indexFn.js -// @optional ./last.js -// @optional ./map.js -// @optional ./slice.js -// @require core/cash.js -// @require collection/filter.js -// @require ./is.js -// @require ./parent.js -fn.closest = function (selector) { - if (!selector || !this[0]) - return cash(); - if (this.is(selector)) - return this.filter(selector); - return this.parent().closest(selector); -}; // @require core/cash.js -// @require core/matches.js -// @require core/unique.js -// @require core/variables.js -// @require collection/each.js -fn.parents = function (selector) { - var result = []; - var last; - this.each(function (i, ele) { - last = ele; - while (last && last.parentNode && last !== doc.body.parentNode) { - last = last.parentNode; - if (!selector || (selector && matches(last, selector))) { - result.push(last); - } - } - }); - return cash(unique(result)); -}; // @require core/cash.js -fn.prev = function () { - return cash(this[0] && this[0].previousElementSibling); -}; // @require core/cash.js -// @require collection/filter.js -// @require ./children.js -// @require ./parent.js -fn.siblings = function () { - var ele = this[0]; - return this.parent() - .children() - .filter(function (i, child) { - return child !== ele; - }); -}; // @optional ./children.js -// @optional ./closest.js -// @optional ./contents.js -// @optional ./find.js -// @optional ./has.js -// @optional ./is.js -// @optional ./next.js -// @optional ./not.js -// @optional ./parent.js -// @optional ./parents.js -// @optional ./prev.js -// @optional ./siblings.js -// @optional attributes/index.js -// @optional collection/index.js -// @optional css/index.js -// @optional data/index.js -// @optional dimensions/index.js -// @optional events/index.js -// @optional forms/index.js -// @optional manipulation/index.js -// @optional offset/index.js -// @optional traversal/index.js -// @require core/index.js -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cash); - - -/***/ }), - -/***/ 491: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ $Q: () => (/* binding */ appendAtIndex), -/* harmony export */ BM: () => (/* binding */ isTextNode), -/* harmony export */ FW: () => (/* binding */ attrUp), -/* harmony export */ G1: () => (/* binding */ motionsEv), -/* harmony export */ GX: () => (/* binding */ getDocumentScroll), -/* harmony export */ L_: () => (/* binding */ removeEl), -/* harmony export */ Mx: () => (/* binding */ isDoc), -/* harmony export */ R3: () => (/* binding */ append), -/* harmony export */ S1: () => (/* binding */ off), -/* harmony export */ SJ: () => (/* binding */ appendVNodes), -/* harmony export */ Ut: () => (/* binding */ getElRect), -/* harmony export */ VB: () => (/* binding */ getPointerEvent), -/* harmony export */ Vb: () => (/* binding */ hasModifierKey), -/* harmony export */ cx: () => (/* binding */ cx), -/* harmony export */ dL: () => (/* binding */ replaceWith), -/* harmony export */ hy: () => (/* binding */ doctypeToString), -/* harmony export */ kl: () => (/* binding */ isEscKey), -/* harmony export */ nB: () => (/* binding */ attrToString), -/* harmony export */ o5: () => (/* binding */ isTaggableNode), -/* harmony export */ on: () => (/* binding */ on), -/* harmony export */ pn: () => (/* binding */ isVisible), -/* harmony export */ r$: () => (/* binding */ isEnterKey), -/* harmony export */ rw: () => (/* binding */ createText), -/* harmony export */ sE: () => (/* binding */ find), -/* harmony export */ sN: () => (/* binding */ getKeyChar), -/* harmony export */ t3: () => (/* binding */ createCustomEvent), -/* harmony export */ ut: () => (/* binding */ createEl) -/* harmony export */ }); -/* unused harmony exports empty, isCommentNode, getKeyCode, hasCtrlKey */ -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); -var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - -var KEY_TAG = 'tag'; -var KEY_ATTR = 'attributes'; -var KEY_CHILD = 'children'; -var motionsEv = 'transitionend oTransitionEnd transitionend webkitTransitionEnd'; -var isDoc = function (el) { return (el === null || el === void 0 ? void 0 : el.nodeType) === Node.DOCUMENT_NODE; }; -var removeEl = function (el) { - var parent = el && el.parentNode; - parent && parent.removeChild(el); -}; -function cx() { - var inputs = []; - for (var _i = 0; _i < arguments.length; _i++) { - inputs[_i] = arguments[_i]; - } - var inp = Array.isArray(inputs[0]) ? inputs[0] : __spreadArray([], inputs, true); - return inp.filter(Boolean).join(' '); -} -var find = function (el, query) { return el.querySelectorAll(query); }; -var attrUp = function (el, attrs) { - if (attrs === void 0) { attrs = {}; } - return el && el.setAttribute && (0,underscore__WEBPACK_IMPORTED_MODULE_0__.each)(attrs, function (value, key) { return el.setAttribute(key, value); }); -}; -var isVisible = function (el) { - var _a; - return el && !!(el.offsetWidth || el.offsetHeight || ((_a = el.getClientRects) === null || _a === void 0 ? void 0 : _a.call(el).length)); -}; -var empty = function (node) { - while (node.firstChild) - node.removeChild(node.firstChild); -}; -var replaceWith = function (oldEl, newEl) { - var _a; - (_a = oldEl.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(newEl, oldEl); -}; -var appendAtIndex = function (parent, child, index) { - var childNodes = parent.childNodes; - var total = childNodes.length; - var at = (0,underscore__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(index) ? total : index; - if ((0,underscore__WEBPACK_IMPORTED_MODULE_0__.isString)(child)) { - // @ts-ignore - parent.insertAdjacentHTML('beforeEnd', child); - child = parent.lastChild; - parent.removeChild(child); - } - if (at >= total) { - parent.appendChild(child); - } - else { - parent.insertBefore(child, childNodes[at]); - } -}; -var append = function (parent, child) { return appendAtIndex(parent, child); }; -var createEl = function (tag, attrs, child) { - if (attrs === void 0) { attrs = {}; } - var el = document.createElement(tag); - attrs && (0,underscore__WEBPACK_IMPORTED_MODULE_0__.each)(attrs, function (value, key) { return el.setAttribute(key, value); }); - if (child) { - if ((0,underscore__WEBPACK_IMPORTED_MODULE_0__.isString)(child)) - el.innerHTML = child; - else - el.appendChild(child); - } - return el; -}; -var createText = function (str) { return document.createTextNode(str); }; -// Unfortunately just creating `KeyboardEvent(e.type, e)` is not enough, -// the keyCode/which will be always `0`. Even if it's an old/deprecated -// property keymaster (and many others) still use it... using `defineProperty` -// hack seems the only way -var createCustomEvent = function (e, cls) { - var oEvent; - var type = e.type; - try { - // @ts-ignore - oEvent = new window[cls](type, e); - } - catch (err) { - oEvent = document.createEvent(cls); - oEvent.initEvent(type, true, true); - } - oEvent._parentEvent = e; - if (type.indexOf('key') === 0) { - oEvent.keyCodeVal = e.keyCode; - ['keyCode', 'which'].forEach(function (prop) { - Object.defineProperty(oEvent, prop, { - get: function () { - return this.keyCodeVal; - }, - }); - }); - } - return oEvent; -}; -/** - * Append an array of vNodes to an element - * @param {HTMLElement} node HTML element - * @param {Array} vNodes Array of node objects - */ -var appendVNodes = function (node, vNodes) { - if (vNodes === void 0) { vNodes = []; } - var vNodesArr = Array.isArray(vNodes) ? vNodes : [vNodes]; - vNodesArr.forEach(function (vnode) { - var tag = vnode[KEY_TAG] || 'div'; - var attr = vnode[KEY_ATTR] || {}; - var el = document.createElement(tag); - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.each)(attr, function (value, key) { - el.setAttribute(key, value); - }); - node.appendChild(el); - }); -}; -/** - * Check if element is a text node - * @param {Node} el - * @return {Boolean} - */ -var isTextNode = function (el) { return (el === null || el === void 0 ? void 0 : el.nodeType) === Node.TEXT_NODE; }; -/** - * Check if element is a comment node - * @param {Node} el - * @return {Boolean} - */ -var isCommentNode = function (el) { return (el === null || el === void 0 ? void 0 : el.nodeType) === Node.COMMENT_NODE; }; -/** - * Check if taggable node - * @param {Node} el - * @return {Boolean} - */ -var isTaggableNode = function (el) { return el && !isTextNode(el) && !isCommentNode(el); }; -/** - * Get DOMRect of the element. - * @param el - * @returns {DOMRect} - */ -var getElRect = function (el) { - var def = { - top: 0, - left: 0, - width: 0, - height: 0, - }; - if (!el) - return def; - var rectText; - if (isTextNode(el)) { - var range = document.createRange(); - range.selectNode(el); - rectText = range.getBoundingClientRect(); - range.detach(); - } - return rectText || (el.getBoundingClientRect ? el.getBoundingClientRect() : def); -}; -/** - * Get document scroll coordinates - */ -var getDocumentScroll = function (el) { - var doc = (el === null || el === void 0 ? void 0 : el.ownerDocument) || document; - var docEl = doc.documentElement; - var win = doc.defaultView || window; - return { - x: (win.pageXOffset || docEl.scrollLeft || 0) - (docEl.clientLeft || 0), - y: (win.pageYOffset || docEl.scrollTop || 0) - (docEl.clientTop || 0), - }; -}; -var getKeyCode = function (ev) { return ev.which || ev.keyCode; }; -var getKeyChar = function (ev) { return String.fromCharCode(getKeyCode(ev)); }; -var getPointerEvent = function (ev) { return (ev.touches && ev.touches[0] ? ev.touches[0] : ev); }; -var isEscKey = function (ev) { return getKeyCode(ev) === 27; }; -var isEnterKey = function (ev) { return getKeyCode(ev) === 13; }; -var hasCtrlKey = function (ev) { return ev.ctrlKey; }; -var hasModifierKey = function (ev) { return hasCtrlKey(ev) || ev.metaKey; }; -// Ref: https://stackoverflow.com/a/10162353 -var doctypeToString = function (dt) { - if (!dt) - return ''; - var name = dt.name, publicId = dt.publicId, systemId = dt.systemId; - var pubId = publicId ? " PUBLIC \"".concat(publicId, "\"") : ''; - var sysId = !publicId && systemId ? " SYSTEM \"".concat(systemId, "\"") : ''; - return ""); -}; -var attrToString = function (attrs) { - if (attrs === void 0) { attrs = {}; } - var res = []; - (0,underscore__WEBPACK_IMPORTED_MODULE_0__.each)(attrs, function (value, key) { return res.push("".concat(key, "=\"").concat(value, "\"")); }); - return res.join(' '); -}; -var on = function (el, ev, fn, opts) { - var evs = ev.split(/\s+/); - var els = (0,underscore__WEBPACK_IMPORTED_MODULE_0__.isArray)(el) ? el : [el]; - evs.forEach(function (ev) { - els.forEach(function (el) { return el === null || el === void 0 ? void 0 : el.addEventListener(ev, fn, opts); }); - }); -}; -var off = function (el, ev, fn, opts) { - var evs = ev.split(/\s+/); - var els = (0,underscore__WEBPACK_IMPORTED_MODULE_0__.isArray)(el) ? el : [el]; - evs.forEach(function (ev) { - els.forEach(function (el) { return el === null || el === void 0 ? void 0 : el.removeEventListener(ev, fn, opts); }); - }); -}; - - -/***/ }), - -/***/ 163: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ appendStyles: () => (/* binding */ appendStyles), -/* harmony export */ buildBase64UrlFromSvg: () => (/* binding */ buildBase64UrlFromSvg), -/* harmony export */ camelCase: () => (/* binding */ camelCase), -/* harmony export */ capitalize: () => (/* binding */ capitalize), -/* harmony export */ createId: () => (/* binding */ createId), -/* harmony export */ deepMerge: () => (/* binding */ deepMerge), -/* harmony export */ escape: () => (/* binding */ escape), -/* harmony export */ escapeNodeContent: () => (/* binding */ escapeNodeContent), -/* harmony export */ find: () => (/* binding */ find), -/* harmony export */ getComponentModel: () => (/* binding */ getComponentModel), -/* harmony export */ getComponentView: () => (/* binding */ getComponentView), -/* harmony export */ getElement: () => (/* binding */ getElement), -/* harmony export */ getGlobal: () => (/* binding */ getGlobal), -/* harmony export */ getModel: () => (/* binding */ getModel), -/* harmony export */ getUiClass: () => (/* binding */ getUiClass), -/* harmony export */ getUnitFromValue: () => (/* binding */ getUnitFromValue), -/* harmony export */ getViewEl: () => (/* binding */ getViewEl), -/* harmony export */ hasDnd: () => (/* binding */ hasDnd), -/* harmony export */ hasWin: () => (/* binding */ hasWin), -/* harmony export */ isBultInMethod: () => (/* binding */ isBultInMethod), -/* harmony export */ isComponent: () => (/* binding */ isComponent), -/* harmony export */ isDef: () => (/* binding */ isDef), -/* harmony export */ isEmptyObj: () => (/* binding */ isEmptyObj), -/* harmony export */ isObject: () => (/* binding */ isObject), -/* harmony export */ isRule: () => (/* binding */ isRule), -/* harmony export */ matches: () => (/* binding */ matches), -/* harmony export */ normalizeFloat: () => (/* binding */ normalizeFloat), -/* harmony export */ normalizeKey: () => (/* binding */ normalizeKey), -/* harmony export */ setViewEl: () => (/* binding */ setViewEl), -/* harmony export */ shallowDiff: () => (/* binding */ shallowDiff), -/* harmony export */ toLowerCase: () => (/* binding */ toLowerCase), -/* harmony export */ upFirst: () => (/* binding */ upFirst), -/* harmony export */ wait: () => (/* binding */ wait) -/* harmony export */ }); -/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(50); -/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(491); -var __assign = (undefined && undefined.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - - -var obj = {}; -var isBultInMethod = function (key) { return (0,underscore__WEBPACK_IMPORTED_MODULE_0__.isFunction)(obj[key]); }; -var normalizeKey = function (key) { return (isBultInMethod(key) ? "_".concat(key) : key); }; -var wait = function (mls) { - if (mls === void 0) { mls = 0; } - return new Promise(function (res) { return setTimeout(res, mls); }); -}; -var isDef = function (value) { return typeof value !== 'undefined'; }; -var hasWin = function () { return typeof window !== 'undefined'; }; -var getGlobal = function () { - return typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : __webpack_require__.g; -}; -var toLowerCase = function (str) { return (str || '').toLowerCase(); }; -var elProt = hasWin() ? window.Element.prototype : {}; -// @ts-ignore -var matches = elProt.matches || elProt.webkitMatchesSelector || elProt.mozMatchesSelector || elProt.msMatchesSelector; -var getUiClass = function (em, defCls) { - var _a = em.getConfig(), stylePrefix = _a.stylePrefix, customUI = _a.customUI; - return [customUI && "".concat(stylePrefix, "cui"), defCls].filter(function (i) { return i; }).join(' '); -}; -/** - * Import styles asynchronously - * @param {String|Array} styles - */ -var appendStyles = function (styles, opts) { - if (opts === void 0) { opts = {}; } - var stls = (0,underscore__WEBPACK_IMPORTED_MODULE_0__.isArray)(styles) ? __spreadArray([], styles, true) : [styles]; - if (stls.length) { - var href = stls.shift(); - if (href && (!opts.unique || !document.querySelector("link[href=\"".concat(href, "\"]")))) { - var head = document.head; - var link = document.createElement('link'); - link.href = href; - link.rel = 'stylesheet'; - if (opts.prepand) { - head.insertBefore(link, head.firstChild); - } - else { - head.appendChild(link); - } - } - appendStyles(stls); - } -}; -/** - * Returns shallow diff between 2 objects - * @param {Object} objOrig - * @param {Objec} objNew - * @return {Object} - * @example - * var a = {foo: 'bar', baz: 1, faz: 'sop'}; - * var b = {foo: 'bar', baz: 2, bar: ''}; - * shallowDiff(a, b); - * // -> {baz: 2, faz: null, bar: ''}; - */ -var shallowDiff = function (objOrig, objNew) { - var result = {}; - var keysNew = (0,underscore__WEBPACK_IMPORTED_MODULE_0__.keys)(objNew); - for (var prop in objOrig) { - if (objOrig.hasOwnProperty(prop)) { - var origValue = objOrig[prop]; - var newValue = objNew[prop]; - if (keysNew.indexOf(prop) >= 0) { - if (origValue !== newValue) { - result[prop] = newValue; - } - } - else { - result[prop] = null; - } - } - } - for (var prop in objNew) { - if (objNew.hasOwnProperty(prop)) { - if ((0,underscore__WEBPACK_IMPORTED_MODULE_0__.isUndefined)(objOrig[prop])) { - result[prop] = objNew[prop]; - } - } - } - return result; -}; -var getUnitFromValue = function (value) { - return value.replace(parseFloat(value), ''); -}; -var upFirst = function (value) { return value[0].toUpperCase() + value.toLowerCase().slice(1); }; -var camelCase = function (value) { - return value.replace(/-./g, function (x) { return x[1].toUpperCase(); }); -}; -var normalizeFloat = function (value, step, valueDef) { - if (step === void 0) { step = 1; } - if (valueDef === void 0) { valueDef = 0; } - var stepDecimals = 0; - if (isNaN(value)) - return valueDef; - value = parseFloat(value); - if (Math.floor(value) !== value) { - var side = step.toString().split('.')[1]; - stepDecimals = side ? side.length : 0; - } - return stepDecimals ? parseFloat(value.toFixed(stepDecimals)) : value; -}; -var hasDnd = function (em) { - return 'draggable' in document.createElement('i') && (em ? em.config.nativeDnD : true); -}; -/** - * Ensure to fetch the element from the input argument - * @param {HTMLElement|Component} el Component or HTML element - * @return {HTMLElement} - */ -var getElement = function (el) { - if ((0,underscore__WEBPACK_IMPORTED_MODULE_0__.isElement)(el) || (0,_dom__WEBPACK_IMPORTED_MODULE_1__/* .isTextNode */ .BM)(el)) { - return el; - // @ts-ignore - } - else if (el && el.getEl) { - // @ts-ignore - return el.getEl(); - } -}; -var find = function (arr, test) { - var result = null; - arr.some(function (el, i) { return (test(el, i, arr) ? ((result = el), 1) : 0); }); - return result; -}; -var escape = function (str) { - if (str === void 0) { str = ''; } - return "".concat(str) - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(/`/g, '`'); -}; -var escapeNodeContent = function (str) { - if (str === void 0) { str = ''; } - return "".concat(str).replace(/&/g, '&').replace(//g, '>'); -}; -var deepMerge = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var target = __assign({}, args[0]); - for (var i = 1; i < args.length; i++) { - var source = __assign({}, args[i]); - for (var key in source) { - var targValue = target[key]; - var srcValue = source[key]; - if (isObject(targValue) && isObject(srcValue)) { - target[key] = deepMerge(targValue, srcValue); - } - else { - target[key] = srcValue; - } - } - } - return target; -}; -/** - * Ensure to fetch the model from the input argument - * @param {HTMLElement|Component} el Component or HTML element - * @return {Component} - */ -var getModel = function (el, $) { - var model; - if (!$ && el && el.__cashData) { - model = el.__cashData.model; - } - else if ($ && (0,underscore__WEBPACK_IMPORTED_MODULE_0__.isElement)(el)) { - model = $(el).data('model'); - } - return model; -}; -var isObject = function (val) { return val && !Array.isArray(val) && typeof val === 'object'; }; -var isEmptyObj = function (val) { return Object.keys(val).length <= 0; }; -var capitalize = function (str) { - if (str === void 0) { str = ''; } - return str && str.charAt(0).toUpperCase() + str.substring(1); -}; -var isRule = function (obj) { return obj && obj.toCSS; }; -var getViewEl = function (el) { return el === null || el === void 0 ? void 0 : el.__gjsv; }; -var isComponent = function (obj) { return !!(obj === null || obj === void 0 ? void 0 : obj.toHTML); }; -var getComponentView = function (el) { return getViewEl(el); }; -var getComponentModel = function (el) { var _a; return (_a = getComponentView(el)) === null || _a === void 0 ? void 0 : _a.model; }; -var setViewEl = function (el, view) { - el.__gjsv = view; -}; -var createId = function (length) { - if (length === void 0) { length = 16; } - var result = ''; - var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; - var len = chars.length; - for (var i = 0; i < length; i++) { - result += chars.charAt(Math.floor(Math.random() * len)); - } - return result; -}; -var buildBase64UrlFromSvg = function (svg) { - if (svg && svg.substr(0, 4) === ' { - -var map = { - "./CanvasClear": 858, - "./CanvasClear.ts": 858, - "./CanvasMove": 884, - "./CanvasMove.ts": 884, - "./CommandAbstract": 790, - "./CommandAbstract.ts": 790, - "./ComponentDelete": 180, - "./ComponentDelete.ts": 180, - "./ComponentDrag": 544, - "./ComponentDrag.ts": 544, - "./ComponentEnter": 236, - "./ComponentEnter.ts": 236, - "./ComponentExit": 368, - "./ComponentExit.ts": 368, - "./ComponentNext": 243, - "./ComponentNext.ts": 243, - "./ComponentPrev": 400, - "./ComponentPrev.ts": 400, - "./ComponentStyleClear": 910, - "./ComponentStyleClear.ts": 910, - "./CopyComponent": 744, - "./CopyComponent.ts": 744, - "./ExportTemplate": 457, - "./ExportTemplate.ts": 457, - "./Fullscreen": 975, - "./Fullscreen.ts": 975, - "./MoveComponent": 191, - "./MoveComponent.ts": 191, - "./OpenAssets": 912, - "./OpenAssets.ts": 912, - "./OpenBlocks": 117, - "./OpenBlocks.ts": 117, - "./OpenLayers": 614, - "./OpenLayers.ts": 614, - "./OpenStyleManager": 801, - "./OpenStyleManager.ts": 801, - "./OpenTraitManager": 395, - "./OpenTraitManager.ts": 395, - "./PasteComponent": 98, - "./PasteComponent.ts": 98, - "./Preview": 129, - "./Preview.ts": 129, - "./Resize": 116, - "./Resize.ts": 116, - "./SelectComponent": 407, - "./SelectComponent.ts": 407, - "./SelectPosition": 189, - "./SelectPosition.ts": 189, - "./ShowOffset": 804, - "./ShowOffset.ts": 804, - "./SwitchVisibility": 434, - "./SwitchVisibility.ts": 434 -}; - - -function webpackContext(req) { - var id = webpackContextResolve(req); - return __webpack_require__(id); -} -function webpackContextResolve(req) { - if(!__webpack_require__.o(map, req)) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; - } - return map[req]; -} -webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); -}; -webpackContext.resolve = webpackContextResolve; -module.exports = webpackContext; -webpackContext.id = 828; - -/***/ }), - -/***/ 50: -/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { - -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXPORTS -__webpack_require__.d(__webpack_exports__, { - VERSION: () => (/* reexport */ VERSION), - after: () => (/* reexport */ after), - all: () => (/* reexport */ every), - allKeys: () => (/* reexport */ allKeys), - any: () => (/* reexport */ some), - assign: () => (/* reexport */ extendOwn), - before: () => (/* reexport */ before), - bind: () => (/* reexport */ bind), - bindAll: () => (/* reexport */ bindAll), - chain: () => (/* reexport */ chain), - chunk: () => (/* reexport */ chunk), - clone: () => (/* reexport */ clone), - collect: () => (/* reexport */ map), - compact: () => (/* reexport */ compact), - compose: () => (/* reexport */ compose), - constant: () => (/* reexport */ constant), - contains: () => (/* reexport */ contains), - countBy: () => (/* reexport */ countBy), - create: () => (/* reexport */ create), - debounce: () => (/* reexport */ debounce), - "default": () => (/* reexport */ index_default), - defaults: () => (/* reexport */ defaults), - defer: () => (/* reexport */ defer), - delay: () => (/* reexport */ delay), - detect: () => (/* reexport */ find), - difference: () => (/* reexport */ difference), - drop: () => (/* reexport */ rest), - each: () => (/* reexport */ each), - escape: () => (/* reexport */ modules_escape), - every: () => (/* reexport */ every), - extend: () => (/* reexport */ extend), - extendOwn: () => (/* reexport */ extendOwn), - filter: () => (/* reexport */ filter), - find: () => (/* reexport */ find), - findIndex: () => (/* reexport */ findIndex), - findKey: () => (/* reexport */ findKey), - findLastIndex: () => (/* reexport */ findLastIndex), - findWhere: () => (/* reexport */ findWhere), - first: () => (/* reexport */ first), - flatten: () => (/* reexport */ flatten_flatten), - foldl: () => (/* reexport */ reduce), - foldr: () => (/* reexport */ reduceRight), - forEach: () => (/* reexport */ each), - functions: () => (/* reexport */ functions), - get: () => (/* reexport */ get), - groupBy: () => (/* reexport */ groupBy), - has: () => (/* reexport */ has_has), - head: () => (/* reexport */ first), - identity: () => (/* reexport */ identity), - include: () => (/* reexport */ contains), - includes: () => (/* reexport */ contains), - indexBy: () => (/* reexport */ indexBy), - indexOf: () => (/* reexport */ indexOf), - initial: () => (/* reexport */ initial), - inject: () => (/* reexport */ reduce), - intersection: () => (/* reexport */ intersection), - invert: () => (/* reexport */ invert), - invoke: () => (/* reexport */ invoke), - isArguments: () => (/* reexport */ modules_isArguments), - isArray: () => (/* reexport */ isArray), - isArrayBuffer: () => (/* reexport */ isArrayBuffer), - isBoolean: () => (/* reexport */ isBoolean), - isDataView: () => (/* reexport */ modules_isDataView), - isDate: () => (/* reexport */ isDate), - isElement: () => (/* reexport */ isElement), - isEmpty: () => (/* reexport */ isEmpty), - isEqual: () => (/* reexport */ isEqual), - isError: () => (/* reexport */ isError), - isFinite: () => (/* reexport */ isFinite_isFinite), - isFunction: () => (/* reexport */ modules_isFunction), - isMap: () => (/* reexport */ isMap), - isMatch: () => (/* reexport */ isMatch), - isNaN: () => (/* reexport */ isNaN_isNaN), - isNull: () => (/* reexport */ isNull), - isNumber: () => (/* reexport */ isNumber), - isObject: () => (/* reexport */ isObject), - isRegExp: () => (/* reexport */ isRegExp), - isSet: () => (/* reexport */ isSet), - isString: () => (/* reexport */ isString), - isSymbol: () => (/* reexport */ isSymbol), - isTypedArray: () => (/* reexport */ modules_isTypedArray), - isUndefined: () => (/* reexport */ isUndefined), - isWeakMap: () => (/* reexport */ isWeakMap), - isWeakSet: () => (/* reexport */ isWeakSet), - iteratee: () => (/* reexport */ iteratee), - keys: () => (/* reexport */ keys), - last: () => (/* reexport */ last), - lastIndexOf: () => (/* reexport */ lastIndexOf), - map: () => (/* reexport */ map), - mapObject: () => (/* reexport */ mapObject), - matcher: () => (/* reexport */ matcher), - matches: () => (/* reexport */ matcher), - max: () => (/* reexport */ max), - memoize: () => (/* reexport */ memoize), - methods: () => (/* reexport */ functions), - min: () => (/* reexport */ min), - mixin: () => (/* reexport */ mixin), - negate: () => (/* reexport */ negate), - noop: () => (/* reexport */ noop), - now: () => (/* reexport */ now), - object: () => (/* reexport */ object), - omit: () => (/* reexport */ omit), - once: () => (/* reexport */ once), - pairs: () => (/* reexport */ pairs), - partial: () => (/* reexport */ modules_partial), - partition: () => (/* reexport */ partition), - pick: () => (/* reexport */ pick), - pluck: () => (/* reexport */ pluck), - property: () => (/* reexport */ property), - propertyOf: () => (/* reexport */ propertyOf), - random: () => (/* reexport */ random), - range: () => (/* reexport */ range), - reduce: () => (/* reexport */ reduce), - reduceRight: () => (/* reexport */ reduceRight), - reject: () => (/* reexport */ reject), - rest: () => (/* reexport */ rest), - restArguments: () => (/* reexport */ restArguments), - result: () => (/* reexport */ result), - sample: () => (/* reexport */ sample), - select: () => (/* reexport */ filter), - shuffle: () => (/* reexport */ shuffle), - size: () => (/* reexport */ size), - some: () => (/* reexport */ some), - sortBy: () => (/* reexport */ sortBy), - sortedIndex: () => (/* reexport */ sortedIndex), - tail: () => (/* reexport */ rest), - take: () => (/* reexport */ first), - tap: () => (/* reexport */ tap), - template: () => (/* reexport */ template), - templateSettings: () => (/* reexport */ templateSettings), - throttle: () => (/* reexport */ throttle), - times: () => (/* reexport */ times), - toArray: () => (/* reexport */ toArray), - toPath: () => (/* reexport */ toPath), - transpose: () => (/* reexport */ unzip), - unescape: () => (/* reexport */ modules_unescape), - union: () => (/* reexport */ union), - uniq: () => (/* reexport */ uniq), - unique: () => (/* reexport */ uniq), - uniqueId: () => (/* reexport */ uniqueId), - unzip: () => (/* reexport */ unzip), - values: () => (/* reexport */ values), - where: () => (/* reexport */ where), - without: () => (/* reexport */ without), - wrap: () => (/* reexport */ wrap), - zip: () => (/* reexport */ zip) -}); - -// NAMESPACE OBJECT: ./node_modules/underscore/modules/index.js -var modules_namespaceObject = {}; -__webpack_require__.r(modules_namespaceObject); -__webpack_require__.d(modules_namespaceObject, { - VERSION: () => (VERSION), - after: () => (after), - all: () => (every), - allKeys: () => (allKeys), - any: () => (some), - assign: () => (extendOwn), - before: () => (before), - bind: () => (bind), - bindAll: () => (bindAll), - chain: () => (chain), - chunk: () => (chunk), - clone: () => (clone), - collect: () => (map), - compact: () => (compact), - compose: () => (compose), - constant: () => (constant), - contains: () => (contains), - countBy: () => (countBy), - create: () => (create), - debounce: () => (debounce), - "default": () => (underscore_array_methods), - defaults: () => (defaults), - defer: () => (defer), - delay: () => (delay), - detect: () => (find), - difference: () => (difference), - drop: () => (rest), - each: () => (each), - escape: () => (modules_escape), - every: () => (every), - extend: () => (extend), - extendOwn: () => (extendOwn), - filter: () => (filter), - find: () => (find), - findIndex: () => (findIndex), - findKey: () => (findKey), - findLastIndex: () => (findLastIndex), - findWhere: () => (findWhere), - first: () => (first), - flatten: () => (flatten_flatten), - foldl: () => (reduce), - foldr: () => (reduceRight), - forEach: () => (each), - functions: () => (functions), - get: () => (get), - groupBy: () => (groupBy), - has: () => (has_has), - head: () => (first), - identity: () => (identity), - include: () => (contains), - includes: () => (contains), - indexBy: () => (indexBy), - indexOf: () => (indexOf), - initial: () => (initial), - inject: () => (reduce), - intersection: () => (intersection), - invert: () => (invert), - invoke: () => (invoke), - isArguments: () => (modules_isArguments), - isArray: () => (isArray), - isArrayBuffer: () => (isArrayBuffer), - isBoolean: () => (isBoolean), - isDataView: () => (modules_isDataView), - isDate: () => (isDate), - isElement: () => (isElement), - isEmpty: () => (isEmpty), - isEqual: () => (isEqual), - isError: () => (isError), - isFinite: () => (isFinite_isFinite), - isFunction: () => (modules_isFunction), - isMap: () => (isMap), - isMatch: () => (isMatch), - isNaN: () => (isNaN_isNaN), - isNull: () => (isNull), - isNumber: () => (isNumber), - isObject: () => (isObject), - isRegExp: () => (isRegExp), - isSet: () => (isSet), - isString: () => (isString), - isSymbol: () => (isSymbol), - isTypedArray: () => (modules_isTypedArray), - isUndefined: () => (isUndefined), - isWeakMap: () => (isWeakMap), - isWeakSet: () => (isWeakSet), - iteratee: () => (iteratee), - keys: () => (keys), - last: () => (last), - lastIndexOf: () => (lastIndexOf), - map: () => (map), - mapObject: () => (mapObject), - matcher: () => (matcher), - matches: () => (matcher), - max: () => (max), - memoize: () => (memoize), - methods: () => (functions), - min: () => (min), - mixin: () => (mixin), - negate: () => (negate), - noop: () => (noop), - now: () => (now), - object: () => (object), - omit: () => (omit), - once: () => (once), - pairs: () => (pairs), - partial: () => (modules_partial), - partition: () => (partition), - pick: () => (pick), - pluck: () => (pluck), - property: () => (property), - propertyOf: () => (propertyOf), - random: () => (random), - range: () => (range), - reduce: () => (reduce), - reduceRight: () => (reduceRight), - reject: () => (reject), - rest: () => (rest), - restArguments: () => (restArguments), - result: () => (result), - sample: () => (sample), - select: () => (filter), - shuffle: () => (shuffle), - size: () => (size), - some: () => (some), - sortBy: () => (sortBy), - sortedIndex: () => (sortedIndex), - tail: () => (rest), - take: () => (first), - tap: () => (tap), - template: () => (template), - templateSettings: () => (templateSettings), - throttle: () => (throttle), - times: () => (times), - toArray: () => (toArray), - toPath: () => (toPath), - transpose: () => (unzip), - unescape: () => (modules_unescape), - union: () => (union), - uniq: () => (uniq), - unique: () => (uniq), - uniqueId: () => (uniqueId), - unzip: () => (unzip), - values: () => (values), - where: () => (where), - without: () => (without), - wrap: () => (wrap), - zip: () => (zip) -}); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_setup.js -// Current version. -var VERSION = '1.13.6'; - -// Establish the root object, `window` (`self`) in the browser, `global` -// on the server, or `this` in some virtual machines. We use `self` -// instead of `window` for `WebWorker` support. -var root = (typeof self == 'object' && self.self === self && self) || - (typeof global == 'object' && global.global === global && global) || - Function('return this')() || - {}; - -// Save bytes in the minified (but not gzipped) version: -var ArrayProto = Array.prototype, ObjProto = Object.prototype; -var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; - -// Create quick reference variables for speed access to core prototypes. -var push = ArrayProto.push, - slice = ArrayProto.slice, - _setup_toString = ObjProto.toString, - _setup_hasOwnProperty = ObjProto.hasOwnProperty; - -// Modern feature detection. -var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined', - supportsDataView = typeof DataView !== 'undefined'; - -// All **ECMAScript 5+** native function implementations that we hope to use -// are declared here. -var nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeCreate = Object.create, - nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; - -// Create references to these builtin functions because we override them. -var _isNaN = isNaN, - _isFinite = isFinite; - -// Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. -var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); -var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', - 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; - -// The largest integer that can be represented exactly. -var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/restArguments.js -// Some functions take a variable number of arguments, or a few expected -// arguments at the beginning and then a variable number of values to operate -// on. This helper accumulates all remaining arguments past the function’s -// argument length (or an explicit `startIndex`), into an array that becomes -// the last argument. Similar to ES6’s "rest parameter". -function restArguments(func, startIndex) { - startIndex = startIndex == null ? func.length - 1 : +startIndex; - return function() { - var length = Math.max(arguments.length - startIndex, 0), - rest = Array(length), - index = 0; - for (; index < length; index++) { - rest[index] = arguments[index + startIndex]; - } - switch (startIndex) { - case 0: return func.call(this, rest); - case 1: return func.call(this, arguments[0], rest); - case 2: return func.call(this, arguments[0], arguments[1], rest); - } - var args = Array(startIndex + 1); - for (index = 0; index < startIndex; index++) { - args[index] = arguments[index]; - } - args[startIndex] = rest; - return func.apply(this, args); - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isObject.js -// Is a given variable an object? -function isObject(obj) { - var type = typeof obj; - return type === 'function' || (type === 'object' && !!obj); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isNull.js -// Is a given value equal to null? -function isNull(obj) { - return obj === null; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isUndefined.js -// Is a given variable undefined? -function isUndefined(obj) { - return obj === void 0; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isBoolean.js - - -// Is a given value a boolean? -function isBoolean(obj) { - return obj === true || obj === false || _setup_toString.call(obj) === '[object Boolean]'; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isElement.js -// Is a given value a DOM element? -function isElement(obj) { - return !!(obj && obj.nodeType === 1); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_tagTester.js - - -// Internal function for creating a `toString`-based type tester. -function tagTester(name) { - var tag = '[object ' + name + ']'; - return function(obj) { - return _setup_toString.call(obj) === tag; - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isString.js - - -/* harmony default export */ const isString = (tagTester('String')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isNumber.js - - -/* harmony default export */ const isNumber = (tagTester('Number')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isDate.js - - -/* harmony default export */ const isDate = (tagTester('Date')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isRegExp.js - - -/* harmony default export */ const isRegExp = (tagTester('RegExp')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isError.js - - -/* harmony default export */ const isError = (tagTester('Error')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isSymbol.js - - -/* harmony default export */ const isSymbol = (tagTester('Symbol')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isArrayBuffer.js - - -/* harmony default export */ const isArrayBuffer = (tagTester('ArrayBuffer')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isFunction.js - - - -var isFunction = tagTester('Function'); - -// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old -// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). -var nodelist = root.document && root.document.childNodes; -if ( true && typeof Int8Array != 'object' && typeof nodelist != 'function') { - isFunction = function(obj) { - return typeof obj == 'function' || false; - }; -} - -/* harmony default export */ const modules_isFunction = (isFunction); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_hasObjectTag.js - - -/* harmony default export */ const _hasObjectTag = (tagTester('Object')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_stringTagBug.js - - - -// In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`. -// In IE 11, the most common among them, this problem also applies to -// `Map`, `WeakMap` and `Set`. -var hasStringTagBug = ( - supportsDataView && _hasObjectTag(new DataView(new ArrayBuffer(8))) - ), - isIE11 = (typeof Map !== 'undefined' && _hasObjectTag(new Map)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isDataView.js - - - - - -var isDataView = tagTester('DataView'); - -// In IE 10 - Edge 13, we need a different heuristic -// to determine whether an object is a `DataView`. -function ie10IsDataView(obj) { - return obj != null && modules_isFunction(obj.getInt8) && isArrayBuffer(obj.buffer); -} - -/* harmony default export */ const modules_isDataView = (hasStringTagBug ? ie10IsDataView : isDataView); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isArray.js - - - -// Is a given value an array? -// Delegates to ECMA5's native `Array.isArray`. -/* harmony default export */ const isArray = (nativeIsArray || tagTester('Array')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_has.js - - -// Internal function to check whether `key` is an own property name of `obj`. -function has(obj, key) { - return obj != null && _setup_hasOwnProperty.call(obj, key); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isArguments.js - - - -var isArguments = tagTester('Arguments'); - -// Define a fallback version of the method in browsers (ahem, IE < 9), where -// there isn't any inspectable "Arguments" type. -(function() { - if (!isArguments(arguments)) { - isArguments = function(obj) { - return has(obj, 'callee'); - }; - } -}()); - -/* harmony default export */ const modules_isArguments = (isArguments); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isFinite.js - - - -// Is a given object a finite number? -function isFinite_isFinite(obj) { - return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj)); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isNaN.js - - - -// Is the given value `NaN`? -function isNaN_isNaN(obj) { - return isNumber(obj) && _isNaN(obj); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/constant.js -// Predicate-generating function. Often useful outside of Underscore. -function constant(value) { - return function() { - return value; - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_createSizePropertyCheck.js - - -// Common internal logic for `isArrayLike` and `isBufferLike`. -function createSizePropertyCheck(getSizeProperty) { - return function(collection) { - var sizeProperty = getSizeProperty(collection); - return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX; - } -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_shallowProperty.js -// Internal helper to generate a function to obtain property `key` from `obj`. -function shallowProperty(key) { - return function(obj) { - return obj == null ? void 0 : obj[key]; - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_getByteLength.js - - -// Internal helper to obtain the `byteLength` property of an object. -/* harmony default export */ const _getByteLength = (shallowProperty('byteLength')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_isBufferLike.js - - - -// Internal helper to determine whether we should spend extensive checks against -// `ArrayBuffer` et al. -/* harmony default export */ const _isBufferLike = (createSizePropertyCheck(_getByteLength)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isTypedArray.js - - - - - -// Is a given value a typed array? -var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; -function isTypedArray(obj) { - // `ArrayBuffer.isView` is the most future-proof, so use it when available. - // Otherwise, fall back on the above regular expression. - return nativeIsView ? (nativeIsView(obj) && !modules_isDataView(obj)) : - _isBufferLike(obj) && typedArrayPattern.test(_setup_toString.call(obj)); -} - -/* harmony default export */ const modules_isTypedArray = (supportsArrayBuffer ? isTypedArray : constant(false)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_getLength.js - - -// Internal helper to obtain the `length` property of an object. -/* harmony default export */ const _getLength = (shallowProperty('length')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_collectNonEnumProps.js - - - - -// Internal helper to create a simple lookup structure. -// `collectNonEnumProps` used to depend on `_.contains`, but this led to -// circular imports. `emulatedSet` is a one-off solution that only works for -// arrays of strings. -function emulatedSet(keys) { - var hash = {}; - for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; - return { - contains: function(key) { return hash[key] === true; }, - push: function(key) { - hash[key] = true; - return keys.push(key); - } - }; -} - -// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't -// be iterated by `for key in ...` and thus missed. Extends `keys` in place if -// needed. -function collectNonEnumProps(obj, keys) { - keys = emulatedSet(keys); - var nonEnumIdx = nonEnumerableProps.length; - var constructor = obj.constructor; - var proto = (modules_isFunction(constructor) && constructor.prototype) || ObjProto; - - // Constructor is a special case. - var prop = 'constructor'; - if (has(obj, prop) && !keys.contains(prop)) keys.push(prop); - - while (nonEnumIdx--) { - prop = nonEnumerableProps[nonEnumIdx]; - if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { - keys.push(prop); - } - } -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/keys.js - - - - - -// Retrieve the names of an object's own properties. -// Delegates to **ECMAScript 5**'s native `Object.keys`. -function keys(obj) { - if (!isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - for (var key in obj) if (has(obj, key)) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isEmpty.js - - - - - - -// Is a given array, string, or object empty? -// An "empty" object has no enumerable own-properties. -function isEmpty(obj) { - if (obj == null) return true; - // Skip the more expensive `toString`-based type checks if `obj` has no - // `.length`. - var length = _getLength(obj); - if (typeof length == 'number' && ( - isArray(obj) || isString(obj) || modules_isArguments(obj) - )) return length === 0; - return _getLength(keys(obj)) === 0; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isMatch.js - - -// Returns whether an object has a given set of `key:value` pairs. -function isMatch(object, attrs) { - var _keys = keys(attrs), length = _keys.length; - if (object == null) return !length; - var obj = Object(object); - for (var i = 0; i < length; i++) { - var key = _keys[i]; - if (attrs[key] !== obj[key] || !(key in obj)) return false; - } - return true; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/underscore.js - - -// If Underscore is called as a function, it returns a wrapped object that can -// be used OO-style. This wrapper holds altered versions of all functions added -// through `_.mixin`. Wrapped objects may be chained. -function _(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; -} - -_.VERSION = VERSION; - -// Extracts the result from a wrapped and chained object. -_.prototype.value = function() { - return this._wrapped; -}; - -// Provide unwrapping proxies for some methods used in engine operations -// such as arithmetic and JSON stringification. -_.prototype.valueOf = _.prototype.toJSON = _.prototype.value; - -_.prototype.toString = function() { - return String(this._wrapped); -}; - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_toBufferView.js - - -// Internal function to wrap or shallow-copy an ArrayBuffer, -// typed array or DataView to a new view, reusing the buffer. -function toBufferView(bufferSource) { - return new Uint8Array( - bufferSource.buffer || bufferSource, - bufferSource.byteOffset || 0, - _getByteLength(bufferSource) - ); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isEqual.js - - - - - - - - - - - -// We use this string twice, so give it a name for minification. -var tagDataView = '[object DataView]'; - -// Internal recursive comparison function for `_.isEqual`. -function eq(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // `null` or `undefined` only equal to itself (strict comparison). - if (a == null || b == null) return false; - // `NaN`s are equivalent, but non-reflexive. - if (a !== a) return b !== b; - // Exhaust primitive checks - var type = typeof a; - if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; - return deepEq(a, b, aStack, bStack); -} - -// Internal recursive comparison function for `_.isEqual`. -function deepEq(a, b, aStack, bStack) { - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = _setup_toString.call(a); - if (className !== _setup_toString.call(b)) return false; - // Work around a bug in IE 10 - Edge 13. - if (hasStringTagBug && className == '[object Object]' && modules_isDataView(a)) { - if (!modules_isDataView(b)) return false; - className = tagDataView; - } - switch (className) { - // These types are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN. - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a === +b; - case '[object Symbol]': - return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); - case '[object ArrayBuffer]': - case tagDataView: - // Coerce to typed array so we can fall through. - return deepEq(toBufferView(a), toBufferView(b), aStack, bStack); - } - - var areArrays = className === '[object Array]'; - if (!areArrays && modules_isTypedArray(a)) { - var byteLength = _getByteLength(a); - if (byteLength !== _getByteLength(b)) return false; - if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true; - areArrays = true; - } - if (!areArrays) { - if (typeof a != 'object' || typeof b != 'object') return false; - - // Objects with different constructors are not equivalent, but `Object`s or `Array`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(modules_isFunction(aCtor) && aCtor instanceof aCtor && - modules_isFunction(bCtor) && bCtor instanceof bCtor) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - } - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - - // Initializing stack of traversed objects. - // It's done here since we only need them for objects and arrays comparison. - aStack = aStack || []; - bStack = bStack || []; - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; - } - - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - - // Recursively compare objects and arrays. - if (areArrays) { - // Compare array lengths to determine if a deep comparison is necessary. - length = a.length; - if (length !== b.length) return false; - // Deep compare the contents, ignoring non-numeric properties. - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) return false; - } - } else { - // Deep compare objects. - var _keys = keys(a), key; - length = _keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - if (keys(b).length !== length) return false; - while (length--) { - // Deep compare each member - key = _keys[length]; - if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return true; -} - -// Perform a deep comparison to check if two objects are equal. -function isEqual(a, b) { - return eq(a, b); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/allKeys.js - - - - -// Retrieve all the enumerable property names of an object. -function allKeys(obj) { - if (!isObject(obj)) return []; - var keys = []; - for (var key in obj) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_methodFingerprint.js - - - - -// Since the regular `Object.prototype.toString` type tests don't work for -// some types in IE 11, we use a fingerprinting heuristic instead, based -// on the methods. It's not great, but it's the best we got. -// The fingerprint method lists are defined below. -function ie11fingerprint(methods) { - var length = _getLength(methods); - return function(obj) { - if (obj == null) return false; - // `Map`, `WeakMap` and `Set` have no enumerable keys. - var keys = allKeys(obj); - if (_getLength(keys)) return false; - for (var i = 0; i < length; i++) { - if (!modules_isFunction(obj[methods[i]])) return false; - } - // If we are testing against `WeakMap`, we need to ensure that - // `obj` doesn't have a `forEach` method in order to distinguish - // it from a regular `Map`. - return methods !== weakMapMethods || !modules_isFunction(obj[forEachName]); - }; -} - -// In the interest of compact minification, we write -// each string in the fingerprints only once. -var forEachName = 'forEach', - hasName = 'has', - commonInit = ['clear', 'delete'], - mapTail = ['get', hasName, 'set']; - -// `Map`, `WeakMap` and `Set` each have slightly different -// combinations of the above sublists. -var mapMethods = commonInit.concat(forEachName, mapTail), - weakMapMethods = commonInit.concat(mapTail), - setMethods = ['add'].concat(commonInit, forEachName, hasName); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isMap.js - - - - -/* harmony default export */ const isMap = (isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isWeakMap.js - - - - -/* harmony default export */ const isWeakMap = (isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isSet.js - - - - -/* harmony default export */ const isSet = (isIE11 ? ie11fingerprint(setMethods) : tagTester('Set')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/isWeakSet.js - - -/* harmony default export */ const isWeakSet = (tagTester('WeakSet')); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/values.js - - -// Retrieve the values of an object's properties. -function values(obj) { - var _keys = keys(obj); - var length = _keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[_keys[i]]; - } - return values; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/pairs.js - - -// Convert an object into a list of `[key, value]` pairs. -// The opposite of `_.object` with one argument. -function pairs(obj) { - var _keys = keys(obj); - var length = _keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [_keys[i], obj[_keys[i]]]; - } - return pairs; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/invert.js - - -// Invert the keys and values of an object. The values must be serializable. -function invert(obj) { - var result = {}; - var _keys = keys(obj); - for (var i = 0, length = _keys.length; i < length; i++) { - result[obj[_keys[i]]] = _keys[i]; - } - return result; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/functions.js - - -// Return a sorted list of the function names available on the object. -function functions(obj) { - var names = []; - for (var key in obj) { - if (modules_isFunction(obj[key])) names.push(key); - } - return names.sort(); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_createAssigner.js -// An internal function for creating assigner functions. -function createAssigner(keysFunc, defaults) { - return function(obj) { - var length = arguments.length; - if (defaults) obj = Object(obj); - if (length < 2 || obj == null) return obj; - for (var index = 1; index < length; index++) { - var source = arguments[index], - keys = keysFunc(source), - l = keys.length; - for (var i = 0; i < l; i++) { - var key = keys[i]; - if (!defaults || obj[key] === void 0) obj[key] = source[key]; - } - } - return obj; - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/extend.js - - - -// Extend a given object with all the properties in passed-in object(s). -/* harmony default export */ const extend = (createAssigner(allKeys)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/extendOwn.js - - - -// Assigns a given object with all the own properties in the passed-in -// object(s). -// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) -/* harmony default export */ const extendOwn = (createAssigner(keys)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/defaults.js - - - -// Fill in a given object with default properties. -/* harmony default export */ const defaults = (createAssigner(allKeys, true)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_baseCreate.js - - - -// Create a naked function reference for surrogate-prototype-swapping. -function ctor() { - return function(){}; -} - -// An internal function for creating a new object that inherits from another. -function baseCreate(prototype) { - if (!isObject(prototype)) return {}; - if (nativeCreate) return nativeCreate(prototype); - var Ctor = ctor(); - Ctor.prototype = prototype; - var result = new Ctor; - Ctor.prototype = null; - return result; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/create.js - - - -// Creates an object that inherits from the given prototype object. -// If additional properties are provided then they will be added to the -// created object. -function create(prototype, props) { - var result = baseCreate(prototype); - if (props) extendOwn(result, props); - return result; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/clone.js - - - - -// Create a (shallow-cloned) duplicate of an object. -function clone(obj) { - if (!isObject(obj)) return obj; - return isArray(obj) ? obj.slice() : extend({}, obj); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/tap.js -// Invokes `interceptor` with the `obj` and then returns `obj`. -// The primary purpose of this method is to "tap into" a method chain, in -// order to perform operations on intermediate results within the chain. -function tap(obj, interceptor) { - interceptor(obj); - return obj; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/toPath.js - - - -// Normalize a (deep) property `path` to array. -// Like `_.iteratee`, this function can be customized. -function toPath(path) { - return isArray(path) ? path : [path]; -} -_.toPath = toPath; - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_toPath.js - - - -// Internal wrapper for `_.toPath` to enable minification. -// Similar to `cb` for `_.iteratee`. -function _toPath_toPath(path) { - return _.toPath(path); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_deepGet.js -// Internal function to obtain a nested property in `obj` along `path`. -function deepGet(obj, path) { - var length = path.length; - for (var i = 0; i < length; i++) { - if (obj == null) return void 0; - obj = obj[path[i]]; - } - return length ? obj : void 0; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/get.js - - - - -// Get the value of the (deep) property on `path` from `object`. -// If any property in `path` does not exist or if the value is -// `undefined`, return `defaultValue` instead. -// The `path` is normalized through `_.toPath`. -function get(object, path, defaultValue) { - var value = deepGet(object, _toPath_toPath(path)); - return isUndefined(value) ? defaultValue : value; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/has.js - - - -// Shortcut function for checking if an object has a given property directly on -// itself (in other words, not on a prototype). Unlike the internal `has` -// function, this public version can also traverse nested properties. -function has_has(obj, path) { - path = _toPath_toPath(path); - var length = path.length; - for (var i = 0; i < length; i++) { - var key = path[i]; - if (!has(obj, key)) return false; - obj = obj[key]; - } - return !!length; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/identity.js -// Keep the identity function around for default iteratees. -function identity(value) { - return value; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/matcher.js - - - -// Returns a predicate for checking whether an object has a given set of -// `key:value` pairs. -function matcher(attrs) { - attrs = extendOwn({}, attrs); - return function(obj) { - return isMatch(obj, attrs); - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/property.js - - - -// Creates a function that, when passed an object, will traverse that object’s -// properties down the given `path`, specified as an array of keys or indices. -function property(path) { - path = _toPath_toPath(path); - return function(obj) { - return deepGet(obj, path); - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_optimizeCb.js -// Internal function that returns an efficient (for current engines) version -// of the passed-in callback, to be repeatedly applied in other Underscore -// functions. -function optimizeCb(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - // The 2-argument case is omitted because we’re not using it. - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_baseIteratee.js - - - - - - - - -// An internal function to generate callbacks that can be applied to each -// element in a collection, returning the desired result — either `_.identity`, -// an arbitrary callback, a property matcher, or a property accessor. -function baseIteratee(value, context, argCount) { - if (value == null) return identity; - if (modules_isFunction(value)) return optimizeCb(value, context, argCount); - if (isObject(value) && !isArray(value)) return matcher(value); - return property(value); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/iteratee.js - - - -// External wrapper for our callback generator. Users may customize -// `_.iteratee` if they want additional predicate/iteratee shorthand styles. -// This abstraction hides the internal-only `argCount` argument. -function iteratee(value, context) { - return baseIteratee(value, context, Infinity); -} -_.iteratee = iteratee; - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_cb.js - - - - -// The function we call internally to generate a callback. It invokes -// `_.iteratee` if overridden, otherwise `baseIteratee`. -function cb(value, context, argCount) { - if (_.iteratee !== iteratee) return _.iteratee(value, context); - return baseIteratee(value, context, argCount); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/mapObject.js - - - -// Returns the results of applying the `iteratee` to each element of `obj`. -// In contrast to `_.map` it returns an object. -function mapObject(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = keys(obj), - length = _keys.length, - results = {}; - for (var index = 0; index < length; index++) { - var currentKey = _keys[index]; - results[currentKey] = iteratee(obj[currentKey], currentKey, obj); - } - return results; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/noop.js -// Predicate-generating function. Often useful outside of Underscore. -function noop(){} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/propertyOf.js - - - -// Generates a function for a given object that returns a given property. -function propertyOf(obj) { - if (obj == null) return noop; - return function(path) { - return get(obj, path); - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/times.js - - -// Run a function **n** times. -function times(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = optimizeCb(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/random.js -// Return a random integer between `min` and `max` (inclusive). -function random(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/now.js -// A (possibly faster) way to get the current timestamp as an integer. -/* harmony default export */ const now = (Date.now || function() { - return new Date().getTime(); -}); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_createEscaper.js - - -// Internal helper to generate functions for escaping and unescaping strings -// to/from HTML interpolation. -function createEscaper(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped. - var source = '(?:' + keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_escapeMap.js -// Internal list of HTML entities for escaping. -/* harmony default export */ const _escapeMap = ({ - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' -}); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/escape.js - - - -// Function for escaping strings to HTML interpolation. -/* harmony default export */ const modules_escape = (createEscaper(_escapeMap)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_unescapeMap.js - - - -// Internal list of HTML entities for unescaping. -/* harmony default export */ const _unescapeMap = (invert(_escapeMap)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/unescape.js - - - -// Function for unescaping strings from HTML interpolation. -/* harmony default export */ const modules_unescape = (createEscaper(_unescapeMap)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/templateSettings.js - - -// By default, Underscore uses ERB-style template delimiters. Change the -// following template settings to use alternative delimiters. -/* harmony default export */ const templateSettings = (_.templateSettings = { - evaluate: /<%([\s\S]+?)%>/g, - interpolate: /<%=([\s\S]+?)%>/g, - escape: /<%-([\s\S]+?)%>/g -}); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/template.js - - - - -// When customizing `_.templateSettings`, if you don't want to define an -// interpolation, evaluation or escaping regex, we need one that is -// guaranteed not to match. -var noMatch = /(.)^/; - -// Certain characters need to be escaped so that they can be put into a -// string literal. -var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' -}; - -var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; - -function escapeChar(match) { - return '\\' + escapes[match]; -} - -// In order to prevent third-party code injection through -// `_.templateSettings.variable`, we test it against the following regular -// expression. It is intentionally a bit more liberal than just matching valid -// identifiers, but still prevents possible loopholes through defaults or -// destructuring assignment. -var bareIdentifier = /^\s*(\w|\$)+\s*$/; - -// JavaScript micro-templating, similar to John Resig's implementation. -// Underscore templating handles arbitrary delimiters, preserves whitespace, -// and correctly escapes quotes within interpolated code. -// NB: `oldSettings` only exists for backwards compatibility. -function template(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escapeRegExp, escapeChar); - index = offset + match.length; - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - - // Adobe VMs need the match returned to produce the correct offset. - return match; - }); - source += "';\n"; - - var argument = settings.variable; - if (argument) { - // Insure against third-party code injection. (CVE-2021-23358) - if (!bareIdentifier.test(argument)) throw new Error( - 'variable is not a bare identifier: ' + argument - ); - } else { - // If a variable is not specified, place data values in local scope. - source = 'with(obj||{}){\n' + source + '}\n'; - argument = 'obj'; - } - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; - - var render; - try { - render = new Function(argument, '_', source); - } catch (e) { - e.source = source; - throw e; - } - - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled source as a convenience for precompilation. - template.source = 'function(' + argument + '){\n' + source + '}'; - - return template; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/result.js - - - -// Traverses the children of `obj` along `path`. If a child is a function, it -// is invoked with its parent as context. Returns the value of the final -// child, or `fallback` if any child is undefined. -function result(obj, path, fallback) { - path = _toPath_toPath(path); - var length = path.length; - if (!length) { - return modules_isFunction(fallback) ? fallback.call(obj) : fallback; - } - for (var i = 0; i < length; i++) { - var prop = obj == null ? void 0 : obj[path[i]]; - if (prop === void 0) { - prop = fallback; - i = length; // Ensure we don't continue iterating. - } - obj = modules_isFunction(prop) ? prop.call(obj) : prop; - } - return obj; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/uniqueId.js -// Generate a unique integer id (unique within the entire client session). -// Useful for temporary DOM ids. -var idCounter = 0; -function uniqueId(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/chain.js - - -// Start chaining a wrapped Underscore object. -function chain(obj) { - var instance = _(obj); - instance._chain = true; - return instance; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_executeBound.js - - - -// Internal function to execute `sourceFunc` bound to `context` with optional -// `args`. Determines whether to execute a function as a constructor or as a -// normal function. -function executeBound(sourceFunc, boundFunc, context, callingContext, args) { - if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); - var self = baseCreate(sourceFunc.prototype); - var result = sourceFunc.apply(self, args); - if (isObject(result)) return result; - return self; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/partial.js - - - - -// Partially apply a function by creating a version that has had some of its -// arguments pre-filled, without changing its dynamic `this` context. `_` acts -// as a placeholder by default, allowing any combination of arguments to be -// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. -var partial = restArguments(function(func, boundArgs) { - var placeholder = partial.placeholder; - var bound = function() { - var position = 0, length = boundArgs.length; - var args = Array(length); - for (var i = 0; i < length; i++) { - args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; - } - while (position < arguments.length) args.push(arguments[position++]); - return executeBound(func, bound, this, this, args); - }; - return bound; -}); - -partial.placeholder = _; -/* harmony default export */ const modules_partial = (partial); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/bind.js - - - - -// Create a function bound to a given object (assigning `this`, and arguments, -// optionally). -/* harmony default export */ const bind = (restArguments(function(func, context, args) { - if (!modules_isFunction(func)) throw new TypeError('Bind must be called on a function'); - var bound = restArguments(function(callArgs) { - return executeBound(func, bound, context, this, args.concat(callArgs)); - }); - return bound; -})); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_isArrayLike.js - - - -// Internal helper for collection methods to determine whether a collection -// should be iterated as an array or as an object. -// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength -// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 -/* harmony default export */ const _isArrayLike = (createSizePropertyCheck(_getLength)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_flatten.js - - - - - -// Internal implementation of a recursive `flatten` function. -function flatten(input, depth, strict, output) { - output = output || []; - if (!depth && depth !== 0) { - depth = Infinity; - } else if (depth <= 0) { - return output.concat(input); - } - var idx = output.length; - for (var i = 0, length = _getLength(input); i < length; i++) { - var value = input[i]; - if (_isArrayLike(value) && (isArray(value) || modules_isArguments(value))) { - // Flatten current level of array or arguments object. - if (depth > 1) { - flatten(value, depth - 1, strict, output); - idx = output.length; - } else { - var j = 0, len = value.length; - while (j < len) output[idx++] = value[j++]; - } - } else if (!strict) { - output[idx++] = value; - } - } - return output; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/bindAll.js - - - - -// Bind a number of an object's methods to that object. Remaining arguments -// are the method names to be bound. Useful for ensuring that all callbacks -// defined on an object belong to it. -/* harmony default export */ const bindAll = (restArguments(function(obj, keys) { - keys = flatten(keys, false, false); - var index = keys.length; - if (index < 1) throw new Error('bindAll must be passed function names'); - while (index--) { - var key = keys[index]; - obj[key] = bind(obj[key], obj); - } - return obj; -})); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/memoize.js - - -// Memoize an expensive function by storing its results. -function memoize(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = '' + (hasher ? hasher.apply(this, arguments) : key); - if (!has(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; - }; - memoize.cache = {}; - return memoize; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/delay.js - - -// Delays a function for the given number of milliseconds, and then calls -// it with the arguments supplied. -/* harmony default export */ const delay = (restArguments(function(func, wait, args) { - return setTimeout(function() { - return func.apply(null, args); - }, wait); -})); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/defer.js - - - - -// Defers a function, scheduling it to run after the current call stack has -// cleared. -/* harmony default export */ const defer = (modules_partial(delay, _, 1)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/throttle.js - - -// Returns a function, that, when invoked, will only be triggered at most once -// during a given window of time. Normally, the throttled function will run -// as much as it can, without ever going more than once per `wait` duration; -// but if you'd like to disable the execution on the leading edge, pass -// `{leading: false}`. To disable execution on the trailing edge, ditto. -function throttle(func, wait, options) { - var timeout, context, args, result; - var previous = 0; - if (!options) options = {}; - - var later = function() { - previous = options.leading === false ? 0 : now(); - timeout = null; - result = func.apply(context, args); - if (!timeout) context = args = null; - }; - - var throttled = function() { - var _now = now(); - if (!previous && options.leading === false) previous = _now; - var remaining = wait - (_now - previous); - context = this; - args = arguments; - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - previous = _now; - result = func.apply(context, args); - if (!timeout) context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - - throttled.cancel = function() { - clearTimeout(timeout); - previous = 0; - timeout = context = args = null; - }; - - return throttled; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/debounce.js - - - -// When a sequence of calls of the returned function ends, the argument -// function is triggered. The end of a sequence is defined by the `wait` -// parameter. If `immediate` is passed, the argument function will be -// triggered at the beginning of the sequence instead of at the end. -function debounce(func, wait, immediate) { - var timeout, previous, args, result, context; - - var later = function() { - var passed = now() - previous; - if (wait > passed) { - timeout = setTimeout(later, wait - passed); - } else { - timeout = null; - if (!immediate) result = func.apply(context, args); - // This check is needed because `func` can recursively invoke `debounced`. - if (!timeout) args = context = null; - } - }; - - var debounced = restArguments(function(_args) { - context = this; - args = _args; - previous = now(); - if (!timeout) { - timeout = setTimeout(later, wait); - if (immediate) result = func.apply(context, args); - } - return result; - }); - - debounced.cancel = function() { - clearTimeout(timeout); - timeout = args = context = null; - }; - - return debounced; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/wrap.js - - -// Returns the first function passed as an argument to the second, -// allowing you to adjust arguments, run code before and after, and -// conditionally execute the original function. -function wrap(func, wrapper) { - return modules_partial(wrapper, func); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/negate.js -// Returns a negated version of the passed-in predicate. -function negate(predicate) { - return function() { - return !predicate.apply(this, arguments); - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/compose.js -// Returns a function that is the composition of a list of functions, each -// consuming the return value of the function that follows. -function compose() { - var args = arguments; - var start = args.length - 1; - return function() { - var i = start; - var result = args[start].apply(this, arguments); - while (i--) result = args[i].call(this, result); - return result; - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/after.js -// Returns a function that will only be executed on and after the Nth call. -function after(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/before.js -// Returns a function that will only be executed up to (but not including) the -// Nth call. -function before(times, func) { - var memo; - return function() { - if (--times > 0) { - memo = func.apply(this, arguments); - } - if (times <= 1) func = null; - return memo; - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/once.js - - - -// Returns a function that will be executed at most one time, no matter how -// often you call it. Useful for lazy initialization. -/* harmony default export */ const once = (modules_partial(before, 2)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/findKey.js - - - -// Returns the first key on an object that passes a truth test. -function findKey(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = keys(obj), key; - for (var i = 0, length = _keys.length; i < length; i++) { - key = _keys[i]; - if (predicate(obj[key], key, obj)) return key; - } -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_createPredicateIndexFinder.js - - - -// Internal function to generate `_.findIndex` and `_.findLastIndex`. -function createPredicateIndexFinder(dir) { - return function(array, predicate, context) { - predicate = cb(predicate, context); - var length = _getLength(array); - var index = dir > 0 ? 0 : length - 1; - for (; index >= 0 && index < length; index += dir) { - if (predicate(array[index], index, array)) return index; - } - return -1; - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/findIndex.js - - -// Returns the first index on an array-like that passes a truth test. -/* harmony default export */ const findIndex = (createPredicateIndexFinder(1)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/findLastIndex.js - - -// Returns the last index on an array-like that passes a truth test. -/* harmony default export */ const findLastIndex = (createPredicateIndexFinder(-1)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/sortedIndex.js - - - -// Use a comparator function to figure out the smallest index at which -// an object should be inserted so as to maintain order. Uses binary search. -function sortedIndex(array, obj, iteratee, context) { - iteratee = cb(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = _getLength(array); - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_createIndexFinder.js - - - - -// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. -function createIndexFinder(dir, predicateFind, sortedIndex) { - return function(array, item, idx) { - var i = 0, length = _getLength(array); - if (typeof idx == 'number') { - if (dir > 0) { - i = idx >= 0 ? idx : Math.max(idx + length, i); - } else { - length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; - } - } else if (sortedIndex && idx && length) { - idx = sortedIndex(array, item); - return array[idx] === item ? idx : -1; - } - if (item !== item) { - idx = predicateFind(slice.call(array, i, length), isNaN_isNaN); - return idx >= 0 ? idx + i : -1; - } - for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { - if (array[idx] === item) return idx; - } - return -1; - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/indexOf.js - - - - -// Return the position of the first occurrence of an item in an array, -// or -1 if the item is not included in the array. -// If the array is large and already in sort order, pass `true` -// for **isSorted** to use binary search. -/* harmony default export */ const indexOf = (createIndexFinder(1, findIndex, sortedIndex)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/lastIndexOf.js - - - -// Return the position of the last occurrence of an item in an array, -// or -1 if the item is not included in the array. -/* harmony default export */ const lastIndexOf = (createIndexFinder(-1, findLastIndex)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/find.js - - - - -// Return the first value which passes a truth test. -function find(obj, predicate, context) { - var keyFinder = _isArrayLike(obj) ? findIndex : findKey; - var key = keyFinder(obj, predicate, context); - if (key !== void 0 && key !== -1) return obj[key]; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/findWhere.js - - - -// Convenience version of a common use case of `_.find`: getting the first -// object containing specific `key:value` pairs. -function findWhere(obj, attrs) { - return find(obj, matcher(attrs)); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/each.js - - - - -// The cornerstone for collection functions, an `each` -// implementation, aka `forEach`. -// Handles raw objects in addition to array-likes. Treats all -// sparse array-likes as if they were dense. -function each(obj, iteratee, context) { - iteratee = optimizeCb(iteratee, context); - var i, length; - if (_isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var _keys = keys(obj); - for (i = 0, length = _keys.length; i < length; i++) { - iteratee(obj[_keys[i]], _keys[i], obj); - } - } - return obj; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/map.js - - - - -// Return the results of applying the iteratee to each element. -function map(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var _keys = !_isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - results = Array(length); - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_createReduce.js - - - - -// Internal helper to create a reducing function, iterating left or right. -function createReduce(dir) { - // Wrap code that reassigns argument variables in a separate function than - // the one that accesses `arguments.length` to avoid a perf hit. (#1991) - var reducer = function(obj, iteratee, memo, initial) { - var _keys = !_isArrayLike(obj) && keys(obj), - length = (_keys || obj).length, - index = dir > 0 ? 0 : length - 1; - if (!initial) { - memo = obj[_keys ? _keys[index] : index]; - index += dir; - } - for (; index >= 0 && index < length; index += dir) { - var currentKey = _keys ? _keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - }; - - return function(obj, iteratee, memo, context) { - var initial = arguments.length >= 3; - return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/reduce.js - - -// **Reduce** builds up a single result from a list of values, aka `inject`, -// or `foldl`. -/* harmony default export */ const reduce = (createReduce(1)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/reduceRight.js - - -// The right-associative version of reduce, also known as `foldr`. -/* harmony default export */ const reduceRight = (createReduce(-1)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/filter.js - - - -// Return all the elements that pass a truth test. -function filter(obj, predicate, context) { - var results = []; - predicate = cb(predicate, context); - each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/reject.js - - - - -// Return all the elements for which a truth test fails. -function reject(obj, predicate, context) { - return filter(obj, negate(cb(predicate)), context); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/every.js - - - - -// Determine whether all of the elements pass a truth test. -function every(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !_isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; - } - return true; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/some.js - - - - -// Determine if at least one element in the object passes a truth test. -function some(obj, predicate, context) { - predicate = cb(predicate, context); - var _keys = !_isArrayLike(obj) && keys(obj), - length = (_keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = _keys ? _keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/contains.js - - - - -// Determine if the array or object contains a given item (using `===`). -function contains(obj, item, fromIndex, guard) { - if (!_isArrayLike(obj)) obj = values(obj); - if (typeof fromIndex != 'number' || guard) fromIndex = 0; - return indexOf(obj, item, fromIndex) >= 0; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/invoke.js - - - - - - -// Invoke a method (with arguments) on every item in a collection. -/* harmony default export */ const invoke = (restArguments(function(obj, path, args) { - var contextPath, func; - if (modules_isFunction(path)) { - func = path; - } else { - path = _toPath_toPath(path); - contextPath = path.slice(0, -1); - path = path[path.length - 1]; - } - return map(obj, function(context) { - var method = func; - if (!method) { - if (contextPath && contextPath.length) { - context = deepGet(context, contextPath); - } - if (context == null) return void 0; - method = context[path]; - } - return method == null ? method : method.apply(context, args); - }); -})); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/pluck.js - - - -// Convenience version of a common use case of `_.map`: fetching a property. -function pluck(obj, key) { - return map(obj, property(key)); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/where.js - - - -// Convenience version of a common use case of `_.filter`: selecting only -// objects containing specific `key:value` pairs. -function where(obj, attrs) { - return filter(obj, matcher(attrs)); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/max.js - - - - - -// Return the maximum element (or element-based computation). -function max(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = _isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value > result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/min.js - - - - - -// Return the minimum element (or element-based computation). -function min(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { - obj = _isArrayLike(obj) ? obj : values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value != null && value < result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - each(obj, function(v, index, list) { - computed = iteratee(v, index, list); - if (computed < lastComputed || (computed === Infinity && result === Infinity)) { - result = v; - lastComputed = computed; - } - }); - } - return result; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/toArray.js - - - - - - - - -// Safely create a real, live array from anything iterable. -var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; -function toArray(obj) { - if (!obj) return []; - if (isArray(obj)) return slice.call(obj); - if (isString(obj)) { - // Keep surrogate pair characters together. - return obj.match(reStrSymbol); - } - if (_isArrayLike(obj)) return map(obj, identity); - return values(obj); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/sample.js - - - - - - -// Sample **n** random values from a collection using the modern version of the -// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). -// If **n** is not specified, returns a single random element. -// The internal `guard` argument allows it to work with `_.map`. -function sample(obj, n, guard) { - if (n == null || guard) { - if (!_isArrayLike(obj)) obj = values(obj); - return obj[random(obj.length - 1)]; - } - var sample = toArray(obj); - var length = _getLength(sample); - n = Math.max(Math.min(n, length), 0); - var last = length - 1; - for (var index = 0; index < n; index++) { - var rand = random(index, last); - var temp = sample[index]; - sample[index] = sample[rand]; - sample[rand] = temp; - } - return sample.slice(0, n); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/shuffle.js - - -// Shuffle a collection. -function shuffle(obj) { - return sample(obj, Infinity); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/sortBy.js - - - - -// Sort the object's values by a criterion produced by an iteratee. -function sortBy(obj, iteratee, context) { - var index = 0; - iteratee = cb(iteratee, context); - return pluck(map(obj, function(value, key, list) { - return { - value: value, - index: index++, - criteria: iteratee(value, key, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_group.js - - - -// An internal function used for aggregate "group by" operations. -function group(behavior, partition) { - return function(obj, iteratee, context) { - var result = partition ? [[], []] : {}; - iteratee = cb(iteratee, context); - each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/groupBy.js - - - -// Groups the object's values by a criterion. Pass either a string attribute -// to group by, or a function that returns the criterion. -/* harmony default export */ const groupBy = (group(function(result, value, key) { - if (has(result, key)) result[key].push(value); else result[key] = [value]; -})); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/indexBy.js - - -// Indexes the object's values by a criterion, similar to `_.groupBy`, but for -// when you know that your index values will be unique. -/* harmony default export */ const indexBy = (group(function(result, value, key) { - result[key] = value; -})); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/countBy.js - - - -// Counts instances of an object that group by a certain criterion. Pass -// either a string attribute to count by, or a function that returns the -// criterion. -/* harmony default export */ const countBy = (group(function(result, value, key) { - if (has(result, key)) result[key]++; else result[key] = 1; -})); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/partition.js - - -// Split a collection into two arrays: one whose elements all pass the given -// truth test, and one whose elements all do not pass the truth test. -/* harmony default export */ const partition = (group(function(result, value, pass) { - result[pass ? 0 : 1].push(value); -}, true)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/size.js - - - -// Return the number of elements in a collection. -function size(obj) { - if (obj == null) return 0; - return _isArrayLike(obj) ? obj.length : keys(obj).length; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_keyInObj.js -// Internal `_.pick` helper function to determine whether `key` is an enumerable -// property name of `obj`. -function keyInObj(value, key, obj) { - return key in obj; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/pick.js - - - - - - - -// Return a copy of the object only containing the allowed properties. -/* harmony default export */ const pick = (restArguments(function(obj, keys) { - var result = {}, iteratee = keys[0]; - if (obj == null) return result; - if (modules_isFunction(iteratee)) { - if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); - keys = allKeys(obj); - } else { - iteratee = keyInObj; - keys = flatten(keys, false, false); - obj = Object(obj); - } - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - return result; -})); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/omit.js - - - - - - - - -// Return a copy of the object without the disallowed properties. -/* harmony default export */ const omit = (restArguments(function(obj, keys) { - var iteratee = keys[0], context; - if (modules_isFunction(iteratee)) { - iteratee = negate(iteratee); - if (keys.length > 1) context = keys[1]; - } else { - keys = map(flatten(keys, false, false), String); - iteratee = function(value, key) { - return !contains(keys, key); - }; - } - return pick(obj, iteratee, context); -})); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/initial.js - - -// Returns everything but the last entry of the array. Especially useful on -// the arguments object. Passing **n** will return all the values in -// the array, excluding the last N. -function initial(array, n, guard) { - return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/first.js - - -// Get the first element of an array. Passing **n** will return the first N -// values in the array. The **guard** check allows it to work with `_.map`. -function first(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[0]; - return initial(array, array.length - n); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/rest.js - - -// Returns everything but the first entry of the `array`. Especially useful on -// the `arguments` object. Passing an **n** will return the rest N values in the -// `array`. -function rest(array, n, guard) { - return slice.call(array, n == null || guard ? 1 : n); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/last.js - - -// Get the last element of an array. Passing **n** will return the last N -// values in the array. -function last(array, n, guard) { - if (array == null || array.length < 1) return n == null || guard ? void 0 : []; - if (n == null || guard) return array[array.length - 1]; - return rest(array, Math.max(0, array.length - n)); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/compact.js - - -// Trim out all falsy values from an array. -function compact(array) { - return filter(array, Boolean); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/flatten.js - - -// Flatten out an array, either recursively (by default), or up to `depth`. -// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. -function flatten_flatten(array, depth) { - return flatten(array, depth, false); -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/difference.js - - - - - -// Take the difference between one array and a number of other arrays. -// Only the elements present in just the first array will remain. -/* harmony default export */ const difference = (restArguments(function(array, rest) { - rest = flatten(rest, true, true); - return filter(array, function(value){ - return !contains(rest, value); - }); -})); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/without.js - - - -// Return a version of the array that does not contain the specified value(s). -/* harmony default export */ const without = (restArguments(function(array, otherArrays) { - return difference(array, otherArrays); -})); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/uniq.js - - - - - -// Produce a duplicate-free version of the array. If the array has already -// been sorted, you have the option of using a faster algorithm. -// The faster algorithm will not work with an iteratee if the iteratee -// is not a one-to-one function, so providing an iteratee will disable -// the faster algorithm. -function uniq(array, isSorted, iteratee, context) { - if (!isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = cb(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = _getLength(array); i < length; i++) { - var value = array[i], - computed = iteratee ? iteratee(value, i, array) : value; - if (isSorted && !iteratee) { - if (!i || seen !== computed) result.push(value); - seen = computed; - } else if (iteratee) { - if (!contains(seen, computed)) { - seen.push(computed); - result.push(value); - } - } else if (!contains(result, value)) { - result.push(value); - } - } - return result; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/union.js - - - - -// Produce an array that contains the union: each distinct element from all of -// the passed-in arrays. -/* harmony default export */ const union = (restArguments(function(arrays) { - return uniq(flatten(arrays, true, true)); -})); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/intersection.js - - - -// Produce an array that contains every item shared between all the -// passed-in arrays. -function intersection(array) { - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = _getLength(array); i < length; i++) { - var item = array[i]; - if (contains(result, item)) continue; - var j; - for (j = 1; j < argsLength; j++) { - if (!contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); - } - return result; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/unzip.js - - - - -// Complement of zip. Unzip accepts an array of arrays and groups -// each array's elements on shared indices. -function unzip(array) { - var length = (array && max(array, _getLength).length) || 0; - var result = Array(length); - - for (var index = 0; index < length; index++) { - result[index] = pluck(array, index); - } - return result; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/zip.js - - - -// Zip together multiple lists into a single array -- elements that share -// an index go together. -/* harmony default export */ const zip = (restArguments(unzip)); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/object.js - - -// Converts lists into objects. Pass either a single array of `[key, value]` -// pairs, or two parallel arrays of the same length -- one of keys, and one of -// the corresponding values. Passing by pairs is the reverse of `_.pairs`. -function object(list, values) { - var result = {}; - for (var i = 0, length = _getLength(list); i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/range.js -// Generate an integer Array containing an arithmetic progression. A port of -// the native Python `range()` function. See -// [the Python documentation](https://docs.python.org/library/functions.html#range). -function range(start, stop, step) { - if (stop == null) { - stop = start || 0; - start = 0; - } - if (!step) { - step = stop < start ? -1 : 1; - } - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/chunk.js - - -// Chunk a single array into multiple arrays, each containing `count` or fewer -// items. -function chunk(array, count) { - if (count == null || count < 1) return []; - var result = []; - var i = 0, length = array.length; - while (i < length) { - result.push(slice.call(array, i, i += count)); - } - return result; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/_chainResult.js - - -// Helper function to continue chaining intermediate results. -function chainResult(instance, obj) { - return instance._chain ? _(obj).chain() : obj; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/mixin.js - - - - - - -// Add your own custom functions to the Underscore object. -function mixin(obj) { - each(functions(obj), function(name) { - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return chainResult(this, func.apply(_, args)); - }; - }); - return _; -} - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/underscore-array-methods.js - - - - - -// Add all mutator `Array` functions to the wrapper. -each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) { - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) { - delete obj[0]; - } - } - return chainResult(this, obj); - }; -}); - -// Add all accessor `Array` functions to the wrapper. -each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - if (obj != null) obj = method.apply(obj, arguments); - return chainResult(this, obj); - }; -}); - -/* harmony default export */ const underscore_array_methods = (_); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/index.js -// Named Exports -// ============= - -// Underscore.js 1.13.6 -// https://underscorejs.org -// (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. - -// Baseline setup. - - - -// Object Functions -// ---------------- -// Our most fundamental functions operate on any JavaScript object. -// Most functions in Underscore depend on at least one function in this section. - -// A group of functions that check the types of core JavaScript values. -// These are often informally referred to as the "isType" functions. - - - - - - - - - - - - - - - - - - - - - - - - - - - -// Functions that treat an object as a dictionary of key-value pairs. - - - - - - - - - - - - - - - - -// Utility Functions -// ----------------- -// A bit of a grab bag: Predicate-generating functions for use with filters and -// loops, string escaping and templating, create random numbers and unique ids, -// and functions that facilitate Underscore's chaining and iteration conventions. - - - - - - - - - - - - - - - - - - - -// Function (ahem) Functions -// ------------------------- -// These functions take a function as an argument and return a new function -// as the result. Also known as higher-order functions. - - - - - - - - - - - - - - - -// Finders -// ------- -// Functions that extract (the position of) a single element from an object -// or array based on some criterion. - - - - - - - - - -// Collection Functions -// -------------------- -// Functions that work on any collection of elements: either an array, or -// an object of key-value pairs. - - - - - - - - - - - - - - - - - - - - - - - - -// `_.pick` and `_.omit` are actually object functions, but we put -// them here in order to create a more natural reading order in the -// monolithic build as they depend on `_.contains`. - - - -// Array Functions -// --------------- -// Functions that operate on arrays (and array-likes) only, because they’re -// expressed in terms of operations on an ordered list of values. - - - - - - - - - - - - - - - - - -// OOP -// --- -// These modules support the "object-oriented" calling style. See also -// `underscore.js` and `index-default.js`. - - - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/index-default.js -// Default Export -// ============== -// In this module, we mix our bundled exports into the `_` object and export -// the result. This is analogous to setting `module.exports = _` in CommonJS. -// Hence, this module is also the entry point of our UMD bundle and the package -// entry point for CommonJS and AMD users. In other words, this is (the source -// of) the module you are interfacing with when you do any of the following: -// -// ```js -// // CommonJS -// var _ = require('underscore'); -// -// // AMD -// define(['underscore'], function(_) {...}); -// -// // UMD in the browser -// // _ is available as a global variable -// ``` - - - -// Add all of the Underscore functions to the wrapper object. -var index_default_ = mixin(modules_namespaceObject); -// Legacy Node.js API. -index_default_._ = index_default_; -// Export the Underscore API. -/* harmony default export */ const index_default = (index_default_); - -;// CONCATENATED MODULE: ./node_modules/underscore/modules/index-all.js -// ESM Exports -// =========== -// This module is the package entry point for ES module users. In other words, -// it is the module they are interfacing with when they import from the whole -// package instead of from a submodule, like this: -// -// ```js -// import { map } from 'underscore'; -// ``` -// -// The difference with `./index-default`, which is the package entry point for -// CommonJS, AMD and UMD users, is purely technical. In ES modules, named and -// default exports are considered to be siblings, so when you have a default -// export, its properties are not automatically available as named exports. For -// this reason, we re-export the named exports in addition to providing the same -// default export as in `./index-default`. - - - - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/compat get default export */ -/******/ (() => { -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = (module) => { -/******/ var getter = module && module.__esModule ? -/******/ () => (module['default']) : -/******/ () => (module); -/******/ __webpack_require__.d(getter, { a: getter }); -/******/ return getter; -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/global */ -/******/ (() => { -/******/ __webpack_require__.g = (function() { -/******/ if (typeof globalThis === 'object') return globalThis; -/******/ try { -/******/ return this || new Function('return this')(); -/******/ } catch (e) { -/******/ if (typeof window === 'object') return window; -/******/ } -/******/ })(); -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. -(() => { - -// EXPORTS -__webpack_require__.d(__webpack_exports__, { - ZP: () => (/* binding */ src_0), - kr: () => (/* binding */ grapesjs), - j7: () => (/* binding */ usePlugin) -}); - -// EXTERNAL MODULE: ./node_modules/underscore/modules/index-all.js + 160 modules -var index_all = __webpack_require__(50); -// EXTERNAL MODULE: ./src/utils/mixins.ts -var mixins = __webpack_require__(163); -;// CONCATENATED MODULE: ./src/utils/html.ts - -/** - * Safe ES6 tagged template strings - * @param {Array} literals - * @param {Array} substs - * @returns {String} - * @example - * const str = 'Hello'; - * const strHtml = html`Escaped ${str}, unescaped $${str}`; - */ -function html(literals) { - var substs = []; - for (var _i = 1; _i < arguments.length; _i++) { - substs[_i - 1] = arguments[_i]; - } - var raw = literals.raw; - return raw.reduce(function (acc, lit, i) { - var subst = substs[i - 1]; - var last = raw[i - 1]; - if (Array.isArray(subst)) { - subst = subst.join(''); - } - else if (last && last.slice(-1) === '$') { - // If the interpolation is preceded by a dollar sign, it won't be escaped - acc = acc.slice(0, -1); - } - else { - subst = (0,mixins.escape)(subst); - } - return acc + subst + lit; - }); -} - -;// CONCATENATED MODULE: ./src/editor/config/config.ts -var config = { - stylePrefix: 'gjs-', - components: '', - style: '', - fromElement: false, - projectData: undefined, - noticeOnUnload: true, - showOffsets: false, - showOffsetsSelected: false, - forceClass: true, - height: '900px', - width: '100%', - log: ['warning', 'error'], - baseCss: '', - protectedCss: '* { box-sizing: border-box; } body {margin: 0;}', - canvasCss: '', - defaultCommand: 'select-comp', - showToolbar: true, - showDevices: true, - devicePreviewMode: false, - mediaCondition: 'max-width', - tagVarStart: '{[ ', - tagVarEnd: ' ]}', - keepEmptyTextNodes: false, - jsInHtml: true, - nativeDnD: true, - multipleSelection: true, - optsHtml: {}, - optsCss: {}, - avoidInlineStyle: true, - avoidDefaults: true, - clearStyles: false, - listenToEl: [], - cssIcons: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', - icons: { - close: '', - move: '', - plus: '', - caret: '', - delete: '', - copy: '', - arrowUp: '', - chevron: '', - eye: '', - eyeOff: '', - }, - i18n: {}, - undoManager: {}, - assetManager: {}, - canvas: {}, - layerManager: {}, - storageManager: {}, - richTextEditor: {}, - domComponents: {}, - modal: {}, - codeManager: {}, - panels: {}, - commands: {}, - cssComposer: {}, - selectorManager: {}, - deviceManager: {}, - styleManager: {}, - blockManager: {}, - traitManager: {}, - textViewCode: 'Code', - keepUnusedStyles: false, - customUI: false, -}; -/* harmony default export */ const config_config = (config); - -// EXTERNAL MODULE: ./node_modules/backbone/backbone.js -var backbone = __webpack_require__(316); -var backbone_default = /*#__PURE__*/__webpack_require__.n(backbone); -// EXTERNAL MODULE: ./src/utils/cash-dom.ts -var cash_dom = __webpack_require__(895); -;// CONCATENATED MODULE: ./src/utils/extender.ts - -/* harmony default export */ const extender = (function (_a) { - var $ = _a.$; - if ($ && $.prototype && $.prototype.constructor.name !== 'jQuery') { - var fn = $.fn; - // Additional helpers - fn.hide = function () { - return this.css('display', 'none'); - }; - fn.show = function () { - return this.css('display', 'block'); - }; - fn.focus = function () { - var el = this.get(0); - el && el.focus(); - return this; - }; - // For spectrum compatibility - fn.bind = function (ev, h) { - return this.on(ev, h); - }; - fn.unbind = function (ev, h) { - if ((0,index_all.isObject)(ev)) { - for (var name_1 in ev) { - ev.hasOwnProperty(name_1) && this.off(name_1, ev[name_1]); - } - return this; - } - else { - return this.off(ev, h); - } - }; - fn.click = function (h) { - return h ? this.on('click', h) : this.trigger('click'); - }; - fn.change = function (h) { - return h ? this.on('change', h) : this.trigger('change'); - }; - fn.keydown = function (h) { - return h ? this.on('keydown', h) : this.trigger('keydown'); - }; - fn.delegate = function (selector, events, data, handler) { - if (!handler) { - handler = data; - } - return this.on(events, selector, function (e) { - e.data = data; - handler(e); - }); - }; - fn.scrollLeft = function () { - var el = this.get(0); - el = el.nodeType == 9 ? el.defaultView : el; - var win = el instanceof Window ? el : null; - return win ? win.pageXOffset : el.scrollLeft || 0; - }; - fn.scrollTop = function () { - var el = this.get(0); - el = el.nodeType == 9 ? el.defaultView : el; - var win = el instanceof Window ? el : null; - return win ? win.pageYOffset : el.scrollTop || 0; - }; - var offset_1 = $.prototype.offset; - fn.offset = function (coords) { - var top, left; - if (coords) { - top = coords.top; - left = coords.left; - } - if (typeof top != 'undefined') { - this.css('top', "".concat(top, "px")); - } - if (typeof left != 'undefined') { - this.css('left', "".concat(left, "px")); - } - return offset_1.call(this); - }; - $.map = function (items, clb) { - var ar = []; - for (var i = 0; i < items.length; i++) { - ar.push(clb(items[i], i)); - } - return ar; - }; - var indexOf_1 = Array.prototype.indexOf; - $.inArray = function (val, arr, i) { - return arr == null ? -1 : indexOf_1.call(arr, val, i); - }; - $.Event = function (src, props) { - if (!(this instanceof $.Event)) { - return new $.Event(src, props); - } - this.type = src; - this.isDefaultPrevented = function () { return false; }; - }; - } -}); - -// EXTERNAL MODULE: ./src/common/index.ts -var common = __webpack_require__(346); -;// CONCATENATED MODULE: ./src/editor/model/Selected.ts -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var Selectable = /** @class */ (function (_super) { - __extends(Selectable, _super); - function Selectable() { - return _super !== null && _super.apply(this, arguments) || this; - } - return Selectable; -}(common/* Model */.Hn)); - -var Selected = /** @class */ (function (_super) { - __extends(Selected, _super); - function Selected() { - return _super !== null && _super.apply(this, arguments) || this; - } - Selected.prototype.getByComponent = function (component) { - var _this = this; - return this.filter(function (s) { return _this.getComponent(s) === component; })[0]; - }; - Selected.prototype.addComponent = function (component, opts) { - var _this = this; - var toAdd = ((0,index_all.isArray)(component) ? component : [component]) - .filter(function (c) { return !_this.hasComponent(c); }) - .map(function (component) { return new Selectable({ component: component }); })[0]; - return this.push(toAdd, opts); - }; - Selected.prototype.getComponent = function (model) { - return model.get('component'); - }; - Selected.prototype.hasComponent = function (component) { - var model = this.getByComponent(component); - return model && this.contains(model); - }; - Selected.prototype.lastComponent = function () { - var last = this.last(); - return last ? this.getComponent(last) : undefined; - }; - Selected.prototype.allComponents = function () { - var _this = this; - return this.map(function (s) { return _this.getComponent(s); }).filter(function (i) { return i; }); - }; - Selected.prototype.removeComponent = function (component, opts) { - var _this = this; - var toRemove = ((0,index_all.isArray)(component) ? component : [component]).map(function (c) { return _this.getByComponent(c); }); - return this.remove(toRemove, opts); - }; - return Selected; -}(common/* Collection */.FE)); -/* harmony default export */ const model_Selected = (Selected); - -;// CONCATENATED MODULE: ./src/abstract/Module.ts -var Module_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __assign = (undefined && undefined.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - - -var Module = /** @class */ (function () { - function Module(em, moduleName, defaults) { - this.debounced = []; - this.collections = []; - this.cls = []; - this._em = em; - this._name = moduleName; - var name = (this.name.charAt(0).toLowerCase() + this.name.slice(1)); - var cfgParent = !(0,index_all.isUndefined)(em.config[name]) ? em.config[name] : em.config[this.name]; - var cfg = (cfgParent === true ? {} : cfgParent || {}); - cfg.pStylePrefix = em.config.pStylePrefix || ''; - if (!(0,index_all.isUndefined)(cfgParent) && !cfgParent) { - cfg._disable = 1; - } - cfg.em = em; - this._config = (0,mixins.deepMerge)(defaults || {}, cfg); - } - Object.defineProperty(Module.prototype, "em", { - get: function () { - return this._em; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Module.prototype, "config", { - get: function () { - return this._config; - }, - enumerable: false, - configurable: true - }); - Module.prototype.render = function (opts) { }; - Module.prototype.postLoad = function (key) { }; - Object.defineProperty(Module.prototype, "name", { - get: function () { - return this._name; - }, - enumerable: false, - configurable: true - }); - Module.prototype.getConfig = function (name) { - // @ts-ignore - return name ? this.config[name] : this.config; - }; - Module.prototype.__logWarn = function (str, opts) { - if (opts === void 0) { opts = {}; } - this.em.logWarning("[".concat(this.name, "]: ").concat(str), opts); - }; - Module.prototype.destroy = function () { - this.__destroy(); - }; - Module.prototype.__destroy = function () { - var _a, _b, _c; - (_a = this.view) === null || _a === void 0 ? void 0 : _a.remove(); - (_b = this.state) === null || _b === void 0 ? void 0 : _b.stopListening(); - (_c = this.state) === null || _c === void 0 ? void 0 : _c.clear(); - this.debounced.forEach(function (d) { return d.cancel(); }); - this.collections.forEach(function (c) { - c.stopListening(); - c.reset(); - }); - }; - /** - * Move the main DOM element of the module. - * To execute only post editor render (in postRender) - */ - Module.prototype.__appendTo = function () { - var elTo = this.getConfig().appendTo; - if (elTo) { - var el = (0,index_all.isElement)(elTo) ? elTo : document.querySelector(elTo); - if (!el) - return this.__logWarn('"appendTo" element not found'); - el.appendChild(this.render()); - } - }; - return Module; -}()); -/* harmony default export */ const abstract_Module = (Module); -var ItemManagerModule = /** @class */ (function (_super) { - Module_extends(ItemManagerModule, _super); - function ItemManagerModule(em, moduleName, all, events, defaults, opts) { - if (opts === void 0) { opts = {}; } - var _this = _super.call(this, em, moduleName, defaults) || this; - _this.cls = []; - _this.private = false; - _this.all = all; - _this.events = events; - !opts.skipListen && _this.__initListen(); - return _this; - } - ItemManagerModule.prototype.postLoad = function (key) { }; - ItemManagerModule.prototype.render = function (opts) { }; - ItemManagerModule.prototype.getProjectData = function (data) { - var obj = {}; - var key = this.storageKey; - if (key) { - obj[key] = data || this.getAll(); - } - return obj; - }; - ItemManagerModule.prototype.loadProjectData = function (data, param) { - if (data === void 0) { data = {}; } - if (param === void 0) { param = {}; } - var all = param.all, onResult = param.onResult, reset = param.reset; - var key = this.storageKey; - var opts = { action: 'load' }; - var coll = all || this.all; - var result = data[key]; - if (typeof result == 'string') { - try { - result = JSON.parse(result); - } - catch (err) { - this.__logWarn('Data parsing failed', { input: result }); - } - } - reset && result && coll.reset(undefined, opts); - if (onResult) { - result && onResult(result, opts); - } - else if (result && (0,mixins.isDef)(result.length)) { - coll.reset(result, opts); - } - return result; - }; - ItemManagerModule.prototype.clear = function (opts) { - if (opts === void 0) { opts = {}; } - var all = this.all; - all && all.reset(undefined, opts); - return this; - }; - // getAll(): TCollection extends Collection ? C[] : TCollection { - ItemManagerModule.prototype.getAll = function () { - return __spreadArray([], this.all.models, true); - }; - ItemManagerModule.prototype.getAllMap = function () { - return this.getAll().reduce(function (acc, i) { - acc[i.get(i.idAttribute)] = i; - return acc; - }, {}); - }; - ItemManagerModule.prototype.__initListen = function (opts) { - if (opts === void 0) { opts = {}; } - var _a = this, all = _a.all, em = _a.em, events = _a.events; - all && - em && - all - .on('add', function (m, c, o) { return em.trigger(events.add, m, o); }) - .on('remove', function (m, c, o) { return em.trigger(events.remove, m, o); }) - .on('change', function (p, c) { return em.trigger(events.update, p, p.changedAttributes(), c); }) - .on('all', this.__catchAllEvent, this); - // Register collections - this.cls = [all].concat(opts.collections || []); - // Propagate events - (opts.propagate || []).forEach(function (_a) { - var entity = _a.entity, event = _a.event; - entity.on('all', function (ev, model, coll, opts) { - var options = opts || coll; - var opt = __assign({ event: ev }, options); - [em, all].map(function (md) { return md.trigger(event, model, opt); }); - }); - }); - }; - ItemManagerModule.prototype.__remove = function (model, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - var em = this.em; - //@ts-ignore - var md = (0,index_all.isString)(model) ? this.get(model) : model; - var rm = function () { - md && _this.all.remove(md, opts); - return md; - }; - !opts.silent && (em === null || em === void 0 ? void 0 : em.trigger(this.events.removeBefore, md, rm, opts)); - return !opts.abort && rm(); - }; - ItemManagerModule.prototype.__catchAllEvent = function (event, model, coll, opts) { - var _a = this, em = _a.em, events = _a.events; - var options = opts || coll; - em && events.all && em.trigger(events.all, { event: event, model: model, options: options }); - this.__onAllEvent(); - }; - ItemManagerModule.prototype.__appendTo = function (renderProps) { - //@ts-ignore - var elTo = this.config.appendTo; - if (elTo) { - var el = (0,index_all.isElement)(elTo) ? elTo : document.querySelector(elTo); - if (!el) - return this.__logWarn('"appendTo" element not found'); - // @ts-ignore - el.appendChild(this.render(renderProps)); - } - }; - ItemManagerModule.prototype.__onAllEvent = function () { }; - ItemManagerModule.prototype._createId = function (len) { - if (len === void 0) { len = 16; } - var all = this.getAll(); - var ln = all.length + len; - var allMap = this.getAllMap(); - var id; - do { - id = (0,mixins.createId)(ln); - } while (allMap[id]); - return id; - }; - ItemManagerModule.prototype.__listenAdd = function (model, event) { - var _this = this; - model.on('add', function (m, c, o) { return _this.em.trigger(event, m, o); }); - }; - ItemManagerModule.prototype.__listenRemove = function (model, event) { - var _this = this; - model.on('remove', function (m, c, o) { return _this.em.trigger(event, m, o); }); - }; - ItemManagerModule.prototype.__listenUpdate = function (model, event) { - var _this = this; - model.on('change', function (p, c) { return _this.em.trigger(event, p, p.changedAttributes(), c); }); - }; - ItemManagerModule.prototype.__destroy = function () { - var _a; - this.cls.forEach(function (coll) { - coll.stopListening(); - coll.reset(); - }); - (_a = this.view) === null || _a === void 0 ? void 0 : _a.remove(); - this.view = undefined; - }; - return ItemManagerModule; -}(Module)); - - -;// CONCATENATED MODULE: ./src/canvas/config/config.ts -var config_config_config = { - stylePrefix: 'cv-', - scripts: [], - styles: [], - customBadgeLabel: undefined, - autoscrollLimit: 50, - extHl: false, - frameContent: '', - frameStyle: "\n body { background-color: #fff }\n * ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1) }\n * ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2) }\n * ::-webkit-scrollbar { width: 10px }\n ", - notTextable: ['button', 'a', 'input[type=checkbox]', 'input[type=radio]'], - allowExternalDrop: true, -}; -/* harmony default export */ const canvas_config_config = (config_config_config); - -// EXTERNAL MODULE: ./src/abstract/ModuleModel.ts -var ModuleModel = __webpack_require__(642); -;// CONCATENATED MODULE: ./src/device_manager/config/config.ts -var device_manager_config_config_config = { - default: '', - devices: [ - { - id: 'desktop', - name: 'Desktop', - width: '', - }, - { - id: 'tablet', - name: 'Tablet', - width: '770px', - widthMedia: '992px', - }, - { - id: 'mobileLandscape', - name: 'Mobile landscape', - width: '568px', - widthMedia: '768px', - }, - { - id: 'mobilePortrait', - name: 'Mobile portrait', - width: '320px', - widthMedia: '480px', - }, - ], -}; -/* harmony default export */ const device_manager_config_config = (device_manager_config_config_config); - -;// CONCATENATED MODULE: ./src/device_manager/model/Device.ts -var Device_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -/** - * @typedef Device - * @property {String} [name=''] Device type, eg. `Mobile` - * @property {String} [width] Width to set for the editor iframe, eg. '900px' - * @property {String} [height=''] Height to set for the editor iframe, eg. '600px' - * @property {String} [widthMedia=''] The width which will be used in media queries, If empty the width will be used - * @property {Number} [priority=null] Setup the order of media queries - */ -var Device = /** @class */ (function (_super) { - Device_extends(Device, _super); - function Device() { - return _super !== null && _super.apply(this, arguments) || this; - } - Device.prototype.defaults = function () { - return { - name: '', - width: null, - height: '', - widthMedia: null, - priority: null, - }; - }; - Device.prototype.initialize = function () { - var _this = this; - this.get('widthMedia') === null && this.set('widthMedia', this.get('width')); - this.get('width') === null && this.set('width', this.get('widthMedia')); - !this.get('priority') && this.set('priority', parseFloat(this.get('widthMedia')) || 0); - var toCheck = ['width', 'height', 'widthMedia']; - toCheck.forEach(function (prop) { return _this.checkUnit(prop); }); - }; - Device.prototype.checkUnit = function (prop) { - var pr = (this.get(prop) || ''); - var noUnit = (parseFloat(pr) || 0).toString() === pr.toString(); - noUnit && this.set(prop, "".concat(pr, "px")); - }; - Device.prototype.getName = function () { - return this.get('name') || this.get('id'); - }; - Device.prototype.getWidthMedia = function () { - return this.get('widthMedia') || ''; - }; - return Device; -}(common/* Model */.Hn)); -/* harmony default export */ const model_Device = (Device); - -;// CONCATENATED MODULE: ./src/device_manager/model/Devices.ts -var Devices_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var Devices = /** @class */ (function (_super) { - Devices_extends(Devices, _super); - function Devices() { - return _super !== null && _super.apply(this, arguments) || this; - } - return Devices; -}(common/* Collection */.FE)); -/* harmony default export */ const model_Devices = (Devices); -Devices.prototype.model = model_Device; - -;// CONCATENATED MODULE: ./src/device_manager/view/DevicesView.ts -var DevicesView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __makeTemplateObject = (undefined && undefined.__makeTemplateObject) || function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - - -var DevicesView = /** @class */ (function (_super) { - DevicesView_extends(DevicesView, _super); - function DevicesView(o) { - var _this = _super.call(this, o) || this; - _this.config = o.config || {}; - _this.em = _this.config.em; - _this.ppfx = _this.config.pStylePrefix || ''; - _this.listenTo(_this.em, 'change:device', _this.updateSelect); - return _this; - } - DevicesView.prototype.template = function (_a) { - var ppfx = _a.ppfx, label = _a.label; - return html(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n
", "
\n
\n \n \n \n
\n
\n
\n
\n \n "], ["\n
", "
\n
\n \n \n \n
\n
\n
\n
\n \n "])), ppfx, label, ppfx, ppfx, ppfx, ppfx, ppfx, ppfx, ppfx); - }; - DevicesView.prototype.events = function () { - return { - change: 'updateDevice', - 'click [data-add-trasp]': 'startAdd', - }; - }; - /** - * Start adding new device - * @return {[type]} [description] - * @private - */ - DevicesView.prototype.startAdd = function () { }; - /** - * Update device of the editor - * @private - */ - DevicesView.prototype.updateDevice = function () { - var em = this.em; - if (em) { - var devEl = this.devicesEl; - em.set('device', devEl ? devEl.val() : ''); - } - }; - /** - * Update select value on device update - * @private - */ - DevicesView.prototype.updateSelect = function () { - var _a = this, em = _a.em, devicesEl = _a.devicesEl; - if (em && em.getDeviceModel && devicesEl) { - var device = em.getDeviceModel(); - devicesEl.val(device ? device.get('id') : ''); - } - }; - /** - * Return devices options - * @return {string} String of options - * @private - */ - DevicesView.prototype.getOptions = function () { - var _a = this, collection = _a.collection, em = _a.em; - var result = ''; - collection.forEach(function (device) { - var _a = device.attributes, name = _a.name, id = _a.id; - var label = (em && em.t && em.t("deviceManager.devices.".concat(id))) || name; - result += ""); - }); - return result; - }; - DevicesView.prototype.render = function () { - var _a = this, em = _a.em, ppfx = _a.ppfx, $el = _a.$el, el = _a.el; - var label = em && em.t && em.t('deviceManager.device'); - $el.html(this.template({ ppfx: ppfx, label: label })); - this.devicesEl = $el.find(".".concat(ppfx, "devices")); - this.devicesEl.append(this.getOptions()); - this.devicesEl.val(em.get('device')); - el.className = "".concat(ppfx, "devices-c"); - return this; - }; - return DevicesView; -}(common/* View */.G7)); -/* harmony default export */ const view_DevicesView = (DevicesView); -var templateObject_1; - -;// CONCATENATED MODULE: ./src/device_manager/index.ts -var device_manager_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var device_manager_assign = (undefined && undefined.__assign) || function () { - device_manager_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return device_manager_assign.apply(this, arguments); -}; -/** - * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/device_manager/config/config.ts) - * ```js - * const editor = grapesjs.init({ - * deviceManager: { - * // options - * } - * }) - * ``` - * - * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance - * - * ```js - * const deviceManager = editor.Devices; - * ``` - * ## Available Events - * * `device:add` - Added new device. The [Device] is passed as an argument to the callback - * * `device:remove` - Device removed. The [Device] is passed as an argument to the callback - * * `device:select` - New device selected. The newly selected [Device] and the previous one, are passed as arguments to the callback - * * `device:update` - Device updated. The updated [Device] and the object containing changes are passed as arguments to the callback - * * `device` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback - * - * ## Methods - * * [add](#add) - * * [get](#get) - * * [getDevices](#getdevices) - * * [remove](#remove) - * * [select](#select) - * * [getSelected](#getselected) - * - * [Device]: device.html - * - * @module Devices - */ - - - - - - -var evAll = 'device'; -var evPfx = "".concat(evAll, ":"); -var evSelect = "".concat(evPfx, "select"); -var evSelectBefore = "".concat(evSelect, ":before"); -var evUpdate = "".concat(evPfx, "update"); -var evAdd = "".concat(evPfx, "add"); -var evAddBefore = "".concat(evAdd, ":before"); -var evRemove = "".concat(evPfx, "remove"); -var evRemoveBefore = "".concat(evRemove, ":before"); -var chnSel = 'change:device'; -var deviceEvents = { - all: evAll, - select: evSelect, - update: evUpdate, - add: evAdd, - remove: evRemove, - removeBefore: evRemoveBefore, -}; -var DeviceManager = /** @class */ (function (_super) { - device_manager_extends(DeviceManager, _super); - function DeviceManager(em) { - var _a; - var _this = _super.call(this, em, 'DeviceManager', new model_Devices(), deviceEvents, device_manager_config_config) || this; - _this.Device = model_Device; - _this.Devices = model_Devices; - _this.storageKey = ''; - _this.devices = _this.all; - (_a = _this.config.devices) === null || _a === void 0 ? void 0 : _a.forEach(function (device) { return _this.add(device, { silent: true }); }); - _this.select(_this.config.default || _this.devices.at(0)); - em.on(chnSel, _this._onSelect, _this); - return _this; - } - DeviceManager.prototype._onSelect = function (m, deviceId, opts) { - var _a = this, em = _a.em, events = _a.events; - var prevId = m.previous('device'); - var newDevice = this.get(deviceId); - var ev = events.select; - em.trigger(ev, newDevice, this.get(prevId)); - this.__catchAllEvent(ev, newDevice, opts); - }; - /** - * Add new device - * @param {Object} props Device properties - * @returns {[Device]} Added device - * @example - * const device1 = deviceManager.add({ - * // Without an explicit ID, the `name` will be taken. In case of missing `name`, a random ID will be created. - * id: 'tablet', - * name: 'Tablet', - * width: '900px', // This width will be applied on the canvas frame and for the CSS media - * }); - * const device2 = deviceManager.add({ - * id: 'tablet2', - * name: 'Tablet 2', - * width: '800px', // This width will be applied on the canvas frame - * widthMedia: '810px', // This width that will be used for the CSS media - * height: '600px', // Height will be applied on the canvas frame - * }); - */ - DeviceManager.prototype.add = function (props, options) { - if (options === void 0) { options = {}; } - var result; - var opts = options; - // Support old API - if ((0,index_all.isString)(props)) { - var width = options; - opts = arguments[2] || {}; - result = device_manager_assign(device_manager_assign({}, opts), { id: props, name: opts.name || props, width: width }); - } - else { - result = props; - } - if (!result.id) { - result.id = result.name || this._createId(); - } - return this.devices.add(result, opts); - }; - /** - * Return device by ID - * @param {String} id ID of the device - * @returns {[Device]|null} - * @example - * const device = deviceManager.get('Tablet'); - * console.log(JSON.stringify(device)); - * // {name: 'Tablet', width: '900px'} - */ - DeviceManager.prototype.get = function (id) { - // Support old API - var byName = this.getAll().filter(function (d) { return d.get('name') === id; })[0]; - return byName || this.devices.get(id) || null; - }; - /** - * Remove device - * @param {String|[Device]} device Device or device id - * @returns {[Device]} Removed device - * @example - * const removed = deviceManager.remove('device-id'); - * // or by passing the Device - * const device = deviceManager.get('device-id'); - * deviceManager.remove(device); - */ - DeviceManager.prototype.remove = function (device, opts) { - if (opts === void 0) { opts = {}; } - return this.__remove(device, opts); - }; - /** - * Return all devices - * @returns {Array<[Device]>} - * @example - * const devices = deviceManager.getDevices(); - * console.log(JSON.stringify(devices)); - * // [{name: 'Desktop', width: ''}, ...] - */ - DeviceManager.prototype.getDevices = function () { - return this.devices.models; - }; - /** - * Change the selected device. This will update the frame in the canvas - * @param {String|[Device]} device Device or device id - * @example - * deviceManager.select('some-id'); - * // or by passing the page - * const device = deviceManager.get('some-id'); - * deviceManager.select(device); - */ - DeviceManager.prototype.select = function (device, opts) { - if (opts === void 0) { opts = {}; } - var md = (0,index_all.isString)(device) ? this.get(device) : device; - md && this.em.set('device', md.get('id'), opts); - return this; - }; - /** - * Get the selected device - * @returns {[Device]} - * @example - * const selected = deviceManager.getSelected(); - */ - DeviceManager.prototype.getSelected = function () { - return this.get(this.em.get('device')); - }; - DeviceManager.prototype.getAll = function () { - return this.devices; - }; - DeviceManager.prototype.render = function () { - var _a; - var em = this.em; - (_a = this.view) === null || _a === void 0 ? void 0 : _a.remove(); - this.view = new view_DevicesView({ - collection: this.devices, - config: device_manager_assign({ em: em }, this.config), - }); - return this.view.render().el; - }; - DeviceManager.prototype.destroy = function () { - this.__destroy(); - }; - return DeviceManager; -}(ItemManagerModule)); -/* harmony default export */ const device_manager = (DeviceManager); - -;// CONCATENATED MODULE: ./src/pages/types.ts -/**{START_EVENTS}*/ -var PagesEvents; -(function (PagesEvents) { - /** - * @event `page:add` Added new page. The page is passed as an argument to the callback. - * @example - * editor.on('page:add', (page) => { ... }); - */ - PagesEvents["add"] = "page:add"; - PagesEvents["addBefore"] = "page:add:before"; - /** - * @event `page:remove` Page removed. The page is passed as an argument to the callback. - * @example - * editor.on('page:remove', (page) => { ... }); - */ - PagesEvents["remove"] = "page:remove"; - PagesEvents["removeBefore"] = "page:remove:before"; - /** - * @event `page:select` New page selected. The newly selected page and the previous one, are passed as arguments to the callback. - * @example - * editor.on('page:select', (page, previousPage) => { ... }); - */ - PagesEvents["select"] = "page:select"; - PagesEvents["selectBefore"] = "page:select:before"; - /** - * @event `page:update` Page updated. The updated page and the object containing changes are passed as arguments to the callback. - * @example - * editor.on('page:update', (page, changes) => { ... }); - */ - PagesEvents["update"] = "page:update"; - /** - * @event `page` Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback. - * @example - * editor.on('page', ({ event, model, ... }) => { ... }); - */ - PagesEvents["all"] = "page"; -})(PagesEvents || (PagesEvents = {})); -/**{END_EVENTS}*/ -// need this to avoid the TS documentation generator to break -/* harmony default export */ const types = (PagesEvents); - -;// CONCATENATED MODULE: ./src/abstract/ModuleCollection.ts -var ModuleCollection_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var ModuleCollection = /** @class */ (function (_super) { - ModuleCollection_extends(ModuleCollection, _super); - function ModuleCollection(module, models, modelConstructor) { - return _super.call(this, models, { module: module, modelConstructor: modelConstructor }) || this; - } - ModuleCollection.prototype.add = function (model, options) { - var _this = this; - var _a; - //Note: the undefined case needed because backbonejs not handle the reset() correctly - var models = (0,index_all.isArray)(model) ? model : !(0,index_all.isUndefined)(model) ? [model] : undefined; - models = (_a = models === null || models === void 0 ? void 0 : models.map(function (m) { return (m instanceof _this.newModel ? m : new _this.newModel(_this.module, m)); })) !== null && _a !== void 0 ? _a : [undefined]; - return _super.prototype.add.call(this, (0,index_all.isArray)(model) ? models : models[0], options); - }; - ModuleCollection.prototype.preinitialize = function (models, options) { - this.newModel = options.modelConstructor; - this.module = options.module; - }; - return ModuleCollection; -}(common/* Collection */.FE)); -/* harmony default export */ const abstract_ModuleCollection = (ModuleCollection); - -;// CONCATENATED MODULE: ./src/canvas/model/Frame.ts -var Frame_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var Frame_assign = (undefined && undefined.__assign) || function () { - Frame_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return Frame_assign.apply(this, arguments); -}; -var Frame_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - - - -var keyAutoW = '__aw'; -var keyAutoH = '__ah'; -var getDimension = function (frame, type) { - var _a; - var dim = frame.get(type); - var viewDim = (_a = frame.view) === null || _a === void 0 ? void 0 : _a.el[type === 'width' ? 'offsetWidth' : 'offsetHeight']; - if ((0,index_all.isNumber)(dim)) { - return dim; - } - else if ((0,index_all.isString)(dim) && dim.endsWith('px')) { - return parseFloat(dim); - } - else if (viewDim) { - return viewDim; - } - else { - return 0; - } -}; -/** - * @property {Object|String} component Wrapper component definition. You can also pass an HTML string as components of the default wrapper component. - * @property {String} [width=''] Width of the frame. By default, the canvas width will be taken. - * @property {String} [height=''] Height of the frame. By default, the canvas height will be taken. - * @property {Number} [x=0] Horizontal position of the frame in the canvas. - * @property {Number} [y=0] Vertical position of the frame in the canvas. - * - */ -var Frame = /** @class */ (function (_super) { - Frame_extends(Frame, _super); - /** - * @hideconstructor - */ - function Frame(module, attr) { - var _this = _super.call(this, module, attr) || this; - var em = _this.em; - var _a = _this.attributes, styles = _a.styles, component = _a.component; - var domc = em.Components; - var conf = domc.getConfig(); - var allRules = em.Css.getAll(); - var idMap = {}; - var modOpts = { em: em, config: conf, frame: _this, idMap: idMap }; - if (!(0,mixins.isComponent)(component)) { - var wrp = (0,mixins.isObject)(component) ? component : { components: component }; - !wrp.type && (wrp.type = 'wrapper'); - var Wrapper = domc.getType('wrapper').model; - _this.set('component', new Wrapper(wrp, modOpts)); - } - if (!styles) { - _this.set('styles', allRules); - } - else if (!(0,mixins.isObject)(styles)) { - var newStyles = styles; - // Avoid losing styles on remapped components - if ((0,index_all.keys)(idMap).length) { - newStyles = (0,index_all.isString)(newStyles) ? em.Parser.parseCss(newStyles) : newStyles; - em.Css.checkId(newStyles, { idMap: idMap }); - } - allRules.add(newStyles); - _this.set('styles', allRules); - } - !attr.width && _this.set(keyAutoW, 1); - !attr.height && _this.set(keyAutoH, 1); - !_this.id && _this.set('id', (0,mixins.createId)()); - return _this; - } - Frame.prototype.defaults = function () { - return { - x: 0, - y: 0, - changesCount: 0, - attributes: {}, - width: null, - height: null, - head: [], - component: '', - styles: '', - refFrame: null, - _undo: true, - _undoexc: ['changesCount'], - }; - }; - Object.defineProperty(Frame.prototype, "width", { - get: function () { - return getDimension(this, 'width'); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Frame.prototype, "height", { - get: function () { - return getDimension(this, 'height'); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Frame.prototype, "head", { - get: function () { - return this.get('head'); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Frame.prototype, "refFrame", { - get: function () { - return this.get('refFrame'); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Frame.prototype, "root", { - get: function () { - var refFrame = this.refFrame; - return (refFrame === null || refFrame === void 0 ? void 0 : refFrame.getComponent()) || this.getComponent(); - }, - enumerable: false, - configurable: true - }); - Frame.prototype.initRefs = function () { - var refFrame = this.refFrame; - if ((0,index_all.isString)(refFrame)) { - var frame = this.module.framesById[refFrame]; - frame && this.set({ refFrame: frame }, { silent: true }); - } - }; - Frame.prototype.getBoxRect = function () { - var _a = this.attributes, x = _a.x, y = _a.y; - var _b = this, width = _b.width, height = _b.height; - return { - x: x, - y: y, - width: width, - height: height, - }; - }; - Frame.prototype.onRemove = function () { - !this.refFrame && this.getComponent().remove({ root: 1 }); - }; - Frame.prototype.changesUp = function (opt) { - if (opt === void 0) { opt = {}; } - if (opt.temporary || opt.noCount || opt.avoidStore) { - return; - } - this.set('changesCount', this.get('changesCount') + 1); - }; - Frame.prototype.getComponent = function () { - return this.get('component'); - }; - Frame.prototype.getStyles = function () { - return this.get('styles'); - }; - Frame.prototype.disable = function () { - this.trigger('disable'); - }; - Frame.prototype.remove = function () { - var _a; - (_a = this.view) === null || _a === void 0 ? void 0 : _a.remove(); - this.view = undefined; - var coll = this.collection; - return coll && coll.remove(this); - }; - Frame.prototype.getHead = function () { - return Frame_spreadArray([], this.head, true); - }; - Frame.prototype.setHead = function (value) { - return this.set('head', Frame_spreadArray([], value, true)); - }; - Frame.prototype.addHeadItem = function (item) { - this.head.push(item); - }; - Frame.prototype.getHeadByAttr = function (attr, value, tag) { - return this.head.filter(function (item) { return item.attributes && item.attributes[attr] == value && (!tag || tag === item.tag); })[0]; - }; - Frame.prototype.removeHeadByAttr = function (attr, value, tag) { - var item = this.getHeadByAttr(attr, value, tag); - var index = this.head.indexOf(item); - if (index >= 0) { - this.head.splice(index, 1); - } - }; - Frame.prototype.addLink = function (href) { - var tag = 'link'; - !this.getHeadByAttr('href', href, tag) && - this.addHeadItem({ - tag: tag, - attributes: { - href: href, - rel: 'stylesheet', - }, - }); - }; - Frame.prototype.removeLink = function (href) { - this.removeHeadByAttr('href', href, 'link'); - }; - Frame.prototype.addScript = function (src) { - var tag = 'script'; - !this.getHeadByAttr('src', src, tag) && - this.addHeadItem({ - tag: tag, - attributes: { src: src }, - }); - }; - Frame.prototype.removeScript = function (src) { - this.removeHeadByAttr('src', src, 'script'); - }; - Frame.prototype.getPage = function () { - var _a; - return (_a = this.collection) === null || _a === void 0 ? void 0 : _a.page; - }; - Frame.prototype._emitUpdated = function (data) { - if (data === void 0) { data = {}; } - this.em.trigger('frame:updated', Frame_assign({ frame: this }, data)); - }; - Frame.prototype.hasAutoHeight = function () { - var height = this.attributes.height; - if (height === 'auto' || this.config.infiniteCanvas) { - return true; - } - return false; - }; - Frame.prototype.toJSON = function (opts) { - if (opts === void 0) { opts = {}; } - var obj = ModuleModel/* default */.Z.prototype.toJSON.call(this, opts); - var defaults = (0,index_all.result)(this, 'defaults'); - if (opts.fromUndo) - delete obj.component; - delete obj.styles; - delete obj.changesCount; - obj[keyAutoW] && delete obj.width; - obj[keyAutoH] && delete obj.height; - if (obj.refFrame) { - obj.refFrame = obj.refFrame.id; - delete obj.component; - } - // Remove private keys - (0,index_all.forEach)(obj, function (value, key) { - key.indexOf('_') === 0 && delete obj[key]; - }); - (0,index_all.forEach)(defaults, function (value, key) { - if (obj[key] === value) - delete obj[key]; - }); - (0,index_all.forEach)(['attributes', 'head'], function (prop) { - if ((0,index_all.isEmpty)(obj[prop])) - delete obj[prop]; - }); - return obj; - }; - return Frame; -}(ModuleModel/* default */.Z)); -/* harmony default export */ const model_Frame = (Frame); - -;// CONCATENATED MODULE: ./src/canvas/model/Frames.ts -var Frames_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - -var Frames = /** @class */ (function (_super) { - Frames_extends(Frames, _super); - function Frames(module, models) { - if (models === void 0) { models = []; } - var _this = _super.call(this, module, models, model_Frame) || this; - _this.loadedItems = 0; - _this.itemsToLoad = 0; - (0,index_all.bindAll)(_this, 'itemLoaded'); - _this.on('add', _this.onAdd); - _this.on('reset', _this.onReset); - _this.on('remove', _this.onRemove); - _this.forEach(function (frame) { return _this.onAdd(frame); }); - return _this; - } - Frames.prototype.onAdd = function (frame) { - this.module.framesById[frame.id] = frame; - }; - Frames.prototype.onReset = function (m, opts) { - var _this = this; - var prev = (opts === null || opts === void 0 ? void 0 : opts.previousModels) || []; - prev.map(function (p) { return _this.onRemove(p); }); - }; - Frames.prototype.onRemove = function (frame) { - frame.onRemove(); - delete this.module.framesById[frame.id]; - }; - Frames.prototype.initRefs = function () { - this.forEach(function (frame) { return frame.initRefs(); }); - }; - Frames.prototype.itemLoaded = function () { - this.loadedItems++; - if (this.loadedItems >= this.itemsToLoad) { - this.trigger('loaded:all'); - this.listenToLoadItems(false); - } - }; - Frames.prototype.listenToLoad = function () { - this.loadedItems = 0; - this.itemsToLoad = this.length; - this.listenToLoadItems(true); - }; - Frames.prototype.listenToLoadItems = function (on) { - var _this = this; - this.forEach(function (item) { return item[on ? 'on' : 'off']('loaded', _this.itemLoaded); }); - }; - return Frames; -}(abstract_ModuleCollection)); -/* harmony default export */ const model_Frames = (Frames); - -;// CONCATENATED MODULE: ./src/canvas/model/Canvas.ts -var Canvas_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - - -var Canvas = /** @class */ (function (_super) { - Canvas_extends(Canvas, _super); - function Canvas(module) { - var _this = this; - var em = module.em, config = module.config; - var scripts = config.scripts, styles = config.styles; - _this = _super.call(this, module, { scripts: scripts, styles: styles }) || this; - _this.set('frames', new model_Frames(module)); - _this.on('change:zoom', _this.onZoomChange); - _this.on('change:x change:y', _this.onCoordsChange); - _this.on('change:pointer change:pointerScreen', _this.onPointerChange); - _this.listenTo(em, "change:device ".concat(evUpdate), _this.updateDevice); - _this.listenTo(em, types.select, _this._pageUpdated); - return _this; - } - Canvas.prototype.defaults = function () { - return { - frame: '', - frames: [], - rulers: false, - zoom: 100, - x: 0, - y: 0, - // Scripts to apply on all frames - scripts: [], - // Styles to apply on all frames - styles: [], - pointer: common/* DEFAULT_COORDS */.pH, - pointerScreen: common/* DEFAULT_COORDS */.pH, - }; - }; - Object.defineProperty(Canvas.prototype, "frames", { - get: function () { - return this.get('frames'); - }, - enumerable: false, - configurable: true - }); - Canvas.prototype.init = function () { - var em = this.em; - var mainPage = em.Pages._initPage(); - this.set('frames', mainPage.getFrames()); - this.updateDevice({ frame: mainPage.getMainFrame() }); - }; - Canvas.prototype._pageUpdated = function (page, prev) { - var em = this.em; - em.setSelected(); - em.get('readyCanvas') && em.stopDefault(); // We have to stop before changing current frames - prev === null || prev === void 0 ? void 0 : prev.getFrames().map(function (frame) { return frame.disable(); }); - this.set('frames', page.getFrames()); - this.updateDevice({ frame: page.getMainFrame() }); - }; - Canvas.prototype.updateDevice = function (opts) { - if (opts === void 0) { opts = {}; } - var em = this.em; - var device = em.getDeviceModel(); - var model = opts.frame || em.getCurrentFrameModel(); - if (model && device) { - var _a = device.attributes, width = _a.width, height = _a.height; - model.set({ width: width, height: height }, { noUndo: 1 }); - } - }; - Canvas.prototype.onZoomChange = function () { - var _a = this, em = _a.em, module = _a.module; - var zoom = this.get('zoom'); - zoom < 1 && this.set('zoom', 1); - em.trigger(module.events.zoom); - }; - Canvas.prototype.onCoordsChange = function () { - var _a = this, em = _a.em, module = _a.module; - em.trigger(module.events.coords); - }; - Canvas.prototype.onPointerChange = function () { - var _a = this, em = _a.em, module = _a.module; - em.trigger(module.events.pointer); - }; - Canvas.prototype.getPointerCoords = function (type) { - if (type === void 0) { type = common/* CoordinatesTypes */.vA.World; } - var _a = this.attributes, pointer = _a.pointer, pointerScreen = _a.pointerScreen; - return type === common/* CoordinatesTypes */.vA.World ? pointer : pointerScreen; - }; - return Canvas; -}(ModuleModel/* default */.Z)); -/* harmony default export */ const model_Canvas = (Canvas); - -// EXTERNAL MODULE: ./src/canvas/model/CanvasSpot.ts -var CanvasSpot = __webpack_require__(675); -// EXTERNAL MODULE: ./src/dom_components/types.ts -var dom_components_types = __webpack_require__(184); -;// CONCATENATED MODULE: ./src/canvas/model/CanvasSpots.ts -var CanvasSpots_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var CanvasSpots = /** @class */ (function (_super) { - CanvasSpots_extends(CanvasSpots, _super); - function CanvasSpots(module, models) { - if (models === void 0) { models = []; } - var _this = _super.call(this, module, models, CanvasSpot/* default */.Z) || this; - _this.on('add', _this.onAdd); - _this.on('change', _this.onChange); - _this.on('remove', _this.onRemove); - var em = _this.em; - _this.refreshDbn = (0,index_all.debounce)(function () { return _this.refresh(); }, 0); - var evToRefreshDbn = "component:resize styleable:change component:input ".concat(dom_components_types/* ComponentsEvents */.g.update, " frame:updated undo redo"); - _this.listenTo(em, evToRefreshDbn, function () { return _this.refreshDbn(); }); - return _this; - } - Object.defineProperty(CanvasSpots.prototype, "em", { - get: function () { - return this.module.em; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CanvasSpots.prototype, "events", { - get: function () { - return this.module.events; - }, - enumerable: false, - configurable: true - }); - CanvasSpots.prototype.refresh = function () { - var _a = this, em = _a.em, events = _a.events; - em.trigger(events.spot); - }; - CanvasSpots.prototype.onAdd = function (spot) { - this.__trgEvent(this.events.spotAdd, { spot: spot }); - }; - CanvasSpots.prototype.onChange = function (spot) { - this.__trgEvent(this.events.spotUpdate, { spot: spot }); - }; - CanvasSpots.prototype.onRemove = function (spot) { - this.__trgEvent(this.events.spotRemove, { spot: spot }); - }; - CanvasSpots.prototype.__trgEvent = function (event, props) { - var module = this.module; - var em = module.em; - em.trigger(event, props); - this.refreshDbn(); - }; - return CanvasSpots; -}(abstract_ModuleCollection)); -/* harmony default export */ const model_CanvasSpots = (CanvasSpots); - -;// CONCATENATED MODULE: ./src/canvas/types.ts -/**{START_EVENTS}*/ -var CanvasEvents; -(function (CanvasEvents) { - /** - * @event `canvas:dragenter` Something is dragged inside the canvas, `DataTransfer` instance passed as an argument. - */ - CanvasEvents["dragEnter"] = "canvas:dragenter"; - /** - * @event `canvas:dragover` Something is dragging on the canvas, `DataTransfer` instance passed as an argument. - */ - CanvasEvents["dragOver"] = "canvas:dragover"; - /** - * @event `canvas:dragend` When a drag operation is ended, `DataTransfer` instance passed as an argument. - */ - CanvasEvents["dragEnd"] = "canvas:dragend"; - /** - * @event `canvas:dragdata` On any dataTransfer parse, `DataTransfer` instance and the `result` are passed as arguments. - * By changing `result.content` you're able to customize what is dropped. - */ - CanvasEvents["dragData"] = "canvas:dragdata"; - /** - * @event `canvas:drop` Something is dropped in canvas, `DataTransfer` instance and the dropped model are passed as arguments. - */ - CanvasEvents["drop"] = "canvas:drop"; - /** - * @event `canvas:spot` Spots updated. - * @example - * editor.on('canvas:spot', () => { - * console.log('Spots', editor.Canvas.getSpots()); - * }); - */ - CanvasEvents["spot"] = "canvas:spot"; - /** - * @event `canvas:spot:add` New canvas spot added. - * @example - * editor.on('canvas:spot:add', ({ spot }) => { - * console.log('Spot added', spot); - * }); - */ - CanvasEvents["spotAdd"] = "canvas:spot:add"; - /** - * @event `canvas:spot:update` Canvas spot updated. - * @example - * editor.on('canvas:spot:update', ({ spot }) => { - * console.log('Spot updated', spot); - * }); - */ - CanvasEvents["spotUpdate"] = "canvas:spot:update"; - /** - * @event `canvas:spot:remove` Canvas spot removed. - * @example - * editor.on('canvas:spot:remove', ({ spot }) => { - * console.log('Spot removed', spot); - * }); - */ - CanvasEvents["spotRemove"] = "canvas:spot:remove"; - /** - * @event `canvas:coords` Canvas coordinates updated. - * @example - * editor.on('canvas:coords', () => { - * console.log('Canvas coordinates updated:', editor.Canvas.getCoords()); - * }); - */ - CanvasEvents["coords"] = "canvas:coords"; - /** - * @event `canvas:zoom` Canvas zoom updated. - * @example - * editor.on('canvas:zoom', () => { - * console.log('Canvas zoom updated:', editor.Canvas.getZoom()); - * }); - */ - CanvasEvents["zoom"] = "canvas:zoom"; - /** - * @event `canvas:pointer` Canvas pointer updated. - * @example - * editor.on('canvas:pointer', () => { - * console.log('Canvas pointer updated:', editor.Canvas.getPointer()); - * }); - */ - CanvasEvents["pointer"] = "canvas:pointer"; - /** - * @event `canvas:refresh` Canvas was refreshed to update elements on top, - * like spots/tools (eg. via `editor.Canvas.refresh()` or on frame resize). - * @example - * editor.on('canvas:refresh', (canvasRefreshOptions) => { - * console.log('Canvas refreshed with options:', canvasRefreshOptions); - * }); - */ - CanvasEvents["refresh"] = "canvas:refresh"; - /** - * @event `canvas:frame:load` Frame loaded in canvas. - * The event is triggered right after iframe's `onload`. - * @example - * editor.on('canvas:frame:load', ({ window }) => { - * console.log('Frame loaded', window); - * }); - */ - CanvasEvents["frameLoad"] = "canvas:frame:load"; - /** - * @event `canvas:frame:load:head` Frame head loaded in canvas. - * The event is triggered right after iframe's finished to load the head elemenets (eg. scripts) - * @example - * editor.on('canvas:frame:load:head', ({ window }) => { - * console.log('Frame head loaded', window); - * }); - */ - CanvasEvents["frameLoadHead"] = "canvas:frame:load:head"; - /** - * @event `canvas:frame:load:body` Frame body loaded in canvas. - * The event is triggered when the body is rendered with components. - * @example - * editor.on('canvas:frame:load:body', ({ window }) => { - * console.log('Frame completed the body render', window); - * }); - */ - CanvasEvents["frameLoadBody"] = "canvas:frame:load:body"; -})(CanvasEvents || (CanvasEvents = {})); -/**{END_EVENTS}*/ -// need this to avoid the TS documentation generator to break -/* harmony default export */ const canvas_types = (CanvasEvents); - -;// CONCATENATED MODULE: ./src/abstract/ModuleView.ts -var ModuleView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -// type TCollection = TItem extends ModuleCollection ? TItem : unknown; -var ModuleView = /** @class */ (function (_super) { - ModuleView_extends(ModuleView, _super); - function ModuleView() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ModuleView.prototype, "pfx", { - get: function () { - return this.ppfx + this.config.stylePrefix || ''; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ModuleView.prototype, "ppfx", { - get: function () { - return this.em.config.stylePrefix || ''; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ModuleView.prototype, "module", { - get: function () { - var _a, _b; - return (_b = (_a = this.model) === null || _a === void 0 ? void 0 : _a.module) !== null && _b !== void 0 ? _b : this.collection.module; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ModuleView.prototype, "em", { - get: function () { - return this.module.em; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ModuleView.prototype, "config", { - get: function () { - return this.module.config; - }, - enumerable: false, - configurable: true - }); - ModuleView.prototype.preinitialize = function (options) { - this.className = ''; - }; - return ModuleView; -}(common/* View */.G7)); -/* harmony default export */ const abstract_ModuleView = (ModuleView); - -// EXTERNAL MODULE: ./src/utils/dom.ts -var dom = __webpack_require__(491); -;// CONCATENATED MODULE: ./src/abstract/ModuleDomainViews.ts -var ModuleDomainViews_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var ModuleDomainViews = /** @class */ (function (_super) { - ModuleDomainViews_extends(ModuleDomainViews, _super); - function ModuleDomainViews(opts, autoAdd) { - if (opts === void 0) { opts = {}; } - if (autoAdd === void 0) { autoAdd = false; } - var _this = _super.call(this, opts) || this; - // Defines the View per type - _this.itemsView = ''; - _this.itemType = 'type'; - _this.reuseView = false; - _this.viewCollection = []; - autoAdd && _this.listenTo(_this.collection, 'add', _this.addTo); - return _this; - } - /** - * Add new model to the collection - * @param {ModuleModel} model - * @private - * */ - ModuleDomainViews.prototype.addTo = function (model) { - this.add(model); - }; - ModuleDomainViews.prototype.itemViewNotFound = function (type) { - /*const { em, ns } = this; - const warn = `${ns ? `[${ns}]: ` : ''}'${type}' type not found`; - em?.logWarning(warn);*/ - }; - /** - * Render new model inside the view - * @param {ModuleModel} model - * @param {Object} fragment Fragment collection - * @private - * */ - ModuleDomainViews.prototype.add = function (model, fragment) { - var _a = this, reuseView = _a.reuseView, viewCollection = _a.viewCollection; - var frag = fragment || null; - var typeField = model.get(this.itemType); - var view; - //@ts-ignore - if (model.view && reuseView) { - //@ts-ignore - view = model.view; - } - else { - view = this.renderView(model, typeField); - } - viewCollection.push(view); - var rendered = view.render().el; - if (frag) - frag.appendChild(rendered); - else - this.$el.append(rendered); - }; - ModuleDomainViews.prototype.render = function () { - var _this = this; - var frag = document.createDocumentFragment(); - this.clearItems(); - this.$el.empty(); - if (this.collection.length) - this.collection.each(function (model) { return _this.add(model, frag); }); - this.$el.append(frag); - this.onRender(); - return this; - }; - ModuleDomainViews.prototype.onRender = function () { }; - ModuleDomainViews.prototype.onRemoveBefore = function (items, opts) { }; - ModuleDomainViews.prototype.onRemove = function (items, opts) { }; - ModuleDomainViews.prototype.remove = function (opts) { - if (opts === void 0) { opts = {}; } - var viewCollection = this.viewCollection; - this.onRemoveBefore(viewCollection, opts); - this.clearItems(); - common/* View */.G7.prototype.remove.apply(this, opts); - this.onRemove(viewCollection, opts); - return this; - }; - ModuleDomainViews.prototype.clearItems = function () { - var items = this.viewCollection || []; - // TODO Traits do not update the target anymore - // items.forEach(item => item.remove()); - // this.items = []; - }; - return ModuleDomainViews; -}(abstract_ModuleView)); -/* harmony default export */ const abstract_ModuleDomainViews = (ModuleDomainViews); - -;// CONCATENATED MODULE: ./src/css_composer/view/CssRuleView.ts -var CssRuleView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var CssRuleView = /** @class */ (function (_super) { - CssRuleView_extends(CssRuleView, _super); - function CssRuleView(o) { - if (o === void 0) { o = {}; } - var _this = _super.call(this, o) || this; - _this.config = o.config || {}; - var model = _this.model; - _this.listenTo(model, 'change', _this.render); - _this.listenTo(model, 'destroy remove', _this.remove); - _this.listenTo(model.get('selectors'), 'change', _this.render); - return _this; - } - // @ts-ignore - CssRuleView.prototype.tagName = function () { - return 'style'; - }; - CssRuleView.prototype.render = function () { - var _a = this, model = _a.model, el = _a.el; - var important = model.get('important'); - el.innerHTML = model.toCSS({ important: important }); - return this; - }; - return CssRuleView; -}(common/* View */.G7)); -/* harmony default export */ const view_CssRuleView = (CssRuleView); - -;// CONCATENATED MODULE: ./src/css_composer/view/CssGroupRuleView.ts -var CssGroupRuleView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var CssGroupRuleView = /** @class */ (function (_super) { - CssGroupRuleView_extends(CssGroupRuleView, _super); - function CssGroupRuleView() { - return _super !== null && _super.apply(this, arguments) || this; - } - CssGroupRuleView.prototype._createElement = function () { - return document.createTextNode(''); - }; - CssGroupRuleView.prototype.render = function () { - var model = this.model; - var important = model.get('important'); - this.el.textContent = model.getDeclaration({ important: important }); - return this; - }; - return CssGroupRuleView; -}(view_CssRuleView)); -/* harmony default export */ const view_CssGroupRuleView = (CssGroupRuleView); - -;// CONCATENATED MODULE: ./src/css_composer/view/CssRulesView.ts -var CssRulesView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - - -var getBlockId = function (pfx, order) { return "".concat(pfx).concat(order ? "-".concat(parseFloat(order)) : ''); }; -var CssRulesView = /** @class */ (function (_super) { - CssRulesView_extends(CssRulesView, _super); - function CssRulesView(o) { - var _this = _super.call(this, o) || this; - (0,index_all.bindAll)(_this, 'sortRules'); - var config = o.config || {}; - _this.atRules = {}; - _this.config = config; - _this.em = config.em; - _this.pfx = config.stylePrefix || ''; - _this.className = _this.pfx + 'rules'; - var coll = _this.collection; - _this.listenTo(coll, 'add', _this.addTo); - _this.listenTo(coll, 'reset', _this.render); - return _this; - } - /** - * Add to collection - * @param {Object} model - * @private - * */ - CssRulesView.prototype.addTo = function (model) { - this.addToCollection(model); - }; - /** - * Add new object to collection - * @param {Object} model - * @param {Object} fragmentEl - * @return {Object} - * @private - * */ - CssRulesView.prototype.addToCollection = function (model, fragmentEl) { - // If the render is not yet started - if (!this.renderStarted) { - return; - } - var fragment = fragmentEl || null; - var config = this.config; - var opts = { model: model, config: config }; - var rendered, view; - // I have to render keyframes of the same name together - // Unfortunately at the moment I didn't find the way of appending them - // if not staticly, via appendData - if (model.get('atRuleType') === 'keyframes') { - var atRule = model.getAtRule(); - var atRuleEl = this.atRules[atRule]; - if (!atRuleEl) { - var styleEl = document.createElement('style'); - atRuleEl = document.createTextNode(''); - styleEl.appendChild(document.createTextNode("".concat(atRule, "{"))); - styleEl.appendChild(atRuleEl); - styleEl.appendChild(document.createTextNode('}')); - this.atRules[atRule] = atRuleEl; - rendered = styleEl; - } - view = new view_CssGroupRuleView(opts); - atRuleEl.appendData(view.render().el.textContent); - } - else { - view = new view_CssRuleView(opts); - rendered = view.render().el; - } - var clsName = this.className; - var mediaText = model.get('mediaText'); - var defaultBlockId = getBlockId(clsName); - var blockId = defaultBlockId; - // If the rule contains a media query it might have a different container - // for it (eg. rules created with Device Manager) - if (mediaText) { - blockId = getBlockId(clsName, this.getMediaWidth(mediaText)); - } - if (rendered) { - var container = fragment || this.el; - var contRules = void 0; - // Try to find a specific container for the rule (if it - // containes a media query), otherwise get the default one - try { - contRules = container.querySelector("#".concat(blockId)); - } - catch (e) { } - if (!contRules) { - contRules = container.querySelector("#".concat(defaultBlockId)); - } - contRules === null || contRules === void 0 ? void 0 : contRules.appendChild(rendered); - } - return rendered; - }; - CssRulesView.prototype.getMediaWidth = function (mediaText) { - return mediaText && mediaText.replace("(".concat(this.em.getConfig().mediaCondition, ": "), '').replace(')', ''); - }; - CssRulesView.prototype.sortRules = function (a, b) { - var em = this.em; - var isMobFirst = (em.getConfig().mediaCondition || '').indexOf('min-width') !== -1; - if (!isMobFirst) - return 0; - var left = isMobFirst ? a : b; - var right = isMobFirst ? b : a; - return left - right; - }; - CssRulesView.prototype.render = function () { - var _this = this; - this.renderStarted = true; - this.atRules = {}; - var _a = this, em = _a.em, $el = _a.$el, collection = _a.collection; - var cls = this.className; - var frag = document.createDocumentFragment(); - $el.empty(); - // Create devices related DOM structure, ensure also to have a default container - var prs = em.Devices.getAll().pluck('priority').sort(this.sortRules); - prs.every(function (pr) { return pr; }) && prs.unshift(0); - prs.forEach(function (pr) { return frag.appendChild((0,dom/* createEl */.ut)('div', { id: getBlockId(cls, pr) })); }); - collection.each(function (model) { return _this.addToCollection(model, frag); }); - $el.append(frag); - $el.attr('class', cls); - return this; - }; - return CssRulesView; -}(common/* View */.G7)); -/* harmony default export */ const view_CssRulesView = (CssRulesView); - -;// CONCATENATED MODULE: ./src/parser/model/BrowserParserHtml.ts - -var htmlType = 'text/html'; -var defaultType = htmlType; // 'application/xml'; -/* harmony default export */ const BrowserParserHtml = (function (str, config) { - if (config === void 0) { config = {}; } - var parser = new DOMParser(); - var mimeType = config.htmlType || defaultType; - var toHTML = mimeType === htmlType; - var strF = toHTML ? str : "
".concat(str, "
"); - var doc = parser.parseFromString(strF, mimeType); - var res; - if (toHTML) { - if (config.asDocument) - return doc; - // Replicate the old parser in order to avoid breaking changes - var head = doc.head, body_1 = doc.body; - // Move all scripts at the bottom of the page - var scripts = head.querySelectorAll('script'); - (0,index_all.each)(scripts, function (node) { return body_1.appendChild(node); }); - // Move inside body all head children - var hEls_1 = []; - (0,index_all.each)(head.children, function (n) { return hEls_1.push(n); }); - (0,index_all.each)(hEls_1, function (node, i) { return body_1.insertBefore(node, body_1.children[i]); }); - res = body_1; - } - else { - res = doc.firstChild; - } - return res; -}); -/** - * POC, custom html parser specs - * Parse an HTML string to an array of nodes - * example - * parse(`
Hello
World example`) - * // result - * [ - * { - * tagName: 'div', - * attributes: { class: 'mycls', 'data-test': '' }, - * childNodes: ['Hello'], - * },{ - * tagName: 'span', - * childNodes: [ - * 'World ', - * { - * tagName: 'b', - * childNodes: ['example'], - * } - * ], - * } - * ] - * - -export const parseNodes = nodes => { - const result = []; - - for (let i = 0; i < nodes.length; i++) { - result.push(parseNode(nodes[i])); - } - - return result; -}; - -export const parseAttributes = attrs => { - const result = {}; - - for (let j = 0; j < attrs.length; j++) { - const attr = attrs[j]; - const nodeName = attr.nodeName; - const nodeValue = attr.nodeValue; - result[nodeName] = nodeValue; - } - - return result; -}; - -export const parseNode = el => { - // Return the string of the textnode element - if (el.nodeType === 3) { - return el.nodeValue; - } - - const tagName = node.tagName ? node.tagName.toLowerCase() : ''; - const attrs = el.attributes || []; - const nodes = el.childNodes || []; - - return { - ...(tagName && { tagName }), - ...(attrs.length && { - attributes: parseAttributes(attrs) - }), - ...(nodes.length && { - childNodes: parseNodes(nodes) - }) - }; -}; - -export default (str, config = {}) => { - const result = []; - const el = document.createElement('div'); - el.innerHTML = str; - const nodes = el.childNodes; - const len = nodes.length; - - for (let i = 0; i < len; i++) { - result.push(parseNode(nodes[i])); - } - - return result; -}; - */ - -;// CONCATENATED MODULE: ./src/parser/model/ParserHtml.ts -var ParserHtml_assign = (undefined && undefined.__assign) || function () { - ParserHtml_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ParserHtml_assign.apply(this, arguments); -}; - - - -var modelAttrStart = 'data-gjs-'; -var ParserHtml_event = 'parse:html'; -var ParserHtml = function (em, config) { - if (config === void 0) { config = {}; } - return { - compTypes: [], - modelAttrStart: modelAttrStart, - getPropAttribute: function (attrName, attrValue) { - var name = attrName.replace(this.modelAttrStart, ''); - var valueLen = (attrValue === null || attrValue === void 0 ? void 0 : attrValue.length) || 0; - var firstChar = attrValue === null || attrValue === void 0 ? void 0 : attrValue.substring(0, 1); - var lastChar = attrValue === null || attrValue === void 0 ? void 0 : attrValue.substring(valueLen - 1); - var value = attrValue === 'true' ? true : attrValue === 'false' ? false : attrValue; - // Try to parse JSON where it's possible - // I can get false positive here (eg. a selector '[data-attr]') - // so put it under try/catch and let fail silently - try { - value = - (firstChar == '{' && lastChar == '}') || (firstChar == '[' && lastChar == ']') ? JSON.parse(value) : value; - } - catch (e) { } - return { - name: name, - value: value, - }; - }, - /** - * Extract component props from an attribute object - * @param {Object} attr - * @returns {Object} An object containing props and attributes without them - */ - splitPropsFromAttr: function (attr) { - var _this = this; - if (attr === void 0) { attr = {}; } - var props = {}; - var attrs = {}; - (0,index_all.each)(attr, function (value, key) { - if (key.indexOf(_this.modelAttrStart) === 0) { - var propsResult = _this.getPropAttribute(key, value); - props[propsResult.name] = propsResult.value; - } - else { - attrs[key] = value; - } - }); - return { - props: props, - attrs: attrs, - }; - }, - /** - * Parse style string to object - * @param {string} str - * @return {Object} - * @example - * var stl = ParserHtml.parseStyle('color:black; width:100px; test:value;'); - * console.log(stl); - * // {color: 'black', width: '100px', test: 'value'} - */ - parseStyle: function (str) { - var result = {}; - while (str.indexOf('/*') >= 0) { - var start = str.indexOf('/*'); - var end = str.indexOf('*/') + 2; - str = str.replace(str.slice(start, end), ''); - } - var decls = str.split(';'); - for (var i = 0, len = decls.length; i < len; i++) { - var decl = decls[i].trim(); - if (!decl) - continue; - var prop = decl.split(':'); - var key = prop[0].trim(); - var value = prop.slice(1).join(':').trim(); - // Support multiple values for the same key - if (result[key]) { - if (!(0,index_all.isArray)(result[key])) { - result[key] = [result[key]]; - } - result[key].push(value); - } - else { - result[key] = value; - } - } - return result; - }, - /** - * Parse class string to array - * @param {string} str - * @return {Array} - * @example - * var res = ParserHtml.parseClass('test1 test2 test3'); - * console.log(res); - * // ['test1', 'test2', 'test3'] - */ - parseClass: function (str) { - var result = []; - var cls = str.split(' '); - for (var i = 0, len = cls.length; i < len; i++) { - var cl = cls[i].trim(); - if (!cl) - continue; - result.push(cl); - } - return result; - }, - parseNodeAttr: function (node, result) { - var model = result || {}; - var attrs = node.attributes || []; - var attrsLen = attrs.length; - for (var i = 0; i < attrsLen; i++) { - var nodeName = attrs[i].nodeName; - var nodeValue = attrs[i].nodeValue; - if (nodeName == 'style') { - model.style = this.parseStyle(nodeValue); - } - else if (nodeName == 'class') { - model.classes = this.parseClass(nodeValue); - } - else if (nodeName == 'contenteditable') { - continue; - } - else if (nodeName.indexOf(this.modelAttrStart) === 0) { - var propsResult = this.getPropAttribute(nodeName, nodeValue); - model[propsResult.name] = propsResult.value; - } - else { - // @ts-ignore Check for attributes from props (eg. required, disabled) - if (nodeValue === '' && node[nodeName] === true) { - nodeValue = true; - } - if (!model.attributes) { - model.attributes = {}; - } - model.attributes[nodeName] = nodeValue; - } - } - return model; - }, - detectNode: function (node, opts) { - var _a; - if (opts === void 0) { opts = {}; } - var compTypes = this.compTypes; - var result = {}; - if (compTypes) { - var type = (_a = node.getAttribute) === null || _a === void 0 ? void 0 : _a.call(node, "".concat(this.modelAttrStart, "type")); - // If the type is already defined, use it - if (type) { - result = { type: type }; - } - else { - // Find the component type - for (var i = 0; i < compTypes.length; i++) { - var compType = compTypes[i]; - var obj = compType.model.isComponent(node, opts); - if (obj) { - if (typeof obj !== 'object') { - obj = { type: compType.id }; - } - result = obj; - break; - } - } - } - } - return result; - }, - parseNode: function (node, opts) { - var _a; - if (opts === void 0) { opts = {}; } - var nodes = ((_a = node.content) === null || _a === void 0 ? void 0 : _a.childNodes) || node.childNodes; - var nodesLen = nodes.length; - var model = this.detectNode(node, opts); - if (!model.tagName) { - var tag = node.tagName || ''; - var ns = node.namespaceURI || ''; - model.tagName = tag && ns === 'http://www.w3.org/1999/xhtml' ? tag.toLowerCase() : tag; - } - model = this.parseNodeAttr(node, model); - // Check for custom void elements (valid in XML) - if (!nodesLen && "".concat(node.outerHTML).slice(-2) === '/>') { - model.void = true; - } - // Check for nested elements but avoid it if already provided - if (nodesLen && !model.components && !opts.skipChildren) { - // Avoid infinite nested text nodes - var firstChild = nodes[0]; - // If there is only one child and it's a TEXTNODE - // just make it content of the current node - if (nodesLen === 1 && firstChild.nodeType === 3) { - !model.type && (model.type = 'text'); - model.components = { - type: 'textnode', - content: firstChild.nodeValue, - }; - } - else { - model.components = this.parseNodes(node, ParserHtml_assign(ParserHtml_assign({}, opts), { inSvg: opts.inSvg || model.type === 'svg' })); - } - } - // If all children are texts and there is any textnode inside, the parent should - // be text too otherwise it won't be possible to edit texnodes. - var comps = model.components; - if (!model.type && (comps === null || comps === void 0 ? void 0 : comps.length)) { - var _b = config.textTypes, textTypes = _b === void 0 ? [] : _b, _c = config.textTags, textTags = _c === void 0 ? [] : _c; - var allTxt = true; - var foundTextNode = false; - for (var i = 0; i < comps.length; i++) { - var comp = comps[i]; - var cType = comp.type; - if (!textTypes.includes(cType) && !textTags.includes(comp.tagName)) { - allTxt = false; - break; - } - if (cType === 'textnode') { - foundTextNode = true; - } - } - if (allTxt && foundTextNode) { - model.type = 'text'; - } - } - return model; - }, - /** - * Get data from the node element - * @param {HTMLElement} el DOM element to traverse - * @return {Array} - */ - parseNodes: function (el, opts) { - var _a; - if (opts === void 0) { opts = {}; } - var result = []; - var nodes = ((_a = el.content) === null || _a === void 0 ? void 0 : _a.childNodes) || el.childNodes; - var nodesLen = nodes.length; - for (var i = 0; i < nodesLen; i++) { - var node = nodes[i]; - var nodePrev = result[result.length - 1]; - var model = this.parseNode(node, opts); - // Check if it's a text node and if it could be moved to the prevous one - if (model.type === 'textnode') { - if ((nodePrev === null || nodePrev === void 0 ? void 0 : nodePrev.type) === 'textnode') { - nodePrev.content += model.content; - continue; - } - // Throw away empty nodes (keep spaces) - if (!opts.keepEmptyTextNodes) { - var content = node.nodeValue; - if (content != ' ' && !content.trim()) { - continue; - } - } - } - // If the tagName is empty and it's not a textnode, skip it - if (!model.tagName && (0,index_all.isUndefined)(model.content)) { - continue; - } - result.push(model); - } - return result; - }, - /** - * Parse HTML string to a desired model object - * @param {string} str HTML string - * @param {ParserCss} parserCss In case there is style tags inside HTML - * @return {Object} - */ - parse: function (str, parserCss, opts) { - var _a, _b, _c; - if (opts === void 0) { opts = {}; } - var conf = (em === null || em === void 0 ? void 0 : em.get('Config')) || {}; - var res = { html: [] }; - var cf = ParserHtml_assign(ParserHtml_assign({}, config), opts); - var options = ParserHtml_assign(ParserHtml_assign(ParserHtml_assign({}, config.optionsHtml), { - // @ts-ignore Support previous `configParser.htmlType` option - htmlType: ((_a = config.optionsHtml) === null || _a === void 0 ? void 0 : _a.htmlType) || config.htmlType }), opts); - var preParser = options.preParser, asDocument = options.asDocument; - var input = (0,index_all.isFunction)(preParser) ? preParser(str, { editor: em === null || em === void 0 ? void 0 : em.getEditor() }) : str; - var parseRes = (0,index_all.isFunction)(cf.parserHtml) ? cf.parserHtml(input, options) : BrowserParserHtml(input, options); - var root = parseRes; - var docEl = parseRes; - if (asDocument) { - root = docEl.documentElement; - res.doctype = (0,dom/* doctypeToString */.hy)(docEl.doctype); - } - var scripts = root.querySelectorAll('script'); - var i = scripts.length; - // Support previous `configMain.allowScripts` option - var allowScripts = !(0,index_all.isUndefined)(conf.allowScripts) ? conf.allowScripts : options.allowScripts; - // Remove script tags - if (!allowScripts) { - while (i--) - (_b = scripts[i].parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(scripts[i]); - } - // Remove unsafe attributes - if (!options.allowUnsafeAttr || !options.allowUnsafeAttrValue) { - this.__sanitizeNode(root, options); - } - // Detach style tags and parse them - if (parserCss) { - var styles = root.querySelectorAll('style'); - var j = styles.length; - var styleStr = ''; - while (j--) { - styleStr = styles[j].innerHTML + styleStr; - (_c = styles[j].parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(styles[j]); - } - if (styleStr) - res.css = parserCss.parse(styleStr); - } - em === null || em === void 0 ? void 0 : em.trigger("".concat(ParserHtml_event, ":root"), { input: input, root: root }); - var resHtml = []; - if (asDocument) { - res.head = this.parseNode(docEl.head, cf); - res.root = this.parseNodeAttr(root); - resHtml = this.parseNode(docEl.body, cf); - } - else { - var result = this.parseNodes(root, cf); - // I have to keep it otherwise it breaks the DomComponents.addComponent (returns always array) - resHtml = result.length === 1 && !cf.returnArray ? result[0] : result; - } - res.html = resHtml; - em === null || em === void 0 ? void 0 : em.trigger(ParserHtml_event, { input: input, output: res }); - return res; - }, - __sanitizeNode: function (node, opts) { - var _this = this; - var attrs = node.attributes || []; - var nodes = node.childNodes || []; - var toRemove = []; - (0,index_all.each)(attrs, function (attr) { - var name = attr.nodeName || ''; - var value = attr.nodeValue || ''; - !opts.allowUnsafeAttr && name.startsWith('on') && toRemove.push(name); - !opts.allowUnsafeAttrValue && value.startsWith('javascript:') && toRemove.push(name); - }); - toRemove.map(function (name) { return node.removeAttribute(name); }); - (0,index_all.each)(nodes, function (node) { return _this.__sanitizeNode(node, opts); }); - }, - }; -}; -/* harmony default export */ const model_ParserHtml = (ParserHtml); - -;// CONCATENATED MODULE: ./src/domain_abstract/model/StyleableModel.ts -var StyleableModel_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var StyleableModel_assign = (undefined && undefined.__assign) || function () { - StyleableModel_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return StyleableModel_assign.apply(this, arguments); -}; - - - - -var parserHtml = model_ParserHtml(); -var getLastStyleValue = function (value) { - return (0,index_all.isArray)(value) ? value[value.length - 1] : value; -}; -var StyleableModel = /** @class */ (function (_super) { - StyleableModel_extends(StyleableModel, _super); - function StyleableModel() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Forward style string to `parseStyle` to be parse to an object - * @param {string} str - * @returns - */ - StyleableModel.prototype.parseStyle = function (str) { - return parserHtml.parseStyle(str); - }; - /** - * To trigger the style change event on models I have to - * pass a new object instance - * @param {Object} prop - * @return {Object} - */ - StyleableModel.prototype.extendStyle = function (prop) { - return StyleableModel_assign(StyleableModel_assign({}, this.getStyle()), prop); - }; - /** - * Get style object - * @return {Object} - */ - StyleableModel.prototype.getStyle = function (prop) { - var style = this.get('style') || {}; - var result = StyleableModel_assign({}, style); - return prop && (0,index_all.isString)(prop) ? result[prop] : result; - }; - /** - * Set new style object - * @param {Object|string} prop - * @param {Object} opts - * @return {Object} Applied properties - */ - StyleableModel.prototype.setStyle = function (prop, opts) { - var _this = this; - if (prop === void 0) { prop = {}; } - if (opts === void 0) { opts = {}; } - if ((0,index_all.isString)(prop)) { - prop = this.parseStyle(prop); - } - var propOrig = this.getStyle(opts); - if (opts.partial || opts.avoidStore) { - opts.avoidStore = true; - prop.__p = true; - } - else { - delete prop.__p; - } - var propNew = StyleableModel_assign({}, prop); - var newStyle = StyleableModel_assign({}, propNew); - // Remove empty style properties - (0,index_all.keys)(newStyle).forEach(function (prop) { - if (newStyle[prop] === '') { - delete newStyle[prop]; - } - }); - this.set('style', newStyle, opts); - var diff = (0,mixins.shallowDiff)(propOrig, propNew); - // Delete the property used for partial updates - delete diff.__p; - (0,index_all.keys)(diff).forEach(function (pr) { - // @ts-ignore - var em = _this.em; - if (opts.noEvent) - return; - _this.trigger("change:style:".concat(pr)); - if (em) { - em.trigger('styleable:change', _this, pr, opts); - em.trigger("styleable:change:".concat(pr), _this, pr, opts); - } - }); - return propNew; - }; - /** - * Add style property - * @param {Object|string} prop - * @param {string} value - * @example - * this.addStyle({color: 'red'}); - * this.addStyle('color', 'blue'); - */ - StyleableModel.prototype.addStyle = function (prop, value, opts) { - var _a; - if (value === void 0) { value = ''; } - if (opts === void 0) { opts = {}; } - if (typeof prop == 'string') { - prop = (_a = {}, - _a[prop] = value, - _a); - } - else { - opts = value || {}; - } - opts.addStyle = prop; - prop = this.extendStyle(prop); - this.setStyle(prop, opts); - }; - /** - * Remove style property - * @param {string} prop - */ - StyleableModel.prototype.removeStyle = function (prop) { - var style = this.getStyle(); - delete style[prop]; - this.setStyle(style); - }; - /** - * Returns string of style properties - * @param {Object} [opts={}] Options - * @return {String} - */ - StyleableModel.prototype.styleToString = function (opts) { - if (opts === void 0) { opts = {}; } - var result = []; - var style = this.getStyle(opts); - var imp = opts.important; - var _loop_1 = function (prop) { - var important = (0,index_all.isArray)(imp) ? imp.indexOf(prop) >= 0 : imp; - var firstChars = prop.substring(0, 2); - var isPrivate = firstChars === '__'; - if (isPrivate) - return "continue"; - var value = style[prop]; - var values = (0,index_all.isArray)(value) ? value : [value]; - values.forEach(function (val) { - var value = "".concat(val).concat(important ? ' !important' : ''); - value && result.push("".concat(prop, ":").concat(value, ";")); - }); - }; - for (var prop in style) { - _loop_1(prop); - } - return result.join(''); - }; - StyleableModel.prototype.getSelectors = function () { - return (this.get('selectors') || this.get('classes')); - }; - StyleableModel.prototype.getSelectorsString = function (opts) { - // @ts-ignore - return this.selectorsToString ? this.selectorsToString(opts) : this.getSelectors().getFullString(); - }; - return StyleableModel; -}(common/* Model */.Hn)); -/* harmony default export */ const model_StyleableModel = (StyleableModel); - -;// CONCATENATED MODULE: ./src/dom_components/model/SymbolUtils.ts -var SymbolUtils_assign = (undefined && undefined.__assign) || function () { - SymbolUtils_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return SymbolUtils_assign.apply(this, arguments); -}; -var SymbolUtils_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - - - -var isSymbolMain = function (cmp) { return (0,index_all.isArray)(cmp.get(keySymbols)); }; -var isSymbolInstance = function (cmp) { return !!cmp.get(keySymbol); }; -var isSymbol = function (cmp) { return !!(isSymbolMain(cmp) || isSymbolInstance(cmp)); }; -var isSymbolRoot = function (symbol) { - var parent = symbol.parent(); - return isSymbol(symbol) && (!parent || !isSymbol(parent)); -}; -var isSymbolNested = function (symbol) { - if (!isSymbol(symbol)) - return false; - var symbTopSelf = getSymbolTop(isSymbolMain(symbol) ? symbol : getSymbolMain(symbol)); - var symbTop = getSymbolTop(symbol); - var symbTopMain = isSymbolMain(symbTop) ? symbTop : getSymbolMain(symbTop); - return symbTopMain !== symbTopSelf; -}; -var initSymbol = function (symbol) { - if (symbol.__symbReady) - return; - symbol.on('change', symbol.__upSymbProps); - symbol.__symbReady = true; -}; -var getSymbolMain = function (symbol) { - var result = symbol.get(keySymbol); - if (result && (0,index_all.isString)(result)) { - var ref = symbol.__getAllById()[result]; - if (ref) { - result = ref; - symbol.set(keySymbol, ref); - } - else { - result = 0; - } - } - return result || undefined; -}; -var getSymbolInstances = function (symbol) { - var symbs = symbol === null || symbol === void 0 ? void 0 : symbol.get(keySymbols); - if (symbs && (0,index_all.isArray)(symbs)) { - symbs.forEach(function (symb, idx) { - if (symb && (0,index_all.isString)(symb)) { - symbs[idx] = symbol.__getAllById()[symb]; - } - }); - symbs = symbs.filter(function (symb) { return symb && !(0,index_all.isString)(symb); }); - } - return symbs || undefined; -}; -var isSymbolOverride = function (symbol, prop) { - if (prop === void 0) { prop = ''; } - var ovrd = symbol === null || symbol === void 0 ? void 0 : symbol.get(keySymbolOvrd); - var prp = prop.split(':')[0]; - var props = prop !== prp ? [prop, prp] : [prop]; - return ovrd === true || ((0,index_all.isArray)(ovrd) && props.some(function (p) { return ovrd.indexOf(p) >= 0; })); -}; -var getSymbolsToUpdate = function (symb, opts) { - if (opts === void 0) { opts = {}; } - var result = []; - var changed = opts.changed; - if (opts.fromInstance || - opts.noPropagate || - opts.fromUndo || - // Avoid updating others if the current component has override - (changed && isSymbolOverride(symb, changed))) { - return result; - } - var symbols = getSymbolInstances(symb) || []; - var symbol = getSymbolMain(symb); - var all = symbol ? SymbolUtils_spreadArray([symbol], (getSymbolInstances(symbol) || []), true) : symbols; - result = all - .filter(function (s) { return s !== symb; }) - // Avoid updating those with override - .filter(function (s) { return !(changed && isSymbolOverride(s, changed)); }); - return result; -}; -var getSymbolTop = function (symbol, opts) { - var result = symbol; - var parent = symbol.parent(opts); - // while (parent && (isSymbolMain(parent) || getSymbol(parent))) { - while (parent && isSymbol(parent)) { - result = parent; - parent = parent.parent(opts); - } - return result; -}; -var detachSymbolInstance = function (symbol, opts) { - if (opts === void 0) { opts = {}; } - var symbolMain = getSymbolMain(symbol); - var symbs = symbolMain && getSymbolInstances(symbolMain); - !opts.skipRefs && - symbs && - symbolMain.set(keySymbols, symbs.filter(function (s) { return s !== symbol; })); - symbol.set(keySymbol, 0); - symbol.components().forEach(function (s) { return detachSymbolInstance(s, opts); }); -}; -var logSymbol = function (symb, type, toUp, opts) { - if (opts === void 0) { opts = {}; } - var symbol = getSymbolMain(symb); - var symbols = getSymbolInstances(symb); - if (!symbol && !symbols) { - return; - } - symb.em.log(type, { model: symb, toUp: toUp, context: 'symbols', opts: opts }); -}; -var updateSymbolProps = function (symbol, opts) { - if (opts === void 0) { opts = {}; } - var changed = symbol.changedAttributes() || {}; - var attrs = changed.attributes || {}; - delete changed.status; - delete changed.open; - delete changed[keySymbols]; - delete changed[keySymbol]; - delete changed[keySymbolOvrd]; - delete changed.attributes; - delete attrs.id; - if (!(0,mixins.isEmptyObj)(attrs)) { - changed.attributes = attrs; - } - if (!(0,mixins.isEmptyObj)(changed)) { - var toUp = getSymbolsToUpdate(symbol, opts); - // Avoid propagating overrides to other symbols - (0,index_all.keys)(changed).map(function (prop) { - if (isSymbolOverride(symbol, prop)) - delete changed[prop]; - }); - logSymbol(symbol, 'props', toUp, { opts: opts, changed: changed }); - toUp.forEach(function (child) { - var propsChanged = SymbolUtils_assign({}, changed); - // Avoid updating those with override - (0,index_all.keys)(propsChanged).map(function (prop) { - if (isSymbolOverride(child, prop)) - delete propsChanged[prop]; - }); - child.set(propsChanged, SymbolUtils_assign({ fromInstance: symbol }, opts)); - }); - } -}; -var updateSymbolCls = function (symbol, opts) { - if (opts === void 0) { opts = {}; } - var toUp = getSymbolsToUpdate(symbol, opts); - logSymbol(symbol, 'classes', toUp, { opts: opts }); - toUp.forEach(function (child) { - // @ts-ignore This will propagate the change up to __upSymbProps - child.set('classes', symbol.get('classes'), { fromInstance: symbol }); - }); - symbol.__changesUp(opts); -}; -var updateSymbolComps = function (symbol, m, c, o) { - var optUp = o || c || {}; - var fromInstance = optUp.fromInstance, fromUndo = optUp.fromUndo; - var toUpOpts = { fromInstance: fromInstance, fromUndo: fromUndo }; - var isTemp = m.opt.temporary; - // Reset - if (!o) { - var coll = m; - var toUp = getSymbolsToUpdate(symbol, SymbolUtils_assign(SymbolUtils_assign({}, toUpOpts), { changed: 'components:reset' })); - var cmps_1 = coll.models; - var newSymbols_1 = new Set(); - logSymbol(symbol, 'reset', toUp, { components: cmps_1 }); - toUp.forEach(function (rel) { - var relCmps = rel.components(); - var toReset = cmps_1.map(function (cmp, i) { - // This particular case here is to handle reset from `resetFromString` - // where we can receive an array of regulat components or already - // existing symbols (updated already before reset) - if (!isSymbol(cmp) || newSymbols_1.has(cmp)) { - newSymbols_1.add(cmp); - return cmp.clone({ symbol: true }); - } - return relCmps.at(i); - }); - relCmps.reset(toReset, SymbolUtils_assign({ fromInstance: symbol }, c)); - }); - // Add - } - else if (o.add) { - var addedInstances_1 = []; - var isMainSymb_1 = !!getSymbolInstances(symbol); - var toUp = getSymbolsToUpdate(symbol, SymbolUtils_assign(SymbolUtils_assign({}, toUpOpts), { changed: 'components:add' })); - if (toUp.length) { - var addSymb = getSymbolMain(m); - addedInstances_1 = (addSymb ? getSymbolInstances(addSymb) : getSymbolInstances(m)) || []; - addedInstances_1 = SymbolUtils_spreadArray([], addedInstances_1, true); - addedInstances_1.push(addSymb ? addSymb : m); - } - !isTemp && - logSymbol(symbol, 'add', toUp, { - opts: o, - addedInstances: addedInstances_1.map(function (c) { return c.cid; }), - added: m.cid, - }); - // Here, before appending a new symbol, I have to ensure there are no previously - // created symbols (eg. used mainly when drag components around) - toUp.forEach(function (symb) { - var symbTop = getSymbolTop(symb); - var symbPrev = addedInstances_1.filter(function (addedInst) { - var addedTop = getSymbolTop(addedInst, { prev: 1 }); - return symbTop && addedTop && addedTop === symbTop; - })[0]; - var toAppend = symbPrev || m.clone({ symbol: true, symbolInv: isMainSymb_1 }); - symb.append(toAppend, SymbolUtils_assign({ fromInstance: symbol }, o)); - }); - // Remove - } - else { - // Remove instance reference from the symbol - var symb = getSymbolMain(m); - symb && - !o.temporary && - symb.set(keySymbols, getSymbolInstances(symb).filter(function (i) { return i !== m; })); - // Propagate remove only if the component is an inner symbol - if (!isSymbolRoot(m) && !o.skipRefsUp) { - var changed_1 = 'components:remove'; - var index_1 = o.index; - var parent_1 = m.parent(); - var opts_1 = SymbolUtils_assign({ fromInstance: m }, o); - var isSymbNested = isSymbolRoot(m); - var toUpFn = function (symb) { - var symbPrnt = symb.parent(); - symbPrnt && !isSymbolOverride(symbPrnt, changed_1) && symb.remove(opts_1); - }; - // Check if the parent allows the removing - var toUp = !isSymbolOverride(parent_1, changed_1) ? getSymbolsToUpdate(m, toUpOpts) : []; - if (isSymbNested) { - toUp = parent_1 && getSymbolsToUpdate(parent_1, SymbolUtils_assign(SymbolUtils_assign({}, toUpOpts), { changed: changed_1 })); - toUpFn = function (symb) { - var toRemove = symb.components().at(index_1); - toRemove && toRemove.remove(SymbolUtils_assign({ fromInstance: parent_1 }, opts_1)); - }; - } - !isTemp && - logSymbol(symbol, 'remove', toUp, { - opts: o, - removed: m.cid, - isSymbNested: isSymbNested, - }); - toUp.forEach(toUpFn); - } - } - symbol.__changesUp(optUp); -}; - -;// CONCATENATED MODULE: ./src/dom_components/model/Components.ts -var Components_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var Components_assign = (undefined && undefined.__assign) || function () { - Components_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return Components_assign.apply(this, arguments); -}; -var __rest = (undefined && undefined.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -}; -var Components_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - - - - - -var getComponentIds = function (cmp, res) { - if (res === void 0) { res = []; } - if (!cmp) - return []; - var cmps = ((0,index_all.isArray)(cmp) || (0,index_all.isFunction)(cmp.map) ? cmp : [cmp]); - cmps.map(function (cmp) { - res.push(cmp.getId()); - getComponentIds(cmp.components().models, res); - }); - return res; -}; -var getComponentsFromDefs = function (items, all, opts) { - if (all === void 0) { all = {}; } - if (opts === void 0) { opts = {}; } - opts.visitedCmps = opts.visitedCmps || {}; - var visitedCmps = opts.visitedCmps; - var itms = (0,index_all.isArray)(items) ? items : [items]; - return itms.map(function (item) { - var _a = item.attributes, attributes = _a === void 0 ? {} : _a, components = item.components, tagName = item.tagName, style = item.style; - var id = attributes.id, draggable = attributes.draggable, restAttr = __rest(attributes, ["id", "draggable"]); - var result = item; - if (id) { - // Detect components with the same ID - if (!visitedCmps[id]) { - visitedCmps[id] = []; - // Update the component if exists already - if (all[id]) { - result = all[id]; - var cmp = result; - tagName && cmp.set({ tagName: tagName }, Components_assign(Components_assign({}, opts), { silent: true })); - (0,index_all.keys)(restAttr).length && cmp.addAttributes(restAttr, Components_assign({}, opts)); - (0,index_all.keys)(style).length && cmp.addStyle(style, opts); - } - } - else { - // Found another component with the same ID, treat it as a new component - visitedCmps[id].push(result); - id = model_Component.getNewId(all); - result.attributes.id = id; - } - } - if (components) { - var newComponents = getComponentsFromDefs(components, all); - if ((0,index_all.isFunction)(result.components)) { - var cmps = result.components(); - cmps.length > 0 && cmps.reset(newComponents, opts); - } - else { - result.components = newComponents; - } - } - return result; - }); -}; -var Components = /** @class */ (function (_super) { - Components_extends(Components, _super); - function Components(models, opt) { - var _this = _super.call(this, models, opt) || this; - _this.opt = opt; - _this.listenTo(_this, 'add', _this.onAdd); - _this.listenTo(_this, 'remove', _this.removeChildren); - _this.listenTo(_this, 'reset', _this.resetChildren); - var em = opt.em, config = opt.config; - _this.config = config; - _this.em = em; - _this.domc = opt.domc || (em === null || em === void 0 ? void 0 : em.Components); - return _this; - } - Object.defineProperty(Components.prototype, "events", { - get: function () { - var _a; - return (_a = this.domc) === null || _a === void 0 ? void 0 : _a.events; - }, - enumerable: false, - configurable: true - }); - Components.prototype.resetChildren = function (models, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - var coll = this; - var prev = opts.previousModels || []; - var toRemove = prev.filter(function (prev) { return !models.get(prev.cid); }); - var newIds = getComponentIds(models); - var idsToKeep = getComponentIds(prev).filter(function (pr) { return newIds.indexOf(pr) >= 0; }); - opts.keepIds = (opts.keepIds || []).concat(idsToKeep); - toRemove.forEach(function (md) { return _this.removeChildren(md, coll, opts); }); - models.each(function (model) { return _this.onAdd(model); }); - }; - Components.prototype.resetFromString = function (input, opts) { - var _a, _b; - if (input === void 0) { input = ''; } - if (opts === void 0) { opts = {}; } - opts.keepIds = getComponentIds(this); - var _c = this, domc = _c.domc, em = _c.em, parent = _c.parent; - var cssc = em === null || em === void 0 ? void 0 : em.Css; - var allByID = (domc === null || domc === void 0 ? void 0 : domc.allById()) || {}; - var parsed = this.parseString(input, opts); - var newCmps = getComponentsFromDefs(parsed, allByID, opts); - var _d = opts.visitedCmps, visitedCmps = _d === void 0 ? {} : _d; - // Clone styles for duplicated components - Object.keys(visitedCmps).forEach(function (id) { - var cmps = visitedCmps[id]; - if (cmps.length) { - // Get all available rules of the component - var rulesToClone_1 = (cssc === null || cssc === void 0 ? void 0 : cssc.getRules("#".concat(id))) || []; - if (rulesToClone_1.length) { - cmps.forEach(function (cmp) { - rulesToClone_1.forEach(function (rule) { - var newRule = rule.clone(); - // @ts-ignore - newRule.set('selectors', ["#".concat(cmp.attributes.id)]); - cssc.getAll().add(newRule); - }); - }); - } - } - }); - this.reset(newCmps, opts); - em === null || em === void 0 ? void 0 : em.trigger('component:content', parent, opts, input); - (_b = (_a = parent).__checkInnerChilds) === null || _b === void 0 ? void 0 : _b.call(_a); - }; - Components.prototype.removeChildren = function (removed, coll, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - // Removing a parent component can cause this function - // to be called with an already removed child element - if (!removed) { - return; - } - var _a = this, domc = _a.domc, em = _a.em; - var isTemp = opts.temporary || opts.fromUndo; - removed.prevColl = this; // This one is required for symbols - if (!isTemp) { - // Remove the component from the global list - var id_1 = removed.getId(); - var sels = em.Selectors.getAll(); - var rules = em.Css.getAll(); - var canRemoveStyle = (opts.keepIds || []).indexOf(id_1) < 0; - var allByID = domc ? domc.allById() : {}; - delete allByID[id_1]; - // Remove all component related styles - var rulesRemoved = (canRemoveStyle - ? rules.remove(rules.filter(function (r) { return r.getSelectors().getFullString() === "#".concat(id_1); }), opts) - : []); - // Clean selectors - sels.remove(rulesRemoved.map(function (rule) { return rule.getSelectors().at(0); })); - if (!removed.opt.temporary) { - em.Commands.run('core:component-style-clear', { target: removed }); - removed.removed(); - removed.trigger('removed'); - em.trigger(dom_components_types/* ComponentsEvents */.g.remove, removed); - if (domc && isSymbolInstance(removed) && isSymbolRoot(removed)) { - domc.symbols.__trgEvent(domc.events.symbolInstanceRemove, { component: removed }, true); - } - } - var inner_1 = removed.components(); - inner_1.forEach(function (it) { - updateSymbolComps(it, it, inner_1, Components_assign(Components_assign({}, opts), { skipRefsUp: true })); - _this.removeChildren(it, coll, opts); - }); - } - // Remove stuff registered in DomComponents.handleChanges - var inner = removed.components(); - em.stopListening(inner); - em.stopListening(removed); - em.stopListening(removed.get('classes')); - removed.__postRemove(); - }; - /** @ts-ignore */ - Components.prototype.model = function (attrs, options) { - var opt = options.collection.opt; - var em = opt.em; - var model; - var df = em.Components.componentTypes; - options.em = em; - options.config = opt.config; - options.componentTypes = df; - options.domc = opt.domc; - for (var it_1 = 0; it_1 < df.length; it_1++) { - var dfId = df[it_1].id; - if (dfId == attrs.type) { - model = df[it_1].model; - break; - } - } - // If no model found, get the default one - if (!model) { - model = df[df.length - 1].model; - em && - attrs.type && - em.logWarning("Component type '".concat(attrs.type, "' not found"), { - attrs: attrs, - options: options, - }); - } - return new model(attrs, options); - }; - Components.prototype.parseString = function (value, opt) { - if (opt === void 0) { opt = {}; } - var _a = this, em = _a.em, domc = _a.domc, parent = _a.parent; - var asDocument = opt.asDocument && (parent === null || parent === void 0 ? void 0 : parent.is('wrapper')); - var cssc = em.Css; - var parsed = em.Parser.parseHtml(value, { asDocument: asDocument }); - var components = parsed.html; - if (asDocument) { - var root = parent; - var _b = parsed.html || {}, bodyCmps = _b.components, restBody = __rest(_b, ["components"]); - var _c = parsed.head || {}, headCmps = _c.components, restHead = __rest(_c, ["components"]); - components = bodyCmps; - root.set(restBody, opt); - root.head.set(restHead, opt); - root.head.components(headCmps, opt); - root.docEl.set(parsed.root, opt); - root.set({ doctype: parsed.doctype }); - } - // We need this to avoid duplicate IDs - model_Component.checkId(components, parsed.css, domc.componentsById, opt); - if (parsed.css && cssc && !opt.temporary) { - var at = opt.at, optsToPass = __rest(opt, ["at"]); - cssc.addCollection(parsed.css, Components_assign(Components_assign({}, optsToPass), { extend: 1 })); - } - return components; - }; - Components.prototype.add = function (models, opt) { - var _this = this; - if (opt === void 0) { opt = {}; } - if (models == undefined) - return; - opt.keepIds = Components_spreadArray(Components_spreadArray([], (opt.keepIds || []), true), getComponentIds(opt.previousModels), true); - if ((0,index_all.isString)(models)) { - models = this.parseString(models, opt); - } - else if ((0,index_all.isArray)(models)) { - models.forEach(function (item, index) { - if ((0,index_all.isString)(item)) { - var nodes = _this.parseString(item, opt); - models[index] = (0,index_all.isArray)(nodes) && !nodes.length ? null : nodes; - } - }); - } - var processedModels = ((0,index_all.isArray)(models) ? models : [models]) - .filter(Boolean) - .map(function (model) { return _this.processDef(model); }); - models = (0,index_all.isArray)(models) ? (0,index_all.flatten)(processedModels, 1) : processedModels[0]; - return _super.prototype.add.call(this, models, opt); - }; - /** - * Process component definition. - */ - Components.prototype.processDef = function (mdl) { - // Avoid processing Models - if (mdl.cid && mdl.ccid) - return mdl; - var _a = this, em = _a.em, _b = _a.config, config = _b === void 0 ? {} : _b; - var processor = config.processor; - var model = mdl; - if (processor) { - model = Components_assign({}, model); // Avoid 'Cannot delete property ...' - var modelPr = processor(model); - if (modelPr) { - //@ts-ignore - (0,index_all.each)(model, function (val, key) { return delete model[key]; }); - (0,index_all.extend)(model, modelPr); - } - } - // React JSX preset - //@ts-ignore - if (model.$$typeof && typeof model.props == 'object') { - model = Components_assign({}, model); - model.props = Components_assign({}, model.props); - var domc = em.Components; - var parser = em.Parser; - var parserHtml = parser.parserHtml; - (0,index_all.each)(model, function (value, key) { - //@ts-ignore - if (!(0,index_all.includes)(['props', 'type'], key)) - delete model[key]; - }); - var props = model.props; - var comps = props.children; - delete props.children; - delete model.props; - var res = parserHtml.splitPropsFromAttr(props); - model.attributes = res.attrs; - if (comps) { - model.components = comps; - } - if (!model.type) { - model.type = 'textnode'; - } - else if (!domc.getType(model.type)) { - model.tagName = model.type; - delete model.type; - } - (0,index_all.extend)(model, res.props); - } - return model; - }; - Components.prototype.onAdd = function (model, c, opts) { - if (opts === void 0) { opts = {}; } - var _a = this, domc = _a.domc, em = _a.em; - var style = model.getStyle(); - var avoidInline = em && em.getConfig().avoidInlineStyle; - domc && domc.Component.ensureInList(model); - if (!(0,index_all.isEmpty)(style) && !avoidInline && em && em.getConfig().forceClass && !opts.temporary) { - var name_1 = model.cid; - em.Css.setClassRule(name_1, style); - model.setStyle({}); - model.addClass(name_1); - } - model.__postAdd({ recursive: true }); - if (em && !opts.temporary) { - var triggerAdd_1 = function (model) { - em.trigger(dom_components_types/* ComponentsEvents */.g.add, model, opts); - model.components().forEach(function (comp) { return triggerAdd_1(comp); }); - }; - triggerAdd_1(model); - if (domc && isSymbolInstance(model) && isSymbolRoot(model)) { - domc.symbols.__trgEvent(domc.events.symbolInstanceAdd, { component: model }, true); - } - } - }; - return Components; -}(common/* Collection */.FE)); -/* harmony default export */ const model_Components = (Components); - -;// CONCATENATED MODULE: ./src/selector_manager/model/Selector.ts -var Selector_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var TYPE_CLASS = 1; -var TYPE_ID = 2; -/** - * @typedef Selector - * @property {String} name Selector name, eg. `my-class` - * @property {String} label Selector label, eg. `My Class` - * @property {Number} [type=1] Type of the selector. 1 (class) | 2 (id) - * @property {Boolean} [active=true] If not active, it's not selectable by the Style Manager. - * @property {Boolean} [private=false] If true, it can't be seen by the Style Manager, but it will be rendered in the canvas and in export code. - * @property {Boolean} [protected=false] If true, it can't be removed from the attached component. - */ -var Selector = /** @class */ (function (_super) { - Selector_extends(Selector, _super); - /** - * @hideconstructor - */ - function Selector(props, opts) { - if (opts === void 0) { opts = {}; } - var _this = _super.call(this, props, opts) || this; - var _a = opts.config, config = _a === void 0 ? {} : _a; - var name = _this.get('name'); - var label = _this.get('label'); - if (!name) { - _this.set('name', label); - } - else if (!label) { - _this.set('label', name); - } - var namePreEsc = _this.get('name'); - var escapeName = config.escapeName; - var nameEsc = escapeName ? escapeName(namePreEsc) : Selector.escapeName(namePreEsc); - _this.set('name', nameEsc); - _this.em = opts.em; - return _this; - } - Selector.prototype.defaults = function () { - return { - name: '', - label: '', - type: TYPE_CLASS, - active: true, - private: false, - protected: false, - _undo: true, - }; - }; - Selector.prototype.isId = function () { - return this.get('type') === TYPE_ID; - }; - Selector.prototype.isClass = function () { - return this.get('type') === TYPE_CLASS; - }; - Selector.prototype.getFullName = function (opts) { - if (opts === void 0) { opts = {}; } - var escape = opts.escape; - var name = this.get('name'); - var pfx = ''; - switch (this.get('type')) { - case TYPE_CLASS: - pfx = '.'; - break; - case TYPE_ID: - pfx = '#'; - break; - } - return pfx + (escape ? escape(name) : name); - }; - /** - * Get selector as a string. - * @returns {String} - * @example - * // Given such selector: { name: 'my-selector', type: 2 } - * console.log(selector.toString()); - * // -> `#my-selector` - */ - Selector.prototype.toString = function () { - return this.getFullName(); - }; - /** - * Get selector name. - * @returns {String} - * @example - * // Given such selector: { name: 'my-selector', label: 'My selector' } - * console.log(selector.getName()); - * // -> `my-selector` - */ - Selector.prototype.getName = function () { - return this.get('name') || ''; - }; - /** - * Get selector label. - * @returns {String} - * @example - * // Given such selector: { name: 'my-selector', label: 'My selector' } - * console.log(selector.getLabel()); - * // -> `My selector` - */ - Selector.prototype.getLabel = function () { - return this.get('label') || ''; - }; - /** - * Update selector label. - * @param {String} label New label - * @example - * // Given such selector: { name: 'my-selector', label: 'My selector' } - * selector.setLabel('New Label') - * console.log(selector.getLabel()); - * // -> `New Label` - */ - Selector.prototype.setLabel = function (label) { - return this.set('label', label); - }; - /** - * Get selector active state. - * @returns {Boolean} - */ - Selector.prototype.getActive = function () { - return !!this.get('active'); - }; - /** - * Update selector active state. - * @param {Boolean} value New active state - */ - Selector.prototype.setActive = function (value) { - return this.set('active', value); - }; - Selector.prototype.toJSON = function (opts) { - if (opts === void 0) { opts = {}; } - var em = this.em; - var obj = common/* Model */.Hn.prototype.toJSON.call(this, [opts]); - var defaults = (0,index_all.result)(this, 'defaults'); - if (em && em.getConfig().avoidDefaults) { - (0,index_all.forEach)(defaults, function (value, key) { - if (obj[key] === value) { - delete obj[key]; - } - }); - if (obj.label === obj.name) { - delete obj.label; - } - var objLen = (0,index_all.keys)(obj).length; - if (objLen === 1 && obj.name) { - obj = obj.name; - } - if (objLen === 2 && obj.name && obj.type) { - obj = this.getFullName(); - } - } - return obj; - }; - /** - * Escape string - * @param {string} name - * @return {string} - * @private - */ - Selector.escapeName = function (name) { - return "".concat(name).trim().replace(/([^a-z0-9\w\-\\:@\\/#()\.%\+\[\]]+)/gi, '-'); - }; - // Type selectors: https://developer.mozilla.org/it/docs/Web/CSS/CSS_Selectors - Selector.TYPE_CLASS = TYPE_CLASS; - Selector.TYPE_ID = TYPE_ID; - return Selector; -}(common/* Model */.Hn)); -/* harmony default export */ const model_Selector = (Selector); -Selector.prototype.idAttribute = 'name'; - -;// CONCATENATED MODULE: ./src/selector_manager/model/Selectors.ts -var Selectors_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - -var combine = function (tail, curr) { - return tail.reduce(function (acc, item, n) { - return acc.concat(combine(tail.slice(n + 1), "".concat(curr).concat(item))); - }, [curr]); -}; -var Selectors = /** @class */ (function (_super) { - Selectors_extends(Selectors, _super); - function Selectors() { - return _super !== null && _super.apply(this, arguments) || this; - } - Selectors.prototype.modelId = function (attr) { - return "".concat(attr.name, "_").concat(attr.type || model_Selector.TYPE_CLASS); - }; - Selectors.prototype.getStyleable = function () { - return (0,index_all.filter)(this.models, function (item) { return item.getActive() && !item.get('private'); }); - }; - Selectors.prototype.getValid = function (_a) { - var _b = _a === void 0 ? {} : _a, noDisabled = _b.noDisabled; - return (0,index_all.filter)(this.models, function (item) { return !item.get('private'); }).filter(function (item) { return (noDisabled ? item.get('active') : 1); }); - }; - Selectors.prototype.getFullString = function (collection, opts) { - if (opts === void 0) { opts = {}; } - var result = []; - var coll = collection || this; - coll.forEach(function (selector) { return result.push(selector.getFullName(opts)); }); - opts.sort && result.sort(); - return result.join('').trim(); - }; - Selectors.prototype.getFullName = function (opts) { - if (opts === void 0) { opts = {}; } - var combination = opts.combination, array = opts.array; - var result = []; - var sels = this.map(function (s) { return s.getFullName(opts); }).sort(); - if (combination) { - sels.forEach(function (sel, n) { - result = result.concat(combine(sels.slice(n + 1), sel)); - }); - } - else { - result = sels; - } - return (array ? result : combination ? result.join(',') : result.join('')); - }; - return Selectors; -}(common/* Collection */.FE)); -/* harmony default export */ const model_Selectors = (Selectors); -Selectors.prototype.model = model_Selector; - -;// CONCATENATED MODULE: ./src/abstract/ModuleCategory.ts -var ModuleCategory_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ModuleCategory_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - -var Category = /** @class */ (function (_super) { - ModuleCategory_extends(Category, _super); - function Category() { - return _super !== null && _super.apply(this, arguments) || this; - } - Category.prototype.defaults = function () { - return { - id: '', - label: '', - open: true, - attributes: {}, - }; - }; - Category.prototype.getId = function () { - return this.get('id'); - }; - Category.prototype.getLabel = function () { - return this.get('label'); - }; - return Category; -}(common/* Model */.Hn)); -/* harmony default export */ const ModuleCategory = (Category); -function getItemsByCategory(allItems) { - var categorySet = new Set(); - var categoryMap = new Map(); - var emptyItem = { items: [] }; - allItems.forEach(function (item) { - var category = item.category; - if (category) { - categorySet.add(category); - var categoryItems = categoryMap.get(category); - if (categoryItems) { - categoryItems.push(item); - } - else { - categoryMap.set(category, [item]); - } - } - else { - emptyItem.items.push(item); - } - }); - var categoryWithItems = Array.from(categorySet).map(function (category) { return ({ - category: category, - items: categoryMap.get(category) || [], - }); }); - return ModuleCategory_spreadArray(ModuleCategory_spreadArray([], categoryWithItems, true), [emptyItem], false); -} - -;// CONCATENATED MODULE: ./src/abstract/CollectionWithCategories.ts -var CollectionWithCategories_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var CATEGORY_KEY = 'category'; -var CollectionWithCategories = /** @class */ (function (_super) { - CollectionWithCategories_extends(CollectionWithCategories, _super); - function CollectionWithCategories() { - return _super !== null && _super.apply(this, arguments) || this; - } - CollectionWithCategories.prototype.initCategory = function (model) { - var category = model.get(CATEGORY_KEY); - var isDefined = category instanceof ModuleCategory; - // Ensure the category exists and it's not already initialized - if (category && !isDefined) { - if ((0,index_all.isString)(category)) { - category = { id: category, label: category }; - } - else if ((0,mixins.isObject)(category) && !category.id) { - category.id = category.label; - } - var catModel = this.getCategories().add(category); - model.set(CATEGORY_KEY, catModel, { silent: true }); - return catModel; - } - else if (isDefined) { - var catModel = category; - this.getCategories().add(catModel); - return catModel; - } - }; - return CollectionWithCategories; -}(common/* Collection */.FE)); - - -;// CONCATENATED MODULE: ./src/abstract/ModuleCategories.ts -var ModuleCategories_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var Categories = /** @class */ (function (_super) { - ModuleCategories_extends(Categories, _super); - function Categories(models, opts) { - if (opts === void 0) { opts = {}; } - var _this = _super.call(this, models, opts) || this; - var events = opts.events, em = opts.em; - var evUpdate = events === null || events === void 0 ? void 0 : events.update; - if (em) { - evUpdate && - _this.on('change', function (category, options) { - return em.trigger(evUpdate, { category: category, changes: category.changedAttributes(), options: options }); - }); - } - return _this; - } - /** @ts-ignore */ - Categories.prototype.add = function (model, opts) { - var models = (0,index_all.isArray)(model) ? model : [model]; - models.forEach(function (md) { return md && (md.id = (0,mixins.normalizeKey)("".concat(md.id))); }); - return _super.prototype.add.call(this, model, opts); - }; - Categories.prototype.get = function (id) { - return _super.prototype.get.call(this, (0,index_all.isString)(id) ? (0,mixins.normalizeKey)(id) : id); - }; - return Categories; -}(common/* Collection */.FE)); -/* harmony default export */ const ModuleCategories = (Categories); -Categories.prototype.model = ModuleCategory; - -;// CONCATENATED MODULE: ./src/trait_manager/types.ts -/**{START_EVENTS}*/ -var TraitsEvents; -(function (TraitsEvents) { - /** - * @event `trait:select` New traits selected (eg. by changing a component). - * @example - * editor.on('trait:select', ({ traits, component }) => { ... }); - */ - TraitsEvents["select"] = "trait:select"; - /** - * @event `trait:value` Trait value updated. - * @example - * editor.on('trait:value', ({ trait, component, value }) => { ... }); - */ - TraitsEvents["value"] = "trait:value"; - /** - * @event `trait:category:update` Trait category updated. - * @example - * editor.on('trait:category:update', ({ category, changes }) => { ... }); - */ - TraitsEvents["categoryUpdate"] = "trait:category:update"; - /** - * @event `trait:custom` Event to use in case of [custom Trait Manager UI](https://grapesjs.com/docs/modules/Traits.html#custom-trait-manager). - * @example - * editor.on('trait:custom', ({ container }) => { ... }); - */ - TraitsEvents["custom"] = "trait:custom"; - /** - * @event `trait` Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback. - * @example - * editor.on('trait', ({ event, model, ... }) => { ... }); - */ - TraitsEvents["all"] = "trait"; -})(TraitsEvents || (TraitsEvents = {})); -/**{END_EVENTS}*/ -// need this to avoid the TS documentation generator to break -/* harmony default export */ const trait_manager_types = (TraitsEvents); - -;// CONCATENATED MODULE: ./src/trait_manager/model/Trait.ts -var Trait_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var Trait_assign = (undefined && undefined.__assign) || function () { - Trait_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return Trait_assign.apply(this, arguments); -}; - - - - - -/** - * @property {String} id Trait id, eg. `my-trait-id`. - * @property {String} type Trait type, defines how the trait should be rendered. Possible values: `text` (default), `number`, `select`, `checkbox`, `color`, `button` - * @property {String} label The trait label to show for the rendered trait. - * @property {String} name The name of the trait used as a key for the attribute/property. By default, the name is used as attribute name or property in case `changeProp` in enabled. - * @property {String} default Default value to use in case the value is not defined on the component. - * @property {String} placeholder Placeholder to show inside the default input (if the UI type allows it). - * @property {String} [category=''] Trait category. - * @property {Boolean} changeProp If `true`, the trait value is applied on the component property, otherwise, on component attributes. - * - * @module docsjs.Trait - * - */ -var Trait = /** @class */ (function (_super) { - Trait_extends(Trait, _super); - function Trait(prop, em) { - var _this = _super.call(this, prop) || this; - var _a = _this.attributes, target = _a.target, name = _a.name; - !_this.get('id') && _this.set('id', name); - if (target) { - _this.setTarget(target); - } - _this.em = em; - return _this; - } - Trait.prototype.defaults = function () { - return { - type: 'text', - label: '', - name: '', - unit: '', - step: 1, - value: '', - default: '', - placeholder: '', - category: '', - changeProp: false, - options: [], - }; - }; - Object.defineProperty(Trait.prototype, "parent", { - get: function () { - return this.collection; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Trait.prototype, "category", { - get: function () { - var cat = this.get('category'); - return cat instanceof ModuleCategory ? cat : undefined; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Trait.prototype, "component", { - get: function () { - return this.target; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Trait.prototype, "changeProp", { - get: function () { - return !!this.get('changeProp'); - }, - enumerable: false, - configurable: true - }); - Trait.prototype.setTarget = function (component) { - if (component) { - var _a = this.attributes, name_1 = _a.name, changeProp = _a.changeProp, initValue = _a.value, getValue = _a.getValue; - this.target = component; - this.unset('target'); - var targetEvent = changeProp ? "change:".concat(name_1) : "change:attributes:".concat(name_1); - this.listenTo(component, targetEvent, this.targetUpdated); - var value = initValue || - // Avoid the risk of loops in case the trait has a custom getValue - (!getValue ? this.getValue() : undefined); - !(0,index_all.isUndefined)(value) && this.set({ value: value }, { silent: true }); - } - }; - /** - * Get the trait id. - * @returns {String} - */ - Trait.prototype.getId = function () { - return this.get('id'); - }; - /** - * Get the trait type. - * @returns {String} - */ - Trait.prototype.getType = function () { - return this.get('type'); - }; - /** - * Get the trait name. - * @returns {String} - */ - Trait.prototype.getName = function () { - return this.get('name'); - }; - /** - * Get the trait label. - * @param {Object} [opts={}] Options. - * @param {Boolean} [opts.locale=true] Use the locale string from i18n module. - * @returns {String} - */ - Trait.prototype.getLabel = function (opts) { - var _a; - if (opts === void 0) { opts = {}; } - var _b = opts.locale, locale = _b === void 0 ? true : _b; - var id = this.getId(); - var name = this.get('label') || this.getName(); - return (locale && ((_a = this.em) === null || _a === void 0 ? void 0 : _a.t("traitManager.traits.labels.".concat(id)))) || name; - }; - /** - * Get the trait value. - * The value is taken from component attributes by default or from properties if the trait has the `changeProp` enabled. - * @param {Object} [opts={}] Options. - * @param {Boolean} [opts.useType=false] Get the value based on type (eg. the checkbox will always return a boolean). - * @returns {any} - */ - Trait.prototype.getValue = function (opts) { - return this.getTargetValue(opts); - }; - /** - * Update the trait value. - * The value is applied on component attributes by default or on properties if the trait has the `changeProp` enabled. - * @param {any} value Value of the trait. - * @param {Object} [opts={}] Options. - * @param {Boolean} [opts.partial] If `true` the update won't be considered complete (not stored in UndoManager). - */ - Trait.prototype.setValue = function (value, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - var _a = this, component = _a.component, em = _a.em; - var partial = opts.partial; - var valueOpts = {}; - var setValue = this.attributes.setValue; - if (setValue) { - setValue({ - value: value, - component: component, - editor: em === null || em === void 0 ? void 0 : em.getEditor(), - trait: this, - partial: !!partial, - options: opts, - emitUpdate: function () { return _this.targetUpdated(); }, - }); - return; - } - if (partial) { - valueOpts.avoidStore = true; - } - this.setTargetValue(value, valueOpts); - }; - /** - * Get default value. - */ - Trait.prototype.getDefault = function () { - return this.get('default'); - }; - /** - * Get trait options. - */ - Trait.prototype.getOptions = function () { - return this.get('options') || []; - }; - /** - * Get current selected option or by id. - * @param {String} [id] Option id. - * @returns {Object | null} - */ - Trait.prototype.getOption = function (id) { - var _this = this; - var idSel = (0,mixins.isDef)(id) ? id : this.getValue(); - return this.getOptions().filter(function (o) { return _this.getOptionId(o) === idSel; })[0]; - }; - /** - * Get the option id from the option object. - * @param {Object} option Option object - * @returns {String} Option id - */ - Trait.prototype.getOptionId = function (option) { - return option.id || option.value; - }; - /** - * Get option label. - * @param {String|Object} id Option id or the option object - * @param {Object} [opts={}] Options - * @param {Boolean} [opts.locale=true] Use the locale string from i18n module - * @returns {String} Option label - */ - Trait.prototype.getOptionLabel = function (id, opts) { - var _a; - if (opts === void 0) { opts = {}; } - var _b = opts.locale, locale = _b === void 0 ? true : _b; - var option = ((0,index_all.isString)(id) ? this.getOption(id) : id); - var optId = this.getOptionId(option); - var label = option.label || option.name || optId; - var propName = this.getName(); - return (locale && ((_a = this.em) === null || _a === void 0 ? void 0 : _a.t("traitManager.traits.options.".concat(propName, ".").concat(optId)))) || label; - }; - /** - * Get category label. - * @param {Object} [opts={}] Options. - * @param {Boolean} [opts.locale=true] Use the locale string from i18n module. - * @returns {String} - */ - Trait.prototype.getCategoryLabel = function (opts) { - if (opts === void 0) { opts = {}; } - var _a = this, em = _a.em, category = _a.category; - var _b = opts.locale, locale = _b === void 0 ? true : _b; - var catId = category === null || category === void 0 ? void 0 : category.getId(); - var catLabel = category === null || category === void 0 ? void 0 : category.getLabel(); - return (locale && (em === null || em === void 0 ? void 0 : em.t("traitManager.categories.".concat(catId)))) || catLabel || ''; - }; - /** - * Run the trait command (used on the button trait type). - */ - Trait.prototype.runCommand = function () { - var em = this.em; - var command = this.attributes.command; - if (command && em) { - if ((0,index_all.isString)(command)) { - return em.Commands.run(command); - } - else { - return command(em.Editor, this); - } - } - }; - Trait.prototype.props = function () { - return this.attributes; - }; - Trait.prototype.targetUpdated = function () { - var _a = this, component = _a.component, em = _a.em; - var value = this.getTargetValue({ useType: true }); - this.set({ value: value }, { fromTarget: 1 }); - var props = { trait: this, component: component, value: value }; - component.trigger(trait_manager_types.value, props); - em === null || em === void 0 ? void 0 : em.trigger(trait_manager_types.value, props); - // This should be triggered for any trait prop change - em === null || em === void 0 ? void 0 : em.trigger('trait:update', props); - }; - Trait.prototype.getTargetValue = function (opts) { - if (opts === void 0) { opts = {}; } - var _a = this, component = _a.component, em = _a.em; - var name = this.getName(); - var getValue = this.get('getValue'); - var value; - if (getValue) { - value = getValue({ - editor: em === null || em === void 0 ? void 0 : em.getEditor(), - trait: this, - component: component, - }); - } - else if (this.changeProp) { - value = component.get(name); - } - else { - value = component.getAttributes()[name]; - } - if (opts.useType) { - var type = this.getType(); - if (type === 'checkbox') { - var _b = this.attributes, valueTrue = _b.valueTrue, valueFalse = _b.valueFalse; - if (!(0,index_all.isUndefined)(valueTrue) && valueTrue === value) { - value = true; - } - else if (!(0,index_all.isUndefined)(valueFalse) && valueFalse === value) { - value = false; - } - } - } - return !(0,index_all.isUndefined)(value) ? value : ''; - }; - Trait.prototype.setTargetValue = function (value, opts) { - var _a; - if (opts === void 0) { opts = {}; } - var _b = this, component = _b.component, attributes = _b.attributes; - var name = this.getName(); - if ((0,index_all.isUndefined)(value)) - return; - var valueToSet = value; - if (value === 'false') { - valueToSet = false; - } - else if (value === 'true') { - valueToSet = true; - } - if (this.getType() === 'checkbox') { - var valueTrue = attributes.valueTrue, valueFalse = attributes.valueFalse; - if (valueToSet && !(0,index_all.isUndefined)(valueTrue)) { - valueToSet = valueTrue; - } - if (!valueToSet && !(0,index_all.isUndefined)(valueFalse)) { - valueToSet = valueFalse; - } - } - var props = (_a = {}, _a[name] = valueToSet, _a); - // This is required for the UndoManager to properly detect changes - props.__p = opts.avoidStore ? null : undefined; - if (this.changeProp) { - component.set(props, opts); - } - else { - component.addAttributes(props, opts); - } - }; - Trait.prototype.setValueFromInput = function (value, final, opts) { - if (final === void 0) { final = true; } - if (opts === void 0) { opts = {}; } - var toSet = { value: value }; - this.set(toSet, Trait_assign(Trait_assign({}, opts), { avoidStore: 1 })); - // Have to trigger the change - if (final) { - this.set('value', '', opts); - this.set(toSet, opts); - } - }; - Trait.prototype.getInitValue = function () { - var component = this.component; - var name = this.getName(); - var value; - if (component) { - var attrs = component.get('attributes'); - value = this.changeProp ? component.get(name) : attrs[name]; - } - return value || this.get('value') || this.get('default'); - }; - return Trait; -}(common/* Model */.Hn)); -/* harmony default export */ const model_Trait = (Trait); - -;// CONCATENATED MODULE: ./src/trait_manager/model/TraitFactory.ts - - -var TraitFactory = /** @class */ (function () { - function TraitFactory(config) { - if (config === void 0) { config = {}; } - this.config = config; - } - /** - * Build props object by their name - */ - TraitFactory.prototype.build = function (prop, em) { - return (0,index_all.isString)(prop) ? this.buildFromString(prop, em) : new model_Trait(prop, em); - }; - TraitFactory.prototype.buildFromString = function (name, em) { - var obj = { - name: name, - type: 'text', - }; - switch (name) { - case 'target': - obj.type = 'select'; - obj.default = false; - obj.options = this.config.optionsTarget; - break; - } - return new model_Trait(obj, em); - }; - return TraitFactory; -}()); -/* harmony default export */ const model_TraitFactory = (TraitFactory); - -;// CONCATENATED MODULE: ./src/trait_manager/model/Traits.ts -var Traits_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - - - -var Traits = /** @class */ (function (_super) { - Traits_extends(Traits, _super); - function Traits(coll, options) { - var _this = _super.call(this, coll) || this; - _this.categories = new ModuleCategories(); - var em = options.em; - _this.em = em; - _this.categories = new ModuleCategories([], { - em: em, - events: { update: trait_manager_types.categoryUpdate }, - }); - _this.on('add', _this.handleAdd); - _this.on('reset', _this.handleReset); - var tm = _this.module; - var tmOpts = tm === null || tm === void 0 ? void 0 : tm.getConfig(); - _this.tf = new model_TraitFactory(tmOpts); - return _this; - } - Object.defineProperty(Traits.prototype, "module", { - get: function () { - return this.em.Traits; - }, - enumerable: false, - configurable: true - }); - Traits.prototype.getCategories = function () { - return this.categories; - }; - Traits.prototype.handleReset = function (coll, _a) { - var _b = _a === void 0 ? {} : _a, _c = _b.previousModels, previousModels = _c === void 0 ? [] : _c; - previousModels.forEach(function (model) { return model.trigger('remove'); }); - }; - Traits.prototype.handleAdd = function (model) { - model.em = this.em; - var target = this.target; - if (target) { - model.target = target; - } - this.initCategory(model); - }; - Traits.prototype.setTarget = function (target) { - this.target = target; - this.models.forEach(function (trait) { return trait.setTarget(target); }); - }; - Traits.prototype.add = function (models, opt) { - if (models == undefined) { - return undefined; - } - var _a = this, target = _a.target, em = _a.em; - if ((0,index_all.isArray)(models)) { - var traits = []; - for (var i = 0, len = models.length; i < len; i++) { - var trait_1 = models[i]; - traits[i] = trait_1 instanceof model_Trait ? trait_1 : this.tf.build(trait_1, em); - traits[i].setTarget(target); - } - return _super.prototype.add.call(this, traits, opt); - } - var trait = models instanceof model_Trait ? models : this.tf.build(models, em); - trait.setTarget(target); - return _super.prototype.add.call(this, trait, opt); - }; - return Traits; -}(CollectionWithCategories)); -/* harmony default export */ const model_Traits = (Traits); - -;// CONCATENATED MODULE: ./src/dom_components/model/Component.ts -var Component_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var Component_assign = (undefined && undefined.__assign) || function () { - Component_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return Component_assign.apply(this, arguments); -}; -var Component_rest = (undefined && undefined.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -}; -var Component_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - - - - - - - - - - -var escapeRegExp = function (str) { - return str.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'); -}; -var avoidInline = function (em) { return !!(em === null || em === void 0 ? void 0 : em.getConfig().avoidInlineStyle); }; -var eventDrag = 'component:drag'; -var keySymbols = '__symbols'; -var keySymbol = '__symbol'; -var keySymbolOvrd = '__symbol_ovrd'; -var keyUpdate = dom_components_types/* ComponentsEvents */.g.update; -var keyUpdateInside = dom_components_types/* ComponentsEvents */.g.updateInside; -/** - * The Component object represents a single node of our template structure, so when you update its properties the changes are - * immediately reflected on the canvas and in the code to export (indeed, when you ask to export the code we just go through all - * the tree of nodes). - * An example on how to update properties: - * ```js - * component.set({ - * tagName: 'span', - * attributes: { ... }, - * removable: false, - * }); - * component.get('tagName'); - * // -> 'span' - * ``` - * - * [Component]: component.html - * - * @property {String} [type=''] Component type, eg. `text`, `image`, `video`, etc. - * @property {String} [tagName='div'] HTML tag of the component, eg. `span`. Default: `div` - * @property {Object} [attributes={}] Key-value object of the component's attributes, eg. `{ title: 'Hello' }` Default: `{}` - * @property {String} [name=''] Name of the component. Will be used, for example, in Layers and badges - * @property {Boolean} [removable=true] When `true` the component is removable from the canvas, default: `true` - * @property {Boolean|String|Function} [draggable=true] Indicates if it's possible to drag the component inside others. - * You can also specify a query string to indentify elements, - * eg. `'.some-class[title=Hello], [data-gjs-type=column]'` means you can drag the component only inside elements - * containing `some-class` class and `Hello` title, and `column` components. In the case of a function, target and destination components are passed as arguments, return a Boolean to indicate if the drag is possible. Default: `true` - * @property {Boolean|String|Function} [droppable=true] Indicates if it's possible to drop other components inside. You can use - * a query string as with `draggable`. In the case of a function, target and destination components are passed as arguments, return a Boolean to indicate if the drop is possible. Default: `true` - * @property {Boolean} [badgable=true] Set to false if you don't want to see the badge (with the name) over the component. Default: `true` - * @property {Boolean|Array} [stylable=true] True if it's possible to style the component. - * You can also indicate an array of CSS properties which is possible to style, eg. `['color', 'width']`, all other properties - * will be hidden from the style manager. Default: `true` - * @property {Array} [stylable-require=[]] Indicate an array of style properties to show up which has been marked as `toRequire`. Default: `[]` - * @property {Array} [unstylable=[]] Indicate an array of style properties which should be hidden from the style manager. Default: `[]` - * @property {Boolean} [highlightable=true] It can be highlighted with 'dotted' borders if true. Default: `true` - * @property {Boolean} [copyable=true] True if it's possible to clone the component. Default: `true` - * @property {Boolean} [resizable=false] Indicates if it's possible to resize the component. It's also possible to pass an object as [options for the Resizer](https://github.com/GrapesJS/grapesjs/blob/master/src/utils/Resizer.ts). Default: `false` - * @property {Boolean} [editable=false] Allow to edit the content of the component (used on Text components). Default: `false` - * @property {Boolean} [layerable=true] Set to `false` if you need to hide the component inside Layers. Default: `true` - * @property {Boolean} [selectable=true] Allow component to be selected when clicked. Default: `true` - * @property {Boolean} [hoverable=true] Shows a highlight outline when hovering on the element if `true`. Default: `true` - * @property {Boolean} [locked] Disable the selection of the component and its children in the canvas. You can unlock a children by setting its locked property to `false`. Default: `undefined` - * @property {Boolean} [void=false] This property is used by the HTML exporter as void elements don't have closing tags, eg. `
`, `
`, etc. Default: `false` - * @property {Object} [style={}] Component default style, eg. `{ width: '100px', height: '100px', 'background-color': 'red' }` - * @property {String} [styles=''] Component related styles, eg. `.my-component-class { color: red }` - * @property {String} [content=''] Content of the component (not escaped) which will be appended before children rendering. Default: `''` - * @property {String} [icon=''] Component's icon, this string will be inserted before the name (in Layers and badge), eg. it can be an HTML string ''. Default: `''` - * @property {String|Function} [script=''] Component's javascript. More about it [here](/modules/Components-js.html). Default: `''` - * @property {String|Function} [script-export=''] You can specify javascript available only in export functions (eg. when you get the HTML). - * If this property is defined it will overwrite the `script` one (in export functions). Default: `''` - * @property {Array} [traits=''] Component's traits. More about it [here](/modules/Traits.html). Default: `['id', 'title']` - * @property {Array} [propagate=[]] Indicates an array of properties which will be inhereted by all NEW appended children. - * For example if you create a component likes this: `{ removable: false, draggable: false, propagate: ['removable', 'draggable'] }` - * and append some new component inside, the new added component will get the exact same properties indicated in the `propagate` array (and the `propagate` property itself). Default: `[]` - * @property {Array} [toolbar=null] Set an array of items to show up inside the toolbar when the component is selected (move, clone, delete). - * Eg. `toolbar: [ { attributes: {class: 'fa fa-arrows'}, command: 'tlb-move' }, ... ]`. - * By default, when `toolbar` property is falsy the editor will add automatically commands `core:component-exit` (select parent component, added if there is one), `tlb-move` (added if `draggable`) , `tlb-clone` (added if `copyable`), `tlb-delete` (added if `removable`). - * @property {Collection} [components=null] Children components. Default: `null` - * @property {Object} [delegate=null] Delegate commands to other components. Available commands `remove` | `move` | `copy` | `select`. eg. `{ remove: (cmp) => cmp.closestType('other-type') }` - * - * @module docsjs.Component - */ -var Component = /** @class */ (function (_super) { - Component_extends(Component, _super); - function Component(props, opt) { - if (props === void 0) { props = {}; } - var _this = _super.call(this, props, opt) || this; - (0,index_all.bindAll)(_this, '__upSymbProps', '__upSymbCls', '__upSymbComps'); - var em = opt.em; - // Propagate properties from parent if indicated - var parent = _this.parent(); - var parentAttr = parent === null || parent === void 0 ? void 0 : parent.attributes; - var propagate = _this.get('propagate'); - propagate && _this.set('propagate', (0,index_all.isArray)(propagate) ? propagate : [propagate]); - if (parentAttr && parentAttr.propagate && !propagate) { - var newAttr_1 = {}; - var toPropagate = parentAttr.propagate; - toPropagate.forEach(function (prop) { return (newAttr_1[prop] = parent.get(prop)); }); - newAttr_1.propagate = toPropagate; - _this.set(Component_assign(Component_assign({}, newAttr_1), props)); - } - // Check void elements - if (opt && opt.config && opt.config.voidElements.indexOf(_this.get('tagName')) >= 0) { - _this.set('void', true); - } - opt.em = em; - _this.opt = opt; - _this.em = em; - _this.frame = opt.frame; - _this.config = opt.config || {}; - _this.set('attributes', Component_assign(Component_assign({}, ((0,index_all.result)(_this, 'defaults').attributes || {})), (_this.get('attributes') || {}))); - _this.ccid = Component.createId(_this, opt); - _this.initClasses(); - _this.initComponents(); - _this.initTraits(); - _this.initToolbar(); - _this.initScriptProps(); - _this.listenTo(_this, 'change:script', _this.scriptUpdated); - _this.listenTo(_this, 'change:tagName', _this.tagUpdated); - _this.listenTo(_this, 'change:attributes', _this.attrUpdated); - _this.listenTo(_this, 'change:attributes:id', _this._idUpdated); - _this.on('change:toolbar', _this.__emitUpdateTlb); - _this.on('change', _this.__onChange); - _this.on(keyUpdateInside, _this.__propToParent); - _this.set('status', ''); - _this.views = []; - // Register global updates for collection properties - ['classes', 'traits', 'components'].forEach(function (name) { - var events = "add remove ".concat(name !== 'components' ? 'change' : ''); - _this.listenTo(_this.get(name), events.trim(), function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return _this.emitUpdate.apply(_this, Component_spreadArray([name], args, false)); - }); - }); - if (!opt.temporary) { - // Add component styles - var cssc = em && em.Css; - var _a = _this.attributes, styles = _a.styles, type = _a.type; - if (styles && cssc) { - cssc.addCollection(styles, { avoidUpdateStyle: true }, { group: "cmp:".concat(type) }); - } - _this.__postAdd(); - _this.init(); - isSymbol(_this) && initSymbol(_this); - em === null || em === void 0 ? void 0 : em.trigger(dom_components_types/* ComponentsEvents */.g.create, _this, opt); - } - return _this; - } - Object.defineProperty(Component.prototype, "defaults", { - /** - * @private - * @ts-ignore */ - get: function () { - var _a; - return _a = { - tagName: 'div', - type: '', - name: '', - removable: true, - draggable: true, - droppable: true, - badgable: true, - stylable: true, - 'stylable-require': '', - 'style-signature': '', - unstylable: '', - highlightable: true, - copyable: true, - resizable: false, - editable: false, - layerable: true, - selectable: true, - hoverable: true, - void: false, - state: '', - status: '', - content: '', - icon: '', - style: '', - styles: '', - classes: '', - script: '', - 'script-props': '', - 'script-export': '', - attributes: {}, - traits: ['id', 'title'], - propagate: '', - dmode: '', - toolbar: null, - delegate: null - }, - _a[keySymbol] = 0, - _a[keySymbols] = 0, - _a[keySymbolOvrd] = 0, - _a._undo = true, - _a._undoexc = ['status', 'open'], - _a; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Component.prototype, "tagName", { - get: function () { - return this.get('tagName'); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Component.prototype, "classes", { - get: function () { - return this.get('classes'); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Component.prototype, "traits", { - get: function () { - return this.get('traits'); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Component.prototype, "content", { - get: function () { - var _a; - return (_a = this.get('content')) !== null && _a !== void 0 ? _a : ''; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Component.prototype, "toolbar", { - get: function () { - return this.get('toolbar') || []; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Component.prototype, "resizable", { - get: function () { - return this.get('resizable'); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Component.prototype, "delegate", { - get: function () { - return this.get('delegate'); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Component.prototype, "locked", { - get: function () { - return this.get('locked'); - }, - enumerable: false, - configurable: true - }); - /** - * Hook method, called once the model is created - */ - Component.prototype.init = function () { }; - /** - * Hook method, called when the model has been updated (eg. updated some model's property) - * @param {String} property Property name, if triggered after some property update - * @param {*} value Property value, if triggered after some property update - * @param {*} previous Property previous value, if triggered after some property update - */ - Component.prototype.updated = function (property, value, previous) { }; - /** - * Hook method, called once the model has been removed - */ - Component.prototype.removed = function () { }; - Component.prototype.__postAdd = function (opts) { - if (opts === void 0) { opts = {}; } - var em = this.em; - var um = em === null || em === void 0 ? void 0 : em.UndoManager; - var comps = this.components(); - if (um && !this.__hasUm) { - um.add(comps); - um.add(this.getSelectors()); - this.__hasUm = true; - } - opts.recursive && comps.map(function (c) { return c.__postAdd(opts); }); - }; - Component.prototype.__postRemove = function () { - var em = this.em; - var um = em === null || em === void 0 ? void 0 : em.UndoManager; - if (um) { - um.remove(this.components()); - um.remove(this.getSelectors()); - delete this.__hasUm; - } - }; - Component.prototype.__onChange = function (m, opts) { - var _this = this; - var changed = this.changedAttributes() || {}; - (0,index_all.keys)(changed).forEach(function (prop) { return _this.emitUpdate(prop); }); - ['status', 'open', 'toolbar', 'traits'].forEach(function (name) { return delete changed[name]; }); - // Propagate component prop changes - if (!(0,mixins.isEmptyObj)(changed)) { - this.__changesUp(opts); - this.__propSelfToParent({ component: this, changed: changed, options: opts }); - } - }; - Component.prototype.__onStyleChange = function (newStyles) { - var _this = this; - var em = this.em; - if (!em) - return; - var event = 'component:styleUpdate'; - var styleKeys = (0,index_all.keys)(newStyles); - var pros = { style: newStyles }; - em.trigger(event, this, pros); - styleKeys.forEach(function (key) { return em.trigger("".concat(event, ":").concat(key), _this, pros); }); - }; - Component.prototype.__changesUp = function (opts) { - var _a = this, em = _a.em, frame = _a.frame; - [frame, em].forEach(function (md) { return md && md.changesUp(opts); }); - }; - Component.prototype.__propSelfToParent = function (props) { - this.trigger(keyUpdate, props); - this.__propToParent(props); - }; - Component.prototype.__propToParent = function (props) { - var parent = this.parent(); - parent && parent.trigger(keyUpdateInside, props); - }; - Component.prototype.__emitUpdateTlb = function () { - this.emitUpdate('toolbar'); - }; - Component.prototype.__getAllById = function () { - var em = this.em; - return em ? em.Components.allById() : {}; - }; - Component.prototype.__upSymbProps = function (m, opts) { - if (opts === void 0) { opts = {}; } - updateSymbolProps(this, opts); - }; - Component.prototype.__upSymbCls = function (m, c, opts) { - if (opts === void 0) { opts = {}; } - updateSymbolCls(this, opts); - }; - Component.prototype.__upSymbComps = function (m, c, o) { - updateSymbolComps(this, m, c, o); - }; - /** - * Check component's type - * @param {string} type Component type - * @return {Boolean} - * @example - * component.is('image') - * // -> false - */ - Component.prototype.is = function (type) { - return !!(this.get('type') == type); - }; - /** - * Return all the propeties - * @returns {Object} - */ - Component.prototype.props = function () { - return this.attributes; - }; - /** - * Get the index of the component in the parent collection. - * @return {Number} - */ - Component.prototype.index = function () { - var collection = this.collection; - return collection ? collection.indexOf(this) : 0; - }; - /** - * Change the drag mode of the component. - * To get more about this feature read: https://github.com/GrapesJS/grapesjs/issues/1936 - * @param {String} value Drag mode, options: `'absolute'` | `'translate'` | `''` - * @returns {this} - */ - Component.prototype.setDragMode = function (value) { - return this.set('dmode', value); - }; - /** - * Get the drag mode of the component. - * @returns {String} Drag mode value, options: `'absolute'` | `'translate'` | `''` - */ - Component.prototype.getDragMode = function () { - return this.get('dmode') || ''; - }; - /** - * Set symbol override. - * By setting override to `true`, none of its property changes will be propagated to relative symbols. - * By setting override to specific properties, changes of those properties will be skipped from propagation. - * @param {Boolean|String|Array} value - * @example - * component.setSymbolOverride(['children', 'classes']); - */ - Component.prototype.setSymbolOverride = function (value) { - var _a; - this.set(keySymbolOvrd, (_a = ((0,index_all.isString)(value) ? [value] : value)) !== null && _a !== void 0 ? _a : 0); - }; - /** - * Get symbol override value. - * @returns {Boolean|Array} - */ - Component.prototype.getSymbolOverride = function () { - return this.get(keySymbolOvrd); - }; - /** - * Find inner components by query string. - * **ATTENTION**: this method works only with already rendered component - * @param {String} query Query string - * @return {Array} Array of components - * @example - * component.find('div > .class'); - * // -> [Component, Component, ...] - */ - Component.prototype.find = function (query) { - var _a; - var result = []; - var $els = (_a = this.view) === null || _a === void 0 ? void 0 : _a.$el.find(query); - $els === null || $els === void 0 ? void 0 : $els.each(function (i) { - var $el = $els.eq(i); - var model = $el.data('model'); - model && result.push(model); - }); - return result; - }; - /** - * Find all inner components by component type. - * The advantage of this method over `find` is that you can use it - * also before rendering the component - * @param {String} type Component type - * @returns {Array} - * @example - * const allImages = component.findType('image'); - * console.log(allImages[0]) // prints the first found component - */ - Component.prototype.findType = function (type) { - var result = []; - var find = function (components) { - return components.forEach(function (item) { - item.is(type) && result.push(item); - find(item.components()); - }); - }; - find(this.components()); - return result; - }; - /** - * Find the closest parent component by query string. - * **ATTENTION**: this method works only with already rendered component - * @param {string} query Query string - * @return {Component} - * @example - * component.closest('div.some-class'); - * // -> Component - */ - Component.prototype.closest = function (query) { - var _a; - var result = (_a = this.view) === null || _a === void 0 ? void 0 : _a.$el.closest(query); - return (result === null || result === void 0 ? void 0 : result.length) ? result.data('model') : undefined; - }; - /** - * Find the closest parent component by its type. - * The advantage of this method over `closest` is that you can use it - * also before rendering the component - * @param {String} type Component type - * @returns {Component} Found component, otherwise `undefined` - * @example - * const Section = component.closestType('section'); - * console.log(Section); - */ - Component.prototype.closestType = function (type) { - var parent = this.parent(); - while (parent && !parent.is(type)) { - parent = parent.parent(); - } - return parent; - }; - /** - * The method returns a Boolean value indicating whether the passed - * component is a descendant of a given component - * @param {Component} component Component to check - * @returns {Boolean} - */ - Component.prototype.contains = function (component) { - var result = !1; - if (!component) - return result; - var contains = function (components) { - !result && - components.forEach(function (item) { - if (item === component) - result = !0; - !result && contains(item.components()); - }); - }; - contains(this.components()); - return result; - }; - /** - * Once the tag is updated I have to rerender the element - * @private - */ - Component.prototype.tagUpdated = function () { - this.trigger('rerender'); - }; - /** - * Replace a component with another one - * @param {String|Component} el Component or HTML string - * @param {Object} [opts={}] Options for the append action - * @returns {Array} New replaced components - * @example - * const result = component.replaceWith('
Some new content
'); - * // result -> [Component] - */ - Component.prototype.replaceWith = function (el, opts) { - if (opts === void 0) { opts = {}; } - var coll = this.collection; - var at = coll.indexOf(this); - coll.remove(this); - var result = coll.add(el, Component_assign(Component_assign({}, opts), { at: at })); - return (0,index_all.isArray)(result) ? result : [result]; - }; - /** - * Emit changes for each updated attribute - * @private - */ - Component.prototype.attrUpdated = function (m, v, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - var attrs = this.get('attributes'); - // Handle classes - var classes = attrs.class; - classes && this.setClass(classes); - delete attrs.class; - // Handle style - var style = attrs.style; - style && this.setStyle(style, opts); - delete attrs.style; - var attrPrev = Component_assign({}, this.previous('attributes')); - var diff = (0,mixins.shallowDiff)(attrPrev, this.get('attributes')); - (0,index_all.keys)(diff).forEach(function (pr) { - var _a; - var attrKey = "attributes:".concat(pr); - _this.trigger("change:".concat(attrKey), _this, diff[pr], opts); - (_a = _this.em) === null || _a === void 0 ? void 0 : _a.trigger("".concat(keyUpdate, ":").concat(attrKey), _this, diff[pr], opts); - }); - }; - /** - * Update attributes of the component - * @param {Object} attrs Key value attributes - * @param {Object} options Options for the model update - * @return {this} - * @example - * component.setAttributes({ id: 'test', 'data-key': 'value' }); - */ - Component.prototype.setAttributes = function (attrs, opts) { - if (opts === void 0) { opts = {}; } - this.set('attributes', Component_assign({}, attrs), opts); - return this; - }; - /** - * Add attributes to the component - * @param {Object} attrs Key value attributes - * @param {Object} options Options for the model update - * @return {this} - * @example - * component.addAttributes({ 'data-key': 'value' }); - */ - Component.prototype.addAttributes = function (attrs, opts) { - if (opts === void 0) { opts = {}; } - return this.setAttributes(Component_assign(Component_assign({}, this.getAttributes({ noClass: true })), attrs), opts); - }; - /** - * Remove attributes from the component - * @param {String|Array} attrs Array of attributes to remove - * @param {Object} options Options for the model update - * @return {this} - * @example - * component.removeAttributes('some-attr'); - * component.removeAttributes(['some-attr1', 'some-attr2']); - */ - Component.prototype.removeAttributes = function (attrs, opts) { - if (attrs === void 0) { attrs = []; } - if (opts === void 0) { opts = {}; } - var attrArr = Array.isArray(attrs) ? attrs : [attrs]; - var compAttr = this.getAttributes(); - attrArr.map(function (i) { return delete compAttr[i]; }); - return this.setAttributes(compAttr, opts); - }; - /** - * Get the style of the component - * @return {Object} - */ - Component.prototype.getStyle = function (options, optsAdd) { - if (options === void 0) { options = {}; } - if (optsAdd === void 0) { optsAdd = {}; } - var em = this.em; - var prop = (0,index_all.isString)(options) ? options : ''; - var opts = prop ? optsAdd : options; - if (avoidInline(em) && !opts.inline) { - var state = em.get('state'); - var cc = em.Css; - var rule = cc.getIdRule(this.getId(), Component_assign({ state: state }, opts)); - this.rule = rule; - if (rule) { - return rule.getStyle(prop); - } - // Return empty style if not rule have been found. We cannot return inline style with the next return - // because else on load inline style is set a #id or .class style - return {}; - } - return _super.prototype.getStyle.call(this, prop); - }; - /** - * Set the style on the component - * @param {Object} prop Key value style object - * @return {Object} - * @example - * component.setStyle({ color: 'red' }); - */ - Component.prototype.setStyle = function (prop, opts) { - var _this = this; - if (prop === void 0) { prop = {}; } - if (opts === void 0) { opts = {}; } - var _a = this, opt = _a.opt, em = _a.em; - if (avoidInline(em) && !opt.temporary && !opts.inline) { - var style = this.get('style') || {}; - prop = (0,index_all.isString)(prop) ? this.parseStyle(prop) : prop; - prop = Component_assign(Component_assign({}, prop), style); - var state = em.get('state'); - var cc = em.Css; - var propOrig = this.getStyle(opts); - this.rule = cc.setIdRule(this.getId(), prop, Component_assign({ state: state }, opts)); - var diff = (0,mixins.shallowDiff)(propOrig, prop); - this.set('style', '', { silent: true }); - (0,index_all.keys)(diff).forEach(function (pr) { return _this.trigger("change:style:".concat(pr)); }); - } - else { - prop = _super.prototype.setStyle.apply(this, arguments); - } - if (!opt.temporary) { - this.__onStyleChange(opts.addStyle || prop); - } - return prop; - }; - /** - * Return all component's attributes - * @return {Object} - */ - Component.prototype.getAttributes = function (opts) { - if (opts === void 0) { opts = {}; } - var em = this.em; - var classes = []; - var attributes = Component_assign({}, this.get('attributes')); - var sm = em === null || em === void 0 ? void 0 : em.Selectors; - var id = this.getId(); - // Add classes - if (opts.noClass) { - delete attributes.class; - } - else { - this.classes.forEach(function (cls) { return classes.push((0,index_all.isString)(cls) ? cls : cls.getName()); }); - classes.length && (attributes.class = classes.join(' ')); - } - // Add style - if (!opts.noStyle) { - var style = this.getStyle({ inline: true }); - if ((0,mixins.isObject)(style) && !(0,mixins.isEmptyObj)(style)) { - attributes.style = this.styleToString({ inline: true }); - } - } - // Check if we need an ID on the component - if (!(0,index_all.has)(attributes, 'id')) { - var addId = false; - // If we don't rely on inline styling we have to check - // for the ID selector - if (avoidInline(em) || !(0,index_all.isEmpty)(this.getStyle())) { - addId = !!(sm === null || sm === void 0 ? void 0 : sm.get(id, sm.Selector.TYPE_ID)); - } - if ( - // Symbols should always have an id - isSymbol(this) || - // Components with script should always have an id - this.get('script-export') || - this.get('script')) { - addId = true; - } - if (addId) { - attributes.id = id; - } - } - return attributes; - }; - /** - * Add classes - * @param {Array|String} classes Array or string of classes - * @return {Array} Array of added selectors - * @example - * model.addClass('class1'); - * model.addClass('class1 class2'); - * model.addClass(['class1', 'class2']); - * // -> [SelectorObject, ...] - */ - Component.prototype.addClass = function (classes) { - var added = this.em.Selectors.addClass(classes); - return this.classes.add(added); - }; - /** - * Set classes (resets current collection) - * @param {Array|String} classes Array or string of classes - * @return {Array} Array of added selectors - * @example - * model.setClass('class1'); - * model.setClass('class1 class2'); - * model.setClass(['class1', 'class2']); - * // -> [SelectorObject, ...] - */ - Component.prototype.setClass = function (classes) { - this.classes.reset(); - return this.addClass(classes); - }; - /** - * Remove classes - * @param {Array|String} classes Array or string of classes - * @return {Array} Array of removed selectors - * @example - * model.removeClass('class1'); - * model.removeClass('class1 class2'); - * model.removeClass(['class1', 'class2']); - * // -> [SelectorObject, ...] - */ - Component.prototype.removeClass = function (classes) { - var removed = []; - classes = (0,index_all.isArray)(classes) ? classes : [classes]; - var selectors = this.classes; - var type = model_Selector.TYPE_CLASS; - classes.forEach(function (classe) { - var classes = classe.split(' '); - classes.forEach(function (name) { - var selector = selectors.where({ name: name, type: type })[0]; - selector && removed.push(selectors.remove(selector)); - }); - }); - return removed; - }; - /** - * Returns component's classes as an array of strings - * @return {Array} - */ - Component.prototype.getClasses = function () { - var attr = this.getAttributes(); - var classStr = attr.class; - return classStr ? classStr.split(' ') : []; - }; - Component.prototype.initClasses = function (m, c, opts) { - if (opts === void 0) { opts = {}; } - var event = 'change:classes'; - var _a = this.get('attributes') || {}, attrCls = _a.class, restAttr = Component_rest(_a, ["class"]); - var toListen = [this, event, this.initClasses]; - var cls = this.get('classes') || attrCls || []; - var clsArr = (0,index_all.isString)(cls) ? cls.split(' ') : cls; - this.stopListening.apply(this, toListen); - var classes = this.normalizeClasses(clsArr); - var selectors = new model_Selectors([]); - this.set('classes', selectors, opts); - selectors.add(classes); - selectors.on('add remove reset', this.__upSymbCls); - // Clear attributes from classes - attrCls && classes.length && this.set('attributes', restAttr); - // @ts-ignore - this.listenTo.apply(this, toListen); - return this; - }; - Component.prototype.initComponents = function () { - var event = 'change:components'; - var toListen = [this, event, this.initComponents]; - this.stopListening.apply(this, toListen); - // Have to add components after the init, otherwise the parent - // is not visible - var comps = new model_Components([], this.opt); - comps.parent = this; - var components = this.get('components'); - var addChild = !this.opt.avoidChildren; - this.set('components', comps); - addChild && components && comps.add((0,index_all.isFunction)(components) ? components(this) : components, this.opt); - comps.on('add remove reset', this.__upSymbComps); - // @ts-ignore - this.listenTo.apply(this, toListen); - return this; - }; - Component.prototype.initTraits = function (changed) { - var em = this.em; - var event = 'change:traits'; - this.off(event, this.initTraits); - this.__loadTraits(); - var attrs = Component_assign({}, this.get('attributes')); - var traits = this.traits; - traits.each(function (trait) { - if (!trait.changeProp) { - var name_1 = trait.getName(); - var value = trait.getInitValue(); - if (name_1 && value) - attrs[name_1] = value; - } - }); - traits.length && this.set('attributes', attrs); - this.on(event, this.initTraits); - changed && em && em.trigger('component:toggled'); - return this; - }; - Component.prototype.initScriptProps = function () { - if (this.opt.temporary) - return; - var prop = 'script-props'; - var toListen = ["change:".concat(prop), this.initScriptProps]; - this.off.apply(this, toListen); - var prevProps = this.previous(prop) || []; - var newProps = this.get(prop) || []; - var prevPropsEv = prevProps.map(function (e) { return "change:".concat(e); }).join(' '); - var newPropsEv = newProps.map(function (e) { return "change:".concat(e); }).join(' '); - prevPropsEv && this.off(prevPropsEv, this.__scriptPropsChange); - newPropsEv && this.on(newPropsEv, this.__scriptPropsChange); - // @ts-ignore - this.on.apply(this, toListen); - }; - Component.prototype.__scriptPropsChange = function (m, v, opts) { - if (opts === void 0) { opts = {}; } - if (opts.avoidStore) - return; - this.trigger('rerender'); - }; - /** - * Add new component children - * @param {Component|String} components Component to add - * @param {Object} [opts={}] Options for the append action - * @return {Array} Array of appended components - * @example - * someComponent.get('components').length // -> 0 - * const videoComponent = someComponent.append('
')[0]; - * // This will add 2 components (`video` and `div`) to your `someComponent` - * someComponent.get('components').length // -> 2 - * // You can pass components directly - * otherComponent.append(otherComponent2); - * otherComponent.append([otherComponent3, otherComponent4]); - * // append at specific index (eg. at the beginning) - * someComponent.append(otherComponent, { at: 0 }); - */ - Component.prototype.append = function (components, opts) { - if (opts === void 0) { opts = {}; } - var compArr = (0,index_all.isArray)(components) ? Component_spreadArray([], components, true) : [components]; - var toAppend = compArr.map(function (comp) { - if ((0,index_all.isString)(comp)) { - return comp; - } - else { - // I have to remove components from the old container before adding them to a new one - comp.collection && comp.collection.remove(comp, { temporary: true }); - return comp; - } - }); - var result = this.components().add(toAppend, Component_assign({ action: dom_components_types/* ActionLabelComponents */.W.add }, opts)); - return (0,index_all.isArray)(result) ? result : [result]; - }; - /** - * Set new collection if `components` are provided, otherwise the - * current collection is returned - * @param {Component|Component[]|String} [components] Component Definitions or HTML string - * @param {Object} [opts={}] Options, same as in `Component.append()` - * @returns {Collection|Array<[Component]>} - * @example - * // Set new collection - * component.components('
'); - * // Get current collection - * const collection = component.components(); - * console.log(collection.length); - * // -> 2 - */ - Component.prototype.components = function (components, opts) { - if (opts === void 0) { opts = {}; } - var coll = this.get('components'); - if ((0,index_all.isUndefined)(components)) { - return coll; - } - else { - coll.reset(undefined, opts); - return components ? this.append(components, opts) : []; - } - }; - /** - * If exists, returns the child component at specific index. - * @param {Number} index Index of the component to return - * @returns {[Component]|null} - * @example - * // Return first child - * component.getChildAt(0); - * // Return second child - * component.getChildAt(1); - */ - Component.prototype.getChildAt = function (index) { - return this.components().at(index || 0) || undefined; - }; - /** - * If exists, returns the last child component. - * @returns {[Component]|null} - * @example - * const lastChild = component.getLastChild(); - */ - Component.prototype.getLastChild = function () { - var children = this.components(); - return children.at(children.length - 1) || null; - }; - /** - * Remove all inner components - * * @return {this} - */ - Component.prototype.empty = function (opts) { - if (opts === void 0) { opts = {}; } - this.components().reset(undefined, opts); - return this; - }; - /** - * Get the parent component, if exists - * @return {Component|null} - * @example - * component.parent(); - * // -> Component - */ - Component.prototype.parent = function (opts) { - if (opts === void 0) { opts = {}; } - var coll = this.collection || (opts.prev && this.prevColl); - return coll ? coll.parent : undefined; - }; - /** - * Return all parents of the component. - * @returns {Array} - */ - Component.prototype.parents = function () { - var parent = this.parent(); - return parent ? [parent].concat(parent.parents()) : []; - }; - /** - * Script updated - * @private - */ - Component.prototype.scriptUpdated = function () { - this.set('scriptUpdated', 1); - }; - /** - * Init toolbar - * @private - */ - Component.prototype.initToolbar = function () { - var em = this.em; - var model = this; - var ppfx = (em && em.getConfig().stylePrefix) || ''; - if (!model.get('toolbar') && em) { - var tb = []; - model.collection && - tb.push({ - label: em.getIcon('arrowUp'), - command: function (ed) { return ed.runCommand('core:component-exit', { force: 1 }); }, - }); - model.get('draggable') && - tb.push({ - attributes: { class: "".concat(ppfx, "no-touch-actions"), draggable: true }, - label: em.getIcon('move'), - command: 'tlb-move', - }); - model.get('copyable') && - tb.push({ - label: em.getIcon('copy'), - command: 'tlb-clone', - }); - model.get('removable') && - tb.push({ - label: em.getIcon('delete'), - command: 'tlb-delete', - }); - model.set('toolbar', tb); - } - }; - Component.prototype.__loadTraits = function (tr, opts) { - if (opts === void 0) { opts = {}; } - var traitsI = tr || this.traits; - if (!(traitsI instanceof model_Traits)) { - traitsI = ((0,index_all.isFunction)(traitsI) ? traitsI(this) : traitsI); - var traits = new model_Traits([], this.opt); - traits.setTarget(this); - if (traitsI.length) { - traitsI.forEach(function (tr) { return tr.attributes && delete tr.attributes.value; }); - traits.add(traitsI); - } - this.set({ traits: traits }, opts); - } - return this; - }; - /** - * Get traits. - * @returns {Array} - * @example - * const traits = component.getTraits(); - * console.log(traits); - * // [Trait, Trait, Trait, ...] - */ - Component.prototype.getTraits = function () { - this.__loadTraits(); - return Component_spreadArray([], this.traits.models, true); - }; - /** - * Replace current collection of traits with a new one. - * @param {Array} traits Array of trait definitions - * @returns {Array} - * @example - * const traits = component.setTraits([{ type: 'checkbox', name: 'disabled'}, ...]); - * console.log(traits); - * // [Trait, ...] - */ - Component.prototype.setTraits = function (traits) { - var tr = (0,index_all.isArray)(traits) ? traits : [traits]; - // @ts-ignore - this.set({ traits: tr }); - return this.getTraits(); - }; - /** - * Get the trait by id/name. - * @param {String} id The `id` or `name` of the trait - * @return {Trait|null} Trait getModelToStyle - * @example - * const traitTitle = component.getTrait('title'); - * traitTitle && traitTitle.set('label', 'New label'); - */ - Component.prototype.getTrait = function (id) { - return (this.getTraits().filter(function (trait) { - return trait.get('id') === id || trait.get('name') === id; - })[0] || null); - }; - /** - * Update a trait. - * @param {String} id The `id` or `name` of the trait - * @param {Object} props Object with the props to update - * @return {this} - * @example - * component.updateTrait('title', { - * type: 'select', - * options: [ 'Option 1', 'Option 2' ], - * }); - */ - Component.prototype.updateTrait = function (id, props) { - var _a; - var trait = this.getTrait(id); - trait && trait.set(props); - (_a = this.em) === null || _a === void 0 ? void 0 : _a.trigger('component:toggled'); - return this; - }; - /** - * Get the trait position index by id/name. Useful in case you want to - * replace some trait, at runtime, with something else. - * @param {String} id The `id` or `name` of the trait - * @return {Number} Index position of the current trait - * @example - * const traitTitle = component.getTraitIndex('title'); - * console.log(traitTitle); // 1 - */ - Component.prototype.getTraitIndex = function (id) { - var trait = this.getTrait(id); - return trait ? this.traits.indexOf(trait) : -1; - }; - /** - * Remove trait/s by id/s. - * @param {String|Array} id The `id`/`name` of the trait (or an array) - * @return {Array} Array of removed traits - * @example - * component.removeTrait('title'); - * component.removeTrait(['title', 'id']); - */ - Component.prototype.removeTrait = function (id) { - var _this = this; - var _a; - var ids = (0,index_all.isArray)(id) ? id : [id]; - var toRemove = ids.map(function (id) { return _this.getTrait(id); }); - var traits = this.traits; - var removed = toRemove.length ? traits.remove(toRemove) : []; - (_a = this.em) === null || _a === void 0 ? void 0 : _a.trigger('component:toggled'); - return (0,index_all.isArray)(removed) ? removed : [removed]; - }; - /** - * Add new trait/s. - * @param {String|Object|Array} trait Trait to add (or an array of traits) - * @param {Options} opts Options for the add - * @return {Array} Array of added traits - * @example - * component.addTrait('title', { at: 1 }); // Add title trait (`at` option is the position index) - * component.addTrait({ - * type: 'checkbox', - * name: 'disabled', - * }); - * component.addTrait(['title', {...}, ...]); - */ - Component.prototype.addTrait = function (trait, opts) { - var _a; - if (opts === void 0) { opts = {}; } - this.__loadTraits(); - var added = this.traits.add(trait, opts); - (_a = this.em) === null || _a === void 0 ? void 0 : _a.trigger('component:toggled'); - return (0,index_all.isArray)(added) ? added : [added]; - }; - /** - * Normalize input classes from array to array of objects - * @param {Array} arr - * @return {Array} - * @private - */ - Component.prototype.normalizeClasses = function (arr) { - var res = []; - var em = this.em; - var clm = em === null || em === void 0 ? void 0 : em.Selectors; - if (!clm) - return []; - // @ts-ignore - if (arr.models) - return Component_spreadArray([], arr.models, true); - arr.forEach(function (val) { return res.push(clm.add(val)); }); - return res; - }; - /** - * Override original clone method - * @private - * @ts-ignore */ - Component.prototype.clone = function (opt) { - if (opt === void 0) { opt = {}; } - var em = this.em; - var attr = Component_assign({}, this.attributes); - var opts = Component_assign({}, this.opt); - var id = this.getId(); - var cssc = em === null || em === void 0 ? void 0 : em.Css; - attr.attributes = Component_assign({}, attr.attributes); - delete attr.attributes.id; - // @ts-ignore - attr.components = []; - // @ts-ignore - attr.classes = []; - // @ts-ignore - attr.traits = []; - if (isSymbolRoot(this)) { - opt.symbol = true; - } - this.get('components').each(function (md, i) { - // @ts-ignore - attr.components[i] = md.clone(Component_assign(Component_assign({}, opt), { _inner: 1 })); - }); - this.get('traits').each(function (md, i) { - // @ts-ignore - attr.traits[i] = md.clone(); - }); - this.get('classes').each(function (md, i) { - // @ts-ignore - attr.classes[i] = md.get('name'); - }); - attr.status = ''; - // @ts-ignore - opts.collection = null; - // @ts-ignore - var cloned = new this.constructor(attr, opts); - // Clone component specific rules - var newId = "#".concat(cloned.getId()); - var rulesToClone = cssc ? cssc.getRules("#".concat(id)) : []; - rulesToClone.forEach(function (rule) { - var newRule = rule.clone(); - // @ts-ignore - newRule.set('selectors', [newId]); - cssc.getAll().add(newRule); - }); - // Symbols - // If I clone an inner symbol, I have to reset it - cloned.set(keySymbols, 0); - var symbol = getSymbolMain(this); - var symbols = getSymbolInstances(this); - if (!opt.symbol && (symbol || symbols)) { - cloned.set(keySymbol, 0); - cloned.set(keySymbols, 0); - } - else if (symbol) { - // Contains already a reference to a symbol - symbol.set(keySymbols, Component_spreadArray(Component_spreadArray([], getSymbolInstances(symbol), true), [cloned], false)); - initSymbol(cloned); - } - else if (opt.symbol) { - // Request to create a symbol - if (isSymbolMain(this)) { - // Already a symbol, cloned should be an instance - this.set(keySymbols, Component_spreadArray(Component_spreadArray([], symbols, true), [cloned], false)); - cloned.set(keySymbol, this); - initSymbol(cloned); - } - else if (opt.symbolInv) { - // Inverted, cloned is the instance, the origin is the main symbol - this.set(keySymbols, [cloned]); - cloned.set(keySymbol, this); - [this, cloned].map(function (i) { return initSymbol(i); }); - } - else { - // Cloned becomes the main symbol - cloned.set(keySymbols, [this]); - [this, cloned].map(function (i) { return initSymbol(i); }); - this.set(keySymbol, cloned); - } - } - var event = 'component:clone'; - em && em.trigger(event, cloned); - this.trigger(event, cloned); - return cloned; - }; - /** - * Get the name of the component. - * @param {Object} [opts={}] Options - * @param {Boolean} [opts.noCustom] Avoid custom name assigned to the component. - * @returns {String} - * */ - Component.prototype.getName = function (opts) { - if (opts === void 0) { opts = {}; } - var em = this.em; - var _a = this.attributes, type = _a.type, tagName = _a.tagName, name = _a.name; - var defName = type || tagName; - var nameTag = !type ? tagName : ''; - var i18nPfx = 'domComponents.names.'; - var i18nName = name && (em === null || em === void 0 ? void 0 : em.t("".concat(i18nPfx).concat(name))); - var i18nNameTag = nameTag && (em === null || em === void 0 ? void 0 : em.t("".concat(i18nPfx).concat(nameTag))); - var i18nDefName = em && (em.t("".concat(i18nPfx).concat(type)) || em.t("".concat(i18nPfx).concat(tagName))); - var customName = this.get('custom-name'); - return ((!opts.noCustom ? customName : '') || // Used in Layers (when the user changes the name) - i18nName || // Use local component `name` key (eg. `domComponents.names.myComponentName`) - name || // Use component `name` key - i18nNameTag || // Use local component `tagName` key (eg. `domComponents.names.div`) - (0,mixins.capitalize)(nameTag) || // Use component `tagName` key - i18nDefName || // Use local component `type` key (eg. `domComponents.names.image`) - (0,mixins.capitalize)(defName) // Use component `type` key - ); - }; - /** - * Update component name. - * @param {String} name New name. - */ - Component.prototype.setName = function (name, opts) { - if (opts === void 0) { opts = {}; } - this.set('custom-name', name, opts); - }; - /** - * Get the icon string - * @return {String} - */ - Component.prototype.getIcon = function () { - var icon = this.get('icon'); - return icon ? icon + ' ' : ''; - }; - /** - * Return HTML string of the component - * @param {Object} [opts={}] Options - * @param {String} [opts.tag] Custom tagName - * @param {Object|Function} [opts.attributes=null] You can pass an object of custom attributes to replace with the current ones or you can even pass a function to generate attributes dynamically. - * @param {Boolean} [opts.withProps] Include component properties as `data-gjs-*` attributes. This allows you to have re-importable HTML. - * @param {Boolean} [opts.altQuoteAttr] In case the attribute value contains a `"` char, instead of escaping it (`attr="value ""`), the attribute will be quoted using single quotes (`attr='value "'`). - * @return {String} HTML string - * @example - * // Simple HTML return - * component.set({ tagName: 'span' }); - * component.setAttributes({ title: 'Hello' }); - * component.toHTML(); - * // -> - * - * // Custom attributes - * component.toHTML({ attributes: { 'data-test': 'Hello' } }); - * // -> - * - * // Custom dynamic attributes - * component.toHTML({ - * attributes(component, attributes) { - * if (component.get('tagName') == 'span') { - * attributes.title = 'Custom attribute'; - * } - * return attributes; - * }, - * }); - * // -> - */ - Component.prototype.toHTML = function (opts) { - if (opts === void 0) { opts = {}; } - var model = this; - var attrs = []; - var customTag = opts.tag; - var tag = customTag || model.get('tagName'); - var sTag = model.get('void'); - var customAttr = opts.attributes; - var attributes = this.getAttrToHTML(opts); - delete opts.tag; - // Get custom attributes if requested - if (customAttr) { - if ((0,index_all.isFunction)(customAttr)) { - attributes = customAttr(model, attributes) || {}; - } - else if ((0,mixins.isObject)(customAttr)) { - attributes = customAttr; - } - } - if (opts.withProps) { - var props = this.toJSON(); - (0,index_all.forEach)(props, function (value, key) { - var skipProps = ['classes', 'attributes', 'components']; - if (key[0] !== '_' && skipProps.indexOf(key) < 0) { - attributes["data-gjs-".concat(key)] = - (0,index_all.isArray)(value) || (0,mixins.isObject)(value) ? JSON.stringify(value) : (0,index_all.isBoolean)(value) ? "".concat(value) : value; - } - }); - } - for (var attr in attributes) { - var val = attributes[attr]; - if (!(0,index_all.isUndefined)(val) && val !== null) { - if ((0,index_all.isBoolean)(val)) { - val && attrs.push(attr); - } - else { - var valueRes = ''; - if (opts.altQuoteAttr && (0,index_all.isString)(val) && val.indexOf('"') >= 0) { - valueRes = "'".concat(val.replace(/'/g, '''), "'"); - } - else { - var value = (0,index_all.isString)(val) ? val.replace(/"/g, '"') : val; - valueRes = "\"".concat(value, "\""); - } - attrs.push("".concat(attr, "=").concat(valueRes)); - } - } - } - var attrString = attrs.length ? " ".concat(attrs.join(' ')) : ''; - var inner = model.getInnerHTML(opts); - var code = "<".concat(tag).concat(attrString).concat(sTag ? '/' : '', ">").concat(inner); - !sTag && (code += "")); - return code; - }; - /** - * Get inner HTML of the component - * @param {Object} [opts={}] Same options of `toHTML` - * @returns {String} HTML string - */ - Component.prototype.getInnerHTML = function (opts) { - return this.__innerHTML(opts); - }; - Component.prototype.__innerHTML = function (opts) { - if (opts === void 0) { opts = {}; } - var cmps = this.components(); - return !cmps.length ? this.content : cmps.map(function (c) { return c.toHTML(opts); }).join(''); - }; - /** - * Returns object of attributes for HTML - * @return {Object} - * @private - */ - Component.prototype.getAttrToHTML = function (opts) { - var attrs = this.getAttributes(); - if (avoidInline(this.em) && (opts === null || opts === void 0 ? void 0 : opts.keepInlineStyle) !== true) { - delete attrs.style; - } - return attrs; - }; - /** - * Return a shallow copy of the model's attributes for JSON - * stringification. - * @return {Object} - * @private - */ - Component.prototype.toJSON = function (opts) { - if (opts === void 0) { opts = {}; } - var obj = backbone.Model.prototype.toJSON.call(this, opts); - obj.attributes = this.getAttributes(); - delete obj.attributes.class; - delete obj.toolbar; - delete obj.traits; - delete obj.status; - delete obj.open; // used in Layers - delete obj._undoexc; - delete obj.delegate; - if (!opts.fromUndo) { - var symbol = obj[keySymbol]; - var symbols = obj[keySymbols]; - if (symbols && (0,index_all.isArray)(symbols)) { - obj[keySymbols] = symbols.filter(function (i) { return i; }).map(function (i) { return (i.getId ? i.getId() : i); }); - } - if (symbol && !(0,index_all.isString)(symbol)) { - obj[keySymbol] = symbol.getId(); - } - } - if (this.em.getConfig().avoidDefaults) { - this.getChangedProps(obj); - } - return obj; - }; - /** - * Return an object containing only changed props - */ - Component.prototype.getChangedProps = function (res) { - var obj = res || backbone.Model.prototype.toJSON.apply(this); - var defaults = (0,index_all.result)(this, 'defaults'); - (0,index_all.forEach)(defaults, function (value, key) { - if (['type'].indexOf(key) === -1 && obj[key] === value) { - delete obj[key]; - } - }); - if ((0,index_all.isEmpty)(obj.type)) { - delete obj.type; - } - (0,index_all.forEach)(['attributes', 'style'], function (prop) { - if ((0,index_all.isEmpty)(defaults[prop]) && (0,index_all.isEmpty)(obj[prop])) { - delete obj[prop]; - } - }); - (0,index_all.forEach)(['classes', 'components'], function (prop) { - if (!obj[prop] || ((0,index_all.isEmpty)(defaults[prop]) && !obj[prop].length)) { - delete obj[prop]; - } - }); - return obj; - }; - /** - * Return the component id - * @return {String} - */ - Component.prototype.getId = function () { - var attrs = this.get('attributes') || {}; - return attrs.id || this.ccid || this.cid; - }; - /** - * Set new id on the component - * @param {String} id - * @return {this} - */ - Component.prototype.setId = function (id, opts) { - var attrs = Component_assign({}, this.get('attributes')); - attrs.id = id; - this.set('attributes', attrs, opts); - return this; - }; - /** - * Get the DOM element of the component. - * This works only if the component is already rendered - * @param {Frame} frame Specific frame from which taking the element - * @return {HTMLElement} - */ - Component.prototype.getEl = function (frame) { - var view = this.getView(frame); - return view && view.el; - }; - /** - * Get the View of the component. - * This works only if the component is already rendered - * @param {Frame} frame Get View of a specific frame - * @return {ComponentView} - */ - Component.prototype.getView = function (frame) { - var _a = this, view = _a.view, views = _a.views, em = _a.em; - var frm = frame || (em === null || em === void 0 ? void 0 : em.getCurrentFrameModel()); - if (frm) { - view = views.filter(function (view) { return view.frameView === frm.view; })[0]; - } - return view; - }; - Component.prototype.getCurrentView = function () { - var frameView = this.em.getCurrentFrame(); - var frame = frameView === null || frameView === void 0 ? void 0 : frameView.model; - return this.getView(frame); - }; - Component.prototype.__getScriptProps = function () { - var modelProps = this.props(); - var scrProps = this.get('script-props') || []; - return scrProps.reduce(function (acc, prop) { - acc[prop] = modelProps[prop]; - return acc; - }, {}); - }; - /** - * Return script in string format, cleans 'function() {..' from scripts - * if it's a function - * @param {string|Function} script - * @return {string} - * @private - */ - Component.prototype.getScriptString = function (script) { - var _this = this; - var scr = script || this.get('script') || ''; - if (!scr) { - return scr; - } - if (this.get('script-props')) { - scr = scr.toString().trim(); - } - else { - // Deprecated - // Need to convert script functions to strings - if ((0,index_all.isFunction)(scr)) { - var scrStr = scr.toString().trim(); - scrStr = scrStr.slice(scrStr.indexOf('{') + 1, scrStr.lastIndexOf('}')); - scr = scrStr.trim(); - } - var config = this.em.getConfig(); - var tagVarStart = escapeRegExp(config.tagVarStart || '{[ '); - var tagVarEnd = escapeRegExp(config.tagVarEnd || ' ]}'); - var reg = new RegExp("".concat(tagVarStart, "([\\w\\d-]*)").concat(tagVarEnd), 'g'); - scr = scr.replace(reg, function (match, v) { - // If at least one match is found I have to track this change for a - // better optimization inside JS generator - _this.scriptUpdated(); - var result = _this.attributes[v] || ''; - return (0,index_all.isArray)(result) || typeof result == 'object' ? JSON.stringify(result) : result; - }); - } - return scr; - }; - Component.prototype.emitUpdate = function (property) { - var _a; - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - var em = this.em; - var event = keyUpdate + (property ? ":".concat(property) : ''); - var item = property && this.get(property); - // @ts-ignore - property && this.updated.apply(this, Component_spreadArray([property, item, property && this.previous(property)], args, false)); - this.trigger.apply(this, Component_spreadArray([event], args, false)); - em && em.trigger.apply(em, Component_spreadArray([event, this], args, false)); - ['components', 'classes'].indexOf(property) >= 0 && - this.__propSelfToParent({ - component: this, - changed: (_a = {}, _a[property] = item, _a), - options: args[2] || args[1] || {}, - }); - }; - /** - * Execute callback function on itself and all inner components - * @param {Function} clb Callback function, the model is passed as an argument - * @return {this} - * @example - * component.onAll(component => { - * // do something with component - * }) - */ - Component.prototype.onAll = function (clb) { - if ((0,index_all.isFunction)(clb)) { - clb(this); - this.components().forEach(function (model) { return model.onAll(clb); }); - } - return this; - }; - /** - * Execute a callback function on all inner child components. - * @param {Function} clb Callback function, the child component is passed as an argument - * @example - * component.forEachChild(child => { - * console.log(child) - * }) - */ - Component.prototype.forEachChild = function (clb) { - if ((0,index_all.isFunction)(clb)) { - this.components().forEach(function (child) { - clb(child); - child.forEachChild(clb); - }); - } - }; - /** - * Remove the component - * @return {this} - */ - Component.prototype.remove = function (opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - var em = this.em; - var coll = this.collection; - var remove = function () { - coll && coll.remove(_this, Component_assign({ action: dom_components_types/* ActionLabelComponents */.W.remove }, opts)); - // Component without parent - if (!coll) { - _this.components('', opts); - _this.components().removeChildren(_this, undefined, opts); - } - }; - var rmOpts = Component_assign({}, opts); - [this, em].map(function (i) { return i.trigger(dom_components_types/* ComponentsEvents */.g.removeBefore, _this, remove, rmOpts); }); - !rmOpts.abort && remove(); - return this; - }; - /** - * Move the component to another destination component - * @param {Component} component Destination component (so the current one will be appended as a child) - * @param {Object} opts Options for the append action - * @returns {this} - * @example - * // Move the selected component on top of the wrapper - * const dest = editor.getWrapper(); - * editor.getSelected().move(dest, { at: 0 }); - */ - Component.prototype.move = function (component, opts) { - if (opts === void 0) { opts = {}; } - if (component) { - var at = opts.at; - var index = this.index(); - var sameParent = component === this.parent(); - var sameIndex = index === at || index === at - 1; - if (!sameParent || !sameIndex) { - if (sameParent && at && at > index) { - opts.at = at - 1; - } - var action = dom_components_types/* ActionLabelComponents */.W.move; - this.remove({ action: action, temporary: 1 }); - component.append(this, Component_assign({ action: action }, opts)); - this.emitUpdate(); - } - } - return this; - }; - /** - * Check if the component is an instance of some component type. - * @param {String} type Component type - * @returns {Boolean} - * @example - * // Add a new component type by extending an existing one - * editor.Components.addType('text-ext', { extend: 'text' }); - * // Append a new component somewhere - * const newTextExt = editor.getSelected().append({ type: 'text-ext' })[0]; - * newTextExt.isInstanceOf('text-ext'); // true - * newTextExt.isInstanceOf('text'); // true - */ - Component.prototype.isInstanceOf = function (type) { - var _a, _b; - var cmp = (_b = (_a = this.em) === null || _a === void 0 ? void 0 : _a.Components.getType(type)) === null || _b === void 0 ? void 0 : _b.model; - if (!cmp) - return false; - // A tiny hack to make isInstanceOf work properly where there a multiple inheritance - var typeExtends = this.constructor.typeExtends; - return this instanceof cmp || typeExtends.has(type); - }; - /** - * Check if the component is a child of some other component (or component type) - * @param {[Component]|String} component Component parent to check. In case a string is passed, - * the check will be performed on the component type. - * @returns {Boolean} - * @example - * const newTextComponent = editor.getSelected().append({ - * type: 'text', - * components: 'My text here', - * })[0]; - * const innerComponent = newTextComponent.find('b')[0]; - * innerComponent.isChildOf(newTextComponent); // true - * innerComponent.isChildOf('text'); // true - */ - Component.prototype.isChildOf = function (component) { - var byType = (0,index_all.isString)(component); - var parent = this.parent(); - while (parent) { - if (byType) { - if (parent.isInstanceOf(component)) { - return true; - } - } - else { - if (parent === component) { - return true; - } - } - parent = parent.parent(); - } - return false; - }; - /** - * Reset id of the component and any of its style rule - * @param {Object} [opts={}] Options - * @return {this} - * @private - */ - Component.prototype.resetId = function (opts) { - if (opts === void 0) { opts = {}; } - var em = this.em; - var oldId = this.getId(); - if (!oldId) - return this; - var newId = Component.createId(this); - this.setId(newId); - var rule = em === null || em === void 0 ? void 0 : em.Css.getIdRule(oldId); - var selector = rule === null || rule === void 0 ? void 0 : rule.get('selectors').at(0); - selector === null || selector === void 0 ? void 0 : selector.set('name', newId); - return this; - }; - Component.prototype._getStyleRule = function (_a) { - var _b = _a === void 0 ? {} : _a, id = _b.id; - var em = this.em; - var idS = id || this.getId(); - return em === null || em === void 0 ? void 0 : em.Css.getIdRule(idS); - }; - Component.prototype._getStyleSelector = function (opts) { - var rule = this._getStyleRule(opts); - return rule === null || rule === void 0 ? void 0 : rule.get('selectors').at(0); - }; - Component.prototype._idUpdated = function (m, v, opts) { - if (opts === void 0) { opts = {}; } - if (opts.idUpdate) - return; - var ccid = this.ccid; - var id = (this.get('attributes') || {}).id; - var idPrev = (this.previous('attributes') || {}).id || ccid; - var list = Component.getList(this); - // If the ID already exists I need to rollback to the old one - if (list[id] || (!id && idPrev)) { - return this.setId(idPrev, { idUpdate: true }); - } - // Remove the old ID reference and add the new one - delete list[idPrev]; - list[id] = this; - this.ccid = id; - // Update the style selector name - var selector = this._getStyleSelector({ id: idPrev }); - selector && selector.set({ name: id, label: id }); - }; - Component.getDefaults = function () { - return (0,index_all.result)(this.prototype, 'defaults'); - }; - Component.isComponent = function (el, opts) { - return { tagName: (0,mixins.toLowerCase)(el.tagName) }; - }; - Component.ensureInList = function (model) { - var list = Component.getList(model); - var id = model.getId(); - var current = list[id]; - if (!current) { - // Insert in list - list[id] = model; - } - else if (current !== model) { - // Create new ID - var nextId = Component.getIncrementId(id, list); - model.setId(nextId); - list[nextId] = model; - } - model.components().forEach(function (i) { return Component.ensureInList(i); }); - }; - Component.createId = function (model, opts) { - if (opts === void 0) { opts = {}; } - var list = Component.getList(model); - var _a = opts.idMap, idMap = _a === void 0 ? {} : _a; - var id = model.get('attributes').id; - var nextId; - if (id) { - nextId = Component.getIncrementId(id, list, opts); - model.setId(nextId); - if (id !== nextId) - idMap[id] = nextId; - } - else { - nextId = Component.getNewId(list); - } - list[nextId] = model; - return nextId; - }; - Component.getNewId = function (list) { - var count = Object.keys(list).length; - // Testing 1000000 components with `+ 2` returns 0 collisions - var ilen = count.toString().length + 2; - var uid = (Math.random() + 1.1).toString(36).slice(-ilen); - var newId = "i".concat(uid); - while (list[newId]) { - newId = Component.getNewId(list); - } - return newId; - }; - Component.getIncrementId = function (id, list, opts) { - if (opts === void 0) { opts = {}; } - var _a = opts.keepIds, keepIds = _a === void 0 ? [] : _a; - var counter = 1; - var newId = id; - if (keepIds.indexOf(id) < 0) { - while (list[newId]) { - counter++; - newId = "".concat(id, "-").concat(counter); - } - } - return newId; - }; - Component.getList = function (model) { - var _a; - var em = model.em; - var dm = em === null || em === void 0 ? void 0 : em.Components; - return (_a = dm === null || dm === void 0 ? void 0 : dm.componentsById) !== null && _a !== void 0 ? _a : {}; - }; - Component.checkId = function (components, styles, list, opts) { - if (styles === void 0) { styles = []; } - if (list === void 0) { list = {}; } - if (opts === void 0) { opts = {}; } - var comps = (0,index_all.isArray)(components) ? components : [components]; - var _a = opts.keepIds, keepIds = _a === void 0 ? [] : _a, _b = opts.idMap, idMap = _b === void 0 ? {} : _b; - comps.forEach(function (comp) { - comp.attributes; - var _a = comp.attributes, attributes = _a === void 0 ? {} : _a, components = comp.components; - var id = attributes.id; - // Check if we have collisions with current components - if (id && list[id] && keepIds.indexOf(id) < 0) { - var newId_1 = Component.getIncrementId(id, list); - idMap[id] = newId_1; - attributes.id = newId_1; - // Update passed styles - (0,index_all.isArray)(styles) && - styles.forEach(function (style) { - var selectors = style.selectors; - selectors.forEach(function (sel, idx) { - if (sel === "#".concat(id)) - selectors[idx] = "#".concat(newId_1); - }); - }); - } - components && Component.checkId(components, styles, list, opts); - }); - }; - Component.typeExtends = new Set(); - return Component; -}(model_StyleableModel)); -/* harmony default export */ const model_Component = (Component); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentHead.ts -var ComponentHead_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentHead_assign = (undefined && undefined.__assign) || function () { - ComponentHead_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentHead_assign.apply(this, arguments); -}; - - -var type = 'head'; -var droppable = ['title', 'style', 'base', 'link', 'meta', 'script', 'noscript']; -var ComponentHead = /** @class */ (function (_super) { - ComponentHead_extends(ComponentHead, _super); - function ComponentHead() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ComponentHead.prototype, "defaults", { - get: function () { - return ComponentHead_assign(ComponentHead_assign({}, _super.prototype.defaults), { type: type, tagName: type, draggable: false, highlightable: false, droppable: (function (_a) { - var tagName = _a.tagName; - return !tagName || droppable.includes((0,mixins.toLowerCase)(tagName)); - }) }); - }, - enumerable: false, - configurable: true - }); - ComponentHead.isComponent = function (el) { - return (0,mixins.toLowerCase)(el.tagName) === type; - }; - return ComponentHead; -}(model_Component)); -/* harmony default export */ const model_ComponentHead = (ComponentHead); - -;// CONCATENATED MODULE: ./src/utils/Droppable.ts -var Droppable_assign = (undefined && undefined.__assign) || function () { - Droppable_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return Droppable_assign.apply(this, arguments); -}; - - -/** - * This class makes the canvas droppable - */ -var Droppable = /** @class */ (function () { - function Droppable(em, rootEl) { - var _this = this; - this.em = em; - this.canvas = em.Canvas; - var el = rootEl || this.canvas.getFrames().map(function (frame) { return frame.getComponent().getEl(); }); - var els = Array.isArray(el) ? el : [el]; - this.el = els[0]; - this.counter = 0; - (0,index_all.bindAll)(this, 'handleDragEnter', 'handleDragOver', 'handleDrop', 'handleDragLeave'); - els.forEach(function (el) { return _this.toggleEffects(el, true); }); - } - Droppable.prototype.toggleEffects = function (el, enable) { - var methods = { on: dom.on, off: dom/* off */.S1 }; - var method = enable ? 'on' : 'off'; - methods[method](el, 'dragenter', this.handleDragEnter); - methods[method](el, 'dragover', this.handleDragOver); - methods[method](el, 'drop', this.handleDrop); - methods[method](el, 'dragleave', this.handleDragLeave); - }; - Droppable.prototype.__customTglEff = function (enable) { - var _a; - var method = enable ? dom.on : dom/* off */.S1; - var doc = this.el.ownerDocument; - var frameEl = (_a = doc.defaultView) === null || _a === void 0 ? void 0 : _a.frameElement; - this.sortOpts = enable - ? { - onStart: function (_a) { - var sorter = _a.sorter; - (0,dom.on)(frameEl, 'pointermove', sorter.onMove); - }, - onEnd: function (_a) { - var sorter = _a.sorter; - (0,dom/* off */.S1)(frameEl, 'pointermove', sorter.onMove); - }, - customTarget: function (_a) { - var event = _a.event; - return doc.elementFromPoint(event.clientX, event.clientY); - }, - } - : null; - method(frameEl, 'pointerenter', this.handleDragEnter); - method(frameEl, 'pointermove', this.handleDragOver); - method(document, 'pointerup', this.handleDrop); - method(frameEl, 'pointerout', this.handleDragLeave); - // Test with touch devices (seems like frameEl is not capturing pointer events). - // on/off(document, 'pointermove', sorter.onMove); // for the sorter - // enable && this.handleDragEnter({}); // no way to use pointerenter/pointerout - }; - Droppable.prototype.startCustom = function () { - this.__customTglEff(true); - }; - Droppable.prototype.endCustom = function (cancel) { - this.over ? this.endDrop(cancel) : this.__customTglEff(false); - }; - /** - * This function is expected to be always executed at the end of d&d. - */ - Droppable.prototype.endDrop = function (cancel, ev) { - var _a = this, em = _a.em, dragStop = _a.dragStop; - this.counter = 0; - dragStop && dragStop(cancel || !this.over); - this.__customTglEff(false); - em.trigger('canvas:dragend', ev); - }; - Droppable.prototype.handleDragLeave = function (ev) { - this.updateCounter(-1, ev); - }; - Droppable.prototype.updateCounter = function (value, ev) { - this.counter += value; - this.counter === 0 && this.endDrop(true, ev); - }; - Droppable.prototype.handleDragEnter = function (ev) { - var _this = this; - var _a = this, em = _a.em, canvas = _a.canvas; - var dt = ev.dataTransfer; - var dragContentOrigin = em.get('dragContent'); - if (!dragContentOrigin && !canvas.getConfig().allowExternalDrop) { - return; - } - this.updateCounter(1, ev); - if (this.over) - return; - this.over = true; - var utils = em.Utils; - // For security reason I can't read the drag data on dragenter, but - // as I need it for the Sorter context I will use `dragContent` or just - // any not empty element - var content = dragContentOrigin || '
'; - var dragStop; - var dragContent; - em.stopDefault(); - // Select the right drag provider - if (em.inAbsoluteMode()) { - var wrapper_1 = em.Components.getWrapper(); - var target_1 = wrapper_1.append({})[0]; - var dragger_1 = em.Commands.run('core:component-drag', { - event: ev, - guidesInfo: 1, - center: 1, - target: target_1, - onEnd: function (ev, dragger, _a) { - var cancelled = _a.cancelled; - var comp; - if (!cancelled) { - comp = wrapper_1.append(content)[0]; - var canvasOffset = canvas.getOffset(); - var _b = target_1.getStyle(), top_1 = _b.top, left = _b.left, position = _b.position; - var scroll_1 = (0,dom/* getDocumentScroll */.GX)(ev.target); - var postLeft = parseInt("".concat(parseFloat(left) + scroll_1.x - canvasOffset.left), 10); - var posTop = parseInt("".concat(parseFloat(top_1) + scroll_1.y - canvasOffset.top), 10); - comp.addStyle({ - left: postLeft + 'px', - top: posTop + 'px', - position: position, - }); - } - _this.handleDragEnd(comp, dt); - target_1.remove(); - }, - }); - dragStop = function (cancel) { return dragger_1.stop(ev, { cancel: cancel }); }; - dragContent = function (cnt) { return (content = cnt); }; - } - else { - var sorter_1 = new utils.Sorter(Droppable_assign({ - // @ts-ignore - em: em, wmargin: 1, nested: 1, canvasRelative: 1, direction: 'a', container: this.el, placer: canvas.getPlacerEl(), containerSel: '*', itemSel: '*', pfx: 'gjs-', onEndMove: function (model) { return _this.handleDragEnd(model, dt); }, document: this.el.ownerDocument }, (this.sortOpts || {}))); - sorter_1.setDropContent(content); - sorter_1.startSort(); - this.sorter = sorter_1; - dragStop = function (cancel) { - cancel && (sorter_1.moved = false); - sorter_1.endMove(); - }; - dragContent = function (content) { return sorter_1.setDropContent(content); }; - } - this.dragStop = dragStop; - this.dragContent = dragContent; - em.trigger('canvas:dragenter', dt, content); - }; - Droppable.prototype.handleDragEnd = function (model, dt) { - var em = this.em; - this.over = false; - if (model) { - em.set('dragResult', model); - em.trigger('canvas:drop', dt, model); - } - em.runDefault({ preserveSelected: 1 }); - }; - /** - * Always need to have this handler active for enabling the drop - * @param {Event} ev - */ - Droppable.prototype.handleDragOver = function (ev) { - ev.preventDefault(); - this.em.trigger('canvas:dragover', ev); - }; - /** - * WARNING: This function might fail to run on drop, for example, when the - * drop, accidentally, happens on some external element (DOM not inside the iframe) - */ - Droppable.prototype.handleDrop = function (ev) { - ev.preventDefault(); - var dragContent = this.dragContent; - var dt = ev.dataTransfer; - var content = this.getContentByData(dt).content; - ev.target.style.border = ''; - content && dragContent && dragContent(content); - this.endDrop(!content, ev); - }; - Droppable.prototype.getContentByData = function (dt) { - var em = this.em; - var types = dt && dt.types; - var files = (dt && dt.files) || []; - var dragContent = em.get('dragContent'); - var content = dt && dt.getData('text'); - if (files.length) { - content = []; - for (var i = 0; i < files.length; i++) { - var file = files[i]; - var type = file.type.split('/')[0]; - if (type == 'image') { - content.push({ - type: type, - file: file, - attributes: { alt: file.name }, - }); - } - } - } - else if (dragContent) { - content = dragContent; - } - else if ((0,index_all.indexOf)(types, 'text/html') >= 0) { - content = dt && dt.getData('text/html').replace(/<\/?meta[^>]*>/g, ''); - } - else if ((0,index_all.indexOf)(types, 'text/uri-list') >= 0) { - content = { - type: 'link', - attributes: { href: content }, - content: content, - }; - } - else if ((0,index_all.indexOf)(types, 'text/json') >= 0) { - var json = dt && dt.getData('text/json'); - json && (content = JSON.parse(json)); - } - else if (types.length === 1 && types[0] === 'text/plain') { - // Avoid dropping non-selectable and non-editable text nodes inside the editor - content = "
".concat(content, "
"); - } - var result = { content: content }; - em.trigger('canvas:dragdata', dt, result); - return result; - }; - return Droppable; -}()); -/* harmony default export */ const utils_Droppable = (Droppable); - -;// CONCATENATED MODULE: ./src/canvas/view/FrameView.ts -var FrameView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var FrameView_assign = (undefined && undefined.__assign) || function () { - FrameView_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return FrameView_assign.apply(this, arguments); -}; -var FrameView_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - - - - - - - - -var FrameView = /** @class */ (function (_super) { - FrameView_extends(FrameView, _super); - function FrameView(model, view) { - var _this = _super.call(this, { model: model }) || this; - _this.dragging = false; - _this.loaded = false; - _this.lastMaxHeight = 0; - _this.tools = {}; - (0,index_all.bindAll)(_this, 'updateClientY', 'stopAutoscroll', 'autoscroll', '_emitUpdate'); - var el = _this.el; - //@ts-ignore - _this.module._config = FrameView_assign(FrameView_assign({}, (_this.config || {})), { - //@ts-ignore - frameView: _this }); - _this.frameWrapView = view; - _this.showGlobalTools = (0,index_all.debounce)(_this.showGlobalTools.bind(_this), 50); - var cvModel = _this.getCanvasModel(); - _this.listenTo(model, 'change:head', _this.updateHead); - _this.listenTo(cvModel, 'change:styles', _this.renderStyles); - model.view = _this; - (0,mixins.setViewEl)(el, _this); - return _this; - } - Object.defineProperty(FrameView.prototype, "tagName", { - /** @ts-ignore */ - get: function () { - return 'iframe'; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(FrameView.prototype, "attributes", { - /** @ts-ignore */ - get: function () { - return { allowfullscreen: 'allowfullscreen' }; - }, - enumerable: false, - configurable: true - }); - FrameView.prototype.getBoxRect = function () { - var _a = this, el = _a.el, module = _a.module; - var canvasView = module.getCanvasView(); - var coords = module.getCoords(); - var frameRect = el.getBoundingClientRect(); - var canvasRect = canvasView.getCanvasOffset(); - var vwDelta = canvasView.getViewportDelta(); - var zoomM = module.getZoomMultiplier(); - var x = (frameRect.x - canvasRect.left - vwDelta.x - coords.x) * zoomM; - var y = (frameRect.y - canvasRect.top - vwDelta.y - coords.y) * zoomM; - var width = frameRect.width * zoomM; - var height = frameRect.height * zoomM; - return { - x: x, - y: y, - width: width, - height: height, - }; - }; - /** - * Update `` content of the frame - */ - FrameView.prototype.updateHead = function () { - var model = this.model; - var headEl = this.getHead(); - var toRemove = []; - var toAdd = []; - var current = model.head; - var prev = model.previous('head'); - var attrStr = function (attr) { - if (attr === void 0) { attr = {}; } - return Object.keys(attr) - .sort() - .map(function (i) { return "[".concat(i, "=\"").concat(attr[i], "\"]"); }) - .join(''); - }; - var find = function (items, stack, res) { - items.forEach(function (item) { - var tag = item.tag, attributes = item.attributes; - var has = stack.some(function (s) { return s.tag === tag && attrStr(s.attributes) === attrStr(attributes); }); - !has && res.push(item); - }); - }; - find(current, prev, toAdd); - find(prev, current, toRemove); - toRemove.forEach(function (stl) { - var _a; - var el = headEl.querySelector("".concat(stl.tag).concat(attrStr(stl.attributes))); - (_a = el === null || el === void 0 ? void 0 : el.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(el); - }); - (0,dom/* appendVNodes */.SJ)(headEl, toAdd); - }; - FrameView.prototype.getEl = function () { - return this.el; - }; - FrameView.prototype.getCanvasModel = function () { - return this.em.Canvas.getModel(); - }; - FrameView.prototype.getWindow = function () { - return this.getEl().contentWindow; - }; - FrameView.prototype.getDoc = function () { - return this.getEl().contentDocument; - }; - FrameView.prototype.getHead = function () { - return this.getDoc().querySelector('head'); - }; - FrameView.prototype.getBody = function () { - return this.getDoc().querySelector('body'); - }; - FrameView.prototype.getWrapper = function () { - return this.getBody().querySelector('[data-gjs-type=wrapper]'); - }; - FrameView.prototype.getJsContainer = function () { - if (!this.jsContainer) { - this.jsContainer = (0,dom/* createEl */.ut)('div', { class: "".concat(this.ppfx, "js-cont") }); - } - return this.jsContainer; - }; - FrameView.prototype.getToolsEl = function () { - var _a; - return (_a = this.frameWrapView) === null || _a === void 0 ? void 0 : _a.elTools; - }; - FrameView.prototype.getGlobalToolsEl = function () { - return this.em.Canvas.getGlobalToolsEl(); - }; - FrameView.prototype.getHighlighter = function () { - return this._getTool('[data-hl]'); - }; - FrameView.prototype.getBadgeEl = function () { - return this._getTool('[data-badge]'); - }; - FrameView.prototype.getOffsetViewerEl = function () { - return this._getTool('[data-offset]'); - }; - FrameView.prototype.getRect = function () { - if (!this.rect) { - this.rect = this.el.getBoundingClientRect(); - } - return this.rect; - }; - /** - * Get rect data, not affected by the canvas zoom - */ - FrameView.prototype.getOffsetRect = function () { - var el = this.el; - var _a = this.getBody(), scrollTop = _a.scrollTop, scrollLeft = _a.scrollLeft; - var height = el.offsetHeight; - var width = el.offsetWidth; - return { - top: el.offsetTop, - left: el.offsetLeft, - height: height, - width: width, - scrollTop: scrollTop, - scrollLeft: scrollLeft, - scrollBottom: scrollTop + height, - scrollRight: scrollLeft + width, - }; - }; - FrameView.prototype._getTool = function (name) { - var tools = this.tools; - var toolsEl = this.getToolsEl(); - if (!tools[name]) { - tools[name] = toolsEl.querySelector(name); - } - return tools[name]; - }; - FrameView.prototype.remove = function () { - var _a; - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - this._toggleEffects(false); - this.tools = {}; - (_a = this.wrapper) === null || _a === void 0 ? void 0 : _a.remove(); - abstract_ModuleView.prototype.remove.apply(this, args); - return this; - }; - FrameView.prototype.startAutoscroll = function () { - var _this = this; - this.lastMaxHeight = this.getWrapper().offsetHeight - this.el.offsetHeight; - // By detaching those from the stack avoid browsers lags - // Noticeable with "fast" drag of blocks - setTimeout(function () { - _this._toggleAutoscrollFx(true); - requestAnimationFrame(_this.autoscroll); - }, 0); - }; - FrameView.prototype.autoscroll = function () { - if (this.dragging) { - var lastClientY = this.lastClientY; - var canvas = this.em.Canvas; - var win = this.getWindow(); - var actualTop = win.pageYOffset; - var clientY = lastClientY || 0; - var limitTop = canvas.getConfig().autoscrollLimit; - var limitBottom = this.getRect().height - limitTop; - var nextTop = actualTop; - if (clientY < limitTop) { - nextTop -= limitTop - clientY; - } - if (clientY > limitBottom) { - nextTop += clientY - limitBottom; - } - if (!(0,index_all.isUndefined)(lastClientY) && // Fixes #3134 - nextTop !== actualTop && - nextTop > 0 && - nextTop < this.lastMaxHeight) { - var toolsEl = this.getGlobalToolsEl(); - toolsEl.style.opacity = '0'; - this.showGlobalTools(); - win.scrollTo(0, nextTop); - canvas.spots.refreshDbn(); - } - requestAnimationFrame(this.autoscroll); - } - }; - FrameView.prototype.updateClientY = function (ev) { - ev.preventDefault(); - this.lastClientY = (0,dom/* getPointerEvent */.VB)(ev).clientY * this.em.getZoomDecimal(); - }; - FrameView.prototype.showGlobalTools = function () { - this.getGlobalToolsEl().style.opacity = ''; - }; - FrameView.prototype.stopAutoscroll = function () { - this.dragging && this._toggleAutoscrollFx(false); - }; - FrameView.prototype._toggleAutoscrollFx = function (enable) { - this.dragging = enable; - var win = this.getWindow(); - var method = enable ? 'on' : 'off'; - var mt = { on: dom.on, off: dom/* off */.S1 }; - mt[method](win, 'mousemove dragover', this.updateClientY); - mt[method](win, 'mouseup', this.stopAutoscroll); - }; - FrameView.prototype.render = function () { - var _a = this, $el = _a.$el, ppfx = _a.ppfx, em = _a.em; - $el.attr({ class: "".concat(ppfx, "frame") }); - this.renderScripts(); - em.trigger('frame:render', this); // deprecated - return this; - }; - FrameView.prototype.renderScripts = function () { - var _this = this; - var _a = this, el = _a.el, model = _a.model, em = _a.em; - var evLoad = 'frame:load'; - var evOpts = { el: el, model: model, view: this }; - var canvas = this.getCanvasModel(); - var appendScript = function (scripts) { - var _a; - if (scripts.length > 0) { - var src = scripts.shift(); - var scriptEl = (0,dom/* createEl */.ut)('script', FrameView_assign({ type: 'text/javascript' }, ((0,index_all.isString)(src) ? { src: src } : src))); - (_a = el.contentDocument) === null || _a === void 0 ? void 0 : _a.head.appendChild(scriptEl); - if (scriptEl.hasAttribute('nomodule') && 'noModule' in HTMLScriptElement.prototype) { - appendScript(scripts); - } - else { - scriptEl.onerror = scriptEl.onload = appendScript.bind(null, scripts); - } - } - else { - em === null || em === void 0 ? void 0 : em.trigger(canvas_types.frameLoadHead, evOpts); - _this.renderBody(); - em === null || em === void 0 ? void 0 : em.trigger(canvas_types.frameLoadBody, evOpts); - em === null || em === void 0 ? void 0 : em.trigger(evLoad, evOpts); // deprecated - } - }; - el.onload = function () { - var frameContent = _this.config.frameContent; - if (frameContent) { - var doc = _this.getDoc(); - doc.open(); - doc.write(frameContent); - doc.close(); - } - evOpts.window = _this.getWindow(); - em === null || em === void 0 ? void 0 : em.trigger("".concat(evLoad, ":before"), evOpts); // deprecated - em === null || em === void 0 ? void 0 : em.trigger(canvas_types.frameLoad, evOpts); - _this.renderHead(); - appendScript(FrameView_spreadArray([], canvas.get('scripts'), true)); - }; - }; - FrameView.prototype.renderStyles = function (opts) { - if (opts === void 0) { opts = {}; } - var head = this.getHead(); - var canvas = this.getCanvasModel(); - var normalize = function (stls) { - return stls.map(function (href) { return ({ - tag: 'link', - attributes: FrameView_assign({ rel: 'stylesheet' }, ((0,index_all.isString)(href) ? { href: href } : href)), - }); }); - }; - var prevStyles = normalize(opts.prev || canvas.previous('styles')); - var styles = normalize(canvas.get('styles')); - var toRemove = []; - var toAdd = []; - var find = function (items, stack, res) { - items.forEach(function (item) { - var href = item.attributes.href; - var has = stack.some(function (s) { return s.attributes.href === href; }); - !has && res.push(item); - }); - }; - find(styles, prevStyles, toAdd); - find(prevStyles, styles, toRemove); - toRemove.forEach(function (stl) { - var _a; - var el = head.querySelector("link[href=\"".concat(stl.attributes.href, "\"]")); - (_a = el === null || el === void 0 ? void 0 : el.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(el); - }); - (0,dom/* appendVNodes */.SJ)(head, toAdd); - }; - FrameView.prototype.renderHead = function () { - var _a = this, model = _a.model, em = _a.em; - var root = model.root; - var HeadView = em.Components.getType(type).view; - this.headView = new HeadView({ - el: this.getHead(), - model: root.head, - config: FrameView_assign(FrameView_assign({}, root.config), { frameView: this }), - }).render(); - }; - FrameView.prototype.renderBody = function () { - var _this = this; - var _a, _b; - var _c = this, config = _c.config, em = _c.em, model = _c.model, ppfx = _c.ppfx; - var doc = this.getDoc(); - var body = this.getBody(); - var win = this.getWindow(); - var hasAutoHeight = model.hasAutoHeight(); - var conf = em.config; - //@ts-ignore This could be used inside component-related scripts to check if the - // script is executed inside the editor. - win._isEditor = true; - this.renderStyles({ prev: [] }); - var colorWarn = '#ffca6f'; - (0,dom/* append */.R3)(body, "")); - var root = model.root; - var view = em.Components.getType('wrapper').view; - this.wrapper = new view({ - model: root, - config: FrameView_assign(FrameView_assign({}, root.config), { em: em, frameView: this }), - }).render(); - (0,dom/* append */.R3)(body, (_a = this.wrapper) === null || _a === void 0 ? void 0 : _a.el); - (0,dom/* append */.R3)(body, new view_CssRulesView({ - collection: model.getStyles(), - //@ts-ignore - config: FrameView_assign(FrameView_assign({}, em.Css.getConfig()), { frameView: this }), - }).render().el); - (0,dom/* append */.R3)(body, this.getJsContainer()); - // em.trigger('loaded'); // I need to manage only the first one maybe - //this.updateOffset(); // TOFIX (check if I need it) - // Avoid some default behaviours - //@ts-ignore - (0,dom.on)(body, 'click', function (ev) { var _a; return ev && ((_a = ev.target) === null || _a === void 0 ? void 0 : _a.tagName) == 'A' && ev.preventDefault(); }); - (0,dom.on)(body, 'submit', function (ev) { return ev && ev.preventDefault(); }); - // When the iframe is focused the event dispatcher is not the same so - // I need to delegate all events to the parent document - [ - { event: 'keydown keyup keypress', class: 'KeyboardEvent' }, - { event: 'mousedown mousemove mouseup', class: 'MouseEvent' }, - { event: 'pointerdown pointermove pointerup', class: 'PointerEvent' }, - { event: 'wheel', class: 'WheelEvent', opts: { passive: !config.infiniteCanvas } }, - ].forEach(function (obj) { - return obj.event.split(' ').forEach(function (event) { - doc.addEventListener(event, function (ev) { return _this.el.dispatchEvent((0,dom/* createCustomEvent */.t3)(ev, obj.class)); }, obj.opts); - }); - }); - this._toggleEffects(true); - if ((0,mixins.hasDnd)(em)) { - this.droppable = new utils_Droppable(em, (_b = this.wrapper) === null || _b === void 0 ? void 0 : _b.el); - } - this.loaded = true; - model.trigger('loaded'); - }; - FrameView.prototype._toggleEffects = function (enable) { - var method = enable ? dom.on : dom/* off */.S1; - var win = this.getWindow(); - win && method(win, "".concat(dom/* motionsEv */.G1, " resize"), this._emitUpdate); - }; - FrameView.prototype._emitUpdate = function () { - this.model._emitUpdated(); - }; - return FrameView; -}(abstract_ModuleView)); -/* harmony default export */ const view_FrameView = (FrameView); - -// EXTERNAL MODULE: ./src/utils/Dragger.ts -var Dragger = __webpack_require__(668); -;// CONCATENATED MODULE: ./src/canvas/view/FrameWrapView.ts -var FrameWrapView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var FrameWrapView_assign = (undefined && undefined.__assign) || function () { - FrameWrapView_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return FrameWrapView_assign.apply(this, arguments); -}; - - - - - -var FrameWrapView = /** @class */ (function (_super) { - FrameWrapView_extends(FrameWrapView, _super); - function FrameWrapView(model, canvasView) { - var _this = _super.call(this, { model: model }) || this; - (0,index_all.bindAll)(_this, 'onScroll', 'frameLoaded', 'updateOffset', 'remove', 'startDrag'); - var config = FrameWrapView_assign(FrameWrapView_assign({}, model.config), { frameWrapView: _this }); - _this.cv = canvasView; - _this.frame = new view_FrameView(model, _this); - _this.classAnim = "".concat(_this.ppfx, "frame-wrapper--anim"); - _this.updateOffset = (0,index_all.debounce)(_this.updateOffset.bind(_this), 0); - _this.updateSize = (0,index_all.debounce)(_this.updateSize.bind(_this), 0); - _this.listenTo(model, 'loaded', _this.frameLoaded); - _this.listenTo(model, 'change:x change:y', _this.updatePos); - _this.listenTo(model, 'change:width change:height', _this.updateSize); - _this.listenTo(model, 'destroy remove', _this.remove); - _this.updatePos(); - _this.setupDragger(); - return _this; - } - FrameWrapView.prototype.events = function () { - return { - 'click [data-action-remove]': 'remove', - 'mousedown [data-action-move]': 'startDrag', - }; - }; - FrameWrapView.prototype.setupDragger = function () { - var _this = this; - var _a = this, module = _a.module, model = _a.model; - var dragX, dragY, zoom; - var toggleEffects = function (on) { - module.toggleFramesEvents(on); - }; - this.dragger = new Dragger/* default */.Z({ - onStart: function () { - var _a = model.attributes, x = _a.x, y = _a.y; - zoom = _this.em.getZoomMultiplier(); - dragX = x; - dragY = y; - toggleEffects(false); - }, - onEnd: function () { return toggleEffects(true); }, - setPosition: function (posOpts) { - model.set({ - x: dragX + posOpts.x * zoom, - y: dragY + posOpts.y * zoom, - }); - }, - }); - }; - FrameWrapView.prototype.startDrag = function (ev) { - var _a; - ev && ((_a = this.dragger) === null || _a === void 0 ? void 0 : _a.start(ev)); - }; - FrameWrapView.prototype.__clear = function (opts) { - var frame = this.frame; - frame && frame.remove(opts); - (0,dom/* removeEl */.L_)(this.elTools); - }; - FrameWrapView.prototype.remove = function (opts) { - var _this = this; - this.__clear(opts); - abstract_ModuleView.prototype.remove.apply(this, opts); - //@ts-ignore - ['frame', 'dragger', 'cv', 'elTools'].forEach(function (i) { return (_this[i] = 0); }); - return this; - }; - FrameWrapView.prototype.updateOffset = function () { - var _a; - var _b = this, em = _b.em, $el = _b.$el, frame = _b.frame; - if (!em || em.destroyed) - return; - em.runDefault({ preserveSelected: 1 }); - $el.removeClass(this.classAnim); - (_a = frame === null || frame === void 0 ? void 0 : frame.model) === null || _a === void 0 ? void 0 : _a._emitUpdated(); - }; - FrameWrapView.prototype.updatePos = function (md) { - var _a = this, model = _a.model, el = _a.el; - var _b = model.attributes, x = _b.x, y = _b.y; - var style = el.style; - this.frame.rect = undefined; - style.left = isNaN(x) ? x : "".concat(x, "px"); - style.top = isNaN(y) ? y : "".concat(y, "px"); - md && this.updateOffset(); - }; - FrameWrapView.prototype.updateSize = function () { - this.updateDim(); - }; - /** - * Update dimensions of the frame - * @private - */ - FrameWrapView.prototype.updateDim = function () { - var _a = this, em = _a.em, el = _a.el, $el = _a.$el, model = _a.model, classAnim = _a.classAnim, frame = _a.frame; - if (!frame) - return; - frame.rect = undefined; - $el.addClass(classAnim); - var _b = this.__handleSize(), noChanges = _b.noChanges, width = _b.width, height = _b.height; - // Set width and height from DOM (should be done only once) - if ((0,index_all.isNull)(width) || (0,index_all.isNull)(height)) { - model.set(FrameWrapView_assign(FrameWrapView_assign({}, (!width ? { width: el.offsetWidth } : {})), (!height ? { height: el.offsetHeight } : {})), { silent: 1 }); - } - // Prevent fixed highlighting box which appears when on - // component hover during the animation - em.stopDefault({ preserveSelected: 1 }); - noChanges ? this.updateOffset() : setTimeout(this.updateOffset, 350); - }; - FrameWrapView.prototype.onScroll = function () { - var _a = this, frame = _a.frame, em = _a.em; - em.trigger('frame:scroll', { - frame: frame, - body: frame.getBody(), - target: frame.getWindow(), - }); - }; - FrameWrapView.prototype.frameLoaded = function () { - var _a = this, frame = _a.frame, config = _a.config; - frame.getWindow().onscroll = this.onScroll; - this.updateDim(); - }; - FrameWrapView.prototype.__handleSize = function () { - var _a, _b; - var un = 'px'; - var _c = this, model = _c.model, el = _c.el; - var style = el.style; - var _d = model.attributes, width = _d.width, height = _d.height; - var currW = style.width || ''; - var currH = style.height || ''; - var newW = width || ''; - var newH = height || ''; - var noChanges = currW == newW && currH == newH; - var newWidth = (0,index_all.isNumber)(newW) ? "".concat(newW).concat(un) : newW; - var newHeight = (0,index_all.isNumber)(newH) ? "".concat(newH).concat(un) : newH; - style.width = newWidth; - if (model.hasAutoHeight()) { - var iframe = this.frame.el; - if (iframe.contentDocument - // this doesn't work always - // && !this.sizeObserver - ) { - var contentDocument_1 = iframe.contentDocument; - var observer = new ResizeObserver(function () { - style.height = "".concat(contentDocument_1.body.scrollHeight, "px"); - }); - observer.observe(contentDocument_1.body); - (_a = this.sizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect(); - this.sizeObserver = observer; - } - } - else { - style.height = newHeight; - (_b = this.sizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect(); - delete this.sizeObserver; - } - return { noChanges: noChanges, width: width, height: height, newW: newW, newH: newH }; - }; - FrameWrapView.prototype.render = function () { - var _a = this, frame = _a.frame, $el = _a.$el, ppfx = _a.ppfx, cv = _a.cv, model = _a.model, el = _a.el; - var onRender = model.attributes.onRender; - this.__clear(); - this.__handleSize(); - frame.render(); - $el - .empty() - .attr({ class: "".concat(ppfx, "frame-wrapper") }) - .append("\n
\n
\n ").concat(model.get('name') || '', "\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n ")) - .append(frame.el); - var elTools = (0,dom/* createEl */.ut)('div', { - class: "".concat(ppfx, "tools"), - style: 'pointer-events:none; display: none', - }, "\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n ")); - this.elTools = elTools; - var twrp = cv === null || cv === void 0 ? void 0 : cv.toolsWrapper; - twrp && twrp.appendChild(elTools); // TODO remove on frame remove - onRender && - onRender({ - el: el, - elTop: el.querySelector('[data-frame-top]'), - elRight: el.querySelector('[data-frame-right]'), - elBottom: el.querySelector('[data-frame-bottom]'), - elLeft: el.querySelector('[data-frame-left]'), - frame: model, - frameWrapperView: this, - remove: this.remove, - startDrag: this.startDrag, - }); - return this; - }; - return FrameWrapView; -}(abstract_ModuleView)); -/* harmony default export */ const view_FrameWrapView = (FrameWrapView); - -;// CONCATENATED MODULE: ./src/canvas/view/FramesView.ts -var FramesView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var FramesView = /** @class */ (function (_super) { - FramesView_extends(FramesView, _super); - function FramesView(opts, config) { - if (opts === void 0) { opts = {}; } - var _this = _super.call(this, opts, true) || this; - _this.listenTo(_this.collection, 'reset', _this.render); - _this.canvasView = config.canvasView; - _this._module = config.module; - return _this; - } - FramesView.prototype.onRemoveBefore = function (items, opts) { - if (opts === void 0) { opts = {}; } - items.forEach(function (item) { return item.remove(opts); }); - }; - FramesView.prototype.onRender = function () { - var _a = this, $el = _a.$el, ppfx = _a.ppfx; - $el.attr({ class: "".concat(ppfx, "frames") }); - }; - FramesView.prototype.clearItems = function () { - var items = this.viewCollection || []; - items.forEach(function (item) { return item.remove(); }); - this.viewCollection = []; - }; - FramesView.prototype.renderView = function (item, type) { - return new view_FrameWrapView(item, this.canvasView); - }; - return FramesView; -}(abstract_ModuleDomainViews)); -/* harmony default export */ const view_FramesView = (FramesView); - -;// CONCATENATED MODULE: ./src/canvas/view/CanvasView.ts -var CanvasView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var CanvasView_assign = (undefined && undefined.__assign) || function () { - CanvasView_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return CanvasView_assign.apply(this, arguments); -}; - - - - - - -var CanvasView = /** @class */ (function (_super) { - CanvasView_extends(CanvasView, _super); - function CanvasView(model) { - var _this = _super.call(this, { model: model }) || this; - _this.ready = false; - (0,index_all.bindAll)(_this, 'clearOff', 'onKeyPress', 'onWheel', 'onPointer'); - var _a = _this, em = _a.em, pfx = _a.pfx, ppfx = _a.ppfx; - var events = _this.module.events; - _this.className = "".concat(pfx, "canvas ").concat(ppfx, "no-touch-actions").concat(!em.config.customUI ? " ".concat(pfx, "canvas-bg") : ''); - _this.clsUnscale = "".concat(pfx, "unscale"); - _this._initFrames(); - _this.listenTo(em, events.refresh, _this.clearOff); - _this.listenTo(em, 'component:selected', _this.checkSelected); - _this.listenTo(em, "".concat(events.coords, " ").concat(events.zoom), _this.updateFrames); - _this.listenTo(model, 'change:frames', _this._onFramesUpdate); - _this.toggleListeners(true); - return _this; - } - CanvasView.prototype.template = function () { - var pfx = this.pfx; - return "\n
\n
\n
\n
\n \n "); - }; - CanvasView.prototype._onFramesUpdate = function () { - this._initFrames(); - this._renderFrames(); - }; - CanvasView.prototype._initFrames = function () { - var _a = this, frames = _a.frames, model = _a.model, config = _a.config, em = _a.em; - var collection = model.frames; - em.set('readyCanvas', 0); - collection.once('loaded:all', function () { return em.set('readyCanvas', 1); }); - frames === null || frames === void 0 ? void 0 : frames.remove(); - this.frames = new view_FramesView({ collection: collection }, CanvasView_assign(CanvasView_assign({}, config), { canvasView: this })); - }; - CanvasView.prototype.checkSelected = function (component, opts) { - var _a; - if (opts === void 0) { opts = {}; } - var scroll = opts.scroll; - var currFrame = this.em.getCurrentFrame(); - scroll && - ((_a = component.views) === null || _a === void 0 ? void 0 : _a.forEach(function (view) { - view.frameView === currFrame && view.scrollIntoView(scroll); - })); - }; - CanvasView.prototype.remove = function () { - var _a; - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - (_a = this.frames) === null || _a === void 0 ? void 0 : _a.remove(); - //@ts-ignore - this.frames = undefined; - abstract_ModuleView.prototype.remove.apply(this, args); - this.toggleListeners(false); - return this; - }; - CanvasView.prototype.preventDefault = function (ev) { - var _a; - if (ev) { - ev.preventDefault(); - (_a = ev._parentEvent) === null || _a === void 0 ? void 0 : _a.preventDefault(); - } - }; - CanvasView.prototype.toggleListeners = function (enable) { - var _a = this, el = _a.el, config = _a.config; - var fn = enable ? dom.on : dom/* off */.S1; - fn(document, 'keypress', this.onKeyPress); - fn(window, 'scroll resize', this.clearOff); - fn(el, 'wheel', this.onWheel, { passive: !config.infiniteCanvas }); - fn(el, 'pointermove', this.onPointer); - }; - CanvasView.prototype.screenToWorld = function (x, y) { - var module = this.module; - var coords = module.getCoords(); - var zoom = module.getZoomMultiplier(); - var vwDelta = this.getViewportDelta(); - return { - x: (x - coords.x - vwDelta.x) * zoom, - y: (y - coords.y - vwDelta.y) * zoom, - }; - }; - CanvasView.prototype.onPointer = function (ev) { - if (!this.config.infiniteCanvas) - return; - var canvasRect = this.getCanvasOffset(); - var docScroll = (0,dom/* getDocumentScroll */.GX)(); - var screenCoords = { - x: ev.clientX - canvasRect.left + docScroll.x, - y: ev.clientY - canvasRect.top + docScroll.y, - }; - if (ev._parentEvent) { - // with _parentEvent means was triggered from the iframe - var frameRect = ev.target.getBoundingClientRect(); - var zoom = this.module.getZoomDecimal(); - screenCoords.x = frameRect.left - canvasRect.left + docScroll.x + ev.clientX * zoom; - screenCoords.y = frameRect.top - canvasRect.top + docScroll.y + ev.clientY * zoom; - } - this.model.set({ - pointerScreen: screenCoords, - pointer: this.screenToWorld(screenCoords.x, screenCoords.y), - }); - }; - CanvasView.prototype.onKeyPress = function (ev) { - var em = this.em; - var key = (0,dom/* getKeyChar */.sN)(ev); - if (key === ' ' && em.getZoomDecimal() !== 1 && !em.Canvas.isInputFocused()) { - this.preventDefault(ev); - em.Editor.runCommand('core:canvas-move'); - } - }; - CanvasView.prototype.onWheel = function (ev) { - var _a = this, module = _a.module, config = _a.config; - if (config.infiniteCanvas) { - this.preventDefault(ev); - var deltaX = ev.deltaX, deltaY = ev.deltaY; - var zoom = module.getZoomDecimal(); - var isZooming = (0,dom/* hasModifierKey */.Vb)(ev); - var coords = module.getCoords(); - if (isZooming) { - var newZoom = zoom - deltaY * zoom * 0.01; - module.setZoom(newZoom * 100); - // Update coordinates based on pointer - var pointer = this.model.getPointerCoords(common/* CoordinatesTypes */.vA.Screen); - var canvasRect = this.getCanvasOffset(); - var pointerX = pointer.x - canvasRect.width / 2; - var pointerY = pointer.y - canvasRect.height / 2; - var zoomDelta = newZoom / zoom; - var x = pointerX - (pointerX - coords.x) * zoomDelta; - var y = pointerY - (pointerY - coords.y) * zoomDelta; - module.setCoords(x, y); - } - else { - this.onPointer(ev); - module.setCoords(coords.x - deltaX, coords.y - deltaY); - } - } - }; - CanvasView.prototype.updateFrames = function (ev) { - var em = this.em; - var toolsWrpEl = this.toolsWrapper; - var defOpts = { preserveSelected: 1 }; - this.updateFramesArea(); - this.clearOff(); - toolsWrpEl.style.display = 'none'; - em.trigger('canvas:update', ev); - this.timerZoom && clearTimeout(this.timerZoom); - this.timerZoom = setTimeout(function () { - em.stopDefault(defOpts); - em.runDefault(defOpts); - toolsWrpEl.style.display = ''; - }, 300); - }; - CanvasView.prototype.updateFramesArea = function () { - var _a = this, framesArea = _a.framesArea, model = _a.model, module = _a.module, cvStyle = _a.cvStyle, clsUnscale = _a.clsUnscale; - var mpl = module.getZoomMultiplier(); - if (framesArea) { - var _b = model.attributes, x = _b.x, y = _b.y; - var zoomDc = module.getZoomDecimal(); - framesArea.style.transform = "scale(".concat(zoomDc, ") translate(").concat(x * mpl, "px, ").concat(y * mpl, "px)"); - } - if (cvStyle) { - cvStyle.innerHTML = "\n .".concat(clsUnscale, " { scale: ").concat(mpl, " }\n "); - } - }; - CanvasView.prototype.fitViewport = function (opts) { - var _a, _b; - if (opts === void 0) { opts = {}; } - var _c = this, em = _c.em, module = _c.module, model = _c.model; - var canvasRect = this.getCanvasOffset(); - var el = opts.el; - var elFrame = el && ((_a = (0,mixins.getComponentView)(el)) === null || _a === void 0 ? void 0 : _a.frameView); - var frame = elFrame ? elFrame.model : opts.frame || em.getCurrentFrameModel() || model.frames.at(0); - var _d = frame.attributes, x = _d.x, y = _d.y; - var boxRect = { - x: x !== null && x !== void 0 ? x : 0, - y: y !== null && y !== void 0 ? y : 0, - width: frame.width, - height: frame.height, - }; - if (el) { - var elRect = this.getElBoxRect(el); - boxRect.x = boxRect.x + elRect.x; - boxRect.y = boxRect.y + elRect.y; - boxRect.width = elRect.width; - boxRect.height = elRect.height; - } - var noHeight = opts.ignoreHeight; - var gap = (_b = opts.gap) !== null && _b !== void 0 ? _b : 0; - var gapIsNum = (0,index_all.isNumber)(gap); - var gapX = gapIsNum ? gap : gap.x; - var gapY = gapIsNum ? gap : gap.y; - var boxWidth = boxRect.width + gapX * 2; - var boxHeight = boxRect.height + gapY * 2; - var canvasWidth = canvasRect.width; - var canvasHeight = canvasRect.height; - var widthRatio = canvasWidth / boxWidth; - var heightRatio = canvasHeight / boxHeight; - var zoomRatio = noHeight ? widthRatio : Math.min(widthRatio, heightRatio); - var zoom = zoomRatio * 100; - module.setZoom(zoom); - // check for the frame witdh is necessary as we're centering the frame via CSS - var coordX = -boxRect.x + (frame.width >= canvasWidth ? canvasWidth / 2 - boxWidth / 2 : -gapX); - var coordY = -boxRect.y + canvasHeight / 2 - boxHeight / 2; - var coords = { - x: (coordX + gapX) * zoomRatio, - y: (coordY + gapY) * zoomRatio, - }; - if (noHeight) { - var zoomMltp = module.getZoomMultiplier(); - var canvasWorldHeight = canvasHeight * zoomMltp; - var canvasHeightDiff = canvasWorldHeight - canvasHeight; - var yDelta = canvasHeightDiff / 2; - coords.y = (-boxRect.y + gapY) * zoomRatio - yDelta / zoomMltp; - } - module.setCoords(coords.x, coords.y); - }; - /** - * Checks if the element is visible in the canvas's viewport - * @param {HTMLElement} el - * @return {Boolean} - */ - CanvasView.prototype.isElInViewport = function (el) { - var elem = (0,mixins.getElement)(el); - var rect = (0,dom/* getElRect */.Ut)(elem); - var frameRect = this.getFrameOffset(elem); - var rTop = rect.top; - var rLeft = rect.left; - return rTop >= 0 && rLeft >= 0 && rTop <= frameRect.height && rLeft <= frameRect.width; - }; - /** - * Get the offset of the element - * @param {HTMLElement} el - * @return { {top: number, left: number, width: number, height: number} } - */ - CanvasView.prototype.offset = function (el, opts) { - if (opts === void 0) { opts = {}; } - var noScroll = opts.noScroll; - var rect = (0,dom/* getElRect */.Ut)(el); - var scroll = noScroll ? { x: 0, y: 0 } : (0,dom/* getDocumentScroll */.GX)(el); - return { - top: rect.top + scroll.y, - left: rect.left + scroll.x, - width: rect.width, - height: rect.height, - }; - }; - CanvasView.prototype.getRectToScreen = function (boxRect) { - var _a, _b, _c, _d; - var zoom = this.module.getZoomDecimal(); - var coords = this.module.getCoords(); - var vwDelta = this.getViewportDelta(); - var x = ((_a = boxRect.x) !== null && _a !== void 0 ? _a : 0) * zoom + coords.x + vwDelta.x || 0; - var y = ((_b = boxRect.y) !== null && _b !== void 0 ? _b : 0) * zoom + coords.y + vwDelta.y || 0; - return { - x: x, - y: y, - width: ((_c = boxRect.width) !== null && _c !== void 0 ? _c : 0) * zoom, - height: ((_d = boxRect.height) !== null && _d !== void 0 ? _d : 0) * zoom, - }; - }; - CanvasView.prototype.getElBoxRect = function (el, opts) { - var _a, _b, _c; - if (opts === void 0) { opts = {}; } - var module = this.module; - var _d = (0,dom/* getElRect */.Ut)(el), width = _d.width, height = _d.height, left = _d.left, top = _d.top; - var frameView = (_a = (0,mixins.getComponentView)(el)) === null || _a === void 0 ? void 0 : _a.frameView; - var frameRect = frameView === null || frameView === void 0 ? void 0 : frameView.getBoxRect(); - var zoomMlt = module.getZoomMultiplier(); - var frameX = (_b = frameRect === null || frameRect === void 0 ? void 0 : frameRect.x) !== null && _b !== void 0 ? _b : 0; - var frameY = (_c = frameRect === null || frameRect === void 0 ? void 0 : frameRect.y) !== null && _c !== void 0 ? _c : 0; - var canvasEl = this.el; - var docScroll = (0,dom/* getDocumentScroll */.GX)(); - var xWithFrame = left + frameX + (canvasEl.scrollLeft + docScroll.x) * zoomMlt; - var yWithFrame = top + frameY + (canvasEl.scrollTop + docScroll.y) * zoomMlt; - var boxRect = { - x: xWithFrame, - y: yWithFrame, - width: width, - height: height, - }; - if (opts.local) { - boxRect.x = left; - boxRect.y = top; - } - return opts.toScreen ? this.getRectToScreen(boxRect) : boxRect; - }; - CanvasView.prototype.getViewportRect = function (opts) { - if (opts === void 0) { opts = {}; } - var _a = this.getCanvasOffset(), top = _a.top, left = _a.left, width = _a.width, height = _a.height; - var module = this.module; - if (opts.toWorld) { - var zoom = module.getZoomMultiplier(); - var coords = module.getCoords(); - var vwDelta = this.getViewportDelta(); - var x = -coords.x - vwDelta.x || 0; - var y = -coords.y - vwDelta.y || 0; - return { - x: x * zoom, - y: y * zoom, - width: width * zoom, - height: height * zoom, - }; - } - else { - return { - x: left, - y: top, - width: width, - height: height, - }; - } - }; - CanvasView.prototype.getViewportDelta = function (opts) { - if (opts === void 0) { opts = {}; } - var zoom = this.module.getZoomMultiplier(); - var _a = this.getCanvasOffset(), width = _a.width, height = _a.height; - var worldWidth = width * zoom; - var worldHeight = height * zoom; - var widthDelta = worldWidth - width; - var heightDelta = worldHeight - height; - return { - x: widthDelta / 2 / zoom, - y: heightDelta / 2 / zoom, - }; - }; - /** - * Cleare cached offsets - * @private - */ - CanvasView.prototype.clearOff = function () { - this.frmOff = undefined; - this.cvsOff = undefined; - }; - /** - * Return frame offset - * @return { {top: number, left: number, width: number, height: number} } - * @public - */ - CanvasView.prototype.getFrameOffset = function (el) { - var _a; - if (!this.frmOff || el) { - var frame = (_a = this.frame) === null || _a === void 0 ? void 0 : _a.el; - var winEl = el === null || el === void 0 ? void 0 : el.ownerDocument.defaultView; - var frEl = winEl ? winEl.frameElement : frame; - this.frmOff = this.offset(frEl || frame); - } - return this.frmOff; - }; - /** - * Return canvas offset - * @return { {top: number, left: number, width: number, height: number} } - * @public - */ - CanvasView.prototype.getCanvasOffset = function () { - if (!this.cvsOff) - this.cvsOff = this.offset(this.el); - return this.cvsOff; - }; - /** - * Returns element's rect info - * @param {HTMLElement} el - * @param {object} opts - * @return { {top: number, left: number, width: number, height: number, zoom: number, rect: any} } - * @public - */ - CanvasView.prototype.getElementPos = function (el, opts) { - if (opts === void 0) { opts = {}; } - var zoom = this.module.getZoomDecimal(); - var frameOffset = this.getFrameOffset(el); - var canvasEl = this.el; - var canvasOffset = this.getCanvasOffset(); - var elRect = this.offset(el, opts); - var frameTop = opts.avoidFrameOffset ? 0 : frameOffset.top; - var frameLeft = opts.avoidFrameOffset ? 0 : frameOffset.left; - var elTop = opts.avoidFrameZoom ? elRect.top : elRect.top * zoom; - var elLeft = opts.avoidFrameZoom ? elRect.left : elRect.left * zoom; - var top = opts.avoidFrameOffset ? elTop : elTop + frameTop - canvasOffset.top + canvasEl.scrollTop; - var left = opts.avoidFrameOffset ? elLeft : elLeft + frameLeft - canvasOffset.left + canvasEl.scrollLeft; - var height = opts.avoidFrameZoom ? elRect.height : elRect.height * zoom; - var width = opts.avoidFrameZoom ? elRect.width : elRect.width * zoom; - return { top: top, left: left, height: height, width: width, zoom: zoom, rect: elRect }; - }; - /** - * Returns element's offsets like margins and paddings - * @param {HTMLElement} el - * @return { MarginPaddingOffsets } - * @public - */ - CanvasView.prototype.getElementOffsets = function (el) { - if (!el || (0,dom/* isTextNode */.BM)(el)) - return {}; - var result = {}; - var styles = window.getComputedStyle(el); - var zoom = this.module.getZoomDecimal(); - var marginPaddingOffsets = [ - 'marginTop', - 'marginRight', - 'marginBottom', - 'marginLeft', - 'paddingTop', - 'paddingRight', - 'paddingBottom', - 'paddingLeft', - 'borderTopWidth', - 'borderRightWidth', - 'borderBottomWidth', - 'borderLeftWidth', - ]; - marginPaddingOffsets.forEach(function (offset) { - result[offset] = parseFloat(styles[offset]) * zoom; - }); - return result; - }; - /** - * Returns position data of the canvas element - * @return { {top: number, left: number, width: number, height: number} } obj Position object - * @public - */ - CanvasView.prototype.getPosition = function (opts) { - var _a; - if (opts === void 0) { opts = {}; } - var doc = (_a = this.frame) === null || _a === void 0 ? void 0 : _a.el.contentDocument; - if (!doc) { - return { - top: 0, - left: 0, - width: 0, - height: 0, - }; - } - var bEl = doc.body; - var zoom = this.module.getZoomDecimal(); - var fo = this.getFrameOffset(); - var co = this.getCanvasOffset(); - var noScroll = opts.noScroll; - return { - top: fo.top + (noScroll ? 0 : bEl.scrollTop) * zoom - co.top, - left: fo.left + (noScroll ? 0 : bEl.scrollLeft) * zoom - co.left, - width: co.width, - height: co.height, - }; - }; - /** - * Update javascript of a specific component passed by its View - * @param {ModuleView} view Component's View - * @private - */ - //TODO change type after the ComponentView was updated to ts - CanvasView.prototype.updateScript = function (view) { - var model = view.model; - var id = model.getId(); - if (!view.scriptContainer) { - view.scriptContainer = (0,dom/* createEl */.ut)('div', { 'data-id': id }); - var jsEl = this.getJsContainer(); - jsEl === null || jsEl === void 0 ? void 0 : jsEl.appendChild(view.scriptContainer); - } - view.el.id = id; - view.scriptContainer.innerHTML = ''; - // In editor, I make use of setTimeout as during the append process of elements - // those will not be available immediately, therefore 'item' variable - var script = document.createElement('script'); - var scriptFn = model.getScriptString(); - var scriptFnStr = model.get('script-props') ? scriptFn : "function(){\n".concat(scriptFn, "\n;}"); - var scriptProps = JSON.stringify(model.__getScriptProps()); - script.innerHTML = "\n setTimeout(function() {\n var item = document.getElementById('".concat(id, "');\n if (!item) return;\n (").concat(scriptFnStr, ".bind(item))(").concat(scriptProps, ")\n }, 1);"); - // #873 - // Adding setTimeout will make js components work on init of the editor - setTimeout(function () { - var scr = view.scriptContainer; - scr === null || scr === void 0 ? void 0 : scr.appendChild(script); - }, 0); - }; - /** - * Get javascript container - * @private - */ - CanvasView.prototype.getJsContainer = function (view) { - var frameView = this.getFrameView(view); - return frameView === null || frameView === void 0 ? void 0 : frameView.getJsContainer(); - }; - CanvasView.prototype.getFrameView = function (view) { - return (view === null || view === void 0 ? void 0 : view.frameView) || this.em.getCurrentFrame(); - }; - CanvasView.prototype._renderFrames = function () { - if (!this.ready) - return; - var _a = this, model = _a.model, frames = _a.frames, em = _a.em, framesArea = _a.framesArea; - var frms = model.frames; - frms.listenToLoad(); - frames.render(); - var mainFrame = frms.at(0); - var currFrame = mainFrame === null || mainFrame === void 0 ? void 0 : mainFrame.view; - em.setCurrentFrame(currFrame); - framesArea === null || framesArea === void 0 ? void 0 : framesArea.appendChild(frames.el); - this.frame = currFrame; - this.updateFramesArea(); - }; - CanvasView.prototype.renderFrames = function () { - this._renderFrames(); - }; - CanvasView.prototype.render = function () { - var _a = this, el = _a.el, $el = _a.$el, ppfx = _a.ppfx, config = _a.config, em = _a.em; - $el.html(this.template()); - var $frames = $el.find('[data-frames]'); - this.framesArea = $frames.get(0); - var toolsWrp = $el.find('[data-tools]'); - this.toolsWrapper = toolsWrp.get(0); - toolsWrp.append("\n
\n
\n
\n
\n
\n
\n ").concat(config.extHl ? "
") : '', "\n
\n
\n
\n
\n
\n
\n
\n ")); - this.toolsEl = el.querySelector("#".concat(ppfx, "tools")); - this.hlEl = el.querySelector(".".concat(ppfx, "highlighter")); - this.badgeEl = el.querySelector(".".concat(ppfx, "badge")); - this.placerEl = el.querySelector(".".concat(ppfx, "placeholder")); - this.ghostEl = el.querySelector(".".concat(ppfx, "ghost")); - this.toolbarEl = el.querySelector(".".concat(ppfx, "toolbar")); - this.resizerEl = el.querySelector(".".concat(ppfx, "resizer")); - this.offsetEl = el.querySelector(".".concat(ppfx, "offset-v")); - this.fixedOffsetEl = el.querySelector(".".concat(ppfx, "offset-fixed-v")); - this.toolsGlobEl = el.querySelector(".".concat(ppfx, "tools-gl")); - this.spotsEl = el.querySelector('[data-spots]'); - this.cvStyle = el.querySelector('[data-canvas-style]'); - this.el.className = (0,mixins.getUiClass)(em, this.className); - this.ready = true; - this._renderFrames(); - return this; - }; - return CanvasView; -}(abstract_ModuleView)); -/* harmony default export */ const view_CanvasView = (CanvasView); - -;// CONCATENATED MODULE: ./src/canvas/index.ts -/** - * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/canvas/config/config.ts) - * ```js - * const editor = grapesjs.init({ - * canvas: { - * // options - * } - * }) - * ``` - * - * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. - * - * ```js - * // Listen to events - * editor.on('canvas:drop', () => { ... }); - * - * // Use the API - * const canvas = editor.Canvas; - * canvas.setCoords(...); - * ``` - * - * {REPLACE_EVENTS} - * - * [Component]: component.html - * [Frame]: frame.html - * [CanvasSpot]: canvas_spot.html - * - * @module Canvas - */ -var canvas_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var canvas_assign = (undefined && undefined.__assign) || function () { - canvas_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return canvas_assign.apply(this, arguments); -}; -var canvas_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - - - - - - - - - - -var CanvasModule = /** @class */ (function (_super) { - canvas_extends(CanvasModule, _super); - /** - * Initialize module. Automatically called with a new instance of the editor - * @param {Object} config Configurations - * @private - */ - function CanvasModule(em) { - var _this = _super.call(this, em, 'Canvas', canvas_config_config) || this; - _this.events = CanvasEvents; - _this.framesById = {}; - _this.canvas = new model_Canvas(_this); - _this.spots = new model_CanvasSpots(_this); - _this.model = _this.canvas; - _this.startAutoscroll = _this.startAutoscroll.bind(_this); - _this.stopAutoscroll = _this.stopAutoscroll.bind(_this); - return _this; - } - /** - * Get configuration object - * @name getConfig - * @function - * @return {Object} - */ - /** - * Used inside RTE - * @private - */ - CanvasModule.prototype.getCanvasView = function () { - return this.canvasView; - }; - CanvasModule.prototype.postLoad = function () { - this.model.init(); - }; - CanvasModule.prototype.getModel = function () { - return this.canvas; - }; - /** - * Get the canvas element - * @returns {HTMLElement} - */ - CanvasModule.prototype.getElement = function () { - return this.getCanvasView().el; - }; - CanvasModule.prototype.getFrame = function (index) { - return this.getFrames()[index || 0]; - }; - /** - * Get the main frame element of the canvas - * @returns {HTMLIFrameElement} - */ - CanvasModule.prototype.getFrameEl = function () { - var frame = (this.canvasView || {}).frame; - return frame === null || frame === void 0 ? void 0 : frame.el; - }; - CanvasModule.prototype.getFramesEl = function () { - var _a; - return (_a = this.canvasView) === null || _a === void 0 ? void 0 : _a.framesArea; - }; - /** - * Get the main frame window instance - * @returns {Window} - */ - CanvasModule.prototype.getWindow = function () { - var frame = (this.canvasView || {}).frame; - return frame === null || frame === void 0 ? void 0 : frame.getWindow(); - }; - /** - * Get the main frame document element - * @returns {HTMLDocument} - */ - CanvasModule.prototype.getDocument = function () { - var frame = this.getFrameEl(); - return frame === null || frame === void 0 ? void 0 : frame.contentDocument; - }; - /** - * Get the main frame body element - * @return {HTMLBodyElement} - */ - CanvasModule.prototype.getBody = function () { - var doc = this.getDocument(); - return doc === null || doc === void 0 ? void 0 : doc.body; - }; - CanvasModule.prototype._getLocalEl = function (globalEl, compView, method) { - var result = globalEl; - var frameView = compView === null || compView === void 0 ? void 0 : compView.frameView; - result = frameView ? frameView[method]() : result; - return result; - }; - /** - * Returns element containing all global canvas tools - * @returns {HTMLElement} - * @private - */ - CanvasModule.prototype.getGlobalToolsEl = function () { - var _a; - return (_a = this.canvasView) === null || _a === void 0 ? void 0 : _a.toolsGlobEl; - }; - /** - * Returns element containing all canvas tools - * @returns {HTMLElement} - * @private - */ - CanvasModule.prototype.getToolsEl = function (compView) { - return this._getLocalEl(this.getCanvasView().toolsEl, compView, 'getToolsEl'); - }; - /** - * Returns highlighter element - * @returns {HTMLElement} - * @private - */ - CanvasModule.prototype.getHighlighter = function (compView) { - return this._getLocalEl(this.getCanvasView().hlEl, compView, 'getHighlighter'); - }; - /** - * Returns badge element - * @returns {HTMLElement} - * @private - */ - CanvasModule.prototype.getBadgeEl = function (compView) { - return this._getLocalEl(this.getCanvasView().badgeEl, compView, 'getBadgeEl'); - }; - /** - * Returns placer element - * @returns {HTMLElement} - * @private - */ - CanvasModule.prototype.getPlacerEl = function () { - return this.getCanvasView().placerEl; - }; - /** - * Returns ghost element - * @returns {HTMLElement} - * @private - */ - CanvasModule.prototype.getGhostEl = function () { - return this.getCanvasView().ghostEl; - }; - /** - * Returns toolbar element - * @returns {HTMLElement} - * @private - */ - CanvasModule.prototype.getToolbarEl = function () { - return this.getCanvasView().toolbarEl; - }; - /** - * Returns resizer element - * @returns {HTMLElement} - * @private - */ - CanvasModule.prototype.getResizerEl = function () { - return this.getCanvasView().resizerEl; - }; - /** - * Returns offset viewer element - * @returns {HTMLElement} - * @private - */ - CanvasModule.prototype.getOffsetViewerEl = function (compView) { - return this._getLocalEl(this.getCanvasView().offsetEl, compView, 'getOffsetViewerEl'); - }; - /** - * Returns fixed offset viewer element - * @returns {HTMLElement} - * @private - */ - CanvasModule.prototype.getFixedOffsetViewerEl = function () { - return this.getCanvasView().fixedOffsetEl; - }; - CanvasModule.prototype.getSpotsEl = function () { - var _a; - return (_a = this.canvasView) === null || _a === void 0 ? void 0 : _a.spotsEl; - }; - CanvasModule.prototype.render = function () { - var _a; - (_a = this.canvasView) === null || _a === void 0 ? void 0 : _a.remove(); - this.canvasView = new view_CanvasView(this.canvas); - return this.canvasView.render().el; - }; - /** - * Get frame position - * @returns {Object} - * @private - */ - CanvasModule.prototype.getOffset = function () { - var frameOff = this.offset(this.getFrameEl()); - var canvasOff = this.offset(this.getElement()); - return { - top: frameOff.top - canvasOff.top, - left: frameOff.left - canvasOff.left, - }; - }; - /** - * Get the offset of the passed component element - * @param {HTMLElement} el - * @returns {Object} - * @private - */ - CanvasModule.prototype.offset = function (el) { - return this.getCanvasView().offset(el); - }; - /** - * Set custom badge naming strategy - * @param {Function} f - * @example - * canvas.setCustomBadgeLabel(function(component){ - * return component.getName(); - * }); - */ - CanvasModule.prototype.setCustomBadgeLabel = function (f) { - //@ts-ignore - this.config.customBadgeLabel = f; - }; - /** - * Get element position relative to the canvas - * @param {HTMLElement} el - * @returns {Object} - * @private - */ - CanvasModule.prototype.getElementPos = function (el, opts) { - return this.getCanvasView().getElementPos(el, opts); - }; - /** - * Returns element's offsets like margins and paddings - * @param {HTMLElement} el - * @returns {Object} - * @private - */ - CanvasModule.prototype.getElementOffsets = function (el) { - return this.getCanvasView().getElementOffsets(el); - }; - /** - * Get canvas rectangular data - * @returns {Object} - */ - CanvasModule.prototype.getRect = function () { - var _a; - var _b = (_a = this.getCanvasView().getPosition()) !== null && _a !== void 0 ? _a : {}, _c = _b.top, top = _c === void 0 ? 0 : _c, _d = _b.left, left = _d === void 0 ? 0 : _d; - return canvas_assign(canvas_assign({}, this.getCanvasView().getCanvasOffset()), { topScroll: top, leftScroll: left }); - }; - /** - * This method comes handy when you need to attach something like toolbars - * to elements inside the canvas, dealing with all relative position, - * offsets, etc. and returning as result the object with positions which are - * viewable by the user (when the canvas is scrolled the top edge of the element - * is not viewable by the user anymore so the new top edge is the one of the canvas) - * - * The target should be visible before being passed here as invisible elements - * return empty string as width - * @param {HTMLElement} target The target in this case could be the toolbar - * @param {HTMLElement} element The element on which I'd attach the toolbar - * @param {Object} options Custom options - * @param {Boolean} options.toRight Set to true if you want the toolbar attached to the right - * @return {Object} - * @private - */ - CanvasModule.prototype.getTargetToElementDim = function (target, element, options) { - if (options === void 0) { options = {}; } - var opts = options || {}; - var canvasPos = this.getCanvasView().getPosition(); - if (!canvasPos) - return; - var pos = opts.elPos || this.getCanvasView().getElementPos(element); - var toRight = options.toRight || 0; - var targetHeight = opts.targetHeight || target.offsetHeight; - var targetWidth = opts.targetWidth || target.offsetWidth; - var eventToTrigger = opts.event || null; - var elTop = pos.top - targetHeight; - var elLeft = pos.left; - elLeft += toRight ? pos.width : 0; - elLeft = toRight ? elLeft - targetWidth : elLeft; - var leftPos = elLeft < canvasPos.left ? canvasPos.left : elLeft; - var topPos = elTop < canvasPos.top ? canvasPos.top : elTop; - topPos = topPos > pos.top + pos.height ? pos.top + pos.height : topPos; - var result = { - top: topPos, - left: leftPos, - elementTop: pos.top, - elementLeft: pos.left, - elementWidth: pos.width, - elementHeight: pos.height, - targetWidth: target.offsetWidth, - targetHeight: target.offsetHeight, - canvasTop: canvasPos.top, - canvasLeft: canvasPos.left, - canvasWidth: canvasPos.width, - canvasHeight: canvasPos.height, - }; - // In this way I can catch data and also change the position strategy - if (eventToTrigger && this.em) { - this.em.trigger(eventToTrigger, result); - } - return result; - }; - CanvasModule.prototype.canvasRectOffset = function (el, pos, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - var getFrameElFromDoc = function (doc) { - var defaultView = doc.defaultView; - return defaultView === null || defaultView === void 0 ? void 0 : defaultView.frameElement; - }; - var rectOff = function (el, top, pos) { - if (top === void 0) { top = 1; } - var zoom = _this.em.getZoomDecimal(); - var side = top ? 'top' : 'left'; - var doc = el.ownerDocument; - var _a = opts.offset ? getFrameElFromDoc(doc) : {}, _b = _a.offsetTop, offsetTop = _b === void 0 ? 0 : _b, _c = _a.offsetLeft, offsetLeft = _c === void 0 ? 0 : _c; - var _d = doc.body || {}, _e = _d.scrollTop, scrollTop = _e === void 0 ? 0 : _e, _f = _d.scrollLeft, scrollLeft = _f === void 0 ? 0 : _f; - var scroll = top ? scrollTop : scrollLeft; - var offset = top ? offsetTop : offsetLeft; - return pos[side] - (scroll - offset) * zoom; - }; - return { - top: rectOff(el, 1, pos), - left: rectOff(el, 0, pos), - }; - }; - /** - * - * @param {HTMLElement} el The component element in the canvas - * @param {HTMLElement} targetEl The target element to position (eg. toolbar) - * @param {Object} opts - * @private - */ - CanvasModule.prototype.getTargetToElementFixed = function (el, targetEl, opts) { - if (opts === void 0) { opts = {}; } - var elRect = opts.pos || this.getElementPos(el, { noScroll: true }); - var canvasOffset = opts.canvasOff || this.canvasRectOffset(el, elRect); - var targetHeight = targetEl.offsetHeight || 0; - var targetWidth = targetEl.offsetWidth || 0; - var elRight = elRect.left + elRect.width; - var canvasView = this.getCanvasView(); - var canvasRect = canvasView.getPosition(); - var frameOffset = canvasView.getFrameOffset(el); - var event = opts.event; - var top = -targetHeight; - var left = !(0,index_all.isUndefined)(opts.left) ? opts.left : elRect.width - targetWidth; - left = elRect.left < -left ? -elRect.left : left; - left = elRight > canvasRect.width ? left - (elRight - canvasRect.width) : left; - // Check when the target top edge reaches the top of the viewable canvas - if (canvasOffset.top < targetHeight) { - var fullHeight = elRect.height + targetHeight; - var elIsShort = fullHeight < frameOffset.height; - // Scroll with the window if the top edge is reached and the - // element is bigger than the canvas - if (elIsShort) { - top = top + fullHeight; - } - else { - top = -canvasOffset.top < elRect.height ? -canvasOffset.top : elRect.height; - } - } - var result = { - top: top, - left: left, - canvasOffsetTop: canvasOffset.top, - canvasOffsetLeft: canvasOffset.left, - elRect: elRect, - canvasOffset: canvasOffset, - canvasRect: canvasRect, - targetWidth: targetWidth, - targetHeight: targetHeight, - }; - // In this way I can catch data and also change the position strategy - event && this.em.trigger(event, result); - return result; - }; - /** - * Instead of simply returning e.clientX and e.clientY this function - * calculates also the offset based on the canvas. This is helpful when you - * need to get X and Y position while moving between the editor area and - * canvas area, which is in the iframe - * @param {Event} e - * @return {Object} - * @private - */ - CanvasModule.prototype.getMouseRelativePos = function (e, opts) { - if (opts === void 0) { opts = {}; } - var subWinOffset = opts.subWinOffset; - var doc = e.target.ownerDocument; - var win = doc.defaultView || doc.parentWindow; - var frame = win.frameElement; - var yOffset = subWinOffset ? win.pageYOffset : 0; - var xOffset = subWinOffset ? win.pageXOffset : 0; - var zoomMlt = this.getZoomMultiplier(); - var addTop = 0; - var addLeft = 0; - if (frame) { - var frameRect = frame.getBoundingClientRect(); - addTop = frameRect.top || 0; - addLeft = frameRect.left || 0; - } - return { - y: (e.clientY + addTop - yOffset) * zoomMlt, - x: (e.clientX + addLeft - xOffset) * zoomMlt, - }; - }; - /** - * X and Y mouse position relative to the canvas - * @param {Event} ev - * @return {Object} - * @private - */ - CanvasModule.prototype.getMouseRelativeCanvas = function (ev, opts) { - var _a; - var zoom = this.getZoomDecimal(); - var _b = (_a = this.getCanvasView().getPosition(opts)) !== null && _a !== void 0 ? _a : {}, _c = _b.top, top = _c === void 0 ? 0 : _c, _d = _b.left, left = _d === void 0 ? 0 : _d; - return { - y: ev.clientY * zoom + top, - x: ev.clientX * zoom + left, - }; - }; - /** - * Check if the canvas is focused - * @returns {Boolean} - */ - CanvasModule.prototype.hasFocus = function () { - return this.getDocument().hasFocus(); - }; - /** - * Detects if some input is focused (input elements, text components, etc.) - * @return {Boolean} - * @private - */ - CanvasModule.prototype.isInputFocused = function () { - var doc = this.getDocument(); - var frame = this.getFrameEl(); - var toIgnore = canvas_spreadArray(['body'], this.config.notTextable, true); - var docActive = frame && document.activeElement === frame; - var focused = docActive ? doc && doc.activeElement : document.activeElement; - return focused && !toIgnore.some(function (item) { return focused.matches(item); }); - }; - /** - * Scroll canvas to the element if it's not visible. The scrolling is - * executed via `scrollIntoView` API and options of this method are - * passed to it. For instance, you can scroll smoothly by using - * `{ behavior: 'smooth' }`. - * @param {HTMLElement|[Component]} el - * @param {Object} [opts={}] Options, same as options for `scrollIntoView` - * @param {Boolean} [opts.force=false] Force the scroll, even if the element is already visible - * @example - * const selected = editor.getSelected(); - * // Scroll smoothly (this behavior can be polyfilled) - * canvas.scrollTo(selected, { behavior: 'smooth' }); - * // Force the scroll, even if the element is alredy visible - * canvas.scrollTo(selected, { force: true }); - */ - CanvasModule.prototype.scrollTo = function (el, opts) { - if (opts === void 0) { opts = {}; } - var elem = (0,mixins.getElement)(el); - var view = elem && (0,mixins.getViewEl)(elem); - view && view.scrollIntoView(opts); - }; - /** - * Start autoscroll - * @private - */ - CanvasModule.prototype.startAutoscroll = function (frame) { - var fr = (frame && frame.view) || this.em.getCurrentFrame(); - fr && fr.startAutoscroll(); - }; - /** - * Stop autoscroll - * @private - */ - CanvasModule.prototype.stopAutoscroll = function (frame) { - var fr = (frame && frame.view) || this.em.getCurrentFrame(); - fr && fr.stopAutoscroll(); - }; - /** - * Set canvas zoom value - * @param {Number} value The zoom value, from 0 to 100 - * @returns {this} - * @example - * canvas.setZoom(50); // set zoom to 50% - */ - CanvasModule.prototype.setZoom = function (value) { - this.canvas.set('zoom', typeof value === 'string' ? parseFloat(value) : value); - return this; - }; - /** - * Get canvas zoom value - * @returns {Number} - * @example - * canvas.setZoom(50); // set zoom to 50% - * const zoom = canvas.getZoom(); // 50 - */ - CanvasModule.prototype.getZoom = function () { - return parseFloat(this.canvas.get('zoom')); - }; - /** - * Set canvas position coordinates - * @param {Number} x Horizontal position - * @param {Number} y Vertical position - * @returns {this} - * @example - * canvas.setCoords(100, 100); - */ - CanvasModule.prototype.setCoords = function (x, y, opts) { - var _a; - if (opts === void 0) { opts = {}; } - var hasX = x || x === 0; - var hasY = y || y === 0; - var coords = { - x: this.canvas.get('x'), - y: this.canvas.get('y'), - }; - if (hasX) - coords.x = parseFloat("".concat(x)); - if (hasY) - coords.y = parseFloat("".concat(y)); - if (opts.toWorld) { - var delta = (_a = this.canvasView) === null || _a === void 0 ? void 0 : _a.getViewportDelta(); - if (delta) { - if (hasX) - coords.x = coords.x - delta.x; - if (hasY) - coords.y = coords.y - delta.y; - } - } - this.canvas.set(coords); - return this; - }; - /** - * Get canvas position coordinates - * @returns {Object} Object containing coordinates - * @example - * canvas.setCoords(100, 100); - * const coords = canvas.getCoords(); - * // { x: 100, y: 100 } - */ - CanvasModule.prototype.getCoords = function () { - var _a = this.canvas.attributes, x = _a.x, y = _a.y; - return { x: x, y: y }; - }; - /** - * Get canvas pointer position coordinates. - * @returns {Object} Object containing pointer coordinates - * @private - * @example - * const worldPointer = canvas.getPointer(); - * const screenPointer = canvas.getPointer(true); - */ - CanvasModule.prototype.getPointer = function (screen) { - var _a = this.canvas.attributes, pointer = _a.pointer, pointerScreen = _a.pointerScreen; - return screen ? pointerScreen : pointer; - }; - CanvasModule.prototype.getZoomDecimal = function () { - return this.getZoom() / 100; - }; - CanvasModule.prototype.getZoomMultiplier = function () { - var zoom = this.getZoomDecimal(); - return zoom ? 1 / zoom : 1; - }; - CanvasModule.prototype.fitViewport = function (opts) { - var _a; - (_a = this.canvasView) === null || _a === void 0 ? void 0 : _a.fitViewport(opts); - }; - CanvasModule.prototype.toggleFramesEvents = function (on) { - var style = this.getFramesEl().style; - style.pointerEvents = on ? '' : 'none'; - }; - CanvasModule.prototype.getFrames = function () { - return this.canvas.frames.map(function (item) { return item; }); - }; - /** - * Add new frame to the canvas - * @param {Object} props Frame properties - * @returns {[Frame]} - * @private - * @example - * canvas.addFrame({ - * name: 'Mobile home page', - * x: 100, // Position in canvas - * y: 100, - * width: 500, // Frame dimensions - * height: 600, - * // device: 'DEVICE-ID', - * components: [ - * '

Title frame

', - * '

Paragraph frame

', - * ], - * styles: ` - * .testh { color: red; } - * .testp { color: blue; } - * `, - * }); - */ - CanvasModule.prototype.addFrame = function (props, opts) { - if (props === void 0) { props = {}; } - if (opts === void 0) { opts = {}; } - return this.canvas.frames.add(new model_Frame(this, canvas_assign({}, props)), opts); - }; - /** - * Get the last created Component from a drag & drop to the canvas. - * @returns {[Component]|undefined} - */ - CanvasModule.prototype.getLastDragResult = function () { - return this.em.get('dragResult'); - }; - /** - * Add or update canvas spot. - * @param {Object} props Canvas spot properties. - * @param opts - * @returns {[CanvasSpot]} - * @example - * // Add new canvas spot - * const spot = canvas.addSpot({ - * type: 'select', // 'select' is one of the built-in spots - * component: editor.getSelected(), - * }); - * - * // Add custom canvas spot - * const spot = canvas.addSpot({ - * type: 'my-custom-spot', - * component: editor.getSelected(), - * }); - * // Update the same spot by reusing its ID - * canvas.addSpot({ - * id: spot.id, - * component: anotherComponent, - * }); - */ - CanvasModule.prototype.addSpot = function (props, opts) { - var _a; - if (opts === void 0) { opts = {}; } - var spotProps = props; - var spots = this.getSpots(spotProps); - if (spots.length) { - var spot_1 = spots[0]; - spot_1.set(spotProps); - return spot_1; - } - var cmpView = spotProps.componentView || ((_a = spotProps.component) === null || _a === void 0 ? void 0 : _a.view); - var spot = new CanvasSpot/* default */.Z(this, canvas_assign(canvas_assign({}, spotProps), { id: spotProps.id || "cs_".concat(spotProps.type, "_").concat(cmpView === null || cmpView === void 0 ? void 0 : cmpView.cid), type: spotProps.type || '' })); - this.spots.add(spot, opts); - return spot; - }; - /** - * Get canvas spots. - * @param {Object} [spotProps] Canvas spot properties for filtering the result. With no properties, all available spots will be returned. - * @returns {[CanvasSpot][]} - * @example - * canvas.addSpot({ type: 'select', component: cmp1 }); - * canvas.addSpot({ type: 'select', component: cmp2 }); - * canvas.addSpot({ type: 'target', component: cmp3 }); - * - * // Get all spots - * const allSpots = canvas.getSpots(); - * allSpots.length; // 3 - * - * // Get all 'select' spots - * const allSelectSpots = canvas.getSpots({ type: 'select' }); - * allSelectSpots.length; // 2 - */ - CanvasModule.prototype.getSpots = function (spotProps) { - if (spotProps === void 0) { spotProps = {}; } - return this.spots.where(spotProps.id ? { id: spotProps.id } : spotProps); - }; - /** - * Remove canvas spots. - * @param {Object|[CanvasSpot][]} [spotProps] Canvas spot properties for filtering spots to remove or an array of spots to remove. With no properties, all available spots will be removed. - * @returns {[CanvasSpot][]} - * @example - * canvas.addSpot({ type: 'select', component: cmp1 }); - * canvas.addSpot({ type: 'select', component: cmp2 }); - * canvas.addSpot({ type: 'target', component: cmp3 }); - * - * // Remove all 'select' spots - * canvas.removeSpots({ type: 'select' }); - * - * // Remove spots by an array of canvas spots - * const filteredSpots = canvas.getSpots().filter(spot => myCustomCondition); - * canvas.removeSpots(filteredSpots); - * - * // Remove all spots - * canvas.removeSpots(); - */ - CanvasModule.prototype.removeSpots = function (spotProps) { - if (spotProps === void 0) { spotProps = {}; } - var spots = (0,index_all.isArray)(spotProps) ? spotProps : this.getSpots(spotProps); - var removed = this.spots.remove(spots); - return removed; - }; - /** - * Check if the built-in canvas spot has a declared custom rendering. - * @param {String} type Built-in canvas spot type - * @returns {Boolean} - * @example - * grapesjs.init({ - * // ... - * canvas: { - * // avoid rendering the built-in 'target' canvas spot - * customSpots: { target: true } - * } - * }); - * // ... - * canvas.hasCustomSpot('select'); // false - * canvas.hasCustomSpot('target'); // true - */ - CanvasModule.prototype.hasCustomSpot = function (type) { - var customSpots = this.config.customSpots; - if (customSpots === true || (customSpots && type && customSpots[type])) { - return true; - } - return false; - }; - /** - * Transform a box rect from the world coordinate system to the screen one. - * @param {Object} boxRect - * @returns {Object} - */ - CanvasModule.prototype.getWorldRectToScreen = function (boxRect) { - var _a; - return (_a = this.canvasView) === null || _a === void 0 ? void 0 : _a.getRectToScreen(boxRect); - }; - /** - * Update canvas for spots/tools positioning. - * @param {Object} [opts] Options. - * @param {Object} [opts.spots=false] Update the position of spots. - */ - CanvasModule.prototype.refresh = function (opts) { - if (opts === void 0) { opts = {}; } - var _a = this, em = _a.em, events = _a.events, canvasView = _a.canvasView; - canvasView === null || canvasView === void 0 ? void 0 : canvasView.clearOff(); - if (opts.spots || opts.all) { - this.refreshSpots(); - em.trigger('canvas:updateTools'); // this should be deprecated - } - em.set('canvasOffset', this.getOffset()); // this should be deprecated - em.trigger(events.refresh, opts); - }; - CanvasModule.prototype.refreshSpots = function () { - this.spots.refresh(); - }; - CanvasModule.prototype.destroy = function () { - var _this = this; - var _a; - this.canvas.stopListening(); - (_a = this.canvasView) === null || _a === void 0 ? void 0 : _a.remove(); - //[this.canvas, this.canvasView].forEach(i => (i = {})); - //@ts-ignore - ['model', 'droppable'].forEach(function (i) { return (_this[i] = {}); }); - }; - return CanvasModule; -}(abstract_Module)); -/* harmony default export */ const canvas = (CanvasModule); - -;// CONCATENATED MODULE: ./src/dom_components/config/config.ts -/* harmony default export */ const dom_components_config_config = ({ - stylePrefix: 'comp-', - components: [], - draggableComponents: true, - disableTextInnerChilds: false, - processor: undefined, - useFrameDoc: false, - voidElements: [ - 'area', - 'base', - 'br', - 'col', - 'embed', - 'hr', - 'img', - 'input', - 'keygen', - 'link', - 'menuitem', - 'meta', - 'param', - 'source', - 'track', - 'wbr', - ], -}); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentTextNode.ts -var ComponentTextNode_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentTextNode_assign = (undefined && undefined.__assign) || function () { - ComponentTextNode_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentTextNode_assign.apply(this, arguments); -}; - - -var ComponentTextNode = /** @class */ (function (_super) { - ComponentTextNode_extends(ComponentTextNode, _super); - function ComponentTextNode() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ComponentTextNode.prototype, "defaults", { - get: function () { - return ComponentTextNode_assign(ComponentTextNode_assign({}, _super.prototype.defaults), { tagName: '', droppable: false, layerable: false, selectable: false, editable: true }); - }, - enumerable: false, - configurable: true - }); - ComponentTextNode.prototype.toHTML = function () { - var content = this.content; - var parent = this.parent(); - return (parent === null || parent === void 0 ? void 0 : parent.is('script')) ? content : this.__escapeContent(content); - }; - ComponentTextNode.prototype.__escapeContent = function (content) { - return (0,mixins.escapeNodeContent)(content); - }; - ComponentTextNode.isComponent = function (el) { - var _a; - if (el.nodeType === 3) { - return { - type: 'textnode', - content: (_a = el.textContent) !== null && _a !== void 0 ? _a : '', - }; - } - }; - return ComponentTextNode; -}(model_Component)); -/* harmony default export */ const model_ComponentTextNode = (ComponentTextNode); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentComment.ts -var ComponentComment_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentComment_assign = (undefined && undefined.__assign) || function () { - ComponentComment_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentComment_assign.apply(this, arguments); -}; - -var ComponentComment = /** @class */ (function (_super) { - ComponentComment_extends(ComponentComment, _super); - function ComponentComment() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ComponentComment.prototype, "defaults", { - get: function () { - // @ts-ignore - return ComponentComment_assign({}, _super.prototype.defaults); - }, - enumerable: false, - configurable: true - }); - ComponentComment.prototype.toHTML = function () { - return ""); - }; - ComponentComment.isComponent = function (el) { - var _a; - if (el.nodeType == 8) { - return { - type: 'comment', - content: (_a = el.textContent) !== null && _a !== void 0 ? _a : '', - }; - } - }; - return ComponentComment; -}(model_ComponentTextNode)); -/* harmony default export */ const model_ComponentComment = (ComponentComment); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentFrame.ts -var ComponentFrame_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentFrame_assign = (undefined && undefined.__assign) || function () { - ComponentFrame_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentFrame_assign.apply(this, arguments); -}; - - -var ComponentFrame_type = 'iframe'; -var ComponentFrame = /** @class */ (function (_super) { - ComponentFrame_extends(ComponentFrame, _super); - function ComponentFrame() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ComponentFrame.prototype, "defaults", { - get: function () { - return ComponentFrame_assign(ComponentFrame_assign({}, _super.prototype.defaults), { type: ComponentFrame_type, tagName: ComponentFrame_type, droppable: false, resizable: true, traits: ['id', 'title', 'src'], attributes: { frameborder: '0' } }); - }, - enumerable: false, - configurable: true - }); - ComponentFrame.isComponent = function (el) { - return (0,mixins.toLowerCase)(el.tagName) === ComponentFrame_type; - }; - return ComponentFrame; -}(model_Component)); -/* harmony default export */ const model_ComponentFrame = (ComponentFrame); -// ComponentFrame.isComponent = el => toLowerCase(el.tagName) === type; - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentImage.ts -var ComponentImage_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentImage_assign = (undefined && undefined.__assign) || function () { - ComponentImage_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentImage_assign.apply(this, arguments); -}; - - - -var svgAttrs = 'xmlns="http://www.w3.org/2000/svg" width="100" viewBox="0 0 24 24" style="fill: rgba(0,0,0,0.15); transform: scale(0.75)"'; -var ComponentImage = /** @class */ (function (_super) { - ComponentImage_extends(ComponentImage, _super); - function ComponentImage(props, opt) { - if (props === void 0) { props = {}; } - var _this = _super.call(this, props, opt) || this; - var src = _this.get('attributes').src; - if (src && (0,mixins.buildBase64UrlFromSvg)((0,index_all.result)(_this, 'defaults').src) !== src) { - _this.set('src', src, { silent: true }); - } - return _this; - } - Object.defineProperty(ComponentImage.prototype, "defaults", { - get: function () { - return ComponentImage_assign(ComponentImage_assign({}, _super.prototype.defaults), { type: 'image', tagName: 'img', void: true, droppable: 0, editable: 1, highlightable: 0, resizable: { ratioDefault: 1 }, traits: ['alt'], src: "\n \n "), - // Fallback image in case the src can't be loaded - // If you use SVG, xmlns="http://www.w3.org/2000/svg" is required - fallback: "\n \n "), - // File to load asynchronously once the model is rendered - file: '' }); - }, - enumerable: false, - configurable: true - }); - ComponentImage.prototype.initToolbar = function () { - _super.prototype.initToolbar.call(this); - var em = this.em; - if (em) { - var cmd = em.Commands; - var cmdName = 'image-editor'; - // Add Image Editor button only if the default command exists - if (cmd.has(cmdName)) { - var hasButtonBool = false; - var tb = this.get('toolbar'); - for (var i = 0; i < tb.length; i++) { - if (tb[i].command === 'image-editor') { - hasButtonBool = true; - break; - } - } - if (!hasButtonBool) { - tb.push({ - attributes: { class: 'fa fa-pencil' }, - command: cmdName, - }); - this.set('toolbar', tb); - } - } - } - }; - /** - * Returns object of attributes for HTML - * @return {Object} - * @private - */ - ComponentImage.prototype.getAttrToHTML = function () { - var attr = _super.prototype.getAttrToHTML.call(this); - var src = this.getSrcResult(); - if (src) - attr.src = src; - return attr; - }; - ComponentImage.prototype.getSrcResult = function (opt) { - if (opt === void 0) { opt = {}; } - var src = this.get(opt.fallback ? 'fallback' : 'src') || ''; - var result = src; - if (src && src.substr(0, 4) === '= 0)) { - delete result.editable; - } - }); - } - return result; - }; - return ComponentLink; -}(model_ComponentText)); -/* harmony default export */ const model_ComponentLink = (ComponentLink); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentMap.ts -var ComponentMap_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentMap_assign = (undefined && undefined.__assign) || function () { - ComponentMap_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentMap_assign.apply(this, arguments); -}; - - -var ComponentMap = /** @class */ (function (_super) { - ComponentMap_extends(ComponentMap, _super); - function ComponentMap(props, opt) { - if (props === void 0) { props = {}; } - var _this = _super.call(this, props, opt) || this; - if (_this.get('src')) - _this.parseFromSrc(); - else - _this.updateSrc(); - _this.listenTo(_this, 'change:address change:zoom change:mapType', _this.updateSrc); - return _this; - } - Object.defineProperty(ComponentMap.prototype, "defaults", { - /** @ts-ignore */ - get: function () { - // @ts-ignore - var defs = _super.prototype.defaults; - return ComponentMap_assign(ComponentMap_assign({}, defs), { type: 'map', src: '', void: false, mapUrl: 'https://maps.google.com/maps', tagName: 'iframe', mapType: 'q', address: '', zoom: '1', attributes: { frameborder: 0 }, - // @ts-ignore - toolbar: defs.toolbar, traits: [ - { - label: 'Address', - name: 'address', - placeholder: 'eg. London, UK', - changeProp: true, - }, - { - type: 'select', - label: 'Map type', - name: 'mapType', - changeProp: true, - options: [ - { id: 'q', label: 'Roadmap' }, - { id: 'w', label: 'Satellite' }, - ], - }, - { - label: 'Zoom', - name: 'zoom', - type: 'range', - min: 1, - max: 20, - changeProp: true, - }, - ] }); - }, - enumerable: false, - configurable: true - }); - ComponentMap.prototype.updateSrc = function () { - this.set('src', this.getMapUrl()); - }; - /** - * Returns url of the map - * @return {string} - * @private - */ - ComponentMap.prototype.getMapUrl = function () { - var addr = this.get('address'); - var zoom = this.get('zoom'); - var type = this.get('mapType'); - addr = addr ? '&q=' + addr : ''; - zoom = zoom ? '&z=' + zoom : ''; - type = type ? '&t=' + type : ''; - var result = this.get('mapUrl') + '?' + addr + zoom + type; - result += '&output=embed'; - return result; - }; - /** - * Set attributes by src string - * @private - */ - ComponentMap.prototype.parseFromSrc = function () { - var uri = this.parseUri(this.get('src')); - var qr = uri.query; - if (qr.q) - this.set('address', qr.q); - if (qr.z) - this.set('zoom', qr.z); - if (qr.t) - this.set('mapType', qr.t); - }; - ComponentMap.isComponent = function (el) { - if ((0,mixins.toLowerCase)(el.tagName) == 'iframe' && /maps\.google\.com/.test(el.src)) { - return { type: 'map', src: el.src }; - } - }; - return ComponentMap; -}(model_ComponentImage)); -/* harmony default export */ const model_ComponentMap = (ComponentMap); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentScript.ts -var ComponentScript_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentScript_assign = (undefined && undefined.__assign) || function () { - ComponentScript_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentScript_assign.apply(this, arguments); -}; - - -var ComponentScript_type = 'script'; -var ComponentScript = /** @class */ (function (_super) { - ComponentScript_extends(ComponentScript, _super); - function ComponentScript() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ComponentScript.prototype, "defaults", { - get: function () { - return ComponentScript_assign(ComponentScript_assign({}, _super.prototype.defaults), { type: ComponentScript_type, tagName: ComponentScript_type, droppable: false, draggable: false, layerable: false, highlightable: false }); - }, - enumerable: false, - configurable: true - }); - ComponentScript.isComponent = function (el) { - return (0,mixins.toLowerCase)(el.tagName) === ComponentScript_type; - }; - return ComponentScript; -}(model_Component)); -/* harmony default export */ const model_ComponentScript = (ComponentScript); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentSvg.ts -var ComponentSvg_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentSvg_assign = (undefined && undefined.__assign) || function () { - ComponentSvg_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentSvg_assign.apply(this, arguments); -}; - - -var ComponentSvg_type = 'svg'; -var ComponentSvg = /** @class */ (function (_super) { - ComponentSvg_extends(ComponentSvg, _super); - function ComponentSvg() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ComponentSvg.prototype, "defaults", { - get: function () { - return ComponentSvg_assign(ComponentSvg_assign({}, _super.prototype.defaults), { type: ComponentSvg_type, tagName: ComponentSvg_type, highlightable: false, resizable: { ratioDefault: true } }); - }, - enumerable: false, - configurable: true - }); - ComponentSvg.prototype.getName = function () { - var name = this.get('tagName'); - var customName = this.get('custom-name'); - name = name.charAt(0).toUpperCase() + name.slice(1); - return customName || name; - }; - ComponentSvg.isComponent = function (el) { - return (0,mixins.toLowerCase)(el.tagName) === ComponentSvg_type; - }; - return ComponentSvg; -}(model_Component)); -/* harmony default export */ const model_ComponentSvg = (ComponentSvg); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentSvgIn.ts -var ComponentSvgIn_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentSvgIn_assign = (undefined && undefined.__assign) || function () { - ComponentSvgIn_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentSvgIn_assign.apply(this, arguments); -}; - -/** - * Component for inner SVG elements - */ -var ComponentSvgIn = /** @class */ (function (_super) { - ComponentSvgIn_extends(ComponentSvgIn, _super); - function ComponentSvgIn() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ComponentSvgIn.prototype, "defaults", { - get: function () { - return ComponentSvgIn_assign(ComponentSvgIn_assign({}, _super.prototype.defaults), { selectable: false, hoverable: false, layerable: false }); - }, - enumerable: false, - configurable: true - }); - ComponentSvgIn.isComponent = function (el, opts) { - if (opts === void 0) { opts = {}; } - return !!opts.inSvg; - }; - return ComponentSvgIn; -}(model_ComponentSvg)); -/* harmony default export */ const model_ComponentSvgIn = (ComponentSvgIn); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentTable.ts -var ComponentTable_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentTable_assign = (undefined && undefined.__assign) || function () { - ComponentTable_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentTable_assign.apply(this, arguments); -}; - - -var ComponentTable_type = 'table'; -var ComponentTable = /** @class */ (function (_super) { - ComponentTable_extends(ComponentTable, _super); - function ComponentTable(props, opt) { - if (props === void 0) { props = {}; } - var _this = _super.call(this, props, opt) || this; - var components = _this.get('components'); - !components.length && components.add({ type: 'tbody' }); - return _this; - } - Object.defineProperty(ComponentTable.prototype, "defaults", { - get: function () { - return ComponentTable_assign(ComponentTable_assign({}, _super.prototype.defaults), { type: ComponentTable_type, tagName: ComponentTable_type, droppable: ['tbody', 'thead', 'tfoot'] }); - }, - enumerable: false, - configurable: true - }); - ComponentTable.isComponent = function (el) { - return (0,mixins.toLowerCase)(el.tagName) === ComponentTable_type; - }; - return ComponentTable; -}(model_Component)); -/* harmony default export */ const model_ComponentTable = (ComponentTable); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentTableBody.ts -var ComponentTableBody_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentTableBody_assign = (undefined && undefined.__assign) || function () { - ComponentTableBody_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentTableBody_assign.apply(this, arguments); -}; - - -var ComponentTableBody_type = 'tbody'; -var ComponentTableBody = /** @class */ (function (_super) { - ComponentTableBody_extends(ComponentTableBody, _super); - function ComponentTableBody(props, opt) { - if (props === void 0) { props = {}; } - var _this = _super.call(this, props, opt) || this; - var components = _this.get('components'); - var columns = _this.get('columns'); - var rows = _this.get('rows'); - // Init components if empty - if (!components.length) { - var rowsToAdd = []; - while (rows--) { - var columnsToAdd = []; - var clm = columns; - while (clm--) { - columnsToAdd.push({ - type: 'cell', - classes: ['cell'], - }); - } - rowsToAdd.push({ - type: 'row', - classes: ['row'], - components: columnsToAdd, - }); - } - components.add(rowsToAdd); - } - return _this; - } - Object.defineProperty(ComponentTableBody.prototype, "defaults", { - get: function () { - return ComponentTableBody_assign(ComponentTableBody_assign({}, _super.prototype.defaults), { type: ComponentTableBody_type, tagName: ComponentTableBody_type, draggable: ['table'], droppable: ['tr'], columns: 1, rows: 1 }); - }, - enumerable: false, - configurable: true - }); - ComponentTableBody.isComponent = function (el) { - return (0,mixins.toLowerCase)(el.tagName) === ComponentTableBody_type; - }; - return ComponentTableBody; -}(model_Component)); -/* harmony default export */ const model_ComponentTableBody = (ComponentTableBody); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentTableCell.ts -var ComponentTableCell_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentTableCell_assign = (undefined && undefined.__assign) || function () { - ComponentTableCell_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentTableCell_assign.apply(this, arguments); -}; - - -var ComponentTableCell = /** @class */ (function (_super) { - ComponentTableCell_extends(ComponentTableCell, _super); - function ComponentTableCell() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ComponentTableCell.prototype, "defaults", { - get: function () { - return ComponentTableCell_assign(ComponentTableCell_assign({}, _super.prototype.defaults), { type: 'cell', tagName: 'td', draggable: ['tr'] }); - }, - enumerable: false, - configurable: true - }); - ComponentTableCell.isComponent = function (el) { - return ['td', 'th'].indexOf((0,mixins.toLowerCase)(el.tagName)) >= 0; - }; - return ComponentTableCell; -}(model_Component)); -/* harmony default export */ const model_ComponentTableCell = (ComponentTableCell); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentTableFoot.ts -var ComponentTableFoot_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentTableFoot_assign = (undefined && undefined.__assign) || function () { - ComponentTableFoot_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentTableFoot_assign.apply(this, arguments); -}; - - -var ComponentTableFoot_type = 'tfoot'; -var ComponentTableFoot = /** @class */ (function (_super) { - ComponentTableFoot_extends(ComponentTableFoot, _super); - function ComponentTableFoot() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ComponentTableFoot.prototype, "defaults", { - get: function () { - return ComponentTableFoot_assign(ComponentTableFoot_assign({}, _super.prototype.defaults), { type: ComponentTableFoot_type, tagName: ComponentTableFoot_type }); - }, - enumerable: false, - configurable: true - }); - ComponentTableFoot.isComponent = function (el) { - return (0,mixins.toLowerCase)(el.tagName) === ComponentTableFoot_type; - }; - return ComponentTableFoot; -}(model_ComponentTableBody)); -/* harmony default export */ const model_ComponentTableFoot = (ComponentTableFoot); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentTableHead.ts -var ComponentTableHead_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentTableHead_assign = (undefined && undefined.__assign) || function () { - ComponentTableHead_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentTableHead_assign.apply(this, arguments); -}; - - -var ComponentTableHead_type = 'thead'; -var ComponentTableHead = /** @class */ (function (_super) { - ComponentTableHead_extends(ComponentTableHead, _super); - function ComponentTableHead() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ComponentTableHead.prototype, "defaults", { - get: function () { - return ComponentTableHead_assign(ComponentTableHead_assign({}, _super.prototype.defaults), { type: ComponentTableHead_type, tagName: ComponentTableHead_type }); - }, - enumerable: false, - configurable: true - }); - ComponentTableHead.isComponent = function (el) { - return (0,mixins.toLowerCase)(el.tagName) === ComponentTableHead_type; - }; - return ComponentTableHead; -}(model_ComponentTableBody)); -/* harmony default export */ const model_ComponentTableHead = (ComponentTableHead); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentTableRow.ts -var ComponentTableRow_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentTableRow_assign = (undefined && undefined.__assign) || function () { - ComponentTableRow_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentTableRow_assign.apply(this, arguments); -}; - - -var tagName = 'tr'; -var ComponentTableRow = /** @class */ (function (_super) { - ComponentTableRow_extends(ComponentTableRow, _super); - function ComponentTableRow() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ComponentTableRow.prototype, "defaults", { - get: function () { - return ComponentTableRow_assign(ComponentTableRow_assign({}, _super.prototype.defaults), { tagName: tagName, draggable: ['thead', 'tbody', 'tfoot'], droppable: ['th', 'td'] }); - }, - enumerable: false, - configurable: true - }); - ComponentTableRow.isComponent = function (el) { - return (0,mixins.toLowerCase)(el.tagName) === tagName; - }; - return ComponentTableRow; -}(model_Component)); -/* harmony default export */ const model_ComponentTableRow = (ComponentTableRow); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentVideo.ts -var ComponentVideo_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentVideo_assign = (undefined && undefined.__assign) || function () { - ComponentVideo_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentVideo_assign.apply(this, arguments); -}; - - -var ComponentVideo_type = 'video'; -var yt = 'yt'; -var vi = 'vi'; -var ytnc = 'ytnc'; -var defProvider = 'so'; -var hasParam = function (value) { return value && value !== '0'; }; -var ComponentVideo = /** @class */ (function (_super) { - ComponentVideo_extends(ComponentVideo, _super); - function ComponentVideo(props, opt) { - if (props === void 0) { props = {}; } - var _this = _super.call(this, props, opt) || this; - if (_this.get('src')) - _this.parseFromSrc(); - _this.updatePropsFromAttr(); - _this.updateTraits(); - _this.on('change:provider', _this.updateTraits); - _this.on('change:videoId change:provider', _this.updateSrc); - return _this; - } - Object.defineProperty(ComponentVideo.prototype, "defaults", { - get: function () { - return ComponentVideo_assign(ComponentVideo_assign({}, _super.prototype.defaults), { type: ComponentVideo_type, tagName: ComponentVideo_type, videoId: '', void: false, provider: defProvider, ytUrl: 'https://www.youtube.com/embed/', ytncUrl: 'https://www.youtube-nocookie.com/embed/', viUrl: 'https://player.vimeo.com/video/', loop: false, poster: '', muted: 0, autoplay: false, controls: true, color: '', list: '', src: '', rel: 1, modestbranding: 0, sources: [], attributes: { allowfullscreen: 'allowfullscreen' } }); - }, - enumerable: false, - configurable: true - }); - ComponentVideo.prototype.updatePropsFromAttr = function () { - if (this.get('provider') === defProvider) { - var _a = this.get('attributes'), controls = _a.controls, autoplay = _a.autoplay, loop = _a.loop; - var toUp = {}; - if ((0,mixins.isDef)(controls)) - toUp.controls = !!controls; - if ((0,mixins.isDef)(autoplay)) - toUp.autoplay = !!autoplay; - if ((0,mixins.isDef)(loop)) - toUp.loop = !!loop; - if (!(0,mixins.isEmptyObj)(toUp)) { - this.set(toUp); - } - } - }; - /** - * Update traits by provider - * @private - */ - ComponentVideo.prototype.updateTraits = function () { - var em = this.em; - var prov = this.get('provider'); - var tagName = 'iframe'; - var traits; - switch (prov) { - case yt: - case ytnc: - traits = this.getYoutubeTraits(); - break; - case vi: - traits = this.getVimeoTraits(); - break; - default: - tagName = 'video'; - traits = this.getSourceTraits(); - } - this.set({ tagName: tagName }, { silent: true }); // avoid break in view - // @ts-ignore - this.set({ traits: traits }); - em.get('ready') && em.trigger('component:toggled'); - }; - /** - * Set attributes by src string - */ - ComponentVideo.prototype.parseFromSrc = function () { - var prov = this.get('provider'); - var uri = this.parseUri(this.get('src')); - var qr = uri.query; - switch (prov) { - case yt: - case ytnc: - case vi: - this.set('videoId', uri.pathname.split('/').pop()); - qr.list && this.set('list', qr.list); - hasParam(qr.autoplay) && this.set('autoplay', true); - hasParam(qr.loop) && this.set('loop', true); - parseInt(qr.controls) === 0 && this.set('controls', false); - hasParam(qr.color) && this.set('color', qr.color); - qr.rel === '0' && this.set('rel', 0); - qr.modestbranding === '1' && this.set('modestbranding', 1); - break; - default: - } - }; - /** - * Update src on change of video ID - * @private - */ - ComponentVideo.prototype.updateSrc = function () { - var prov = this.get('provider'); - var src = ''; - switch (prov) { - case yt: - src = this.getYoutubeSrc(); - break; - case ytnc: - src = this.getYoutubeNoCookieSrc(); - break; - case vi: - src = this.getVimeoSrc(); - break; - } - this.set({ src: src }); - }; - /** - * Returns object of attributes for HTML - * @return {Object} - * @private - */ - ComponentVideo.prototype.getAttrToHTML = function () { - var attr = _super.prototype.getAttrToHTML.call(this); - var prov = this.get('provider'); - switch (prov) { - case yt: - case ytnc: - case vi: - break; - default: - attr.loop = !!this.get('loop'); - attr.autoplay = !!this.get('autoplay'); - attr.controls = !!this.get('controls'); - } - return attr; - }; - // Listen provider change and switch traits, in TraitView listen traits change - /** - * Return the provider trait - * @return {Object} - * @private - */ - ComponentVideo.prototype.getProviderTrait = function () { - return { - type: 'select', - label: 'Provider', - name: 'provider', - changeProp: true, - options: [ - { value: 'so', name: 'HTML5 Source' }, - { value: yt, name: 'Youtube' }, - { value: ytnc, name: 'Youtube (no cookie)' }, - { value: vi, name: 'Vimeo' }, - ], - }; - }; - /** - * Return traits for the source provider - * @return {Array} - * @private - */ - ComponentVideo.prototype.getSourceTraits = function () { - return [ - this.getProviderTrait(), - { - label: 'Source', - name: 'src', - placeholder: 'eg. ./media/video.mp4', - changeProp: true, - }, - { - label: 'Poster', - name: 'poster', - placeholder: 'eg. ./media/image.jpg', - }, - this.getAutoplayTrait(), - this.getLoopTrait(), - this.getControlsTrait(), - ]; - }; - /** - * Return traits for the source provider - * @return {Array} - * @private - */ - ComponentVideo.prototype.getYoutubeTraits = function () { - return [ - this.getProviderTrait(), - { - label: 'Video ID', - name: 'videoId', - placeholder: 'eg. jNQXAC9IVRw', - changeProp: true, - }, - this.getAutoplayTrait(), - this.getLoopTrait(), - this.getControlsTrait(), - { - type: 'checkbox', - label: 'Related', - name: 'rel', - changeProp: true, - }, - { - type: 'checkbox', - label: 'Modest', - name: 'modestbranding', - changeProp: true, - }, - ]; - }; - /** - * Return traits for the source provider - * @return {Array} - * @private - */ - ComponentVideo.prototype.getVimeoTraits = function () { - return [ - this.getProviderTrait(), - { - label: 'Video ID', - name: 'videoId', - placeholder: 'eg. 123456789', - changeProp: true, - }, - { - label: 'Color', - name: 'color', - placeholder: 'eg. FF0000', - changeProp: true, - }, - this.getAutoplayTrait(), - this.getLoopTrait(), - ]; - }; - /** - * Return object trait - * @return {Object} - * @private - */ - ComponentVideo.prototype.getAutoplayTrait = function () { - return { - type: 'checkbox', - label: 'Autoplay', - name: 'autoplay', - changeProp: true, - }; - }; - /** - * Return object trait - * @return {Object} - * @private - */ - ComponentVideo.prototype.getLoopTrait = function () { - return { - type: 'checkbox', - label: 'Loop', - name: 'loop', - changeProp: true, - }; - }; - /** - * Return object trait - * @return {Object} - * @private - */ - ComponentVideo.prototype.getControlsTrait = function () { - return { - type: 'checkbox', - label: 'Controls', - name: 'controls', - changeProp: true, - }; - }; - /** - * Returns url to youtube video - * @return {string} - * @private - */ - ComponentVideo.prototype.getYoutubeSrc = function () { - var id = this.get('videoId'); - var url = this.get('ytUrl'); - var list = this.get('list'); - url += id + (id.indexOf('?') < 0 ? '?' : ''); - url += list ? "&list=".concat(list) : ''; - url += this.get('autoplay') ? '&autoplay=1&mute=1' : ''; - url += !this.get('controls') ? '&controls=0&showinfo=0' : ''; - // Loop works only with playlist enabled - // https://stackoverflow.com/questions/25779966/youtube-iframe-loop-doesnt-work - url += this.get('loop') ? "&loop=1&playlist=".concat(id) : ''; - url += this.get('rel') ? '' : '&rel=0'; - url += this.get('modestbranding') ? '&modestbranding=1' : ''; - return url; - }; - /** - * Returns url to youtube no cookie video - * @return {string} - * @private - */ - ComponentVideo.prototype.getYoutubeNoCookieSrc = function () { - var url = this.getYoutubeSrc(); - url = url.replace(this.get('ytUrl'), this.get('ytncUrl')); - return url; - }; - /** - * Returns url to vimeo video - * @return {string} - * @private - */ - ComponentVideo.prototype.getVimeoSrc = function () { - var url = this.get('viUrl'); - url += this.get('videoId') + '?'; - url += this.get('autoplay') ? '&autoplay=1&muted=1' : ''; - url += this.get('loop') ? '&loop=1' : ''; - url += !this.get('controls') ? '&title=0&portrait=0&badge=0' : ''; - url += this.get('color') ? '&color=' + this.get('color') : ''; - return url; - }; - ComponentVideo.isComponent = function (el) { - var tagName = el.tagName, src = el.src; - var isYtProv = /youtube\.com\/embed/.test(src); - var isYtncProv = /youtube-nocookie\.com\/embed/.test(src); - var isViProv = /player\.vimeo\.com\/video/.test(src); - var isExtProv = isYtProv || isYtncProv || isViProv; - if ((0,mixins.toLowerCase)(tagName) == ComponentVideo_type || ((0,mixins.toLowerCase)(tagName) == 'iframe' && isExtProv)) { - var result = { type: 'video' }; - if (src) - result.src = src; - if (isExtProv) { - if (isYtProv) - result.provider = yt; - else if (isYtncProv) - result.provider = ytnc; - else if (isViProv) - result.provider = vi; - } - return result; - } - }; - return ComponentVideo; -}(model_ComponentImage)); -/* harmony default export */ const model_ComponentVideo = (ComponentVideo); - -;// CONCATENATED MODULE: ./src/dom_components/model/ComponentWrapper.ts -var ComponentWrapper_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentWrapper_assign = (undefined && undefined.__assign) || function () { - ComponentWrapper_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentWrapper_assign.apply(this, arguments); -}; - - - - -var ComponentWrapper = /** @class */ (function (_super) { - ComponentWrapper_extends(ComponentWrapper, _super); - function ComponentWrapper() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var _a, _b; - var _this = _super.apply(this, args) || this; - var opts = args[1]; - var cmp = (_a = opts === null || opts === void 0 ? void 0 : opts.em) === null || _a === void 0 ? void 0 : _a.Components; - var CmpHead = (_b = cmp === null || cmp === void 0 ? void 0 : cmp.getType(type)) === null || _b === void 0 ? void 0 : _b.model; - var CmpDef = cmp === null || cmp === void 0 ? void 0 : cmp.getType('default').model; - if (CmpHead) { - _this.set({ - head: new CmpHead({}, opts), - docEl: new CmpDef({ tagName: 'html' }, opts), - }, { silent: true }); - } - return _this; - } - Object.defineProperty(ComponentWrapper.prototype, "defaults", { - get: function () { - return ComponentWrapper_assign(ComponentWrapper_assign({}, _super.prototype.defaults), { tagName: 'body', removable: false, copyable: false, draggable: false, components: [], traits: [], doctype: '', head: null, docEl: null, stylable: [ - 'background', - 'background-color', - 'background-image', - 'background-repeat', - 'background-attachment', - 'background-position', - 'background-size', - ] }); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ComponentWrapper.prototype, "head", { - get: function () { - return this.get('head'); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ComponentWrapper.prototype, "docEl", { - get: function () { - return this.get('docEl'); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ComponentWrapper.prototype, "doctype", { - get: function () { - return this.attributes.doctype || ''; - }, - enumerable: false, - configurable: true - }); - ComponentWrapper.prototype.toHTML = function (opts) { - if (opts === void 0) { opts = {}; } - var doctype = this.doctype; - var asDoc = !(0,index_all.isUndefined)(opts.asDocument) ? opts.asDocument : !!doctype; - var _a = this, head = _a.head, docEl = _a.docEl; - var body = _super.prototype.toHTML.call(this, opts); - var headStr = (asDoc && (head === null || head === void 0 ? void 0 : head.toHTML(opts))) || ''; - var docElAttr = (asDoc && (0,dom/* attrToString */.nB)(docEl === null || docEl === void 0 ? void 0 : docEl.getAttrToHTML())) || ''; - var docElAttrStr = docElAttr ? " ".concat(docElAttr) : ''; - return asDoc ? "".concat(doctype, "").concat(headStr).concat(body, "") : body; - }; - ComponentWrapper.prototype.__postAdd = function () { - var _a; - var um = (_a = this.em) === null || _a === void 0 ? void 0 : _a.UndoManager; - !this.__hasUm && (um === null || um === void 0 ? void 0 : um.add(this)); - return _super.prototype.__postAdd.call(this); - }; - ComponentWrapper.prototype.__postRemove = function () { - var _a; - var um = (_a = this.em) === null || _a === void 0 ? void 0 : _a.UndoManager; - um === null || um === void 0 ? void 0 : um.remove(this); - return _super.prototype.__postRemove.call(this); - }; - ComponentWrapper.isComponent = function () { - return false; - }; - return ComponentWrapper; -}(model_Component)); -/* harmony default export */ const model_ComponentWrapper = (ComponentWrapper); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentsView.ts -var ComponentsView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var ComponentsView = /** @class */ (function (_super) { - ComponentsView_extends(ComponentsView, _super); - function ComponentsView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.compView = view_ComponentView; - return _this; - } - ComponentsView.prototype.initialize = function (o) { - this.opts = o || {}; - this.config = o.config || {}; - // @ts-ignore - this.em = this.config.em; - var coll = this.collection; - this.listenTo(coll, 'add', this.addTo); - this.listenTo(coll, 'reset', this.resetChildren); - this.listenTo(coll, 'remove', this.removeChildren); - }; - ComponentsView.prototype.removeChildren = function (removed, coll, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - removed.views.forEach(function (view) { - if (!view) - return; - var childrenView = view.childrenView, scriptContainer = view.scriptContainer; - childrenView && childrenView.stopListening(); - (0,dom/* removeEl */.L_)(scriptContainer); - view.remove.apply(view); - }); - var inner = removed.components(); - inner.forEach(function (it) { return _this.removeChildren(it, coll, opts); }); - }; - /** - * Add to collection - * @param {Model} model - * @param {Collection} coll - * @param {Object} opts - * @private - * */ - ComponentsView.prototype.addTo = function (model) { - this.addToCollection(model, null, this.collection.indexOf(model)); - }; - /** - * Add new object to collection - * @param {Object} Model - * @param {Object} Fragment collection - * @param {Integer} Index of append - * - * @return {Object} Object rendered - * @private - * */ - ComponentsView.prototype.addToCollection = function (model, fragment, index) { - var _a = this, config = _a.config, opts = _a.opts, em = _a.em; - var frameView = config.frameView; - var sameFrameView = (frameView === null || frameView === void 0 ? void 0 : frameView.model) && model.getView(frameView.model); - var dt = opts.componentTypes || (em === null || em === void 0 ? void 0 : em.Components.getTypes()); - var type = model.get('type') || 'default'; - var viewObject = this.compView; - for (var it_1 = 0; it_1 < dt.length; it_1++) { - if (dt[it_1].id == type) { - viewObject = dt[it_1].view; - break; - } - } - var view = sameFrameView || - new viewObject({ - model: model, - // @ts-ignore - config: config, - componentTypes: dt, - }); - var rendered; - try { - // Avoid breaking on DOM rendering (eg. invalid attribute name) - rendered = view.render().el; - } - catch (error) { - rendered = document.createTextNode(''); - em.logError(error); - } - if (fragment) { - fragment.appendChild(rendered); - } - else { - var parent_1 = this.parentEl; - var children = parent_1.childNodes; - if (!(0,index_all.isUndefined)(index)) { - var lastIndex = children.length == index; - // If the added model is the last of collection - // need to change the logic of append - if (lastIndex) { - index--; - } - // In case the added is new in the collection index will be -1 - if (lastIndex || !children.length) { - parent_1.appendChild(rendered); - } - else { - parent_1.insertBefore(rendered, children[index]); - } - } - else { - parent_1.appendChild(rendered); - } - } - if (!model.opt.temporary) { - em === null || em === void 0 ? void 0 : em.trigger('component:mount', model); - } - return rendered; - }; - ComponentsView.prototype.resetChildren = function (models, _a) { - var _this = this; - var _b = _a === void 0 ? {} : _a, _c = _b.previousModels, previousModels = _c === void 0 ? [] : _c; - this.parentEl.innerHTML = ''; - previousModels.forEach(function (md) { return _this.removeChildren(md, _this.collection); }); - models.each(function (model) { return _this.addToCollection(model); }); - }; - ComponentsView.prototype.render = function (parent) { - var _this = this; - var el = this.el; - var frag = document.createDocumentFragment(); - this.parentEl = parent || this.el; - this.collection.each(function (model) { return _this.addToCollection(model, frag); }); - el.innerHTML = ''; - el.appendChild(frag); - return this; - }; - return ComponentsView; -}(common/* View */.G7)); -/* harmony default export */ const view_ComponentsView = (ComponentsView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentView.ts -var ComponentView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentView_assign = (undefined && undefined.__assign) || function () { - ComponentView_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentView_assign.apply(this, arguments); -}; - - - - - - - - - -var ComponentView = /** @class */ (function (_super) { - ComponentView_extends(ComponentView, _super); - function ComponentView() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** @ts-ignore */ - ComponentView.prototype.className = function () { - return this.getClasses(); - }; - /** @ts-ignore */ - ComponentView.prototype.tagName = function () { - return this.model.get('tagName'); - }; - ComponentView.prototype.preinitialize = function (opt) { - if (opt === void 0) { opt = {}; } - this.opts = opt; - }; - ComponentView.prototype.initialize = function (opt) { - if (opt === void 0) { opt = {}; } - var model = this.model; - var config = opt.config || {}; - var em = config.em; - var modelOpt = model.opt || {}; - var _a = this, $el = _a.$el, el = _a.el; - this.opts = opt; - this.modelOpt = modelOpt; - this.config = config; - this.em = em; - this.pfx = config.stylePrefix || ''; - this.ppfx = config.pStylePrefix || ''; - this.attr = model.get('attributes'); - this.classe = this.attr.class || []; - this.listenTo(model, 'change:style', this.updateStyle); - this.listenTo(model, 'change:attributes', this.renderAttributes); - this.listenTo(model, 'change:highlightable', this.updateHighlight); - this.listenTo(model, 'change:status change:locked', this.updateStatus); - this.listenTo(model, 'change:script rerender', this.reset); - this.listenTo(model, 'change:content', this.updateContent); - this.listenTo(model, 'change', this.handleChange); - this.listenTo(model, 'active', this.onActive); - this.listenTo(model, 'disable', this.onDisable); - $el.data('model', model); - (0,mixins.setViewEl)(el, this); - model.view = this; - this.frameView && model.views.push(this); - this.initClasses(); - this.initComponents({ avoidRender: true }); - this.events = ComponentView_assign(ComponentView_assign({}, this.constructor.getEvents()), { dragstart: 'handleDragStart' }); - this.delegateEvents(); - !modelOpt.temporary && this.init(this._clbObj()); - }; - Object.defineProperty(ComponentView.prototype, "__cmpStyleOpts", { - get: function () { - return { state: '', mediaText: '' }; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ComponentView.prototype, "frameView", { - get: function () { - return this.opts.config.frameView; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(ComponentView.prototype, "createDoc", { - get: function () { - var _a, _b; - var doc = ((_a = this.frameView) === null || _a === void 0 ? void 0 : _a.getDoc()) || document; - return ((_b = this.opts.config) === null || _b === void 0 ? void 0 : _b.useFrameDoc) ? doc : document; - }, - enumerable: false, - configurable: true - }); - ComponentView.prototype.__isDraggable = function () { - var _a = this, model = _a.model, config = _a.config; - var draggable = model.attributes.draggable; - return config.draggableComponents && draggable; - }; - ComponentView.prototype._clbObj = function () { - var _a = this, em = _a.em, model = _a.model, el = _a.el; - return { - editor: em === null || em === void 0 ? void 0 : em.getEditor(), - model: model, - el: el, - }; - }; - /** - * Initialize callback - */ - ComponentView.prototype.init = function (opts) { }; - /** - * Remove callback - */ - ComponentView.prototype.removed = function (opts) { }; - /** - * On render callback - */ - ComponentView.prototype.onRender = function (opts) { }; - /** - * Callback executed when the `active` event is triggered on component - */ - ComponentView.prototype.onActive = function (ev) { }; - /** - * Callback executed when the `disable` event is triggered on component - */ - ComponentView.prototype.onDisable = function (opts) { }; - ComponentView.prototype.remove = function () { - var _a; - _super.prototype.remove.call(this); - var _b = this, model = _b.model, $el = _b.$el; - var views = model.views; - var frame = this.frameView || {}; - model.components().forEach(function (comp) { - var view = comp.getView(frame.model); - view === null || view === void 0 ? void 0 : view.remove(); - }); - (_a = this.childrenView) === null || _a === void 0 ? void 0 : _a.remove(); - views.splice(views.indexOf(this), 1); - this.removed(this._clbObj()); - $el.data({ model: '', collection: '', view: '' }); - // delete model.view; // Sorter relies on this property - return this; - }; - ComponentView.prototype.handleDragStart = function (event) { - if (!this.__isDraggable()) - return false; - event.stopPropagation(); - event.preventDefault(); - this.em.Commands.run('tlb-move', { - target: this.model, - event: event, - }); - }; - ComponentView.prototype.initClasses = function () { - var model = this.model; - var classes = model.classes; - var event = 'change:classes'; - if (classes instanceof model_Selectors) { - this.stopListening(model, event, this.initClasses); - this.listenTo(model, event, this.initClasses); - this.listenTo(classes, 'add remove change reset', this.updateClasses); - classes.length && this.importClasses(); - } - }; - ComponentView.prototype.initComponents = function (opts) { - if (opts === void 0) { opts = {}; } - var _a = this, model = _a.model, $el = _a.$el, childrenView = _a.childrenView; - var event = 'change:components'; - var comps = model.get('components'); - var toListen = [model, event, this.initComponents]; - if (comps instanceof model_Components) { - $el.data('collection', comps); - childrenView && childrenView.remove(); - this.stopListening.apply(this, toListen); - !opts.avoidRender && this.renderChildren(); - // @ts-ignore - this.listenTo.apply(this, toListen); - } - }; - /** - * Handle any property change - * @private - */ - ComponentView.prototype.handleChange = function () { - var model = this.model; - var chgArr = (0,index_all.keys)(model.changed); - if (chgArr.length === 1 && chgArr[0] === 'status') - return; - model.emitUpdate(); - for (var prop in model.changed) { - model.emitUpdate(prop); - } - }; - /** - * Import, if possible, classes inside main container - * @private - * */ - ComponentView.prototype.importClasses = function () { - var _a = this, em = _a.em, model = _a.model; - var sm = em.Selectors; - sm && model.classes.forEach(function (s) { return sm.add(s.getName()); }); - }; - /** - * Update item on status change - * @param {Event} e - * @private - * */ - ComponentView.prototype.updateStatus = function (opts) { - if (opts === void 0) { opts = {}; } - var _a = this, em = _a.em, el = _a.el, ppfx = _a.ppfx, model = _a.model; - var canvas = em === null || em === void 0 ? void 0 : em.Canvas; - var extHl = canvas === null || canvas === void 0 ? void 0 : canvas.config.extHl; - var status = model.get('status'); - var selectedCls = "".concat(ppfx, "selected"); - var selectedParentCls = "".concat(selectedCls, "-parent"); - var freezedCls = "".concat(ppfx, "freezed"); - var hoveredCls = "".concat(ppfx, "hovered"); - var noPointerCls = "".concat(ppfx, "no-pointer"); - var pointerInitCls = "".concat(ppfx, "pointer-init"); - var toRemove = [selectedCls, selectedParentCls, freezedCls, hoveredCls, noPointerCls]; - var selCls = extHl && !opts.noExtHl ? '' : selectedCls; - this.$el.removeClass(toRemove.join(' ')); - var actualCls = el.getAttribute('class') || ''; - var cls = [actualCls]; - var noCustomSpotSelect = !(canvas === null || canvas === void 0 ? void 0 : canvas.hasCustomSpot(CanvasSpot/* CanvasSpotBuiltInTypes */.q.Select)); - var noCustomSpotTarget = !(canvas === null || canvas === void 0 ? void 0 : canvas.hasCustomSpot(CanvasSpot/* CanvasSpotBuiltInTypes */.q.Target)); - switch (status) { - case 'selected': - noCustomSpotSelect && cls.push(selCls); - break; - case 'selected-parent': - noCustomSpotTarget && cls.push(selectedParentCls); - break; - case 'freezed': - cls.push(freezedCls); - break; - case 'freezed-selected': - cls.push(freezedCls); - noCustomSpotSelect && cls.push(selCls); - break; - case 'hovered': - !opts.avoidHover && cls.push(hoveredCls); - break; - } - if ((0,index_all.isBoolean)(model.locked)) { - cls.push(model.locked ? noPointerCls : pointerInitCls); - } - var clsStr = cls.filter(Boolean).join(' '); - clsStr && el.setAttribute('class', clsStr); - }; - /** - * Update highlight attribute - * @private - * */ - ComponentView.prototype.updateHighlight = function () { - var model = this.model; - var isTextable = model.get('textable'); - var hl = model.get('highlightable') && (isTextable || !model.isChildOf('text')); - this.setAttribute('data-gjs-highlightable', hl ? true : ''); - }; - /** - * Update style attribute - * @private - * */ - ComponentView.prototype.updateStyle = function (m, v, opts) { - if (opts === void 0) { opts = {}; } - var _a = this, model = _a.model, em = _a.em; - if (avoidInline(em) && !opts.inline) { - // Move inline styles to CSSRule - var styleOpts = this.__cmpStyleOpts; - var style = model.getStyle(ComponentView_assign({ inline: true }, styleOpts)); - !(0,index_all.isEmpty)(style) && model.setStyle(style, styleOpts); - } - else { - this.setAttribute('style', model.styleToString(opts)); - } - }; - /** - * Update classe attribute - * @private - * */ - ComponentView.prototype.updateClasses = function () { - var str = this.model.classes.pluck('name').join(' '); - this.setAttribute('class', str); - // Regenerate status class - this.updateStatus(); - this.onAttrUpdate(); - }; - /** - * Update single attribute - * @param {[type]} name [description] - * @param {[type]} value [description] - */ - ComponentView.prototype.setAttribute = function (name, value) { - var el = this.$el; - value ? el.attr(name, value) : el.removeAttr(name); - }; - /** - * Get classes from attributes. - * This method is called before initialize - * - * @return {Array}|null - * @private - * */ - ComponentView.prototype.getClasses = function () { - return this.model.getClasses().join(' '); - }; - /** - * Update attributes - * @private - * */ - ComponentView.prototype.updateAttributes = function () { - var attrs = []; - var _a = this, model = _a.model, $el = _a.$el, el = _a.el; - var _b = model.attributes, textable = _b.textable, type = _b.type; - var defaultAttr = ComponentView_assign(ComponentView_assign({ id: model.getId(), 'data-gjs-type': type || 'default' }, (this.__isDraggable() && { draggable: true })), (textable && { contenteditable: 'false' })); - // Remove all current attributes - (0,index_all.each)(el.attributes, function (attr) { return attrs.push(attr.nodeName); }); - attrs.forEach(function (attr) { return $el.removeAttr(attr); }); - this.updateStyle(); - this.updateHighlight(); - var attr = ComponentView_assign(ComponentView_assign({}, defaultAttr), model.getAttributes()); - // Remove all `false` attributes - (0,index_all.keys)(attr).forEach(function (key) { return attr[key] === false && delete attr[key]; }); - $el.attr(attr); - }; - /** - * Update component content - * @private - * */ - ComponentView.prototype.updateContent = function () { - var content = this.model.content; - var hasComps = this.model.components().length; - this.getChildrenContainer().innerHTML = hasComps ? '' : content; - }; - /** - * Prevent default helper - * @param {Event} e - * @private - */ - ComponentView.prototype.prevDef = function (e) { - e.preventDefault(); - }; - /** - * Render component's script - * @private - */ - ComponentView.prototype.updateScript = function () { - var _a = this, model = _a.model, em = _a.em; - if (!model.get('script')) - return; - em === null || em === void 0 ? void 0 : em.Canvas.getCanvasView().updateScript(this); - }; - /** - * Return children container - * Differently from a simple component where children container is the - * component itself - * - * - * - * You could have the children container more deeper - * - *
- *
- *
- *
- * - *
- *
- *
- * @return HTMLElement - * @private - */ - ComponentView.prototype.getChildrenContainer = function () { - var container = this.el; - if (typeof this.getChildrenSelector == 'function') { - container = this.el.querySelector(this.getChildrenSelector()); - } - else if (typeof this.getTemplate == 'function') { - // Need to find deepest first child - } - return container; - }; - /** - * This returns rect informations not affected by the canvas zoom. - * The method `getBoundingClientRect` doesn't work here and we - * have to take in account offsetParent - */ - ComponentView.prototype.getOffsetRect = function () { - var rect = { top: 0, left: 0, bottom: 0, right: 0 }; - var target = this.el; - var gtop = 0; - var gleft = 0; - var assignRect = function (el) { - var offsetParent = el.offsetParent; - if (offsetParent) { - gtop += offsetParent.offsetTop; - gleft += offsetParent.offsetLeft; - assignRect(offsetParent); - } - else { - rect.top = target.offsetTop + gtop; - rect.left = target.offsetLeft + gleft; - rect.bottom = rect.top + target.offsetHeight; - rect.right = rect.left + target.offsetWidth; - } - }; - assignRect(target); - return rect; - }; - ComponentView.prototype.isInViewport = function () { - var _a = this, el = _a.el, em = _a.em, frameView = _a.frameView; - var canvasView = em.Canvas.getCanvasView(); - var elRect = canvasView.getElBoxRect(el, { local: true }); - var frameEl = frameView.el; - var frameH = frameEl.clientHeight; - var frameW = frameEl.clientWidth; - var elTop = elRect.y; - var elRight = elRect.x; - var elBottom = elTop + elRect.height; - var elLeft = elRight + elRect.width; - var isTopInside = elTop >= 0 && elTop < frameH; - var isBottomInside = elBottom > 0 && elBottom < frameH; - var isLeftInside = elLeft >= 0 && elLeft < frameW; - var isRightInside = elRight > 0 && elRight <= frameW; - var partiallyIn = (isTopInside || isBottomInside) && (isLeftInside || isRightInside); - return partiallyIn; - }; - ComponentView.prototype.scrollIntoView = function (opts) { - var _a; - if (opts === void 0) { opts = {}; } - var isInViewport = this.isInViewport(); - if (!isInViewport || opts.force) { - var el = this.el; - // PATCH: scrollIntoView won't work with multiple requests from iframes - if (opts.behavior !== 'smooth') { - var rect = this.getOffsetRect(); - (_a = el.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.scrollTo(0, rect.top); - } - else { - el.scrollIntoView(ComponentView_assign({ behavior: 'smooth', block: 'nearest' }, opts)); - } - } - }; - /** - * Recreate the element of the view - */ - ComponentView.prototype.reset = function () { - var el = this.el; - // @ts-ignore - this.el = ''; - this._ensureElement(); - this._setData(); - (0,dom/* replaceWith */.dL)(el, this.el); - this.render(); - }; - ComponentView.prototype._setData = function () { - var model = this.model; - var collection = model.components(); - var view = this; - this.$el.data({ model: model, collection: collection, view: view }); - }; - ComponentView.prototype._createElement = function (tagName) { - return this.createDoc.createElement(tagName); - }; - /** - * Render children components - * @private - */ - ComponentView.prototype.renderChildren = function () { - this.updateContent(); - var container = this.getChildrenContainer(); - var view = this.childrenView || - new view_ComponentsView({ - // @ts-ignore - collection: this.model.get('components'), - config: this.config, - componentTypes: this.opts.componentTypes, - }); - view.render(container); - this.childrenView = view; - var childNodes = Array.prototype.slice.call(view.el.childNodes); - for (var i = 0, len = childNodes.length; i < len; i++) { - container.appendChild(childNodes.shift()); - } - }; - ComponentView.prototype.renderAttributes = function () { - this.updateAttributes(); - this.updateClasses(); - }; - ComponentView.prototype.onAttrUpdate = function () { }; - ComponentView.prototype.render = function () { - this.renderAttributes(); - if (this.modelOpt.temporary) - return this; - this.renderChildren(); - this.updateScript(); - (0,mixins.setViewEl)(this.el, this); - this.postRender(); - return this; - }; - ComponentView.prototype.postRender = function () { - if (!this.modelOpt.temporary) { - this.onRender(this._clbObj()); - } - }; - ComponentView.getEvents = function () { - return (0,index_all.result)(this.prototype, 'events'); - }; - return ComponentView; -}(common/* View */.G7)); -/* harmony default export */ const view_ComponentView = (ComponentView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentTextNodeView.ts -var ComponentTextNodeView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ComponentTextNodeView = /** @class */ (function (_super) { - ComponentTextNodeView_extends(ComponentTextNodeView, _super); - function ComponentTextNodeView() { - return _super !== null && _super.apply(this, arguments) || this; - } - // Clear methods used on Nodes with attributes - ComponentTextNodeView.prototype._setAttributes = function () { }; - ComponentTextNodeView.prototype.renderAttributes = function () { }; - ComponentTextNodeView.prototype.updateStatus = function () { }; - ComponentTextNodeView.prototype.updateClasses = function () { }; - ComponentTextNodeView.prototype.setAttribute = function () { }; - ComponentTextNodeView.prototype.updateAttributes = function () { }; - ComponentTextNodeView.prototype.initClasses = function () { }; - ComponentTextNodeView.prototype.initComponents = function () { }; - ComponentTextNodeView.prototype.delegateEvents = function () { - return this; - }; - ComponentTextNodeView.prototype._createElement = function () { - return document.createTextNode(''); - }; - ComponentTextNodeView.prototype.render = function () { - var _a = this, model = _a.model, el = _a.el; - if (model.opt.temporary) - return this; - el.textContent = model.content; - return this; - }; - return ComponentTextNodeView; -}(view_ComponentView)); -/* harmony default export */ const view_ComponentTextNodeView = (ComponentTextNodeView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentCommentView.ts -var ComponentCommentView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ComponentCommentView = /** @class */ (function (_super) { - ComponentCommentView_extends(ComponentCommentView, _super); - function ComponentCommentView() { - return _super !== null && _super.apply(this, arguments) || this; - } - ComponentCommentView.prototype._createElement = function () { - return document.createComment(this.model.content); - }; - return ComponentCommentView; -}(view_ComponentTextNodeView)); -/* harmony default export */ const view_ComponentCommentView = (ComponentCommentView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentFrameView.ts -var ComponentFrameView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var ComponentFrameView = /** @class */ (function (_super) { - ComponentFrameView_extends(ComponentFrameView, _super); - function ComponentFrameView() { - return _super !== null && _super.apply(this, arguments) || this; - } - ComponentFrameView.prototype.tagName = function () { - return 'div'; - }; - ComponentFrameView.prototype.initialize = function (props) { - _super.prototype.initialize.call(this, props); - this.listenTo(this.model, 'change:attributes:src', this.updateSrc); - }; - ComponentFrameView.prototype.updateSrc = function () { - var frame = (0,dom/* find */.sE)(this.el, 'iframe')[0]; - frame && (0,dom/* attrUp */.FW)(frame, { src: this.__getSrc() }); - }; - ComponentFrameView.prototype.render = function () { - _super.prototype.render.call(this); - var frame = (0,dom/* createEl */.ut)('iframe', { - class: "".concat(this.ppfx, "no-pointer"), - style: 'width: 100%; height: 100%; border: none', - src: this.__getSrc(), - }); - this.el.appendChild(frame); - return this; - }; - ComponentFrameView.prototype.__getSrc = function () { - return this.model.getAttributes().src || ''; - }; - return ComponentFrameView; -}(view_ComponentView)); -/* harmony default export */ const view_ComponentFrameView = (ComponentFrameView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentImageView.ts -var ComponentImageView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var ComponentImageView = /** @class */ (function (_super) { - ComponentImageView_extends(ComponentImageView, _super); - function ComponentImageView() { - return _super !== null && _super.apply(this, arguments) || this; - } - ComponentImageView.prototype.tagName = function () { - return 'img'; - }; - ComponentImageView.prototype.events = function () { - return { - dblclick: 'onActive', - click: 'initResize', - error: 'onError', - load: 'onLoad', - dragstart: 'noDrag', - }; - }; - ComponentImageView.prototype.initialize = function (props) { - _super.prototype.initialize.call(this, props); - this.listenTo(this.model, 'change:src', this.updateSrc); - this.classEmpty = "".concat(this.ppfx, "plh-image"); - this.fetchFile(); - }; - /** - * Fetch file if exists - */ - ComponentImageView.prototype.fetchFile = function () { - if (this.modelOpt.temporary) - return; - var _a = this, model = _a.model, em = _a.em; - var file = model.get('file'); - if (file && em) { - var fu = em.Assets.FileUploader(); - fu === null || fu === void 0 ? void 0 : fu.uploadFile({ - // @ts-ignore - dataTransfer: { files: [file] }, - }, function (res) { - var obj = res && res.data && res.data[0]; - var src = obj && ((0,index_all.isString)(obj) ? obj : obj.src); - src && model.set({ src: src }); - }); - model.set('file', ''); - } - }; - /** - * Update src attribute - * @private - * */ - ComponentImageView.prototype.updateSrc = function () { - var model = this.model; - model.addAttributes({ src: model.getSrcResult() }); - this.updateClasses(); - }; - ComponentImageView.prototype.updateClasses = function () { - _super.prototype.updateClasses.call(this); - var _a = this, el = _a.el, classEmpty = _a.classEmpty, model = _a.model; - var srcExists = model.getSrcResult() && !model.isDefaultSrc(); - var method = srcExists ? 'remove' : 'add'; - el.classList[method](classEmpty); - }; - /** - * Open dialog for image changing - * @param {Object} e Event - * @private - * */ - ComponentImageView.prototype.onActive = function (ev) { - ev === null || ev === void 0 ? void 0 : ev.stopPropagation(); - var _a = this, em = _a.em, model = _a.model; - var am = em === null || em === void 0 ? void 0 : em.Assets; - if (am && model.get('editable')) { - am.open({ - select: function (asset, complete) { - model.set({ src: asset.getSrc() }); - complete && am.close(); - }, - target: model, - types: ['image'], - accept: 'image/*', - }); - } - }; - ComponentImageView.prototype.onError = function () { - var fallback = this.model.getSrcResult({ fallback: true }); - if (fallback) { - this.el.src = fallback; - } - }; - ComponentImageView.prototype.onLoad = function () { - // Used to update component tools box (eg. toolbar, resizer) once the image is loaded - this.em.Canvas.refresh({ all: true }); - }; - ComponentImageView.prototype.noDrag = function (ev) { - ev.preventDefault(); - return false; - }; - ComponentImageView.prototype.render = function () { - this.renderAttributes(); - if (this.modelOpt.temporary) - return this; - this.updateSrc(); - var _a = this, $el = _a.$el, model = _a.model; - var cls = $el.attr('class') || ''; - !model.get('src') && $el.attr('class', "".concat(cls, " ").concat(this.classEmpty).trim()); - this.postRender(); - return this; - }; - return ComponentImageView; -}(view_ComponentView)); -/* harmony default export */ const view_ComponentImageView = (ComponentImageView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentTextView.ts -var ComponentTextView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ComponentTextView_assign = (undefined && undefined.__assign) || function () { - ComponentTextView_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return ComponentTextView_assign.apply(this, arguments); -}; -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (undefined && undefined.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; - - - - - -var ComponentTextView = /** @class */ (function (_super) { - ComponentTextView_extends(ComponentTextView, _super); - function ComponentTextView() { - return _super !== null && _super.apply(this, arguments) || this; - } - ComponentTextView.prototype.events = function () { - return { - dblclick: 'onActive', - input: 'onInput', - }; - }; - ComponentTextView.prototype.initialize = function (props) { - _super.prototype.initialize.call(this, props); - (0,index_all.bindAll)(this, 'disableEditing', 'onDisable'); - var model = this.model; - var em = this.em; - this.listenTo(model, 'focus', this.onActive); - this.listenTo(model, 'change:content', this.updateContentText); - this.listenTo(model, 'sync:content', this.syncContent); - this.rte = em === null || em === void 0 ? void 0 : em.RichTextEditor; - }; - ComponentTextView.prototype.updateContentText = function (m, v, opts) { - if (opts === void 0) { opts = {}; } - !opts.fromDisable && this.disableEditing(); - }; - ComponentTextView.prototype.canActivate = function () { - var _a = this, model = _a.model, rteEnabled = _a.rteEnabled, em = _a.em; - var modelInEdit = em === null || em === void 0 ? void 0 : em.getEditing(); - var sameInEdit = modelInEdit === model; - var result = true; - var isInnerText = false; - var delegate; - if (rteEnabled || !model.get('editable') || sameInEdit || (isInnerText = model.isChildOf('text'))) { - result = false; - // If the current is inner text, select the closest text - if (isInnerText && !model.get('textable')) { - var parent_1 = model.parent(); - while (parent_1 && !parent_1.isInstanceOf('text')) { - parent_1 = parent_1.parent(); - } - if (parent_1 && parent_1.get('editable')) { - delegate = parent_1; - } - else { - result = true; - } - } - } - return { result: result, delegate: delegate }; - }; - /** - * Enable element content editing - * @private - * */ - ComponentTextView.prototype.onActive = function (ev) { - var _a, _b; - return __awaiter(this, void 0, void 0, function () { - var _c, rte, em, _d, result, delegate, _e, _f, err_1; - return __generator(this, function (_g) { - switch (_g.label) { - case 0: - _c = this, rte = _c.rte, em = _c.em; - _d = this.canActivate(), result = _d.result, delegate = _d.delegate; - // We place this before stopPropagation in case of nested - // text components will not block the editing (#1394) - if (!result) { - if (delegate) { - (_a = ev === null || ev === void 0 ? void 0 : ev.stopPropagation) === null || _a === void 0 ? void 0 : _a.call(ev); - em.setSelected(delegate); - delegate.trigger('active', ev); - } - return [2 /*return*/]; - } - (_b = ev === null || ev === void 0 ? void 0 : ev.stopPropagation) === null || _b === void 0 ? void 0 : _b.call(ev); - _e = this; - return [4 /*yield*/, this.getContent()]; - case 1: - _e.lastContent = _g.sent(); - if (!rte) return [3 /*break*/, 5]; - _g.label = 2; - case 2: - _g.trys.push([2, 4, , 5]); - _f = this; - return [4 /*yield*/, rte.enable(this, this.activeRte, { event: ev })]; - case 3: - _f.activeRte = _g.sent(); - return [3 /*break*/, 5]; - case 4: - err_1 = _g.sent(); - em.logError(err_1); - return [3 /*break*/, 5]; - case 5: - this.toggleEvents(true); - return [2 /*return*/]; - } - }); - }); - }; - ComponentTextView.prototype.onDisable = function (opts) { - this.disableEditing(opts); - }; - /** - * Disable element content editing - * @private - * */ - ComponentTextView.prototype.disableEditing = function (opts) { - if (opts === void 0) { opts = {}; } - return __awaiter(this, void 0, void 0, function () { - var _a, model, rte, activeRte, em, editable, err_2, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - _a = this, model = _a.model, rte = _a.rte, activeRte = _a.activeRte, em = _a.em; - editable = model && model.get('editable'); - if (!rte) return [3 /*break*/, 8]; - _c.label = 1; - case 1: - _c.trys.push([1, 3, , 4]); - return [4 /*yield*/, rte.disable(this, activeRte, opts)]; - case 2: - _c.sent(); - return [3 /*break*/, 4]; - case 3: - err_2 = _c.sent(); - em.logError(err_2); - return [3 /*break*/, 4]; - case 4: - _b = editable; - if (!_b) return [3 /*break*/, 6]; - return [4 /*yield*/, this.getContent()]; - case 5: - _b = (_c.sent()) !== this.lastContent; - _c.label = 6; - case 6: - if (!_b) return [3 /*break*/, 8]; - return [4 /*yield*/, this.syncContent(opts)]; - case 7: - _c.sent(); - this.lastContent = ''; - _c.label = 8; - case 8: - this.toggleEvents(); - return [2 /*return*/]; - } - }); - }); - }; - /** - * get content from RTE - * @return string - */ - ComponentTextView.prototype.getContent = function () { - return __awaiter(this, void 0, void 0, function () { - var _a, rte, activeRte, result; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = this, rte = _a.rte, activeRte = _a.activeRte; - result = ''; - if (!rte) return [3 /*break*/, 2]; - return [4 /*yield*/, rte.getContent(this, activeRte)]; - case 1: - result = _b.sent(); - _b.label = 2; - case 2: return [2 /*return*/, result]; - } - }); - }); - }; - /** - * Merge content from the DOM to the model - */ - ComponentTextView.prototype.syncContent = function (opts) { - if (opts === void 0) { opts = {}; } - return __awaiter(this, void 0, void 0, function () { - var _a, model, rte, rteEnabled, content, comps, contentOpt; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = this, model = _a.model, rte = _a.rte, rteEnabled = _a.rteEnabled; - if (!rteEnabled && !opts.force) - return [2 /*return*/]; - return [4 /*yield*/, this.getContent()]; - case 1: - content = _b.sent(); - comps = model.components(); - contentOpt = ComponentTextView_assign({ fromDisable: 1 }, opts); - model.set('content', '', contentOpt); - // If there is a custom RTE the content is just added staticly - // inside 'content' - if ((rte === null || rte === void 0 ? void 0 : rte.customRte) && !rte.customRte.parseContent) { - comps.length && - comps.reset(undefined, ComponentTextView_assign(ComponentTextView_assign({}, opts), { - // @ts-ignore - keepIds: getComponentIds(comps) })); - model.set('content', content, contentOpt); - } - else { - comps.resetFromString(content, opts); - } - return [2 /*return*/]; - } - }); - }); - }; - ComponentTextView.prototype.insertComponent = function (content, opts) { - var _a; - if (opts === void 0) { opts = {}; } - var _b = this, model = _b.model, el = _b.el; - var doc = el.ownerDocument; - var selection = doc.getSelection(); - if (selection === null || selection === void 0 ? void 0 : selection.rangeCount) { - var range = selection.getRangeAt(0); - var textNode_1 = range.startContainer; - var offset_1 = range.startOffset; - var textModel_1 = (0,mixins.getComponentModel)(textNode_1); - var newCmps_1 = []; - if (textModel_1 && ((_a = textModel_1.is) === null || _a === void 0 ? void 0 : _a.call(textModel_1, 'textnode'))) { - var cmps = textModel_1.collection; - cmps.forEach(function (cmp) { - if (cmp === textModel_1) { - var type = 'textnode'; - var cnt = opts.useDomContent ? textNode_1.textContent || '' : cmp.content; - newCmps_1.push({ type: type, content: cnt.slice(0, offset_1) }); - newCmps_1.push(content); - newCmps_1.push({ type: type, content: cnt.slice(offset_1) }); - } - else { - newCmps_1.push(cmp); - } - }); - var result = newCmps_1.filter(Boolean); - var index = result.indexOf(content); - cmps.reset(result, opts); - return cmps.at(index); - } - } - return model.append(content, opts); - }; - /** - * Callback on input event - * @param {Event} e - */ - ComponentTextView.prototype.onInput = function () { - var em = this.em; - var evPfx = 'component'; - var ev = ["".concat(evPfx, ":update"), "".concat(evPfx, ":input")].join(' '); - // Update toolbars - em && em.trigger(ev, this.model); - }; - /** - * Isolate disable propagation method - * @param {Event} - * @private - * */ - ComponentTextView.prototype.disablePropagation = function (e) { - e.stopPropagation(); - }; - /** - * Enable/Disable events - * @param {Boolean} enable - */ - ComponentTextView.prototype.toggleEvents = function (enable) { - var _a = this, em = _a.em, model = _a.model, $el = _a.$el; - var mixins = { on: dom.on, off: dom/* off */.S1 }; - var method = enable ? 'on' : 'off'; - em.setEditing(enable ? this : false); - this.rteEnabled = !!enable; - // The ownerDocument is from the frame - var elDocs = [this.el.ownerDocument, document]; - mixins.off(elDocs, 'mousedown', this.onDisable); - mixins[method](elDocs, 'mousedown', this.onDisable); - em[method]('toolbar:run:before', this.onDisable); - if (model) { - model[method]('removed', this.onDisable); - model.trigger("rte:".concat(enable ? 'enable' : 'disable')); - } - // @ts-ignore Avoid closing edit mode on component click - $el === null || $el === void 0 ? void 0 : $el.off('mousedown', this.disablePropagation); - // @ts-ignore - $el && $el[method]('mousedown', this.disablePropagation); - // Fixes #2210 but use this also as a replacement - // of this fix: bd7b804f3b46eb45b4398304b2345ce870f232d2 - if (this.config.draggableComponents) { - var el = this.el; - while (el) { - el.draggable = enable ? !1 : !0; - // Note: el.parentNode is sometimes null here - el = el.parentNode; - if (el && el.tagName == 'BODY') { - // @ts-ignore - el = 0; - } - } - } - }; - return ComponentTextView; -}(view_ComponentView)); -/* harmony default export */ const view_ComponentTextView = (ComponentTextView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentLinkView.ts -var ComponentLinkView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ComponentLinkView = /** @class */ (function (_super) { - ComponentLinkView_extends(ComponentLinkView, _super); - function ComponentLinkView() { - return _super !== null && _super.apply(this, arguments) || this; - } - ComponentLinkView.prototype.render = function () { - _super.prototype.render.call(this); - // I need capturing instead of bubbling as bubbled clicks from other - // children will execute the link event - this.el.addEventListener('click', this.prevDef, true); - return this; - }; - return ComponentLinkView; -}(view_ComponentTextView)); -/* harmony default export */ const view_ComponentLinkView = (ComponentLinkView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentLabelView.ts -var ComponentLabelView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ComponentLabelView = /** @class */ (function (_super) { - ComponentLabelView_extends(ComponentLabelView, _super); - function ComponentLabelView() { - return _super !== null && _super.apply(this, arguments) || this; - } - return ComponentLabelView; -}(view_ComponentLinkView)); -/* harmony default export */ const view_ComponentLabelView = (ComponentLabelView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentMapView.ts -var ComponentMapView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ComponentMapView = /** @class */ (function (_super) { - ComponentMapView_extends(ComponentMapView, _super); - function ComponentMapView() { - return _super !== null && _super.apply(this, arguments) || this; - } - ComponentMapView.prototype.tagName = function () { - return 'div'; - }; - ComponentMapView.prototype.events = function () { - return {}; - }; - ComponentMapView.prototype.initialize = function (props) { - _super.prototype.initialize.call(this, props); - this.classEmpty = this.ppfx + 'plh-map'; - }; - /** - * Update the map on the canvas - * @private - */ - ComponentMapView.prototype.updateSrc = function () { - this.getIframe().src = this.model.get('src'); - }; - ComponentMapView.prototype.getIframe = function () { - if (!this.iframe) { - var ifrm = document.createElement('iframe'); - ifrm.src = this.model.get('src'); - ifrm.frameBorder = '0'; - ifrm.style.height = '100%'; - ifrm.style.width = '100%'; - ifrm.className = this.ppfx + 'no-pointer'; - this.iframe = ifrm; - } - return this.iframe; - }; - ComponentMapView.prototype.render = function () { - _super.prototype.render.call(this); - this.updateClasses(); - this.el.appendChild(this.getIframe()); - return this; - }; - return ComponentMapView; -}(view_ComponentImageView)); -/* harmony default export */ const view_ComponentMapView = (ComponentMapView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentScriptView.ts -var ComponentScriptView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ComponentScriptView = /** @class */ (function (_super) { - ComponentScriptView_extends(ComponentScriptView, _super); - function ComponentScriptView() { - return _super !== null && _super.apply(this, arguments) || this; - } - ComponentScriptView.prototype.tagName = function () { - return 'script'; - }; - ComponentScriptView.prototype.events = function () { - return {}; - }; - return ComponentScriptView; -}(view_ComponentView)); -/* harmony default export */ const view_ComponentScriptView = (ComponentScriptView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentSvgView.ts -var ComponentSvgView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ComponentSvgView = /** @class */ (function (_super) { - ComponentSvgView_extends(ComponentSvgView, _super); - function ComponentSvgView() { - return _super !== null && _super.apply(this, arguments) || this; - } - ComponentSvgView.prototype._createElement = function (tagName) { - return document.createElementNS('http://www.w3.org/2000/svg', tagName); - }; - return ComponentSvgView; -}(view_ComponentView)); -/* harmony default export */ const view_ComponentSvgView = (ComponentSvgView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentTableBodyView.ts -var ComponentTableBodyView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ComponentTableBodyView = /** @class */ (function (_super) { - ComponentTableBodyView_extends(ComponentTableBodyView, _super); - function ComponentTableBodyView() { - return _super !== null && _super.apply(this, arguments) || this; - } - return ComponentTableBodyView; -}(view_ComponentView)); -/* harmony default export */ const view_ComponentTableBodyView = (ComponentTableBodyView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentTableCellView.ts -var ComponentTableCellView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ComponentTableCellView = /** @class */ (function (_super) { - ComponentTableCellView_extends(ComponentTableCellView, _super); - function ComponentTableCellView() { - return _super !== null && _super.apply(this, arguments) || this; - } - return ComponentTableCellView; -}(view_ComponentView)); -/* harmony default export */ const view_ComponentTableCellView = (ComponentTableCellView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentTableFootView.ts -var ComponentTableFootView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ComponentTableFootView = /** @class */ (function (_super) { - ComponentTableFootView_extends(ComponentTableFootView, _super); - function ComponentTableFootView() { - return _super !== null && _super.apply(this, arguments) || this; - } - return ComponentTableFootView; -}(view_ComponentView)); -/* harmony default export */ const view_ComponentTableFootView = (ComponentTableFootView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentTableHeadView.ts -var ComponentTableHeadView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ComponentTableHeadView = /** @class */ (function (_super) { - ComponentTableHeadView_extends(ComponentTableHeadView, _super); - function ComponentTableHeadView() { - return _super !== null && _super.apply(this, arguments) || this; - } - return ComponentTableHeadView; -}(view_ComponentView)); -/* harmony default export */ const view_ComponentTableHeadView = (ComponentTableHeadView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentTableRowView.ts -var ComponentTableRowView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ComponentTableRowView = /** @class */ (function (_super) { - ComponentTableRowView_extends(ComponentTableRowView, _super); - function ComponentTableRowView() { - return _super !== null && _super.apply(this, arguments) || this; - } - return ComponentTableRowView; -}(view_ComponentView)); -/* harmony default export */ const view_ComponentTableRowView = (ComponentTableRowView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentTableView.ts -var ComponentTableView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ComponentTableView = /** @class */ (function (_super) { - ComponentTableView_extends(ComponentTableView, _super); - function ComponentTableView() { - return _super !== null && _super.apply(this, arguments) || this; - } - ComponentTableView.prototype.events = function () { - return {}; - }; - return ComponentTableView; -}(view_ComponentView)); -/* harmony default export */ const view_ComponentTableView = (ComponentTableView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentVideoView.ts -var ComponentVideoView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var ComponentVideoView = /** @class */ (function (_super) { - ComponentVideoView_extends(ComponentVideoView, _super); - function ComponentVideoView() { - return _super !== null && _super.apply(this, arguments) || this; - } - ComponentVideoView.prototype.tagName = function () { - return 'div'; - }; - // @ts-ignore - ComponentVideoView.prototype.events = function () { - return {}; - }; - ComponentVideoView.prototype.initialize = function () { - // @ts-ignore - view_ComponentView.prototype.initialize.apply(this, arguments); - var model = this.model; - var props = ['loop', 'autoplay', 'controls', 'color', 'rel', 'modestbranding', 'poster']; - var events = props.map(function (p) { return "change:".concat(p); }).join(' '); - this.listenTo(model, 'change:provider', this.updateProvider); - this.listenTo(model, 'change:src', this.updateSrc); - this.listenTo(model, events, this.updateVideo); - }; - /** - * Rerender on update of the provider - * @private - */ - ComponentVideoView.prototype.updateProvider = function () { - var prov = this.model.get('provider'); - this.el.innerHTML = ''; - this.el.appendChild(this.renderByProvider(prov)); - }; - /** - * Update the source of the video - * @private - */ - ComponentVideoView.prototype.updateSrc = function () { - var _a = this, model = _a.model, videoEl = _a.videoEl; - if (!videoEl) - return; - var prov = model.get('provider'); - var src = model.get('src'); - switch (prov) { - case 'yt': - src = model.getYoutubeSrc(); - break; - case 'ytnc': - src = model.getYoutubeNoCookieSrc(); - break; - case 'vi': - src = model.getVimeoSrc(); - break; - } - videoEl.src = src; - }; - /** - * Update video parameters - * @private - */ - ComponentVideoView.prototype.updateVideo = function () { - var _a = this, model = _a.model, videoEl = _a.videoEl; - var prov = model.get('provider'); - switch (prov) { - case 'yt': - case 'ytnc': - case 'vi': - model.trigger('change:videoId'); - break; - default: { - if (videoEl) { - var el = videoEl; - el.loop = model.get('loop'); - el.autoplay = model.get('autoplay'); - el.controls = model.get('controls'); - el.poster = model.get('poster'); - } - } - } - }; - ComponentVideoView.prototype.renderByProvider = function (prov) { - var videoEl; - switch (prov) { - case 'yt': - videoEl = this.renderYoutube(); - break; - case 'ytnc': - videoEl = this.renderYoutubeNoCookie(); - break; - case 'vi': - videoEl = this.renderVimeo(); - break; - default: - videoEl = this.renderSource(); - } - this.videoEl = videoEl; - return videoEl; - }; - ComponentVideoView.prototype.renderSource = function () { - var el = document.createElement('video'); - el.src = this.model.get('src'); - this.initVideoEl(el); - return el; - }; - ComponentVideoView.prototype.renderYoutube = function () { - var el = document.createElement('iframe'); - el.src = this.model.getYoutubeSrc(); - el.frameBorder = '0'; - el.setAttribute('allowfullscreen', 'true'); - this.initVideoEl(el); - return el; - }; - ComponentVideoView.prototype.renderYoutubeNoCookie = function () { - var el = document.createElement('iframe'); - el.src = this.model.getYoutubeNoCookieSrc(); - el.frameBorder = '0'; - el.setAttribute('allowfullscreen', 'true'); - this.initVideoEl(el); - return el; - }; - ComponentVideoView.prototype.renderVimeo = function () { - var el = document.createElement('iframe'); - el.src = this.model.getVimeoSrc(); - el.frameBorder = '0'; - el.setAttribute('allowfullscreen', 'true'); - this.initVideoEl(el); - return el; - }; - ComponentVideoView.prototype.initVideoEl = function (el) { - el.className = this.ppfx + 'no-pointer'; - el.style.height = '100%'; - el.style.width = '100%'; - }; - ComponentVideoView.prototype.render = function () { - view_ComponentView.prototype.render.apply(this); - this.updateClasses(); - var prov = this.model.get('provider'); - this.el.appendChild(this.renderByProvider(prov)); - this.updateVideo(); - return this; - }; - return ComponentVideoView; -}(view_ComponentImageView)); -/* harmony default export */ const view_ComponentVideoView = (ComponentVideoView); - -;// CONCATENATED MODULE: ./src/dom_components/view/ComponentWrapperView.ts -var ComponentWrapperView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -var ComponentWrapperView = /** @class */ (function (_super) { - ComponentWrapperView_extends(ComponentWrapperView, _super); - function ComponentWrapperView() { - return _super !== null && _super.apply(this, arguments) || this; - } - ComponentWrapperView.prototype.tagName = function () { - return 'div'; - }; - return ComponentWrapperView; -}(view_ComponentView)); -/* harmony default export */ const view_ComponentWrapperView = (ComponentWrapperView); - -;// CONCATENATED MODULE: ./src/dom_components/model/Symbols.ts -var Symbols_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var Symbols_assign = (undefined && undefined.__assign) || function () { - Symbols_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return Symbols_assign.apply(this, arguments); -}; - - - -var Symbols = /** @class */ (function (_super) { - Symbols_extends(Symbols, _super); - function Symbols() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var _this = _super.apply(this, args) || this; - _this.refreshDbn = (0,index_all.debounce)(function () { return _this.refresh(); }, 0); - var events = _this.events; - _this.on(events.update, _this.onUpdate); - _this.on(events.updateInside, _this.onUpdateDeep); - return _this; - } - Symbols.prototype.removeChildren = function (component, coll, opts) { - var _a; - if (opts === void 0) { opts = {}; } - _super.prototype.removeChildren.call(this, component, coll, opts); - (_a = getSymbolInstances(component)) === null || _a === void 0 ? void 0 : _a.forEach(function (i) { return detachSymbolInstance(i, { skipRefs: true }); }); - this.__trgEvent(this.events.symbolMainRemove, { component: component }); - }; - Symbols.prototype.onAdd = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - _super.prototype.onAdd.apply(this, args); - var component = args[0]; - this.__trgEvent(this.events.symbolMainAdd, { component: component }); - }; - Symbols.prototype.onUpdate = function (props) { - this.__trgEvent(this.events.symbolMainUpdate, props); - }; - Symbols.prototype.onUpdateDeep = function (props) { - this.__trgEvent(this.events.symbolMainUpdateDeep, props); - }; - Symbols.prototype.refresh = function () { - var _a = this, em = _a.em, events = _a.events; - em.trigger(events.symbol); - }; - Symbols.prototype.__trgEvent = function (event, props, isInstance) { - if (isInstance === void 0) { isInstance = false; } - var _a = this, em = _a.em, events = _a.events; - var eventType = isInstance ? events.symbolInstance : events.symbolMain; - em.trigger(event, props); - em.trigger(eventType, Symbols_assign(Symbols_assign({}, props), { event: event })); - this.refreshDbn(); - }; - return Symbols; -}(model_Components)); -/* harmony default export */ const model_Symbols = (Symbols); - -;// CONCATENATED MODULE: ./src/dom_components/index.ts -var dom_components_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var dom_components_assign = (undefined && undefined.__assign) || function () { - dom_components_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return dom_components_assign.apply(this, arguments); -}; -var dom_components_rest = (undefined && undefined.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -}; -var dom_components_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -/** - * With this module is possible to manage components inside the canvas. You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/dom_components/config/config.ts) - * ```js - * const editor = grapesjs.init({ - * domComponents: { - * // options - * } - * }) - * ``` - * - * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. - * - * ```js - * // Listen to events - * editor.on('component:create', () => { ... }); - * - * // Use the API - * const cmp = editor.Components; - * cmp.addType(...); - * ``` - * - * ## Available Events - * * `component:create` - Component is created (only the model, is not yet mounted in the canvas), called after the init() method - * * `component:mount` - Component is mounted to an element and rendered in canvas - * * `component:add` - Triggered when a new component is added to the editor, the model is passed as an argument to the callback - * * `component:remove` - Triggered when a component is removed, the model is passed as an argument to the callback - * * `component:remove:before` - Triggered before the remove of the component, the model, remove function (if aborted via options, with this function you can complete the remove) and options (use options.abort = true to prevent remove), are passed as arguments to the callback - * * `component:clone` - Triggered when a component is cloned, the new model is passed as an argument to the callback - * * `component:update` - Triggered when a component is updated (moved, styled, etc.), the model is passed as an argument to the callback - * * `component:update:{propertyName}` - Listen any property change, the model is passed as an argument to the callback - * * `component:styleUpdate` - Triggered when the style of the component is updated, the model is passed as an argument to the callback - * * `component:styleUpdate:{propertyName}` - Listen for a specific style property change, the model is passed as an argument to the callback - * * `component:selected` - New component selected, the selected model is passed as an argument to the callback - * * `component:deselected` - Component deselected, the deselected model is passed as an argument to the callback - * * `component:toggled` - Component selection changed, toggled model is passed as an argument to the callback - * * `component:type:add` - New component type added, the new type is passed as an argument to the callback - * * `component:type:update` - Component type updated, the updated type is passed as an argument to the callback - * * `component:drag:start` - Component drag started. Passed an object, to the callback, containing the `target` (component to drag), `parent` (parent of the component) and `index` (component index in the parent) - * * `component:drag` - During component drag. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the current pointer - * * `component:drag:end` - Component drag ended. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the final pointer - * * `component:resize` - During component resize. - * - * ## Methods - * * [getWrapper](#getwrapper) - * * [getComponents](#getcomponents) - * * [addComponent](#addcomponent) - * * [clear](#clear) - * * [addType](#addtype) - * * [getType](#gettype) - * * [getTypes](#gettypes) - * - * * [Component]: component.html - * - * @module Components - */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/** @private */ -var CanMoveReason; -(function (CanMoveReason) { - /** - * Invalid source. This is a default value and should be ignored in case the `result` is true - */ - CanMoveReason[CanMoveReason["InvalidSource"] = 0] = "InvalidSource"; - /** - * Source doesn't accept target as destination. - */ - CanMoveReason[CanMoveReason["SourceReject"] = 1] = "SourceReject"; - /** - * Target doesn't accept source. - */ - CanMoveReason[CanMoveReason["TargetReject"] = 2] = "TargetReject"; -})(CanMoveReason || (CanMoveReason = {})); -var ComponentManager = /** @class */ (function (_super) { - dom_components_extends(ComponentManager, _super); - /** - * Initialize module. Called on a new instance of the editor with configurations passed - * inside 'domComponents' field - * @param {Object} config Configurations - * @private - */ - function ComponentManager(em) { - var _this = _super.call(this, em, 'DomComponents', new model_Components(undefined, { em: em })) || this; - _this.componentTypes = [ - { - id: 'cell', - model: model_ComponentTableCell, - view: view_ComponentTableCellView, - }, - { - id: 'row', - model: model_ComponentTableRow, - view: view_ComponentTableRowView, - }, - { - id: 'table', - model: model_ComponentTable, - view: view_ComponentTableView, - }, - { - id: 'thead', - model: model_ComponentTableHead, - view: view_ComponentTableHeadView, - }, - { - id: 'tbody', - model: model_ComponentTableBody, - view: view_ComponentTableBodyView, - }, - { - id: 'tfoot', - model: model_ComponentTableFoot, - view: view_ComponentTableFootView, - }, - { - id: 'map', - model: model_ComponentMap, - view: view_ComponentMapView, - }, - { - id: 'link', - model: model_ComponentLink, - view: view_ComponentLinkView, - }, - { - id: 'label', - model: model_ComponentLabel, - view: view_ComponentLabelView, - }, - { - id: 'video', - model: model_ComponentVideo, - view: view_ComponentVideoView, - }, - { - id: 'image', - model: model_ComponentImage, - view: view_ComponentImageView, - }, - { - id: 'script', - model: model_ComponentScript, - view: view_ComponentScriptView, - }, - { - id: 'svg-in', - model: model_ComponentSvgIn, - view: view_ComponentSvgView, - }, - { - id: 'svg', - model: model_ComponentSvg, - view: view_ComponentSvgView, - }, - { - id: 'iframe', - model: model_ComponentFrame, - view: view_ComponentFrameView, - }, - { - id: 'comment', - model: model_ComponentComment, - view: view_ComponentCommentView, - }, - { - id: 'textnode', - model: model_ComponentTextNode, - view: view_ComponentTextNodeView, - }, - { - id: type, - model: model_ComponentHead, - view: view_ComponentView, - }, - { - id: 'wrapper', - model: model_ComponentWrapper, - view: view_ComponentWrapperView, - }, - { - id: 'text', - model: model_ComponentText, - view: view_ComponentTextView, - }, - { - id: 'default', - model: model_Component, - view: view_ComponentView, - }, - ]; - _this.componentsById = {}; - _this.Component = model_Component; - _this.Components = model_Components; - _this.ComponentView = view_ComponentView; - _this.ComponentsView = view_ComponentsView; - /** - * Name of the module - * @type {String} - * @private - */ - //name = "DomComponents"; - _this.storageKey = 'components'; - _this.keySymbols = 'symbols'; - _this.events = dom_components_types/* ComponentsEvents */.g; - var config = _this.config; - _this.symbols = new model_Symbols([], { em: em, config: config, domc: _this }); - if (em) { - //@ts-ignore - _this.config.components = em.config.components || _this.config.components; - } - for (var name_1 in dom_components_config_config) { - //@ts-ignore - if (!(name_1 in _this.config)) - _this.config[name_1] = dom_components_config_config[name_1]; - } - var ppfx = _this.config.pStylePrefix; - if (ppfx) - _this.config.stylePrefix = ppfx + _this.config.stylePrefix; - // Load dependencies - if (em) { - em.get('Parser').compTypes = _this.componentTypes; - em.on('change:componentHovered', _this.componentHovered, _this); - var selected_1 = em.get('selected'); - em.listenTo(selected_1, 'add', function (sel, c, opts) { return _this.selectAdd(selected_1.getComponent(sel), opts); }); - em.listenTo(selected_1, 'remove', function (sel, c, opts) { return _this.selectRemove(selected_1.getComponent(sel), opts); }); - } - return _this; - } - ComponentManager.prototype.postLoad = function () { - var _a = this, em = _a.em, symbols = _a.symbols; - var UndoManager = em.UndoManager; - UndoManager.add(symbols); - }; - ComponentManager.prototype.load = function (data) { - var _this = this; - var result = this.loadProjectData(data, { - onResult: function (result) { - var wrapper = _this.getWrapper(); - if (!wrapper) { - _this.em.Pages.add({}, { select: true }); - wrapper = _this.getWrapper(); - } - if ((0,index_all.isArray)(result)) { - result.length && wrapper.components(result); - } - else { - var _a = result.components, components = _a === void 0 ? [] : _a, rest = dom_components_rest(result, ["components"]); - wrapper.set(rest); - //@ts-ignore - wrapper.components(components); - } - }, - }); - this.symbols.reset(data[this.keySymbols] || []); - return result; - }; - ComponentManager.prototype.store = function () { - var _a; - return _a = {}, - _a[this.keySymbols] = this.symbols, - _a; - }; - /** - * Returns the main wrapper. - * @return {Object} - * @private - */ - ComponentManager.prototype.getComponent = function () { - var sel = this.em.Pages.getSelected(); - var frame = sel === null || sel === void 0 ? void 0 : sel.getMainFrame(); - return frame === null || frame === void 0 ? void 0 : frame.getComponent(); - }; - /** - * Returns root component inside the canvas. Something like `` inside HTML page - * The wrapper doesn't differ from the original Component Model - * @return {[Component]} Root Component - * @example - * // Change background of the wrapper and set some attribute - * var wrapper = cmp.getWrapper(); - * wrapper.set('style', {'background-color': 'red'}); - * wrapper.set('attributes', {'title': 'Hello!'}); - */ - ComponentManager.prototype.getWrapper = function () { - return this.getComponent(); - }; - /** - * Returns wrapper's children collection. Once you have the collection you can - * add other Components(Models) inside. Each component can have several nested - * components inside and you can nest them as more as you wish. - * @return {Components} Collection of components - * @example - * // Let's add some component - * var wrapperChildren = cmp.getComponents(); - * var comp1 = wrapperChildren.add({ - * style: { 'background-color': 'red'} - * }); - * var comp2 = wrapperChildren.add({ - * tagName: 'span', - * attributes: { title: 'Hello!'} - * }); - * // Now let's add an other one inside first component - * // First we have to get the collection inside. Each - * // component has 'components' property - * var comp1Children = comp1.get('components'); - * // Procede as before. You could also add multiple objects - * comp1Children.add([ - * { style: { 'background-color': 'blue'}}, - * { style: { height: '100px', width: '100px'}} - * ]); - * // Remove comp2 - * wrapperChildren.remove(comp2); - */ - ComponentManager.prototype.getComponents = function () { - var wrp = this.getWrapper(); - return wrp === null || wrp === void 0 ? void 0 : wrp.components(); - }; - /** - * Add new components to the wrapper's children. It's the same - * as 'cmp.getComponents().add(...)' - * @param {Object|[Component]|Array} component Component/s to add - * @param {string} [component.tagName='div'] Tag name - * @param {string} [component.type=''] Type of the component. Available: ''(default), 'text', 'image' - * @param {boolean} [component.removable=true] If component is removable - * @param {boolean} [component.draggable=true] If is possible to move the component around the structure - * @param {boolean} [component.droppable=true] If is possible to drop inside other components - * @param {boolean} [component.badgable=true] If the badge is visible when the component is selected - * @param {boolean} [component.stylable=true] If is possible to style component - * @param {boolean} [component.copyable=true] If is possible to copy&paste the component - * @param {string} [component.content=''] String inside component - * @param {Object} [component.style={}] Style object - * @param {Object} [component.attributes={}] Attribute object - * @param {Object} opt the options object to be used by the [Components.add]{@link getComponents} method - * @return {[Component]|Array<[Component]>} Component/s added - * @example - * // Example of a new component with some extra property - * var comp1 = cmp.addComponent({ - * tagName: 'div', - * removable: true, // Can't remove it - * draggable: true, // Can't move it - * copyable: true, // Disable copy/past - * content: 'Content text', // Text inside component - * style: { color: 'red'}, - * attributes: { title: 'here' } - * }); - */ - ComponentManager.prototype.addComponent = function (component, opt) { - if (opt === void 0) { opt = {}; } - return this.getComponents().add(component, opt); - }; - /** - * Render and returns wrapper element with all components inside. - * Once the wrapper is rendered, and it's what happens when you init the editor, - * the all new components will be added automatically and property changes are all - * updated immediately - * @return {HTMLElement} - * @private - */ - ComponentManager.prototype.render = function () { - var _a; - return (_a = this.componentView) === null || _a === void 0 ? void 0 : _a.render().el; - }; - /** - * Remove all components - * @return {this} - */ - ComponentManager.prototype.clear = function (opts) { - if (opts === void 0) { opts = {}; } - var components = this.getComponents(); - //@ts-ignore - components === null || components === void 0 ? void 0 : components.filter(Boolean).forEach(function (i) { return i.remove(opts); }); - return this; - }; - /** - * Set components - * @param {Object|string} components HTML string or components model - * @param {Object} opt the options object to be used by the {@link addComponent} method - * @return {this} - * @private - */ - ComponentManager.prototype.setComponents = function (components, opt) { - if (opt === void 0) { opt = {}; } - this.clear(opt).addComponent(components, opt); - }; - /** - * Add new component type. - * Read more about this in [Define New Component](https://grapesjs.com/docs/modules/Components.html#define-new-component) - * @param {string} type Component ID - * @param {Object} methods Component methods - * @return {this} - */ - ComponentManager.prototype.addType = function (type, methods) { - var em = this.em; - var _a = methods.model, model = _a === void 0 ? {} : _a, _b = methods.view, view = _b === void 0 ? {} : _b, isComponent = methods.isComponent, extend = methods.extend, extendView = methods.extendView, _c = methods.extendFn, extendFn = _c === void 0 ? [] : _c, _d = methods.extendFnView, extendFnView = _d === void 0 ? [] : _d, block = methods.block; - var compType = this.getType(type); - var extendType = this.getType(extend); - var extendViewType = this.getType(extendView); - var typeToExtend = extendType ? extendType : compType ? compType : this.getType('default'); - var modelToExt = typeToExtend.model; - var viewToExt = extendViewType ? extendViewType.view : typeToExtend.view; - // Function for extending source object methods - var getExtendedObj = function (fns, target, srcToExt) { - return fns.reduce(function (res, next) { - var fn = target[next]; - var parentFn = srcToExt.prototype[next]; - if (fn && parentFn) { - res[next] = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - parentFn.bind(this).apply(void 0, args); - fn.bind(this).apply(void 0, args); - }; - } - return res; - }, {}); - }; - // If the model/view is a simple object I need to extend it - if (typeof model === 'object') { - var modelDefaults_1 = { defaults: model.defaults }; - delete model.defaults; - var typeExtends = new Set(modelToExt.typeExtends); - typeExtends.add(modelToExt.getDefaults().type); - methods.model = modelToExt.extend(dom_components_assign(dom_components_assign({}, model), getExtendedObj(extendFn, model, modelToExt)), { - typeExtends: typeExtends, - isComponent: compType && !extendType && !isComponent ? modelToExt.isComponent : isComponent || (function () { return 0; }), - }); - // Reassign the defaults getter to the model - Object.defineProperty(methods.model.prototype, 'defaults', { - get: function () { return (dom_components_assign(dom_components_assign({}, ((0,index_all.result)(modelToExt.prototype, 'defaults') || {})), ((0,index_all.result)(modelDefaults_1, 'defaults') || {}))); }, - }); - } - if (typeof view === 'object') { - methods.view = viewToExt.extend(dom_components_assign(dom_components_assign({}, view), getExtendedObj(extendFnView, view, viewToExt))); - } - if (compType) { - compType.model = methods.model; - compType.view = methods.view; - } - else { - // @ts-ignore - methods.id = type; - this.componentTypes.unshift(methods); - } - if (block) { - var defBlockProps = { - id: type, - label: type, - content: { type: type }, - }; - var blockProps = block === true ? defBlockProps : dom_components_assign(dom_components_assign({}, defBlockProps), block); - em.Blocks.add(blockProps.id || type, blockProps); - } - var event = "component:type:".concat(compType ? 'update' : 'add'); - em === null || em === void 0 ? void 0 : em.trigger(event, compType || methods); - return this; - }; - ComponentManager.prototype.getType = function (type) { - var df = this.componentTypes; - for (var it = 0; it < df.length; it++) { - var dfId = df[it].id; - if (dfId == type) { - return df[it]; - } - } - return; - }; - /** - * Remove component type - * @param {string} type Component ID - * @returns {Object|undefined} Removed component type, undefined otherwise - */ - ComponentManager.prototype.removeType = function (id) { - var df = this.componentTypes; - var type = this.getType(id); - if (!type) - return; - var index = df.indexOf(type); - df.splice(index, 1); - return type; - }; - /** - * Return the array of all types - * @return {Array} - */ - ComponentManager.prototype.getTypes = function () { - return this.componentTypes; - }; - ComponentManager.prototype.selectAdd = function (component, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - if (component) { - component.set({ - status: 'selected', - }); - ['component:selected', 'component:toggled'].forEach(function (event) { return _this.em.trigger(event, component, opts); }); - } - }; - ComponentManager.prototype.selectRemove = function (component, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - if (component) { - var em = this.em; - component.set({ - status: '', - state: '', - }); - ['component:deselected', 'component:toggled'].forEach(function (event) { return _this.em.trigger(event, component, opts); }); - } - }; - /** - * Triggered when the component is hovered - * @private - */ - ComponentManager.prototype.componentHovered = function () { - var em = this.em; - var model = em.get('componentHovered'); - var previous = em.previous('componentHovered'); - var state = 'hovered'; - // Deselect the previous component - previous && - previous.get('status') == state && - previous.set({ - status: '', - state: '', - }); - model && (0,index_all.isEmpty)(model.get('status')) && model.set('status', state); - }; - ComponentManager.prototype.getShallowWrapper = function () { - var _a = this, shallow = _a.shallow, em = _a.em; - if (!shallow && em) { - var shallowEm = em.shallow; - if (!shallowEm) - return; - var domc = shallowEm.Components; - domc.componentTypes = this.componentTypes; - shallow = domc.getWrapper(); - if (shallow) { - var events = [keyUpdate, keyUpdateInside].join(' '); - shallow.on(events, (0,index_all.debounce)(function () { return shallow === null || shallow === void 0 ? void 0 : shallow.components(''); }, 100)); - } - this.shallow = shallow; - } - return shallow; - }; - /** - * Check if the object is a [Component]. - * @param {Object} obj - * @returns {Boolean} - * @example - * cmp.isComponent(editor.getSelected()); // true - * cmp.isComponent({}); // false - */ - ComponentManager.prototype.isComponent = function (obj) { - return (0,mixins.isComponent)(obj); - }; - /** - * Add a new symbol from a component. - * If the passed component is not a symbol, it will be converted to an instance and will return the main symbol. - * If the passed component is already an instance, a new instance will be created and returned. - * If the passed component is the main symbol, a new instance will be created and returned. - * @param {[Component]} component Component from which create a symbol. - * @returns {[Component]} - * @example - * const symbol = cmp.addSymbol(editor.getSelected()); - * // cmp.getSymbolInfo(symbol).isSymbol === true; - */ - ComponentManager.prototype.addSymbol = function (component) { - if ((0,index_all.isSymbol)(component) && !isSymbolRoot(component)) { - return; - } - var symbol = component.clone({ symbol: true }); - isSymbolMain(symbol) && this.symbols.add(symbol); - this.em.trigger('component:toggled'); - return symbol; - }; - /** - * Get the array of main symbols. - * @returns {Array<[Component]>} - * @example - * const symbols = cmp.getSymbols(); - * // [Component, Component, ...] - * // Removing the main symbol will detach all the relative instances. - * symbols[0].remove(); - */ - ComponentManager.prototype.getSymbols = function () { - return dom_components_spreadArray([], this.symbols.models, true); - }; - /** - * Detach symbol instance from the main one. - * The passed symbol instance will become a regular component. - * @param {[Component]} component The component symbol to detach. - * @example - * const cmpInstance = editor.getSelected(); - * // cmp.getSymbolInfo(cmpInstance).isInstance === true; - * cmp.detachSymbol(cmpInstance); - * // cmp.getSymbolInfo(cmpInstance).isInstance === false; - */ - ComponentManager.prototype.detachSymbol = function (component) { - if (isSymbolInstance(component)) { - detachSymbolInstance(component); - } - }; - /** - * Get info about the symbol. - * @param {[Component]} component Component symbol from which to get the info. - * @returns {Object} Object containing symbol info. - * @example - * cmp.getSymbolInfo(editor.getSelected()); - * // > { isSymbol: true, isMain: false, isInstance: true, ... } - */ - ComponentManager.prototype.getSymbolInfo = function (component, opts) { - if (opts === void 0) { opts = {}; } - var isMain = isSymbolMain(component); - var mainRef = getSymbolMain(component); - var isInstance = !!mainRef; - var instances = (isMain ? getSymbolInstances(component) : getSymbolInstances(mainRef)) || []; - var main = mainRef || (isMain ? component : undefined); - var relatives = getSymbolsToUpdate(component, { changed: opts.withChanges }); - var isSymbol = isMain || isInstance; - var isRoot = isSymbol && isSymbolRoot(component); - return { - isSymbol: isSymbol, - isMain: isMain, - isInstance: isInstance, - isRoot: isRoot, - main: main, - instances: instances, - relatives: relatives || [], - }; - }; - /** - * Check if a component can be moved inside another one. - * @param {[Component]} target The target component is the one that is supposed to receive the source one. - * @param {[Component]|String} source The source can be another component, a component definition or an HTML string. - * @param {Number} [index] Index position, if not specified, the check will be performed against appending the source to the target. - * @returns {Object} Object containing the `result` (Boolean), `source`, `target` (as Components), and a `reason` (Number) with these meanings: - * * `0` - Invalid source. This is a default value and should be ignored in case the `result` is true. - * * `1` - Source doesn't accept target as destination. - * * `2` - Target doesn't accept source. - * @example - * const rootComponent = editor.getWrapper(); - * const someComponent = editor.getSelected(); - * - * // Check with two components - * editor.Components.canMove(rootComponent, someComponent); - * - * // Check with component definition - * editor.Components.canMove(rootComponent, { tagName: 'a', draggable: false }); - * - * // Check with HTML string - * editor.Components.canMove(rootComponent, '
...
'); - */ - ComponentManager.prototype.canMove = function (target, source, index) { - var result = { - result: false, - reason: CanMoveReason.InvalidSource, - target: target, - source: null, - }; - if (!source || !target) - return result; - var srcModel = (0,mixins.isComponent)(source) ? source : null; - if (!srcModel) { - var wrapper = this.getShallowWrapper(); - srcModel = (wrapper === null || wrapper === void 0 ? void 0 : wrapper.append(source)[0]) || null; - } - result.source = srcModel; - if (!srcModel) - return result; - // Check if the source is draggable in the target - var draggable = srcModel.get('draggable'); - if ((0,index_all.isFunction)(draggable)) { - draggable = !!draggable(srcModel, target, index); - } - else { - var el = target.getEl(); - draggable = (0,index_all.isArray)(draggable) ? draggable.join(',') : draggable; - draggable = (0,index_all.isString)(draggable) ? el === null || el === void 0 ? void 0 : el.matches(draggable) : draggable; - } - if (!draggable) - return dom_components_assign(dom_components_assign({}, result), { reason: CanMoveReason.SourceReject }); - // Check if the target accepts the source - var droppable = target.get('droppable'); - if ((0,index_all.isFunction)(droppable)) { - droppable = !!droppable(srcModel, target, index); - } - else { - if (droppable === false && target.isInstanceOf('text') && srcModel.get('textable')) { - droppable = true; - } - else { - var el = srcModel.getEl(); - droppable = (0,index_all.isArray)(droppable) ? droppable.join(',') : droppable; - droppable = (0,index_all.isString)(droppable) ? el === null || el === void 0 ? void 0 : el.matches(droppable) : droppable; - } - } - // Ensure the target is not inside the source - var isTargetInside = [target].concat(target.parents()).indexOf(srcModel) > -1; - if (!droppable || isTargetInside) - return dom_components_assign(dom_components_assign({}, result), { reason: CanMoveReason.TargetReject }); - return dom_components_assign(dom_components_assign({}, result), { result: true }); - }; - ComponentManager.prototype.allById = function () { - return this.componentsById; - }; - ComponentManager.prototype.getById = function (id) { - return this.componentsById[id] || null; - }; - ComponentManager.prototype.destroy = function () { - var _a; - var all = this.allById(); - Object.keys(all).forEach(function (id) { return all[id] && all[id].remove(); }); - (_a = this.componentView) === null || _a === void 0 ? void 0 : _a.remove(); - [this.em, this.componentsById, this.componentView].forEach(function (i) { return (i = {}); }); - }; - return ComponentManager; -}(ItemManagerModule)); -/* harmony default export */ const dom_components = (ComponentManager); - -;// CONCATENATED MODULE: ./src/css_composer/config/config.ts -var css_composer_config_config_config = { - stylePrefix: 'css-', - rules: [], -}; -/* harmony default export */ const css_composer_config_config = (css_composer_config_config_config); - -;// CONCATENATED MODULE: ./src/code_manager/model/CssGenerator.ts -var CssGenerator_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - -var maxValue = Number.MAX_VALUE; -var getMediaLength = function (mediaQuery) { - var length = /(-?\d*\.?\d+)\w{0,}/.exec(mediaQuery); - return !length ? '' : length[0]; -}; -var CssGenerator = /** @class */ (function (_super) { - CssGenerator_extends(CssGenerator, _super); - function CssGenerator() { - var _this = _super.call(this) || this; - (0,index_all.bindAll)(_this, 'sortRules'); - _this.compCls = []; - _this.ids = []; - return _this; - } - /** - * Get CSS from a component - * @param {Model} model - * @return {String} - */ - CssGenerator.prototype.buildFromModel = function (model, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - var code = ''; - var em = this.em; - var avoidInline = em && em.getConfig().avoidInlineStyle; - var style = model.styleToString(); - var classes = model.classes; - this.ids.push("#".concat(model.getId())); - // Let's know what classes I've found - classes.forEach(function (model) { return _this.compCls.push(model.getFullName()); }); - if (!avoidInline && style) { - code = "#".concat(model.getId(), "{").concat(style, "}"); - } - var components = model.components(); - components.forEach(function (model) { return (code += _this.buildFromModel(model, opts)); }); - return code; - }; - CssGenerator.prototype.build = function (model, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - var json = opts.json; - var em = opts.em; - var cssc = opts.cssc || (em === null || em === void 0 ? void 0 : em.Css); - this.em = em; - this.compCls = []; - this.ids = []; - this.model = model; - var codeJson = []; - var code = model ? this.buildFromModel(model, opts) : ''; - var clearStyles = (0,index_all.isUndefined)(opts.clearStyles) && em ? em.getConfig().clearStyles : opts.clearStyles; - if (cssc) { - var rules = opts.rules || cssc.getAll(); - var atRules_1 = {}; - var dump_1 = []; - if (opts.onlyMatched && model && (0,mixins.hasWin)()) { - rules = this.matchedRules(model, rules); - } - rules.forEach(function (rule) { - var atRule = rule.getAtRule(); - if (atRule) { - var mRules = atRules_1[atRule]; - if (mRules) { - mRules.push(rule); - } - else { - atRules_1[atRule] = [rule]; - } - return; - } - var res = _this.buildFromRule(rule, dump_1, opts); - if (json) { - codeJson.push(res); - } - else { - code += res; - } - }); - this.sortMediaObject(atRules_1).forEach(function (item) { - var rulesStr = ''; - var atRule = item.key; - var mRules = item.value; - mRules.forEach(function (rule) { - var ruleStr = _this.buildFromRule(rule, dump_1, opts); - if (rule.get('singleAtRule')) { - code += "".concat(atRule, "{").concat(ruleStr, "}"); - } - else { - rulesStr += ruleStr; - } - json && codeJson.push(ruleStr); - }); - if (rulesStr) { - code += "".concat(atRule, "{").concat(rulesStr, "}"); - } - }); - // @ts-ignore - em && clearStyles && rules.remove && rules.remove(dump_1); - } - return json ? codeJson.filter(function (r) { return r; }) : code; - }; - /** - * Get CSS from the rule model - * @param {Model} rule - * @return {string} CSS string - */ - CssGenerator.prototype.buildFromRule = function (rule, dump, opts) { - var _this = this; - var _a; - if (opts === void 0) { opts = {}; } - var result = ''; - var model = this.model; - var selectorStrNoAdd = rule.selectorsToString({ skipAdd: 1 }); - var selectorsAdd = rule.get('selectorsAdd'); - var singleAtRule = rule.get('singleAtRule'); - var found; - // This will not render a rule if there is no its component - (_a = rule.get('selectors')) === null || _a === void 0 ? void 0 : _a.forEach(function (selector) { - var name = selector.getFullName(); - if (_this.compCls.indexOf(name) >= 0 || _this.ids.indexOf(name) >= 0 || opts.keepUnusedStyles) { - found = 1; - } - }); - if ((selectorStrNoAdd && found) || selectorsAdd || singleAtRule || !model) { - var block = rule.getDeclaration({ body: 1 }); - block && (opts.json ? (result = rule) : (result += block)); - } - else { - dump.push(rule); - } - return result; - }; - /** - * Get matched rules of a component - * @param {Component} component - * @param {Array} rules - * @returns {Array} - */ - CssGenerator.prototype.matchedRules = function (component, rules) { - var _this = this; - var el = component.getEl(); - var result = []; - rules.forEach(function (rule) { - try { - if (rule - .selectorsToString() - .split(',') - .some(function (selector) { return el === null || el === void 0 ? void 0 : el.matches(_this.__cleanSelector(selector)); })) { - result.push(rule); - } - } - catch (err) { } - }); - component.components().forEach(function (component) { - result = result.concat(_this.matchedRules(component, rules)); - }); - // Remove duplicates - result = result.filter(function (rule, i) { return result.indexOf(rule) === i; }); - return result; - }; - /** - * Get the numeric length of the media query string - * @param {String} mediaQuery Media query string - * @return {Number} - */ - CssGenerator.prototype.getQueryLength = function (mediaQuery) { - var length = /(-?\d*\.?\d+)\w{0,}/.exec(mediaQuery); - if (!length) - return maxValue; - return parseFloat(length[1]); - }; - /** - * Return a sorted array from media query object - * @param {Object} items - * @return {Array} - */ - CssGenerator.prototype.sortMediaObject = function (items) { - var _this = this; - if (items === void 0) { items = {}; } - var itemsArr = []; - (0,index_all.each)(items, function (value, key) { return itemsArr.push({ key: key, value: value }); }); - return itemsArr.sort(function (a, b) { - var isMobFirst = [a.key, b.key].every(function (mquery) { return mquery.indexOf('min-width') !== -1; }); - var left = isMobFirst ? a.key : b.key; - var right = isMobFirst ? b.key : a.key; - return _this.getQueryLength(left) - _this.getQueryLength(right); - }); - }; - CssGenerator.prototype.sortRules = function (a, b) { - var getKey = function (rule) { return rule.get('mediaText') || ''; }; - var isMobFirst = [getKey(a), getKey(b)].every(function (q) { return q.indexOf('min-width') !== -1; }); - var left = isMobFirst ? getKey(a) : getKey(b); - var right = isMobFirst ? getKey(b) : getKey(a); - return this.getQueryLength(left) - this.getQueryLength(right); - }; - /** - * Return passed selector without states - * @param {String} selector - * @returns {String} - * @private - */ - CssGenerator.prototype.__cleanSelector = function (selector) { - return selector - .split(' ') - .map(function (item) { return item.split(':')[0]; }) - .join(' '); - }; - return CssGenerator; -}(common/* Model */.Hn)); -/* harmony default export */ const model_CssGenerator = (CssGenerator); - -;// CONCATENATED MODULE: ./src/css_composer/model/CssRule.ts -var CssRule_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var CssRule_assign = (undefined && undefined.__assign) || function () { - CssRule_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return CssRule_assign.apply(this, arguments); -}; -var CssRule_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - - - - - - -// @ts-ignore -var CSS = ((0,mixins.hasWin)() ? window : {}).CSS; -/** - * @typedef CssRule - * @property {Array} selectors Array of selectors - * @property {Object} style Object containing style definitions - * @property {String} [selectorsAdd=''] Additional string css selectors - * @property {String} [atRuleType=''] Type of at-rule, eg. `media`, 'font-face' - * @property {String} [mediaText=''] At-rule value, eg. `(max-width: 1000px)` - * @property {Boolean} [singleAtRule=false] This property is used only on at-rules, like 'page' or 'font-face', where the block containes only style declarations - * @property {String} [state=''] State of the rule, eg: `hover`, `focused` - * @property {Boolean|Array} [important=false] If true, sets `!important` on all properties. You can also pass an array to specify properties on which use important - * @property {Boolean} [stylable=true] Indicates if the rule is stylable from the editor - * - * [Device]: device.html - * [State]: state.html - * [Component]: component.html - */ -var CssRule = /** @class */ (function (_super) { - CssRule_extends(CssRule, _super); - function CssRule(props, opt) { - if (opt === void 0) { opt = {}; } - var _this = _super.call(this, props) || this; - _this.config = props || {}; - _this.opt = opt; - _this.em = opt.em; - _this.ensureSelectors(null, null, {}); - _this.on('change', _this.__onChange); - return _this; - } - CssRule.prototype.defaults = function () { - return { - selectors: [], - selectorsAdd: '', - style: {}, - mediaText: '', - state: '', - stylable: true, - atRuleType: '', - singleAtRule: false, - important: false, - group: '', - shallow: false, - _undo: true, - }; - }; - CssRule.prototype.__onChange = function (m, opts) { - var em = this.em; - var changed = this.changedAttributes(); - changed && !(0,mixins.isEmptyObj)(changed) && (em === null || em === void 0 ? void 0 : em.changesUp(opts)); - }; - CssRule.prototype.clone = function () { - var opts = CssRule_assign({}, this.opt); - var attr = CssRule_assign({}, this.attributes); - attr.selectors = this.get('selectors').map(function (s) { return s.clone(); }); - // @ts-ignore - return new this.constructor(attr, opts); - }; - CssRule.prototype.ensureSelectors = function (m, c, opts) { - var em = this.em; - var sm = em === null || em === void 0 ? void 0 : em.get('SelectorManager'); - var toListen = [this, 'change:selectors', this.ensureSelectors]; - var sels = this.getSelectors(); - this.stopListening.apply(this, toListen); - if (sels.models) { - sels = CssRule_spreadArray([], sels.models, true); - } - sels = (0,index_all.isString)(sels) ? [sels] : sels; - if (Array.isArray(sels)) { - var res = sels.filter(function (i) { return i; }).map(function (i) { return (sm ? sm.add(i) : i); }); - sels = new model_Selectors(res); - } - this.set('selectors', sels, opts); - // @ts-ignore - this.listenTo.apply(this, toListen); - }; - /** - * Returns the at-rule statement when exists, eg. `@media (...)`, `@keyframes` - * @returns {String} - * @example - * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, { - * atRuleType: 'media', - * atRuleParams: '(min-width: 500px)' - * }); - * cssRule.getAtRule(); // "@media (min-width: 500px)" - */ - CssRule.prototype.getAtRule = function () { - var type = this.get('atRuleType'); - var condition = this.get('mediaText'); - // Avoid breaks with the last condition - var typeStr = type ? "@".concat(type) : condition ? '@media' : ''; - return typeStr + (condition && typeStr ? " ".concat(condition) : ''); - }; - /** - * Return selectors of the rule as a string - * @param {Object} [opts] Options - * @param {Boolean} [opts.skipState] Skip state from the result - * @returns {String} - * @example - * const cssRule = editor.Css.setRule('.class1:hover', { color: 'red' }); - * cssRule.selectorsToString(); // ".class1:hover" - * cssRule.selectorsToString({ skipState: true }); // ".class1" - */ - CssRule.prototype.selectorsToString = function (opts) { - if (opts === void 0) { opts = {}; } - var result = []; - var state = this.get('state'); - var addSelector = this.get('selectorsAdd'); - var selOpts = { - escape: function (str) { return (CSS && CSS.escape ? CSS.escape(str) : str); }, - }; - // @ts-ignore - var selectors = this.get('selectors').getFullString(0, selOpts); - var stateStr = state && !opts.skipState ? ":".concat(state) : ''; - selectors && result.push("".concat(selectors).concat(stateStr)); - addSelector && !opts.skipAdd && result.push(addSelector); - return result.join(', '); - }; - /** - * Get declaration block (without the at-rule statement) - * @param {Object} [opts={}] Options (same as in `selectorsToString`) - * @returns {String} - * @example - * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, { - * atRuleType: 'media', - * atRuleParams: '(min-width: 500px)' - * }); - * cssRule.getDeclaration() // ".class1{color:red;}" - */ - CssRule.prototype.getDeclaration = function (opts) { - if (opts === void 0) { opts = {}; } - var result = ''; - var important = this.attributes.important; - var selectors = this.selectorsToString(opts); - var style = this.styleToString(CssRule_assign({ important: important }, opts)); - var singleAtRule = this.get('singleAtRule'); - if ((selectors || singleAtRule) && (style || opts.allowEmpty)) { - result = singleAtRule ? style : "".concat(selectors, "{").concat(style, "}"); - } - return result; - }; - /** - * Get the Device the rule is related to. - * @returns {[Device]|null} - * @example - * const device = rule.getDevice(); - * console.log(device?.getName()); - */ - CssRule.prototype.getDevice = function () { - var em = this.em; - var _a = this.attributes, atRuleType = _a.atRuleType, mediaText = _a.mediaText; - var devices = (em === null || em === void 0 ? void 0 : em.get('DeviceManager').getDevices()) || []; - var deviceDefault = devices.filter(function (d) { return d.getWidthMedia() === ''; })[0]; - if (atRuleType !== 'media' || !mediaText) { - return deviceDefault || null; - } - return devices.filter(function (d) { return d.getWidthMedia() === getMediaLength(mediaText); })[0] || null; - }; - /** - * Get the State the rule is related to. - * @returns {[State]|null} - * @example - * const state = rule.getState(); - * console.log(state?.getLabel()); - */ - CssRule.prototype.getState = function () { - var em = this.em; - var stateValue = this.get('state'); - var states = (em === null || em === void 0 ? void 0 : em.get('SelectorManager').getStates()) || []; - return states.filter(function (s) { return s.getName() === stateValue; })[0] || null; - }; - /** - * Returns the related Component (valid only for component-specific rules). - * @returns {[Component]|null} - * @example - * const cmp = rule.getComponent(); - * console.log(cmp?.toHTML()); - */ - CssRule.prototype.getComponent = function () { - var _a; - var sel = this.getSelectors(); - var sngl = sel.length == 1 && sel.at(0); - var cmpId = sngl && sngl.isId() && sngl.get('name'); - return (cmpId && ((_a = this.em) === null || _a === void 0 ? void 0 : _a.Components.getById(cmpId))) || null; - }; - /** - * Return the CSS string of the rule - * @param {Object} [opts={}] Options (same as in `getDeclaration`) - * @return {String} CSS string - * @example - * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, { - * atRuleType: 'media', - * atRuleParams: '(min-width: 500px)' - * }); - * cssRule.toCSS() // "@media (min-width: 500px){.class1{color:red;}}" - */ - CssRule.prototype.toCSS = function (opts) { - if (opts === void 0) { opts = {}; } - var result = ''; - var atRule = this.getAtRule(); - var block = this.getDeclaration(opts); - if (block || opts.allowEmpty) { - result = block; - } - if (atRule && result) { - result = "".concat(atRule, "{").concat(result, "}"); - } - return result; - }; - CssRule.prototype.toJSON = function () { - var _a; - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var obj = common/* Model */.Hn.prototype.toJSON.apply(this, args); - if ((_a = this.em) === null || _a === void 0 ? void 0 : _a.getConfig().avoidDefaults) { - var defaults = this.defaults(); - (0,index_all.forEach)(defaults, function (value, key) { - if (obj[key] === value) { - delete obj[key]; - } - }); - // Delete the property used for partial updates - delete obj.style.__p; - if ((0,index_all.isEmpty)(obj.selectors)) - delete obj.selectors; - if ((0,index_all.isEmpty)(obj.style)) - delete obj.style; - } - return obj; - }; - /** - * Compare the actual model with parameters - * @param {Object} selectors Collection of selectors - * @param {String} state Css rule state - * @param {String} width For which device this style is oriented - * @param {Object} ruleProps Other rule props - * @returns {Boolean} - * @private - */ - CssRule.prototype.compare = function (selectors, state, width, ruleProps) { - var _a; - if (ruleProps === void 0) { ruleProps = {}; } - var st = state || ''; - var wd = width || ''; - var selAdd = ruleProps.selectorsAdd || ''; - var atRule = ruleProps.atRuleType || ''; - var sel = !(0,index_all.isArray)(selectors) && !selectors.models ? [selectors] : selectors.models || selectors; - // Fix atRuleType in case is not specified with width - if (wd && !atRule) - atRule = 'media'; - var a1 = sel.map(function (model) { return model.getFullName(); }); - var a2 = (_a = this.get('selectors')) === null || _a === void 0 ? void 0 : _a.map(function (model) { return model.getFullName(); }); - // Check selectors - var a1S = a1.slice().sort(); - var a2S = a2.slice().sort(); - if (a1.length !== a2.length || !a1S.every(function (v, i) { return v === a2S[i]; })) { - return false; - } - // Check other properties - if (this.get('state') !== st || - this.get('mediaText') !== wd || - this.get('selectorsAdd') !== selAdd || - this.get('atRuleType') !== atRule) { - return false; - } - return true; - }; - return CssRule; -}(model_StyleableModel)); -/* harmony default export */ const model_CssRule = (CssRule); - -;// CONCATENATED MODULE: ./src/css_composer/model/CssRules.ts -var CssRules_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var CssRules = /** @class */ (function (_super) { - CssRules_extends(CssRules, _super); - function CssRules(props, opt) { - var _this = _super.call(this, props) || this; - // Inject editor - _this.editor = opt === null || opt === void 0 ? void 0 : opt.em; - // This will put the listener post CssComposer.postLoad - setTimeout(function () { - _this.on('remove', _this.onRemove); - _this.on('add', _this.onAdd); - }); - return _this; - } - CssRules.prototype.toJSON = function (opts) { - var result = common/* Collection */.FE.prototype.toJSON.call(this, opts); - return result.filter(function (rule) { return rule.style && !rule.shallow; }); - }; - CssRules.prototype.onAdd = function (model, c, o) { - model.ensureSelectors(model, c, o); // required for undo - }; - CssRules.prototype.onRemove = function (removed) { - var em = this.editor; - em.stopListening(removed); - em.UndoManager.remove(removed); - }; - /** @ts-ignore */ - CssRules.prototype.add = function (models, opt) { - if (opt === void 0) { opt = {}; } - if (typeof models === 'string') { - models = this.editor.get('Parser').parseCss(models); - } - opt.em = this.editor; - return common/* Collection */.FE.prototype.add.apply(this, [models, opt]); - }; - return CssRules; -}(common/* Collection */.FE)); -/* harmony default export */ const model_CssRules = (CssRules); -CssRules.prototype.model = model_CssRule; - -;// CONCATENATED MODULE: ./src/css_composer/index.ts -/** - * This module manages CSS rules in the canvas. - * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/css_composer/config/config.ts) - * ```js - * const editor = grapesjs.init({ - * cssComposer: { - * // options - * } - * }) - * ``` - * - * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance - * - * ```js - * const css = editor.Css; - * ``` - * - * * [addRules](#addrules) - * * [setRule](#setrule) - * * [getRule](#getrule) - * * [getRules](#getrules) - * * [remove](#remove) - * * [clear](#clear) - * - * [CssRule]: css_rule.html - * - * @module Css - */ -var css_composer_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var css_composer_assign = (undefined && undefined.__assign) || function () { - css_composer_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return css_composer_assign.apply(this, arguments); -}; -var css_composer_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - - - - - - - - - -var CssComposer = /** @class */ (function (_super) { - css_composer_extends(CssComposer, _super); - /** - * Initializes module. Automatically called with a new instance of the editor - * @param {Object} config Configurations - * @private - */ - function CssComposer(em) { - var _this = _super.call(this, em, 'CssComposer', null, {}, css_composer_config_config) || this; - _this.Selectors = model_Selectors; - _this.storageKey = 'styles'; - var config = _this.config; - var ppfx = config.pStylePrefix; - if (ppfx) - config.stylePrefix = ppfx + config.stylePrefix; - // @ts-ignore - config.rules = _this.em.config.style || config.rules || ''; - _this.rules = new model_CssRules([], config); - return _this; - } - /** - * On load callback - * @private - */ - CssComposer.prototype.onLoad = function () { - this.rules.add(this.config.rules, { silent: true }); - }; - /** - * Do stuff after load - * @param {Editor} em - * @private - */ - CssComposer.prototype.postLoad = function () { - var _a; - var um = (_a = this.em) === null || _a === void 0 ? void 0 : _a.get('UndoManager'); - um && um.add(this.getAll()); - }; - CssComposer.prototype.store = function () { - return this.getProjectData(); - }; - CssComposer.prototype.load = function (data) { - return this.loadProjectData(data, { - // @ts-ignore Fix add() first in CssRules - all: this.rules, - }); - }; - /** - * Add new rule to the collection, if not yet exists with the same selectors - * @param {Array} selectors Array of selectors - * @param {String} state Css rule state - * @param {String} width For which device this style is oriented - * @param {Object} props Other props for the rule - * @param {Object} opts Options for the add of new rule - * @return {Model} - * @private - * @example - * var sm = editor.SelectorManager; - * var sel1 = sm.add('myClass1'); - * var sel2 = sm.add('myClass2'); - * var rule = cssComposer.add([sel1, sel2], 'hover'); - * rule.set('style', { - * width: '100px', - * color: '#fff', - * }); - * */ - CssComposer.prototype.add = function (selectors, state, width, opts, addOpts) { - if (opts === void 0) { opts = {}; } - if (addOpts === void 0) { addOpts = {}; } - var s = state || ''; - var w = width || ''; - var opt = css_composer_assign({}, opts); - var rule = this.get(selectors, s, w, opt); - // do not create rules that were found before - // unless this is a single at-rule, for which multiple declarations - // make sense (e.g. multiple `@font-type`s) - if (rule && rule.config && !rule.config.singleAtRule) { - return rule; - } - else { - opt.state = s; - opt.mediaText = w; - opt.selectors = []; - // #4727: Prevent updating atRuleType if already defined - if (w && !opt.atRuleType) { - opt.atRuleType = 'media'; - } - rule = new model_CssRule(opt, this.config); - // @ts-ignore - rule.get('selectors').add(selectors, addOpts); - this.rules.add(rule, addOpts); - return rule; - } - }; - /** - * Get the rule - * @param {String|Array} selectors Array of selectors or selector string, eg `.myClass1.myClass2` - * @param {String} state Css rule state, eg. 'hover' - * @param {String} width Media rule value, eg. '(max-width: 992px)' - * @param {Object} ruleProps Other rule props - * @return {Model|null} - * @private - * @example - * const sm = editor.SelectorManager; - * const sel1 = sm.add('myClass1'); - * const sel2 = sm.add('myClass2'); - * const rule = cssComposer.get([sel1, sel2], 'hover', '(max-width: 992px)'); - * // Update the style - * rule.set('style', { - * width: '300px', - * color: '#000', - * }); - * */ - CssComposer.prototype.get = function (selectors, state, width, ruleProps) { - var slc = selectors; - if ((0,index_all.isString)(selectors)) { - var sm = this.em.Selectors; - var singleSel = selectors.split(',')[0].trim(); - var node = this.em.Parser.parserCss.checkNode({ selectors: singleSel })[0]; - slc = sm.get(node.selectors); - } - return this.rules.find(function (rule) { return rule.compare(slc, state, width, ruleProps); }) || null; - }; - CssComposer.prototype.getAll = function () { - return this.rules; - }; - /** - * Add a raw collection of rule objects - * This method overrides styles, in case, of already defined rule - * @param {String|Array} data CSS string or an array of rule objects, eg. [{selectors: ['class1'], style: {....}}, ..] - * @param {Object} opts Options - * @param {Object} props Additional properties to add on rules - * @return {Array} - * @private - */ - CssComposer.prototype.addCollection = function (data, opts, props) { - if (opts === void 0) { opts = {}; } - if (props === void 0) { props = {}; } - var em = this.em; - var result = []; - if ((0,index_all.isString)(data)) { - data = em.Parser.parseCss(data); - } - var d = data instanceof Array ? data : [data]; - for (var i = 0, l = d.length; i < l; i++) { - var rule = (d[i] || {}); - if (!rule.selectors) - continue; - var sm = em === null || em === void 0 ? void 0 : em.Selectors; - if (!sm) - console.warn('Selector Manager not found'); - var sl = rule.selectors; - var sels = sl instanceof Array ? sl : [sl]; - var newSels = []; - for (var j = 0, le = sels.length; j < le; j++) { - // @ts-ignore - var selec = sm.add(sels[j]); - newSels.push(selec); - } - var modelExists = this.get(newSels, rule.state, rule.mediaText, rule); - var model = this.add(newSels, rule.state, rule.mediaText, rule, opts); - var updateStyle = !modelExists || !opts.avoidUpdateStyle; - var style = rule.style || {}; - (0,mixins.isObject)(props) && model.set(props, opts); - if (updateStyle) { - var styleUpdate = opts.extend ? css_composer_assign(css_composer_assign({}, model.get('style')), style) : style; - model.set('style', styleUpdate, opts); - } - result.push(model); - } - return result; - }; - /** - * Add CssRules via CSS string. - * @param {String} css CSS string of rules to add. - * @returns {Array<[CssRule]>} Array of rules - * @example - * const addedRules = css.addRules('.my-cls{ color: red } @media (max-width: 992px) { .my-cls{ color: darkred } }'); - * // Check rules - * console.log(addedRules.map(rule => rule.toCSS())); - */ - CssComposer.prototype.addRules = function (css) { - return this.addCollection(css); - }; - /** - * Add/update the CssRule. - * @param {String} selectors Selector string, eg. `.myclass` - * @param {Object} style Style properties and values. If the rule exists, styles will be replaced unless `addStyles` option is used. - * @param {Object} [opts={}] Additional properties. - * @param {String} [opts.atRuleType=''] At-rule type, eg. `media`. - * @param {String} [opts.atRuleParams=''] At-rule parameters, eg. `(min-width: 500px)`. - * @param {Boolean} [opts.addStyles=false] If the rule exists already, merge passed styles instead of replacing them. - * @returns {[CssRule]} The new/updated CssRule. - * @example - * // Simple class-based rule - * const rule = css.setRule('.class1.class2', { color: 'red' }); - * console.log(rule.toCSS()) // output: .class1.class2 { color: red } - * // With state and other mixed selector - * const rule = css.setRule('.class1.class2:hover, div#myid', { color: 'red' }); - * // output: .class1.class2:hover, div#myid { color: red } - * // With media - * const rule = css.setRule('.class1:hover', { color: 'red' }, { - * atRuleType: 'media', - * atRuleParams: '(min-width: 500px)', - * }); - * // output: `@media (min-width: 500px) { .class1:hover { color: red } }` - * - * // Update styles of existent rule - * css.setRule('.class1', { color: 'red', background: 'red' }); - * css.setRule('.class1', { color: 'blue' }, { addStyles: true }); - * // output: .class1 { color: blue; background: red } - */ - CssComposer.prototype.setRule = function (selectors, style, opts) { - if (style === void 0) { style = {}; } - if (opts === void 0) { opts = {}; } - var atRuleType = opts.atRuleType, atRuleParams = opts.atRuleParams; - var node = this.em.Parser.parserCss.checkNode({ - selectors: selectors, - style: style, - })[0]; - var state = node.state, selectorsAdd = node.selectorsAdd; - var sm = this.em.Selectors; - var selector = sm.add(node.selectors); - var rule = this.add(selector, state, atRuleParams, { - selectorsAdd: selectorsAdd, - atRule: atRuleType, - }); - if (opts.addStyles) { - rule.addStyle(style, opts); - } - else { - rule.setStyle(style, opts); - } - return rule; - }; - /** - * Get the CssRule. - * @param {String} selectors Selector string, eg. `.myclass:hover` - * @param {Object} [opts={}] Additional properties - * @param {String} [opts.atRuleType=''] At-rule type, eg. `media` - * @param {String} [opts.atRuleParams=''] At-rule parameters, eg. '(min-width: 500px)' - * @returns {[CssRule]} - * @example - * const rule = css.getRule('.myclass1:hover'); - * const rule2 = css.getRule('.myclass1:hover, div#myid'); - * const rule3 = css.getRule('.myclass1', { - * atRuleType: 'media', - * atRuleParams: '(min-width: 500px)', - * }); - */ - CssComposer.prototype.getRule = function (selectors, opts) { - if (opts === void 0) { opts = {}; } - var em = this.em; - var sm = em.Selectors; - var node = em.Parser.parserCss.checkNode({ selectors: selectors })[0]; - // @ts-ignore - var selector = sm.get(node.selectors); - var state = node.state, selectorsAdd = node.selectorsAdd; - var atRuleType = opts.atRuleType, atRuleParams = opts.atRuleParams; - return selector - ? this.get(selector, state, atRuleParams, { - selectorsAdd: selectorsAdd, - atRuleType: atRuleType, - }) - : undefined; - }; - /** - * Get all rules or filtered by a matching selector. - * @param {String} [selector=''] Selector, eg. `.myclass` - * @returns {Array<[CssRule]>} - * @example - * // Take all the component specific rules - * const id = someComponent.getId(); - * const rules = css.getRules(`#${id}`); - * console.log(rules.map(rule => rule.toCSS())) - * // All rules in the project - * console.log(css.getRules()) - */ - CssComposer.prototype.getRules = function (selector) { - var rules = this.getAll(); - if (!selector) - return css_composer_spreadArray([], rules.models, true); - var optRuleSel = { sort: true }; - var sels = (0,index_all.isString)(selector) ? selector.split(',').map(function (s) { return s.trim(); }) : selector; - var result = rules.filter(function (r) { return sels.indexOf(r.getSelectors().getFullString(null, optRuleSel)) >= 0; }); - return result; - }; - /** - * Add/update the CSS rule with id selector - * @param {string} name Id selector name, eg. 'my-id' - * @param {Object} style Style properties and values - * @param {Object} [opts={}] Custom options, like `state` and `mediaText` - * @return {CssRule} The new/updated rule - * @private - * @example - * const rule = css.setIdRule('myid', { color: 'red' }); - * const ruleHover = css.setIdRule('myid', { color: 'blue' }, { state: 'hover' }); - * // This will add current CSS: - * // #myid { color: red } - * // #myid:hover { color: blue } - */ - CssComposer.prototype.setIdRule = function (name, style, opts) { - if (style === void 0) { style = {}; } - if (opts === void 0) { opts = {}; } - var _a = opts.addOpts, addOpts = _a === void 0 ? {} : _a, mediaText = opts.mediaText; - var state = opts.state || ''; - var media = !(0,index_all.isUndefined)(mediaText) ? mediaText : this.em.getCurrentMedia(); - var sm = this.em.Selectors; - var selector = sm.add({ name: name, type: model_Selector.TYPE_ID }, addOpts); - var rule = this.add(selector, state, media, {}, addOpts); - rule.setStyle(style, css_composer_assign(css_composer_assign({}, opts), addOpts)); - return rule; - }; - /** - * Get the CSS rule by id selector - * @param {string} name Id selector name, eg. 'my-id' - * @param {Object} [opts={}] Custom options, like `state` and `mediaText` - * @return {CssRule} - * @private - * @example - * const rule = css.getIdRule('myid'); - * const ruleHover = css.setIdRule('myid', { state: 'hover' }); - */ - CssComposer.prototype.getIdRule = function (name, opts) { - if (opts === void 0) { opts = {}; } - var mediaText = opts.mediaText; - var state = opts.state || ''; - var media = !(0,index_all.isUndefined)(mediaText) ? mediaText : this.em.getCurrentMedia(); - var selector = this.em.Selectors.get(name, model_Selector.TYPE_ID); - return selector && this.get(selector, state, media); - }; - /** - * Add/update the CSS rule with class selector - * @param {string} name Class selector name, eg. 'my-class' - * @param {Object} style Style properties and values - * @param {Object} [opts={}] Custom options, like `state` and `mediaText` - * @return {CssRule} The new/updated rule - * @private - * @example - * const rule = css.setClassRule('myclass', { color: 'red' }); - * const ruleHover = css.setClassRule('myclass', { color: 'blue' }, { state: 'hover' }); - * // This will add current CSS: - * // .myclass { color: red } - * // .myclass:hover { color: blue } - */ - CssComposer.prototype.setClassRule = function (name, style, opts) { - if (style === void 0) { style = {}; } - if (opts === void 0) { opts = {}; } - var state = opts.state || ''; - var media = opts.mediaText || this.em.getCurrentMedia(); - var sm = this.em.Selectors; - var selector = sm.add({ name: name, type: model_Selector.TYPE_CLASS }); - var rule = this.add(selector, state, media); - rule.setStyle(style, opts); - return rule; - }; - /** - * Get the CSS rule by class selector - * @param {string} name Class selector name, eg. 'my-class' - * @param {Object} [opts={}] Custom options, like `state` and `mediaText` - * @return {CssRule} - * @private - * @example - * const rule = css.getClassRule('myclass'); - * const ruleHover = css.getClassRule('myclass', { state: 'hover' }); - */ - CssComposer.prototype.getClassRule = function (name, opts) { - if (opts === void 0) { opts = {}; } - var state = opts.state || ''; - var media = opts.mediaText || this.em.getCurrentMedia(); - var selector = this.em.Selectors.get(name, model_Selector.TYPE_CLASS); - return selector && this.get(selector, state, media); - }; - /** - * Remove rule, by CssRule or matching selector (eg. the selector will match also at-rules like `@media`) - * @param {String|[CssRule]|Array<[CssRule]>} rule CssRule or matching selector. - * @return {Array<[CssRule]>} Removed rules - * @example - * // Remove by CssRule - * const toRemove = css.getRules('.my-cls'); - * css.remove(toRemove); - * // Remove by selector - * css.remove('.my-cls-2'); - */ - CssComposer.prototype.remove = function (rule, opts) { - var toRemove = (0,index_all.isString)(rule) ? this.getRules(rule) : rule; - var result = this.getAll().remove(toRemove, opts); - return (0,index_all.isArray)(result) ? result : [result]; - }; - /** - * Remove all rules - * @return {this} - */ - CssComposer.prototype.clear = function (opts) { - if (opts === void 0) { opts = {}; } - this.getAll().reset([], opts); - return this; - }; - CssComposer.prototype.getComponentRules = function (cmp, opts) { - if (opts === void 0) { opts = {}; } - var state = opts.state, mediaText = opts.mediaText, current = opts.current; - if (current) { - state = this.em.get('state') || ''; - mediaText = this.em.getCurrentMedia(); - } - var id = cmp.getId(); - var rules = this.getAll().filter(function (r) { - if (!(0,index_all.isUndefined)(state) && r.get('state') !== state) - return false; - if (!(0,index_all.isUndefined)(mediaText) && r.get('mediaText') !== mediaText) - return false; - return r.getSelectorsString() === "#".concat(id); - }); - return rules; - }; - /** - * Render the block of CSS rules - * @return {HTMLElement} - * @private - */ - CssComposer.prototype.render = function () { - var _a; - (_a = this.rulesView) === null || _a === void 0 ? void 0 : _a.remove(); - this.rulesView = new view_CssRulesView({ - collection: this.rules, - config: this.config, - }); - return this.rulesView.render().el; - }; - CssComposer.prototype.checkId = function (rule, opts) { - if (opts === void 0) { opts = {}; } - var _a = opts.idMap, idMap = _a === void 0 ? {} : _a; - var changed = []; - if (!Object.keys(idMap).length) - return changed; - var rules = Array.isArray(rule) ? rule : [rule]; - rules.forEach(function (rule) { - var sel = rule.selectors; - if (sel && sel.length == 1) { - var sSel = sel[0]; - if ((0,index_all.isString)(sSel)) { - if (sSel[0] === '#') { - var prevId = sSel.substring(1); - var newId = idMap[prevId]; - if (prevId && newId) { - sel[0] = "#".concat(newId); - changed.push(rule); - } - } - } - else if (sSel.name && sSel.type === model_Selector.TYPE_ID) { - var newId = idMap[sSel.name]; - if (newId) { - sSel.name = newId; - changed.push(rule); - } - } - } - }); - return changed; - }; - CssComposer.prototype.destroy = function () { - var _a; - this.rules.reset(); - this.rules.stopListening(); - (_a = this.rulesView) === null || _a === void 0 ? void 0 : _a.remove(); - }; - return CssComposer; -}(ItemManagerModule)); -/* harmony default export */ const css_composer = (CssComposer); - -;// CONCATENATED MODULE: ./src/block_manager/config/config.ts -var block_manager_config_config_config = { - appendTo: '', - blocks: [], - appendOnClick: false, - custom: false, -}; -/* harmony default export */ const block_manager_config_config = (block_manager_config_config_config); - -;// CONCATENATED MODULE: ./src/block_manager/model/Block.ts -var Block_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - -/** - * @property {String} label Block label, eg. `My block` - * @property {String|Object} content The content of the block. Might be an HTML string or a [Component Defintion](/modules/Components.html#component-definition) - * @property {String} [media=''] HTML string for the media/icon of the block, eg. ` editor.getWrapper().append(block.get('content'))` - * @property {Object} [attributes={}] Block attributes to apply in the view element - * - * @module docsjs.Block - */ -var Block = /** @class */ (function (_super) { - Block_extends(Block, _super); - function Block() { - return _super !== null && _super.apply(this, arguments) || this; - } - Block.prototype.defaults = function () { - return { - label: '', - content: '', - media: '', - category: '', - activate: false, - select: undefined, - resetId: false, - disable: false, - onClick: undefined, - attributes: {}, - }; - }; - Object.defineProperty(Block.prototype, "category", { - get: function () { - var cat = this.get('category'); - return cat instanceof ModuleCategory ? cat : undefined; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Block.prototype, "parent", { - get: function () { - return this.collection; - }, - enumerable: false, - configurable: true - }); - /** - * Get block id - * @returns {String} - */ - Block.prototype.getId = function () { - return this.id; - }; - /** - * Get block label - * @returns {String} - */ - Block.prototype.getLabel = function () { - return this.get('label'); - }; - /** - * Get block media - * @returns {String} - */ - Block.prototype.getMedia = function () { - return this.get('media'); - }; - /** - * Get block content - * @returns {Object|String|Array} - */ - Block.prototype.getContent = function () { - return this.get('content'); - }; - /** - * Get block category label - * @returns {String} - */ - Block.prototype.getCategoryLabel = function () { - var ctg = this.get('category'); - // @ts-ignore - return (0,index_all.isFunction)(ctg === null || ctg === void 0 ? void 0 : ctg.get) ? ctg.get('label') : (ctg === null || ctg === void 0 ? void 0 : ctg.label) ? ctg === null || ctg === void 0 ? void 0 : ctg.label : ctg; - }; - return Block; -}(common/* Model */.Hn)); -/* harmony default export */ const model_Block = (Block); - -;// CONCATENATED MODULE: ./src/block_manager/model/Blocks.ts -var Blocks_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var Blocks = /** @class */ (function (_super) { - Blocks_extends(Blocks, _super); - function Blocks(coll, options) { - var _this = _super.call(this, coll) || this; - _this.em = options.em; - _this.on('add', _this.handleAdd); - return _this; - } - Blocks.prototype.getCategories = function () { - return this.em.Blocks.getCategories(); - }; - Blocks.prototype.handleAdd = function (model) { - this.initCategory(model); - }; - return Blocks; -}(CollectionWithCategories)); -/* harmony default export */ const model_Blocks = (Blocks); -Blocks.prototype.model = model_Block; - -;// CONCATENATED MODULE: ./src/block_manager/types.ts -/**{START_EVENTS}*/ -var BlocksEvents; -(function (BlocksEvents) { - /** - * @event `block:add` New block added to the collection. The [Block] is passed as an argument to the callback. - * @example - * editor.on('block:add', (block) => { ... }); - */ - BlocksEvents["add"] = "block:add"; - /** - * @event `block:remove` Block removed from the collection. The [Block] is passed as an argument to the callback. - * @example - * editor.on('block:remove', (block) => { ... }); - */ - BlocksEvents["remove"] = "block:remove"; - /** - * @event `block:remove:before` Event triggered before Block remove. - * @example - * editor.on('block:remove:before', (block, remove, opts) => { ... }); - */ - BlocksEvents["removeBefore"] = "block:remove:before"; - /** - * @event `block:update` Block updated. The [Block] and the object containing changes are passed as arguments to the callback. - * @example - * editor.on('block:update', (block, updatedProps) => { ... }); - */ - BlocksEvents["update"] = "block:update"; - /** - * @event `block:drag:start` Started dragging block. The [Block] is passed as an argument. - * @example - * editor.on('block:drag:start', (block) => { ... }); - */ - BlocksEvents["dragStart"] = "block:drag:start"; - /** - * @event `block:drag` The block is dragging. The [Block] is passed as an argument. - * @example - * editor.on('block:drag', (block) => { ... }); - */ - BlocksEvents["drag"] = "block:drag"; - /** - * @event `block:drag:stop` Dragging of the block is stopped. The dropped [Component] (if dropped successfully) and the [Block] are passed as arguments. - * @example - * editor.on('block:drag:stop', (component, block) => { ... }); - */ - BlocksEvents["dragEnd"] = "block:drag:stop"; - /** - * @event `block:category:update` Block category updated. - * @example - * editor.on('block:category:update', ({ category, changes }) => { ... }); - */ - BlocksEvents["categoryUpdate"] = "block:category:update"; - /** - * @event `block:custom` Event to use in case of [custom Block Manager UI](https://grapesjs.com/docs/modules/Blocks.html#customization). - * @example - * editor.on('block:custom', ({ container, blocks, ... }) => { ... }); - */ - BlocksEvents["custom"] = "block:custom"; - /** - * @event `block` Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback. - * @example - * editor.on('block', ({ event, model, ... }) => { ... }); - */ - BlocksEvents["all"] = "block"; -})(BlocksEvents || (BlocksEvents = {})); -/**{END_EVENTS}*/ -// need this to avoid the TS documentation generator to break -/* harmony default export */ const block_manager_types = ((/* unused pure expression or super */ null && (BlocksEvents))); - -;// CONCATENATED MODULE: ./src/block_manager/view/BlockView.ts -var BlockView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -var BlockView = /** @class */ (function (_super) { - BlockView_extends(BlockView, _super); - function BlockView(o, config) { - if (config === void 0) { config = {}; } - var _this = _super.call(this, o) || this; - var model = _this.model; - _this.em = config.em; - _this.config = config; - _this.endDrag = _this.endDrag.bind(_this); - _this.ppfx = config.pStylePrefix || ''; - _this.listenTo(model, 'destroy remove', _this.remove); - _this.listenTo(model, 'change', _this.render); - return _this; - } - BlockView.prototype.events = function () { - return { - click: 'handleClick', - mousedown: 'startDrag', - dragstart: 'handleDragStart', - drag: 'handleDrag', - dragend: 'handleDragEnd', - }; - }; - BlockView.prototype.__getModule = function () { - return this.em.Blocks; - }; - BlockView.prototype.handleClick = function (ev) { - var _a = this, config = _a.config, model = _a.model, em = _a.em; - var onClick = model.get('onClick') || config.appendOnClick; - em.trigger('block:click', model, ev); - if (!onClick) { - return; - } - else if ((0,index_all.isFunction)(onClick)) { - return onClick(model, em === null || em === void 0 ? void 0 : em.getEditor(), { event: ev }); - } - var sorter = config.getSorter(); - var content = model.get('content'); - var selected = em.getSelected(); - sorter.setDropContent(content); - var target, valid, insertAt; - // If there is a selected component, try first to append - // the block inside, otherwise, try to place it as a next sibling - if (selected) { - valid = sorter.validTarget(selected.getEl(), content); - if (valid.valid) { - target = selected; - } - else { - var parent_1 = selected.parent(); - if (parent_1) { - valid = sorter.validTarget(parent_1.getEl(), content); - if (valid.valid) { - target = parent_1; - insertAt = parent_1.components().indexOf(selected) + 1; - } - } - } - } - // If no target found yet, try to append the block to the wrapper - if (!target) { - var wrapper = em.getWrapper(); - valid = sorter.validTarget(wrapper.getEl(), content); - if (valid.valid) - target = wrapper; - } - var result = target && target.append(content, { at: insertAt })[0]; - result && em.setSelected(result, { scroll: 1 }); - }; - /** - * Start block dragging - * @private - */ - BlockView.prototype.startDrag = function (e) { - var _a = this, config = _a.config, em = _a.em, model = _a.model; - var disable = model.get('disable'); - //Right or middel click - if (e.button !== 0 || !config.getSorter || this.el.draggable || disable) - return; - em.refreshCanvas(); - var sorter = config.getSorter(); - sorter.__currentBlock = model; - sorter.setDragHelper(this.el, e); - sorter.setDropContent(this.model.get('content')); - sorter.startSort(this.el); - (0,dom.on)(document, 'mouseup', this.endDrag); - }; - BlockView.prototype.handleDragStart = function (ev) { - this.__getModule().__startDrag(this.model, ev); - }; - BlockView.prototype.handleDrag = function (ev) { - this.__getModule().__drag(ev); - }; - BlockView.prototype.handleDragEnd = function () { - this.__getModule().__endDrag(); - }; - /** - * Drop block - * @private - */ - BlockView.prototype.endDrag = function () { - (0,dom/* off */.S1)(document, 'mouseup', this.endDrag); - var sorter = this.config.getSorter(); - // After dropping the block in the canvas the mouseup event is not yet - // triggerd on 'this.doc' and so clicking outside, the sorter, tries to move - // things (throws false positives). As this method just need to drop away - // the block helper I use the trick of 'moved = 0' to void those errors. - sorter.moved = 0; - sorter.endMove(); - }; - BlockView.prototype.render = function () { - var _a; - var _b = this, em = _b.em, el = _b.el, $el = _b.$el, ppfx = _b.ppfx, model = _b.model; - var disable = model.get('disable'); - var attr = model.get('attributes') || {}; - var cls = attr.class || ''; - var className = "".concat(ppfx, "block"); - var label = (em && em.t("blockManager.labels.".concat(model.id))) || model.get('label'); - // @ts-ignore deprecated - var render = model.get('render'); - var media = model.get('media'); - var clsAdd = disable ? "".concat(className, "--disable") : "".concat(ppfx, "four-color-h"); - $el.attr(attr); - el.className = "".concat(cls, " ").concat(className, " ").concat(ppfx, "one-bg ").concat(clsAdd).trim(); - el.innerHTML = "\n ".concat(media ? "
").concat(media, "
") : '', "\n
").concat(label, "
\n "); - el.title = attr.title || ((_a = el.textContent) === null || _a === void 0 ? void 0 : _a.trim()); - el.setAttribute('draggable', "".concat((0,mixins.hasDnd)(em) && !disable ? true : false)); - // @ts-ignore - var result = render && render({ el: el, model: model, className: className, prefix: ppfx }); - if (result) - el.innerHTML = result; - return this; - }; - return BlockView; -}(common/* View */.G7)); -/* harmony default export */ const view_BlockView = (BlockView); - -;// CONCATENATED MODULE: ./src/abstract/ModuleCategoryView.ts -var ModuleCategoryView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ModuleCategoryView_makeTemplateObject = (undefined && undefined.__makeTemplateObject) || function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - - -var CategoryView = /** @class */ (function (_super) { - ModuleCategoryView_extends(CategoryView, _super); - function CategoryView(o, config, catName) { - var _this = _super.call(this, o) || this; - _this.config = config; - var pfx = config.pStylePrefix || ''; - _this.em = config.em; - _this.catName = catName; - _this.pfx = pfx; - _this.caretR = 'fa fa-caret-right'; - _this.caretD = 'fa fa-caret-down'; - _this.iconClass = "".concat(pfx, "caret-icon"); - _this.activeClass = "".concat(pfx, "open"); - _this.className = "".concat(pfx).concat(catName, "-category"); - _this.listenTo(_this.model, 'change:open', _this.updateVisibility); - _this.model.view = _this; - return _this; - } - CategoryView.prototype.events = function () { - return { - 'click [data-title]': 'toggle', - }; - }; - CategoryView.prototype.template = function (_a) { - var pfx = _a.pfx, label = _a.label, catName = _a.catName; - return html(ModuleCategoryView_templateObject_1 || (ModuleCategoryView_templateObject_1 = ModuleCategoryView_makeTemplateObject(["\n
\n \n ", "\n
\n
\n "], ["\n
\n \n ", "\n
\n
\n "])), pfx, pfx, label, pfx, catName); - }; - /** @ts-ignore */ - CategoryView.prototype.attributes = function () { - return this.model.get('attributes') || {}; - }; - CategoryView.prototype.updateVisibility = function () { - if (this.model.get('open')) - this.open(); - else - this.close(); - }; - CategoryView.prototype.open = function () { - this.$el.addClass(this.activeClass); - this.getIconEl().className = "".concat(this.iconClass, " ").concat(this.caretD); - this.getTypeEl().style.display = ''; - }; - CategoryView.prototype.close = function () { - this.$el.removeClass(this.activeClass); - this.getIconEl().className = "".concat(this.iconClass, " ").concat(this.caretR); - this.getTypeEl().style.display = 'none'; - }; - CategoryView.prototype.toggle = function () { - var model = this.model; - model.set('open', !model.get('open')); - }; - CategoryView.prototype.getIconEl = function () { - if (!this.iconEl) { - this.iconEl = this.el.querySelector(".".concat(this.iconClass)); - } - return this.iconEl; - }; - CategoryView.prototype.getTypeEl = function () { - if (!this.typeEl) { - this.typeEl = this.el.querySelector(".".concat(this.pfx).concat(this.catName, "s-c")); - } - return this.typeEl; - }; - CategoryView.prototype.append = function (el) { - this.getTypeEl().appendChild(el); - }; - CategoryView.prototype.render = function () { - var _a = this, em = _a.em, el = _a.el, $el = _a.$el, model = _a.model, pfx = _a.pfx, catName = _a.catName; - var label = em.t("".concat(catName, "Manager.categories.").concat(model.id)) || model.get('label'); - el.innerHTML = this.template({ pfx: pfx, label: label, catName: catName }); - $el.addClass(this.className); - $el.css({ order: model.get('order') }); - this.updateVisibility(); - return this; - }; - return CategoryView; -}(common/* View */.G7)); -/* harmony default export */ const ModuleCategoryView = (CategoryView); -var ModuleCategoryView_templateObject_1; - -;// CONCATENATED MODULE: ./src/block_manager/view/BlocksView.ts -var BlocksView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var BlocksView_assign = (undefined && undefined.__assign) || function () { - BlocksView_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return BlocksView_assign.apply(this, arguments); -}; - - - - -var BlocksView = /** @class */ (function (_super) { - BlocksView_extends(BlocksView, _super); - function BlocksView(opts, config) { - var _this = _super.call(this, opts) || this; - _this.renderedCategories = new Map(); - (0,index_all.bindAll)(_this, 'getSorter', 'onDrag', 'onDrop', 'onMove'); - _this.config = config || {}; - _this.categories = opts.categories || ''; - var ppfx = _this.config.pStylePrefix || ''; - _this.ppfx = ppfx; - _this.noCatClass = "".concat(ppfx, "blocks-no-cat"); - _this.blockContClass = "".concat(ppfx, "blocks-c"); - _this.catsClass = "".concat(ppfx, "block-categories"); - var coll = _this.collection; - _this.listenTo(coll, 'add', _this.addTo); - _this.listenTo(coll, 'reset', _this.render); - _this.em = _this.config.em; - if (_this.em) { - _this.config.getSorter = _this.getSorter; - } - return _this; - } - BlocksView.prototype.__getModule = function () { - return this.em.Blocks; - }; - BlocksView.prototype.updateConfig = function (opts) { - if (opts === void 0) { opts = {}; } - this.config = BlocksView_assign(BlocksView_assign({}, this.config), opts); - }; - /** - * Get sorter - * @private - */ - BlocksView.prototype.getSorter = function () { - var em = this.em; - if (!em) - return; - if (!this.sorter) { - var utils = em.Utils; - var canvas = em.Canvas; - this.sorter = new utils.Sorter({ - // @ts-ignore - container: canvas.getBody(), - placer: canvas.getPlacerEl(), - containerSel: '*', - itemSel: '*', - pfx: this.ppfx, - onStart: this.onDrag, - onEndMove: this.onDrop, - onMove: this.onMove, - document: canvas.getFrameEl().contentDocument, - direction: 'a', - wmargin: 1, - nested: 1, - em: em, - canvasRelative: 1, - }); - } - return this.sorter; - }; - BlocksView.prototype.onDrag = function (ev) { - this.em.stopDefault(); - this.__getModule().__startDrag(this.sorter.__currentBlock, ev); - }; - BlocksView.prototype.onMove = function (ev) { - this.__getModule().__drag(ev); - }; - BlocksView.prototype.onDrop = function (component) { - this.em.runDefault(); - this.__getModule().__endDrag({ component: component }); - delete this.sorter.__currentBlock; - }; - /** - * Add new model to the collection - * @param {Model} model - * @private - * */ - BlocksView.prototype.addTo = function (model) { - this.add(model); - }; - /** - * Render new model inside the view - * @param {Model} model - * @param {Object} fragment Fragment collection - * @private - * */ - BlocksView.prototype.add = function (model, fragment) { - var _a = this, config = _a.config, renderedCategories = _a.renderedCategories; - var attributes = model.get('attributes'); - var view = new view_BlockView({ model: model, attributes: attributes }, config); - var rendered = view.render().el; - var category = model.parent.initCategory(model); - // Check for categories - if (category && this.categories && !config.ignoreCategories) { - var catId = category.getId(); - var categories = this.getCategoriesEl(); - var catView = renderedCategories.get(catId); - if (!catView && categories) { - catView = new ModuleCategoryView({ model: category }, config, 'block').render(); - renderedCategories.set(catId, catView); - categories.appendChild(catView.el); - } - catView === null || catView === void 0 ? void 0 : catView.append(rendered); - return; - } - fragment ? fragment.appendChild(rendered) : this.append(rendered); - }; - BlocksView.prototype.getCategoriesEl = function () { - if (!this.catsEl) { - this.catsEl = this.el.querySelector(".".concat(this.catsClass)); - } - return this.catsEl; - }; - BlocksView.prototype.getBlocksEl = function () { - if (!this.blocksEl) { - this.blocksEl = this.el.querySelector(".".concat(this.noCatClass, " .").concat(this.blockContClass)); - } - return this.blocksEl; - }; - BlocksView.prototype.append = function (el) { - var blocks = this.getBlocksEl(); - blocks && blocks.appendChild(el); - }; - BlocksView.prototype.render = function () { - var _this = this; - var ppfx = this.ppfx; - var frag = document.createDocumentFragment(); - delete this.catsEl; - delete this.blocksEl; - this.renderedCategories = new Map(); - this.el.innerHTML = "\n
\n
\n
\n
\n "); - this.collection.each(function (model) { return _this.add(model, frag); }); - this.append(frag); - var cls = "".concat(this.blockContClass, "s ").concat(ppfx, "one-bg ").concat(ppfx, "two-color"); - this.$el.addClass(cls); - this.rendered = true; - return this; - }; - return BlocksView; -}(common/* View */.G7)); -/* harmony default export */ const view_BlocksView = (BlocksView); - -;// CONCATENATED MODULE: ./src/block_manager/index.ts -var block_manager_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var block_manager_assign = (undefined && undefined.__assign) || function () { - block_manager_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return block_manager_assign.apply(this, arguments); -}; -/** - * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/block_manager/config/config.ts) - * ```js - * const editor = grapesjs.init({ - * blockManager: { - * // options - * } - * }) - * ``` - * - * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. - * - * ```js - * // Listen to events - * editor.on('block:add', (block) => { ... }); - * - * // Use the API - * const blockManager = editor.Blocks; - * blockManager.add(...); - * ``` - * - * {REPLACE_EVENTS} - * - * [Block]: block.html - * [Component]: component.html - * - * @module Blocks - */ - - - - - - - - - -var BlockManager = /** @class */ (function (_super) { - block_manager_extends(BlockManager, _super); - function BlockManager(em) { - var _a; - var _this = _super.call(this, em, 'BlockManager', new model_Blocks(((_a = em.config.blockManager) === null || _a === void 0 ? void 0 : _a.blocks) || [], { em: em }), BlocksEvents, block_manager_config_config) || this; - _this.events = BlocksEvents; - _this.Block = model_Block; - _this.Blocks = model_Blocks; - _this.Category = ModuleCategory; - _this.Categories = ModuleCategories; - _this.storageKey = ''; - // Global blocks collection - _this.blocks = _this.all; - _this.blocksVisible = new model_Blocks(_this.blocks.models, { em: em }); - _this.categories = new ModuleCategories([], { - em: em, - events: { update: BlocksEvents.categoryUpdate }, - }); - // Setup the sync between the global and public collections - _this.blocks.on('add', function (model) { return _this.blocksVisible.add(model); }); - _this.blocks.on('remove', function (model) { return _this.blocksVisible.remove(model); }); - _this.blocks.on('reset', function (coll) { return _this.blocksVisible.reset(coll.models); }); - _this.__onAllEvent = (0,index_all.debounce)(function () { return _this.__trgCustom(); }, 0); - return _this; - } - /** - * Get configuration object - * @name getConfig - * @function - * @return {Object} - */ - BlockManager.prototype.__trgCustom = function () { - this.em.trigger(this.events.custom, this.__customData()); - }; - BlockManager.prototype.__customData = function () { - var _this = this; - var bhv = this.__getBehaviour(); - return { - bm: this, - blocks: this.getAll().models, - container: bhv.container, - dragStart: function (block, ev) { return _this.startDrag(block, ev); }, - drag: function (ev) { return _this.__drag(ev); }, - dragStop: function (cancel) { return _this.endDrag(cancel); }, - }; - }; - BlockManager.prototype.__startDrag = function (block, ev) { - var _a = this, em = _a.em, events = _a.events, blocks = _a.blocks; - var content = block.getContent ? block.getContent() : block; - this._dragBlock = block; - em.set({ dragResult: null, dragContent: content }); - [em, blocks].map(function (i) { return i.trigger(events.dragStart, block, ev); }); - }; - BlockManager.prototype.__drag = function (ev) { - var _a = this, em = _a.em, events = _a.events, blocks = _a.blocks; - var block = this._dragBlock; - [em, blocks].map(function (i) { return i.trigger(events.drag, block, ev); }); - }; - BlockManager.prototype.__endDrag = function (opts) { - if (opts === void 0) { opts = {}; } - var _a = this, em = _a.em, events = _a.events, blocks = _a.blocks; - var block = this._dragBlock; - var cmp = opts.component || em.get('dragResult'); - delete this._dragBlock; - if (cmp && block) { - var oldKey = 'activeOnRender'; - var oldActive = cmp.get && cmp.get(oldKey); - var toActive = block.get('activate') || oldActive; - var toSelect = block.get('select'); - var first = (0,index_all.isArray)(cmp) ? cmp[0] : cmp; - if (toSelect || (toActive && toSelect !== false)) { - em.setSelected(first); - } - if (toActive) { - first.trigger('active'); - oldActive && first.unset(oldKey); - } - if (block.get('resetId')) { - first.onAll(function (cmp) { return cmp.resetId(); }); - } - } - em.set({ dragResult: null, dragContent: null }); - if (block) { - [em, blocks].map(function (i) { return i.trigger(events.dragEnd, cmp, block); }); - } - }; - BlockManager.prototype.__getFrameViews = function () { - return this.em.Canvas.getFrames() - .map(function (frame) { return frame.view; }) - .filter(Boolean); - }; - BlockManager.prototype.__behaviour = function (opts) { - if (opts === void 0) { opts = {}; } - return (this._bhv = block_manager_assign(block_manager_assign({}, (this._bhv || {})), opts)); - }; - BlockManager.prototype.__getBehaviour = function () { - return this._bhv || {}; - }; - BlockManager.prototype.startDrag = function (block, ev) { - this.__startDrag(block, ev); - this.__getFrameViews().forEach(function (fv) { var _a; return (_a = fv.droppable) === null || _a === void 0 ? void 0 : _a.startCustom(); }); - }; - BlockManager.prototype.endDrag = function (cancel) { - this.__getFrameViews().forEach(function (fv) { var _a; return (_a = fv.droppable) === null || _a === void 0 ? void 0 : _a.endCustom(cancel); }); - this.__endDrag(); - }; - BlockManager.prototype.postRender = function () { - var _a = this, categories = _a.categories, config = _a.config, em = _a.em; - var collection = this.blocksVisible; - this.blocksView = new view_BlocksView({ collection: collection, categories: categories }, block_manager_assign(block_manager_assign({}, config), { em: em })); - this.__appendTo(collection.models); - this.__trgCustom(); - }; - /** - * Add new block. - * @param {String} id Block ID - * @param {[Block]} props Block properties - * @returns {[Block]} Added block - * @example - * blockManager.add('h1-block', { - * label: 'Heading', - * content: '

Put your title here

', - * category: 'Basic', - * attributes: { - * title: 'Insert h1 block' - * } - * }); - */ - BlockManager.prototype.add = function (id, props, opts) { - if (opts === void 0) { opts = {}; } - var prp = props || {}; - prp.id = id; - return this.blocks.add(prp, opts); - }; - /** - * Get the block by id. - * @param {String} id Block id - * @returns {[Block]} - * @example - * const block = blockManager.get('h1-block'); - * console.log(JSON.stringify(block)); - * // {label: 'Heading', content: '

Put your ...', ...} - */ - BlockManager.prototype.get = function (id) { - return this.blocks.get(id); - }; - /** - * Return all blocks. - * @returns {Collection<[Block]>} - * @example - * const blocks = blockManager.getAll(); - * console.log(JSON.stringify(blocks)); - * // [{label: 'Heading', content: '

Put your ...'}, ...] - */ - BlockManager.prototype.getAll = function () { - return this.blocks; - }; - /** - * Return the visible collection, which containes blocks actually rendered - * @returns {Collection<[Block]>} - */ - BlockManager.prototype.getAllVisible = function () { - return this.blocksVisible; - }; - /** - * Remove block. - * @param {String|[Block]} block Block or block ID - * @returns {[Block]} Removed block - * @example - * const removed = blockManager.remove('BLOCK_ID'); - * // or by passing the Block - * const block = blockManager.get('BLOCK_ID'); - * blockManager.remove(block); - */ - BlockManager.prototype.remove = function (block, opts) { - if (opts === void 0) { opts = {}; } - return this.__remove(block, opts); - }; - /** - * Get all available categories. - * It's possible to add categories only within blocks via 'add()' method - * @return {Array|Collection} - */ - BlockManager.prototype.getCategories = function () { - return this.categories; - }; - /** - * Return the Blocks container element - * @return {HTMLElement} - */ - BlockManager.prototype.getContainer = function () { - var _a; - return (_a = this.blocksView) === null || _a === void 0 ? void 0 : _a.el; - }; - /** - * Returns currently dragging block. - * Updated when the drag starts and cleared once it's done. - * @returns {[Block]|undefined} - */ - BlockManager.prototype.getDragBlock = function () { - return this._dragBlock; - }; - /** - * Get blocks by category. - * @example - * blockManager.getBlocksByCategory(); - * // Returns an array of items of this type - * // > { category?: Category; items: Block[] } - * - * // NOTE: The item without category is the one containing blocks without category. - * - * // You can also get the same output format by passing your own array of Blocks - * const myFilteredBlocks: Block[] = [...]; - * blockManager.getBlocksByCategorymyFilteredBlocks - */ - BlockManager.prototype.getBlocksByCategory = function (blocks) { - return getItemsByCategory(blocks || this.getAll().models); - }; - /** - * Render blocks - * @param {Array} blocks Blocks to render, without the argument will render all global blocks - * @param {Object} [opts={}] Options - * @param {Boolean} [opts.external] Render blocks in a new container (HTMLElement will be returned) - * @param {Boolean} [opts.ignoreCategories] Render blocks without categories - * @return {HTMLElement} Rendered element - * @example - * // Render all blocks (inside the global collection) - * blockManager.render(); - * - * // Render new set of blocks - * const blocks = blockManager.getAll(); - * const filtered = blocks.filter(block => block.get('category') == 'sections') - * - * blockManager.render(filtered); - * // Or a new set from an array - * blockManager.render([ - * {label: 'Label text', content: '
Content
'} - * ]); - * - * // Back to blocks from the global collection - * blockManager.render(); - * - * // You can also render your blocks outside of the main block container - * const newBlocksEl = blockManager.render(filtered, { external: true }); - * document.getElementById('some-id').appendChild(newBlocksEl); - */ - BlockManager.prototype.render = function (blocks, opts) { - if (opts === void 0) { opts = {}; } - var _a = this, categories = _a.categories, config = _a.config, em = _a.em; - var toRender = blocks || this.getAll().models; - if (opts.external) { - var collection = new model_Blocks(toRender, { em: em }); - return new view_BlocksView({ collection: collection, categories: categories }, block_manager_assign(block_manager_assign({ em: em }, config), opts)).render().el; - } - if (this.blocksView) { - this.blocksView.updateConfig(opts); - this.blocksView.collection.reset(toRender); - if (!this.blocksView.rendered) { - this.blocksView.render(); - this.blocksView.rendered = true; - } - } - return this.getContainer(); - }; - BlockManager.prototype.destroy = function () { - var _a; - var colls = [this.blocks, this.blocksVisible, this.categories]; - colls.map(function (c) { return c.stopListening(); }); - colls.map(function (c) { return c.reset(); }); - (_a = this.blocksView) === null || _a === void 0 ? void 0 : _a.remove(); - }; - return BlockManager; -}(ItemManagerModule)); -/* harmony default export */ const block_manager = (BlockManager); - -;// CONCATENATED MODULE: ./src/selector_manager/config/config.ts -var selector_manager_config_config_config = { - stylePrefix: 'clm-', - appendTo: '', - selectors: [], - states: [{ name: 'hover' }, { name: 'active' }, { name: 'nth-of-type(2n)' }], - iconAdd: '', - iconSync: '', - iconTagOn: '', - iconTagOff: '', - iconTagRemove: '', - componentFirst: false, - custom: false, -}; -/* harmony default export */ const selector_manager_config_config = (selector_manager_config_config_config); - -;// CONCATENATED MODULE: ./src/selector_manager/model/State.ts -var State_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - -/** - * @typedef State - * @property {String} name State name, eg. `hover`, `nth-of-type(2n)` - * @property {String} label State label, eg. `Hover`, `Even/Odd` - */ -var State = /** @class */ (function (_super) { - State_extends(State, _super); - function State() { - return _super !== null && _super.apply(this, arguments) || this; - } - State.prototype.defaults = function () { - return { - name: '', - label: '', - }; - }; - /** - * Get state name - * @returns {String} - */ - State.prototype.getName = function () { - return this.get('name'); - }; - /** - * Get state label. If label was not provided, the name will be returned. - * @returns {String} - */ - State.prototype.getLabel = function () { - return this.get('label') || this.getName(); - }; - return State; -}(common/* Model */.Hn)); -/* harmony default export */ const model_State = (State); -State.prototype.idAttribute = 'name'; - -;// CONCATENATED MODULE: ./src/selector_manager/view/ClassTagView.ts -var ClassTagView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ClassTagView_makeTemplateObject = (undefined && undefined.__makeTemplateObject) || function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - - -var inputProp = 'contentEditable'; -var ClassTagView = /** @class */ (function (_super) { - ClassTagView_extends(ClassTagView, _super); - function ClassTagView(o) { - if (o === void 0) { o = {}; } - var _this = _super.call(this, o) || this; - var config = o.config || {}; - _this.config = config; - _this.module = o.module; - _this.coll = o.coll || null; - _this.pfx = config.stylePrefix || ''; - _this.ppfx = config.pStylePrefix || ''; - _this.em = config.em; - _this.listenTo(_this.model, 'change:active', _this.updateStatus); - return _this; - } - ClassTagView.prototype.template = function () { - var _a = this, pfx = _a.pfx, model = _a.model, config = _a.config; - var label = model.get('label') || ''; - return html(ClassTagView_templateObject_1 || (ClassTagView_templateObject_1 = ClassTagView_makeTemplateObject(["\n \n ", "\n $", " \n "], ["\n \n ", "\n $", " \n "])), pfx, pfx, pfx, label, pfx, pfx, config.iconTagRemove); - }; - ClassTagView.prototype.events = function () { - return { - 'click [data-tag-remove]': 'removeTag', - 'click [data-tag-status]': 'changeStatus', - 'dblclick [data-tag-name]': 'startEditTag', - 'focusout [data-tag-name]': 'endEditTag', - }; - }; - /** - * Returns the element which containes the anme of the tag - * @return {HTMLElement} - */ - ClassTagView.prototype.getInputEl = function () { - if (!this.inputEl) { - this.inputEl = this.el.querySelector('[data-tag-name]'); - } - return this.inputEl; - }; - /** - * Start editing tag - * @private - */ - ClassTagView.prototype.startEditTag = function () { - var em = this.em; - var inputEl = this.getInputEl(); - inputEl[inputProp] = 'true'; - inputEl.focus(); - em === null || em === void 0 ? void 0 : em.setEditing(true); - }; - /** - * End editing tag. If the class typed already exists the - * old one will be restored otherwise will be changed - * @private - */ - ClassTagView.prototype.endEditTag = function () { - var _a = this, model = _a.model, em = _a.em; - var inputEl = this.getInputEl(); - var label = inputEl.textContent || ''; - var sm = em === null || em === void 0 ? void 0 : em.Selectors; - inputEl[inputProp] = 'false'; - em === null || em === void 0 ? void 0 : em.setEditing(false); - if (sm && sm.rename(model, label) !== model) { - inputEl.innerText = model.getLabel(); - } - }; - /** - * Update status of the tag - * @private - */ - ClassTagView.prototype.changeStatus = function () { - var model = this.model; - model.set('active', !model.getActive()); - }; - /** - * Remove tag from the selected component - * @param {Object} e - * @private - */ - ClassTagView.prototype.removeTag = function () { - this.module.removeSelected(this.model); - }; - /** - * Update status of the checkbox - * @private - */ - ClassTagView.prototype.updateStatus = function () { - var _a = this, model = _a.model, $el = _a.$el, config = _a.config; - var iconTagOn = config.iconTagOn, iconTagOff = config.iconTagOff; - var $chk = $el.find('[data-tag-status]'); - if (model.get('active')) { - $chk.html(iconTagOn); - $el.removeClass('opac50'); - } - else { - $chk.html(iconTagOff); - $el.addClass('opac50'); - } - }; - ClassTagView.prototype.render = function () { - var _a = this, pfx = _a.pfx, ppfx = _a.ppfx, $el = _a.$el, model = _a.model; - var mainCls = "".concat(pfx, "tag"); - var classes = ["".concat(mainCls, " ").concat(ppfx, "three-bg")]; - model.get('protected') && classes.push("".concat(mainCls, "-protected")); - $el.html(this.template()); - $el.attr('class', classes.join(' ')); - this.updateStatus(); - return this; - }; - return ClassTagView; -}(common/* View */.G7)); -/* harmony default export */ const view_ClassTagView = (ClassTagView); -var ClassTagView_templateObject_1; - -;// CONCATENATED MODULE: ./src/selector_manager/view/ClassTagsView.ts -var ClassTagsView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var ClassTagsView_makeTemplateObject = (undefined && undefined.__makeTemplateObject) || function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - - - - - -var ClassTagsView = /** @class */ (function (_super) { - ClassTagsView_extends(ClassTagsView, _super); - function ClassTagsView(o) { - if (o === void 0) { o = {}; } - var _this = _super.call(this, o) || this; - _this.config = o.config || {}; - _this.pfx = _this.config.stylePrefix || ''; - _this.ppfx = _this.config.pStylePrefix || ''; - _this.className = _this.pfx + 'tags'; - _this.stateInputId = _this.pfx + 'states'; - _this.stateInputC = _this.pfx + 'input-c'; - _this.states = _this.config.states || []; - var em = _this.config.em; - var coll = _this.collection; - _this.target = em; - var md = em.Selectors; - _this.module = md; - _this.em = em; - _this.componentChanged = (0,index_all.debounce)(_this.componentChanged.bind(_this), 0); - _this.checkSync = (0,index_all.debounce)(_this.checkSync.bind(_this), 0); - var eventCmpUpdate = dom_components_types/* ComponentsEvents */.g.update; - var evClsUp = "".concat(eventCmpUpdate, ":classes"); - var toList = "component:toggled ".concat(evClsUp); - var toListCls = "".concat(evClsUp, " ").concat(eventCmpUpdate, ":attributes:id change:state"); - _this.listenTo(em, toList, _this.componentChanged); - _this.listenTo(em, 'styleManager:update', _this.componentChanged); - _this.listenTo(em, toListCls, _this.__handleStateChange); - _this.listenTo(em, 'styleable:change change:device', _this.checkSync); - _this.listenTo(coll, 'add', _this.addNew); - _this.listenTo(coll, 'reset', _this.renderClasses); - _this.listenTo(coll, 'remove', _this.tagRemoved); - _this.listenTo(md.getAll(), md.events.state, (0,index_all.debounce)(function () { return _this.renderStates(); }, 0)); - _this.delegateEvents(); - return _this; - } - ClassTagsView.prototype.template = function (_a) { - var labelInfo = _a.labelInfo, labelHead = _a.labelHead, iconSync = _a.iconSync, iconAdd = _a.iconAdd, pfx = _a.pfx, ppfx = _a.ppfx; - return html(ClassTagsView_templateObject_1 || (ClassTagsView_templateObject_1 = ClassTagsView_makeTemplateObject(["
\n
", "
\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n $", " \n $", " \n
\n
\n
", ":
\n
\n
"], ["
\n
", "
\n
\n \n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n $", " \n $", " \n
\n
\n
", ":
\n
\n
"])), pfx, pfx, pfx, pfx, labelHead, pfx, pfx, pfx, ppfx, ppfx, ppfx, pfx, ppfx, ppfx, pfx, ppfx, pfx, pfx, pfx, pfx, pfx, iconAdd, pfx, pfx, iconSync, pfx, pfx, labelInfo, pfx); - }; - ClassTagsView.prototype.events = function () { - return { - 'change [data-states]': 'stateChanged', - 'click [data-add]': 'startNewTag', - 'focusout [data-input]': 'endNewTag', - 'keyup [data-input]': 'onInputKeyUp', - 'click [data-sync-style]': 'syncStyle', - }; - }; - ClassTagsView.prototype.syncStyle = function () { - var em = this.em; - var target = this.getTarget(); - var cssC = em.Css; - var opts = { noDisabled: 1 }; - var selectors = this.getCommonSelectors({ opts: opts }); - var state = em.get('state'); - var mediaText = em.getCurrentMedia(); - var ruleComponents = []; - var rule = cssC.get(selectors, state, mediaText) || cssC.add(selectors, state, mediaText); - var style; - this.getTargets().forEach(function (target) { - var ruleComponent = cssC.getIdRule(target.getId(), { - state: state, - mediaText: mediaText, - }); - style = ruleComponent.getStyle(); - ruleComponent.setStyle({}); - ruleComponents.push(ruleComponent); - }); - style && rule.addStyle(style); - em.trigger('component:toggled'); - em.trigger('component:sync-style', { - component: target, - selectors: selectors, - mediaText: mediaText, - rule: rule, - ruleComponents: ruleComponents, - state: state, - }); - }; - /** - * Triggered when a tag is removed from collection - * @param {Object} model Removed model - * @private - */ - ClassTagsView.prototype.tagRemoved = function (model) { - this.updateStateVis(); - }; - /** - * Add new model - * @param {Object} model - * @private - */ - ClassTagsView.prototype.addNew = function (model) { - this.addToClasses(model); - }; - /** - * Start tag creation - * @param {Object} e - * @private - */ - ClassTagsView.prototype.startNewTag = function () { - var _a, _b; - (_a = this.$addBtn) === null || _a === void 0 ? void 0 : _a.css({ display: 'none' }); - (_b = this.$input) === null || _b === void 0 ? void 0 : _b.show().focus(); - }; - /** - * End tag creation - * @param {Object} e - * @private - */ - ClassTagsView.prototype.endNewTag = function () { - var _a, _b; - (_a = this.$addBtn) === null || _a === void 0 ? void 0 : _a.css({ display: '' }); - (_b = this.$input) === null || _b === void 0 ? void 0 : _b.hide().val(''); - }; - /** - * Checks what to do on keyup event - * @param {Object} e - * @private - */ - ClassTagsView.prototype.onInputKeyUp = function (e) { - var _a; - if (e.keyCode === 13) { - e.preventDefault(); - this.addNewTag((_a = this.$input) === null || _a === void 0 ? void 0 : _a.val()); - } - else if (e.keyCode === 27) { - this.endNewTag(); - } - }; - ClassTagsView.prototype.checkStates = function () { - var state = this.em.getState(); - var statesEl = this.getStates(); - statesEl && statesEl.val(state); - }; - /** - * Triggered when component is changed - * @param {Object} e - * @public - */ - ClassTagsView.prototype.componentChanged = function (_a) { - var _b = _a === void 0 ? {} : _a, targets = _b.targets; - this.updateSelection(targets); - }; - ClassTagsView.prototype.updateSelection = function (targets) { - var trgs = targets || this.getTargets(); - trgs = (0,index_all.isArray)(trgs) ? trgs : [trgs]; - var selectors = []; - if (trgs && trgs.length) { - selectors = this.getCommonSelectors({ targets: trgs }); - //@ts-ignore TODO This parameters are not in use why do we have them? - this.checkSync({ validSelectors: selectors }); - } - this.collection.reset(selectors); - this.updateStateVis(trgs); - this.module.__trgCustom(); - return selectors; - }; - ClassTagsView.prototype.getCommonSelectors = function (_a) { - var _b = _a === void 0 ? {} : _a, targets = _b.targets, _c = _b.opts, opts = _c === void 0 ? {} : _c; - var trgs = targets || this.getTargets(); - return this.module.__getCommonSelectors(trgs, opts); - }; - ClassTagsView.prototype._commonSelectors = function () { - var _a; - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return (_a = this.module).__common.apply(_a, args); - }; - ClassTagsView.prototype.checkSync = function () { - var _a = this, $btnSyncEl = _a.$btnSyncEl, config = _a.config, collection = _a.collection; - var target = this.getTarget(); - var hasStyle; - if (target && config.componentFirst && collection.length) { - var style = target.getStyle(); - hasStyle = !(0,index_all.isEmpty)(style); - } - $btnSyncEl && $btnSyncEl[hasStyle ? 'show' : 'hide'](); - }; - ClassTagsView.prototype.getTarget = function () { - return this.target.getSelected(); - }; - ClassTagsView.prototype.getTargets = function () { - return this.target.getSelectedAll(); - }; - /** - * Update states visibility. Hides states in case there is no tags - * inside collection - * @private - */ - ClassTagsView.prototype.updateStateVis = function (targets) { - var em = this.em; - var avoidInline = em && em.getConfig().avoidInlineStyle; - var display = this.collection.length || avoidInline ? '' : 'none'; - this.getStatesC().css('display', display); - this.updateSelector(targets); - }; - ClassTagsView.prototype.__handleStateChange = function () { - this.updateSelector(this.getTargets()); - }; - /** - * Update selector helper - * @return {this} - * @private - */ - ClassTagsView.prototype.updateSelector = function (targets) { - var _this = this; - var elSel = this.el.querySelector('[data-selected]'); - var result = []; - var trgs = targets || this.getTargets(); - trgs = (0,index_all.isArray)(trgs) ? trgs : [trgs]; - trgs.forEach(function (target) { return result.push(_this.__getName(target)); }); - elSel && (elSel.innerHTML = result.join(', ')); - this.checkStates(); - }; - ClassTagsView.prototype.__getName = function (target) { - var _a = this, pfx = _a.pfx, config = _a.config, em = _a.em; - var selectedName = config.selectedName, componentFirst = config.componentFirst; - var result; - if ((0,index_all.isString)(target)) { - result = html(templateObject_2 || (templateObject_2 = ClassTagsView_makeTemplateObject(["", ""], ["", ""])), pfx, target); - } - else { - var sel = target === null || target === void 0 ? void 0 : target.getSelectors(); - if (!sel) - return ''; - var selectors = sel.getStyleable(); - var state = em.get('state'); - var idRes = target.getId - ? html(templateObject_3 || (templateObject_3 = ClassTagsView_makeTemplateObject(["", "\n #", ""], ["", "\n #", ""])), pfx, target.getName(), pfx, target.getId()) : ''; - result = this.collection.getFullString(selectors); - result = result ? html(templateObject_4 || (templateObject_4 = ClassTagsView_makeTemplateObject(["", ""], ["", ""])), pfx, result) : target.get('selectorsAdd') || idRes; - result = componentFirst && idRes ? idRes : result; - result += state ? html(templateObject_5 || (templateObject_5 = ClassTagsView_makeTemplateObject([":", ""], [":", ""])), pfx, state) : ''; - result = selectedName ? selectedName({ result: result, state: state, target: target }) : result; - } - return result && "").concat(result, ""); - }; - /** - * Triggered when the select with states is changed - * @param {Object} e - * @private - */ - ClassTagsView.prototype.stateChanged = function (ev) { - var em = this.em; - var value = ev.target.value; - em.set('state', value); - }; - /** - * Add new tag to collection, if possible, and to the component - * @param {Object} e - * @private - */ - ClassTagsView.prototype.addNewTag = function (value) { - var label = value.trim(); - if (!label) - return; - this.module.addSelected({ label: label }); - this.endNewTag(); - // this.updateStateVis(); // Check if required - }; - /** - * Add new object to collection - * @param {Object} model Model - * @param {Object} fragmentEl Fragment collection - * @return {Object} Object created - * @private - * */ - ClassTagsView.prototype.addToClasses = function (model, fragmentEl) { - var fragment = fragmentEl; - var classes = this.getClasses(); - var rendered = new view_ClassTagView({ - model: model, - config: this.config, - coll: this.collection, - module: this.module, - }).render().el; - fragment ? fragment.appendChild(rendered) : classes.append(rendered); - return rendered; - }; - /** - * Render the collection of classes - * @private - */ - ClassTagsView.prototype.renderClasses = function () { - var _this = this; - var frag = document.createDocumentFragment(); - var classes = this.getClasses(); - classes.empty(); - this.collection.each(function (model) { return _this.addToClasses(model, frag); }); - classes.append(frag); - }; - /** - * Return classes element - * @return {HTMLElement} - * @private - */ - ClassTagsView.prototype.getClasses = function () { - return this.$el.find('[data-selectors]'); - }; - /** - * Return states element - * @return {HTMLElement} - * @private - */ - ClassTagsView.prototype.getStates = function () { - if (!this.$states) { - var el = this.$el.find('[data-states]'); - this.$states = el[0] && el; - } - return this.$states; - }; - /** - * Return states container element - * @return {HTMLElement} - * @private - */ - ClassTagsView.prototype.getStatesC = function () { - if (!this.$statesC) - this.$statesC = this.$el.find('#' + this.stateInputC); - return this.$statesC; - }; - ClassTagsView.prototype.renderStates = function () { - var _a = this, module = _a.module, em = _a.em; - var labelStates = em.t('selectorManager.emptyState'); - var options = module - .getStates() - .map(function (state) { - var label = em.t("selectorManager.states.".concat(state.id)) || state.getLabel() || state.id; - return ""); - }) - .join(''); - var statesEl = this.getStates(); - statesEl && statesEl.html("").concat(options)); - this.checkStates(); - }; - ClassTagsView.prototype.render = function () { - var _a = this, em = _a.em, pfx = _a.pfx, ppfx = _a.ppfx, config = _a.config, $el = _a.$el, el = _a.el; - var render = config.render, iconSync = config.iconSync, iconAdd = config.iconAdd; - var tmpOpts = { - iconSync: iconSync, - iconAdd: iconAdd, - labelHead: em.t('selectorManager.label'), - labelInfo: em.t('selectorManager.selected'), - ppfx: ppfx, - pfx: pfx, - el: el, - }; - $el.html(this.template(tmpOpts)); - var renderRes = render && render(tmpOpts); - renderRes && renderRes !== el && $el.empty().append(renderRes); - this.$input = $el.find('[data-input]'); - this.$addBtn = $el.find('[data-add]'); - this.$classes = $el.find('#' + pfx + 'tags-c'); - this.$btnSyncEl = $el.find('[data-sync-style]'); - this.$input.hide(); - this.renderStates(); - this.renderClasses(); - $el.attr('class', "".concat(this.className, " ").concat(ppfx, "one-bg ").concat(ppfx, "two-color")); - return this; - }; - return ClassTagsView; -}(common/* View */.G7)); -/* harmony default export */ const view_ClassTagsView = (ClassTagsView); -var ClassTagsView_templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5; - -;// CONCATENATED MODULE: ./src/selector_manager/index.ts -/** - * Selectors in GrapesJS are used in CSS Composer inside Rules and in Components as classes. To illustrate this concept let's take - * a look at this code: - * - * ```css - * span > #send-btn.btn{ - * ... - * } - * ``` - * ```html - * - * - * - * ``` - * - * In this scenario we get: - * * span -> selector of type `tag` - * * send-btn -> selector of type `id` - * * btn -> selector of type `class` - * - * So, for example, being `btn` the same class entity it'll be easier to refactor and track things. - * - * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/selector_manager/config/config.ts) - * ```js - * const editor = grapesjs.init({ - * selectorManager: { - * // options - * } - * }) - * ``` - * - * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance. - * - * ```js - * // Listen to events - * editor.on('selector:add', (selector) => { ... }); - * - * // Use the API - * const sm = editor.Selectors; - * sm.add(...); - * ``` - * - * ## Available Events - * * `selector:add` - Selector added. The [Selector] is passed as an argument to the callback. - * * `selector:remove` - Selector removed. The [Selector] is passed as an argument to the callback. - * * `selector:update` - Selector updated. The [Selector] and the object containing changes are passed as arguments to the callback. - * * `selector:state` - States changed. An object containing all the available data about the triggered event is passed as an argument to the callback. - * * `selector` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback. - * - * ## Methods - * * [getConfig](#getconfig) - * * [add](#add) - * * [get](#get) - * * [remove](#remove) - * * [rename](#rename) - * * [getAll](#getall) - * * [setState](#setstate) - * * [getState](#getstate) - * * [getStates](#getstates) - * * [setStates](#setstates) - * * [getSelected](#getselected) - * * [addSelected](#addselected) - * * [removeSelected](#removeselected) - * * [getSelectedTargets](#getselectedtargets) - * * [setComponentFirst](#setcomponentfirst) - * * [getComponentFirst](#getcomponentfirst) - * - * [Selector]: selector.html - * [State]: state.html - * [Component]: component.html - * [CssRule]: css_rule.html - * - * @module Selectors - */ -var selector_manager_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var selector_manager_assign = (undefined && undefined.__assign) || function () { - selector_manager_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return selector_manager_assign.apply(this, arguments); -}; -var selector_manager_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - - - - - - - - - - -var isId = function (str) { return (0,index_all.isString)(str) && str[0] == '#'; }; -var isClass = function (str) { return (0,index_all.isString)(str) && str[0] == '.'; }; -var selector_manager_evAll = 'selector'; -var selector_manager_evPfx = "".concat(selector_manager_evAll, ":"); -var selector_manager_evAdd = "".concat(selector_manager_evPfx, "add"); -var selector_manager_evUpdate = "".concat(selector_manager_evPfx, "update"); -var selector_manager_evRemove = "".concat(selector_manager_evPfx, "remove"); -var selector_manager_evRemoveBefore = "".concat(selector_manager_evRemove, ":before"); -var evCustom = "".concat(selector_manager_evPfx, "custom"); -var evState = "".concat(selector_manager_evPfx, "state"); -var selectorEvents = { - all: selector_manager_evAll, - update: selector_manager_evUpdate, - add: selector_manager_evAdd, - remove: selector_manager_evRemove, - removeBefore: selector_manager_evRemoveBefore, - state: evState, - custom: evCustom, -}; -var SelectorManager = /** @class */ (function (_super) { - selector_manager_extends(SelectorManager, _super); - /** - * Get configuration object - * @name getConfig - * @function - * @return {Object} - */ - function SelectorManager(em) { - var _this = _super.call(this, em, 'SelectorManager', new model_Selectors([]), selectorEvents, selector_manager_config_config, { skipListen: true }) || this; - _this.Selector = model_Selector; - _this.Selectors = model_Selectors; - _this.storageKey = ''; - (0,index_all.bindAll)(_this, '__updateSelectedByComponents'); - var config = _this.config; - var ppfx = config.pStylePrefix; - if (ppfx) - config.stylePrefix = ppfx + config.stylePrefix; - // Global selectors container - _this.all = new model_Selectors(config.selectors); - _this.selected = new model_Selectors([], { em: em, config: config }); - _this.states = new common/* Collection */.FE(config.states.map(function (state) { return new model_State(state); }), { model: model_State }); - _this.model = new common/* Model */.Hn({ cFirst: config.componentFirst, _undo: true }); - _this.__update = (0,index_all.debounce)(function () { return _this.__trgCustom(); }, 0); - _this.__initListen({ - collections: [_this.states, _this.selected], - propagate: [{ entity: _this.states, event: _this.events.state }], - }); - em.on('change:state', function (m, value) { return em.trigger(evState, value); }); - _this.model.on('change:cFirst', function (m, value) { return em.trigger('selector:type', value); }); - var eventCmpUpdateCls = "".concat(dom_components_types/* ComponentsEvents */.g.update, ":classes"); - em.on("component:toggled ".concat(eventCmpUpdateCls), _this.__updateSelectedByComponents); - var listenTo = "component:toggled ".concat(eventCmpUpdateCls, " change:device styleManager:update selector:state selector:type style:target"); - _this.model.listenTo(em, listenTo, function () { return _this.__update(); }); - return _this; - } - SelectorManager.prototype.__trgCustom = function (opts) { - this.em.trigger(this.events.custom, this.__customData(opts)); - }; - SelectorManager.prototype.getAll = function (opts) { - if (opts === void 0) { opts = {}; } - return (this.all ? (opts.array ? selector_manager_spreadArray([], this.all.models, true) : this.all) : []); - }; - SelectorManager.prototype.__customData = function (opts) { - if (opts === void 0) { opts = {}; } - this.__ctn = this.__ctn || opts.container; - return { - states: this.getStates(), - selected: this.getSelected(), - container: this.__ctn, - }; - }; - // postLoad() { - // this.__postLoad(); - // const { em, model } = this; - // const um = em.get('UndoManager'); - // um && um.add(model); - // um && um.add(this.pages); - // }, - SelectorManager.prototype.postRender = function () { - this.__appendTo(); - this.__trgCustom(); - }; - SelectorManager.prototype.select = function (value, opts) { - if (opts === void 0) { opts = {}; } - var targets = Array.isArray(value) ? value : [value]; - var toSelect = this.em.Styles.select(targets, opts); - this.selected.reset(this.__getCommonSelectors(toSelect)); - var selTags = this.selectorTags; - var res = toSelect - .filter(function (i) { return i; }) - .map(function (sel) { return ((0,mixins.isComponent)(sel) ? sel : (0,mixins.isRule)(sel) && !sel.get('selectorsAdd') ? sel : sel.getSelectorsString()); }); - selTags && selTags.componentChanged({ targets: res }); - return this; - }; - SelectorManager.prototype.addSelector = function (name, opts, cOpts) { - if (opts === void 0) { opts = {}; } - if (cOpts === void 0) { cOpts = {}; } - var props = selector_manager_assign({}, opts); - if ((0,index_all.isObject)(name)) { - props = name; - } - else { - props.name = name; - } - if (isId(props.name)) { - props.name = props.name.substr(1); - props.type = model_Selector.TYPE_ID; - } - else if (isClass(props.name)) { - props.name = props.name.substr(1); - } - if (props.label && !props.name) { - props.name = this.escapeName(props.label); - } - var cname = props.name; - var config = this.getConfig(); - var _a = this, all = _a.all, em = _a.em; - var selector = cname ? this.get(cname, props.type) : all.where(props)[0]; - if (!selector) { - var selModel = props instanceof model_Selector ? props : new model_Selector(props, selector_manager_assign(selector_manager_assign({}, cOpts), { config: config, em: em })); - return all.add(selModel, cOpts); - } - return selector; - }; - SelectorManager.prototype.getSelector = function (name, type) { - if (type === void 0) { type = model_Selector.TYPE_CLASS; } - if (isId(name)) { - name = name.substr(1); - type = model_Selector.TYPE_ID; - } - else if (isClass(name)) { - name = name.substr(1); - } - return this.all.where({ name: name, type: type })[0]; - }; - /** - * Add a new selector to the collection if it does not already exist. - * You can pass selectors properties or string identifiers. - * @param {Object|String} props Selector properties or string identifiers, eg. `{ name: 'my-class', label: 'My class' }`, `.my-cls` - * @param {Object} [opts] Selector options - * @return {[Selector]} - * @example - * const selector = selectorManager.add({ name: 'my-class', label: 'My class' }); - * console.log(selector.toString()) // `.my-class` - * // Same as - * const selector = selectorManager.add('.my-class'); - * console.log(selector.toString()) // `.my-class` - * */ - SelectorManager.prototype.add = function (props, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - var cOpts = (0,index_all.isString)(props) ? {} : opts; - // Keep support for arrays but avoid it in docs - if ((0,index_all.isArray)(props)) { - return props.map(function (item) { return _this.addSelector(item, opts, cOpts); }); - } - else { - return this.addSelector(props, opts, cOpts); - } - }; - /** - * Add class selectors - * @param {Array|string} classes Array or string of classes - * @return {Array} Array of added selectors - * @private - * @example - * sm.addClass('class1'); - * sm.addClass('class1 class2'); - * sm.addClass(['class1', 'class2']); - * // -> [SelectorObject, ...] - */ - SelectorManager.prototype.addClass = function (classes) { - var _this = this; - var added = []; - if ((0,index_all.isString)(classes)) { - classes = classes.trim().split(' '); - } - classes.forEach(function (name) { return added.push(_this.addSelector(name)); }); - return added; - }; - /** - * Get the selector by its name/type - * @param {String} name Selector name or string identifier - * @returns {[Selector]|null} - * @example - * const selector = selectorManager.get('.my-class'); - * // Get Id - * const selectorId = selectorManager.get('#my-id'); - * */ - SelectorManager.prototype.get = function (name, type) { - var _this = this; - // Keep support for arrays but avoid it in docs - if ((0,index_all.isArray)(name)) { - var result_1 = []; - var selectors = name.map(function (item) { return _this.getSelector(item); }).filter(Boolean); - selectors.forEach(function (item) { return result_1.indexOf(item) < 0 && result_1.push(item); }); - // @ts-ignore - return result_1; - } - else { - // @ts-ignore - return this.getSelector(name, type); - } - }; - /** - * Remove Selector. - * @param {String|[Selector]} selector Selector instance or Selector string identifier - * @returns {[Selector]} Removed Selector - * @example - * const removed = selectorManager.remove('.myclass'); - * // or by passing the Selector - * selectorManager.remove(selectorManager.get('.myclass')); - */ - SelectorManager.prototype.remove = function (selector, opts) { - return this.__remove(selector, opts); - }; - /** - * Rename Selector. - * @param {[Selector]} selector Selector to update. - * @param {String} name New name for the selector. - * @returns {[Selector]} Selector containing the passed name. - * @example - * const selector = selectorManager.get('myclass'); - * const result = selectorManager.rename(selector, 'myclass2'); - * console.log(result === selector ? 'Selector updated' : 'Selector with this name exists already'); - */ - SelectorManager.prototype.rename = function (selector, name, opts) { - var newName = this.escapeName(name); - var result = this.get(newName); - return result || selector.set({ name: newName, label: name }, opts); - }; - /** - * Change the selector state - * @param {String} value State value - * @returns {this} - * @example - * selectorManager.setState('hover'); - */ - SelectorManager.prototype.setState = function (value) { - this.em.setState(value); - return this; - }; - /** - * Get the current selector state value - * @returns {String} - */ - SelectorManager.prototype.getState = function () { - return this.em.getState(); - }; - /** - * Get states - * @returns {Array<[State]>} - */ - SelectorManager.prototype.getStates = function () { - return selector_manager_spreadArray([], this.states.models, true); - }; - /** - * Set a new collection of states - * @param {Array} states Array of new states - * @returns {Array<[State]>} - * @example - * const states = selectorManager.setStates([ - * { name: 'hover', label: 'Hover' }, - * { name: 'nth-of-type(2n)', label: 'Even/Odd' } - * ]); - */ - SelectorManager.prototype.setStates = function (states, opts) { - return this.states.reset(states.map(function (state) { return new model_State(state); }), opts); - }; - /** - * Get commonly selected selectors, based on all selected components. - * @returns {Array<[Selector]>} - * @example - * const selected = selectorManager.getSelected(); - * console.log(selected.map(s => s.toString())) - */ - SelectorManager.prototype.getSelected = function () { - return this.__getCommon(); - }; - /** - * Get selected selectors. - * @returns {Array<[Selector]>} - * @example - * const selected = selectorManager.getSelectedAll(); - * console.log(selected.map(s => s.toString())) - */ - SelectorManager.prototype.getSelectedAll = function () { - return selector_manager_spreadArray([], this.selected.models, true); - }; - /** - * Add new selector to all selected components. - * @param {Object|String} props Selector properties or string identifiers, eg. `{ name: 'my-class', label: 'My class' }`, `.my-cls` - * @example - * selectorManager.addSelected('.new-class'); - */ - SelectorManager.prototype.addSelected = function (props) { - var added = this.add(props); - this.em.getSelectedAll().forEach(function (target) { - target.getSelectors().add(added); - }); - // TODO: update selected collection - }; - /** - * Remove a common selector from all selected components. - * @param {String|[Selector]} selector Selector instance or Selector string identifier - * @example - * selectorManager.removeSelected('.myclass'); - */ - SelectorManager.prototype.removeSelected = function (selector) { - this.em.getSelectedAll().forEach(function (trg) { - !selector.get('protected') && trg && trg.getSelectors().remove(selector); - }); - }; - SelectorManager.prototype.duplicateSelected = function (selector, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - var em = this.em; - var commonSelectors = this.getSelected(); - if (commonSelectors.indexOf(selector) < 0) - return; - var state = this.getState(); - var media = em.getCurrentMedia(); - var rule = em.Css.get(commonSelectors, state, media); - var styleToApply = rule === null || rule === void 0 ? void 0 : rule.getStyle(); - em.getSelectedAll().forEach(function (component) { - var selectors = component.getSelectors(); - if (selectors.includes(selector)) { - var suffix = opts.suffix || ' copy'; - var label = selector.getLabel(); - var newSelector = _this.addSelector("".concat(label).concat(suffix)); - var at = selectors.indexOf(selector); - selectors.remove(selector); - selectors.add(newSelector, { at: at }); - } - }); - if (styleToApply) { - var newRule = em.Css.add(this.getSelected(), state, media); - newRule.setStyle(styleToApply); - } - }; - /** - * Get the array of currently selected targets. - * @returns {Array<[Component]|[CssRule]>} - * @example - * const targetsToStyle = selectorManager.getSelectedTargets(); - * console.log(targetsToStyle.map(target => target.getSelectorsString())) - */ - SelectorManager.prototype.getSelectedTargets = function () { - return this.em.Styles.getSelectedAll(); - }; - /** - * Update component-first option. - * If the component-first is enabled, all the style changes will be applied on selected components (ID rules) instead - * of selectors (which would change styles on all components with those classes). - * @param {Boolean} value - */ - SelectorManager.prototype.setComponentFirst = function (value) { - this.getConfig().componentFirst = value; - this.model.set({ cFirst: value }); - }; - /** - * Get the value of component-first option. - * @return {Boolean} - */ - SelectorManager.prototype.getComponentFirst = function () { - return this.getConfig().componentFirst; - }; - /** - * Get all selectors - * @name getAll - * @function - * @return {Collection<[Selector]>} - * */ - /** - * Return escaped selector name - * @param {String} name Selector name to escape - * @returns {String} Escaped name - * @private - */ - SelectorManager.prototype.escapeName = function (name) { - var escapeName = this.getConfig().escapeName; - return escapeName ? escapeName(name) : model_Selector.escapeName(name); - }; - /** - * Render class selectors. If an array of selectors is provided a new instance of the collection will be rendered - * @param {Array} selectors - * @return {HTMLElement} - * @private - */ - SelectorManager.prototype.render = function (selectors) { - var selectorTags = this.selectorTags; - var config = this.getConfig(); - var el = selectorTags === null || selectorTags === void 0 ? void 0 : selectorTags.el; - this.selected.reset(selectors); - this.selectorTags = new view_ClassTagsView({ - el: el, - collection: this.selected, - //@ts-ignore - module: this, - config: config, - }); - return this.selectorTags.render().el; - }; - SelectorManager.prototype.destroy = function () { - var _a = this, selectorTags = _a.selectorTags, model = _a.model; - model.stopListening(); - this.__update.cancel(); - this.__destroy(); - selectorTags === null || selectorTags === void 0 ? void 0 : selectorTags.remove(); - this.selectorTags = undefined; - }; - /** - * Get common selectors from the current selection. - * @return {Array} - * @private - */ - SelectorManager.prototype.__getCommon = function () { - return this.__getCommonSelectors(this.em.getSelectedAll()); - }; - SelectorManager.prototype.__getCommonSelectors = function (components, opts) { - if (opts === void 0) { opts = {}; } - var selectors = components.map(function (cmp) { return cmp.getSelectors && cmp.getSelectors().getValid(opts); }).filter(Boolean); - return this.__common.apply(this, selectors); - }; - SelectorManager.prototype.__common = function () { - var _this = this; - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (!args.length) - return []; - if (args.length === 1) - return args[0]; - if (args.length === 2) - return args[0].filter(function (item) { return args[1].indexOf(item) >= 0; }); - return (args - .slice(1) - //@ts-ignore - .reduce(function (acc, item) { return _this.__common(acc, item); }, args[0])); - }; - SelectorManager.prototype.__updateSelectedByComponents = function () { - this.selected.reset(this.__getCommon()); - }; - return SelectorManager; -}(ItemManagerModule)); -/* harmony default export */ const selector_manager = (SelectorManager); - -;// CONCATENATED MODULE: ./src/parser/config/config.ts -var parser_config_config_config = { - textTags: ['br', 'b', 'i', 'u', 'a', 'ul', 'ol'], - textTypes: ['text', 'textnode', 'comment'], - parserCss: undefined, - parserHtml: undefined, - optionsHtml: { - htmlType: 'text/html', - allowScripts: false, - allowUnsafeAttr: false, - allowUnsafeAttrValue: false, - keepEmptyTextNodes: false, - }, -}; -/* harmony default export */ const parser_config_config = (parser_config_config_config); - -;// CONCATENATED MODULE: ./src/parser/model/BrowserParserCss.ts -var _a; - -/** @see https://developer.mozilla.org/en-US/docs/Web/API/CSSRule/type */ -var CSS_RULE_TYPES = { - STYLE_RULE: 1, - CHARSET_RULE: 2, - IMPORT_RULE: 3, - MEDIA_RULE: 4, - FONT_FACE_RULE: 5, - PAGE_RULE: 6, - KEYFRAMES_RULE: 7, - KEYFRAME_RULE: 8, - NAMESPACE_RULE: 10, - COUNTER_STYLE_RULE: 11, - SUPPORTS_RULE: 12, - DOCUMENT_RULE: 13, - FONT_FEATURE_VALUES_RULE: 14, - VIEWPORT_RULE: 15, - REGION_STYLE_RULE: 16, -}; -/** @see https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule */ -var AT_RULE_NAMES = (_a = {}, - _a[CSS_RULE_TYPES.MEDIA_RULE] = 'media', - _a[CSS_RULE_TYPES.FONT_FACE_RULE] = 'font-face', - _a[CSS_RULE_TYPES.PAGE_RULE] = 'page', - _a[CSS_RULE_TYPES.KEYFRAMES_RULE] = 'keyframes', - _a[CSS_RULE_TYPES.COUNTER_STYLE_RULE] = 'counter-style', - _a[CSS_RULE_TYPES.SUPPORTS_RULE] = 'supports', - _a[CSS_RULE_TYPES.DOCUMENT_RULE] = 'document', - _a[CSS_RULE_TYPES.FONT_FEATURE_VALUES_RULE] = 'font-feature-values', - _a[CSS_RULE_TYPES.VIEWPORT_RULE] = 'viewport', - _a); -var AT_RULE_KEYS = (0,index_all.keys)(AT_RULE_NAMES); -var SINGLE_AT_RULE_TYPES = [ - CSS_RULE_TYPES.FONT_FACE_RULE, - CSS_RULE_TYPES.PAGE_RULE, - CSS_RULE_TYPES.COUNTER_STYLE_RULE, - CSS_RULE_TYPES.VIEWPORT_RULE, -]; -var NESTABLE_AT_RULE_NAMES = AT_RULE_KEYS.filter(function (i) { return SINGLE_AT_RULE_TYPES.indexOf(Number(i)) < 0; }) - .map(function (i) { return AT_RULE_NAMES[i]; }) - .concat(['container', 'layer']); -var SINGLE_AT_RULE_NAMES = SINGLE_AT_RULE_TYPES.map(function (n) { return AT_RULE_NAMES[n]; }); -/** - * Parse selector string to array. - * Only classe based are valid as CSS rules inside editor, not valid - * selectors will be dropped as additional - * It's ok with the last part of the string as state (:hover, :active) - * @param {string} str Selectors string - * @return {Object} - * @example - * var res = parseSelector('.test1, .test1.test2, .test2 .test3'); - * console.log(res); - * // { result: [['test1'], ['test1', 'test2']], add: ['.test2 .test3'] } - */ -var parseSelector = function (str) { - if (str === void 0) { str = ''; } - var add = []; - var result = []; - var sels = str.split(','); - for (var i = 0, len = sels.length; i < len; i++) { - var sel = sels[i].trim(); - // Will accept only concatenated classes and last - // class might be with state (eg. :hover), nothing else. - // Can also accept SINGLE ID selectors, eg. `#myid`, `#myid:hover` - // Composed are not valid: `#myid.some-class`, `#myid.some-class:hover` - if (/^(\.{1}[\w\-]+)+(:{1,2}[\w\-()]+)?$/gi.test(sel) || /^(#{1}[\w\-]+){1}(:{1,2}[\w\-()]+)?$/gi.test(sel)) { - var cls = sel.split('.').filter(Boolean); - result.push(cls); - } - else { - add.push(sel); - } - } - return { - result: result, - add: add, - }; -}; -/** - * Parse style declarations of the node. - * @param {CSSRule} node - * @return {Object} - */ -var parseStyle = function (node) { - var stl = node.style; - var style = {}; - for (var i = 0, len = stl.length; i < len; i++) { - var propName = stl[i]; - var propValue = stl.getPropertyValue(propName); - var important = stl.getPropertyPriority(propName); - style[propName] = "".concat(propValue).concat(important ? " !".concat(important) : ''); - } - return style; -}; -/** - * Get the condition when possible - * @param {CSSRule} node - * @return {string} - */ -var parseCondition = function (node) { - // @ts-ignore - var condition = node.conditionText || (node.media && node.media.mediaText) || node.name || node.selectorText || ''; - return condition.trim(); -}; -/** - * Create node for the editor - * @param {Array} selectors Array containing strings of classes - * @param {Object} style Key-value object of style declarations - * @return {Object} - */ -var createNode = function (selectors, style, opts) { - if (style === void 0) { style = {}; } - if (opts === void 0) { opts = {}; } - var node = {}; - var selLen = selectors.length; - var lastClass = selectors[selLen - 1]; - var stateArr = lastClass ? lastClass.split(/:(.+)/) : []; - var state = stateArr[1]; - // @ts-ignore - var atRule = opts.atRule, selectorsAdd = opts.selectorsAdd, mediaText = opts.mediaText; - var singleAtRule = SINGLE_AT_RULE_NAMES.indexOf(atRule) >= 0; - singleAtRule && (node.singleAtRule = true); - atRule && (node.atRuleType = atRule); - selectorsAdd && (node.selectorsAdd = selectorsAdd); - mediaText && (node.mediaText = mediaText); - // Isolate the state from selectors - if (state) { - selectors[selLen - 1] = stateArr[0]; - node.state = state; - stateArr.splice(stateArr.length - 1, 1); - } - node.selectors = selectors; - node.style = style; - return node; -}; -var getNestableAtRule = function (node) { - var _a = node.cssText, cssText = _a === void 0 ? '' : _a; - return NESTABLE_AT_RULE_NAMES.find(function (name) { return cssText.indexOf("@".concat(name)) === 0; }); -}; -/** - * Fetch data from node - * @param {StyleSheet|CSSRule} el - * @return {Array} - */ -var parseNode = function (el) { - var result = []; - var nodes = el.cssRules || []; - for (var i = 0, len = nodes.length; i < len; i++) { - var node = nodes[i]; - var type = node.type; - var singleAtRule = false; - var atRuleType = ''; - var condition = ''; - var sels = node.selectorText || node.keyText || ''; - var isSingleAtRule = SINGLE_AT_RULE_TYPES.indexOf(type) >= 0; - // Check if the node is an at-rule - if (isSingleAtRule) { - singleAtRule = true; - atRuleType = AT_RULE_NAMES[type]; - condition = parseCondition(node); - } - else if (AT_RULE_KEYS.indexOf("".concat(type)) >= 0 || (!type && getNestableAtRule(node))) { - var subRules = parseNode(node); - var subAtRuleType = AT_RULE_NAMES[type] || getNestableAtRule(node); - condition = parseCondition(node); - for (var s = 0, lens = subRules.length; s < lens; s++) { - var subRule = subRules[s]; - condition && (subRule.mediaText = condition); - subRule.atRuleType = subAtRuleType; - } - result = result.concat(subRules); - } - if (!sels && !isSingleAtRule) - continue; - var style = parseStyle(node); - var selsParsed = parseSelector(sels); - var selsAdd = selsParsed.add; - var selsArr = selsParsed.result; - var lastRule = void 0; - // For each group of selectors - for (var k = 0, len3 = selsArr.length; k < len3; k++) { - var model = createNode(selsArr[k], style, { - atRule: AT_RULE_NAMES[type], - }); - result.push(model); - lastRule = model; - } - // Need to push somewhere not class-based selectors, if some rule was - // created will push them there, otherwise will create a new rule - if (selsAdd.length) { - var selsAddStr = selsAdd.join(', '); - if (lastRule) { - lastRule.selectorsAdd = selsAddStr; - } - else { - var model = { - selectors: [], - selectorsAdd: selsAddStr, - style: style, - }; - singleAtRule && (model.singleAtRule = singleAtRule); - atRuleType && (model.atRuleType = atRuleType); - condition && (model.mediaText = condition); - result.push(model); - } - } - } - return result; -}; -/** - * Parse CSS string and return the array of objects - * @param {String} str CSS string - * @return {Array} Array of objects for the definition of CSSRules - */ -/* harmony default export */ const BrowserParserCss = (function (str) { - var el = document.createElement('style'); - el.innerHTML = str; - // There is no .sheet before adding it to the - document.head.appendChild(el); - var sheet = el.sheet; - document.head.removeChild(el); - return sheet ? parseNode(sheet) : []; -}); - -;// CONCATENATED MODULE: ./src/parser/model/ParserCss.ts - - -var ParserCss = function (em, config) { - if (config === void 0) { config = {}; } - return ({ - /** - * Parse CSS string to a desired model object - * @param {String} input CSS string - * @return {Array} - */ - parse: function (input) { - var _this = this; - var output = []; - var parserCss = config.parserCss; - var editor = em === null || em === void 0 ? void 0 : em.Editor; - var nodes = parserCss ? parserCss(input, editor) : BrowserParserCss(input); - nodes.forEach(function (node) { return (output = output.concat(_this.checkNode(node))); }); - em === null || em === void 0 ? void 0 : em.trigger('parse:css', { input: input, output: output, nodes: nodes }); - return output; - }, - /** - * Check the returned node from a custom parser and transforms it to - * a valid object for the CSS composer - * @return {[type]} - */ - checkNode: function (node) { - var selectors = node.selectors, style = node.style; - var result = [node]; - if ((0,index_all.isString)(selectors)) { - var nodes_1 = []; - var parsedNode = node; - var selsParsed = parseSelector(selectors); - var classSets = selsParsed.result; - var selectorsAdd = selsParsed.add.join(', '); - var opts_1 = { atRule: parsedNode.atRule, mediaText: parsedNode.params }; - if (classSets.length) { - classSets.forEach(function (classSet) { - nodes_1.push(createNode(classSet, style, opts_1)); - }); - } - else { - nodes_1.push(createNode([], style, opts_1)); - } - if (selectorsAdd) { - var lastNode = nodes_1[nodes_1.length - 1]; - lastNode.selectorsAdd = selectorsAdd; - } - result = nodes_1; - } - return result; - }, - }); -}; -/* harmony default export */ const model_ParserCss = (ParserCss); - -;// CONCATENATED MODULE: ./src/parser/index.ts -var parser_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -/** - * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/parser/config/config.ts) - * ```js - * const editor = grapesjs.init({ - * parser: { - * // options - * } - * }) - * ``` - * - * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance - * - * ```js - * const { Parser } = editor; - * ``` - * ## Available Events - * * `parse:html` - On HTML parse, an object containing the input and the output of the parser is passed as an argument - * * `parse:css` - On CSS parse, an object containing the input and the output of the parser is passed as an argument - * - * ## Methods - * * [getConfig](#getconfig) - * * [parseHtml](#parsehtml) - * * [parseCss](#parsecss) - * - * @module Parser - */ - - - - -var ParserModule = /** @class */ (function (_super) { - parser_extends(ParserModule, _super); - function ParserModule(em) { - var _this = _super.call(this, em, 'Parser', parser_config_config) || this; - var config = _this.config; - _this.parserCss = model_ParserCss(em, config); - _this.parserHtml = model_ParserHtml(em, config); - return _this; - } - /** - * Get configuration object - * @name getConfig - * @function - * @return {Object} - */ - /** - * Parse HTML string and return the object containing the Component Definition - * @param {String} input HTML string to parse - * @param {Object} [options] Options - * @param {String} [options.htmlType] [HTML mime type](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02) to parse - * @param {Boolean} [options.allowScripts=false] Allow `") : ''; - return html; - }; - /** - * Returns CSS built inside canvas - * @param {Object} [opts={}] Options - * @returns {string} CSS string - * @public - */ - EditorModel.prototype.getCss = function (opts) { - if (opts === void 0) { opts = {}; } - var config = this.config; - var optsCss = config.optsCss; - var avoidProt = opts.avoidProtected; - var keepUnusedStyles = !(0,index_all.isUndefined)(opts.keepUnusedStyles) ? opts.keepUnusedStyles : config.keepUnusedStyles; - var cssc = this.Css; - var wrp = opts.component || this.Components.getComponent(); - var protCss = !avoidProt ? config.protectedCss : ''; - var css = wrp && - this.CodeManager.getCode(wrp, 'css', Editor_assign(Editor_assign({ cssc: cssc, keepUnusedStyles: keepUnusedStyles }, optsCss), opts)); - return wrp ? (opts.json ? css : protCss + css) : ''; - }; - /** - * Returns JS of all components - * @return {string} JS string - * @public - */ - EditorModel.prototype.getJs = function (opts) { - if (opts === void 0) { opts = {}; } - var wrp = opts.component || this.Components.getWrapper(); - return wrp ? this.CodeManager.getCode(wrp, 'js').trim() : ''; - }; - /** - * Store data to the current storage. - * @public - */ - EditorModel.prototype.store = function (options) { - return Editor_awaiter(this, void 0, void 0, function () { - var data; - return Editor_generator(this, function (_a) { - switch (_a.label) { - case 0: - data = this.storeData(); - return [4 /*yield*/, this.Storage.store(data, options)]; - case 1: - _a.sent(); - this.clearDirtyCount(); - return [2 /*return*/, data]; - } - }); - }); - }; - /** - * Load data from the current storage. - * @public - */ - EditorModel.prototype.load = function (options, loadOptions) { - if (loadOptions === void 0) { loadOptions = {}; } - return Editor_awaiter(this, void 0, void 0, function () { - var result; - return Editor_generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.Storage.load(options)]; - case 1: - result = _a.sent(); - this.loadData(result); - // Wait in order to properly update the dirty counter (#5385) - return [4 /*yield*/, (0,mixins.wait)()]; - case 2: - // Wait in order to properly update the dirty counter (#5385) - _a.sent(); - if (loadOptions.clear) { - this.UndoManager.clear(); - this.clearDirtyCount(); - } - return [2 /*return*/, result]; - } - }); - }); - }; - EditorModel.prototype.storeData = function () { - var result = {}; - // Sync content if there is an active RTE - var editingCmp = this.getEditing(); - editingCmp && editingCmp.trigger('sync:content', { noCount: true }); - this.storables.forEach(function (m) { - result = Editor_assign(Editor_assign({}, result), m.store(1)); - }); - return JSON.parse(JSON.stringify(result)); - }; - EditorModel.prototype.loadData = function (data) { - if (data === void 0) { data = {}; } - if (!(0,mixins.isEmptyObj)(data)) { - this.storables.forEach(function (module) { return module.clear(); }); - this.storables.forEach(function (module) { return module.load(data); }); - } - return data; - }; - /** - * Returns device model by name - * @return {Device|null} - * @private - */ - EditorModel.prototype.getDeviceModel = function () { - var name = this.get('device'); - return this.Devices.get(name); - }; - /** - * Run default command if setted - * @param {Object} [opts={}] Options - * @private - */ - EditorModel.prototype.runDefault = function (opts) { - if (opts === void 0) { opts = {}; } - var command = this.get('Commands').get(this.config.defaultCommand); - if (!command || this.defaultRunning) - return; - command.stop(this, this, opts); - command.run(this, this, opts); - this.defaultRunning = true; - }; - /** - * Stop default command - * @param {Object} [opts={}] Options - * @private - */ - EditorModel.prototype.stopDefault = function (opts) { - if (opts === void 0) { opts = {}; } - var commands = this.get('Commands'); - var command = commands.get(this.config.defaultCommand); - if (!command || !this.defaultRunning) - return; - command.stop(this, this, opts); - this.defaultRunning = false; - }; - /** - * Update canvas dimensions and refresh data useful for tools positioning - * @public - */ - EditorModel.prototype.refreshCanvas = function (opts) { - if (opts === void 0) { opts = {}; } - this.Canvas.refresh({ spots: opts.tools }); - }; - /** - * Clear all selected stuf inside the window, sometimes is useful to call before - * doing some dragging opearation - * @param {Window} win If not passed the current one will be used - * @private - */ - EditorModel.prototype.clearSelection = function (win) { - var _a; - var w = win || window; - (_a = w.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges(); - }; - /** - * Get the current media text - * @return {string} - */ - EditorModel.prototype.getCurrentMedia = function () { - var config = this.config; - var device = this.getDeviceModel(); - var condition = config.mediaCondition; - var preview = config.devicePreviewMode; - var width = device && device.get('widthMedia'); - return device && width && !preview ? "(".concat(condition, ": ").concat(width, ")") : ''; - }; - /** - * Return the component wrapper - * @return {Component} - */ - EditorModel.prototype.getWrapper = function () { - return this.Components.getWrapper(); - }; - EditorModel.prototype.setCurrentFrame = function (frameView) { - return this.set('currentFrame', frameView); - }; - EditorModel.prototype.getCurrentFrame = function () { - return this.get('currentFrame'); - }; - EditorModel.prototype.getCurrentFrameModel = function () { - var _a; - return (_a = (this.getCurrentFrame() || {})) === null || _a === void 0 ? void 0 : _a.model; - }; - EditorModel.prototype.getIcon = function (icon) { - var icons = this.config.icons || {}; - return icons[icon] || ''; - }; - /** - * Return the count of changes made to the content and not yet stored. - * This count resets at any `store()` - * @return {number} - */ - EditorModel.prototype.getDirtyCount = function () { - return this.get('changesCount'); - }; - EditorModel.prototype.clearDirtyCount = function () { - return this.set({ changesCount: 0 }, { isClear: true }); - }; - EditorModel.prototype.getZoomDecimal = function () { - return this.Canvas.getZoomDecimal(); - }; - EditorModel.prototype.getZoomMultiplier = function () { - return this.Canvas.getZoomMultiplier(); - }; - EditorModel.prototype.setDragMode = function (value) { - return this.set('dmode', value); - }; - EditorModel.prototype.getDragMode = function (component) { - var mode = (component === null || component === void 0 ? void 0 : component.getDragMode()) || this.get('dmode'); - return mode || ''; - }; - EditorModel.prototype.t = function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - var i18n = this.get('I18n'); - return i18n === null || i18n === void 0 ? void 0 : i18n.t.apply(i18n, args); - }; - /** - * Returns true if the editor is in absolute mode - * @returns {Boolean} - */ - EditorModel.prototype.inAbsoluteMode = function (component) { - return this.getDragMode(component) === 'absolute'; - }; - /** - * Destroy editor - */ - EditorModel.prototype.destroyAll = function () { - var _this = this; - var _a = this, config = _a.config, view = _a.view; - var editor = this.getEditor(); - // @ts-ignore - var _b = (config.grapesjs || {}).editors, editors = _b === void 0 ? [] : _b; - var shallow = this.get('shallow'); - this._storageTimeout && clearTimeout(this._storageTimeout); - shallow === null || shallow === void 0 ? void 0 : shallow.destroyAll(); - this.stopListening(); - this.stopDefault(); - this.modules - .slice() - .reverse() - .forEach(function (mod) { return mod.destroy(); }); - view && view.remove(); - this.clear({ silent: true }); - this.destroyed = true; - ['_config', 'view', '_previousAttributes', '_events', '_listeners'].forEach( - //@ts-ignore - function (i) { return (_this[i] = {}); }); - editors.splice(editors.indexOf(editor), 1); - //@ts-ignore - (0,mixins.hasWin)() && (0,cash_dom["default"])(config.el).empty().attr(this.attrsOrig); - }; - EditorModel.prototype.getEditing = function () { - var res = this.get('editing'); - return (res && res.model) || undefined; - }; - EditorModel.prototype.setEditing = function (value) { - this.set('editing', value); - return this; - }; - EditorModel.prototype.isEditing = function () { - return !!this.get('editing'); - }; - EditorModel.prototype.log = function (msg, opts) { - if (opts === void 0) { opts = {}; } - var ns = opts.ns, _a = opts.level, level = _a === void 0 ? 'debug' : _a; - this.trigger('log', msg, opts); - level && this.trigger("log:".concat(level), msg, opts); - if (ns) { - var logNs = "log-".concat(ns); - this.trigger(logNs, msg, opts); - level && this.trigger("".concat(logNs, ":").concat(level), msg, opts); - } - }; - EditorModel.prototype.logInfo = function (msg, opts) { - this.log(msg, Editor_assign(Editor_assign({}, opts), { level: 'info' })); - }; - EditorModel.prototype.logWarning = function (msg, opts) { - this.log(msg, Editor_assign(Editor_assign({}, opts), { level: 'warning' })); - }; - EditorModel.prototype.logError = function (msg, opts) { - this.log(msg, Editor_assign(Editor_assign({}, opts), { level: 'error' })); - }; - EditorModel.prototype.initBaseColorPicker = function (el, opts) { - if (opts === void 0) { opts = {}; } - var config = this.config; - var _a = config.colorPicker, colorPicker = _a === void 0 ? {} : _a; - var elToAppend = config.el; - var ppfx = config.stylePrefix; - //@ts-ignore - return (0,cash_dom["default"])(el).spectrum(Editor_assign(Editor_assign({ containerClassName: "".concat(ppfx, "one-bg ").concat(ppfx, "two-color"), appendTo: elToAppend || 'body', maxSelectionSize: 8, showPalette: true, palette: [], showAlpha: true, chooseText: 'Ok', cancelText: '⨯' }, opts), colorPicker)); - }; - /** - * Execute actions without triggering the storage and undo manager. - * @param {Function} clb - * @private - */ - EditorModel.prototype.skip = function (clb) { - this.__skip = true; - var um = this.UndoManager; - um ? um.skip(clb) : clb(); - this.__skip = false; - }; - /** - * Set/get data from the HTMLElement - * @param {HTMLElement} el - * @param {string} name Data name - * @param {any} value Date value - * @return {any} - * @private - */ - EditorModel.prototype.data = function (el, name, value) { - var varName = '_gjs-data'; - if (!el[varName]) { - el[varName] = {}; - } - if ((0,index_all.isUndefined)(value)) { - return el[varName][name]; - } - else { - el[varName][name] = value; - } - }; - return EditorModel; -}(common/* Model */.Hn)); -/* harmony default export */ const model_Editor = (EditorModel); - -;// CONCATENATED MODULE: ./src/editor/view/EditorView.ts -var view_EditorView_extends = (undefined && undefined.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - -var EditorView_EditorView = /** @class */ (function (_super) { - view_EditorView_extends(EditorView, _super); - function EditorView(model) { - var _this = _super.call(this, { model: model }) || this; - var Panels = model.Panels, UndoManager = model.UndoManager; - model.view = _this; - model.once('change:ready', function () { - Panels.active(); - Panels.disableButtons(); - UndoManager.clear(); - setTimeout(function () { - model.trigger('load', model.Editor); - model.clearDirtyCount(); - }); - }); - return _this; - } - EditorView.prototype.render = function () { - var _this = this; - var _a = this, $el = _a.$el, model = _a.model; - var Panels = model.Panels, Canvas = model.Canvas, config = model.config, modules = model.modules; - var pfx = config.stylePrefix; - var classNames = ["".concat(pfx, "editor")]; - !config.customUI && classNames.push("".concat(pfx, "one-bg ").concat(pfx, "two-color")); - var contEl = (0,cash_dom["default"])(config.el || "body ".concat(config.container)); - config.cssIcons && (0,mixins.appendStyles)(config.cssIcons, { unique: true, prepand: true }); - $el.empty(); - config.width && contEl.css('width', config.width); - config.height && contEl.css('height', config.height); - $el.append(Canvas.render()); - $el.append(Panels.render()); - // Load shallow editor - var shallow = model.shallow; - var shallowCanvasEl = shallow.Canvas.render(); - shallowCanvasEl.style.display = 'none'; - $el.append(shallowCanvasEl); - $el.attr('class', classNames.join(' ')); - contEl.addClass("".concat(pfx, "editor-cont")).empty().append($el); - modules.forEach(function (md) { var _a; return (_a = md.postRender) === null || _a === void 0 ? void 0 : _a.call(md, _this); }); - return this; - }; - return EditorView; -}(common/* View */.G7)); -/* harmony default export */ const view_EditorView = (EditorView_EditorView); - -;// CONCATENATED MODULE: ./src/editor/index.ts -var editor_assign = (undefined && undefined.__assign) || function () { - editor_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return editor_assign.apply(this, arguments); -}; -var editor_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var editor_generator = (undefined && undefined.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var editor_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; - - - - -var Editor = /** @class */ (function () { - function Editor(config, opts) { - if (config === void 0) { config = {}; } - if (opts === void 0) { opts = {}; } - var _a; - /** - * Print safe HTML by using ES6 tagged template strings. - * @param {Array} literals - * @param {Array} substs - * @returns {String} - * @example - * const unsafeStr = ''; - * const safeStr = 'Hello'; - * // Use `$${var}` to avoid escaping - * const strHtml = editor.html`Escaped ${unsafeStr} unescaped $${safeStr}`; - */ - this.html = html; - this.config = editor_assign(editor_assign(editor_assign({}, config_config), config), { pStylePrefix: (_a = config.stylePrefix) !== null && _a !== void 0 ? _a : config_config.stylePrefix }); - this.em = new model_Editor(this.config); - this.$ = opts.$; - this.em.init(this); - this.editor = this.em; - } - Object.defineProperty(Editor.prototype, "Config", { - get: function () { - return this.em.config; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "I18n", { - get: function () { - return this.em.I18n; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Utils", { - get: function () { - return this.em.Utils; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Commands", { - get: function () { - return this.em.Commands; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Keymaps", { - get: function () { - return this.em.Keymaps; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Modal", { - get: function () { - return this.em.Modal; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Panels", { - get: function () { - return this.em.Panels; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Canvas", { - get: function () { - return this.em.Canvas; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Parser", { - get: function () { - return this.em.Parser; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "CodeManager", { - get: function () { - return this.em.CodeManager; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "UndoManager", { - get: function () { - return this.em.UndoManager; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "RichTextEditor", { - get: function () { - return this.em.RichTextEditor; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Pages", { - get: function () { - return this.em.Pages; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Components", { - get: function () { - return this.em.Components; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "DomComponents", { - get: function () { - return this.em.Components; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Layers", { - get: function () { - return this.em.Layers; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "LayerManager", { - get: function () { - return this.em.Layers; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Css", { - get: function () { - return this.em.Css; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "CssComposer", { - get: function () { - return this.em.Css; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Storage", { - get: function () { - return this.em.Storage; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "StorageManager", { - get: function () { - return this.em.Storage; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Assets", { - get: function () { - return this.em.Assets; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "AssetManager", { - get: function () { - return this.em.Assets; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Blocks", { - get: function () { - return this.em.Blocks; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "BlockManager", { - get: function () { - return this.em.Blocks; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Traits", { - get: function () { - return this.em.Traits; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "TraitManager", { - get: function () { - return this.em.Traits; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Selectors", { - get: function () { - return this.em.Selectors; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "SelectorManager", { - get: function () { - return this.em.Selectors; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Styles", { - get: function () { - return this.em.Styles; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "StyleManager", { - get: function () { - return this.em.Styles; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "Devices", { - get: function () { - return this.em.Devices; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "DeviceManager", { - get: function () { - return this.em.Devices; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Editor.prototype, "EditorModel", { - get: function () { - return this.em; - }, - enumerable: false, - configurable: true - }); - /** - * Returns configuration object - * @returns {any} Returns the configuration object or the value of the specified property - */ - Editor.prototype.getConfig = function (prop) { - return this.em.getConfig(prop); - }; - /** - * Returns HTML built inside canvas - * @param {Object} [opts={}] Options - * @param {Component} [opts.component] Return the HTML of a specific Component - * @param {Boolean} [opts.cleanId=false] Remove unnecessary IDs (eg. those created automatically) - * @returns {string} HTML string - */ - Editor.prototype.getHtml = function (opts) { - return this.em.getHtml(opts); - }; - /** - * Returns CSS built inside canvas - * @param {Object} [opts={}] Options - * @param {Component} [opts.component] Return the CSS of a specific Component - * @param {Boolean} [opts.json=false] Return an array of CssRules instead of the CSS string - * @param {Boolean} [opts.avoidProtected=false] Don't include protected CSS - * @param {Boolean} [opts.onlyMatched=false] Return only rules matched by the passed component. - * @param {Boolean} [opts.keepUnusedStyles=false] Force keep all defined rules. Toggle on in case output looks different inside/outside of the editor. - * @returns {String|Array} CSS string or array of CssRules - */ - Editor.prototype.getCss = function (opts) { - return this.em.getCss(opts); - }; - /** - * Returns JS of all components - * @param {Object} [opts={}] Options - * @param {Component} [opts.component] Get the JS of a specific component - * @returns {String} JS string - */ - Editor.prototype.getJs = function (opts) { - return this.em.getJs(opts); - }; - /** - * Return the complete tree of components. Use `getWrapper` to include also the wrapper - * @return {Components} - */ - Editor.prototype.getComponents = function () { - return this.Components.getComponents(); - }; - /** - * Return the wrapper and its all components - * @return {Component} - */ - Editor.prototype.getWrapper = function () { - return this.Components.getWrapper(); - }; - /** - * Set components inside editor's canvas. This method overrides actual components - * @param {Array|Object|string} components HTML string or components model - * @param {Object} opt the options object to be used by the [setComponents]{@link em#setComponents} method - * @return {this} - * @example - * editor.setComponents('
New component
'); - * // or - * editor.setComponents({ - * type: 'text', - * classes:['cls'], - * content: 'New component' - * }); - */ - Editor.prototype.setComponents = function (components, opt) { - if (opt === void 0) { opt = {}; } - this.em.setComponents(components, opt); - return this; - }; - /** - * Add components - * @param {Array|Object|string} components HTML string or components model - * @param {Object} opts Options - * @param {Boolean} [opts.avoidUpdateStyle=false] If the HTML string contains styles, - * by default, they will be created and, if already exist, updated. When this option - * is true, styles already created will not be updated. - * @return {Array} - * @example - * editor.addComponents('
New component
'); - * // or - * editor.addComponents({ - * type: 'text', - * classes:['cls'], - * content: 'New component' - * }); - */ - Editor.prototype.addComponents = function (components, opts) { - return this.getWrapper().append(components, opts); - }; - /** - * Returns style in JSON format object - * @return {Object} - */ - Editor.prototype.getStyle = function () { - return this.em.Css.getAll(); - }; - /** - * Set style inside editor's canvas. This method overrides actual style - * @param {Array|Object|string} style CSS string or style model - * @return {this} - * @example - * editor.setStyle('.cls{color: red}'); - * //or - * editor.setStyle({ - * selectors: ['cls'], - * style: { color: 'red' } - * }); - */ - Editor.prototype.setStyle = function (style, opt) { - if (opt === void 0) { opt = {}; } - this.em.setStyle(style, opt); - return this; - }; - /** - * Add styles to the editor - * @param {Array|Object|string} style CSS string or style model - * @returns {Array} Array of created CssRule instances - * @example - * editor.addStyle('.cls{color: red}'); - */ - Editor.prototype.addStyle = function (style, opts) { - if (opts === void 0) { opts = {}; } - return this.em.addStyle(style, opts); - }; - /** - * Returns the last selected component, if there is one - * @return {Model} - */ - Editor.prototype.getSelected = function () { - return this.em.getSelected(); - }; - /** - * Returns an array of all selected components - * @return {Array} - */ - Editor.prototype.getSelectedAll = function () { - return this.em.getSelectedAll(); - }; - /** - * Get a stylable entity from the selected component. - * If you select a component without classes the entity is the Component - * itself and all changes will go inside its 'style' attribute. Otherwise, - * if the selected component has one or more classes, the function will - * return the corresponding CSS Rule - * @return {Model} - */ - Editor.prototype.getSelectedToStyle = function () { - var selected = this.em.getSelected(); - if (selected) { - return this.StyleManager.getModelToStyle(selected); - } - }; - /** - * Select a component - * @param {Component|HTMLElement} el Component to select - * @param {Object} [opts] Options - * @param {Boolean} [opts.scroll] Scroll canvas to the selected element - * @return {this} - * @example - * // Select dropped block - * editor.on('block:drag:stop', function(model) { - * editor.select(model); - * }); - */ - Editor.prototype.select = function (el, opts) { - this.em.setSelected(el, opts); - return this; - }; - /** - * Add component to selection - * @param {Component|HTMLElement|Array} el Component to select - * @return {this} - * @example - * editor.selectAdd(model); - */ - // selectAdd(el: Parameters[0]) { - Editor.prototype.selectAdd = function (el) { - this.em.addSelected(el); - return this; - }; - /** - * Remove component from selection - * @param {Component|HTMLElement|Array} el Component to select - * @return {this} - * @example - * editor.selectRemove(model); - */ - Editor.prototype.selectRemove = function (el) { - this.em.removeSelected(el); - return this; - }; - /** - * Toggle component selection - * @param {Component|HTMLElement|Array} el Component to select - * @return {this} - * @example - * editor.selectToggle(model); - */ - Editor.prototype.selectToggle = function (el) { - this.em.toggleSelected(el); - return this; - }; - /** - * Returns, if active, the Component enabled in rich text editing mode. - * @returns {Component|null} - * @example - * const textComp = editor.getEditing(); - * if (textComp) { - * console.log('HTML: ', textComp.toHTML()); - * } - */ - Editor.prototype.getEditing = function () { - return this.em.getEditing(); - }; - /** - * Set device to the editor. If the device exists it will - * change the canvas to the proper width - * @param {string} name Name of the device - * @return {this} - * @example - * editor.setDevice('Tablet'); - */ - Editor.prototype.setDevice = function (name) { - this.em.set('device', name); - return this; - }; - /** - * Return the actual active device - * @return {string} Device name - * @example - * var device = editor.getDevice(); - * console.log(device); - * // 'Tablet' - */ - Editor.prototype.getDevice = function () { - return this.em.get('device'); - }; - /** - * Execute command - * @param {string} id Command ID - * @param {Object} options Custom options - * @return {*} The return is defined by the command - * @example - * editor.runCommand('myCommand', {someValue: 1}); - */ - Editor.prototype.runCommand = function (id, options) { - if (options === void 0) { options = {}; } - return this.Commands.run(id, options); - }; - /** - * Stop the command if stop method was provided - * @param {string} id Command ID - * @param {Object} options Custom options - * @return {*} The return is defined by the command - * @example - * editor.stopCommand('myCommand', {someValue: 1}); - */ - Editor.prototype.stopCommand = function (id, options) { - if (options === void 0) { options = {}; } - return this.Commands.stop(id, options); - }; - /** - * Store data to the current storage. - * This will reset the counter of changes (`editor.getDirtyCount()`). - * @param {Object} [options] Storage options. - * @returns {Object} Stored data. - * @example - * const storedData = await editor.store(); - */ - Editor.prototype.store = function (options) { - return editor_awaiter(this, void 0, void 0, function () { - return editor_generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.em.store(options)]; - case 1: return [2 /*return*/, _a.sent()]; - } - }); - }); - }; - /** - * Load data from the current storage. - * @param {Object} [options] Storage options. - * @param {Object} [loadOptions={}] Load options. - * @param {Boolean} [loadOptions.clear=false] Clear the editor state (eg. dirty counter, undo manager, etc.). - * @returns {Object} Loaded data. - * @example - * const data = await editor.load(); - */ - Editor.prototype.load = function (options, loadOptions) { - if (loadOptions === void 0) { loadOptions = {}; } - return editor_awaiter(this, void 0, void 0, function () { - return editor_generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.em.load(options, loadOptions)]; - case 1: return [2 /*return*/, _a.sent()]; - } - }); - }); - }; - /** - * Get the JSON project data, which could be stored and loaded back with `editor.loadProjectData(json)` - * @returns {Object} - * @example - * console.log(editor.getProjectData()); - * // { pages: [...], styles: [...], ... } - */ - Editor.prototype.getProjectData = function () { - return this.em.storeData(); - }; - /** - * Load data from the JSON project - * @param {Object} data Project to load - * @example - * editor.loadProjectData({ pages: [...], styles: [...], ... }) - */ - Editor.prototype.loadProjectData = function (data) { - return this.em.loadData(data); - }; - Editor.prototype.storeData = function () { - return this.em.storeData(); - }; - Editor.prototype.loadData = function (data) { - return this.em.loadData(data); - }; - /** - * Returns container element. The one which was indicated as 'container' - * on init method - * @return {HTMLElement} - */ - Editor.prototype.getContainer = function () { - return this.config.el; - }; - /** - * Return the count of changes made to the content and not yet stored. - * This count resets at any `store()` - * @return {number} - */ - Editor.prototype.getDirtyCount = function () { - return this.em.getDirtyCount(); - }; - /** - * Reset the counter of changes. - */ - Editor.prototype.clearDirtyCount = function () { - return this.em.clearDirtyCount(); - }; - /** - * Update editor dimension offsets - * - * This method could be useful when you update, for example, some position - * of the editor element (eg. canvas, panels, etc.) with CSS, where without - * refresh you'll get misleading position of tools - * @param {Object} [options] Options - * @param {Boolean} [options.tools=false] Update the position of tools (eg. rich text editor, component highlighter, etc.) - */ - Editor.prototype.refresh = function (opts) { - this.em.refreshCanvas(opts); - }; - /** - * Replace the built-in Rich Text Editor with a custom one. - * @param {Object} obj Custom RTE Interface - * @example - * editor.setCustomRte({ - * // Function for enabling custom RTE - * // el is the HTMLElement of the double clicked Text Component - * // rte is the same instance you have returned the first time you call - * // enable(). This is useful if need to check if the RTE is already enabled so - * // ion this case you'll need to return the RTE and the end of the function - * enable: function(el, rte) { - * rte = new MyCustomRte(el, {}); // this depends on the Custom RTE API - * ... - * return rte; // return the RTE instance - * } - * - * // Disable the editor, called for example when you unfocus the Text Component - * disable: function(el, rte) { - * rte.blur(); // this depends on the Custom RTE API - * } - * - * // Called when the Text Component is focused again. If you returned the RTE instance - * // from the enable function, the enable won't be called again instead will call focus, - * // in this case to avoid double binding of the editor - * focus: function (el, rte) { - * rte.focus(); // this depends on the Custom RTE API - * } - * }); - */ - Editor.prototype.setCustomRte = function (obj) { - this.RichTextEditor.customRte = obj; - }; - /** - * Replace the default CSS parser with a custom one. - * The parser function receives a CSS string as a parameter and expects - * an array of CSSRule objects as a result. If you need to remove the - * custom parser, pass `null` as the argument - * @param {Function|null} parser Parser function - * @return {this} - * @example - * editor.setCustomParserCss(css => { - * const result = []; - * // ... parse the CSS string - * result.push({ - * selectors: '.someclass, div .otherclass', - * style: { color: 'red' } - * }) - * // ... - * return result; - * }); - */ - Editor.prototype.setCustomParserCss = function (parser) { - this.Parser.getConfig().parserCss = parser; - return this; - }; - /** - * Change the global drag mode of components. - * To get more about this feature read: https://github.com/GrapesJS/grapesjs/issues/1936 - * @param {String} value Drag mode, options: 'absolute' | 'translate' - * @returns {this} - */ - Editor.prototype.setDragMode = function (value) { - this.em.setDragMode(value); - return this; - }; - /** - * Trigger event log message - * @param {*} msg Message to log - * @param {Object} [opts={}] Custom options - * @param {String} [opts.ns=''] Namespace of the log (eg. to use in plugins) - * @param {String} [opts.level='debug'] Level of the log, `debug`, `info`, `warning`, `error` - * @return {this} - * @example - * editor.log('Something done!', { ns: 'from-plugin-x', level: 'info' }); - * // This will trigger following events - * // `log`, `log:info`, `log-from-plugin-x`, `log-from-plugin-x:info` - * // Callbacks of those events will always receive the message and - * // options, as arguments, eg: - * // editor.on('log:info', (msg, opts) => console.info(msg, opts)) - */ - Editor.prototype.log = function (msg, opts) { - if (opts === void 0) { opts = {}; } - this.em.log(msg, opts); - return this; - }; - /** - * Translate label - * @param {String} key Label to translate - * @param {Object} [opts] Options for the translation - * @param {Object} [opts.params] Params for the translation - * @param {Boolean} [opts.noWarn] Avoid warnings in case of missing resources - * @returns {String} - * @example - * editor.t('msg'); - * // use params - * editor.t('msg2', { params: { test: 'hello' } }); - * // custom local - * editor.t('msg2', { params: { test: 'hello' } l: 'it' }); - */ - Editor.prototype.t = function () { - var _a; - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return (_a = this.em).t.apply(_a, args); - }; - /** - * Attach event - * @param {string} event Event name - * @param {Function} callback Callback function - * @return {this} - */ - Editor.prototype.on = function (event, callback) { - this.em.on(event, callback); - return this; - }; - /** - * Attach event and detach it after the first run - * @param {string} event Event name - * @param {Function} callback Callback function - * @return {this} - */ - Editor.prototype.once = function (event, callback) { - this.em.once(event, callback); - return this; - }; - /** - * Detach event - * @param {string} event Event name - * @param {Function} callback Callback function - * @return {this} - */ - Editor.prototype.off = function (event, callback) { - this.em.off(event, callback); - return this; - }; - /** - * Trigger event - * @param {string} event Event to trigger - * @return {this} - */ - Editor.prototype.trigger = function (event) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - this.em.trigger.apply(this.em, editor_spreadArray([event], args, true)); - return this; - }; - /** - * Destroy the editor - */ - Editor.prototype.destroy = function () { - if (!this.em) - return; - this.em.destroyAll(); - this.editorView = undefined; - }; - /** - * Returns editor element - * @return {HTMLElement} - * @private - */ - Editor.prototype.getEl = function () { - var _a; - return (_a = this.editorView) === null || _a === void 0 ? void 0 : _a.el; - }; - /** - * Returns editor model - * @return {Model} - * @private - */ - Editor.prototype.getModel = function () { - return this.em; - }; - /** - * Render editor - * @return {HTMLElement} - */ - Editor.prototype.render = function () { - var _a; - (_a = this.editorView) === null || _a === void 0 ? void 0 : _a.remove(); - this.editorView = new view_EditorView(this.em); - return this.editorView.render().el; - }; - /** - * Trigger a callback once the editor is loaded and rendered. - * The callback will be executed immediately if the method is called on the already rendered editor. - * @param {Function} clb Callback to trigger - * @example - * editor.onReady(() => { - * // perform actions - * }); - */ - Editor.prototype.onReady = function (clb) { - this.em.get('ready') ? clb(this) : this.em.on('load', clb); - }; - return Editor; -}()); -/* harmony default export */ const src_editor = (Editor); - -;// CONCATENATED MODULE: ./src/plugin_manager/index.ts - - -var getPluginById = function (pluginId, plugins) { - var result = plugins.get(pluginId); - // Try to search in global context - if (!result) { - var wplg = (0,mixins.getGlobal)()[pluginId]; - result = (wplg === null || wplg === void 0 ? void 0 : wplg.default) || wplg; - } - return result; -}; -var getPlugin = function (plugin, plugins) { - return (0,index_all.isString)(plugin) - ? getPluginById(plugin, plugins) - : (plugin === null || plugin === void 0 ? void 0 : plugin.default) || plugin; -}; -var logPluginWarn = function (editor, plugin) { - editor.getModel().logWarning("Plugin ".concat(plugin, " not found"), { - context: 'plugins', - plugin: plugin, - }); -}; -var PluginManager = /** @class */ (function () { - function PluginManager() { - this.plugins = {}; - } - /** - * Add new plugin. Plugins could not be overwritten - * @param {string} id Plugin ID - * @param {Function} plugin Function which contains all plugin logic - * @return {Function} The plugin function - * @deprecated Don't use named plugins, create plugins as simple functions. More about [Plugins](https://grapesjs.com/docs/modules/Plugins.html) - * @example - * PluginManager.add('some-plugin', function(editor) { - * editor.Commands.add('new-command', { - * run: function(editor, senderBtn){ - * console.log('Executed new-command'); - * } - * }) - * }); - */ - PluginManager.prototype.add = function (id, plugin) { - var plg = this.get(id); - if (plg) { - return plg; - } - // @ts-ignore - this.plugins[id] = plugin; - return plugin; - }; - /** - * Returns plugin by ID - * @param {string} id Plugin ID - * @return {Function|undefined} Plugin - * @example - * var plugin = PluginManager.get('some-plugin'); - * plugin(editor); - */ - PluginManager.prototype.get = function (id) { - return this.plugins[id]; - }; - /** - * Returns object with all plugins - */ - PluginManager.prototype.getAll = function () { - return this.plugins; - }; - return PluginManager; -}()); -/* harmony default export */ const plugin_manager = (PluginManager); - -;// CONCATENATED MODULE: ./src/utils/polyfills.ts -/** - * File made for IE/Edge support - * https://github.com/GrapesJS/grapesjs/issues/214 - */ - -/* harmony default export */ const polyfills = (function () { - /** - * Check if IE/Edge - * @return {Boolean} - */ - var isIE = function () { - var match; - var agent = window.navigator.userAgent; - var rules = [ - ['edge', /Edge\/([0-9\._]+)/], - ['ie', /MSIE\s(7\.0)/], - ['ie', /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], - ['ie', /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/], - ]; - for (var i = 0; i < rules.length; i++) { - var rule = rules[i]; - match = rule[1].exec(agent); - if (match) - break; - } - return !!match; - }; - if ((0,mixins.hasWin)() && isIE()) { - var originalCreateHTMLDocument_1 = DOMImplementation.prototype.createHTMLDocument; - DOMImplementation.prototype.createHTMLDocument = function (title) { - if (!title) - title = ''; - return originalCreateHTMLDocument_1.apply(document.implementation, [title]); - }; - } -}); - -;// CONCATENATED MODULE: ./src/index.ts -var src_assign = (undefined && undefined.__assign) || function () { - src_assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return src_assign.apply(this, arguments); -}; - - - - - -polyfills(); -var plugins = new plugin_manager(); -var editors = []; -var usePlugin = function (plugin, opts) { - var pluginResult = getPlugin(plugin, plugins); - return function (editor) { - if (pluginResult) { - pluginResult(editor, opts || {}); - } - else { - logPluginWarn(editor, plugin); - } - }; -}; -var grapesjs = { - $: cash_dom["default"], - editors: editors, - plugins: plugins, - usePlugin: usePlugin, - // @ts-ignore Will be replaced on build - version: '0.21.12', - /** - * Initialize the editor with passed options - * @param {Object} config Configuration object - * @param {string|HTMLElement} config.container Selector which indicates where render the editor - * @param {Boolean} [config.autorender=true] If true, auto-render the content - * @param {Array} [config.plugins=[]] Array of plugins to execute on start - * @param {Object} [config.pluginsOpts={}] Custom options for plugins - * @param {Boolean} [config.headless=false] Init headless editor - * @return {Editor} Editor instance - * @example - * var editor = grapesjs.init({ - * container: '#myeditor', - * components: '
Hello world
', - * style: '.hello{color: red}', - * }) - */ - init: function (config) { - if (config === void 0) { config = {}; } - var headless = config.headless; - var els = config.container; - if (!els && !headless) - throw new Error("'container' is required"); - var initConfig = src_assign(src_assign({ autorender: true, plugins: [], pluginsOpts: {} }, config), { grapesjs: this, el: headless ? undefined : (0,index_all.isElement)(els) ? els : document.querySelector(els) }); - var editor = new src_editor(initConfig, { $: cash_dom["default"] }); - var em = editor.getModel(); - // Load plugins - initConfig.plugins.forEach(function (pluginId) { - var plugin = getPlugin(pluginId, plugins); - var plgOptions = initConfig.pluginsOpts[pluginId] || {}; - if (plugin) { - plugin(editor, plgOptions); - } - else { - logPluginWarn(editor, pluginId); - } - }); - // Execute `onLoad` on modules once all plugins are initialized. - // A plugin might have extended/added some custom type so this - // is a good point to load stuff like components, css rules, etc. - em.loadOnStart(); - initConfig.autorender && !headless && editor.render(); - editors.push(editor); - return editor; - }, -}; -/* harmony default export */ const src_0 = (grapesjs); - -})(); - -var __webpack_exports__default = __webpack_exports__.ZP; -var __webpack_exports__grapesjs = __webpack_exports__.kr; -var __webpack_exports__usePlugin = __webpack_exports__.j7; -export { __webpack_exports__default as default, __webpack_exports__grapesjs as grapesjs, __webpack_exports__usePlugin as usePlugin }; - -//# sourceMappingURL=grapes.mjs.map \ No newline at end of file diff --git a/dist/grapes.mjs.map b/dist/grapes.mjs.map deleted file mode 100644 index 135d6e475f..0000000000 --- a/dist/grapes.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"grapes.mjs","mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA,KAAK,IAA0C;AAC/C;AACA,EAAE,iCAAO,CAAC,uBAAY,EAAE,wBAAU,CAAC,oCAAE,OAAO;AAAA;AAAA;AAAA,kGAAC;AAC7C,GAAG,KAAK,EASC;AACT,CAAC;;AAED;;AAEA;AACA;AACA;AACA,aAAa,UAAU;AACvB,aAAa,UAAU;AACvB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,eAAe;AAC5B,aAAa,UAAU;AACvB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,UAAU;AACvB,aAAa,SAAS;AACtB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,eAAe,WAAW;AAC1B,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,aAAa;AACb,eAAe,WAAW;AAC1B,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,YAAY;AACZ,cAAc,QAAQ;AACtB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA,kDAAkD,oCAAoC;AACtF;AACA;;AAEA;AACA;AACA;AACA,aAAa,UAAU;AACvB,aAAa,UAAU;AACvB,aAAa,UAAU;AACvB,aAAa,UAAU;AACvB,aAAa;AACb;AACA;AACA,2CAA2C,OAAO;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,UAAU;AACvB,aAAa,cAAc;AAC3B,aAAa,aAAa;AAC1B,aAAa,WAAW;AACxB,aAAa,WAAW;AACxB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,kCAAkC,mDAAmD;AACrF;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,SAAS;AACtB,aAAa,YAAY;AACzB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,aAAa;AACzB,YAAY,WAAW;AACvB,YAAY,aAAa;AACzB,YAAY,iBAAiB;AAC7B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qCAAqC,qBAAqB;AAC1D;AACA,4BAA4B,UAAU,sBAAsB;AAC5D;AACA;AACA;AACA;AACA,aAAa,cAAc;AAC3B,aAAa,wBAAwB;AACrC,aAAa,cAAc;AAC3B,aAAa,0BAA0B;AACvC,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc,0BAA0B;AACxC,cAAc;AACd;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc,0BAA0B;AACxC,cAAc;AACd;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc,QAAQ;AACtB,uDAAuD,SAAS;AAChE,8CAA8C,SAAS;AACvD,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,cAAc,SAAS;AACvB,cAAc;AACd;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,YAAY;AACzB,cAAc;AACd;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,YAAY;AACzB,cAAc;AACd;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,UAAU;AACvB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,aAAa,UAAU;AACvB,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc,SAAS;AACvB,cAAc,SAAS;AACvB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc,cAAc;AAC5B,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,cAAc;AACd;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc;AACd;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc,cAAc;AAC5B,cAAc;AACd;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc;AACd;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc;AACd;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc;AACd;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,cAAc,cAAc;AAC5B,cAAc;AACd;AACA;AACA;AACA;AACA,EAAE;;AAEF;;AAEA,CAAC;;;;;;;;ACh0BD;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,mBAAmB,qBAAM,gBAAgB,qBAAM,YAAY,qBAAM,IAAI,qBAAM;;AAE3E;AACA,MAAM,IAA0C;AAChD,IAAI,iCAAO,CAAC,uBAAY,EAAE,wBAAQ,EAAE,OAAS,CAAC,mCAAE;AAChD;AACA;AACA;AACA,KAAK;AAAA,kGAAC;;AAEN;AACA,IAAI,KAAK,aAQN;;AAEH,CAAC;;AAED;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,yCAAyC,oBAAoB;AAC7D;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,YAAY,gBAAgB;AAC5B;AACA;AACA;AACA;AACA;AACA,iCAAiC,mBAAmB;AACpD;AACA;AACA,MAAM;AACN;AACA,8CAA8C,kBAAkB;AAChE;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA,KAAK;;AAEL;AACA,8DAA8D;AAC9D;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;AAClE;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,gFAAgF;AACrG;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,gBAAgB;AACpC;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,sCAAsC,kBAAkB;AACxD;AACA;AACA;AACA;;AAEA;AACA,WAAW,kBAAkB;AAC7B;AACA;;AAEA;AACA;;AAEA;AACA;AACA,sBAAsB,qBAAqB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,8BAA8B,YAAY;AAC1C,sCAAsC;AACtC;AACA;AACA;;AAEA;AACA;AACA,8BAA8B,YAAY;AAC1C,sCAAsC;AACtC;AACA;;AAEA,iDAAiD,mBAAmB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,YAAY;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE;AACtE,0EAA0E;AAC1E,8EAA8E;AAC9E,kFAAkF;AAClF,8EAA8E;AAC9E;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;;AAE/B;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA,0CAA0C,WAAW;AACrD;AACA;AACA;AACA;AACA,QAAQ;AACR,mBAAmB;AACnB;;AAEA,8BAA8B;;AAE9B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB,oBAAoB;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,+CAA+C,YAAY,YAAY;AACvE,KAAK;;AAEL;AACA;AACA;AACA;AACA,wCAAwC,YAAY,YAAY;AAChE,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,0BAA0B,YAAY;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,0CAA0C,WAAW;AACrD;AACA;AACA;AACA;AACA,QAAQ;AACR,mBAAmB;AACnB;;AAEA,0BAA0B,4BAA4B;AACtD;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;;AAEA,uCAAuC,WAAW;AAClD,sDAAsD;;AAEtD;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,8BAA8B,aAAa,YAAY,eAAe;AACtE,KAAK;;AAEL;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,8DAA8D,uBAAuB;AACrF;AACA;;AAEA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA,6CAA6C,aAAa;AAC1D;;AAEA;AACA,oBAAoB;AACpB,oBAAoB;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC,gBAAgB,YAAY;AAC5B,gBAAgB,iBAAiB;AACjC;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA,+BAA+B;;AAE/B;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA;AACA,wCAAwC,+BAA+B;AACvE,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,wCAAwC,aAAa;AACrD,KAAK;;AAEL;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,mBAAmB;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA,2BAA2B,aAAa;;AAExC;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA;AACA,0CAA0C,aAAa;AACvD;AACA;AACA,KAAK;;AAEL;AACA;AACA,uCAAuC,gBAAgB;AACvD,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,uCAAuC,MAAM;AAC7C,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;;AAE9B;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,0BAA0B,YAAY;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,sBAAsB,mBAAmB;AACzC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,gBAAgB;AAChB;;AAEA;AACA;AACA;AACA;;AAEA,YAAY;AACZ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,+BAA+B;;AAE/B;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,SAAS,6BAA6B;AACtC;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA,GAAG;;AAEH;AACA;AACA;AACA,yCAAyC,8BAA8B;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA,oEAAoE,MAAM;AAC1E;AACA;AACA;AACA,uDAAuD;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA,sBAAsB;AACtB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO,IAAI;AACX;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uCAAuC;AACvC;AACA;AACA,KAAK;;AAEL;AACA,kBAAkB;;AAElB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC,oBAAoB;AACvD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4BAA4B;;AAE5B;AACA;;AAEA;AACA;AACA,+BAA+B;;AAE/B;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wCAAwC,UAAU;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV,yCAAyC,cAAc;AACvD;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,6BAA6B,iCAAiC;AAC9D,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;;AAEnD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,uEAAuE;;AAEvE;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA,GAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,0BAA0B;AAC1B;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;;;;;;;ACzjED;AACA,MAAM,IAAuD;AAC7D,QAAQ,mBAAO,CAAC,GAA2B;AAC3C,OAAO,EAGa;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,wBAAwB;AAC9C,QAAQ;AACR,yBAAyB;AACzB,qBAAqB,yBAAyB;AAC9C;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA,QAAQ,OAAO;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA,8BAA8B,cAAc;AAC5C;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6DAA6D,YAAY;AACzE;AACA;AACA,KAAK;AACL,GAAG;AACH,CAAC;;;;;;;;ACxHD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAE,KAA4D;AAC9D,EAAE,CACwD;AAC1D,CAAC,sBAAsB;;AAEvB;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC,GAAG;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAwB;AACxB,gDAAgD,gBAAgB;AAChE;AACA;AACA;;AAEA,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0CAA0C,WAAW;AACrD,QAAQ;AACR;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,sCAAsC;AACtC,wBAAwB,gBAAgB,oBAAoB,OAAO;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,UAAU;AACV,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA,kCAAkC;AAClC,6BAA6B;AAC7B,MAAM;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA,oBAAoB,eAAe;AACnC,QAAQ,0CAA0C;AAClD;AACA;;AAEA,qCAAqC;AACrC;AACA,MAAM,+BAA+B,yBAAyB;AAC9D;AACA,MAAM,+BAA+B,MAAM,iBAAiB;;AAE5D,qBAAqB;;AAErB,qBAAqB;;AAErB;AACA;AACA,sBAAsB;AACtB;;AAEA;AACA,mBAAmB;AACnB;AACA,QAAQ;AACR,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA,uDAAuD;AACvD;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,kBAAkB;AACtC,QAAQ,uBAAuB;AAC/B;AACA;;AAEA;AACA;;AAEA;AACA;AACA,cAAc,qBAAqB;;AAEnC;AACA,wBAAwB,cAAc,eAAe,iBAAiB,cAAc;;AAEpF;AACA;AACA;AACA,+BAA+B;AAC/B;AACA,2BAA2B;AAC3B;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,yBAAyB;AACzB;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA,sBAAsB;;AAEtB;AACA;AACA,oBAAoB,kBAAkB,OAAO;AAC7C;AACA;;AAEA;AACA;AACA,kEAAkE;AAClE;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,oEAAoE;AACpE;AACA;;AAEA;AACA,yBAAyB,uCAAuC;AAChE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;;AAEjC,2CAA2C;AAC3C;AACA,yFAAyF;AACzF;AACA;;AAEA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,wBAAwB;AACxB;AACA,yBAAyB;AACzB,uBAAuB;AACvB,aAAa;AACb;AACA;;AAEA;;AAEA;AACA,kBAAkB;AAClB;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA,0CAA0C;AAC1C;AACA,wDAAwD;AACxD,eAAe;AACf;AACA;AACA,wDAAwD;AACxD,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,iDAAiD;AACjD,iDAAiD;AACjD,iDAAiD;AACjD,mDAAmD;AACnD,iCAAiC;AACjC,aAAa;AACb;;AAEA;AACA;;AAEA;AACA;AACA,wBAAwB;AACxB;;AAEA;AACA;;AAEA,wEAAwE;AACxE;AACA,sBAAsB,SAAS;AAC/B,UAAU;;AAEV;AACA;AACA;AACA;AACA,0CAA0C,WAAW;AACrD;AACA,2BAA2B;AAC3B,eAAe;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA,yCAAyC,WAAW;AACpD;AACA,2CAA2C;AAC3C,0CAA0C,cAAc,qBAAqB;AAC7E;;AAEA;AACA;AACA;AACA,2CAA2C,eAAe;AAC1D;AACA,qEAAqE;AACrE;AACA,qDAAqD;AACrD;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA,6BAA6B;AAC7B;AACA;AACA,8BAA8B,gCAAgC;AAC9D;AACA,4BAA4B,SAAS,OAAO;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C,WAAW;AACtD;AACA,6CAA6C;AAC7C,0CAA0C;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA,gCAAgC,6CAA6C;AAC7E;AACA;AACA;AACA,8BAA8B,aAAa,SAAS;AACpD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,UAAU;AAClC;AACA;AACA,sBAAsB,4CAA4C;AAClE;AACA,UAAU;AACV;AACA,sBAAsB,gCAAgC;AACtD,8BAA8B,UAAU;AACxC;AACA,+BAA+B,gDAAgD;AAC/E;AACA,0BAA0B,2CAA2C;AACrE;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN,4DAA4D;AAC5D;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA,4BAA4B;AAC5B;AACA,oBAAoB,qBAAqB,OAAO;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ,KAAK,sCAAsC;AACnD;AACA;AACA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA,oBAAoB,gBAAgB,OAAO;AAC3C,QAAQ;AACR;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,2CAA2C;AAC3C,4CAA4C;AAC5C;;AAEA;AACA;;AAEA;AACA,4BAA4B;AAC5B,WAAW;AACX;AACA;AACA,6BAA6B;AAC7B,WAAW;AACX;AACA;AACA;AACA;AACA,sBAAsB,qBAAqB;;AAE3C,wBAAwB;AACxB;AACA;AACA;AACA,0BAA0B;AAC1B,+BAA+B;AAC/B,+BAA+B;AAC/B;AACA,sCAAsC;AACtC;AACA;;AAEA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,0DAA0D,YAAY;AACtE;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA,sCAAsC,eAAe;AACrD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,IAAI,sBAAsB;;AAE1B;AACA,UAAU;AACV,eAAe;AACf,IAAI;AACJ;AACA,SAAS;AACT;AACA,iDAAiD;AACjD;AACA;;AAEA;AACA;AACA,yBAAyB;AACzB,qCAAqC;AACrC;AACA,GAAG;;AAEH;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA,mCAAmC,QAAQ;AAC3C,WAAW,gBAAgB;AAC3B;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,0CAA0C;AAC1C,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,0BAA0B;AAC1B,QAAQ;;AAER;AACA;;AAEA;AACA;AACA;AACA;AACA,sGAAsG;AACtG;AACA;;AAEA;AACA,0BAA0B;AAC1B,0BAA0B;AAC1B;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA,oBAAoB;AACpB;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4CAA4C;AAC5C,4CAA4C;AAC5C,6CAA6C;AAC7C;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,oCAAoC;AACpC,WAAW;AACX,aAAa,YAAY;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D;AAC9D;AACA;AACA,kDAAkD;AAClD;AACA;AACA,qBAAqB,kBAAkB;AACvC;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA,iCAAiC;AACjC;AACA;AACA,MAAM;AACN;AACA,sCAAsC;AACtC,wCAAwC;AACxC;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA,UAAU;AACV,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA,uBAAuB;AACvB;AACA,sBAAsB,eAAe;AACrC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,6BAA6B;AAC7B;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,yCAAyC,sBAAsB,GAAG;AAClE;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB,GAAG,gBAAgB;AACtD;;AAEA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA,iCAAiC,OAAO;AACxC,uBAAuB;AACvB,wCAAwC;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB,6BAA6B;AACrD;AACA,sBAAsB,eAAe;AACrC;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,WAAW,wBAAwB;AACnC;AACA,oBAAoB;AACpB;AACA;AACA;AACA;;AAEA,2BAA2B;;AAE3B;AACA;AACA;;AAEA;AACA;AACA;;AAEA,kCAAkC;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;;AAEvB,kCAAkC;;AAElC,uBAAuB;AACvB,0BAA0B;AAC1B,0BAA0B;;AAE1B;AACA;AACA,6BAA6B;AAC7B;AACA,gCAAgC;AAChC;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA,sCAAsC;AACtC,uBAAuB;AACvB,WAAW;AACX;AACA;AACA;AACA,oBAAoB,kBAAkB,OAAO;AAC7C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iDAAiD;AACjD;AACA;;AAEA;AACA,4BAA4B;AAC5B;AACA,QAAQ;AACR;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA,iCAAiC;AACjC;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,6BAA6B;AACtG;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,UAAU;AACV,iBAAiB,WAAW;AAC5B;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA,oBAAoB,8BAA8B;;AAElD,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,4BAA4B;AAC5B,oCAAoC;AACpC;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,mBAAmB;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B;AAC1B,2BAA2B;AAC3B;AACA,gCAAgC;AAChC;;AAEA;AACA,oBAAoB,QAAQ;AAC5B,mBAAmB;AACnB;AACA,uCAAuC;AACvC;AACA;AACA;;AAEA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;;AAEA;AACA,gBAAgB,OAAO;AACvB;AACA,wBAAwB;AACxB;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,cAAc;AACvC,iCAAiC;AACjC;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0CAA0C;AAC1C;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,sBAAsB;AACtB;;AAEA;AACA;AACA,iBAAiB,gBAAgB,kBAAkB;AACnD;AACA,mCAAmC;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC,QAAQ,wBAAwB;AAChC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,sBAAsB;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,kBAAkB;AACxC;AACA;AACA;AACA,wBAAwB;AACxB,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA,UAAU;AACV;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA,iBAAiB;AACjB,iCAAiC;;AAEjC;AACA;AACA;AACA;AACA;AACA,UAAU,kBAAkB,oBAAoB;AAChD,YAAY;AACZ,cAAc;AACd,wBAAwB,WAAW;AACnC,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA,UAAU;AACV;AACA,yBAAyB;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA,8BAA8B,gBAAgB,6BAA6B;AAC3E;AACA;AACA,YAAY;AACZ;AACA,KAAK;AACL,oBAAoB;AACpB,kBAAkB,mBAAmB;AACrC,oBAAoB,oBAAoB;AACxC;AACA,sBAAsB,kBAAkB;AACxC;AACA,8DAA8D;AAC9D;AACA;AACA,YAAY,eAAe,yBAAyB;AACpD;AACA,YAAY,eAAe,qBAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB;AAClB,oBAAoB,kBAAkB;AACtC,QAAQ;AACR;AACA;AACA;AACA,kBAAkB;AAClB,oBAAoB,kBAAkB;AACtC,QAAQ;AACR;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,gCAAgC;;AAEhC;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,mBAAmB;AACnB;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,+BAA+B,gBAAgB;AAC9D;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,wCAAwC;AACxC,sCAAsC;;AAEtC;AACA;AACA,eAAe,gBAAgB,gBAAgB;AAC/C;AACA;AACA,uEAAuE;AACvE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB,gBAAgB;AAC/C;AACA,kCAAkC;AAClC;AACA;AACA;AACA,sEAAsE;AACtE;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;;AAEA;AACA;AACA;AACA,kCAAkC;AAClC;AACA,oCAAoC;AACpC;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,+BAA+B,gBAAgB;AAC9D;AACA,kCAAkC;AAClC,6BAA6B;AAC7B,kCAAkC;AAClC;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR,mCAAmC,6BAA6B;AAChE;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oBAAoB,wBAAwB;AAC5C;AACA,6BAA6B;AAC7B,aAAa;AACb;AACA,+BAA+B,GAAG;AAClC,wBAAwB,yBAAyB;AACjD;AACA,4BAA4B;AAC5B,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,uBAAuB;AACvB,8BAA8B;AAC9B;AACA;AACA;AACA,oCAAoC;AACpC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA,yCAAyC;AACzC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,iDAAiD;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,YAAY;AACZ;;AAEA;AACA;AACA,UAAU;;AAEV;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,SAAS,mEAAmE;AAC5E;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA,QAAQ;;AAER;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC,iBAAiB;AACjB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,sCAAsC;AACtC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,sBAAsB;AACtB;AACA;AACA,uCAAuC;AACvC,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA,uDAAuD;AACvD;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C,UAAU;AACV;AACA;;AAEA;AACA;AACA,WAAW;AACX,+BAA+B;AAC/B;AACA;AACA,0BAA0B;AAC1B;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,yBAAyB,qBAAqB;AAC9C,kDAAkD;AAClD,qDAAqD;AACrD;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA,kBAAkB,+BAA+B;AACjD;AACA;AACA,gBAAgB;AAChB,YAAY;AACZ;AACA;AACA;AACA,yBAAyB,kBAAkB,wBAAwB;AACnE,YAAY,wCAAwC;;AAEpD,mDAAmD,kBAAkB,6BAA6B;AAClG,YAAY;AACZ;AACA;AACA;AACA,sCAAsC;AACtC,qCAAqC;AACrC;AACA;AACA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,+BAA+B,YAAY;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB,UAAU;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,sBAAsB;AACnC,UAAU;AACV,sBAAsB,sBAAsB;AAC5C;AACA;AACA,YAAY;AACZ,cAAc;AACd;AACA,MAAM;AACN;;AAEA;AACA;AACA,kBAAkB;;AAElB,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,8BAA8B,kCAAkC;AAChE;;AAEA,oBAAoB,gBAAgB;AACpC;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,oBAAoB,OAAO;AAC/C;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,6BAA6B;AACjD;AACA,4BAA4B;AAC5B,mCAAmC;AACnC,kCAAkC;AAClC,mCAAmC;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,kCAAkC;AAClC;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA,iBAAiB;AACjB,aAAa,iEAAiE;AAC9E,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2HAA2H;AAC3H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA,6EAA6E;AAC7E,qBAAqB,gBAAgB,mCAAmC;AACxE;AACA;AACA,YAAY;AACZ,8EAA8E;AAC9E;AACA;AACA;;AAEA;AACA,8BAA8B;AAC9B;AACA,+DAA+D,MAAM;AACrE;AACA,2CAA2C;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yBAAyB,gBAAgB,0BAA0B;AACnE,QAAQ;AACR;;AAEA;AACA,yBAAyB;AACzB;AACA,uCAAuC,eAAe;AACtD;AACA,uCAAuC;AACvC;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;;AAEA;AACA,iCAAiC;AACjC;AACA,eAAe;AACf;AACA,4CAA4C;AAC5C;AACA,UAAU,uEAAuE;AACjF;AACA,UAAU,gEAAgE;AAC1E;AACA;AACA;AACA;;AAEA;AACA;AACA,8BAA8B,sBAAsB;AACpD;AACA;AACA,UAAU;AACV;AACA;;AAEA;;AAEA,gCAAgC;AAChC,iCAAiC;AACjC;AACA,kCAAkC;AAClC;AACA;AACA,gBAAgB;AAChB,mDAAmD;AACnD;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,sBAAsB;AAC9C;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ,QAAQ;AAChB;AACA,sBAAsB,0BAA0B;AAChD,UAAU;AACV,YAAY,QAAQ;AACpB,wBAAwB,4BAA4B;AACpD,UAAU;AACV,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY,0BAA0B;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA,MAAM;AACN;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,YAAY;AACZ;AACA;AACA;;AAEA,kBAAkB;;AAElB;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA,mBAAmB;AACnB;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA,0BAA0B,gBAAgB,kBAAkB;AAC5D,kDAAkD;AAClD,QAAQ,OAAO,iCAAiC,UAAU;AAC1D,oDAAoD;AACpD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,8BAA8B;AAC9B,wBAAwB,SAAS,SAAS;AAC1C,gGAAgG;AAChG,gIAAgI;AAChI;AACA,YAAY;AACZ;AACA,YAAY;AACZ,qDAAqD;AACrD;AACA;AACA;AACA;AACA,mCAAmC;AACnC,MAAM,OAAO;AACb,uBAAuB;AACvB;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,UAAU,QAAQ;AAClB;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA,WAAW,wBAAwB;AACnC,QAAQ,wBAAwB;AAChC;AACA,kBAAkB;AAClB;AACA;AACA,qCAAqC;AACrC,iDAAiD,oBAAoB;;AAErE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA,2BAA2B,gBAAgB,0BAA0B;AACrE,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,4BAA4B;AAChD,QAAQ;AACR;;AAEA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;;AAEA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,gBAAgB,oBAAoB,OAAO;AAC9D,QAAQ;AACR;AACA;;AAEA,iBAAiB,0BAA0B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,6BAA6B;AAC7B,oBAAoB;AACpB;AACA,8BAA8B;AAC9B,WAAW;AACX;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,sBAAsB;AACtB;AACA;;AAEA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;;AAEA;AACA,oBAAoB;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,mBAAmB,oBAAoB,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,kBAAkB;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,QAAQ;AACR,iBAAiB;;AAEjB;AACA,WAAW;AACX;AACA;AACA,wBAAwB;AACxB;AACA,oCAAoC;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAA0C,sEAAsE;AAChH,oCAAoC,8DAA8D;AAClG,YAAY;AACZ;;AAEA;AACA,4BAA4B;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA,oBAAoB,kBAAkB;AACtC;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,6BAA6B,QAAQ;AACrC,yBAAyB,QAAQ;AACjC;AACA;;AAEA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,sBAAsB,QAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;;AAEA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,8CAA8C,GAAG;AACjD;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;;AAExC;AACA,0BAA0B,gBAAgB,yBAAyB;AACnE,sCAAsC;AACtC;;AAEA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA;AACA,sCAAsC;AACtC,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;;AAE5E;AACA;AACA,UAAU,4BAA4B;AACtC,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kCAAkC;AAClC;AACA,iBAAiB;AACjB;AACA,oBAAoB,iBAAiB;AACrC;AACA,mBAAmB;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,sBAAsB;AACtB,oBAAoB;;AAEpB;AACA;AACA;AACA,QAAQ;;AAER;;AAEA,kCAAkC;AAClC;AACA,UAAU;AACV,MAAM,mCAAmC;AACzC;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM,6DAA6D;AACnE;AACA,MAAM,qCAAqC;AAC3C;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,MAAM,iCAAiC;AACvC;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,MAAM,OAAO;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER,6DAA6D;AAC7D;AACA,iCAAiC;AACjC;AACA,oCAAoC;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ,QAAQ;AAChB;AACA,oBAAoB,WAAW;AAC/B,QAAQ;AACR;AACA;AACA,wCAAwC;AACxC;AACA;AACA,QAAQ;AACR;AACA;AACA,oBAAoB;AACpB;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA,sEAAsE;AACtE;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,wBAAwB;AACxB,oBAAoB,2BAA2B;AAC/C,gDAAgD;AAChD;AACA,6FAA6F;AAC7F;AACA;AACA;AACA,oBAAoB;AACpB,QAAQ;AACR;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB;AACrB;AACA;AACA,yFAAyF,qBAAqB,mDAAmD,4DAA4D;AAC7N;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA,UAAU,OAAO;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;;AAEA,uDAAuD;AACvD,2CAA2C;AAC3C,mDAAmD;AACnD,yCAAyC;AACzC,OAAO;AACP,cAAc;AACd;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR,8BAA8B;AAC9B;AACA,OAAO;AACP;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B;AACA,8BAA8B;AAC9B,OAAO;AACP;;AAEA;AACA,gEAAgE;;AAEhE,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,yBAAyB,sCAAsC,SAAS;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,yBAAyB,6BAA6B;AACnF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,yBAAyB;AAC7C;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA,wBAAwB,gBAAgB,qBAAqB;AAC7D,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;;AAEA;AACA;AACA;AACA,wBAAwB,gBAAgB,yBAAyB;AACjE;AACA,oBAAoB;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,OAAO,SAAS,OAAO,WAAW;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;;AAEA;AACA;AACA;AACA,sDAAsD;;AAEtD;AACA;AACA,kCAAkC;AAClC,0GAA0G;AAC1G;AACA,uEAAuE,mGAAmG,0GAA0G,wDAAwD,uDAAuD;AACnY;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA,2DAA2D;AAC3D;AACA,sBAAsB;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA,uCAAuC;AACvC,wCAAwC;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,iCAAiC;AACjC;;AAEA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;;AAEA;AACA,kCAAkC;AAClC,qBAAqB;AACrB,qBAAqB;AACrB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,gDAAgD;AAChD,kBAAkB,yBAAyB,SAAS;AACpD;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA,gEAAgE;AAChE;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;AACA;AACA;AACA,2GAA2G;AAC3G;AACA;AACA,iDAAiD;AACjD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA,iBAAiB;;AAEjB;AACA,+BAA+B;AAC/B,KAAK;AACL;AACA,+BAA+B;AAC/B,KAAK;;AAEL;AACA;AACA,gCAAgC;AAChC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA,yBAAyB;AACzB;AACA;;AAEA,YAAY;AACZ;;AAEA;AACA,wCAAwC;AACxC,6BAA6B;AAC7B;;AAEA;AACA,sCAAsC;AACtC,4BAA4B;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,kDAAkD,QAAQ;AAC1D;AACA;AACA;;AAEA;AACA,oBAAoB;AACpB;AACA;AACA,oBAAoB,mFAAmF;AACvG;AACA,UAAU;AACV;AACA,wCAAwC;AACxC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM,OAAO;AACb;AACA;AACA;AACA;AACA,MAAM,OAAO;AACb;;AAEA,wBAAwB;;AAExB;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA,gCAAgC,yBAAyB,kCAAkC;AAC3F,OAAO;AACP;AACA,KAAK;AACL,kCAAkC;AAClC,aAAa;AACb,KAAK;AACL;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd,sBAAsB,sBAAsB;AAC5C,UAAU;AACV;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC,QAAQ;AACR,sBAAsB,kBAAkB;AACxC,QAAQ;AACR,sBAAsB,kBAAkB;AACxC,QAAQ;AACR,sBAAsB,kBAAkB;AACxC,QAAQ;AACR,sBAAsB,kBAAkB;AACxC,QAAQ;AACR;;AAEA;AACA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA;AACA,8CAA8C,0CAA0C;AACxF;;AAEA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B;;AAE7B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,QAAQ;AACR;;AAEA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA,QAAQ;;AAER,+BAA+B;;AAE/B;AACA,QAAQ;AACR,qBAAqB;AACrB;;AAEA;AACA;;AAEA,6BAA6B;;AAE7B;AACA;AACA,QAAQ;;AAER;AACA,gCAAgC;;AAEhC,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,gBAAgB,mBAAmB;AACrD,QAAQ,+BAA+B;AACvC,oBAAoB,kBAAkB,uBAAuB;AAC7D,QAAQ,kCAAkC;;AAE1C;AACA,QAAQ;;AAER;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;;AAEA;AACA;AACA,oBAAoB;AACpB;AACA,UAAU;AACV,cAAc;AACd;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,YAAY;AACZ,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA,YAAY;AACZ,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,YAAY;AACZ,gBAAgB;AAChB;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;;AAEA;AACA,iDAAiD;AACjD;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,sBAAsB;AACtB,2BAA2B;AAC3B;AACA;AACA,wBAAwB,mCAAmC,OAAO;AAClE,wBAAwB;AACxB;AACA;AACA,QAAQ;AACR;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,+BAA+B;AAC/B,sBAAsB,yBAAyB;AAC/C,UAAU;AACV,KAAK;AACL;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA,oBAAoB,wBAAwB;AAC5C,QAAQ;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB;AACzB;AACA,4DAA4D;AAC5D,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iHAAiH;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mEAAmE;AACnE,2DAA2D;AAC3D;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA,wBAAwB;AACxB;AACA,wBAAwB;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA,4BAA4B;AAC5B;AACA;AACA;AACA,YAAY,YAAY;AACxB;AACA;AACA;AACA;AACA,YAAY;AACZ,QAAQ;AACR;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA,6BAA6B,oEAAoE;AACjG;AACA;AACA,QAAQ,OAAO;AACf,uCAAuC;AACvC;AACA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,6FAA6F;AAC7F;AACA;AACA,oBAAoB,iBAAiB,OAAO;AAC5C;AACA;AACA,YAAY;AACZ;AACA,YAAY;AACZ;AACA;AACA,mBAAmB,gBAAgB,kBAAkB;AACrD,UAAU;AACV;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,oBAAoB;AACxC;AACA,qCAAqC,oBAAoB;AACzD;AACA,4BAA4B;AAC5B,eAAe;AACf;AACA,mBAAmB,8BAA8B;AACjD;AACA,0CAA0C,aAAa,iDAAiD;AACxG;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,+BAA+B,WAAW;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;;AAE3C;AACA;AACA;;AAEA;AACA,gCAAgC,6BAA6B;AAC7D,yCAAyC;;AAEzC;AACA,+BAA+B;AAC/B,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,oBAAoB;AACpB,qBAAqB;AACrB,qBAAqB;;AAErB;AACA;AACA,iEAAiE;AACjE,+DAA+D;AAC/D,2BAA2B;AAC3B,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD,aAAa;AACb;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mDAAmD;;AAEnD;AACA;AACA;AACA;AACA;AACA,2DAA2D,eAAe;AAC1E,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,kCAAkC;AAClC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,aAAa;AACb,+BAA+B,sBAAsB;AACrD;;AAEA;AACA;AACA,iDAAiD;AACjD,8BAA8B;AAC9B;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,SAAS;AACT,QAAQ;AACR,+BAA+B;AAC/B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8CAA8C;;AAE9C;AACA,yBAAyB;AACzB,0FAA0F;AAC1F,oBAAoB,wBAAwB;AAC5C;AACA,kGAAkG;AAClG;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,wBAAwB;AAC5C,QAAQ;AACR;AACA;;AAEA;AACA,oBAAoB,wBAAwB;AAC5C,QAAQ,+BAA+B;AACvC;AACA;;AAEA;AACA,gBAAgB;AAChB,oBAAoB,wBAAwB;AAC5C;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA,0BAA0B;AAC1B;;AAEA,uCAAuC;AACvC,qCAAqC;AACrC,wCAAwC;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,iCAAiC;AACnE;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA,qCAAqC;AACrC,oCAAoC;;AAEpC;AACA,sCAAsC;AACtC;AACA;;AAEA;AACA;AACA,oBAAoB,2BAA2B;AAC/C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,KAAK;AACL;AACA;AACA;AACA,oBAAoB;AACpB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,SAAS;AACnC,UAAU;AACV;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,oBAAoB;AACpB,0BAA0B;AAC1B,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,wBAAwB;AACxB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB,gBAAgB,uBAAuB;AAC/D;AACA,+BAA+B;AAC/B;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB;AACtB;AACA,qCAAqC,iFAAiF;AACtH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,UAAU;AACV,aAAa;AACb;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;;AAER;AACA;AACA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU,uDAAuD;AACjE;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,oBAAoB,kBAAkB;AACtC,+CAA+C,YAAY;AAC3D,sBAAsB;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,oBAAoB,wBAAwB;AAC5C,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,sBAAsB;;AAEtB,oBAAoB,gBAAgB;AACpC;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA,0BAA0B,mBAAmB;AAC7C,cAAc,uCAAuC;AACrD;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC,sBAAsB,oBAAoB;AAC1C;AACA,yBAAyB,oDAAoD;AAC7E,wBAAwB,2BAA2B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA,0BAA0B;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAoB,2BAA2B;AAC/C,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C,YAAY;AACZ;AACA,OAAO;AACP;AACA;AACA;AACA,kBAAkB;AAClB,oCAAoC;AACpC,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;;AAER;AACA;AACA;;AAEA;AACA,QAAQ;AACR;;AAEA;AACA,+BAA+B;;AAE/B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4BAA4B,gBAAgB,6BAA6B;AACzE;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC,kBAAkB,KAAK;AACvB;AACA;AACA,yBAAyB;;AAEzB;AACA;AACA;AACA,cAAc;AACd;AACA,cAAc;AACd;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC;AAClC,aAAa;AACb,MAAM;AACN,iDAAiD;AACjD,aAAa;AACb,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA,kBAAkB;AAClB,kBAAkB;AAClB,gBAAgB;AAChB,kBAAkB;AAClB,kCAAkC;AAClC;AACA;AACA,kBAAkB;;AAElB;AACA,oBAAoB;AACpB;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,wCAAwC;AACxC;;AAEA;AACA;AACA,qBAAqB;AACrB;;AAEA;AACA;AACA;AACA;AACA,qCAAqC,QAAQ;AAC7C,UAAU,sBAAsB,0FAA0F;AAC1H,MAAM;AACN;AACA;AACA;;AAEA;AACA,+FAA+F;AAC/F;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,2CAA2C;;AAE3C;AACA;;AAEA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;AACA,UAAU;AACV;AACA,8BAA8B;AAC9B;;AAEA,WAAW;AACX;AACA;AACA;AACA;AACA,oCAAoC,iBAAiB;AACrD;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ,OAAO;AACf;;AAEA;AACA;AACA;AACA;AACA,eAAe,kDAAkD;AACjE;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,0BAA0B,uBAAuB,yCAAyC;AAC1F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,6CAA6C,UAAU;AACvD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,mEAAmE;AACnE;AACA;AACA,QAAQ;AACR;AACA;AACA,mDAAmD,cAAc;AACjE,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA;AACA,6CAA6C;;AAE7C;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;;AAEA,qBAAqB;AACrB,kBAAkB;AAClB,WAAW;AACX;;AAEA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,QAAQ;;AAER;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,gCAAgC;AAChC;;AAEA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA,QAAQ;;AAER;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,4BAA4B;AAC5B;AACA;AACA;;AAEA;AACA;;AAEA,eAAe;AACf,6BAA6B;AAC7B,mCAAmC;AACnC,qBAAqB,+CAA+C;AACpE;;AAEA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA,2BAA2B,iCAAiC;AAC5D,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA,wBAAwB,0BAA0B;AAClD;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC,WAAW;AACX,sBAAsB;AACtB,kCAAkC;AAClC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,0BAA0B;;AAEtD;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,sBAAsB,kBAAkB,OAAO;AAC/C,KAAK;;AAEL;AACA;AACA,2BAA2B,QAAQ;AACnC,UAAU,0BAA0B;AACpC;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,qBAAqB;AACzC;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,kBAAkB;;AAE9C;AACA;AACA,sBAAsB,0BAA0B;AAChD;AACA;AACA;AACA;AACA;AACA,0BAA0B,8BAA8B;AACxD,gCAAgC;AAChC;AACA,UAAU,OAAO;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,sBAAsB,0BAA0B,OAAO;AACvD,KAAK;;AAEL;AACA;AACA;AACA,sBAAsB,0BAA0B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,yBAAyB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,KAAK;;AAEL;AACA,sBAAsB,0BAA0B;AAChD;AACA;AACA;AACA,2CAA2C;AAC3C,kCAAkC;AAClC;AACA,UAAU,OAAO;AACjB;AACA;AACA;;AAEA;;AAEA;AACA,mBAAmB,2BAA2B;AAC9C,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B,oBAAoB,eAAe,OAAO,qBAAqB;AAC/D,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA,qCAAqC;AACrC,aAAa;AACb;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA,KAAK;AACL,cAAc;AACd;AACA;;AAEA;;AAEA;AACA;AACA;AACA,MAAM,kBAAkB;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC;AAClC;AACA,kBAAkB;AAClB;AACA;AACA,mBAAmB;AACnB;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,mCAAmC;AACnC;AACA,+BAA+B;AAC/B,iCAAiC;AACjC;AACA;AACA;AACA,UAAU;AACV;AACA,4DAA4D,kBAAkB,yBAAyB;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,cAAc;AACd,kBAAkB;AAClB,uBAAuB;AACvB;;AAEA,iEAAiE;AACjE,SAAS;AACT;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,oBAAoB;AACpB;;AAEA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA,mCAAmC;;AAEnC;AACA,mBAAmB;AACnB;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,wCAAwC;AACxC,gCAAgC;AAChC;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA,QAAQ,yBAAyB,uCAAuC;;AAExE;AACA;AACA;AACA,UAAU;AACV,sDAAsD;AACtD;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,4BAA4B;AAC5B,qCAAqC;AACrC,KAAK;;AAEL,+BAA+B,8CAA8C,wBAAwB;;AAErG;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA,UAAU;AACV;AACA;AACA,UAAU,wBAAwB,cAAc,OAAO;AACvD,2BAA2B;AAC3B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,oBAAoB;AACxC,QAAQ;AACR;;AAEA;AACA,kCAAkC;AAClC;AACA,oBAAoB,yBAAyB;AAC7C,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA,sBAAsB,uBAAuB;AAC7C,UAAU,8BAA8B;AACxC;AACA,KAAK;AACL;AACA;;AAEA;AACA,6FAA6F,kBAAkB;AAC/G;;AAEA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oDAAoD,wBAAwB;AAC5E,sBAAsB,2BAA2B;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,oBAAoB;AACxC;;AAEA;AACA;AACA,kCAAkC;AAClC,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mCAAmC;AACnC,qBAAqB,m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7C;AACA,sBAAsB;AACtB;AACA;AACA,yCAAyC,UAAU;AACnD,UAAU;AACV,oBAAoB;AACpB,0BAA0B;AAC1B,KAAK;AACL,kCAAkC,qCAAqC;AACvE,kCAAkC,qCAAqC;AACvE,2CAA2C,2CAA2C;AACtF,2CAA2C,2CAA2C;;AAEtF,iCAAiC,mBAAmB;AACpD,8BAA8B,mBAAmB;;AAEjD;AACA;AACA,sBAAsB,sBAAsB,OAAO,4BAA4B;AAC/E,wBAAwB,0BAA0B,SAAS,gCAAgC;AAC3F,cAAc;AACd,KAAK;AACL;AACA;;AAEA;AACA,wCAAwC,sCAAsC;AAC9E,KAAK;;AAEL;AACA;AACA,KAAK;AACL;AACA;AACA,UAAU;AACV;AACA,KAAK;AACL;AACA;AACA,KAAK;;AAEL;AACA,cAAc;AACd;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,oEAAoE;AACpE;AACA,0CAA0C;AAC1C;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA,WAAW;AACX;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA,qBAAqB;AACrB,QAAQ;AACR;AACA,yBAAyB;AACzB;AACA,cAAc;AACd;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,oDAAoD;AACpD,eAAe;AACf;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB,gCAAgC;AAChC;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA,KAAK;AACL,yCAAyC,iBAAiB;;AAE1D;AACA;AACA,KAAK;AACL;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,mBAAmB,gBAAgB,kBAAkB;AACrD;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,KAAK;AACL;AACA,kCAAkC;AAClC;AACA;AACA;AACA,qBAAqB,gBAAgB,kBAAkB;AACvD;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,mBAAmB,gBAAgB,gBAAgB;AACnD,YAAY,2BAA2B;AACvC,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,wBAAwB,UAAU;AAClC;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA;AACA,uDAAuD;AACvD;AACA,2DAA2D;AAC3D;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,sBAAsB;AACtB;AACA,yDAAyD;AACzD,mDAAmD;AACnD;AACA,gCAAgC;AAChC,SAAS,0CAA0C,0CAA0C;AAC7F,sBAAsB,0DAA0D;AAChF;AACA;AACA,KAAK;AACL;AACA,yCAAyC;AACzC,yBAAyB,gBAAgB,wBAAwB;AACjE;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,+BAA+B;AAC1E;AACA;AACA;AACA;AACA,KAAK;AACL,iCAAiC,qBAAqB;;AAEtD,yBAAyB,iBAAiB;AAC1C,2BAA2B,eAAe;;AAE1C;AACA,0BAA0B;AAC1B;AACA,KAAK;AACL,gCAAgC,6BAA6B;;AAE7D;AACA,0BAA0B;AAC1B,mCAAmC;AACnC;AACA,kCAAkC,2BAA2B;AAC7D,qBAAqB;AACrB,KAAK;AACL,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,cAAc;AACd;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,yDAAyD,mBAAmB;AAC5E;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA,oCAAoC,EAAE;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,kBAAkB,OAAO;AAC/C,MAAM,OAAO;AACb;AACA;AACA;AACA;AACA,iCAAiC,kCAAkC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA,0BAA0B,kBAAkB,uBAAuB;AACnE,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wEAAwE,WAAW;AACnF,iEAAiE;;AAEjE;AACA;;AAEA;AACA;AACA;AACA,yDAAyD,SAAS,OAAO;AACzE,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;AACA,oBAAoB,oBAAoB;AACxC;AACA,gBAAgB;AAChB;AACA,0BAA0B;AAC1B,sBAAsB,oBAAoB,OAAO;AACjD,KAAK;AACL;;AAEA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,qCAAqC,mCAAmC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA,qBAAqB;AACrB;AACA;AACA;;AAEA;AACA,kBAAkB,QAAQ,OAAO;AACjC;AACA,qBAAqB,WAAW,SAAS;AACzC;AACA,oBAAoB,WAAW,SAAS;;AAExC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,sBAAsB;AAC1C;AACA,yCAAyC;AACzC,wCAAwC;AACxC,kDAAkD;AAClD,0CAA0C;AAC1C,aAAa;AACb;AACA,eAAe;AACf,gBAAgB;AAChB,eAAe;AACf,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA,8DAA8D;AAC9D,4BAA4B,wBAAwB;;AAEpD;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,qBAAqB;AACrB,gCAAgC;AAChC;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;;AAEA;AACA;AACA;AACA,2BAA2B;AAC3B,2BAA2B;AAC3B,0CAA0C;;AAE1C;AACA;AACA,UAAU;AACV,sBAAsB,4BAA4B;AAClD;AACA,sBAAsB;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,yCAAyC;AACzC,2EAA2E;AAC3E,0EAA0E;AAC1E,yDAAyD;AACzD;AACA;;AAEA;AACA;AACA,0DAA0D;AAC1D;AACA,6CAA6C;AAC7C;AACA;AACA,4CAA4C;AAC5C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,QAAQ;AAC5C,UAAU;AACV;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,4DAA4D;AACrG,oCAAoC;AACpC,UA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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,uBAAuB;AACvB;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,6BAA6B;AACjD;AACA,oBAAoB;AACpB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,SAAS;AACT,+DAA+D;AAC/D;AACA;AACA;;AAEA;AACA;;AAEA;AACA,QAAQ;AACR;AACA,QAAQ;;AAER;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA,gEAAgE,sCAAsC;AACtG;AACA;AACA,mBAAmB;AACnB,cAAc;AACd,MAAM;AACN,qDAAqD,gCAAgC;AACrF;AACA;;AAEA;AACA;AACA,6DAA6D,sCAAsC;AACnG;;AAEA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA,iCAAiC;AACjC;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,QAAQ;;AAER;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;AAC3B;AACA;;AAEA;AACA;AACA,+DAA+D;AAC/D,+GAA+G;AAC/G;AACA,8CAA8C,uBAAuB,qBAAqB;AAC1F,6EAA6E;AAC7E;AACA;AACA,wBAAwB;AACxB,wCAAwC;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yFAAyF;AACzF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iCAAiC,2CAA2C;AAC5E;AACA;AACA;AACA,gCAAgC;AAChC;AACA;;AAEA;AACA;AACA,QAAQ;;AAER,iEAAiE;;AAEjE;AACA,iBAAiB;AACjB,kDAAkD;AAClD,MAAM;AACN,iBAAiB;AACjB,+BAA+B,+BAA+B;AAC9D,MAAM;AACN,+BAA+B;AAC/B,aAAa;AACb;AACA;;AAEA;AACA;AACA,8BAA8B;AAC9B,mCAAmC;AACnC;;AAEA;AACA,sCAAsC;AACtC,oBAAoB;AACpB;AACA;AACA,+BAA+B;AAC/B;AACA,QAAQ;AACR;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD,gCAAgC;AAChC,oCAAoC;AACpC;AACA;;AAEA;AACA,cAAc;AACd,WAAW;;AAEX;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,6BAA6B;AAC7B,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,YAAY,wBAAwB,0CAA0C,oBAAoB,GAAG,uBAAuB;AAC5H;AACA,YAAY;AACZ;AACA,KAAK;AACL;AACA;AACA;AACA,kCAAkC;AAClC;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6BAA6B,+BAA+B;AAC5D;AACA,qCAAqC;AACrC;;AAEA;AACA,0BAA0B;AAC1B,0BAA0B;AAC1B,0BAA0B;AAC1B;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV,MAAM;AACN;AACA;AACA;;AAEA;AACA,8BAA8B;AAC9B;AACA;AACA,MAAM;AACN;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,oBAAoB,gCAAgC;AACpD,MAAM;AACN;AACA,oBAAoB,gCAAgC;AACpD;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA,oCAAoC;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,cAAc;AACd;AACA,cAAc;AACd;AACA,8BAA8B;AAC9B;AACA,sBAAsB,gCAAgC;AACtD;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,YAAY,sCAAsC,2BAA2B,aAAa;AAC1F,QAAQ;AACR;AACA,uBAAuB;AACvB,qCAAqC;AACrC;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C,aAAa;AACb,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;AAClE;AACA,kBAAkB;AAClB;AACA,0DAA0D;AAC1D;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,YAAY,gBAAgB;AAC5B,mBAAmB;AACnB;AACA,8EAA8E;AAC9E,mBAAmB;;AAEnB;AACA;;AAEA,wDAAwD;AACxD;;AAEA,oBAAoB,mCAAmC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,sEAAsE;AACtE,gDAAgD;AAChD,8BAA8B;AAC9B;;AAEA;AACA,gDAAgD;AAChD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,cAAc,qBAAqB;;AAEnC;AACA;;AAEA;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB,6CAA6C,mBAAmB,yBAAyB;AACzF;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,6CAA6C,0BAA0B;AACvE;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,kBAAkB;AAClB;AACA;AACA,0BAA0B;AAC1B;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,OAAO;AACP,yCAAyC,QAAQ;AACjD,UAAU;AACV,KAAK;AACL;AACA;AACA,yBAAyB;AACzB,KAAK;AACL,oFAAoF,sBAAsB;AAC1G;AACA;AACA;AACA,KAAK;AACL,qDAAqD,6CAA6C;AAClG,sDAAsD,8CAA8C;AACpG,yDAAyD,iDAAiD;AAC1G;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,iCAAiC;AACjC,yBAAyB;AACzB,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,gEAAgE,8BAA8B;AAC9F;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,uDAAuD,iBAAiB;AACxE;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL,sDAAsD,YAAY,4BAA4B;AAC9F;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,wCAAwC;AAC1F;AACA,iDAAiD,sBAAsB;AACvE;AACA;AACA,kBAAkB;AAClB,KAAK;;AAEL,kDAAkD,0DAA0D;AAC5G;AACA,oDAAoD,kCAAkC;AACtF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,8BAA8B;AAC3D;;AAEA;AACA;;AAEA;AACA;;AAEA,yCAAyC;;AAEzC;AACA;AACA;;AAEA;AACA,kCAAkC;AAClC,6BAA6B;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wCAAwC;;AAExC;AACA;AACA,iCAAiC,yBAAyB,0CAA0C;;AAEpG;AACA;;AAEA;AACA;AACA;;AAEA;AACA,QAAQ;AACR,0DAA0D;AAC1D,OAAO;AACP;AACA,QAAQ;;AAER,sCAAsC;AACtC,QAAQ;AACR;AACA,8BAA8B;AAC9B,oBAAoB,sBAAsB,OAAO;AACjD;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR,qCAAqC;AACrC;AACA,4EAA4E;AAC5E;AACA;AACA;AACA,OAAO;AACP;AACA,QAAQ,0CAA0C,sDAAsD;AACxG;AACA;AACA;AACA,iDAAiD,8BAA8B;AAC/E;AACA,4CAA4C;AAC5C,KAAK;;AAEL;AACA,oCAAoC;AACpC;AACA;AACA,iDAAiD,8BAA8B;AAC/E;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,2BAA2B;AAC3B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,YAAY;AACZ;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,gDAAgD,8BAA8B;AAC9E,oDAAoD,8BAA8B;;AAElF;AACA,0CAA0C,wDAAwD;;AAElG;AACA,2BAA2B,8BAA8B,aAAa;AACtE,0BAA0B,8BAA8B,mBAAmB,aAAa;AACxF,4BAA4B,4BAA4B;AACxD;AACA,2BAA2B,8BAA8B;AACzD;;AAEA;AACA,oCAAoC,6BAA6B;AACjE;AACA;AACA,oCAAoC,wBAAwB;AAC5D,mCAAmC,uBAAuB;AAC1D;;AAEA;AACA,6CAA6C;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA,8BAA8B;AAC9B,aAAa;AACb;;AAEA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,aAAa;AACb,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA,QAAQ,gDAAgD,GAAG,MAAM,gBAAgB;AACjF,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,wBAAwB,6BAA6B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B,gCAAgC;AAC5D;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,4BAA4B;AACtD,cAAc;AACd;AACA,QAAQ;AACR,mDAAmD,aAAa;AAChE;AACA;;AAEA;AACA;AACA,0CAA0C,UAAU;AACpD;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,YAAY;AACZ;AACA,YAAY;AACZ;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA,oCAAoC;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU,0BAA0B,sDAAsD;AAC1F;AACA;AACA;;AAEA;AACA;AACA,gEAAgE;AAChE;;AAEA,wCAAwC,QAAQ;AAChD;AACA,0FAA0F;AAC1F;AACA;AACA;AACA,wBAAwB,+BAA+B;AACvD,YAAY;AACZ;AACA;AACA;AACA,QAAQ;AACR;AACA,YAAY;AACZ;AACA,sBAAsB;AACtB;AACA;;AAEA;AACA;AACA,oBAAoB,8BAA8B;AAClD;AACA,uBAAuB;AACvB;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,8DAA8D,cAAc,YAAY,YAAY,aAAa,iBAAiB;AAClI,wDAAwD,oBAAoB,YAAY,YAAY;AACpG;AACA;AACA;AACA;AACA,kBAAkB;AAClB,WAAW;AACX,qBAAqB;AACrB,eAAe;AACf;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,wBAAwB,mBAAmB,4BAA4B;;AAEvE;AACA;AACA,4DAA4D;AAC5D;AACA;AACA,YAAY;AACZ;AACA,OAAO;;AAEP,mCAAmC,4BAA4B;AAC/D,0BAA0B,gBAAgB;;AAE1C;AACA;AACA,OAAO;AACP;AACA;AACA,wBAAwB,iBAAiB;AACzC,YAAY;AACZ;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA,+BAA+B;AAC/B;AACA,sBAAsB;AACtB,mEAAmE;AACnE,0CAA0C,0BAA0B;AACpE;AACA;AACA,OAAO;AACP;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA,6BAA6B;AAC7B,iBAAiB;AACjB;AACA,mCAAmC;AACnC,OAAO;AACP;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB,YAAY;AACZ;AACA;AACA,+CAA+C;AAC/C;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,eAAe,OAAO;AACtB;AACA,uDAAuD;AACvD,+CAA+C;AAC/C,iBAAiB,4BAA4B;AAC7C;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA,+BAA+B;AAC/B;AACA,OAAO;;AAEP;AACA;AACA,OAAO;;AAEP;AACA;AACA,6CAA6C;AAC7C;AACA;AACA,kCAAkC;AAClC,UAAU;AACV,0BAA0B,uBAAuB;AACjD;AACA,uBAAuB;AACvB;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA,0BAA0B,2BAA2B;AACrD;AACA;AACA,cAAc;AACd;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA,6BAA6B;AAC7B,6CAA6C;AAC7C,eAAe;AACf;AACA,OAAO;;AAEP;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,OAAO;;AAEP;AACA,wCAAwC,qBAAqB;AAC7D;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,uCAAuC;AACvC,kCAAkC,aAAa;AAC/C;AACA,UAAU;AACV;AACA;AACA,+CAA+C,gBAAgB;AAC/D;AACA,OAAO;;AAEP,sCAAsC,iCAAiC;AACvE,qCAAqC,gCAAgC;;AAErE,gCAAgC,QAAQ,sDAAsD;;AAE9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,uEAAuE;AACvE;AACA,cAAc;AACd;AACA,cAAc;AACd;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,iCAAiC;AACjC,wCAAwC;AACxC;AACA;AACA;AACA,YAAY,sBAAsB,sFAAsF;AACxH,OAAO;;AAEP;AACA;AACA;AACA;;AAEA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AA8B,gBAAgB,yBAAyB;AACvE,cAAc,iCAAiC,yCAAyC;AACxF;AACA,SAAS;AACT;AACA;AACA,OAAO;;AAEP,6BAA6B,wBAAwB;AACrD,iCAAiC,4BAA4B;AAC7D,+BAA+B,0BAA0B;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,OAAO;;AAEP,gCAAgC,qCAAqC;AACrE,oCAAoC,4BAA4B;AAChE,qCAAqC,6BAA6B;AAClE,mCAAmC;AACnC;AACA;;AAEA;AACA,2CAA2C,oCAAoC;AAC/E;AACA;AACA;AACA;AACA,kCAAkC,4BAA4B;AAC9D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,YAAY;AACZ,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA,8BAA8B;AAC9B,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA,wBAAwB,SAAS,YAAY;AAC7C;AACA;;AAEA,oBAAoB;AACpB,4CAA4C;AAC5C;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAM;AACN;AACA;AACA;AACA,WAAW;AACX;AACA,6BAA6B;AAC7B,gDAAgD,uBAAuB;AACvE;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,6BAA6B,GAAG;AAChC,wBAAwB;AACxB,kEAAkE;AAClE;AACA;AACA;;AAEA;AACA,+EAA+E;AAC/E;AACA,8BAA8B,uCAAuC,gCAAgC;AACrG,KAAK;;AAEL;AACA,0BAA0B;AAC1B,KAAK;AACL;AACA,+BAA+B,oBAAoB;AACnD,KAAK;AACL;AACA;AACA,+CAA+C;AAC/C;AACA;AACA,KAAK;;AAEL,wCAAwC,qCAAqC;;AAE7E;AACA,+BAA+B;AAC/B,KAAK;;AAEL;AACA,yDAAyD;AACzD;AACA,uBAAuB,0CAA0C;AACjE,+BAA+B;AAC/B,QAAQ;AACR;AACA,QAAQ;AACR;AACA,uBAAuB,kCAAkC;AACzD;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,iDAAiD;AACjD,mCAAmC;AACnC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;;AAEA;AACA,UAAU;AACV,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,2CAA2C;AAC3C,wBAAwB;AACxB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU,kCAAkC,iDAAiD;AAC7F,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,0CAA0C;AAC1C,wCAAwC;AACxC;;AAEA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,sDAAsD;AACtD,0DAA0D;;AAE1D,+DAA+D;;AAE/D;AACA;;AAEA;AACA;AACA,QAAQ,yBAAyB,gCAAgC;AACjE;AACA,QAAQ,+BAA+B,gDAAgD;;AAEvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,uFAAuF;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sDAAsD;AACtF;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,oCAAoC;AACpC,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR,wEAAwE;;AAExE;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA,qBAAqB;AACrB;AACA;AACA;AACA,0CAA0C,eAAe,eAAe;AACxE,2CAA2C,iBAAiB,iBAAiB;AAC7E,aAAa;AACb;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,uCAAuC;AACvC;AACA;AACA;AACA,qCAAqC;AACrC,eAAe;AACf;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA,QAAQ,+BAA+B,8BAA8B;AACrE;;AAEA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,gCAAgC;AAChC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,MAAM;AAChC,QAAQ,wDAAwD;AAChE;AACA;;AAEA,8BAA8B,WAAW,kBAAkB;;AAE3D;AACA;AACA,mCAAmC,2BAA2B;AAC9D;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,+DAA+D;AAC/D;AACA,4EAA4E;;AAE5E,uBAAuB;AACvB,wBAAwB,4BAA4B;AACpD,YAAY;;AAEZ,gDAAgD;AAChD,uBAAuB;AACvB,QAAQ;AACR;AACA;AACA;AACA,WAAW;AACX;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,mBAAmB;AACnB,MAAM;AACN,6BAA6B;AAC7B,2DAA2D;AAC3D,gFAAgF;AAChF;AACA;AACA,oBAAoB,4BAA4B;AAChD;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB;AACpB;AACA,4CAA4C;AAC5C;;AAEA;AACA,uBAAuB,8BAA8B;AACrD;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA,oGAAoG,OAAO;AAC3G;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,gEAAgE,QAAQ;AACxE;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,eAAe;;AAEf;AACA,0DAA0D;AAC1D;AACA,KAAK;;AAEL;AACA,yDAAyD;;AAEzD;AACA;AACA,KAAK;;AAEL;AACA,mCAAmC;AACnC;AACA,uBAAuB,0CAA0C;AACjE,QAAQ;AACR;AACA,QAAQ;AACR;AACA,uBAAuB,kCAAkC;AACzD;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;;AAEA;AACA,gEAAgE;AAChE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,wCAAwC;AACxC,KAAK;;AAEL;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,uDAAuD,kCAAkC;AACzF;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,mCAAmC;AACnC,MAAM;AACN;AACA,mCAAmC;AACnC;AACA;AACA;;AAEA,mDAAmD;;AAEnD,wDAAwD;;AAExD;AACA;AACA,YAAY;AACZ,mBAAmB;AACnB;AACA;;AAEA,+CAA+C;;AAE/C;AACA;AACA;;AAEA,wDAAwD;;AAExD;AACA;AACA;AACA;;AAEA,4BAA4B;AAC5B;AACA;AACA,qCAAqC;AACrC,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,eAAe;AAC/C,YAAY,2BAA2B;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2CAA2C;AAC3C,6BAA6B,cAAc;AAC3C;AACA;AACA;AACA,8EAA8E;;AAE9E;AACA;AACA;;AAEA;AACA,2DAA2D;AAC3D,aAAa;;AAEb;AACA;AACA;AACA,4CAA4C,kCAAkC;AAC9E;AACA,KAAK;AACL;AACA;;AAEA;AACA,2CAA2C;AAC3C;;AAEA;AACA,iCAAiC;AACjC;AACA;;AAEA;AACA;AACA,oCAAoC;AACpC;AACA,0BAA0B,SAAS;;AAEnC;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA,4CAA4C,aAAa,aAAa,yDAAyD,kDAAkD,uBAAuB,sEAAsE,uBAAuB,iBAAiB,eAAe,kBAAkB,cAAc,yBAAyB;AAC9X;AACA,kBAAkB,qDAAqD;AACvE;AACA,kBAAkB;AAClB;AACA;AACA,mCAAmC;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA,gBAAgB;AAChB;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA,qCAAqC;AACrC;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA,0CAA0C,sEAAsE;AAChH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA,oCAAoC;AACpC,MAAM;AACN,yBAAyB;AACzB,KAAK;;AAEL;AACA,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA,uDAAuD;AACvD;AACA;;AAEA;;AAEA;AACA,8CAA8C,SAAS,2BAA2B,6BAA6B,IAAI;AACnH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA,CAAC;;;;;;;;ACjpTD;AACA;;AAEA;AACA,MAAM,IAAuD;AAC7D,QAAQ,mBAAO,CAAC,GAAsB;AACtC,OAAO,EAGa;AACpB,CAAC;AACD;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sDAAsD;AACtD,gDAAgD;AAChD,sDAAsD;AACtD,gEAAgE;AAChE,4DAA4D;AAC5D,kFAAkF;AAClF,wDAAwD;AACxD,gEAAgE;AAChE,sDAAsD;AACtD,sDAAsD;AACtD;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,WAAW;;AAEvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM,eAAe;AACrB;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yBAAyB,OAAO;AAChC;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,kBAAkB;AAClB;AACA,MAAM,mBAAmB;AACzB;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB;AAClB,kBAAkB;AAClB,kBAAkB,eAAe;AACjC;;AAEA,2CAA2C,IAAI,aAAa,EAAE,aAAa,EAAE;AAC7E;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA,kBAAkB;AAClB,0BAA0B,uBAAuB;AACjD;AACA;;AAEA;AACA,kBAAkB,eAAe;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,eAAe;AACjC,kBAAkB;;AAElB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB;AAClB;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,eAAe;AACjC;AACA;;AAEA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B,uBAAuB;AACjD,kBAAkB;AAClB;AACA;;AAEA;AACA,kBAAkB;AAClB,kBAAkB,eAAe;AACjC;AACA;AACA;AACA;;AAEA;AACA,kBAAkB;AAClB,kBAAkB,eAAe;AACjC;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,wCAAwC;AACxC;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,UAAU;AACV,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,UAAU;AACV;AACA;AACA,OAAO;AACP;AACA,gCAAgC;AAChC;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,0BAA0B;AAC1B;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,UAAU;AACV;AACA;AACA,OAAO;AACP;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH,CAAC;;;;;;;;AC71BD;AACA;;AAEA;AACA,MAAM,IAAuD;AAC7D,QAAQ,mBAAO,CAAC,GAAsB,GAAG,mBAAO,CAAC,GAAY,GAAG,mBAAO,CAAC,GAA0B,GAAG,mBAAO,CAAC,GAAY;AACzH,OAAO,EAGa;AACpB,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sCAAsC,QAAQ;AAC9C;AACA;AACA;;AAEA;AACA,oBAAoB,oBAAoB;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,4DAA4D,QAAQ;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB;AAChB,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,OAAO;;AAEP;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA,gBAAgB;AAChB;AACA;AACA,GAAG;;AAEH;AACA,CAAC;;;;;;;;ACxJD;AACA;;AAEA;AACA,MAAM,IAAuD;AAC7D,QAAQ,mBAAO,CAAC,GAAsB;AACtC,OAAO,EAGa;AACpB,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,uBAAuB,QAAQ;AAC/B;AACA,2CAA2C;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM,iBAAiB,MAAM;AAC7B;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gBAAgB;AAChB,6CAA6C,GAAG,IAAI;AACpD;AACA;;AAEA;AACA,8BAA8B,UAAU;AACxC;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B,4BAA4B,oCAAoC;AAChE,QAAQ;AACR;AACA,QAAQ;AACR;AACA,QAAQ;AACR,gBAAgB;AAChB;AACA;AACA,qEAAqE,OAAO;AAC5E;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,qBAAqB;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC,GAAG;AACrC;AACA,iCAAiC,IAAI;AACrC,4BAA4B,GAAG;AAC/B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,oBAAoB,8BAA8B;;AAExE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,YAAY;AACZ;AACA,uCAAuC,QAAQ;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,GAAG;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,wCAAwC,kBAAkB,kBAAkB;AAC5E,6BAA6B,kBAAkB;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,2CAA2C;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA;AACA;AACA;;AAEA;AACA,8EAA8E;AAC9E;AACA;AACA,+HAA+H;AAC/H,iDAAiD;AACjD,kBAAkB,yBAAyB;AAC3C,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,+FAA+F;AAC/F,4DAA4D,cAAc;AAC1E,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,2EAA2E,cAAc;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6DAA6D,uBAAuB;AACpF;AACA;AACA;AACA;AACA,kBAAkB,kCAAkC;AACpD;AACA;AACA;AACA;AACA;AACA,sBAAsB,EAAE;AACxB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,kBAAkB;AAClB;AACA;AACA;AACA,iCAAiC,uBAAuB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,uBAAuB;AACpD;AACA;AACA,6BAA6B,uBAAuB;AACpD;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA,6BAA6B,wBAAwB;AACrD;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,yBAAyB;AAC3C;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA,MAAM,wBAAwB,EAAE;AAChC;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,uBAAuB;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,uBAAuB;AACjD;AACA;AACA;AACA,qCAAqC,uBAAuB;AAC5D,8BAA8B,iBAAiB;AAC/C;AACA;AACA,kBAAkB,sCAAsC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,0CAA0C,uBAAuB;AACjE;AACA;AACA;AACA,uBAAuB,uBAAuB;AAC9C,6BAA6B,iBAAiB;AAC9C;AACA;AACA;AACA;AACA,uBAAuB,uBAAuB;AAC9C,6BAA6B,iBAAiB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,uBAAuB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iBAAiB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,yBAAyB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB,gCAAgC;AAC/E,8BAA8B,uBAAuB,iCAAiC;AACtF,kBAAkB,uCAAuC,wBAAwB;AACjF;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qCAAqC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,cAAc,2BAA2B;AAC5F;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0EAA0E,IAAI;AAC9E,uCAAuC;AACvC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,2EAA2E,QAAQ;AACnF;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL,gDAAgD,GAAG;AACnD;AACA;AACA;AACA;AACA;AACA,0BAA0B;;AAE1B;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA,4CAA4C,gCAAgC;AAC5E,8CAA8C,gCAAgC;AAC9E,qDAAqD,gCAAgC;AACrF,+CAA+C,kCAAkC;AACjF,2CAA2C,sCAAsC;AACjF,kDAAkD,sCAAsC;;AAExF,CAAC;;;;;;;;AC/7BD;AACA;;AAEA;AACA,MAAM,IAAuD;AAC7D,QAAQ,mBAAO,CAAC,GAAsB;AACtC,OAAO,EAGa;AACpB,CAAC;AACD;;AAEA;AACA,oBAAoB;AACpB;AACA;AACA,iEAAiE;AACjE,qBAAqB;AACrB;AACA,4CAA4C;AAC5C;AACA,WAAW,uBAAuB;AAClC,WAAW,uBAAuB;AAClC,WAAW,WAAW;AACtB,eAAe,iCAAiC;AAChD,iBAAiB,iBAAiB;AAClC,UAAU;AACV;AACA;AACA;AACA,6EAA6E;AAC7E,WAAW,uBAAuB;AAClC,WAAW,uBAAuB;AAClC,cAAc,6BAA6B;AAC3C,WAAW,uBAAuB;AAClC,cAAc,cAAc;AAC5B,WAAW,uBAAuB;AAClC,cAAc,6BAA6B;AAC3C,WAAW;AACX,GAAG;AACH,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;;AAEA;AACA,qBAAqB;AACrB,sBAAsB;AACtB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA,UAAU;AACV;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,6DAA6D;AAC7D,UAAU;AACV,uDAAuD;AACvD;AACA,QAAQ;AACR,0DAA0D;AAC1D;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,qBAAqB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,YAAY;AACZ;AACA;AACA;AACA,QAAQ,qBAAqB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA,8BAA8B,sDAAsD;AACpF,KAAK;;AAEL;AACA;AACA,mCAAmC,IAAI;AACvC;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,sCAAsC,4BAA4B;;AAElE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;ACha0F;AAI3F;IAKU,+BAAc;IAGtB,qBAAY,MAAe,EAAE,UAAc,EAAE,OAA4C;QAAzF,YACE,kBAAM,UAAU,EAAE,OAAO,CAAC,SAE3B;QADC,KAAI,CAAC,OAAO,GAAG,MAAM,CAAC;;IACxB,CAAC;IAED,sBAAW,+BAAM;aAAjB;YACE,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;;;OAAA;IAED,sBAAW,+BAAM;aAAjB;YACE,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;QAC7B,CAAC;;;OAAA;IAED,sBAAW,2BAAE;aAA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;AACnC;AACA,2BAA2B,GAAG;AAC9B;AACA,MAAM,UAAU,EAAE,mBAAmB;AACrC;AACA;;;ACfwC;AACL;AACE;AACM;AACd;;AAE7B;AACA;AACe;AACf;AACA;AACA;AACA,eAAe,UAAS;AACxB;AACA,IAAI,OAAO,SAAS,QAAQ,SAAS,mBAAW;AAChD;AACA,SAAS,UAAS,CAAC,IAAI;AACvB;;;ACjB6B;;AAE7B;AACe;AACf,cAAc,IAAI;AAClB;AACA;AACA,kBAAkB,YAAY;AAC9B;AACA;AACA;AACA;AACA;;;ACZsC;;AAEtC;AACA;AACA;AACe;AACf;AACA;AACA;AACA;;AAEA,YAAY,OAAO;;AAEnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;ACxBgD;;AAEhD;AACA;AACe;AACf;AACA;AACA;AACA,IAAI,cAAa;AACjB;AACA;;;ACVgC;AACoB;AACJ;AACH;AACJ;AACa;AACb;AACZ;AACD;AACkB;;AAE9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB,CAAC;AACpB,mBAAmB,CAAC;AACpB;AACA,kBAAkB,eAAQ;AAC1B,oBAAoB,eAAQ;AAC5B;AACA,MAAM,eAAe,sCAAsC,kBAAU;AACrE,SAAS,kBAAU;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,WAAW,qBAAqB,WAAW;AACxD;AACA;AACA;AACA,oBAAoB,YAAY,KAAK,YAAY;AACjD;;AAEA;AACA,oBAAoB,oBAAY;AAChC,uBAAuB,cAAa;AACpC,yBAAyB,cAAa;AACtC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B,kBAAU;AACvC,6BAA6B,kBAAU;AACvC;AACA;AACA;AACA;AACA;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;AACA;;;ACVyC;;AAEzC;AACe;AACf;AACA;AACA,QAAQ,kBAAU;AAClB;AACA;AACA;;;ACTA;AACe;AACf;AACA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;;;ACjBkD;AACf;;AAEnC;AACA,6CAAe,cAAc,CAAC,OAAO,CAAC,EAAC;;;ACJW;AACrB;;AAE7B;AACA;AACA;AACA,gDAAe,cAAc,CAAC,IAAI,CAAC,EAAC;;;ACNc;AACf;;AAEnC;AACA,+CAAe,cAAc,CAAC,OAAO,OAAO,EAAC;;;ACJR;AACM;;AAE3C;AACA;AACA;AACA;;AAEA;AACe;AACf,OAAO,QAAQ;AACf,MAAM,YAAY,SAAS,YAAY;AACvC;AACA;AACA;AACA;AACA;AACA;;;ACjB0C;AACH;;AAEvC;AACA;AACA;AACe;AACf,eAAe,UAAU;AACzB,aAAa,SAAS;AACtB;AACA;;;ACVqC;AACF;AACF;;AAEjC;AACe;AACf,OAAO,QAAQ;AACf,SAAS,OAAO,sBAAsB,MAAM,GAAG;AAC/C;;;ACRA;AACA;AACA;AACe;AACf;AACA;AACA;;;ACNgC;AACG;;AAEnC;AACA;AACe;AACf,SAAS,OAAO;AAChB;AACA,CAAC;;;ACR+B;AACX;;AAErB;AACA;AACe,SAAS,cAAM;AAC9B,SAAS,CAAC;AACV;;;ACPA;AACe;AACf;AACA,kBAAkB,YAAY;AAC9B;AACA;AACA;AACA;AACA;;;ACRkC;AACE;AACO;;AAE3C;AACA;AACA;AACA;AACe;AACf,cAAc,OAAO,SAAS,cAAM;AACpC,SAAS,WAAW;AACpB;;;ACX6B;AACK;;AAElC;AACA;AACA;AACe,SAAS,OAAG;AAC3B,SAAS,cAAM;AACf;AACA,kBAAkB,YAAY;AAC9B;AACA,SAAS,GAAI;AACb;AACA;AACA;AACA;;;ACfA;AACe;AACf;AACA;;;ACHuC;AACJ;;AAEnC;AACA;AACe;AACf,UAAU,SAAS,GAAG;AACtB;AACA,WAAW,OAAO;AAClB;AACA;;;ACVoC;AACF;;AAElC;AACA;AACe;AACf,SAAS,cAAM;AACf;AACA,WAAW,OAAO;AAClB;AACA;;;ACVA;AACA;AACA;AACe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACpBqC;AACI;AACJ;AACF;AACA;AACE;AACK;;AAE1C;AACA;AACA;AACe;AACf,4BAA4B,QAAQ;AACpC,MAAM,kBAAU,gBAAgB,UAAU;AAC1C,MAAM,QAAQ,YAAY,OAAO,gBAAgB,OAAO;AACxD,SAAS,QAAQ;AACjB;;;AChBgC;AACc;;AAE9C;AACA;AACA;AACe;AACf,SAAS,YAAY;AACrB;AACA,CAAC;;;ACT+B;AACc;AACT;;AAErC;AACA;AACe;AACf,MAAM,CAAC,cAAc,QAAQ,SAAS,CAAC;AACvC,SAAS,YAAY;AACrB;;;ACT0B;AACG;;AAE7B;AACA;AACe;AACf,aAAa,EAAE;AACf,cAAc,IAAI;AAClB;AACA;AACA,sBAAsB,gBAAgB;AACtC;AACA;AACA;AACA;AACA;;;ACfA;AACe;;;ACDc;AACF;;AAE3B;AACe;AACf,0BAA0B,IAAI;AAC9B;AACA,WAAW,GAAG;AACd;AACA;;;ACT0C;;AAE1C;AACe;AACf;AACA,aAAa,UAAU;AACvB,kBAAkB,OAAO;AACzB;AACA;;;ACRA;AACe;AACf;AACA;AACA;AACA;AACA;AACA;;;ACPA;AACA,0CAAe;AACf;AACA,CAAC,EAAC;;;ACH2B;;AAE7B;AACA;AACe;AACf;AACA;AACA;AACA;AACA,uBAAuB,IAAI;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;;AChBA;AACA,iDAAe;AACf,aAAa;AACb,YAAY;AACZ,YAAY;AACZ,cAAc;AACd,cAAc;AACd,cAAc;AACd,CAAC,EAAC;;;ACR8C;AACR;;AAExC;AACA,qDAAe,aAAa,CAAC,UAAS,CAAC,EAAC;;;ACJP;AACO;;AAExC;AACA,mDAAe,MAAM,CAAC,UAAS,CAAC,EAAC;;;ACJe;AACJ;;AAE5C;AACA,uDAAe,aAAa,CAAC,YAAW,CAAC,EAAC;;;ACJV;;AAEhC;AACA;AACA,uDAAe,CAAC;AAChB;AACA;AACA;AACA,CAAC,EAAC;;;ACRmC;AACL;AACD;;AAE/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACe;AACf;AACA,aAAa,QAAQ,GAAG,YAAY,CAAC;;AAErC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN,mBAAmB;AACnB;;AAEA;AACA;AACA,GAAG;AACH,eAAe;;AAEf;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,0BAA0B,EAAE,iBAAiB;AAC7C;AACA;;AAEA;AACA,sBAAsB,8BAA8B;AACpD,yBAAyB;;AAEzB;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA,mCAAmC,CAAC;AACpC;;AAEA;AACA,gDAAgD,iBAAiB;;AAEjE;AACA;;;ACpGyC;AACP;;AAElC;AACA;AACA;AACe;AACf,SAAS,cAAM;AACf;AACA;AACA,WAAW,kBAAU;AACrB;AACA,kBAAkB,YAAY;AAC9B;AACA;AACA;AACA,kBAAkB;AAClB;AACA,UAAU,kBAAU;AACpB;AACA;AACA;;;ACrBA;AACA;AACA;AACe;AACf;AACA;AACA;;;ACNgC;;AAEhC;AACe;AACf,iBAAiB,CAAC;AAClB;AACA;AACA;;;ACP0C;AACL;;AAErC;AACA;AACA;AACe;AACf;AACA,aAAa,UAAU;AACvB;AACA,MAAM,QAAQ;AACd;AACA;;;ACZ+C;AACD;AACd;;AAEhC;AACA;AACA;AACA;AACA,cAAc,aAAa;AAC3B;AACA;AACA;AACA;AACA,oBAAoB,YAAY;AAChC;AACA;AACA;AACA,WAAW,YAAY;AACvB;AACA;AACA,CAAC;;AAED,sBAAsB,CAAC;AACvB,sDAAe,OAAO,EAAC;;;ACvBwB;AACN;AACK;;AAE9C;AACA;AACA,2CAAe,aAAa;AAC5B,OAAO,kBAAU;AACjB,cAAc,aAAa;AAC3B,WAAW,YAAY;AACvB,GAAG;AACH;AACA,CAAC,CAAC,EAAC;;;ACZiE;AAC5B;;AAExC;AACA;AACA;AACA;AACA,mDAAe,uBAAuB,CAAC,UAAS,CAAC,EAAC;;;ACPV;AACI;AACT;AACQ;;AAE3C;AACe;AACf;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,2BAA2B,UAAS,SAAS,YAAY;AACzD;AACA,QAAQ,YAAW,YAAY,OAAO,WAAW,mBAAW;AAC5D;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;;AC9B+C;AACX;AACP;;AAE7B;AACA;AACA;AACA,8CAAe,aAAa;AAC5B,SAAS,OAAO;AAChB;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA,CAAC,CAAC,EAAC;;;AChByB;;AAE5B;AACe;AACf;AACA;AACA;AACA,SAAS,GAAG;AACZ;AACA;AACA;AACA;AACA;;;ACZ+C;;AAE/C;AACA;AACA,4CAAe,aAAa;AAC5B;AACA;AACA,GAAG;AACH,CAAC,CAAC,EAAC;;;ACRgC;AACJ;AACC;;AAEhC;AACA;AACA,4CAAe,eAAO,CAAC,KAAK,EAAE,CAAC,IAAI,EAAC;;;ACNT;;AAE3B;AACA;AACA;AACA;AACA,KAAK,eAAe;AACL;AACf;AACA;AACA;;AAEA;AACA,+CAA+C,GAAG;AAClD;AACA;AACA;AACA;;AAEA;AACA,eAAe,GAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AC9C+C;AACpB;;AAE3B;AACA;AACA;AACA;AACe;AACf;;AAEA;AACA,iBAAiB,GAAG;AACpB;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,aAAa;AAC/B;AACA;AACA,eAAe,GAAG;AAClB;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;;ACvCmC;;AAEnC;AACA;AACA;AACe;AACf,SAAS,eAAO;AAChB;;;ACPA;AACe;AACf;AACA;AACA;AACA;;;ACLA;AACA;AACe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACXA;AACe;AACf;AACA;AACA;AACA;AACA;AACA;;;ACPA;AACA;AACe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACXmC;AACF;;AAEjC;AACA;AACA,2CAAe,eAAO,CAAC,MAAM,IAAI,EAAC;;;ACLR;AACG;;AAE7B;AACe;AACf,cAAc,EAAE;AAChB,cAAc,IAAI;AAClB,yCAAyC,YAAY;AACrD;AACA;AACA;AACA;;;ACX0B;AACc;;AAExC;AACe;AACf;AACA,gBAAgB,EAAE;AAClB,iBAAiB,UAAS;AAC1B;AACA,WAAW,8BAA8B;AACzC;AACA;AACA;AACA;AACA;;;ACd0E;;AAE1E;AACA,gDAAe,0BAA0B,GAAG,EAAC;;;ACH6B;;AAE1E;AACA,oDAAe,0BAA0B,IAAI,EAAC;;;ACHpB;AACc;;AAExC;AACA;AACe;AACf,aAAa,EAAE;AACf;AACA,sBAAsB,UAAS;AAC/B;AACA;AACA,qDAAqD;AACrD;AACA;AACA;;;ACdwC;AACJ;AACL;;AAE/B;AACe;AACf;AACA,wBAAwB,UAAS;AACjC;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,0BAA0B,K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;AAE7B;AACe;AACf,cAAc,EAAE;AAChB,eAAe,YAAW,SAAS,IAAI;AACvC;AACA,sBAAsB,gBAAgB;AACtC;AACA;AACA;AACA;AACA;;;ACd0B;AACkB;AACf;;AAE7B;AACe;AACf,cAAc,EAAE;AAChB,eAAe,YAAW,SAAS,IAAI;AACvC;AACA,sBAAsB,gBAAgB;AACtC;AACA;AACA;AACA;AACA;;;ACd4C;AACX;AACE;;AAEnC;AACe;AACf,OAAO,YAAW,aAAa,MAAM;AACrC;AACA,SAAS,OAAO;AAChB;;;ACT+C;AACN;AACd;AACS;AACF;;AAElC;AACA,6CAAe,aAAa;AAC5B;AACA,MAAM,kBAAU;AAChB;AACA,IAAI;AACJ,WAAW,cAAM;AACjB;AACA;AACA;AACA,SAAS,GAAG;AACZ;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC,CAAC,EAAC;;;AC3BwB;AACU;;AAErC;AACe;AACf,SAAS,GAAG,MAAM,QAAQ;AAC1B;;;ACNiC;AACE;;AAEnC;AACA;AACe;AACf,SAAS,MAAM,MAAM,OAAO;AAC5B;;;ACP4C;AACX;AACP;AACG;;AAE7B;AACe;AACf;AACA;AACA;AACA,UAAU,YAAW,cAAc,MAAM;AACzC,yCAAyC,YAAY;AACrD;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,eAAe,EAAE;AACjB,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AC5B4C;AACX;AACP;AACG;;AAE7B;AACe;AACf;AACA;AACA;AACA,UAAU,YAAW,cAAc,MAAM;AACzC,yCAAyC,YAAY;AACrD;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ,eAAe,EAAE;AACjB,IAAI,IAAI;AACR;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;AC5BmC;AACC;AACC;AACO;AACjB;AACU;AACJ;;AAEjC;AACA;AACe;AACf;AACA,MAAM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AACH;AACA;AACA,WAAW,WAAW;AACtB;AACA,CAAC;;AAED,+DAAe,CAAC,EAAC;;;AC9BjB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACsC;AACwB;;AAE9D;AACA;AACA;AACA;;AAEA;AACA;AACoD;AACJ;AACU;AACJ;AACA;AACF;AACA;AACJ;AACI;AACF;AACE;AACU;AACN;AACN;AACM;AACE;AACN;AACN;AACc;AACV;AACA;AACA;AACJ;AACQ;AACR;AACQ;;AAEtD;AAC4C;AACM;AACF;AACF;AACE;AAEM;AACN;AAEM;AACF;AACJ;AACF;AACJ;AACA;AACA;AACY;;AAEtD;AACA;AACA;AACA;AACA;AACoD;AACA;AACR;AACI;AACI;AACI;AAEN;AACJ;AACE;AACN;AACM;AACI;AACgB;AAChB;AACJ;AACI;AACN;AACM;;AAEpD;AACA;AACA;AACA;AACkD;AACN;AACM;AACA;AACJ;AACA;AACM;AACA;AACR;AACI;AACE;AACJ;AACE;AACJ;;AAE5C;AACA;AACA;AACA;AACkD;AACI;AACQ;AACJ;AACR;AACQ;AAEZ;AACQ;;AAEtD;AACA;AACA;AACA;AAE+C;AAED;AAGE;AAEU;AAEV;AACA;AAEF;AAEF;AAGQ;AACJ;AACF;AACA;AACJ;AACA;AACQ;AACF;AACA;AACE;AACA;AACA;AACI;AACJ;AACN;;AAE5C;AACA;AACA;AAC4C;AACA;;AAE5C;AACA;AACA;AACA;AAG8C;AACI;AACN;AAGA;AACM;AACA;AACA;AAEJ;AACA;AACc;AACJ;AAEN;AACR;AACM;AACF;AACA;;AAE9C;AACA;AACA;AACA;AAC8C;AACU;;;ACvMxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,IAAI;AAC3C;AACA;AACA;AACA;AACyC;AACN;;AAEnC;AACA,IAAI,cAAC,GAAG,KAAK,CAAC,uBAAU;AACxB;AACA,cAAC,KAAK,cAAC;AACP;AACA,oDAAe,cAAC,EAAC;;;AC1BjB;AAC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e;QACf,UAAU,CAAC,OAAQ,CAAC,OAAO,CAAC,kBAAQ;YAClC,IAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC5C,IAAM,UAAU,GAAG,UAAU,CAAC,WAAY,CAAC,QAAkB,CAAC,IAAI,EAAE,CAAC;YAErE,IAAI,MAAM,EAAE;gBACV,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;aAC5B;iBAAM;gBACL,aAAa,CAAC,MAAM,EAAE,QAAkB,CAAC,CAAC;aAC3C;QACH,CAAC,CAAC,CAAC;QAEH,gEAAgE;QAChE,8DAA8D;QAC9D,iEAAiE;QACjE,EAAE,CAAC,WAAW,EAAE,CAAC;QACjB,UAAU,CAAC,UAAU,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QACtD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAErB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC;AAmDF,4CAAe,QAAQ,EAAC","sources":["webpack://grapesjs/./node_modules/backbone-undo/Backbone.Undo.js","webpack://grapesjs/./node_modules/backbone/backbone.js","webpack://grapesjs/./node_modules/codemirror-formatting/formatting.js","webpack://grapesjs/./node_modules/codemirror/lib/codemirror.js","webpack://grapesjs/./node_modules/codemirror/mode/css/css.js","webpack://grapesjs/./node_modules/codemirror/mode/htmlmixed/htmlmixed.js","webpack://grapesjs/./node_modules/codemirror/mode/javascript/javascript.js","webpack://grapesjs/./node_modules/codemirror/mode/xml/xml.js","webpack://grapesjs/./src/abstract/ModuleModel.ts","webpack://grapesjs/./src/canvas/model/CanvasSpot.ts","webpack://grapesjs/./src/commands/types.ts","webpack://grapesjs/./src/commands/view/CanvasClear.ts","webpack://grapesjs/./src/commands/view/CanvasMove.ts","webpack://grapesjs/./src/commands/view/CommandAbstract.ts","webpack://grapesjs/./src/commands/view/ComponentDelete.ts","webpack://grapesjs/./src/commands/view/ComponentDrag.ts","webpack://grapesjs/./src/commands/view/ComponentEnter.ts","webpack://grapesjs/./src/commands/view/ComponentExit.ts","webpack://grapesjs/./src/commands/view/ComponentNext.ts","webpack://grapesjs/./src/commands/view/ComponentPrev.ts","webpack://grapesjs/./src/commands/view/ComponentStyleClear.ts","webpack://grapesjs/./src/commands/view/CopyComponent.ts","webpack://grapesjs/./src/commands/view/ExportTemplate.ts","webpack://grapesjs/./src/commands/view/Fullscreen.ts","webpack://grapesjs/./src/commands/view/MoveComponent.ts","webpack://grapesjs/./src/commands/view/OpenAssets.ts","webpack://grapesjs/./src/commands/view/OpenBlocks.ts","webpack://grapesjs/./src/commands/view/OpenLayers.ts","webpack://grapesjs/./src/commands/view/OpenStyleManager.ts","webpack://grapesjs/./src/commands/view/OpenTraitManager.ts","webpack://grapesjs/./src/commands/view/PasteComponent.ts","webpack://grapesjs/./src/commands/view/Preview.ts","webpack://grapesjs/./src/commands/view/Resize.ts","webpack://grapesjs/./src/dom_components/model/ToolbarButton.ts","webpack://grapesjs/./src/dom_components/model/Toolbar.ts","webpack://grapesjs/./src/dom_components/view/ToolbarButtonView.ts","webpack://grapesjs/./src/dom_components/view/ToolbarView.ts","webpack://grapesjs/./src/commands/view/SelectComponent.ts","webpack://grapesjs/./src/commands/view/SelectPosition.ts","webpack://grapesjs/./src/commands/view/ShowOffset.ts","webpack://grapesjs/./src/commands/view/SwitchVisibility.ts","webpack://grapesjs/./src/common/index.ts","webpack://grapesjs/./src/dom_components/types.ts","webpack://grapesjs/./src/domain_abstract/view/DomainViews.ts","webpack://grapesjs/./src/utils/Dragger.ts","webpack://grapesjs/./src/utils/cash-dom.ts","webpack://grapesjs/./src/utils/dom.ts","webpack://grapesjs/./src/utils/mixins.ts","webpack://grapesjs/./src/commands/view/ sync ^\\.\\/.*$","webpack://grapesjs/./node_modules/underscore/modules/_setup.js","webpack://grapesjs/./node_modules/underscore/modules/restArguments.js","webpack://grapesjs/./node_modules/underscore/modules/isObject.js","webpack://grapesjs/./node_modules/underscore/modules/isNull.js","webpack://grapesjs/./node_modules/underscore/modules/isUndefined.js","webpack://grapesjs/./node_modules/underscore/modules/isBoolean.js","webpack://grapesjs/./node_modules/underscore/modules/isElement.js","webpack://grapesjs/./node_modules/underscore/modules/_tagTester.js","webpack://grapesjs/./node_modules/underscore/modules/isString.js","webpack://grapesjs/./node_modules/underscore/modules/isNumber.js","webpack://grapesjs/./node_modules/underscore/modules/isDate.js","webpack://grapesjs/./node_modules/underscore/modules/isRegExp.js","webpack://grapesjs/./node_modules/underscore/modules/isError.js","webpack://grapesjs/./node_modules/underscore/modules/isSymbol.js","webpack://grapesjs/./node_modules/underscore/modules/isArrayBuffer.js","webpack://grapesjs/./node_modules/underscore/modules/isFunction.js","webpack://grapesjs/./node_modules/underscore/modules/_hasObjectTag.js","webpack://grapesjs/./node_modules/underscore/modules/_stringTagBug.js","webpack://grapesjs/./node_modules/underscore/modules/isDataView.js","webpack://grapesjs/./node_modules/underscore/modules/isArray.js","webpack://grapesjs/./node_modules/underscore/modules/_has.js","webpack://grapesjs/./node_modules/underscore/modules/isArguments.js","webpack://grapesjs/./node_modules/underscore/modules/isFinite.js","webpack://grapesjs/./node_modules/underscore/modules/isNaN.js","webpack://grapesjs/./node_modules/underscore/modules/constant.js","webpack://grapesjs/./node_modules/underscore/modules/_createSizePropertyCheck.js","webpack://grapesjs/./node_modules/underscore/modules/_shallowProperty.js","webpack://grapesjs/./node_modules/underscore/modules/_getByteLength.js","webpack://grapesjs/./node_modules/underscore/modules/_isBufferLike.js","webpack://grapesjs/./node_modules/underscore/modules/isTypedArray.js","webpack://grapesjs/./node_modules/underscore/modules/_getLength.js","webpack://grapesjs/./node_modules/underscore/modules/_collectNonEnumProps.js","webpack://grapesjs/./node_modules/underscore/modules/keys.js","webpack://grapesjs/./node_modules/underscore/modules/isEmpty.js","webpack://grapesjs/./node_modules/underscore/modules/isMatch.js","webpack://grapesjs/./node_modules/underscore/modules/underscore.js","webpack://grapesjs/./node_modules/underscore/modules/_toBufferView.js","webpack://grapesjs/./node_modules/underscore/modules/isEqual.js","webpack://grapesjs/./node_modules/underscore/modules/allKeys.js","webpack://grapesjs/./node_modules/underscore/modules/_methodFingerprint.js","webpack://grapesjs/./node_modules/underscore/modules/isMap.js","webpack://grapesjs/./node_modules/underscore/modules/isWeakMap.js","webpack://grapesjs/./node_modules/underscore/modules/isSet.js","webpack://grapesjs/./node_modules/underscore/modules/isWeakSet.js","webpack://grapesjs/./node_modules/underscore/modules/values.js","webpack://grapesjs/./node_modules/underscore/modules/pairs.js","webpack://grapesjs/./node_modules/underscore/modules/invert.js","webpack://grapesjs/./node_modules/underscore/modules/functions.js","webpack://grapesjs/./node_modules/underscore/modules/_createAssigner.js","webpack://grapesjs/./node_modules/underscore/modules/extend.js","webpack://grapesjs/./node_modules/underscore/modules/extendOwn.js","webpack://grapesjs/./node_modules/underscore/modules/defaults.js","webpack://grapesjs/./node_modules/underscore/modules/_baseCreate.js","webpack://grapesjs/./node_modules/underscore/modules/create.js","webpack://grapesjs/./node_modules/underscore/modules/clone.js","webpack://grapesjs/./node_modules/underscore/modules/tap.js","webpack://grapesjs/./node_modules/underscore/modules/toPath.js","webpack://grapesjs/./node_modules/underscore/modules/_toPath.js","webpack://grapesjs/./node_modules/underscore/modules/_deepGet.js","webpack://grapesjs/./node_modules/underscore/modules/get.js","webpack://grapesjs/./node_modules/underscore/modules/has.js","webpack://grapesjs/./node_modules/underscore/modules/identity.js","webpack://grapesjs/./node_modules/underscore/modules/matcher.js","webpack://grapesjs/./node_modules/underscore/modules/property.js","webpack://grapesjs/./node_modules/underscore/modules/_optimizeCb.js","webpack://grapesjs/./node_modules/underscore/modules/_baseIteratee.js","webpack://grapesjs/./node_modules/underscore/modules/iteratee.js","webpack://grapesjs/./node_modules/underscore/modules/_cb.js","webpack://grapesjs/./node_modules/underscore/modules/mapObject.js","webpack://grapesjs/./node_modules/underscore/modules/noop.js","webpack://grapesjs/./node_modules/underscore/modules/propertyOf.js","webpack://grapesjs/./node_modules/underscore/modules/times.js","webpack://grapesjs/./node_modules/underscore/modules/random.js","webpack://grapesjs/./node_modules/underscore/modules/now.js","webpack://grapesjs/./node_modules/underscore/modules/_createEscaper.js","webpack://grapesjs/./node_modules/underscore/modules/_escapeMap.js","webpack://grapesjs/./node_modules/underscore/modules/escape.js","webpack://grapesjs/./node_modules/underscore/modules/_unescapeMap.js","webpack://grapesjs/./node_modules/underscore/modules/unescape.js","webpack://grapesjs/./node_modules/underscore/modules/templateSettings.js","webpack://grapesjs/./node_modules/underscore/modules/template.js","webpack://grapesjs/./node_modules/underscore/modules/result.js","webpack://grapesjs/./node_modules/underscore/modules/uniqueId.js","webpack://grapesjs/./node_modules/underscore/modules/chain.js","webpack://grapesjs/./node_modules/underscore/modules/_executeBound.js","webpack://grapesjs/./node_modules/underscore/modules/partial.js","webpack://grapesjs/./node_modules/underscore/modules/bind.js","webpack://grapesjs/./node_modules/underscore/modules/_isArrayLike.js","webpack://grapesjs/./node_modules/underscore/modules/_flatten.js","webpack://grapesjs/./node_modules/underscore/modules/bindAll.js","webpack://grapesjs/./node_modules/underscore/modules/memoize.js","webpack://grapesjs/./node_modules/underscore/modules/delay.js","webpack://grapesjs/./node_modules/underscore/modules/defer.js","webpack://grapesjs/./node_modules/underscore/modules/throttle.js","webpack://grapesjs/./node_modules/underscore/modules/debounce.js","webpack://grapesjs/./node_modules/underscore/modules/wrap.js","webpack://grapesjs/./node_modules/underscore/modules/negate.js","webpack://grapesjs/./node_modules/underscore/modules/compose.js","webpack://grapesjs/./node_modules/underscore/modules/after.js","webpack://grapesjs/./node_modules/underscore/modules/before.js","webpack://grapesjs/./node_modules/underscore/modules/once.js","webpack://grapesjs/./node_modules/underscore/modules/findKey.js","webpack://grapesjs/./node_modules/underscore/modules/_createPredicateIndexFinder.js","webpack://grapesjs/./node_modules/underscore/modules/findIndex.js","webpack://grapesjs/./node_modules/underscore/modules/findLastIndex.js","webpack://grapesjs/./node_modules/underscore/modules/sortedIndex.js","webpack://grapesjs/./node_modules/underscore/modules/_createIndexFinder.js","webpack://grapesjs/./node_modules/underscore/modules/indexOf.js","webpack://grapesjs/./node_modules/underscore/modules/lastIndexOf.js","webpack://grapesjs/./node_modules/underscore/modules/find.js","webpack://grapesjs/./node_modules/underscore/modules/findWhere.js","webpack://grapesjs/./node_modules/underscore/modules/each.js","webpack://grapesjs/./node_modules/underscore/modules/map.js","webpack://grapesjs/./node_modules/underscore/modules/_createReduce.js","webpack://grapesjs/./node_modules/underscore/modules/reduce.js","webpack://grapesjs/./node_modules/underscore/modules/reduceRight.js","webpack://grapesjs/./node_modules/underscore/modules/filter.js","webpack://grapesjs/./node_modules/underscore/modules/reject.js","webpack://grapesjs/./node_modules/underscore/modules/every.js","webpack://grapesjs/./node_modules/underscore/modules/some.js","webpack://grapesjs/./node_modules/underscore/modules/contains.js","webpack://grapesjs/./node_modules/underscore/modules/invoke.js","webpack://grapesjs/./node_modules/underscore/modules/pluck.js","webpack://grapesjs/./node_modules/underscore/modules/where.js","webpack://grapesjs/./node_modules/underscore/modules/max.js","webpack://grapesjs/./node_modules/underscore/modules/min.js","webpack://grapesjs/./node_modules/underscore/modules/toArray.js","webpack://grapesjs/./node_modules/underscore/modules/sample.js","webpack://grapesjs/./node_modules/underscore/modules/shuffle.js","webpack://grapesjs/./node_modules/underscore/modules/sortBy.js","webpack://grapesjs/./node_modules/underscore/modules/_group.js","webpack://grapesjs/./node_modules/underscore/modules/groupBy.js","webpack://grapesjs/./node_modules/underscore/modules/indexBy.js","webpack://grapesjs/./node_modules/underscore/modules/countBy.js","webpack://grapesjs/./node_modules/underscore/modules/partition.js","webpack://grapesjs/./node_modules/underscore/modules/size.js","webpack://grapesjs/./node_modules/underscore/modules/_keyInObj.js","webpack://grapesjs/./node_modules/underscore/modules/pick.js","webpack://grapesjs/./node_modules/underscore/modules/omit.js","webpack://grapesjs/./node_modules/underscore/modules/initial.js","webpack://grapesjs/./node_modules/underscore/modules/first.js","webpack://grapesjs/./node_modules/underscore/modules/rest.js","webpack://grapesjs/./node_modules/underscore/modules/last.js","webpack://grapesjs/./node_modules/underscore/modules/compact.js","webpack://grapesjs/./node_modules/underscore/modules/flatten.js","webpack://grapesjs/./node_modules/underscore/modules/difference.js","webpack://grapesjs/./node_modules/underscore/modules/without.js","webpack://grapesjs/./node_modules/underscore/modules/uniq.js","webpack://grapesjs/./node_modules/underscore/modules/union.js","webpack://grapesjs/./node_modules/underscore/modules/intersection.js","webpack://grapesjs/./node_modules/underscore/modules/unzip.js","webpack://grapesjs/./node_modules/underscore/modules/zip.js","webpack://grapesjs/./node_modules/underscore/modules/object.js","webpack://grapesjs/./node_modules/underscore/modules/range.js","webpack://grapesjs/./node_modules/underscore/modules/chunk.js","webpack://grapesjs/./node_modules/underscore/modules/_chainResult.js","webpack://grapesjs/./node_modules/underscore/modules/mixin.js","webpack://grapesjs/./node_modules/underscore/modules/underscore-array-methods.js","webpack://grapesjs/./node_modules/underscore/modules/index.js","webpack://grapesjs/./node_modules/underscore/modules/index-default.js","webpack://grapesjs/./node_modules/underscore/modules/index-all.js","webpack://grapesjs/webpack/bootstrap","webpack://grapesjs/webpack/runtime/compat get default export","webpack://grapesjs/webpack/runtime/define property getters","webpack://grapesjs/webpack/runtime/global","webpack://grapesjs/webpack/runtime/hasOwnProperty shorthand","webpack://grapesjs/webpack/runtime/make namespace object","webpack://grapesjs/./src/utils/html.ts","webpack://grapesjs/./src/editor/config/config.ts","webpack://grapesjs/./src/utils/extender.ts","webpack://grapesjs/./src/editor/model/Selected.ts","webpack://grapesjs/./src/abstract/Module.ts","webpack://grapesjs/./src/canvas/config/config.ts","webpack://grapesjs/./src/device_manager/config/config.ts","webpack://grapesjs/./src/device_manager/model/Device.ts","webpack://grapesjs/./src/device_manager/model/Devices.ts","webpack://grapesjs/./src/device_manager/view/DevicesView.ts","webpack://grapesjs/./src/device_manager/index.ts","webpack://grapesjs/./src/pages/types.ts","webpack://grapesjs/./src/abstract/ModuleCollection.ts","webpack://grapesjs/./src/canvas/model/Frame.ts","webpack://grapesjs/./src/canvas/model/Frames.ts","webpack://grapesjs/./src/canvas/model/Canvas.ts","webpack://grapesjs/./src/canvas/model/CanvasSpots.ts","webpack://grapesjs/./src/canvas/types.ts","webpack://grapesjs/./src/abstract/ModuleView.ts","webpack://grapesjs/./src/abstract/ModuleDomainViews.ts","webpack://grapesjs/./src/css_composer/view/CssRuleView.ts","webpack://grapesjs/./src/css_composer/view/CssGroupRuleView.ts","webpack://grapesjs/./src/css_composer/view/CssRulesView.ts","webpack://grapesjs/./src/parser/model/BrowserParserHtml.ts","webpack://grapesjs/./src/parser/model/ParserHtml.ts","webpack://grapesjs/./src/domain_abstract/model/StyleableModel.ts","webpack://grapesjs/./src/dom_components/model/SymbolUtils.ts","webpack://grapesjs/./src/dom_components/model/Components.ts","webpack://grapesjs/./src/selector_manager/model/Selector.ts","webpack://grapesjs/./src/selector_manager/model/Selectors.ts","webpack://grapesjs/./src/abstract/ModuleCategory.ts","webpack://grapesjs/./src/abstract/CollectionWithCategories.ts","webpack://grapesjs/./src/abstract/ModuleCategories.ts","webpack://grapesjs/./src/trait_manager/types.ts","webpack://grapesjs/./src/trait_manager/model/Trait.ts","webpack://grapesjs/./src/trait_manager/model/TraitFactory.ts","webpack://grapesjs/./src/trait_manager/model/Traits.ts","webpack://grapesjs/./src/dom_components/model/Component.ts","webpack://grapesjs/./src/dom_components/model/ComponentHead.ts","webpack://grapesjs/./src/utils/Droppable.ts","webpack://grapesjs/./src/canvas/view/FrameView.ts","webpack://grapesjs/./src/canvas/view/FrameWrapView.ts","webpack://grapesjs/./src/canvas/view/FramesView.ts","webpack://grapesjs/./src/canvas/view/CanvasView.ts","webpack://grapesjs/./src/canvas/index.ts","webpack://grapesjs/./src/dom_components/config/config.ts","webpack://grapesjs/./src/dom_components/model/ComponentTextNode.ts","webpack://grapesjs/./src/dom_components/model/ComponentComment.ts","webpack://grapesjs/./src/dom_components/model/ComponentFrame.ts","webpack://grapesjs/./src/dom_components/model/ComponentImage.ts","webpack://grapesjs/./src/dom_components/model/ComponentText.ts","webpack://grapesjs/./src/dom_components/model/ComponentLabel.ts","webpack://grapesjs/./src/dom_components/model/ComponentLink.ts","webpack://grapesjs/./src/dom_components/model/ComponentMap.ts","webpack://grapesjs/./src/dom_components/model/ComponentScript.ts","webpack://grapesjs/./src/dom_components/model/ComponentSvg.ts","webpack://grapesjs/./src/dom_components/model/ComponentSvgIn.ts","webpack://grapesjs/./src/dom_components/model/ComponentTable.ts","webpack://grapesjs/./src/dom_components/model/ComponentTableBody.ts","webpack://grapesjs/./src/dom_components/model/ComponentTableCell.ts","webpack://grapesjs/./src/dom_components/model/ComponentTableFoot.ts","webpack://grapesjs/./src/dom_components/model/ComponentTableHead.ts","webpack://grapesjs/./src/dom_components/model/ComponentTableRow.ts","webpack://grapesjs/./src/dom_components/model/ComponentVideo.ts","webpack://grapesjs/./src/dom_components/model/ComponentWrapper.ts","webpack://grapesjs/./src/dom_components/view/ComponentsView.ts","webpack://grapesjs/./src/dom_components/view/ComponentView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTextNodeView.ts","webpack://grapesjs/./src/dom_components/view/ComponentCommentView.ts","webpack://grapesjs/./src/dom_components/view/ComponentFrameView.ts","webpack://grapesjs/./src/dom_components/view/ComponentImageView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTextView.ts","webpack://grapesjs/./src/dom_components/view/ComponentLinkView.ts","webpack://grapesjs/./src/dom_components/view/ComponentLabelView.ts","webpack://grapesjs/./src/dom_components/view/ComponentMapView.ts","webpack://grapesjs/./src/dom_components/view/ComponentScriptView.ts","webpack://grapesjs/./src/dom_components/view/ComponentSvgView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTableBodyView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTableCellView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTableFootView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTableHeadView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTableRowView.ts","webpack://grapesjs/./src/dom_components/view/ComponentTableView.ts","webpack://grapesjs/./src/dom_components/view/ComponentVideoView.ts","webpack://grapesjs/./src/dom_components/view/ComponentWrapperView.ts","webpack://grapesjs/./src/dom_components/model/Symbols.ts","webpack://grapesjs/./src/dom_components/index.ts","webpack://grapesjs/./src/css_composer/config/config.ts","webpack://grapesjs/./src/code_manager/model/CssGenerator.ts","webpack://grapesjs/./src/css_composer/model/CssRule.ts","webpack://grapesjs/./src/css_composer/model/CssRules.ts","webpack://grapesjs/./src/css_composer/index.ts","webpack://grapesjs/./src/block_manager/config/config.ts","webpack://grapesjs/./src/block_manager/model/Block.ts","webpack://grapesjs/./src/block_manager/model/Blocks.ts","webpack://grapesjs/./src/block_manager/types.ts","webpack://grapesjs/./src/block_manager/view/BlockView.ts","webpack://grapesjs/./src/abstract/ModuleCategoryView.ts","webpack://grapesjs/./src/block_manager/view/BlocksView.ts","webpack://grapesjs/./src/block_manager/index.ts","webpack://grapesjs/./src/selector_manager/config/config.ts","webpack://grapesjs/./src/selector_manager/model/State.ts","webpack://grapesjs/./src/selector_manager/view/ClassTagView.ts","webpack://grapesjs/./src/selector_manager/view/ClassTagsView.ts","webpack://grapesjs/./src/selector_manager/index.ts","webpack://grapesjs/./src/parser/config/config.ts","webpack://grapesjs/./src/parser/model/BrowserParserCss.ts","webpack://grapesjs/./src/parser/model/ParserCss.ts","webpack://grapesjs/./src/parser/index.ts","webpack://grapesjs/./src/storage_manager/config/config.ts","webpack://grapesjs/./src/storage_manager/model/LocalStorage.ts","webpack://grapesjs/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://grapesjs/./node_modules/promise-polyfill/src/finally.js","webpack://grapesjs/./node_modules/promise-polyfill/src/allSettled.js","webpack://grapesjs/./node_modules/promise-polyfill/src/any.js","webpack://grapesjs/./node_modules/promise-polyfill/src/index.js","webpack://grapesjs/./src/utils/fetch.ts","webpack://grapesjs/./src/storage_manager/model/RemoteStorage.ts","webpack://grapesjs/./src/storage_manager/types.ts","webpack://grapesjs/./src/storage_manager/index.ts","webpack://grapesjs/./src/trait_manager/config/config.ts","webpack://grapesjs/./src/trait_manager/view/TraitView.ts","webpack://grapesjs/./src/trait_manager/view/TraitButtonView.ts","webpack://grapesjs/./src/trait_manager/view/TraitCheckboxView.ts","webpack://grapesjs/./src/utils/ColorPicker.ts","webpack://grapesjs/./src/domain_abstract/ui/Input.ts","webpack://grapesjs/./src/domain_abstract/ui/InputColor.ts","webpack://grapesjs/./src/trait_manager/view/TraitColorView.ts","webpack://grapesjs/./src/domain_abstract/ui/InputNumber.ts","webpack://grapesjs/./src/trait_manager/view/TraitNumberView.ts","webpack://grapesjs/./src/trait_manager/view/TraitSelectView.ts","webpack://grapesjs/./src/trait_manager/view/TraitsView.ts","webpack://grapesjs/./src/trait_manager/index.ts","webpack://grapesjs/./src/navigator/config/config.ts","webpack://grapesjs/./src/navigator/view/ItemsView.ts","webpack://grapesjs/./src/commands/config/config.ts","webpack://grapesjs/./src/commands/index.ts","webpack://grapesjs/./src/navigator/view/ItemView.ts","webpack://grapesjs/./src/navigator/index.ts","webpack://grapesjs/./src/asset_manager/config/config.ts","webpack://grapesjs/./src/asset_manager/model/Asset.ts","webpack://grapesjs/./src/asset_manager/model/AssetImage.ts","webpack://grapesjs/./src/asset_manager/view/AssetView.ts","webpack://grapesjs/./src/asset_manager/view/AssetImageView.ts","webpack://grapesjs/./src/domain_abstract/model/TypeableCollection.ts","webpack://grapesjs/./src/asset_manager/model/Assets.ts","webpack://grapesjs/./src/asset_manager/types.ts","webpack://grapesjs/./src/asset_manager/view/AssetsView.ts","webpack://grapesjs/./src/asset_manager/view/FileUploader.ts","webpack://grapesjs/./src/asset_manager/index.ts","webpack://grapesjs/./src/pages/model/Page.ts","webpack://grapesjs/./src/pages/model/Pages.ts","webpack://grapesjs/./src/pages/index.ts","webpack://grapesjs/./src/i18n/locale/en.js","webpack://grapesjs/./src/i18n/config.ts","webpack://grapesjs/./src/i18n/types.ts","webpack://grapesjs/./src/i18n/index.ts","webpack://grapesjs/./src/utils/Sorter.ts","webpack://grapesjs/./src/utils/Resizer.ts","webpack://grapesjs/./src/utils/index.ts","webpack://grapesjs/./src/utils/keymaster.ts","webpack://grapesjs/./src/keymaps/config.ts","webpack://grapesjs/./src/keymaps/index.ts","webpack://grapesjs/./src/modal_dialog/config/config.ts","webpack://grapesjs/./src/modal_dialog/model/Modal.ts","webpack://grapesjs/./src/modal_dialog/view/ModalView.ts","webpack://grapesjs/./src/modal_dialog/index.ts","webpack://grapesjs/./src/panels/config/config.ts","webpack://grapesjs/./src/panels/model/Button.ts","webpack://grapesjs/./src/panels/model/Buttons.ts","webpack://grapesjs/./src/panels/model/Panel.ts","webpack://grapesjs/./src/panels/model/Panels.ts","webpack://grapesjs/./src/panels/view/ButtonView.ts","webpack://grapesjs/./src/panels/view/ButtonsView.ts","webpack://grapesjs/./src/panels/view/PanelView.ts","webpack://grapesjs/./src/panels/view/PanelsView.ts","webpack://grapesjs/./src/panels/index.ts","webpack://grapesjs/./src/code_manager/config/config.ts","webpack://grapesjs/./src/code_manager/model/HtmlGenerator.ts","webpack://grapesjs/./src/code_manager/model/JsonGenerator.ts","webpack://grapesjs/./src/code_manager/model/JsGenerator.ts","webpack://grapesjs/./src/code_manager/model/CodeMirrorEditor.ts","webpack://grapesjs/./src/code_manager/view/EditorView.ts","webpack://grapesjs/./src/code_manager/index.ts","webpack://grapesjs/./src/undo_manager/config.ts","webpack://grapesjs/./src/undo_manager/index.ts","webpack://grapesjs/./src/rich_text_editor/config/config.ts","webpack://grapesjs/./src/rich_text_editor/model/RichTextEditor.ts","webpack://grapesjs/./src/rich_text_editor/index.ts","webpack://grapesjs/./src/style_manager/config/config.ts","webpack://grapesjs/./src/style_manager/model/Property.ts","webpack://grapesjs/./src/style_manager/model/Layer.ts","webpack://grapesjs/./src/style_manager/model/Layers.ts","webpack://grapesjs/./src/style_manager/model/PropertyComposite.ts","webpack://grapesjs/./src/style_manager/model/PropertyStack.ts","webpack://grapesjs/./src/style_manager/view/PropertyView.ts","webpack://grapesjs/./src/style_manager/view/PropertiesView.ts","webpack://grapesjs/./src/style_manager/view/PropertyCompositeView.ts","webpack://grapesjs/./src/style_manager/view/LayerView.ts","webpack://grapesjs/./src/style_manager/view/LayersView.ts","webpack://grapesjs/./src/style_manager/view/PropertyStackView.ts","webpack://grapesjs/./src/style_manager/view/PropertyFileView.ts","webpack://grapesjs/./src/style_manager/view/PropertyNumberView.ts","webpack://grapesjs/./src/style_manager/view/PropertyColorView.ts","webpack://grapesjs/./src/style_manager/model/PropertySelect.ts","webpack://grapesjs/./src/style_manager/view/PropertySelectView.ts","webpack://grapesjs/./src/style_manager/model/PropertyRadio.ts","webpack://grapesjs/./src/style_manager/view/PropertyRadioView.ts","webpack://grapesjs/./src/style_manager/model/PropertyNumber.ts","webpack://grapesjs/./src/style_manager/model/PropertySlider.ts","webpack://grapesjs/./src/style_manager/view/PropertySliderView.ts","webpack://grapesjs/./src/style_manager/model/Properties.ts","webpack://grapesjs/./src/style_manager/model/Sector.ts","webpack://grapesjs/./src/style_manager/model/Sectors.ts","webpack://grapesjs/./src/style_manager/model/PropertyFactory.ts","webpack://grapesjs/./src/style_manager/view/SectorView.ts","webpack://grapesjs/./src/style_manager/view/SectorsView.ts","webpack://grapesjs/./src/style_manager/index.ts","webpack://grapesjs/./src/editor/model/Editor.ts","webpack://grapesjs/./src/editor/view/EditorView.ts","webpack://grapesjs/./src/editor/index.ts","webpack://grapesjs/./src/plugin_manager/index.ts","webpack://grapesjs/./src/utils/polyfills.ts","webpack://grapesjs/./src/index.ts"],"sourcesContent":["/*!\n * Backbone.Undo.js v0.2\n *\n * Copyright (c)2013 Oliver Sartun\n * Released under the MIT License\n *\n * Documentation and full license available at\n * https://github.com/osartun/Backbone.Undo.js\n */\n\n\n(function (factory) {\n\tif (typeof define === \"function\" && define.amd) {\n\t\t// AMD support\n\t\tdefine([\"underscore\", \"backbone\"], factory);\n\t} else if (typeof exports !== 'undefined') {\n\t\t// CommonJS support\n\t\tmodule.exports = factory(\n\t\t\trequire(\"underscore\"),\n\t\t\trequire(\"backbone\")\n\t\t);\n\t} else {\n\t\t// Non-modular execution\n\t\tfactory(_, Backbone);\n }\n})(function (_, Backbone) {\n\n\tvar core_slice = Array.prototype.slice;\n\n\t/**\n\t * As call is faster than apply, this is a faster version of apply as it uses call.\n\t *\n\t * @param {Function} fn \tThe function to execute\n\t * @param {Object} ctx \tThe context the function should be called in\n\t * @param {Array} args \tThe array of arguments that should be applied to the function\n\t * @return Forwards whatever the called function returns\n\t */\n\tfunction apply (fn, ctx, args) {\n\t\treturn args.length <= 4 ?\n\t\t\tfn.call(ctx, args[0], args[1], args[2], args[3]) :\n\t\t\tfn.apply(ctx, args);\n\t}\n\n\t/**\n\t * Uses slice on an array or an array-like object.\n\t *\n\t * @param {Array|Object} \tarr \tThe array or array-like object.\n\t * @param {Number} \t\t[index]\tThe index from where the array should be sliced. Default is 0.\n\t * @return {Array} The sliced array\n\t */\n\tfunction slice (arr, index) {\n\t\treturn core_slice.call(arr, index);\n\t}\n\n\t/**\n\t * Checks if an object has one or more specific keys. The keys\n\t * don't have to be an owned property.\n\t * You can call this function either this way:\n\t * hasKeys(obj, [\"a\", \"b\", \"c\"])\n\t * or this way:\n\t * hasKeys(obj, \"a\", \"b\", \"c\")\n\t *\n\t * @param {Object} \tobj \tThe object to check on\n\t * @param {Array} \tkeys \tThe keys to check for\n\t * @return {Boolean} True, if the object has all those keys\n\t */\n\tfunction hasKeys (obj, keys) {\n\t\tif (obj == null) return false;\n\t\tif (!_.isArray(keys)) {\n\t\t\tkeys = slice(arguments, 1);\n\t\t}\n\t\treturn _.all(keys, function (key) {\n\t\t\treturn key in obj;\n\t\t});\n\t}\n\n\t/**\n\t * Returns a number that is unique per call stack. The number gets\n\t * changed after the call stack has been completely processed.\n\t *\n\t * @return {number} MagicFusionIndex\n\t */\n\tvar getMagicFusionIndex = (function () {\n\t\t// If you add several models to a collection or set several\n\t\t// attributes on a model all in sequence and yet all for\n\t\t// example in one function, then several Undo-Actions are\n\t\t// generated.\n\t\t// If you want to undo your last action only the last model\n\t\t// would be removed from the collection or the last set\n\t\t// attribute would be changed back to its previous value.\n\t\t// To prevent that we have to figure out a way to combine\n\t\t// all those actions that happened \"at the same time\".\n\t\t// Timestamps aren't exact enough. A complex routine could\n\t\t// run several milliseconds and in that time produce a lot\n\t\t// of actions with different timestamps.\n\t\t// Instead we take advantage of the single-threadedness of\n\t\t// JavaScript:\n\n\t\tvar callstackWasIndexed = false, magicFusionIndex = -1;\n\t\tfunction indexCycle() {\n\t\t\tmagicFusionIndex++;\n\t\t\tcallstackWasIndexed = true;\n\t\t\t_.defer(function () {\n\t\t\t\t// Here comes the magic. With a Timeout of 0\n\t\t\t\t// milliseconds this function gets called whenever\n\t\t\t\t// the current callstack is completed\n\t\t\t\tcallstackWasIndexed = false;\n\t\t\t})\n\t\t}\n\t\treturn function () {\n\t\t\tif (!callstackWasIndexed) {\n\t\t\t\tindexCycle();\n\t\t\t}\n\t\t\treturn magicFusionIndex;\n\t\t}\n\t})();\n\n\t/**\n\t * To prevent binding a listener several times to one\n\t * object, we register the objects in an ObjectRegistry\n\t *\n\t * @constructor\n\t */\n\tfunction ObjectRegistry () {\n\t\t// This uses two different ways of storing\n\t\t// objects: In case the object has a cid\n\t\t// (which Backbone objects typically have)\n\t\t// it uses this cid as an index. That way\n\t\t// the Array's length attribute doesn't\n\t\t// change and the object isn't an item\n\t\t// in the array, but an object-property.\n\t\t// Otherwise it's added to the Array as an\n\t\t// item.\n\t\t// That way we can use the fast property-\n\t\t// lookup and only have to fall back to\n\t\t// iterating over the array in case\n\t\t// non-Backbone-objects are registered.\n\t\tthis.registeredObjects = [];\n\t\t// To return a list of all registered\n\t\t// objects in the 'get' method we have to\n\t\t// store the objects that have a cid in\n\t\t// an additional array.\n\t\tthis.cidIndexes = [];\n\t}\n\tObjectRegistry.prototype = {\n\t\t/**\n\t\t * Returns whether the object is already registered in this ObjectRegistry or not.\n\t\t *\n\t\t * @this \t{ObjectRegistry}\n\t\t * @param \t{Object} \t\t obj \tThe object to check\n\t\t * @return \t{Boolean} True if the object is already registered\n\t\t */\n\t\tisRegistered: function (obj) {\n\t\t\t// This is where we get a performance boost\n\t\t\t// by using the two different ways of storing\n\t\t\t// objects.\n\t\t\treturn obj && obj.cid ? this.registeredObjects[obj.cid] : _.contains(this.registeredObjects, obj);\n\t\t},\n\t\t/**\n\t\t * Registers an object in this ObjectRegistry.\n\t\t *\n\t\t * @this \t{ObjectRegistry}\n\t\t * @param \t{Object} \t\t obj \tThe object to register\n\t\t * @return \t{undefined}\n\t\t */\n\t\tregister: function (obj) {\n\t\t\tif (!this.isRegistered(obj)) {\n\t\t\t\tif (obj && obj.cid) {\n\t\t\t\t\tthis.registeredObjects[obj.cid] = obj;\n\t\t\t\t\tthis.cidIndexes.push(obj.cid);\n\t\t\t\t} else {\n\t\t\t\t\tthis.registeredObjects.push(obj);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\t/**\n\t\t * Unregisters an object from this ObjectRegistry.\n\t\t *\n\t\t * @this {ObjectRegistry}\n\t\t * @param {Object} obj The object to unregister\n\t\t * @return {undefined}\n\t\t */\n\t\tunregister: function (obj) {\n\t\t\tif (this.isRegistered(obj)) {\n\t\t\t\tif (obj && obj.cid) {\n\t\t\t\t\tdelete this.registeredObjects[obj.cid];\n\t\t\t\t\tthis.cidIndexes.splice(_.indexOf(this.cidIndexes, obj.cid), 1);\n\t\t\t\t} else {\n\t\t\t\t\tvar i = _.indexOf(this.registeredObjects, obj);\n\t\t\t\t\tthis.registeredObjects.splice(i, 1);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\t/**\n\t\t * Returns an array of all objects that are currently in this ObjectRegistry.\n\t\t *\n\t\t * @return {Array} An array of all the objects which are currently in the ObjectRegistry\n\t\t */\n\t\tget: function () {\n\t\t\treturn (_.map(this.cidIndexes, function (cid) {return this.registeredObjects[cid];}, this)).concat(this.registeredObjects);\n\t\t}\n\t}\n\n\t/**\n\t * Binds or unbinds the \"all\"-listener for one or more objects.\n\t *\n\t * @param {String} which \tEither \"on\" or \"off\"\n\t * @param {Object[]} objects \tArray of the objects on which the \"all\"-listener should be bound / unbound to\n\t * @param {Function} [fn] \t\tThe function that should be bound / unbound. Optional in case of \"off\"\n\t * @param {Object} [ctx] \tThe context the function should be called in\n\t * @return {undefined}\n\t */\n\tfunction onoff(which, objects, fn, ctx) {\n\t\tfor (var i = 0, l = objects.length, obj; i < l; i++) {\n\t\t\tobj = objects[i];\n\t\t\tif (!obj) continue;\n\t\t\tif (which === \"on\") {\n\t\t\t\tif (!ctx.objectRegistry.register(obj)) {\n\t\t\t\t\t// register returned false, so obj was already registered\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!ctx.objectRegistry.unregister(obj)) {\n\t\t\t\t\t// unregister returned false, so obj wasn't registered\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (_.isFunction(obj[which])) {\n\t\t\t\tobj[which](\"all\", fn, ctx);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Calls the undo/redo-function for a specific action.\n\t *\n\t * @param {String} which \tEither \"undo\" or \"redo\"\n\t * @param {Object} action \tThe Action's attributes\n\t * @return {undefined}\n\t */\n\tfunction actionUndoRedo (which, action) {\n\t\tvar type = action.type, undoTypes = action.undoTypes, fn = !undoTypes[type] || undoTypes[type][which];\n\t\tif (_.isFunction(fn)) {\n\t\t\tfn(action.object, action.before, action.after, action.options);\n\t\t}\n\t}\n\n\t/**\n\t * The main undo/redo function.\n\t *\n\t * @param {String} \t\twhich \t Either \"undo\" or \"redo\"\n\t * @param {UndoManager} \tmanager\t The UndoManager-instance on which an \"undo\"/\"redo\"-Event is triggered afterwards\n\t * @param {UndoStack} \t\tstack \t The UndoStack on which we perform\n\t * @param {Boolean} \t\tmagic \t If true, undoes / redoes all actions with the same magicFusionIndex\n\t * @param {Boolean} \t\teverything If true, undoes / redoes every action that had been tracked\n\t * @return {undefined}\n\t */\n\tfunction managerUndoRedo (which, manager, stack, magic, everything) {\n\t\tif (stack.isCurrentlyUndoRedoing ||\n\t\t\t(which === \"undo\" && stack.pointer === -1) ||\n\t\t\t(which === \"redo\" && stack.pointer === stack.length - 1)) {\n\t\t\t// We're either currently in an undo- / redo-process or\n\t\t\t// we reached the end of the stack\n\t\t\treturn;\n\t\t}\n\t\tstack.isCurrentlyUndoRedoing = true;\n\t\tvar action, actions, isUndo = which === \"undo\";\n\t\tif (everything) {\n\t\t\t// Undo / Redo all steps until you reach the stack's beginning / end\n\t\t\tactions = isUndo && stack.pointer === stack.length - 1 || // If at the stack's end calling undo\n\t\t\t\t\t !isUndo && stack.pointer === -1 ? // or at the stack's beginning calling redo\n\t\t\t\t\t _.clone(stack.models) : // => Take all the models. Otherwise:\n\t\t\t\t\t core_slice.apply(stack.models, isUndo ? [0, stack.pointer] : [stack.pointer, stack.length - 1]);\n\t\t} else {\n\t\t\t// Undo / Redo only one step\n\t\t\taction = stack.at(isUndo ? stack.pointer : stack.pointer + 1);\n\t\t\tactions = magic ? stack.where({\"magicFusionIndex\": action.get(\"magicFusionIndex\")}) : [action];\n\t\t}\n\n\t\tstack.pointer += (isUndo ? -1 : 1) * actions.length;\n\t\twhile (action = isUndo ? actions.pop() : actions.shift()) {\n\t\t\t// Here we're calling the Action's undo / redo method\n\t\t\taction[which]();\n\t\t}\n\t\tstack.isCurrentlyUndoRedoing = false;\n\n\t\tmanager.trigger(which, manager);\n\t}\n\n\t/**\n\t * Checks whether an UndoAction should be created or not. Therefore it checks\n\t * whether a \"condition\" property is set in the undoTypes-object of the specific\n\t * event type. If not, it returns true. If it's set and a boolean, it returns it.\n\t * If it's a function, it returns its result, converting it into a boolean.\n\t * Otherwise it returns true.\n\t *\n\t * @param {Object} \tundoTypesType \tThe object within the UndoTypes that holds the function for this event type (i.e. \"change\")\n\t * @param {Arguments} \targs \t\tThe arguments the \"condition\" function is called with\n\t * @return {Boolean} \tTrue, if an UndoAction should be created\n\t */\n\tfunction validateUndoActionCreation (undoTypesType, args) {\n\t\tvar condition = undoTypesType.condition, type = typeof condition;\n\t\treturn type === \"function\" ? !!apply(condition, undoTypesType, args) :\n\t\t\ttype === \"boolean\" ? condition : true;\n\t}\n\n\t/**\n\t * Adds an Undo-Action to the stack.\n\t *\n\t * @param {UndoStack} \t\tstack \t\tThe undostack the action should be added to.\n\t * @param {String} \t\t\ttype \t\tThe event type (i.e. \"change\")\n\t * @param {Arguments} \t\targs \t\tThe arguments passed to the undoTypes' \"on\"-handler\n\t * @param {OwnedUndoTypes} \tundoTypes \tThe undoTypes-object which has the \"on\"-handler\n\t * @return {undefined}\n\t */\n\tfunction addToStack(stack, type, args, undoTypes) {\n\t\tif (stack.track && !stack.isCurrentlyUndoRedoing && type in undoTypes &&\n\t\t\tvalidateUndoActionCreation(undoTypes[type], args)) {\n\t\t\t// An UndoAction should be created\n\t\t\tvar res = apply(undoTypes[type][\"on\"], undoTypes[type], args), diff;\n\t\t\tif (hasKeys(res, \"object\", \"before\", \"after\")) {\n\t\t\t\tres.type = type;\n\t\t\t\tres.magicFusionIndex = getMagicFusionIndex();\n\t\t\t\tres.undoTypes = undoTypes;\n\t\t\t\tif (stack.pointer < stack.length - 1) {\n\t\t\t\t\t// New Actions must always be added to the end of the stack.\n\t\t\t\t\t// If the pointer is not pointed to the last action in the\n\t\t\t\t\t// stack, presumably because actions were undone before, then\n\t\t\t\t\t// all following actions must be discarded\n\t\t\t\t\tvar diff = stack.length - stack.pointer - 1;\n\t\t\t\t\twhile (diff--) {\n\t\t\t\t\t\tstack.pop();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstack.pointer = stack.length;\n\t\t\t\tstack.add(res);\n\t\t\t\tif (stack.length > stack.maximumStackLength) {\n\t\t\t\t\tstack.shift();\n\t\t\t\t\tstack.pointer--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\t/**\n\t * Predefined UndoTypes object with default handlers for the most common events.\n\t * @type {Object}\n\t */\n\tvar UndoTypes = {\n\t\t\"add\": {\n\t\t\t\"undo\": function (collection, ignore, model, options) {\n\t\t\t\t// Undo add = remove\n\t\t\t\tcollection.remove(model, options);\n\t\t\t},\n\t\t\t\"redo\": function (collection, ignore, model, options) {\n\t\t\t\t// Redo add = add\n\t\t\t\tif (options.index) {\n\t\t\t\t\toptions.at = options.index;\n\t\t\t\t}\n\t\t\t\tcollection.add(model, options);\n\t\t\t},\n\t\t\t\"on\": function (model, collection, options) {\n\t\t\t\treturn {\n\t\t\t\t\tobject: collection,\n\t\t\t\t\tbefore: undefined,\n\t\t\t\t\tafter: model,\n\t\t\t\t\toptions: _.clone(options)\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\t\"remove\": {\n\t\t\t\"undo\": function (collection, model, ignore, options) {\n\t\t\t\tif (\"index\" in options) {\n\t\t\t\t\toptions.at = options.index;\n\t\t\t\t}\n\t\t\t\tcollection.add(model, options);\n\t\t\t},\n\t\t\t\"redo\": function (collection, model, ignore, options) {\n\t\t\t\tcollection.remove(model, options);\n\t\t\t},\n\t\t\t\"on\": function (model, collection, options) {\n\t\t\t\treturn {\n\t\t\t\t\tobject: collection,\n\t\t\t\t\tbefore: model,\n\t\t\t\t\tafter: undefined,\n\t\t\t\t\toptions: _.clone(options)\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\t\"change\": {\n\t\t\t\"undo\": function (model, before, after, options) {\n\t\t\t\tif (_.isEmpty(before)) {\n\t\t\t\t\t_.each(_.keys(after), model.unset, model);\n\t\t\t\t} else {\n\t\t\t\t\tmodel.set(before);\n\t\t\t\t\tif (options && options.unsetData && options.unsetData.before && options.unsetData.before.length) {\n\t\t\t\t\t\t_.each(options.unsetData.before, model.unset, model);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"redo\": function (model, before, after, options) {\n\t\t\t\tif (_.isEmpty(after)) {\n\t\t\t\t\t_.each(_.keys(before), model.unset, model);\n\t\t\t\t} else {\n\t\t\t\t\tmodel.set(after);\n\t\t\t\t\tif (options && options.unsetData && options.unsetData.after && options.unsetData.after.length) {\n\t\t\t\t\t\t_.each(options.unsetData.after, model.unset, model);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"on\": function (model, options) {\n\t\t\t\tvar\n\t\t\t\tafterAttributes = model.changedAttributes(),\n\t\t\t\tkeysAfter = _.keys(afterAttributes),\n\t\t\t\tpreviousAttributes = _.pick(model.previousAttributes(), keysAfter),\n\t\t\t\tkeysPrevious = _.keys(previousAttributes),\n\t\t\t\tunsetData = (options || (options = {})).unsetData = {\n\t\t\t\t\tafter: [],\n\t\t\t\t\tbefore: []\n\t\t\t\t};\n\n\t\t\t\tif (keysAfter.length != keysPrevious.length) {\n\t\t\t\t\t// There are new attributes or old attributes have been unset\n\t\t\t\t\tif (keysAfter.length > keysPrevious.length) {\n\t\t\t\t\t\t// New attributes have been added\n\t\t\t\t\t\t_.each(keysAfter, function (val) {\n\t\t\t\t\t\t\tif (!(val in previousAttributes)) {\n\t\t\t\t\t\t\t\tunsetData.before.push(val);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, this);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Old attributes have been unset\n\t\t\t\t\t\t_.each(keysPrevious, function (val) {\n\t\t\t\t\t\t\tif (!(val in afterAttributes)) {\n\t\t\t\t\t\t\t\tunsetData.after.push(val);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tobject: model,\n\t\t\t\t\tbefore: previousAttributes,\n\t\t\t\t\tafter: afterAttributes,\n\t\t\t\t\toptions: _.clone(options)\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\t\"reset\": {\n\t\t\t\"undo\": function (collection, before, after) {\n\t\t\t\tcollection.reset(before);\n\t\t\t},\n\t\t\t\"redo\": function (collection, before, after) {\n\t\t\t\tcollection.reset(after);\n\t\t\t},\n\t\t\t\"on\": function (collection, options) {\n\t\t\t\treturn {\n\t\t\t\t\tobject: collection,\n\t\t\t\t\tbefore: options.previousModels,\n\t\t\t\t\tafter: _.clone(collection.models)\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t};\n\n\t/**\n\t * Every UndoManager instance has an own undoTypes object\n\t * which is an instance of OwnedUndoTypes. OwnedUndoTypes'\n\t * prototype is the global UndoTypes object. Changes to the\n\t * global UndoTypes object take effect on every instance of\n\t * UndoManager as the object is its prototype. And yet every\n\t * local UndoTypes object can be changed individually.\n\t *\n\t * @constructor\n\t */\n\tfunction OwnedUndoTypes () {}\n\tOwnedUndoTypes.prototype = UndoTypes;\n\n\t/**\n\t * Adds, changes or removes an undo-type from an UndoTypes-object.\n\t * You can call it this way:\n\t * manipulateUndoType (1, \"reset\", {\"on\": function () {}}, undoTypes)\n\t * or this way to perform bulk actions:\n\t * manipulateUndoType (1, {\"reset\": {\"on\": function () {}}}, undoTypes)\n\t * In case of removing undo-types you can pass an Array for performing\n\t * bulk actions:\n\t * manipulateUndoType(2, [\"reset\", \"change\"], undoTypes)\n\t *\n\t * @param {Number} \t\t\t\t manipType \t\tIndicates the kind of action to execute: 0 for add, 1 for change, 2 for remove\n\t * @param {String|Object|Array} \t undoType \t\t\tThe type of undoType that should be added/changed/removed. Can be an object / array to perform bulk actions\n\t * @param {Object} \t\t\t\t [fns] \t\t\tObject with the functions to add / change. Is optional in case you passed an object as undoType that contains these functions\n\t * @param {OwnedUndoTypes|UndoTypes} undoTypesInstance The undoTypes object to act on\n\t * @return {undefined}\n\t */\n\tfunction manipulateUndoType (manipType, undoType, fns, undoTypesInstance) {\n\t\t// manipType, passed by the calling function\n\t\t// 0: add\n\t\t// 1: change\n\t\t// 2: remove\n\t\tif (typeof undoType === \"object\") {\n\t\t\t// bulk action. Iterate over this data.\n\t\t\treturn _.each(undoType, function (val, key) {\n\t\t\t\t\tif (manipType === 2) { // remove\n\t\t\t\t\t\t// undoType is an array\n\t\t\t\t\t\tmanipulateUndoType (manipType, val, fns, undoTypesInstance);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// undoType is an object\n\t\t\t\t\t\tmanipulateUndoType (manipType, key, val, fns);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t}\n\n\t\tswitch (manipType) {\n\t\t\tcase 0: // add\n\t\t\t\tif (hasKeys(fns, \"undo\", \"redo\", \"on\") && _.all(_.pick(fns, \"undo\", \"redo\", \"on\"), _.isFunction)) {\n\t\t\t\t\tundoTypesInstance[undoType] = fns;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 1: // change\n\t\t\t\tif (undoTypesInstance[undoType] && _.isObject(fns)) {\n\t\t\t\t\t// undoTypeInstance[undoType] may be a prototype's property\n\t\t\t\t\t// So, if we did this _.extend(undoTypeInstance[undoType], fns)\n\t\t\t\t\t// we would extend the object on the prototype which means\n\t\t\t\t\t// that this change would have a global effect\n\t\t\t\t\t// Instead we just want to manipulate this instance. That's why\n\t\t\t\t\t// we're doing this:\n\t\t\t\t\tundoTypesInstance[undoType] = _.extend({}, undoTypesInstance[undoType], fns);\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 2: // remove\n\t\t\t\tdelete undoTypesInstance[undoType];\n\t\t\tbreak;\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * Instantiating \"Action\" creates the UndoActions that\n\t * are collected in an UndoStack. It holds all relevant\n\t * data to undo / redo an action and has an undo / redo\n\t * method.\n\t */\n\tvar Action = Backbone.Model.extend({\n\t\tdefaults: {\n\t\t\ttype: null, // \"add\", \"change\", \"reset\", etc.\n\t\t\tobject: null, // The object on which the action occurred\n\t\t\tbefore: null, // The previous values which were changed with this action\n\t\t\tafter: null, // The values after this action\n\t\t\tmagicFusionIndex: null // The magicFusionIndex helps to combine\n\t\t\t// all actions that occurred \"at the same time\" to undo/redo them altogether\n\t\t},\n\t\t/**\n\t\t * Undoes this action.\n\t\t * @param {OwnedUndoTypes|UndoTypes} undoTypes The undoTypes object which contains the \"undo\"-handler that should be used\n\t\t * @return {undefined}\n\t\t */\n\t\tundo: function (undoTypes) {\n\t\t\tactionUndoRedo(\"undo\", this.attributes);\n\t\t},\n\t\t/**\n\t\t * Redoes this action.\n\t\t * @param {OwnedUndoTypes|UndoTypes} undoTypes The undoTypes object which contains the \"redo\"-handler that should be used\n\t\t * @return {undefined}\n\t\t */\n\t\tredo: function (undoTypes) {\n\t\t\tactionUndoRedo(\"redo\", this.attributes);\n\t\t}\n\t}),\n\t/**\n\t * An UndoStack is a collection of UndoActions in\n\t * chronological order.\n\t */\n\tUndoStack = Backbone.Collection.extend({\n\t\tmodel: Action,\n\t\tpointer: -1, // The pointer indicates the index where we are located within the stack. We start at -1\n\t\ttrack: false,\n\t\tisCurrentlyUndoRedoing: false,\n\t\tmaximumStackLength: Infinity,\n\t\tsetMaxLength: function (val) {\n\t\t\tthis.maximumStackLength = val;\n\t\t}\n\t}),\n\t/**\n\t * An instance of UndoManager can keep track of\n\t * changes to objects and helps to undo them.\n\t */\n\tUndoManager = Backbone.Model.extend({\n\t\tdefaults: {\n\t\t\tmaximumStackLength: Infinity,\n\t\t\ttrack: false\n\t\t},\n\t\t/**\n\t\t * The constructor function.\n\t\t * @param {attr} \t\t[attr] Object with parameters. The available parameters are:\n\t\t * \t - maximumStackLength {number} \tSet the undo-stack's maximum size\n\t\t * - track \t\t\t\t{boolean}\tStart tracking changes right away\n\t\t * @return {undefined}\n\t\t */\n\t\tinitialize: function (attr) {\n\t\t\tthis.stack = new UndoStack;\n\t\t\tthis.objectRegistry = new ObjectRegistry();\n\t\t\tthis.undoTypes = new OwnedUndoTypes();\n\n\t\t\t// sync the maximumStackLength attribute with our stack\n\t\t\tthis.stack.setMaxLength(this.get(\"maximumStackLength\"));\n\t\t\tthis.on(\"change:maximumStackLength\", function (model, value) {\n\t\t\t\tthis.stack.setMaxLength(value);\n\t\t\t}, this);\n\n\t\t\t// Start tracking, if attr.track == true\n\t\t\tif (attr && attr.track) {\n\t\t\t\tthis.startTracking();\n\t\t\t}\n\n\t\t\t// Register objects passed in the \"register\" attribute\n\t\t\tif (attr && attr.register) {\n\t\t\t\tif (_.isArray(attr.register) || _.isArguments(attr.register)) {\n\t\t\t\t\tapply(this.register, this, attr.register);\n\t\t\t\t} else {\n\t\t\t\t\tthis.register(attr.register);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Starts tracking. Changes of registered objects won't be processed until you've called this function\n\t\t * @return {undefined}\n\t\t */\n\t\tstartTracking: function () {\n\t\t\tthis.set(\"track\", true);\n\t\t\tthis.stack.track = true;\n\t\t},\n\t\t/**\n\t\t * Stops tracking. Afterwards changes of registered objects won't be processed.\n\t\t * @return {undefined}\n\t\t */\n\t\tstopTracking: function () {\n\t\t\tthis.set(\"track\", false);\n\t\t\tthis.stack.track = false;\n\t\t},\n\t\t/**\n\t\t * Return the state of the tracking\n\t\t * @return {boolean}\n\t\t */\n\t\tisTracking: function () {\n\t\t\treturn this.get(\"track\");\n\t\t},\n\t\t/**\n\t\t * This is the \"all\"-handler which is bound to registered\n\t\t * objects. It creates an UndoAction from the event and adds\n\t\t * it to the stack.\n\t\t *\n\t\t * @param {String} \ttype \tThe event type\n\t\t * @return {undefined}\n\t\t */\n\t\t_addToStack: function (type) {\n\t\t\taddToStack(this.stack, type, slice(arguments, 1), this.undoTypes);\n\t\t},\n\t\t/**\n\t\t * Registers one or more objects to track their changes.\n\t\t * @param {...Object} \tobj \tThe object or objects of which changes should be tracked\n\t\t * @return {undefined}\n\t\t */\n\t\tregister: function () {\n\t\t\tonoff(\"on\", arguments, this._addToStack, this);\n\t\t},\n\t\t/**\n\t\t * Unregisters one or more objects.\n\t\t * @param {...Object} \tobj \tThe object or objects of which changes shouldn't be tracked any longer\n\t\t * @return {undefined}\n\t\t */\n\t\tunregister: function () {\n\t\t\tonoff(\"off\", arguments, this._addToStack, this);\n\t\t},\n\t\t/**\n\t\t * Unregisters all previously registered objects.\n\t\t * @return {undefined}\n\t\t */\n\t\tunregisterAll: function () {\n\t\t\tapply(this.unregister, this, this.objectRegistry.get());\n\t\t},\n\t\t/**\n\t\t * Undoes the last action or the last set of actions in case 'magic' is true.\n\t\t * @param {Boolean} \t[magic] \tIf true, all actions that happened basically at the same time are undone together\n\t\t * @return {undefined}\n\t\t */\n\t\tundo: function (magic) {\n\t\t\tmanagerUndoRedo(\"undo\", this, this.stack, magic);\n\t\t},\n\n\t\t/**\n\t\t * Undoes all actions ever tracked by the undo manager\n\t\t * @return {undefined}\n\t\t */\n\t\tundoAll: function () {\n\t\t\tmanagerUndoRedo(\"undo\", this, this.stack, false, true);\n\t\t},\n\n\t\t/**\n\t\t * Redoes a previously undone action or a set of actions.\n\t\t * @param {Boolean} \t[magic] \tIf true, all actions that happened basically at the same time are redone together\n\t\t * @return {undefined}\n\t\t */\n\t\tredo: function (magic) {\n\t\t\tmanagerUndoRedo(\"redo\", this, this.stack, magic);\n\t\t},\n\n\t\t/**\n\t\t * Redoes all actions ever tracked by the undo manager\n\t\t * @return {undefined}\n\t\t */\n\t\tredoAll: function () {\n\t\t\tmanagerUndoRedo(\"redo\", this, this.stack, false, true);\n\t\t},\n\t\t/**\n\t\t * Checks if there's an action in the stack that can be undone / redone\n\t\t * @param {String} \ttype \tEither \"undo\" or \"redo\"\n\t\t * @return {Boolean} True if there is a set of actions which can be undone / redone\n\t\t */\n\t\tisAvailable: function (type) {\n\t\t\tvar s = this.stack, l = s.length;\n\n\t\t\tswitch (type) {\n\t\t\t\tcase \"undo\": return l > 0 && s.pointer > -1;\n\t\t\t\tcase \"redo\": return l > 0 && s.pointer < l - 1;\n\t\t\t\tdefault: return false;\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Sets the stack-reference to the stack of another undoManager.\n\t\t * @param {UndoManager} \tundoManager \tThe undoManager whose stack-reference is set to this stack\n\t\t * @return {undefined}\n\t\t */\n\t\tmerge: function (undoManager) {\n\t\t\t// This sets the stack-reference to the stack of another\n\t\t\t// undoManager so that the stack of this other undoManager\n\t\t\t// is used by two different managers.\n\t\t\t// This enables to set up a main-undoManager and besides it\n\t\t\t// several others for special, exceptional cases (by using\n\t\t\t// instance-based custom UndoTypes). Models / collections\n\t\t\t// which need this special treatment are only registered at\n\t\t\t// those special undoManagers. Those special ones are then\n\t\t\t// merged into the main-undoManager to write on its stack.\n\t\t\t// That way it's easier to manage exceptional cases.\n\t\t\tvar args = _.isArray(undoManager) ? undoManager : slice(arguments), manager;\n\t\t\twhile (manager = args.pop()) {\n\t\t\t\tif (manager instanceof UndoManager &&\n\t\t\t\t\tmanager.stack instanceof UndoStack) {\n\t\t\t\t\t// set the stack reference to our stack\n\t\t\t\t\tmanager.stack = this.stack;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Add an UndoType to this specific UndoManager-instance.\n\t\t * @param {String} type The event this UndoType is made for\n\t\t * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. Must have the properties \"undo\", \"redo\" and \"on\". Can have the property \"condition\".\n\t\t * @return {undefined}\n\t\t */\n\t\taddUndoType: function (type, fns) {\n\t\t\tmanipulateUndoType(0, type, fns, this.undoTypes);\n\t\t},\n\t\t/**\n\t\t * Overwrite properties of an existing UndoType for this specific UndoManager-instance.\n\t\t * @param {String} type The event the UndoType is made for\n\t\t * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. It extends the existing object.\n\t\t * @return {undefined}\n\t\t */\n\t\tchangeUndoType: function (type, fns) {\n\t\t\tmanipulateUndoType(1, type, fns, this.undoTypes);\n\t\t},\n\t\t/**\n\t\t * Remove one or more UndoTypes of this specific UndoManager-instance to fall back to the global UndoTypes.\n\t\t * @param {String|Array} type The event the UndoType that should be removed is made for. You can also pass an array of events.\n\t\t * @return {undefined}\n\t\t */\n\t\tremoveUndoType: function (type) {\n\t\t\tmanipulateUndoType(2, type, undefined, this.undoTypes);\n\t\t},\n\n\t\t/**\n\t\t * Removes all actions from the stack.\n\t\t * @return {undefined}\n\t\t */\n\t\tclear: function() {\n\t\t\tthis.stack.reset();\n\t\t\tthis.stack.pointer = -1;\n\t\t}\n\t});\n\n\t_.extend(UndoManager, {\n\t\t/**\n\t\t * Change the UndoManager's default attributes\n\t\t * @param {Object} defaultAttributes An object with the new default values.\n\t\t * @return {undefined}\n\t\t */\n\t\tdefaults: function (defaultAttributes) {\n\t\t\t_.extend(UndoManager.prototype.defaults, defaultAttributes);\n\t\t},\n\t\t/**\n\t\t * Add an UndoType to the global UndoTypes-object.\n\t\t * @param {String} type The event this UndoType is made for\n\t\t * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. Must have the properties \"undo\", \"redo\" and \"on\". Can have the property \"condition\".\n\t\t * @return {undefined}\n\t\t */\n\t\t\"addUndoType\": function (type, fns) {\n\t\t\tmanipulateUndoType(0, type, fns, UndoTypes);\n\t\t},\n\t\t/**\n\t\t * Overwrite properties of an existing UndoType in the global UndoTypes-object.\n\t\t * @param {String} type The event the UndoType is made for\n\t\t * @param {Object} fns An object of functions that are called to generate the data for an UndoAction or to process it. It extends the existing object.\n\t\t * @return {undefined}\n\t\t */\n\t\t\"changeUndoType\": function (type, fns) {\n\t\t\tmanipulateUndoType(1, type, fns, UndoTypes)\n\t\t},\n\t\t/**\n\t\t * Remove one or more UndoTypes of this specific UndoManager-instance to fall back to the global UndoTypes.\n\t\t * @param {String|Array} type The event the UndoType that should be removed is made for. You can also pass an array of events.\n\t\t * @return {undefined}\n\t\t */\n\t\t\"removeUndoType\": function (type) {\n\t\t\tmanipulateUndoType(2, type, undefined, UndoTypes);\n\t\t}\n\t})\n\n\treturn Backbone.UndoManager = UndoManager;\n\n});\n","// Backbone.js 1.4.1\n\n// (c) 2010-2022 Jeremy Ashkenas and DocumentCloud\n// Backbone may be freely distributed under the MIT license.\n// For all details and documentation:\n// http://backbonejs.org\n\n(function(factory) {\n\n // Establish the root object, `window` (`self`) in the browser, or `global` on the server.\n // We use `self` instead of `window` for `WebWorker` support.\n var root = typeof self == 'object' && self.self === self && self ||\n typeof global == 'object' && global.global === global && global;\n\n // Set up Backbone appropriately for the environment. Start with AMD.\n if (typeof define === 'function' && define.amd) {\n define(['underscore', 'jquery', 'exports'], function(_, $, exports) {\n // Export global even in AMD case in case this script is loaded with\n // others that may still expect a global Backbone.\n root.Backbone = factory(root, exports, _, $);\n });\n\n // Next for Node.js or CommonJS. jQuery may not be needed as a module.\n } else if (typeof exports !== 'undefined') {\n var _ = require('underscore'), $;\n try { $ = require('jquery'); } catch (e) {}\n factory(root, exports, _, $);\n\n // Finally, as a browser global.\n } else {\n root.Backbone = factory(root, {}, root._, root.jQuery || root.Zepto || root.ender || root.$);\n }\n\n})(function(root, Backbone, _, $) {\n\n // Initial Setup\n // -------------\n\n // Save the previous value of the `Backbone` variable, so that it can be\n // restored later on, if `noConflict` is used.\n var previousBackbone = root.Backbone;\n\n // Create a local reference to a common array method we'll want to use later.\n var slice = Array.prototype.slice;\n\n // Current version of the library. Keep in sync with `package.json`.\n Backbone.VERSION = '1.4.1';\n\n // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns\n // the `$` variable.\n Backbone.$ = $;\n\n // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable\n // to its previous owner. Returns a reference to this Backbone object.\n Backbone.noConflict = function() {\n root.Backbone = previousBackbone;\n return this;\n };\n\n // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option\n // will fake `\"PATCH\"`, `\"PUT\"` and `\"DELETE\"` requests via the `_method` parameter and\n // set a `X-Http-Method-Override` header.\n Backbone.emulateHTTP = false;\n\n // Turn on `emulateJSON` to support legacy servers that can't deal with direct\n // `application/json` requests ... this will encode the body as\n // `application/x-www-form-urlencoded` instead and will send the model in a\n // form param named `model`.\n Backbone.emulateJSON = false;\n\n // Backbone.Events\n // ---------------\n\n // A module that can be mixed in to *any object* in order to provide it with\n // a custom event channel. You may bind a callback to an event with `on` or\n // remove with `off`; `trigger`-ing an event fires all callbacks in\n // succession.\n //\n // var object = {};\n // _.extend(object, Backbone.Events);\n // object.on('expand', function(){ alert('expanded'); });\n // object.trigger('expand');\n //\n var Events = Backbone.Events = {};\n\n // Regular expression used to split event strings.\n var eventSplitter = /\\s+/;\n\n // A private global variable to share between listeners and listenees.\n var _listening;\n\n // Iterates over the standard `event, callback` (as well as the fancy multiple\n // space-separated events `\"change blur\", callback` and jQuery-style event\n // maps `{event: callback}`).\n var eventsApi = function(iteratee, events, name, callback, opts) {\n var i = 0, names;\n if (name && typeof name === 'object') {\n // Handle event maps.\n if (callback !== void 0 && 'context' in opts && opts.context === void 0) opts.context = callback;\n for (names = _.keys(name); i < names.length ; i++) {\n events = eventsApi(iteratee, events, names[i], name[names[i]], opts);\n }\n } else if (name && eventSplitter.test(name)) {\n // Handle space-separated event names by delegating them individually.\n for (names = name.split(eventSplitter); i < names.length; i++) {\n events = iteratee(events, names[i], callback, opts);\n }\n } else {\n // Finally, standard events.\n events = iteratee(events, name, callback, opts);\n }\n return events;\n };\n\n // Bind an event to a `callback` function. Passing `\"all\"` will bind\n // the callback to all events fired.\n Events.on = function(name, callback, context) {\n this._events = eventsApi(onApi, this._events || {}, name, callback, {\n context: context,\n ctx: this,\n listening: _listening\n });\n\n if (_listening) {\n var listeners = this._listeners || (this._listeners = {});\n listeners[_listening.id] = _listening;\n // Allow the listening to use a counter, instead of tracking\n // callbacks for library interop\n _listening.interop = false;\n }\n\n return this;\n };\n\n // Inversion-of-control versions of `on`. Tell *this* object to listen to\n // an event in another object... keeping track of what it's listening to\n // for easier unbinding later.\n Events.listenTo = function(obj, name, callback) {\n if (!obj) return this;\n var id = obj._listenId || (obj._listenId = _.uniqueId('l'));\n var listeningTo = this._listeningTo || (this._listeningTo = {});\n var listening = _listening = listeningTo[id];\n\n // This object is not listening to any other events on `obj` yet.\n // Setup the necessary references to track the listening callbacks.\n if (!listening) {\n this._listenId || (this._listenId = _.uniqueId('l'));\n listening = _listening = listeningTo[id] = new Listening(this, obj);\n }\n\n // Bind callbacks on obj.\n var error = tryCatchOn(obj, name, callback, this);\n _listening = void 0;\n\n if (error) throw error;\n // If the target obj is not Backbone.Events, track events manually.\n if (listening.interop) listening.on(name, callback);\n\n return this;\n };\n\n // The reducing API that adds a callback to the `events` object.\n var onApi = function(events, name, callback, options) {\n if (callback) {\n var handlers = events[name] || (events[name] = []);\n var context = options.context, ctx = options.ctx, listening = options.listening;\n if (listening) listening.count++;\n\n handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening});\n }\n return events;\n };\n\n // An try-catch guarded #on function, to prevent poisoning the global\n // `_listening` variable.\n var tryCatchOn = function(obj, name, callback, context) {\n try {\n obj.on(name, callback, context);\n } catch (e) {\n return e;\n }\n };\n\n // Remove one or many callbacks. If `context` is null, removes all\n // callbacks with that function. If `callback` is null, removes all\n // callbacks for the event. If `name` is null, removes all bound\n // callbacks for all events.\n Events.off = function(name, callback, context) {\n if (!this._events) return this;\n this._events = eventsApi(offApi, this._events, name, callback, {\n context: context,\n listeners: this._listeners\n });\n\n return this;\n };\n\n // Tell this object to stop listening to either specific events ... or\n // to every object it's currently listening to.\n Events.stopListening = function(obj, name, callback) {\n var listeningTo = this._listeningTo;\n if (!listeningTo) return this;\n\n var ids = obj ? [obj._listenId] : _.keys(listeningTo);\n for (var i = 0; i < ids.length; i++) {\n var listening = listeningTo[ids[i]];\n\n // If listening doesn't exist, this object is not currently\n // listening to obj. Break out early.\n if (!listening) break;\n\n listening.obj.off(name, callback, this);\n if (listening.interop) listening.off(name, callback);\n }\n if (_.isEmpty(listeningTo)) this._listeningTo = void 0;\n\n return this;\n };\n\n // The reducing API that removes a callback from the `events` object.\n var offApi = function(events, name, callback, options) {\n if (!events) return;\n\n var context = options.context, listeners = options.listeners;\n var i = 0, names;\n\n // Delete all event listeners and \"drop\" events.\n if (!name && !context && !callback) {\n for (names = _.keys(listeners); i < names.length; i++) {\n listeners[names[i]].cleanup();\n }\n return;\n }\n\n names = name ? [name] : _.keys(events);\n for (; i < names.length; i++) {\n name = names[i];\n var handlers = events[name];\n\n // Bail out if there are no events stored.\n if (!handlers) break;\n\n // Find any remaining events.\n var remaining = [];\n for (var j = 0; j < handlers.length; j++) {\n var handler = handlers[j];\n if (\n callback && callback !== handler.callback &&\n callback !== handler.callback._callback ||\n context && context !== handler.context\n ) {\n remaining.push(handler);\n } else {\n var listening = handler.listening;\n if (listening) listening.off(name, callback);\n }\n }\n\n // Replace events if there are any remaining. Otherwise, clean up.\n if (remaining.length) {\n events[name] = remaining;\n } else {\n delete events[name];\n }\n }\n\n return events;\n };\n\n // Bind an event to only be triggered a single time. After the first time\n // the callback is invoked, its listener will be removed. If multiple events\n // are passed in using the space-separated syntax, the handler will fire\n // once for each event, not once for a combination of all events.\n Events.once = function(name, callback, context) {\n // Map the event into a `{event: once}` object.\n var events = eventsApi(onceMap, {}, name, callback, this.off.bind(this));\n if (typeof name === 'string' && context == null) callback = void 0;\n return this.on(events, callback, context);\n };\n\n // Inversion-of-control versions of `once`.\n Events.listenToOnce = function(obj, name, callback) {\n // Map the event into a `{event: once}` object.\n var events = eventsApi(onceMap, {}, name, callback, this.stopListening.bind(this, obj));\n return this.listenTo(obj, events);\n };\n\n // Reduces the event callbacks into a map of `{event: onceWrapper}`.\n // `offer` unbinds the `onceWrapper` after it has been called.\n var onceMap = function(map, name, callback, offer) {\n if (callback) {\n var once = map[name] = _.once(function() {\n offer(name, once);\n callback.apply(this, arguments);\n });\n once._callback = callback;\n }\n return map;\n };\n\n // Trigger one or many events, firing all bound callbacks. Callbacks are\n // passed the same arguments as `trigger` is, apart from the event name\n // (unless you're listening on `\"all\"`, which will cause your callback to\n // receive the true name of the event as the first argument).\n Events.trigger = function(name) {\n if (!this._events) return this;\n\n var length = Math.max(0, arguments.length - 1);\n var args = Array(length);\n for (var i = 0; i < length; i++) args[i] = arguments[i + 1];\n\n eventsApi(triggerApi, this._events, name, void 0, args);\n return this;\n };\n\n // Handles triggering the appropriate event callbacks.\n var triggerApi = function(objEvents, name, callback, args) {\n if (objEvents) {\n var events = objEvents[name];\n var allEvents = objEvents.all;\n if (events && allEvents) allEvents = allEvents.slice();\n if (events) triggerEvents(events, args);\n if (allEvents) triggerEvents(allEvents, [name].concat(args));\n }\n return objEvents;\n };\n\n // A difficult-to-believe, but optimized internal dispatch function for\n // triggering events. Tries to keep the usual cases speedy (most internal\n // Backbone events have 3 arguments).\n var triggerEvents = function(events, args) {\n var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];\n switch (args.length) {\n case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;\n case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;\n case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;\n case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;\n default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;\n }\n };\n\n // A listening class that tracks and cleans up memory bindings\n // when all callbacks have been offed.\n var Listening = function(listener, obj) {\n this.id = listener._listenId;\n this.listener = listener;\n this.obj = obj;\n this.interop = true;\n this.count = 0;\n this._events = void 0;\n };\n\n Listening.prototype.on = Events.on;\n\n // Offs a callback (or several).\n // Uses an optimized counter if the listenee uses Backbone.Events.\n // Otherwise, falls back to manual tracking to support events\n // library interop.\n Listening.prototype.off = function(name, callback) {\n var cleanup;\n if (this.interop) {\n this._events = eventsApi(offApi, this._events, name, callback, {\n context: void 0,\n listeners: void 0\n });\n cleanup = !this._events;\n } else {\n this.count--;\n cleanup = this.count === 0;\n }\n if (cleanup) this.cleanup();\n };\n\n // Cleans up memory bindings between the listener and the listenee.\n Listening.prototype.cleanup = function() {\n delete this.listener._listeningTo[this.obj._listenId];\n if (!this.interop) delete this.obj._listeners[this.id];\n };\n\n // Aliases for backwards compatibility.\n Events.bind = Events.on;\n Events.unbind = Events.off;\n\n // Allow the `Backbone` object to serve as a global event bus, for folks who\n // want global \"pubsub\" in a convenient place.\n _.extend(Backbone, Events);\n\n // Backbone.Model\n // --------------\n\n // Backbone **Models** are the basic data object in the framework --\n // frequently representing a row in a table in a database on your server.\n // A discrete chunk of data and a bunch of useful, related methods for\n // performing computations and transformations on that data.\n\n // Create a new model with the specified attributes. A client id (`cid`)\n // is automatically generated and assigned for you.\n var Model = Backbone.Model = function(attributes, options) {\n var attrs = attributes || {};\n options || (options = {});\n this.preinitialize.apply(this, arguments);\n this.cid = _.uniqueId(this.cidPrefix);\n this.attributes = {};\n if (options.collection) this.collection = options.collection;\n if (options.parse) attrs = this.parse(attrs, options) || {};\n var defaults = _.result(this, 'defaults');\n attrs = _.defaults(_.extend({}, defaults, attrs), defaults);\n this.set(attrs, options);\n this.changed = {};\n this.initialize.apply(this, arguments);\n };\n\n // Attach all inheritable methods to the Model prototype.\n _.extend(Model.prototype, Events, {\n\n // A hash of attributes whose current and previous value differ.\n changed: null,\n\n // The value returned during the last failed validation.\n validationError: null,\n\n // The default name for the JSON `id` attribute is `\"id\"`. MongoDB and\n // CouchDB users may want to set this to `\"_id\"`.\n idAttribute: 'id',\n\n // The prefix is used to create the client id which is used to identify models locally.\n // You may want to override this if you're experiencing name clashes with model ids.\n cidPrefix: 'c',\n\n // preinitialize is an empty function by default. You can override it with a function\n // or object. preinitialize will run before any instantiation logic is run in the Model.\n preinitialize: function(){},\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // Return a copy of the model's `attributes` object.\n toJSON: function(options) {\n return _.clone(this.attributes);\n },\n\n // Proxy `Backbone.sync` by default -- but override this if you need\n // custom syncing semantics for *this* particular model.\n sync: function() {\n return Backbone.sync.apply(this, arguments);\n },\n\n // Get the value of an attribute.\n get: function(attr) {\n return this.attributes[attr];\n },\n\n // Get the HTML-escaped value of an attribute.\n escape: function(attr) {\n return _.escape(this.get(attr));\n },\n\n // Returns `true` if the attribute contains a value that is not null\n // or undefined.\n has: function(attr) {\n return this.get(attr) != null;\n },\n\n // Special-cased proxy to underscore's `_.matches` method.\n matches: function(attrs) {\n return !!_.iteratee(attrs, this)(this.attributes);\n },\n\n // Set a hash of model attributes on the object, firing `\"change\"`. This is\n // the core primitive operation of a model, updating the data and notifying\n // anyone who needs to know about the change in state. The heart of the beast.\n set: function(key, val, options) {\n if (key == null) return this;\n\n // Handle both `\"key\", value` and `{key: value}` -style arguments.\n var attrs;\n if (typeof key === 'object') {\n attrs = key;\n options = val;\n } else {\n (attrs = {})[key] = val;\n }\n\n options || (options = {});\n\n // Run validation.\n if (!this._validate(attrs, options)) return false;\n\n // Extract attributes and options.\n var unset = options.unset;\n var silent = options.silent;\n var changes = [];\n var changing = this._changing;\n this._changing = true;\n\n if (!changing) {\n this._previousAttributes = _.clone(this.attributes);\n this.changed = {};\n }\n\n var current = this.attributes;\n var changed = this.changed;\n var prev = this._previousAttributes;\n\n // For each `set` attribute, update or delete the current value.\n for (var attr in attrs) {\n val = attrs[attr];\n if (!_.isEqual(current[attr], val)) changes.push(attr);\n if (!_.isEqual(prev[attr], val)) {\n changed[attr] = val;\n } else {\n delete changed[attr];\n }\n unset ? delete current[attr] : current[attr] = val;\n }\n\n // Update the `id`.\n if (this.idAttribute in attrs) {\n var prevId = this.id;\n this.id = this.get(this.idAttribute);\n this.trigger('changeId', this, prevId, options);\n }\n\n // Trigger all relevant attribute changes.\n if (!silent) {\n if (changes.length) this._pending = options;\n for (var i = 0; i < changes.length; i++) {\n this.trigger('change:' + changes[i], this, current[changes[i]], options);\n }\n }\n\n // You might be wondering why there's a `while` loop here. Changes can\n // be recursively nested within `\"change\"` events.\n if (changing) return this;\n if (!silent) {\n while (this._pending) {\n options = this._pending;\n this._pending = false;\n this.trigger('change', this, options);\n }\n }\n this._pending = false;\n this._changing = false;\n return this;\n },\n\n // Remove an attribute from the model, firing `\"change\"`. `unset` is a noop\n // if the attribute doesn't exist.\n unset: function(attr, options) {\n return this.set(attr, void 0, _.extend({}, options, {unset: true}));\n },\n\n // Clear all attributes on the model, firing `\"change\"`.\n clear: function(options) {\n var attrs = {};\n for (var key in this.attributes) attrs[key] = void 0;\n return this.set(attrs, _.extend({}, options, {unset: true}));\n },\n\n // Determine if the model has changed since the last `\"change\"` event.\n // If you specify an attribute name, determine if that attribute has changed.\n hasChanged: function(attr) {\n if (attr == null) return !_.isEmpty(this.changed);\n return _.has(this.changed, attr);\n },\n\n // Return an object containing all the attributes that have changed, or\n // false if there are no changed attributes. Useful for determining what\n // parts of a view need to be updated and/or what attributes need to be\n // persisted to the server. Unset attributes will be set to undefined.\n // You can also pass an attributes object to diff against the model,\n // determining if there *would be* a change.\n changedAttributes: function(diff) {\n if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;\n var old = this._changing ? this._previousAttributes : this.attributes;\n var changed = {};\n var hasChanged;\n for (var attr in diff) {\n var val = diff[attr];\n if (_.isEqual(old[attr], val)) continue;\n changed[attr] = val;\n hasChanged = true;\n }\n return hasChanged ? changed : false;\n },\n\n // Get the previous value of an attribute, recorded at the time the last\n // `\"change\"` event was fired.\n previous: function(attr) {\n if (attr == null || !this._previousAttributes) return null;\n return this._previousAttributes[attr];\n },\n\n // Get all of the attributes of the model at the time of the previous\n // `\"change\"` event.\n previousAttributes: function() {\n return _.clone(this._previousAttributes);\n },\n\n // Fetch the model from the server, merging the response with the model's\n // local attributes. Any changed attributes will trigger a \"change\" event.\n fetch: function(options) {\n options = _.extend({parse: true}, options);\n var model = this;\n var success = options.success;\n options.success = function(resp) {\n var serverAttrs = options.parse ? model.parse(resp, options) : resp;\n if (!model.set(serverAttrs, options)) return false;\n if (success) success.call(options.context, model, resp, options);\n model.trigger('sync', model, resp, options);\n };\n wrapError(this, options);\n return this.sync('read', this, options);\n },\n\n // Set a hash of model attributes, and sync the model to the server.\n // If the server returns an attributes hash that differs, the model's\n // state will be `set` again.\n save: function(key, val, options) {\n // Handle both `\"key\", value` and `{key: value}` -style arguments.\n var attrs;\n if (key == null || typeof key === 'object') {\n attrs = key;\n options = val;\n } else {\n (attrs = {})[key] = val;\n }\n\n options = _.extend({validate: true, parse: true}, options);\n var wait = options.wait;\n\n // If we're not waiting and attributes exist, save acts as\n // `set(attr).save(null, opts)` with validation. Otherwise, check if\n // the model will be valid when the attributes, if any, are set.\n if (attrs && !wait) {\n if (!this.set(attrs, options)) return false;\n } else if (!this._validate(attrs, options)) {\n return false;\n }\n\n // After a successful server-side save, the client is (optionally)\n // updated with the server-side state.\n var model = this;\n var success = options.success;\n var attributes = this.attributes;\n options.success = function(resp) {\n // Ensure attributes are restored during synchronous saves.\n model.attributes = attributes;\n var serverAttrs = options.parse ? model.parse(resp, options) : resp;\n if (wait) serverAttrs = _.extend({}, attrs, serverAttrs);\n if (serverAttrs && !model.set(serverAttrs, options)) return false;\n if (success) success.call(options.context, model, resp, options);\n model.trigger('sync', model, resp, options);\n };\n wrapError(this, options);\n\n // Set temporary attributes if `{wait: true}` to properly find new ids.\n if (attrs && wait) this.attributes = _.extend({}, attributes, attrs);\n\n var method = this.isNew() ? 'create' : options.patch ? 'patch' : 'update';\n if (method === 'patch' && !options.attrs) options.attrs = attrs;\n var xhr = this.sync(method, this, options);\n\n // Restore attributes.\n this.attributes = attributes;\n\n return xhr;\n },\n\n // Destroy this model on the server if it was already persisted.\n // Optimistically removes the model from its collection, if it has one.\n // If `wait: true` is passed, waits for the server to respond before removal.\n destroy: function(options) {\n options = options ? _.clone(options) : {};\n var model = this;\n var success = options.success;\n var wait = options.wait;\n\n var destroy = function() {\n model.stopListening();\n model.trigger('destroy', model, model.collection, options);\n };\n\n options.success = function(resp) {\n if (wait) destroy();\n if (success) success.call(options.context, model, resp, options);\n if (!model.isNew()) model.trigger('sync', model, resp, options);\n };\n\n var xhr = false;\n if (this.isNew()) {\n _.defer(options.success);\n } else {\n wrapError(this, options);\n xhr = this.sync('delete', this, options);\n }\n if (!wait) destroy();\n return xhr;\n },\n\n // Default URL for the model's representation on the server -- if you're\n // using Backbone's restful methods, override this to change the endpoint\n // that will be called.\n url: function() {\n var base =\n _.result(this, 'urlRoot') ||\n _.result(this.collection, 'url') ||\n urlError();\n if (this.isNew()) return base;\n var id = this.get(this.idAttribute);\n return base.replace(/[^\\/]$/, '$&/') + encodeURIComponent(id);\n },\n\n // **parse** converts a response into the hash of attributes to be `set` on\n // the model. The default implementation is just to pass the response along.\n parse: function(resp, options) {\n return resp;\n },\n\n // Create a new model with identical attributes to this one.\n clone: function() {\n return new this.constructor(this.attributes);\n },\n\n // A model is new if it has never been saved to the server, and lacks an id.\n isNew: function() {\n return !this.has(this.idAttribute);\n },\n\n // Check if the model is currently in a valid state.\n isValid: function(options) {\n return this._validate({}, _.extend({}, options, {validate: true}));\n },\n\n // Run validation against the next complete set of model attributes,\n // returning `true` if all is well. Otherwise, fire an `\"invalid\"` event.\n _validate: function(attrs, options) {\n if (!options.validate || !this.validate) return true;\n attrs = _.extend({}, this.attributes, attrs);\n var error = this.validationError = this.validate(attrs, options) || null;\n if (!error) return true;\n this.trigger('invalid', this, error, _.extend(options, {validationError: error}));\n return false;\n }\n\n });\n\n // Backbone.Collection\n // -------------------\n\n // If models tend to represent a single row of data, a Backbone Collection is\n // more analogous to a table full of data ... or a small slice or page of that\n // table, or a collection of rows that belong together for a particular reason\n // -- all of the messages in this particular folder, all of the documents\n // belonging to this particular author, and so on. Collections maintain\n // indexes of their models, both in order, and for lookup by `id`.\n\n // Create a new **Collection**, perhaps to contain a specific type of `model`.\n // If a `comparator` is specified, the Collection will maintain\n // its models in sort order, as they're added and removed.\n var Collection = Backbone.Collection = function(models, options) {\n options || (options = {});\n this.preinitialize.apply(this, arguments);\n if (options.model) this.model = options.model;\n if (options.comparator !== void 0) this.comparator = options.comparator;\n this._reset();\n this.initialize.apply(this, arguments);\n if (models) this.reset(models, _.extend({silent: true}, options));\n };\n\n // Default options for `Collection#set`.\n var setOptions = {add: true, remove: true, merge: true};\n var addOptions = {add: true, remove: false};\n\n // Splices `insert` into `array` at index `at`.\n var splice = function(array, insert, at) {\n at = Math.min(Math.max(at, 0), array.length);\n var tail = Array(array.length - at);\n var length = insert.length;\n var i;\n for (i = 0; i < tail.length; i++) tail[i] = array[i + at];\n for (i = 0; i < length; i++) array[i + at] = insert[i];\n for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i];\n };\n\n // Define the Collection's inheritable methods.\n _.extend(Collection.prototype, Events, {\n\n // The default model for a collection is just a **Backbone.Model**.\n // This should be overridden in most cases.\n model: Model,\n\n\n // preinitialize is an empty function by default. You can override it with a function\n // or object. preinitialize will run before any instantiation logic is run in the Collection.\n preinitialize: function(){},\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // The JSON representation of a Collection is an array of the\n // models' attributes.\n toJSON: function(options) {\n return this.map(function(model) { return model.toJSON(options); });\n },\n\n // Proxy `Backbone.sync` by default.\n sync: function() {\n return Backbone.sync.apply(this, arguments);\n },\n\n // Add a model, or list of models to the set. `models` may be Backbone\n // Models or raw JavaScript objects to be converted to Models, or any\n // combination of the two.\n add: function(models, options) {\n return this.set(models, _.extend({merge: false}, options, addOptions));\n },\n\n // Remove a model, or a list of models from the set.\n remove: function(models, options) {\n options = _.extend({}, options);\n var singular = !_.isArray(models);\n models = singular ? [models] : models.slice();\n var removed = this._removeModels(models, options);\n if (!options.silent && removed.length) {\n options.changes = {added: [], merged: [], removed: removed};\n this.trigger('update', this, options);\n }\n return singular ? removed[0] : removed;\n },\n\n // Update a collection by `set`-ing a new list of models, adding new ones,\n // removing models that are no longer present, and merging models that\n // already exist in the collection, as necessary. Similar to **Model#set**,\n // the core operation for updating the data contained by the collection.\n set: function(models, options) {\n if (models == null) return;\n\n options = _.extend({}, setOptions, options);\n if (options.parse && !this._isModel(models)) {\n models = this.parse(models, options) || [];\n }\n\n var singular = !_.isArray(models);\n models = singular ? [models] : models.slice();\n\n var at = options.at;\n if (at != null) at = +at;\n if (at > this.length) at = this.length;\n if (at < 0) at += this.length + 1;\n\n var set = [];\n var toAdd = [];\n var toMerge = [];\n var toRemove = [];\n var modelMap = {};\n\n var add = options.add;\n var merge = options.merge;\n var remove = options.remove;\n\n var sort = false;\n var sortable = this.comparator && at == null && options.sort !== false;\n var sortAttr = _.isString(this.comparator) ? this.comparator : null;\n\n // Turn bare objects into model references, and prevent invalid models\n // from being added.\n var model, i;\n for (i = 0; i < models.length; i++) {\n model = models[i];\n\n // If a duplicate is found, prevent it from being added and\n // optionally merge it into the existing model.\n var existing = this.get(model);\n if (existing) {\n if (merge && model !== existing) {\n var attrs = this._isModel(model) ? model.attributes : model;\n if (options.parse) attrs = existing.parse(attrs, options);\n existing.set(attrs, options);\n toMerge.push(existing);\n if (sortable && !sort) sort = existing.hasChanged(sortAttr);\n }\n if (!modelMap[existing.cid]) {\n modelMap[existing.cid] = true;\n set.push(existing);\n }\n models[i] = existing;\n\n // If this is a new, valid model, push it to the `toAdd` list.\n } else if (add) {\n model = models[i] = this._prepareModel(model, options);\n if (model) {\n toAdd.push(model);\n this._addReference(model, options);\n modelMap[model.cid] = true;\n set.push(model);\n }\n }\n }\n\n // Remove stale models.\n if (remove) {\n for (i = 0; i < this.length; i++) {\n model = this.models[i];\n if (!modelMap[model.cid]) toRemove.push(model);\n }\n if (toRemove.length) this._removeModels(toRemove, options);\n }\n\n // See if sorting is needed, update `length` and splice in new models.\n var orderChanged = false;\n var replace = !sortable && add && remove;\n if (set.length && replace) {\n orderChanged = this.length !== set.length || _.some(this.models, function(m, index) {\n return m !== set[index];\n });\n this.models.length = 0;\n splice(this.models, set, 0);\n this.length = this.models.length;\n } else if (toAdd.length) {\n if (sortable) sort = true;\n splice(this.models, toAdd, at == null ? this.length : at);\n this.length = this.models.length;\n }\n\n // Silently sort the collection if appropriate.\n if (sort) this.sort({silent: true});\n\n // Unless silenced, it's time to fire all appropriate add/sort/update events.\n if (!options.silent) {\n for (i = 0; i < toAdd.length; i++) {\n if (at != null) options.index = at + i;\n model = toAdd[i];\n model.trigger('add', model, this, options);\n }\n if (sort || orderChanged) this.trigger('sort', this, options);\n if (toAdd.length || toRemove.length || toMerge.length) {\n options.changes = {\n added: toAdd,\n removed: toRemove,\n merged: toMerge\n };\n this.trigger('update', this, options);\n }\n }\n\n // Return the added (or merged) model (or models).\n return singular ? models[0] : models;\n },\n\n // When you have more items than you want to add or remove individually,\n // you can reset the entire set with a new list of models, without firing\n // any granular `add` or `remove` events. Fires `reset` when finished.\n // Useful for bulk operations and optimizations.\n reset: function(models, options) {\n options = options ? _.clone(options) : {};\n for (var i = 0; i < this.models.length; i++) {\n this._removeReference(this.models[i], options);\n }\n options.previousModels = this.models;\n this._reset();\n models = this.add(models, _.extend({silent: true}, options));\n if (!options.silent) this.trigger('reset', this, options);\n return models;\n },\n\n // Add a model to the end of the collection.\n push: function(model, options) {\n return this.add(model, _.extend({at: this.length}, options));\n },\n\n // Remove a model from the end of the collection.\n pop: function(options) {\n var model = this.at(this.length - 1);\n return this.remove(model, options);\n },\n\n // Add a model to the beginning of the collection.\n unshift: function(model, options) {\n return this.add(model, _.extend({at: 0}, options));\n },\n\n // Remove a model from the beginning of the collection.\n shift: function(options) {\n var model = this.at(0);\n return this.remove(model, options);\n },\n\n // Slice out a sub-array of models from the collection.\n slice: function() {\n return slice.apply(this.models, arguments);\n },\n\n // Get a model from the set by id, cid, model object with id or cid\n // properties, or an attributes object that is transformed through modelId.\n get: function(obj) {\n if (obj == null) return void 0;\n return this._byId[obj] ||\n this._byId[this.modelId(this._isModel(obj) ? obj.attributes : obj, obj.idAttribute)] ||\n obj.cid && this._byId[obj.cid];\n },\n\n // Returns `true` if the model is in the collection.\n has: function(obj) {\n return this.get(obj) != null;\n },\n\n // Get the model at the given index.\n at: function(index) {\n if (index < 0) index += this.length;\n return this.models[index];\n },\n\n // Return models with matching attributes. Useful for simple cases of\n // `filter`.\n where: function(attrs, first) {\n return this[first ? 'find' : 'filter'](attrs);\n },\n\n // Return the first model with matching attributes. Useful for simple cases\n // of `find`.\n findWhere: function(attrs) {\n return this.where(attrs, true);\n },\n\n // Force the collection to re-sort itself. You don't need to call this under\n // normal circumstances, as the set will maintain sort order as each item\n // is added.\n sort: function(options) {\n var comparator = this.comparator;\n if (!comparator) throw new Error('Cannot sort a set without a comparator');\n options || (options = {});\n\n var length = comparator.length;\n if (_.isFunction(comparator)) comparator = comparator.bind(this);\n\n // Run sort based on type of `comparator`.\n if (length === 1 || _.isString(comparator)) {\n this.models = this.sortBy(comparator);\n } else {\n this.models.sort(comparator);\n }\n if (!options.silent) this.trigger('sort', this, options);\n return this;\n },\n\n // Pluck an attribute from each model in the collection.\n pluck: function(attr) {\n return this.map(attr + '');\n },\n\n // Fetch the default set of models for this collection, resetting the\n // collection when they arrive. If `reset: true` is passed, the response\n // data will be passed through the `reset` method instead of `set`.\n fetch: function(options) {\n options = _.extend({parse: true}, options);\n var success = options.success;\n var collection = this;\n options.success = function(resp) {\n var method = options.reset ? 'reset' : 'set';\n collection[method](resp, options);\n if (success) success.call(options.context, collection, resp, options);\n collection.trigger('sync', collection, resp, options);\n };\n wrapError(this, options);\n return this.sync('read', this, options);\n },\n\n // Create a new instance of a model in this collection. Add the model to the\n // collection immediately, unless `wait: true` is passed, in which case we\n // wait for the server to agree.\n create: function(model, options) {\n options = options ? _.clone(options) : {};\n var wait = options.wait;\n model = this._prepareModel(model, options);\n if (!model) return false;\n if (!wait) this.add(model, options);\n var collection = this;\n var success = options.success;\n options.success = function(m, resp, callbackOpts) {\n if (wait) collection.add(m, callbackOpts);\n if (success) success.call(callbackOpts.context, m, resp, callbackOpts);\n };\n model.save(null, options);\n return model;\n },\n\n // **parse** converts a response into a list of models to be added to the\n // collection. The default implementation is just to pass it through.\n parse: function(resp, options) {\n return resp;\n },\n\n // Create a new collection with an identical list of models as this one.\n clone: function() {\n return new this.constructor(this.models, {\n model: this.model,\n comparator: this.comparator\n });\n },\n\n // Define how to uniquely identify models in the collection.\n modelId: function(attrs, idAttribute) {\n return attrs[idAttribute || this.model.prototype.idAttribute || 'id'];\n },\n\n // Get an iterator of all models in this collection.\n values: function() {\n return new CollectionIterator(this, ITERATOR_VALUES);\n },\n\n // Get an iterator of all model IDs in this collection.\n keys: function() {\n return new CollectionIterator(this, ITERATOR_KEYS);\n },\n\n // Get an iterator of all [ID, model] tuples in this collection.\n entries: function() {\n return new CollectionIterator(this, ITERATOR_KEYSVALUES);\n },\n\n // Private method to reset all internal state. Called when the collection\n // is first initialized or reset.\n _reset: function() {\n this.length = 0;\n this.models = [];\n this._byId = {};\n },\n\n // Prepare a hash of attributes (or other model) to be added to this\n // collection.\n _prepareModel: function(attrs, options) {\n if (this._isModel(attrs)) {\n if (!attrs.collection) attrs.collection = this;\n return attrs;\n }\n options = options ? _.clone(options) : {};\n options.collection = this;\n\n var model;\n if (this.model.prototype) {\n model = new this.model(attrs, options);\n } else {\n // ES class methods didn't have prototype\n model = this.model(attrs, options);\n }\n\n if (!model.validationError) return model;\n this.trigger('invalid', this, model.validationError, options);\n return false;\n },\n\n // Internal method called by both remove and set.\n _removeModels: function(models, options) {\n var removed = [];\n for (var i = 0; i < models.length; i++) {\n var model = this.get(models[i]);\n if (!model) continue;\n\n var index = this.indexOf(model);\n this.models.splice(index, 1);\n this.length--;\n\n // Remove references before triggering 'remove' event to prevent an\n // infinite loop. #3693\n delete this._byId[model.cid];\n var id = this.modelId(model.attributes, model.idAttribute);\n if (id != null) delete this._byId[id];\n\n if (!options.silent) {\n options.index = index;\n model.trigger('remove', model, this, options);\n }\n\n removed.push(model);\n this._removeReference(model, options);\n }\n return removed;\n },\n\n // Method for checking whether an object should be considered a model for\n // the purposes of adding to the collection.\n _isModel: function(model) {\n return model instanceof Model;\n },\n\n // Internal method to create a model's ties to a collection.\n _addReference: function(model, options) {\n this._byId[model.cid] = model;\n var id = this.modelId(model.attributes, model.idAttribute);\n if (id != null) this._byId[id] = model;\n model.on('all', this._onModelEvent, this);\n },\n\n // Internal method to sever a model's ties to a collection.\n _removeReference: function(model, options) {\n delete this._byId[model.cid];\n var id = this.modelId(model.attributes, model.idAttribute);\n if (id != null) delete this._byId[id];\n if (this === model.collection) delete model.collection;\n model.off('all', this._onModelEvent, this);\n },\n\n // Internal method called every time a model in the set fires an event.\n // Sets need to update their indexes when models change ids. All other\n // events simply proxy through. \"add\" and \"remove\" events that originate\n // in other collections are ignored.\n _onModelEvent: function(event, model, collection, options) {\n if (model) {\n if ((event === 'add' || event === 'remove') && collection !== this) return;\n if (event === 'destroy') this.remove(model, options);\n if (event === 'changeId') {\n var prevId = this.modelId(model.previousAttributes(), model.idAttribute);\n var id = this.modelId(model.attributes, model.idAttribute);\n if (prevId != null) delete this._byId[prevId];\n if (id != null) this._byId[id] = model;\n }\n }\n this.trigger.apply(this, arguments);\n }\n\n });\n\n // Defining an @@iterator method implements JavaScript's Iterable protocol.\n // In modern ES2015 browsers, this value is found at Symbol.iterator.\n /* global Symbol */\n var $$iterator = typeof Symbol === 'function' && Symbol.iterator;\n if ($$iterator) {\n Collection.prototype[$$iterator] = Collection.prototype.values;\n }\n\n // CollectionIterator\n // ------------------\n\n // A CollectionIterator implements JavaScript's Iterator protocol, allowing the\n // use of `for of` loops in modern browsers and interoperation between\n // Backbone.Collection and other JavaScript functions and third-party libraries\n // which can operate on Iterables.\n var CollectionIterator = function(collection, kind) {\n this._collection = collection;\n this._kind = kind;\n this._index = 0;\n };\n\n // This \"enum\" defines the three possible kinds of values which can be emitted\n // by a CollectionIterator that correspond to the values(), keys() and entries()\n // methods on Collection, respectively.\n var ITERATOR_VALUES = 1;\n var ITERATOR_KEYS = 2;\n var ITERATOR_KEYSVALUES = 3;\n\n // All Iterators should themselves be Iterable.\n if ($$iterator) {\n CollectionIterator.prototype[$$iterator] = function() {\n return this;\n };\n }\n\n CollectionIterator.prototype.next = function() {\n if (this._collection) {\n\n // Only continue iterating if the iterated collection is long enough.\n if (this._index < this._collection.length) {\n var model = this._collection.at(this._index);\n this._index++;\n\n // Construct a value depending on what kind of values should be iterated.\n var value;\n if (this._kind === ITERATOR_VALUES) {\n value = model;\n } else {\n var id = this._collection.modelId(model.attributes, model.idAttribute);\n if (this._kind === ITERATOR_KEYS) {\n value = id;\n } else { // ITERATOR_KEYSVALUES\n value = [id, model];\n }\n }\n return {value: value, done: false};\n }\n\n // Once exhausted, remove the reference to the collection so future\n // calls to the next method always return done.\n this._collection = void 0;\n }\n\n return {value: void 0, done: true};\n };\n\n // Backbone.View\n // -------------\n\n // Backbone Views are almost more convention than they are actual code. A View\n // is simply a JavaScript object that represents a logical chunk of UI in the\n // DOM. This might be a single item, an entire list, a sidebar or panel, or\n // even the surrounding frame which wraps your whole app. Defining a chunk of\n // UI as a **View** allows you to define your DOM events declaratively, without\n // having to worry about render order ... and makes it easy for the view to\n // react to specific changes in the state of your models.\n\n // Creating a Backbone.View creates its initial element outside of the DOM,\n // if an existing element is not provided...\n var View = Backbone.View = function(options) {\n this.cid = _.uniqueId('view');\n this.preinitialize.apply(this, arguments);\n _.extend(this, _.pick(options, viewOptions));\n this._ensureElement();\n this.initialize.apply(this, arguments);\n };\n\n // Cached regex to split keys for `delegate`.\n var delegateEventSplitter = /^(\\S+)\\s*(.*)$/;\n\n // List of view options to be set as properties.\n var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];\n\n // Set up all inheritable **Backbone.View** properties and methods.\n _.extend(View.prototype, Events, {\n\n // The default `tagName` of a View's element is `\"div\"`.\n tagName: 'div',\n\n // jQuery delegate for element lookup, scoped to DOM elements within the\n // current view. This should be preferred to global lookups where possible.\n $: function(selector) {\n return this.$el.find(selector);\n },\n\n // preinitialize is an empty function by default. You can override it with a function\n // or object. preinitialize will run before any instantiation logic is run in the View\n preinitialize: function(){},\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // **render** is the core function that your view should override, in order\n // to populate its element (`this.el`), with the appropriate HTML. The\n // convention is for **render** to always return `this`.\n render: function() {\n return this;\n },\n\n // Remove this view by taking the element out of the DOM, and removing any\n // applicable Backbone.Events listeners.\n remove: function() {\n this._removeElement();\n this.stopListening();\n return this;\n },\n\n // Remove this view's element from the document and all event listeners\n // attached to it. Exposed for subclasses using an alternative DOM\n // manipulation API.\n _removeElement: function() {\n this.$el.remove();\n },\n\n // Change the view's element (`this.el` property) and re-delegate the\n // view's events on the new element.\n setElement: function(element) {\n this.undelegateEvents();\n this._setElement(element);\n this.delegateEvents();\n return this;\n },\n\n // Creates the `this.el` and `this.$el` references for this view using the\n // given `el`. `el` can be a CSS selector or an HTML string, a jQuery\n // context or an element. Subclasses can override this to utilize an\n // alternative DOM manipulation API and are only required to set the\n // `this.el` property.\n _setElement: function(el) {\n this.$el = el instanceof Backbone.$ ? el : Backbone.$(el);\n this.el = this.$el[0];\n },\n\n // Set callbacks, where `this.events` is a hash of\n //\n // *{\"event selector\": \"callback\"}*\n //\n // {\n // 'mousedown .title': 'edit',\n // 'click .button': 'save',\n // 'click .open': function(e) { ... }\n // }\n //\n // pairs. Callbacks will be bound to the view, with `this` set properly.\n // Uses event delegation for efficiency.\n // Omitting the selector binds the event to `this.el`.\n delegateEvents: function(events) {\n events || (events = _.result(this, 'events'));\n if (!events) return this;\n this.undelegateEvents();\n for (var key in events) {\n var method = events[key];\n if (!_.isFunction(method)) method = this[method];\n if (!method) continue;\n var match = key.match(delegateEventSplitter);\n this.delegate(match[1], match[2], method.bind(this));\n }\n return this;\n },\n\n // Add a single event listener to the view's element (or a child element\n // using `selector`). This only works for delegate-able events: not `focus`,\n // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer.\n delegate: function(eventName, selector, listener) {\n this.$el.on(eventName + '.delegateEvents' + this.cid, selector, listener);\n return this;\n },\n\n // Clears all callbacks previously bound to the view by `delegateEvents`.\n // You usually don't need to use this, but may wish to if you have multiple\n // Backbone views attached to the same DOM element.\n undelegateEvents: function() {\n if (this.$el) this.$el.off('.delegateEvents' + this.cid);\n return this;\n },\n\n // A finer-grained `undelegateEvents` for removing a single delegated event.\n // `selector` and `listener` are both optional.\n undelegate: function(eventName, selector, listener) {\n this.$el.off(eventName + '.delegateEvents' + this.cid, selector, listener);\n return this;\n },\n\n // Produces a DOM element to be assigned to your view. Exposed for\n // subclasses using an alternative DOM manipulation API.\n _createElement: function(tagName) {\n return document.createElement(tagName);\n },\n\n // Ensure that the View has a DOM element to render into.\n // If `this.el` is a string, pass it through `$()`, take the first\n // matching element, and re-assign it to `el`. Otherwise, create\n // an element from the `id`, `className` and `tagName` properties.\n _ensureElement: function() {\n if (!this.el) {\n var attrs = _.extend({}, _.result(this, 'attributes'));\n if (this.id) attrs.id = _.result(this, 'id');\n if (this.className) attrs['class'] = _.result(this, 'className');\n this.setElement(this._createElement(_.result(this, 'tagName')));\n this._setAttributes(attrs);\n } else {\n this.setElement(_.result(this, 'el'));\n }\n },\n\n // Set attributes from a hash on this view's element. Exposed for\n // subclasses using an alternative DOM manipulation API.\n _setAttributes: function(attributes) {\n this.$el.attr(attributes);\n }\n\n });\n\n // Proxy Backbone class methods to Underscore functions, wrapping the model's\n // `attributes` object or collection's `models` array behind the scenes.\n //\n // collection.filter(function(model) { return model.get('age') > 10 });\n // collection.each(this.addView);\n //\n // `Function#apply` can be slow so we use the method's arg count, if we know it.\n var addMethod = function(base, length, method, attribute) {\n switch (length) {\n case 1: return function() {\n return base[method](this[attribute]);\n };\n case 2: return function(value) {\n return base[method](this[attribute], value);\n };\n case 3: return function(iteratee, context) {\n return base[method](this[attribute], cb(iteratee, this), context);\n };\n case 4: return function(iteratee, defaultVal, context) {\n return base[method](this[attribute], cb(iteratee, this), defaultVal, context);\n };\n default: return function() {\n var args = slice.call(arguments);\n args.unshift(this[attribute]);\n return base[method].apply(base, args);\n };\n }\n };\n\n var addUnderscoreMethods = function(Class, base, methods, attribute) {\n _.each(methods, function(length, method) {\n if (base[method]) Class.prototype[method] = addMethod(base, length, method, attribute);\n });\n };\n\n // Support `collection.sortBy('attr')` and `collection.findWhere({id: 1})`.\n var cb = function(iteratee, instance) {\n if (_.isFunction(iteratee)) return iteratee;\n if (_.isObject(iteratee) && !instance._isModel(iteratee)) return modelMatcher(iteratee);\n if (_.isString(iteratee)) return function(model) { return model.get(iteratee); };\n return iteratee;\n };\n var modelMatcher = function(attrs) {\n var matcher = _.matches(attrs);\n return function(model) {\n return matcher(model.attributes);\n };\n };\n\n // Underscore methods that we want to implement on the Collection.\n // 90% of the core usefulness of Backbone Collections is actually implemented\n // right here:\n var collectionMethods = {forEach: 3, each: 3, map: 3, collect: 3, reduce: 0,\n foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3,\n select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3,\n contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3,\n head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3,\n without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3,\n isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3,\n sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3};\n\n\n // Underscore methods that we want to implement on the Model, mapped to the\n // number of arguments they take.\n var modelMethods = {keys: 1, values: 1, pairs: 1, invert: 1, pick: 0,\n omit: 0, chain: 1, isEmpty: 1};\n\n // Mix in each Underscore method as a proxy to `Collection#models`.\n\n _.each([\n [Collection, collectionMethods, 'models'],\n [Model, modelMethods, 'attributes']\n ], function(config) {\n var Base = config[0],\n methods = config[1],\n attribute = config[2];\n\n Base.mixin = function(obj) {\n var mappings = _.reduce(_.functions(obj), function(memo, name) {\n memo[name] = 0;\n return memo;\n }, {});\n addUnderscoreMethods(Base, obj, mappings, attribute);\n };\n\n addUnderscoreMethods(Base, _, methods, attribute);\n });\n\n // Backbone.sync\n // -------------\n\n // Override this function to change the manner in which Backbone persists\n // models to the server. You will be passed the type of request, and the\n // model in question. By default, makes a RESTful Ajax request\n // to the model's `url()`. Some possible customizations could be:\n //\n // * Use `setTimeout` to batch rapid-fire updates into a single request.\n // * Send up the models as XML instead of JSON.\n // * Persist models via WebSockets instead of Ajax.\n //\n // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests\n // as `POST`, with a `_method` parameter containing the true HTTP method,\n // as well as all requests with the body as `application/x-www-form-urlencoded`\n // instead of `application/json` with the model in a param named `model`.\n // Useful when interfacing with server-side languages like **PHP** that make\n // it difficult to read the body of `PUT` requests.\n Backbone.sync = function(method, model, options) {\n var type = methodMap[method];\n\n // Default options, unless specified.\n _.defaults(options || (options = {}), {\n emulateHTTP: Backbone.emulateHTTP,\n emulateJSON: Backbone.emulateJSON\n });\n\n // Default JSON-request options.\n var params = {type: type, dataType: 'json'};\n\n // Ensure that we have a URL.\n if (!options.url) {\n params.url = _.result(model, 'url') || urlError();\n }\n\n // Ensure that we have the appropriate request data.\n if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {\n params.contentType = 'application/json';\n params.data = JSON.stringify(options.attrs || model.toJSON(options));\n }\n\n // For older servers, emulate JSON by encoding the request into an HTML-form.\n if (options.emulateJSON) {\n params.contentType = 'application/x-www-form-urlencoded';\n params.data = params.data ? {model: params.data} : {};\n }\n\n // For older servers, emulate HTTP by mimicking the HTTP method with `_method`\n // And an `X-HTTP-Method-Override` header.\n if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {\n params.type = 'POST';\n if (options.emulateJSON) params.data._method = type;\n var beforeSend = options.beforeSend;\n options.beforeSend = function(xhr) {\n xhr.setRequestHeader('X-HTTP-Method-Override', type);\n if (beforeSend) return beforeSend.apply(this, arguments);\n };\n }\n\n // Don't process data on a non-GET request.\n if (params.type !== 'GET' && !options.emulateJSON) {\n params.processData = false;\n }\n\n // Pass along `textStatus` and `errorThrown` from jQuery.\n var error = options.error;\n options.error = function(xhr, textStatus, errorThrown) {\n options.textStatus = textStatus;\n options.errorThrown = errorThrown;\n if (error) error.call(options.context, xhr, textStatus, errorThrown);\n };\n\n // Make the request, allowing the user to override any Ajax options.\n var xhr = options.xhr = Backbone.ajax(_.extend(params, options));\n model.trigger('request', model, xhr, options);\n return xhr;\n };\n\n // Map from CRUD to HTTP for our default `Backbone.sync` implementation.\n var methodMap = {\n 'create': 'POST',\n 'update': 'PUT',\n 'patch': 'PATCH',\n 'delete': 'DELETE',\n 'read': 'GET'\n };\n\n // Set the default implementation of `Backbone.ajax` to proxy through to `$`.\n // Override this if you'd like to use a different library.\n Backbone.ajax = function() {\n return Backbone.$.ajax.apply(Backbone.$, arguments);\n };\n\n // Backbone.Router\n // ---------------\n\n // Routers map faux-URLs to actions, and fire events when routes are\n // matched. Creating a new one sets its `routes` hash, if not set statically.\n var Router = Backbone.Router = function(options) {\n options || (options = {});\n this.preinitialize.apply(this, arguments);\n if (options.routes) this.routes = options.routes;\n this._bindRoutes();\n this.initialize.apply(this, arguments);\n };\n\n // Cached regular expressions for matching named param parts and splatted\n // parts of route strings.\n var optionalParam = /\\((.*?)\\)/g;\n var namedParam = /(\\(\\?)?:\\w+/g;\n var splatParam = /\\*\\w+/g;\n var escapeRegExp = /[\\-{}\\[\\]+?.,\\\\\\^$|#\\s]/g;\n\n // Set up all inheritable **Backbone.Router** properties and methods.\n _.extend(Router.prototype, Events, {\n\n // preinitialize is an empty function by default. You can override it with a function\n // or object. preinitialize will run before any instantiation logic is run in the Router.\n preinitialize: function(){},\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // Manually bind a single named route to a callback. For example:\n //\n // this.route('search/:query/p:num', 'search', function(query, num) {\n // ...\n // });\n //\n route: function(route, name, callback) {\n if (!_.isRegExp(route)) route = this._routeToRegExp(route);\n if (_.isFunction(name)) {\n callback = name;\n name = '';\n }\n if (!callback) callback = this[name];\n var router = this;\n Backbone.history.route(route, function(fragment) {\n var args = router._extractParameters(route, fragment);\n if (router.execute(callback, args, name) !== false) {\n router.trigger.apply(router, ['route:' + name].concat(args));\n router.trigger('route', name, args);\n Backbone.history.trigger('route', router, name, args);\n }\n });\n return this;\n },\n\n // Execute a route handler with the provided parameters. This is an\n // excellent place to do pre-route setup or post-route cleanup.\n execute: function(callback, args, name) {\n if (callback) callback.apply(this, args);\n },\n\n // Simple proxy to `Backbone.history` to save a fragment into the history.\n navigate: function(fragment, options) {\n Backbone.history.navigate(fragment, options);\n return this;\n },\n\n // Bind all defined routes to `Backbone.history`. We have to reverse the\n // order of the routes here to support behavior where the most general\n // routes can be defined at the bottom of the route map.\n _bindRoutes: function() {\n if (!this.routes) return;\n this.routes = _.result(this, 'routes');\n var route, routes = _.keys(this.routes);\n while ((route = routes.pop()) != null) {\n this.route(route, this.routes[route]);\n }\n },\n\n // Convert a route string into a regular expression, suitable for matching\n // against the current location hash.\n _routeToRegExp: function(route) {\n route = route.replace(escapeRegExp, '\\\\$&')\n .replace(optionalParam, '(?:$1)?')\n .replace(namedParam, function(match, optional) {\n return optional ? match : '([^/?]+)';\n })\n .replace(splatParam, '([^?]*?)');\n return new RegExp('^' + route + '(?:\\\\?([\\\\s\\\\S]*))?$');\n },\n\n // Given a route, and a URL fragment that it matches, return the array of\n // extracted decoded parameters. Empty or unmatched parameters will be\n // treated as `null` to normalize cross-browser behavior.\n _extractParameters: function(route, fragment) {\n var params = route.exec(fragment).slice(1);\n return _.map(params, function(param, i) {\n // Don't decode the search params.\n if (i === params.length - 1) return param || null;\n return param ? decodeURIComponent(param) : null;\n });\n }\n\n });\n\n // Backbone.History\n // ----------------\n\n // Handles cross-browser history management, based on either\n // [pushState](http://diveintohtml5.info/history.html) and real URLs, or\n // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)\n // and URL fragments. If the browser supports neither (old IE, natch),\n // falls back to polling.\n var History = Backbone.History = function() {\n this.handlers = [];\n this.checkUrl = this.checkUrl.bind(this);\n\n // Ensure that `History` can be used outside of the browser.\n if (typeof window !== 'undefined') {\n this.location = window.location;\n this.history = window.history;\n }\n };\n\n // Cached regex for stripping a leading hash/slash and trailing space.\n var routeStripper = /^[#\\/]|\\s+$/g;\n\n // Cached regex for stripping leading and trailing slashes.\n var rootStripper = /^\\/+|\\/+$/g;\n\n // Cached regex for stripping urls of hash.\n var pathStripper = /#.*$/;\n\n // Has the history handling already been started?\n History.started = false;\n\n // Set up all inheritable **Backbone.History** properties and methods.\n _.extend(History.prototype, Events, {\n\n // The default interval to poll for hash changes, if necessary, is\n // twenty times a second.\n interval: 50,\n\n // Are we at the app root?\n atRoot: function() {\n var path = this.location.pathname.replace(/[^\\/]$/, '$&/');\n return path === this.root && !this.getSearch();\n },\n\n // Does the pathname match the root?\n matchRoot: function() {\n var path = this.decodeFragment(this.location.pathname);\n var rootPath = path.slice(0, this.root.length - 1) + '/';\n return rootPath === this.root;\n },\n\n // Unicode characters in `location.pathname` are percent encoded so they're\n // decoded for comparison. `%25` should not be decoded since it may be part\n // of an encoded parameter.\n decodeFragment: function(fragment) {\n return decodeURI(fragment.replace(/%25/g, '%2525'));\n },\n\n // In IE6, the hash fragment and search params are incorrect if the\n // fragment contains `?`.\n getSearch: function() {\n var match = this.location.href.replace(/#.*/, '').match(/\\?.+/);\n return match ? match[0] : '';\n },\n\n // Gets the true hash value. Cannot use location.hash directly due to bug\n // in Firefox where location.hash will always be decoded.\n getHash: function(window) {\n var match = (window || this).location.href.match(/#(.*)$/);\n return match ? match[1] : '';\n },\n\n // Get the pathname and search params, without the root.\n getPath: function() {\n var path = this.decodeFragment(\n this.location.pathname + this.getSearch()\n ).slice(this.root.length - 1);\n return path.charAt(0) === '/' ? path.slice(1) : path;\n },\n\n // Get the cross-browser normalized URL fragment from the path or hash.\n getFragment: function(fragment) {\n if (fragment == null) {\n if (this._usePushState || !this._wantsHashChange) {\n fragment = this.getPath();\n } else {\n fragment = this.getHash();\n }\n }\n return fragment.replace(routeStripper, '');\n },\n\n // Start the hash change handling, returning `true` if the current URL matches\n // an existing route, and `false` otherwise.\n start: function(options) {\n if (History.started) throw new Error('Backbone.history has already been started');\n History.started = true;\n\n // Figure out the initial configuration. Do we need an iframe?\n // Is pushState desired ... is it available?\n this.options = _.extend({root: '/'}, this.options, options);\n this.root = this.options.root;\n this._wantsHashChange = this.options.hashChange !== false;\n this._hasHashChange = 'onhashchange' in window && (document.documentMode === void 0 || document.documentMode > 7);\n this._useHashChange = this._wantsHashChange && this._hasHashChange;\n this._wantsPushState = !!this.options.pushState;\n this._hasPushState = !!(this.history && this.history.pushState);\n this._usePushState = this._wantsPushState && this._hasPushState;\n this.fragment = this.getFragment();\n\n // Normalize root to always include a leading and trailing slash.\n this.root = ('/' + this.root + '/').replace(rootStripper, '/');\n\n // Transition from hashChange to pushState or vice versa if both are\n // requested.\n if (this._wantsHashChange && this._wantsPushState) {\n\n // If we've started off with a route from a `pushState`-enabled\n // browser, but we're currently in a browser that doesn't support it...\n if (!this._hasPushState && !this.atRoot()) {\n var rootPath = this.root.slice(0, -1) || '/';\n this.location.replace(rootPath + '#' + this.getPath());\n // Return immediately as browser will do redirect to new url\n return true;\n\n // Or if we've started out with a hash-based route, but we're currently\n // in a browser where it could be `pushState`-based instead...\n } else if (this._hasPushState && this.atRoot()) {\n this.navigate(this.getHash(), {replace: true});\n }\n\n }\n\n // Proxy an iframe to handle location events if the browser doesn't\n // support the `hashchange` event, HTML5 history, or the user wants\n // `hashChange` but not `pushState`.\n if (!this._hasHashChange && this._wantsHashChange && !this._usePushState) {\n this.iframe = document.createElement('iframe');\n this.iframe.src = 'javascript:0';\n this.iframe.style.display = 'none';\n this.iframe.tabIndex = -1;\n var body = document.body;\n // Using `appendChild` will throw on IE < 9 if the document is not ready.\n var iWindow = body.insertBefore(this.iframe, body.firstChild).contentWindow;\n iWindow.document.open();\n iWindow.document.close();\n iWindow.location.hash = '#' + this.fragment;\n }\n\n // Add a cross-platform `addEventListener` shim for older browsers.\n var addEventListener = window.addEventListener || function(eventName, listener) {\n return attachEvent('on' + eventName, listener);\n };\n\n // Depending on whether we're using pushState or hashes, and whether\n // 'onhashchange' is supported, determine how we check the URL state.\n if (this._usePushState) {\n addEventListener('popstate', this.checkUrl, false);\n } else if (this._useHashChange && !this.iframe) {\n addEventListener('hashchange', this.checkUrl, false);\n } else if (this._wantsHashChange) {\n this._checkUrlInterval = setInterval(this.checkUrl, this.interval);\n }\n\n if (!this.options.silent) return this.loadUrl();\n },\n\n // Disable Backbone.history, perhaps temporarily. Not useful in a real app,\n // but possibly useful for unit testing Routers.\n stop: function() {\n // Add a cross-platform `removeEventListener` shim for older browsers.\n var removeEventListener = window.removeEventListener || function(eventName, listener) {\n return detachEvent('on' + eventName, listener);\n };\n\n // Remove window listeners.\n if (this._usePushState) {\n removeEventListener('popstate', this.checkUrl, false);\n } else if (this._useHashChange && !this.iframe) {\n removeEventListener('hashchange', this.checkUrl, false);\n }\n\n // Clean up the iframe if necessary.\n if (this.iframe) {\n document.body.removeChild(this.iframe);\n this.iframe = null;\n }\n\n // Some environments will throw when clearing an undefined interval.\n if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);\n History.started = false;\n },\n\n // Add a route to be tested when the fragment changes. Routes added later\n // may override previous routes.\n route: function(route, callback) {\n this.handlers.unshift({route: route, callback: callback});\n },\n\n // Checks the current URL to see if it has changed, and if it has,\n // calls `loadUrl`, normalizing across the hidden iframe.\n checkUrl: function(e) {\n var current = this.getFragment();\n\n // If the user pressed the back button, the iframe's hash will have\n // changed and we should use that for comparison.\n if (current === this.fragment && this.iframe) {\n current = this.getHash(this.iframe.contentWindow);\n }\n\n if (current === this.fragment) return false;\n if (this.iframe) this.navigate(current);\n this.loadUrl();\n },\n\n // Attempt to load the current URL fragment. If a route succeeds with a\n // match, returns `true`. If no defined routes matches the fragment,\n // returns `false`.\n loadUrl: function(fragment) {\n // If the root doesn't match, no routes can match either.\n if (!this.matchRoot()) return false;\n fragment = this.fragment = this.getFragment(fragment);\n return _.some(this.handlers, function(handler) {\n if (handler.route.test(fragment)) {\n handler.callback(fragment);\n return true;\n }\n });\n },\n\n // Save a fragment into the hash history, or replace the URL state if the\n // 'replace' option is passed. You are responsible for properly URL-encoding\n // the fragment in advance.\n //\n // The options object can contain `trigger: true` if you wish to have the\n // route callback be fired (not usually desirable), or `replace: true`, if\n // you wish to modify the current URL without adding an entry to the history.\n navigate: function(fragment, options) {\n if (!History.started) return false;\n if (!options || options === true) options = {trigger: !!options};\n\n // Normalize the fragment.\n fragment = this.getFragment(fragment || '');\n\n // Don't include a trailing slash on the root.\n var rootPath = this.root;\n if (fragment === '' || fragment.charAt(0) === '?') {\n rootPath = rootPath.slice(0, -1) || '/';\n }\n var url = rootPath + fragment;\n\n // Strip the fragment of the query and hash for matching.\n fragment = fragment.replace(pathStripper, '');\n\n // Decode for matching.\n var decodedFragment = this.decodeFragment(fragment);\n\n if (this.fragment === decodedFragment) return;\n this.fragment = decodedFragment;\n\n // If pushState is available, we use it to set the fragment as a real URL.\n if (this._usePushState) {\n this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);\n\n // If hash changes haven't been explicitly disabled, update the hash\n // fragment to store history.\n } else if (this._wantsHashChange) {\n this._updateHash(this.location, fragment, options.replace);\n if (this.iframe && fragment !== this.getHash(this.iframe.contentWindow)) {\n var iWindow = this.iframe.contentWindow;\n\n // Opening and closing the iframe tricks IE7 and earlier to push a\n // history entry on hash-tag change. When replace is true, we don't\n // want this.\n if (!options.replace) {\n iWindow.document.open();\n iWindow.document.close();\n }\n\n this._updateHash(iWindow.location, fragment, options.replace);\n }\n\n // If you've told us that you explicitly don't want fallback hashchange-\n // based history, then `navigate` becomes a page refresh.\n } else {\n return this.location.assign(url);\n }\n if (options.trigger) return this.loadUrl(fragment);\n },\n\n // Update the hash location, either replacing the current entry, or adding\n // a new one to the browser history.\n _updateHash: function(location, fragment, replace) {\n if (replace) {\n var href = location.href.replace(/(javascript:|#).*$/, '');\n location.replace(href + '#' + fragment);\n } else {\n // Some browsers require that `hash` contains a leading #.\n location.hash = '#' + fragment;\n }\n }\n\n });\n\n // Create the default Backbone.history.\n Backbone.history = new History;\n\n // Helpers\n // -------\n\n // Helper function to correctly set up the prototype chain for subclasses.\n // Similar to `goog.inherits`, but uses a hash of prototype properties and\n // class properties to be extended.\n var extend = function(protoProps, staticProps) {\n var parent = this;\n var child;\n\n // The constructor function for the new subclass is either defined by you\n // (the \"constructor\" property in your `extend` definition), or defaulted\n // by us to simply call the parent constructor.\n if (protoProps && _.has(protoProps, 'constructor')) {\n child = protoProps.constructor;\n } else {\n child = function(){ return parent.apply(this, arguments); };\n }\n\n // Add static properties to the constructor function, if supplied.\n _.extend(child, parent, staticProps);\n\n // Set the prototype chain to inherit from `parent`, without calling\n // `parent`'s constructor function and add the prototype properties.\n child.prototype = _.create(parent.prototype, protoProps);\n child.prototype.constructor = child;\n\n // Set a convenience property in case the parent's prototype is needed\n // later.\n child.__super__ = parent.prototype;\n\n return child;\n };\n\n // Set up inheritance for the model, collection, router, view and history.\n Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;\n\n // Throw an error when a URL is needed, and none is supplied.\n var urlError = function() {\n throw new Error('A \"url\" property or function must be specified');\n };\n\n // Wrap an optional error callback with a fallback error event.\n var wrapError = function(model, options) {\n var error = options.error;\n options.error = function(resp) {\n if (error) error.call(options.context, model, resp, options);\n model.trigger('error', model, resp, options);\n };\n };\n\n return Backbone;\n});\n","(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"codemirror/lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"codemirror/lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\n CodeMirror.extendMode(\"css\", {\n commentStart: \"/*\",\n commentEnd: \"*/\",\n newlineAfterToken: function(_type, content) {\n return /^[;{}]$/.test(content);\n }\n });\n\n CodeMirror.extendMode(\"javascript\", {\n commentStart: \"/*\",\n commentEnd: \"*/\",\n // FIXME semicolons inside of for\n newlineAfterToken: function(_type, content, textAfter, state) {\n if (this.jsonMode) {\n return /^[\\[,{]$/.test(content) || /^}/.test(textAfter);\n } else {\n if (content == \";\" && state.lexical && state.lexical.type == \")\") return false;\n return /^[;{}]$/.test(content) && !/^;/.test(textAfter);\n }\n }\n });\n\n var inlineElements = /^(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)$/;\n\n CodeMirror.extendMode(\"xml\", {\n commentStart: \"\",\n newlineAfterToken: function(type, content, textAfter, state) {\n var inline = false;\n if (this.configuration == \"html\")\n inline = state.context ? inlineElements.test(state.context.tagName) : false;\n return !inline && ((type == \"tag\" && />$/.test(content) && state.context) ||\n /^ -1 && endIndex > -1 && endIndex > startIndex) {\n // Take string till comment start\n selText = selText.substr(0, startIndex) +\n // From comment start till comment end\n selText.substring(startIndex + curMode.commentStart.length, endIndex) +\n // From comment end till string end\n selText.substr(endIndex + curMode.commentEnd.length);\n }\n cm.replaceRange(selText, from, to);\n }\n });\n });\n\n // Applies automatic mode-aware indentation to the specified range\n CodeMirror.defineExtension(\"autoIndentRange\", function (from, to) {\n var cmInstance = this;\n this.operation(function () {\n for (var i = from.line; i <= to.line; i++) {\n cmInstance.indentLine(i, \"smart\");\n }\n });\n });\n\n // Applies automatic formatting to the specified range\n CodeMirror.defineExtension(\"autoFormatRange\", function (from, to) {\n var cm = this;\n var outer = cm.getMode(), text = cm.getRange(from, to).split(\"\\n\");\n var state = CodeMirror.copyState(outer, cm.getTokenAt(from).state);\n var tabSize = cm.getOption(\"tabSize\");\n\n var out = \"\", lines = 0, atSol = from.ch === 0;\n function newline() {\n out += \"\\n\";\n atSol = true;\n ++lines;\n }\n\n for (var i = 0; i < text.length; ++i) {\n var stream = new CodeMirror.StringStream(text[i], tabSize);\n while (!stream.eol()) {\n var inner = CodeMirror.innerMode(outer, state);\n var style = outer.token(stream, state), cur = stream.current();\n stream.start = stream.pos;\n if (!atSol || /\\S/.test(cur)) {\n out += cur;\n atSol = false;\n }\n if (!atSol && inner.mode.newlineAfterToken &&\n inner.mode.newlineAfterToken(style, cur, stream.string.slice(stream.pos) || text[i+1] || \"\", inner.state))\n newline();\n }\n if (!stream.pos && outer.blankLine) outer.blankLine(state);\n if (!atSol && i < text.length - 1) newline();\n }\n\n cm.operation(function () {\n cm.replaceRange(out, from, to);\n for (var cur = from.line + 1, end = from.line + lines; cur <= end; ++cur)\n cm.indentLine(cur, \"smart\");\n cm.setSelection(from, cm.getCursor(false));\n });\n });\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// This is CodeMirror (https://codemirror.net/5), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\/(\\d+)/.exec(userAgent);\n var chrome_version = chrome && +chrome[1];\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = safari && (/Mobile\\/\\w+/.test(userAgent) || navigator.maxTouchPoints > 2);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt(doc) {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = doc.activeElement;\n } catch(e) {\n activeElement = doc.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function doc(cm) { return cm.display.wrapper.ownerDocument }\n\n function win(cm) { return doc(cm).defaultView }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {\n this.id = null;\n this.f = null;\n this.time = 0;\n this.handler = bind(this.onTimeout, this);\n };\n Delayed.prototype.onTimeout = function (self) {\n self.id = 0;\n if (self.time <= +new Date) {\n self.f();\n } else {\n setTimeout(self.handler, self.time - +new Date);\n }\n };\n Delayed.prototype.set = function (ms, f) {\n this.f = f;\n var time = +new Date + ms;\n if (!this.id || time < this.time) {\n clearTimeout(this.id);\n this.id = setTimeout(this.handler, ms);\n this.time = time;\n }\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 50;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length, isRTL = direction == \"rtl\" ? 1 : 0;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n at += isRTL;\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers || (emitter._handlers = {});\n map[type] = (map[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers, arr = map && map[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range;\n try {range = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\\\s)\" + lineClass[2] + \"(?:$|\\\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n\n // Add a span to a line.\n function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n gutterWrap.setAttribute(\"aria-hidden\", \"true\");\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) {\n var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n var isWidget = classTest(\"CodeMirror-linewidget\");\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (isWidget.test(node.className)) { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\" + (widget.className ? \" \" + widget.className : \"\"));\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\", \"CodeMirror-line-like\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n if (lineView.rest) {\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i];\n mEnd = map[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX(doc) {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(doc.body.getBoundingClientRect().left - parseInt(getComputedStyle(doc.body).marginLeft)) }\n return doc.defaultView.pageXOffset || (doc.documentElement || doc.body).scrollLeft\n }\n function pageScrollY(doc) {\n if (chrome && android) { return -(doc.body.getBoundingClientRect().top - parseInt(getComputedStyle(doc.body).marginTop)) }\n return doc.defaultView.pageYOffset || (doc.documentElement || doc.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var ref = visualLine(lineObj);\n var widgets = ref.widgets;\n var height = 0;\n if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above)\n { height += widgetHeight(widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY(doc(cm)));\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX(doc(cm)));\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX(doc(cm));\n top -= pageScrollY(doc(cm));\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = outside; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight; box.bottom += widgetHeight;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n var customCursor = cm.options.$customCursor;\n if (customCursor) { primary = true; }\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i];\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty();\n if (customCursor) {\n var head = customCursor(cm, range);\n if (head) { drawSelectionCursor(cm, head, curFragment); }\n } else if (collapsed || cm.options.showCursorWhenSelecting) {\n drawSelectionCursor(cm, range.head, curFragment);\n }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n var charPos = charCoords(cm, head, \"div\", null, null);\n var width = charPos.right - charPos.left;\n cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n }\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () {\n if (!cm.hasFocus()) { onBlur(cm); }\n display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\";\n }, cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.hasFocus()) {\n cm.display.input.focus();\n if (!cm.state.focused) { onFocus(cm); }\n }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n if (cm.state.focused) { onBlur(cm); }\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n var oldHeight = display.lineDiv.getBoundingClientRect().top;\n var mustScroll = 0;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n oldHeight += cur.line.height;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n if (oldHeight < viewTop) { mustScroll -= diff; }\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n var doc = display.wrapper.ownerDocument;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.scrollTop = 0;\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.visibility = this.vert.style.visibility = \"hidden\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.visibility = \"\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt != bar) { bar.style.visibility = \"hidden\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId, // Unique ID\n markArrays: null // Used by addMarkedSpan\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt(doc(cm));\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt(doc(cm));\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = win(cm).getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(snapshot.activeElt.ownerDocument)) { return }\n snapshot.activeElt.focus();\n if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&\n snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var doc = snapshot.activeElt.ownerDocument;\n var sel = doc.defaultView.getSelection(), range = doc.createRange();\n range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n } else if (first) {\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(display) {\n var width = display.gutters.offsetWidth;\n display.sizer.style.marginLeft = width + \"px\";\n // Send an event to consumers responding to changes in gutter width.\n signalLater(display, \"gutterChanged\", display);\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }\n\n function getGutters(gutters, lineNumbers) {\n var result = [], sawLineNumbers = false;\n for (var i = 0; i < gutters.length; i++) {\n var name = gutters[i], style = null;\n if (typeof name != \"string\") { style = name.style; name = name.className; }\n if (name == \"CodeMirror-linenumbers\") {\n if (!lineNumbers) { continue }\n else { sawLineNumbers = true; }\n }\n result.push({className: name, style: style});\n }\n if (lineNumbers && !sawLineNumbers) { result.push({className: \"CodeMirror-linenumbers\", style: null}); }\n return result\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }\n\n function updateGutters(cm) {\n renderGutters(cm.display);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input, options) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n // See #6982. FIXME remove when this has been fixed for a while in Chrome\n if (chrome && chrome_version >= 105) { d.wrapper.style.clipPath = \"inset(0px)\"; }\n\n // This attribute is respected by automatic translation systems such as Google Translate,\n // and may also be respected by tools used by human translators.\n d.wrapper.setAttribute('translate', 'no');\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n d.gutterSpecs = getGutters(options.gutters, options.lineNumbers);\n renderGutters(d);\n\n input.init(d);\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n // On Chrome 102, viewport updates somehow stop wheel-based\n // scrolling. Turning off pointer events during the scroll seems\n // to avoid the issue.\n if (chrome && chrome_version == 102) {\n if (cm.display.chromeScrollHack == null) { cm.display.sizer.style.pointerEvents = \"none\"; }\n else { clearTimeout(cm.display.chromeScrollHack); }\n cm.display.chromeScrollHack = setTimeout(function () {\n cm.display.chromeScrollHack = null;\n cm.display.sizer.style.pointerEvents = \"\";\n }, 100);\n }\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n var pixelsPerUnit = wheelPixelsPerUnit;\n if (e.deltaMode === 0) {\n dx = e.deltaX;\n dy = e.deltaY;\n pixelsPerUnit = 1;\n }\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && pixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && pixelsPerUnit != null) {\n var pixels = dy * pixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20 && e.deltaMode !== 0) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n cm.options.direction = doc.direction;\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(prev) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = prev ? prev.undoDepth : Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption(\"readOnly\") != \"nocursor\")\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = range.head == range.anchor ? newAnchor : skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n\n // Determine if we should prevent the cursor being placed to the left/right of an atomic marker\n // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it\n // is with selectLeft/Right\n var preventCursorLeft = (\"selectLeft\" in m) ? !m.selectLeft : m.inclusiveLeft;\n var preventCursorRight = (\"selectRight\" in m) ? !m.selectRight : m.inclusiveRight;\n\n if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? preventCursorRight : preventCursorLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? preventCursorLeft : preventCursorRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n\n if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0)))\n { doc.cantEdit = false; }\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this.lines[i];\n this.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n for (var e = at + n; at < e; ++at)\n { if (op(this.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this.height -= oldHeight - child.height;\n if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this.children.splice(++i, 0, leaf);\n leaf.parent = this;\n }\n child.lines = child.lines.slice(0, remaining);\n this.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n if (lineSep === '') { return lines.join('') }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range.head; }\n else if (start == \"anchor\") { pos = range.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range.to(); }\n else { pos = range.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this, ranges[i].anchor),\n clipPos(this, ranges[i].head || ranges[i].anchor)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {\n var this$1 = this;\n\n this.history = new History(this.history);\n linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true);\n },\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo;\n });\n return clipPos(this, Pos(lineNo, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this.linked[i];\n if (link.doc != other) { continue }\n this.linked.splice(i, 1);\n other.unlinkDoc(this);\n detachSharedMarkers(findSharedMarkers(this));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var markAsReadAndPasteIfAllFilesAreRead = function () {\n if (++read == n) {\n operation(cm, function () {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(\n text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));\n })();\n }\n };\n var readTextFromFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n var reader = new FileReader;\n reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); };\n reader.onload = function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n text[i] = content;\n markAsReadAndPasteIfAllFilesAreRead();\n };\n reader.readAsText(file);\n };\n for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e$1){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 224: \"Mod\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\", \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\",\n \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\",\n \"Ctrl-T\": \"transposeChars\", \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map, handle, context) {\n map = getKeyMap(map);\n var found = map.call ? map.call(key, context) : map[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map.fallthrough, handle, context) }\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Mod\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n if (cm.doc.direction == \"rtl\") { dir = -dir; }\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"codepoint\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(start.ch, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n cm.curOp.focus = activeElt(doc(cm));\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand)\n { document.execCommand(\"cut\"); }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n win(cm).focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(doc(cm)); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n if (cm.state.delayingBlurEvent) {\n if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }\n else { delayBlurEvent(cm); }\n }\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if ((webkit && !safari) || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { return display.input.focus(); }, 20);\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n if (ie) { delayBlurEvent(cm); }\n var display = cm.display, doc$1 = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc$1.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc$1.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc$1.sel.primary();\n ourIndex = doc$1.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); }\n else\n { ourRange = range; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc$1, new Selection([ourRange], 0), sel_mouse);\n startSel = doc$1.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc$1, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc$1, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc$1.sel;\n } else {\n replaceOneSelection(doc$1, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc$1, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc$1, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc$1, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc$1, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc$1, anchor), head));\n setSelection(doc$1, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt(doc(cm));\n extendTo(cur);\n var visible = visibleLines(display, doc$1);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n // If e is null or undefined we interpret this as someone trying\n // to explicitly cancel the selection rather than the user\n // letting go of the mouse button.\n if (e) {\n e_preventDefault(e);\n display.input.focus();\n }\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc$1.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e$1) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.display.gutterSpecs.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.display.gutterSpecs[i];\n signal(cm, type, cm, line, gutter.className, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b\\u200e\\u200f\\u2028\\u2029\\u202d\\u202e\\u2066\\u2067\\u2069\\ufeff\\ufff9-\\ufffc]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n updateGutters(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm, val) {\n cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers);\n updateGutters(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm, val) {\n cm.display.gutterSpecs = getGutters(cm.options.gutters, val);\n updateGutters(cm);\n }, true);\n option(\"firstLineNumber\", 1, updateGutters, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, updateGutters, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n\n option(\"screenReaderLabel\", null, function (cm, val) {\n val = (val === '') ? null : val;\n cm.display.input.screenReaderLabelChanged(val);\n });\n\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input, options);\n display.wrapper.CodeMirror = this;\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(function () {\n if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); }\n }, 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range = sel.ranges[i$1];\n var from = range.from(), to = range.to();\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == textLines.join(\"\\n\"))\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput && cm.hasFocus())\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i];\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }\n var mode = cm.getModeAt(range.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n { indented = indentLine(cm, range.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", autocorrect ? \"on\" : \"off\");\n field.setAttribute(\"autocapitalize\", autocapitalize ? \"on\" : \"off\");\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){win(this).focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt(doc(this)) },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"codepoint\", \"char\", \"column\" (like char, but\n // doesn't cross line boundaries), \"word\" (across next word), or\n // \"group\" (to the start of next group of word or\n // non-word-non-whitespace chars). The visually param controls\n // whether, in right-to-left text, direction 1 means to move towards\n // the next index in the string, or towards the character to the right\n // of the current position. The resulting position will have a\n // hitSide=true property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n var lineDir = visually && doc.direction == \"rtl\" ? -dir : dir;\n function findNextLine() {\n var l = pos.line + lineDir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (unit == \"codepoint\") {\n var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));\n if (isNaN(ch)) {\n next = null;\n } else {\n var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;\n next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);\n }\n } else if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\" || unit == \"codepoint\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, win(cm).innerHeight || doc(cm).documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n div.contentEditable = true;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n function belongsToInput(e) {\n for (var t = e.target; t; t = t.parentNode) {\n if (t == div) { return true }\n if (/\\bCodeMirror-(?:line)?widget\\b/.test(t.className)) { break }\n }\n return false\n }\n\n on(div, \"paste\", function (e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n disableBrowserMagic(te);\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = activeElt(div.ownerDocument);\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.div.setAttribute('aria-label', label);\n } else {\n this.div.removeAttribute('aria-label');\n }\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = activeElt(this.div.ownerDocument) == this.div;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor() || activeElt(this.div.ownerDocument) != this.div)\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var this$1 = this;\n\n var input = this;\n if (this.selectionInEditor())\n { setTimeout(function () { return this$1.pollSelection(); }, 20); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range = found[0].find(0)))\n { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n this.resetting = false;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n var opts = this.cm.options;\n disableBrowserMagic(this.textarea, opts.spellcheck, opts.autocorrect, opts.autocapitalize);\n };\n\n TextareaInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.textarea.setAttribute('aria-label', label);\n } else {\n this.textarea.removeAttribute('aria-label');\n }\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing && typing) { return }\n var cm = this.cm;\n this.resetting = true;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n this.resetting = false;\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt(this.textarea.ownerDocument) != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || this.resetting || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = te.ownerDocument.defaultView.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { te.ownerDocument.defaultView.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n this.textarea.readOnly = !!val;\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt(textarea.ownerDocument);\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.65.15\";\n\n return CodeMirror;\n\n})));\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"css\", function(config, parserConfig) {\n var inline = parserConfig.inline\n if (!parserConfig.propertyKeywords) parserConfig = CodeMirror.resolveMode(\"text/css\");\n\n var indentUnit = config.indentUnit,\n tokenHooks = parserConfig.tokenHooks,\n documentTypes = parserConfig.documentTypes || {},\n mediaTypes = parserConfig.mediaTypes || {},\n mediaFeatures = parserConfig.mediaFeatures || {},\n mediaValueKeywords = parserConfig.mediaValueKeywords || {},\n propertyKeywords = parserConfig.propertyKeywords || {},\n nonStandardPropertyKeywords = parserConfig.nonStandardPropertyKeywords || {},\n fontProperties = parserConfig.fontProperties || {},\n counterDescriptors = parserConfig.counterDescriptors || {},\n colorKeywords = parserConfig.colorKeywords || {},\n valueKeywords = parserConfig.valueKeywords || {},\n allowNested = parserConfig.allowNested,\n lineComment = parserConfig.lineComment,\n supportsAtComponent = parserConfig.supportsAtComponent === true,\n highlightNonStandardPropertyKeywords = config.highlightNonStandardPropertyKeywords !== false;\n\n var type, override;\n function ret(style, tp) { type = tp; return style; }\n\n // Tokenizers\n\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (tokenHooks[ch]) {\n var result = tokenHooks[ch](stream, state);\n if (result !== false) return result;\n }\n if (ch == \"@\") {\n stream.eatWhile(/[\\w\\\\\\-]/);\n return ret(\"def\", stream.current());\n } else if (ch == \"=\" || (ch == \"~\" || ch == \"|\") && stream.eat(\"=\")) {\n return ret(null, \"compare\");\n } else if (ch == \"\\\"\" || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \"#\") {\n stream.eatWhile(/[\\w\\\\\\-]/);\n return ret(\"atom\", \"hash\");\n } else if (ch == \"!\") {\n stream.match(/^\\s*\\w*/);\n return ret(\"keyword\", \"important\");\n } else if (/\\d/.test(ch) || ch == \".\" && stream.eat(/\\d/)) {\n stream.eatWhile(/[\\w.%]/);\n return ret(\"number\", \"unit\");\n } else if (ch === \"-\") {\n if (/[\\d.]/.test(stream.peek())) {\n stream.eatWhile(/[\\w.%]/);\n return ret(\"number\", \"unit\");\n } else if (stream.match(/^-[\\w\\\\\\-]*/)) {\n stream.eatWhile(/[\\w\\\\\\-]/);\n if (stream.match(/^\\s*:/, false))\n return ret(\"variable-2\", \"variable-definition\");\n return ret(\"variable-2\", \"variable\");\n } else if (stream.match(/^\\w+-/)) {\n return ret(\"meta\", \"meta\");\n }\n } else if (/[,+>*\\/]/.test(ch)) {\n return ret(null, \"select-op\");\n } else if (ch == \".\" && stream.match(/^-?[_a-z][_a-z0-9-]*/i)) {\n return ret(\"qualifier\", \"qualifier\");\n } else if (/[:;{}\\[\\]\\(\\)]/.test(ch)) {\n return ret(null, ch);\n } else if (stream.match(/^[\\w-.]+(?=\\()/)) {\n if (/^(url(-prefix)?|domain|regexp)$/i.test(stream.current())) {\n state.tokenize = tokenParenthesized;\n }\n return ret(\"variable callee\", \"variable\");\n } else if (/[\\w\\\\\\-]/.test(ch)) {\n stream.eatWhile(/[\\w\\\\\\-]/);\n return ret(\"property\", \"word\");\n } else {\n return ret(null, null);\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, ch;\n while ((ch = stream.next()) != null) {\n if (ch == quote && !escaped) {\n if (quote == \")\") stream.backUp(1);\n break;\n }\n escaped = !escaped && ch == \"\\\\\";\n }\n if (ch == quote || !escaped && quote != \")\") state.tokenize = null;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenParenthesized(stream, state) {\n stream.next(); // Must be '('\n if (!stream.match(/^\\s*[\\\"\\')]/, false))\n state.tokenize = tokenString(\")\");\n else\n state.tokenize = null;\n return ret(null, \"(\");\n }\n\n // Context management\n\n function Context(type, indent, prev) {\n this.type = type;\n this.indent = indent;\n this.prev = prev;\n }\n\n function pushContext(state, stream, type, indent) {\n state.context = new Context(type, stream.indentation() + (indent === false ? 0 : indentUnit), state.context);\n return type;\n }\n\n function popContext(state) {\n if (state.context.prev)\n state.context = state.context.prev;\n return state.context.type;\n }\n\n function pass(type, stream, state) {\n return states[state.context.type](type, stream, state);\n }\n function popAndPass(type, stream, state, n) {\n for (var i = n || 1; i > 0; i--)\n state.context = state.context.prev;\n return pass(type, stream, state);\n }\n\n // Parser\n\n function wordAsValue(stream) {\n var word = stream.current().toLowerCase();\n if (valueKeywords.hasOwnProperty(word))\n override = \"atom\";\n else if (colorKeywords.hasOwnProperty(word))\n override = \"keyword\";\n else\n override = \"variable\";\n }\n\n var states = {};\n\n states.top = function(type, stream, state) {\n if (type == \"{\") {\n return pushContext(state, stream, \"block\");\n } else if (type == \"}\" && state.context.prev) {\n return popContext(state);\n } else if (supportsAtComponent && /@component/i.test(type)) {\n return pushContext(state, stream, \"atComponentBlock\");\n } else if (/^@(-moz-)?document$/i.test(type)) {\n return pushContext(state, stream, \"documentTypes\");\n } else if (/^@(media|supports|(-moz-)?document|import)$/i.test(type)) {\n return pushContext(state, stream, \"atBlock\");\n } else if (/^@(font-face|counter-style)/i.test(type)) {\n state.stateArg = type;\n return \"restricted_atBlock_before\";\n } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(type)) {\n return \"keyframes\";\n } else if (type && type.charAt(0) == \"@\") {\n return pushContext(state, stream, \"at\");\n } else if (type == \"hash\") {\n override = \"builtin\";\n } else if (type == \"word\") {\n override = \"tag\";\n } else if (type == \"variable-definition\") {\n return \"maybeprop\";\n } else if (type == \"interpolation\") {\n return pushContext(state, stream, \"interpolation\");\n } else if (type == \":\") {\n return \"pseudo\";\n } else if (allowNested && type == \"(\") {\n return pushContext(state, stream, \"parens\");\n }\n return state.context.type;\n };\n\n states.block = function(type, stream, state) {\n if (type == \"word\") {\n var word = stream.current().toLowerCase();\n if (propertyKeywords.hasOwnProperty(word)) {\n override = \"property\";\n return \"maybeprop\";\n } else if (nonStandardPropertyKeywords.hasOwnProperty(word)) {\n override = highlightNonStandardPropertyKeywords ? \"string-2\" : \"property\";\n return \"maybeprop\";\n } else if (allowNested) {\n override = stream.match(/^\\s*:(?:\\s|$)/, false) ? \"property\" : \"tag\";\n return \"block\";\n } else {\n override += \" error\";\n return \"maybeprop\";\n }\n } else if (type == \"meta\") {\n return \"block\";\n } else if (!allowNested && (type == \"hash\" || type == \"qualifier\")) {\n override = \"error\";\n return \"block\";\n } else {\n return states.top(type, stream, state);\n }\n };\n\n states.maybeprop = function(type, stream, state) {\n if (type == \":\") return pushContext(state, stream, \"prop\");\n return pass(type, stream, state);\n };\n\n states.prop = function(type, stream, state) {\n if (type == \";\") return popContext(state);\n if (type == \"{\" && allowNested) return pushContext(state, stream, \"propBlock\");\n if (type == \"}\" || type == \"{\") return popAndPass(type, stream, state);\n if (type == \"(\") return pushContext(state, stream, \"parens\");\n\n if (type == \"hash\" && !/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(stream.current())) {\n override += \" error\";\n } else if (type == \"word\") {\n wordAsValue(stream);\n } else if (type == \"interpolation\") {\n return pushContext(state, stream, \"interpolation\");\n }\n return \"prop\";\n };\n\n states.propBlock = function(type, _stream, state) {\n if (type == \"}\") return popContext(state);\n if (type == \"word\") { override = \"property\"; return \"maybeprop\"; }\n return state.context.type;\n };\n\n states.parens = function(type, stream, state) {\n if (type == \"{\" || type == \"}\") return popAndPass(type, stream, state);\n if (type == \")\") return popContext(state);\n if (type == \"(\") return pushContext(state, stream, \"parens\");\n if (type == \"interpolation\") return pushContext(state, stream, \"interpolation\");\n if (type == \"word\") wordAsValue(stream);\n return \"parens\";\n };\n\n states.pseudo = function(type, stream, state) {\n if (type == \"meta\") return \"pseudo\";\n\n if (type == \"word\") {\n override = \"variable-3\";\n return state.context.type;\n }\n return pass(type, stream, state);\n };\n\n states.documentTypes = function(type, stream, state) {\n if (type == \"word\" && documentTypes.hasOwnProperty(stream.current())) {\n override = \"tag\";\n return state.context.type;\n } else {\n return states.atBlock(type, stream, state);\n }\n };\n\n states.atBlock = function(type, stream, state) {\n if (type == \"(\") return pushContext(state, stream, \"atBlock_parens\");\n if (type == \"}\" || type == \";\") return popAndPass(type, stream, state);\n if (type == \"{\") return popContext(state) && pushContext(state, stream, allowNested ? \"block\" : \"top\");\n\n if (type == \"interpolation\") return pushContext(state, stream, \"interpolation\");\n\n if (type == \"word\") {\n var word = stream.current().toLowerCase();\n if (word == \"only\" || word == \"not\" || word == \"and\" || word == \"or\")\n override = \"keyword\";\n else if (mediaTypes.hasOwnProperty(word))\n override = \"attribute\";\n else if (mediaFeatures.hasOwnProperty(word))\n override = \"property\";\n else if (mediaValueKeywords.hasOwnProperty(word))\n override = \"keyword\";\n else if (propertyKeywords.hasOwnProperty(word))\n override = \"property\";\n else if (nonStandardPropertyKeywords.hasOwnProperty(word))\n override = highlightNonStandardPropertyKeywords ? \"string-2\" : \"property\";\n else if (valueKeywords.hasOwnProperty(word))\n override = \"atom\";\n else if (colorKeywords.hasOwnProperty(word))\n override = \"keyword\";\n else\n override = \"error\";\n }\n return state.context.type;\n };\n\n states.atComponentBlock = function(type, stream, state) {\n if (type == \"}\")\n return popAndPass(type, stream, state);\n if (type == \"{\")\n return popContext(state) && pushContext(state, stream, allowNested ? \"block\" : \"top\", false);\n if (type == \"word\")\n override = \"error\";\n return state.context.type;\n };\n\n states.atBlock_parens = function(type, stream, state) {\n if (type == \")\") return popContext(state);\n if (type == \"{\" || type == \"}\") return popAndPass(type, stream, state, 2);\n return states.atBlock(type, stream, state);\n };\n\n states.restricted_atBlock_before = function(type, stream, state) {\n if (type == \"{\")\n return pushContext(state, stream, \"restricted_atBlock\");\n if (type == \"word\" && state.stateArg == \"@counter-style\") {\n override = \"variable\";\n return \"restricted_atBlock_before\";\n }\n return pass(type, stream, state);\n };\n\n states.restricted_atBlock = function(type, stream, state) {\n if (type == \"}\") {\n state.stateArg = null;\n return popContext(state);\n }\n if (type == \"word\") {\n if ((state.stateArg == \"@font-face\" && !fontProperties.hasOwnProperty(stream.current().toLowerCase())) ||\n (state.stateArg == \"@counter-style\" && !counterDescriptors.hasOwnProperty(stream.current().toLowerCase())))\n override = \"error\";\n else\n override = \"property\";\n return \"maybeprop\";\n }\n return \"restricted_atBlock\";\n };\n\n states.keyframes = function(type, stream, state) {\n if (type == \"word\") { override = \"variable\"; return \"keyframes\"; }\n if (type == \"{\") return pushContext(state, stream, \"top\");\n return pass(type, stream, state);\n };\n\n states.at = function(type, stream, state) {\n if (type == \";\") return popContext(state);\n if (type == \"{\" || type == \"}\") return popAndPass(type, stream, state);\n if (type == \"word\") override = \"tag\";\n else if (type == \"hash\") override = \"builtin\";\n return \"at\";\n };\n\n states.interpolation = function(type, stream, state) {\n if (type == \"}\") return popContext(state);\n if (type == \"{\" || type == \";\") return popAndPass(type, stream, state);\n if (type == \"word\") override = \"variable\";\n else if (type != \"variable\" && type != \"(\" && type != \")\") override = \"error\";\n return \"interpolation\";\n };\n\n return {\n startState: function(base) {\n return {tokenize: null,\n state: inline ? \"block\" : \"top\",\n stateArg: null,\n context: new Context(inline ? \"block\" : \"top\", base || 0, null)};\n },\n\n token: function(stream, state) {\n if (!state.tokenize && stream.eatSpace()) return null;\n var style = (state.tokenize || tokenBase)(stream, state);\n if (style && typeof style == \"object\") {\n type = style[1];\n style = style[0];\n }\n override = style;\n if (type != \"comment\")\n state.state = states[state.state](type, stream, state);\n return override;\n },\n\n indent: function(state, textAfter) {\n var cx = state.context, ch = textAfter && textAfter.charAt(0);\n var indent = cx.indent;\n if (cx.type == \"prop\" && (ch == \"}\" || ch == \")\")) cx = cx.prev;\n if (cx.prev) {\n if (ch == \"}\" && (cx.type == \"block\" || cx.type == \"top\" ||\n cx.type == \"interpolation\" || cx.type == \"restricted_atBlock\")) {\n // Resume indentation from parent context.\n cx = cx.prev;\n indent = cx.indent;\n } else if (ch == \")\" && (cx.type == \"parens\" || cx.type == \"atBlock_parens\") ||\n ch == \"{\" && (cx.type == \"at\" || cx.type == \"atBlock\")) {\n // Dedent relative to current context.\n indent = Math.max(0, cx.indent - indentUnit);\n }\n }\n return indent;\n },\n\n electricChars: \"}\",\n blockCommentStart: \"/*\",\n blockCommentEnd: \"*/\",\n blockCommentContinue: \" * \",\n lineComment: lineComment,\n fold: \"brace\"\n };\n});\n\n function keySet(array) {\n var keys = {};\n for (var i = 0; i < array.length; ++i) {\n keys[array[i].toLowerCase()] = true;\n }\n return keys;\n }\n\n var documentTypes_ = [\n \"domain\", \"regexp\", \"url\", \"url-prefix\"\n ], documentTypes = keySet(documentTypes_);\n\n var mediaTypes_ = [\n \"all\", \"aural\", \"braille\", \"handheld\", \"print\", \"projection\", \"screen\",\n \"tty\", \"tv\", \"embossed\"\n ], mediaTypes = keySet(mediaTypes_);\n\n var mediaFeatures_ = [\n \"width\", \"min-width\", \"max-width\", \"height\", \"min-height\", \"max-height\",\n \"device-width\", \"min-device-width\", \"max-device-width\", \"device-height\",\n \"min-device-height\", \"max-device-height\", \"aspect-ratio\",\n \"min-aspect-ratio\", \"max-aspect-ratio\", \"device-aspect-ratio\",\n \"min-device-aspect-ratio\", \"max-device-aspect-ratio\", \"color\", \"min-color\",\n \"max-color\", \"color-index\", \"min-color-index\", \"max-color-index\",\n \"monochrome\", \"min-monochrome\", \"max-monochrome\", \"resolution\",\n \"min-resolution\", \"max-resolution\", \"scan\", \"grid\", \"orientation\",\n \"device-pixel-ratio\", \"min-device-pixel-ratio\", \"max-device-pixel-ratio\",\n \"pointer\", \"any-pointer\", \"hover\", \"any-hover\", \"prefers-color-scheme\",\n \"dynamic-range\", \"video-dynamic-range\"\n ], mediaFeatures = keySet(mediaFeatures_);\n\n var mediaValueKeywords_ = [\n \"landscape\", \"portrait\", \"none\", \"coarse\", \"fine\", \"on-demand\", \"hover\",\n \"interlace\", \"progressive\",\n \"dark\", \"light\",\n \"standard\", \"high\"\n ], mediaValueKeywords = keySet(mediaValueKeywords_);\n\n var propertyKeywords_ = [\n \"align-content\", \"align-items\", \"align-self\", \"alignment-adjust\",\n \"alignment-baseline\", \"all\", \"anchor-point\", \"animation\", \"animation-delay\",\n \"animation-direction\", \"animation-duration\", \"animation-fill-mode\",\n \"animation-iteration-count\", \"animation-name\", \"animation-play-state\",\n \"animation-timing-function\", \"appearance\", \"azimuth\", \"backdrop-filter\",\n \"backface-visibility\", \"background\", \"background-attachment\",\n \"background-blend-mode\", \"background-clip\", \"background-color\",\n \"background-image\", \"background-origin\", \"background-position\",\n \"background-position-x\", \"background-position-y\", \"background-repeat\",\n \"background-size\", \"baseline-shift\", \"binding\", \"bleed\", \"block-size\",\n \"bookmark-label\", \"bookmark-level\", \"bookmark-state\", \"bookmark-target\",\n \"border\", \"border-bottom\", \"border-bottom-color\", \"border-bottom-left-radius\",\n \"border-bottom-right-radius\", \"border-bottom-style\", \"border-bottom-width\",\n \"border-collapse\", \"border-color\", \"border-image\", \"border-image-outset\",\n \"border-image-repeat\", \"border-image-slice\", \"border-image-source\",\n \"border-image-width\", \"border-left\", \"border-left-color\", \"border-left-style\",\n \"border-left-width\", \"border-radius\", \"border-right\", \"border-right-color\",\n \"border-right-style\", \"border-right-width\", \"border-spacing\", \"border-style\",\n \"border-top\", \"border-top-color\", \"border-top-left-radius\",\n \"border-top-right-radius\", \"border-top-style\", \"border-top-width\",\n \"border-width\", \"bottom\", \"box-decoration-break\", \"box-shadow\", \"box-sizing\",\n \"break-after\", \"break-before\", \"break-inside\", \"caption-side\", \"caret-color\",\n \"clear\", \"clip\", \"color\", \"color-profile\", \"column-count\", \"column-fill\",\n \"column-gap\", \"column-rule\", \"column-rule-color\", \"column-rule-style\",\n \"column-rule-width\", \"column-span\", \"column-width\", \"columns\", \"contain\",\n \"content\", \"counter-increment\", \"counter-reset\", \"crop\", \"cue\", \"cue-after\",\n \"cue-before\", \"cursor\", \"direction\", \"display\", \"dominant-baseline\",\n \"drop-initial-after-adjust\", \"drop-initial-after-align\",\n \"drop-initial-before-adjust\", \"drop-initial-before-align\", \"drop-initial-size\",\n \"drop-initial-value\", \"elevation\", \"empty-cells\", \"fit\", \"fit-content\", \"fit-position\",\n \"flex\", \"flex-basis\", \"flex-direction\", \"flex-flow\", \"flex-grow\",\n \"flex-shrink\", \"flex-wrap\", \"float\", \"float-offset\", \"flow-from\", \"flow-into\",\n \"font\", \"font-family\", \"font-feature-settings\", \"font-kerning\",\n \"font-language-override\", \"font-optical-sizing\", \"font-size\",\n \"font-size-adjust\", \"font-stretch\", \"font-style\", \"font-synthesis\",\n \"font-variant\", \"font-variant-alternates\", \"font-variant-caps\",\n \"font-variant-east-asian\", \"font-variant-ligatures\", \"font-variant-numeric\",\n \"font-variant-position\", \"font-variation-settings\", \"font-weight\", \"gap\",\n \"grid\", \"grid-area\", \"grid-auto-columns\", \"grid-auto-flow\", \"grid-auto-rows\",\n \"grid-column\", \"grid-column-end\", \"grid-column-gap\", \"grid-column-start\",\n \"grid-gap\", \"grid-row\", \"grid-row-end\", \"grid-row-gap\", \"grid-row-start\",\n \"grid-template\", \"grid-template-areas\", \"grid-template-columns\",\n \"grid-template-rows\", \"hanging-punctuation\", \"height\", \"hyphens\", \"icon\",\n \"image-orientation\", \"image-rendering\", \"image-resolution\", \"inline-box-align\",\n \"inset\", \"inset-block\", \"inset-block-end\", \"inset-block-start\", \"inset-inline\",\n \"inset-inline-end\", \"inset-inline-start\", \"isolation\", \"justify-content\",\n \"justify-items\", \"justify-self\", \"left\", \"letter-spacing\", \"line-break\",\n \"line-height\", \"line-height-step\", \"line-stacking\", \"line-stacking-ruby\",\n \"line-stacking-shift\", \"line-stacking-strategy\", \"list-style\",\n \"list-style-image\", \"list-style-position\", \"list-style-type\", \"margin\",\n \"margin-bottom\", \"margin-left\", \"margin-right\", \"margin-top\", \"marks\",\n \"marquee-direction\", \"marquee-loop\", \"marquee-play-count\", \"marquee-speed\",\n \"marquee-style\", \"mask-clip\", \"mask-composite\", \"mask-image\", \"mask-mode\",\n \"mask-origin\", \"mask-position\", \"mask-repeat\", \"mask-size\",\"mask-type\",\n \"max-block-size\", \"max-height\", \"max-inline-size\",\n \"max-width\", \"min-block-size\", \"min-height\", \"min-inline-size\", \"min-width\",\n \"mix-blend-mode\", \"move-to\", \"nav-down\", \"nav-index\", \"nav-left\", \"nav-right\",\n \"nav-up\", \"object-fit\", \"object-position\", \"offset\", \"offset-anchor\",\n \"offset-distance\", \"offset-path\", \"offset-position\", \"offset-rotate\",\n \"opacity\", \"order\", \"orphans\", \"outline\", \"outline-color\", \"outline-offset\",\n \"outline-style\", \"outline-width\", \"overflow\", \"overflow-style\",\n \"overflow-wrap\", \"overflow-x\", \"overflow-y\", \"padding\", \"padding-bottom\",\n \"padding-left\", \"padding-right\", \"padding-top\", \"page\", \"page-break-after\",\n \"page-break-before\", \"page-break-inside\", \"page-policy\", \"pause\",\n \"pause-after\", \"pause-before\", \"perspective\", \"perspective-origin\", \"pitch\",\n \"pitch-range\", \"place-content\", \"place-items\", \"place-self\", \"play-during\",\n \"position\", \"presentation-level\", \"punctuation-trim\", \"quotes\",\n \"region-break-after\", \"region-break-before\", \"region-break-inside\",\n \"region-fragment\", \"rendering-intent\", \"resize\", \"rest\", \"rest-after\",\n \"rest-before\", \"richness\", \"right\", \"rotate\", \"rotation\", \"rotation-point\",\n \"row-gap\", \"ruby-align\", \"ruby-overhang\", \"ruby-position\", \"ruby-span\",\n \"scale\", \"scroll-behavior\", \"scroll-margin\", \"scroll-margin-block\",\n \"scroll-margin-block-end\", \"scroll-margin-block-start\", \"scroll-margin-bottom\",\n \"scroll-margin-inline\", \"scroll-margin-inline-end\",\n \"scroll-margin-inline-start\", \"scroll-margin-left\", \"scroll-margin-right\",\n \"scroll-margin-top\", \"scroll-padding\", \"scroll-padding-block\",\n \"scroll-padding-block-end\", \"scroll-padding-block-start\",\n \"scroll-padding-bottom\", \"scroll-padding-inline\", \"scroll-padding-inline-end\",\n \"scroll-padding-inline-start\", \"scroll-padding-left\", \"scroll-padding-right\",\n \"scroll-padding-top\", \"scroll-snap-align\", \"scroll-snap-type\",\n \"shape-image-threshold\", \"shape-inside\", \"shape-margin\", \"shape-outside\",\n \"size\", \"speak\", \"speak-as\", \"speak-header\", \"speak-numeral\",\n \"speak-punctuation\", \"speech-rate\", \"stress\", \"string-set\", \"tab-size\",\n \"table-layout\", \"target\", \"target-name\", \"target-new\", \"target-position\",\n \"text-align\", \"text-align-last\", \"text-combine-upright\", \"text-decoration\",\n \"text-decoration-color\", \"text-decoration-line\", \"text-decoration-skip\",\n \"text-decoration-skip-ink\", \"text-decoration-style\", \"text-emphasis\",\n \"text-emphasis-color\", \"text-emphasis-position\", \"text-emphasis-style\",\n \"text-height\", \"text-indent\", \"text-justify\", \"text-orientation\",\n \"text-outline\", \"text-overflow\", \"text-rendering\", \"text-shadow\",\n \"text-size-adjust\", \"text-space-collapse\", \"text-transform\",\n \"text-underline-position\", \"text-wrap\", \"top\", \"touch-action\", \"transform\", \"transform-origin\",\n \"transform-style\", \"transition\", \"transition-delay\", \"transition-duration\",\n \"transition-property\", \"transition-timing-function\", \"translate\",\n \"unicode-bidi\", \"user-select\", \"vertical-align\", \"visibility\", \"voice-balance\",\n \"voice-duration\", \"voice-family\", \"voice-pitch\", \"voice-range\", \"voice-rate\",\n \"voice-stress\", \"voice-volume\", \"volume\", \"white-space\", \"widows\", \"width\",\n \"will-change\", \"word-break\", \"word-spacing\", \"word-wrap\", \"writing-mode\", \"z-index\",\n // SVG-specific\n \"clip-path\", \"clip-rule\", \"mask\", \"enable-background\", \"filter\", \"flood-color\",\n \"flood-opacity\", \"lighting-color\", \"stop-color\", \"stop-opacity\", \"pointer-events\",\n \"color-interpolation\", \"color-interpolation-filters\",\n \"color-rendering\", \"fill\", \"fill-opacity\", \"fill-rule\", \"image-rendering\",\n \"marker\", \"marker-end\", \"marker-mid\", \"marker-start\", \"paint-order\", \"shape-rendering\", \"stroke\",\n \"stroke-dasharray\", \"stroke-dashoffset\", \"stroke-linecap\", \"stroke-linejoin\",\n \"stroke-miterlimit\", \"stroke-opacity\", \"stroke-width\", \"text-rendering\",\n \"baseline-shift\", \"dominant-baseline\", \"glyph-orientation-horizontal\",\n \"glyph-orientation-vertical\", \"text-anchor\", \"writing-mode\",\n ], propertyKeywords = keySet(propertyKeywords_);\n\n var nonStandardPropertyKeywords_ = [\n \"accent-color\", \"aspect-ratio\", \"border-block\", \"border-block-color\", \"border-block-end\",\n \"border-block-end-color\", \"border-block-end-style\", \"border-block-end-width\",\n \"border-block-start\", \"border-block-start-color\", \"border-block-start-style\",\n \"border-block-start-width\", \"border-block-style\", \"border-block-width\",\n \"border-inline\", \"border-inline-color\", \"border-inline-end\",\n \"border-inline-end-color\", \"border-inline-end-style\",\n \"border-inline-end-width\", \"border-inline-start\", \"border-inline-start-color\",\n \"border-inline-start-style\", \"border-inline-start-width\",\n \"border-inline-style\", \"border-inline-width\", \"content-visibility\", \"margin-block\",\n \"margin-block-end\", \"margin-block-start\", \"margin-inline\", \"margin-inline-end\",\n \"margin-inline-start\", \"overflow-anchor\", \"overscroll-behavior\", \"padding-block\", \"padding-block-end\",\n \"padding-block-start\", \"padding-inline\", \"padding-inline-end\",\n \"padding-inline-start\", \"scroll-snap-stop\", \"scrollbar-3d-light-color\",\n \"scrollbar-arrow-color\", \"scrollbar-base-color\", \"scrollbar-dark-shadow-color\",\n \"scrollbar-face-color\", \"scrollbar-highlight-color\", \"scrollbar-shadow-color\",\n \"scrollbar-track-color\", \"searchfield-cancel-button\", \"searchfield-decoration\",\n \"searchfield-results-button\", \"searchfield-results-decoration\", \"shape-inside\", \"zoom\"\n ], nonStandardPropertyKeywords = keySet(nonStandardPropertyKeywords_);\n\n var fontProperties_ = [\n \"font-display\", \"font-family\", \"src\", \"unicode-range\", \"font-variant\",\n \"font-feature-settings\", \"font-stretch\", \"font-weight\", \"font-style\"\n ], fontProperties = keySet(fontProperties_);\n\n var counterDescriptors_ = [\n \"additive-symbols\", \"fallback\", \"negative\", \"pad\", \"prefix\", \"range\",\n \"speak-as\", \"suffix\", \"symbols\", \"system\"\n ], counterDescriptors = keySet(counterDescriptors_);\n\n var colorKeywords_ = [\n \"aliceblue\", \"antiquewhite\", \"aqua\", \"aquamarine\", \"azure\", \"beige\",\n \"bisque\", \"black\", \"blanchedalmond\", \"blue\", \"blueviolet\", \"brown\",\n \"burlywood\", \"cadetblue\", \"chartreuse\", \"chocolate\", \"coral\", \"cornflowerblue\",\n \"cornsilk\", \"crimson\", \"cyan\", \"darkblue\", \"darkcyan\", \"darkgoldenrod\",\n \"darkgray\", \"darkgreen\", \"darkgrey\", \"darkkhaki\", \"darkmagenta\", \"darkolivegreen\",\n \"darkorange\", \"darkorchid\", \"darkred\", \"darksalmon\", \"darkseagreen\",\n \"darkslateblue\", \"darkslategray\", \"darkslategrey\", \"darkturquoise\", \"darkviolet\",\n \"deeppink\", \"deepskyblue\", \"dimgray\", \"dimgrey\", \"dodgerblue\", \"firebrick\",\n \"floralwhite\", \"forestgreen\", \"fuchsia\", \"gainsboro\", \"ghostwhite\",\n \"gold\", \"goldenrod\", \"gray\", \"grey\", \"green\", \"greenyellow\", \"honeydew\",\n \"hotpink\", \"indianred\", \"indigo\", \"ivory\", \"khaki\", \"lavender\",\n \"lavenderblush\", \"lawngreen\", \"lemonchiffon\", \"lightblue\", \"lightcoral\",\n \"lightcyan\", \"lightgoldenrodyellow\", \"lightgray\", \"lightgreen\", \"lightgrey\", \"lightpink\",\n \"lightsalmon\", \"lightseagreen\", \"lightskyblue\", \"lightslategray\", \"lightslategrey\",\n \"lightsteelblue\", \"lightyellow\", \"lime\", \"limegreen\", \"linen\", \"magenta\",\n \"maroon\", \"mediumaquamarine\", \"mediumblue\", \"mediumorchid\", \"mediumpurple\",\n \"mediumseagreen\", \"mediumslateblue\", \"mediumspringgreen\", \"mediumturquoise\",\n \"mediumvioletred\", \"midnightblue\", \"mintcream\", \"mistyrose\", \"moccasin\",\n \"navajowhite\", \"navy\", \"oldlace\", \"olive\", \"olivedrab\", \"orange\", \"orangered\",\n \"orchid\", \"palegoldenrod\", \"palegreen\", \"paleturquoise\", \"palevioletred\",\n \"papayawhip\", \"peachpuff\", \"peru\", \"pink\", \"plum\", \"powderblue\",\n \"purple\", \"rebeccapurple\", \"red\", \"rosybrown\", \"royalblue\", \"saddlebrown\",\n \"salmon\", \"sandybrown\", \"seagreen\", \"seashell\", \"sienna\", \"silver\", \"skyblue\",\n \"slateblue\", \"slategray\", \"slategrey\", \"snow\", \"springgreen\", \"steelblue\", \"tan\",\n \"teal\", \"thistle\", \"tomato\", \"turquoise\", \"violet\", \"wheat\", \"white\",\n \"whitesmoke\", \"yellow\", \"yellowgreen\"\n ], colorKeywords = keySet(colorKeywords_);\n\n var valueKeywords_ = [\n \"above\", \"absolute\", \"activeborder\", \"additive\", \"activecaption\", \"afar\",\n \"after-white-space\", \"ahead\", \"alias\", \"all\", \"all-scroll\", \"alphabetic\", \"alternate\",\n \"always\", \"amharic\", \"amharic-abegede\", \"antialiased\", \"appworkspace\",\n \"arabic-indic\", \"armenian\", \"asterisks\", \"attr\", \"auto\", \"auto-flow\", \"avoid\", \"avoid-column\", \"avoid-page\",\n \"avoid-region\", \"axis-pan\", \"background\", \"backwards\", \"baseline\", \"below\", \"bidi-override\", \"binary\",\n \"bengali\", \"blink\", \"block\", \"block-axis\", \"blur\", \"bold\", \"bolder\", \"border\", \"border-box\",\n \"both\", \"bottom\", \"break\", \"break-all\", \"break-word\", \"brightness\", \"bullets\", \"button\",\n \"buttonface\", \"buttonhighlight\", \"buttonshadow\", \"buttontext\", \"calc\", \"cambodian\",\n \"capitalize\", \"caps-lock-indicator\", \"caption\", \"captiontext\", \"caret\",\n \"cell\", \"center\", \"checkbox\", \"circle\", \"cjk-decimal\", \"cjk-earthly-branch\",\n \"cjk-heavenly-stem\", \"cjk-ideographic\", \"clear\", \"clip\", \"close-quote\",\n \"col-resize\", \"collapse\", \"color\", \"color-burn\", \"color-dodge\", \"column\", \"column-reverse\",\n \"compact\", \"condensed\", \"conic-gradient\", \"contain\", \"content\", \"contents\",\n \"content-box\", \"context-menu\", \"continuous\", \"contrast\", \"copy\", \"counter\", \"counters\", \"cover\", \"crop\",\n \"cross\", \"crosshair\", \"cubic-bezier\", \"currentcolor\", \"cursive\", \"cyclic\", \"darken\", \"dashed\", \"decimal\",\n \"decimal-leading-zero\", \"default\", \"default-button\", \"dense\", \"destination-atop\",\n \"destination-in\", \"destination-out\", \"destination-over\", \"devanagari\", \"difference\",\n \"disc\", \"discard\", \"disclosure-closed\", \"disclosure-open\", \"document\",\n \"dot-dash\", \"dot-dot-dash\",\n \"dotted\", \"double\", \"down\", \"drop-shadow\", \"e-resize\", \"ease\", \"ease-in\", \"ease-in-out\", \"ease-out\",\n \"element\", \"ellipse\", \"ellipsis\", \"embed\", \"end\", \"ethiopic\", \"ethiopic-abegede\",\n \"ethiopic-abegede-am-et\", \"ethiopic-abegede-gez\", \"ethiopic-abegede-ti-er\",\n \"ethiopic-abegede-ti-et\", \"ethiopic-halehame-aa-er\",\n \"ethiopic-halehame-aa-et\", \"ethiopic-halehame-am-et\",\n \"ethiopic-halehame-gez\", \"ethiopic-halehame-om-et\",\n \"ethiopic-halehame-sid-et\", \"ethiopic-halehame-so-et\",\n \"ethiopic-halehame-ti-er\", \"ethiopic-halehame-ti-et\", \"ethiopic-halehame-tig\",\n \"ethiopic-numeric\", \"ew-resize\", \"exclusion\", \"expanded\", \"extends\", \"extra-condensed\",\n \"extra-expanded\", \"fantasy\", \"fast\", \"fill\", \"fill-box\", \"fixed\", \"flat\", \"flex\", \"flex-end\", \"flex-start\", \"footnotes\",\n \"forwards\", \"from\", \"geometricPrecision\", \"georgian\", \"grayscale\", \"graytext\", \"grid\", \"groove\",\n \"gujarati\", \"gurmukhi\", \"hand\", \"hangul\", \"hangul-consonant\", \"hard-light\", \"hebrew\",\n \"help\", \"hidden\", \"hide\", \"higher\", \"highlight\", \"highlighttext\",\n \"hiragana\", \"hiragana-iroha\", \"horizontal\", \"hsl\", \"hsla\", \"hue\", \"hue-rotate\", \"icon\", \"ignore\",\n \"inactiveborder\", \"inactivecaption\", \"inactivecaptiontext\", \"infinite\",\n \"infobackground\", \"infotext\", \"inherit\", \"initial\", \"inline\", \"inline-axis\",\n \"inline-block\", \"inline-flex\", \"inline-grid\", \"inline-table\", \"inset\", \"inside\", \"intrinsic\", \"invert\",\n \"italic\", \"japanese-formal\", \"japanese-informal\", \"justify\", \"kannada\",\n \"katakana\", \"katakana-iroha\", \"keep-all\", \"khmer\",\n \"korean-hangul-formal\", \"korean-hanja-formal\", \"korean-hanja-informal\",\n \"landscape\", \"lao\", \"large\", \"larger\", \"left\", \"level\", \"lighter\", \"lighten\",\n \"line-through\", \"linear\", \"linear-gradient\", \"lines\", \"list-item\", \"listbox\", \"listitem\",\n \"local\", \"logical\", \"loud\", \"lower\", \"lower-alpha\", \"lower-armenian\",\n \"lower-greek\", \"lower-hexadecimal\", \"lower-latin\", \"lower-norwegian\",\n \"lower-roman\", \"lowercase\", \"ltr\", \"luminosity\", \"malayalam\", \"manipulation\", \"match\", \"matrix\", \"matrix3d\",\n \"media-play-button\", \"media-slider\", \"media-sliderthumb\",\n \"media-volume-slider\", \"media-volume-sliderthumb\", \"medium\",\n \"menu\", \"menulist\", \"menulist-button\",\n \"menutext\", \"message-box\", \"middle\", \"min-intrinsic\",\n \"mix\", \"mongolian\", \"monospace\", \"move\", \"multiple\", \"multiple_mask_images\", \"multiply\", \"myanmar\", \"n-resize\",\n \"narrower\", \"ne-resize\", \"nesw-resize\", \"no-close-quote\", \"no-drop\",\n \"no-open-quote\", \"no-repeat\", \"none\", \"normal\", \"not-allowed\", \"nowrap\",\n \"ns-resize\", \"numbers\", \"numeric\", \"nw-resize\", \"nwse-resize\", \"oblique\", \"octal\", \"opacity\", \"open-quote\",\n \"optimizeLegibility\", \"optimizeSpeed\", \"oriya\", \"oromo\", \"outset\",\n \"outside\", \"outside-shape\", \"overlay\", \"overline\", \"padding\", \"padding-box\",\n \"painted\", \"page\", \"paused\", \"persian\", \"perspective\", \"pinch-zoom\", \"plus-darker\", \"plus-lighter\",\n \"pointer\", \"polygon\", \"portrait\", \"pre\", \"pre-line\", \"pre-wrap\", \"preserve-3d\",\n \"progress\", \"push-button\", \"radial-gradient\", \"radio\", \"read-only\",\n \"read-write\", \"read-write-plaintext-only\", \"rectangle\", \"region\",\n \"relative\", \"repeat\", \"repeating-linear-gradient\", \"repeating-radial-gradient\",\n \"repeating-conic-gradient\", \"repeat-x\", \"repeat-y\", \"reset\", \"reverse\",\n \"rgb\", \"rgba\", \"ridge\", \"right\", \"rotate\", \"rotate3d\", \"rotateX\", \"rotateY\",\n \"rotateZ\", \"round\", \"row\", \"row-resize\", \"row-reverse\", \"rtl\", \"run-in\", \"running\",\n \"s-resize\", \"sans-serif\", \"saturate\", \"saturation\", \"scale\", \"scale3d\", \"scaleX\", \"scaleY\", \"scaleZ\", \"screen\",\n \"scroll\", \"scrollbar\", \"scroll-position\", \"se-resize\", \"searchfield\",\n \"searchfield-cancel-button\", \"searchfield-decoration\",\n \"searchfield-results-button\", \"searchfield-results-decoration\", \"self-start\", \"self-end\",\n \"semi-condensed\", \"semi-expanded\", \"separate\", \"sepia\", \"serif\", \"show\", \"sidama\",\n \"simp-chinese-formal\", \"simp-chinese-informal\", \"single\",\n \"skew\", \"skewX\", \"skewY\", \"skip-white-space\", \"slide\", \"slider-horizontal\",\n \"slider-vertical\", \"sliderthumb-horizontal\", \"sliderthumb-vertical\", \"slow\",\n \"small\", \"small-caps\", \"small-caption\", \"smaller\", \"soft-light\", \"solid\", \"somali\",\n \"source-atop\", \"source-in\", \"source-out\", \"source-over\", \"space\", \"space-around\", \"space-between\", \"space-evenly\", \"spell-out\", \"square\",\n \"square-button\", \"start\", \"static\", \"status-bar\", \"stretch\", \"stroke\", \"stroke-box\", \"sub\",\n \"subpixel-antialiased\", \"svg_masks\", \"super\", \"sw-resize\", \"symbolic\", \"symbols\", \"system-ui\", \"table\",\n \"table-caption\", \"table-cell\", \"table-column\", \"table-column-group\",\n \"table-footer-group\", \"table-header-group\", \"table-row\", \"table-row-group\",\n \"tamil\",\n \"telugu\", \"text\", \"text-bottom\", \"text-top\", \"textarea\", \"textfield\", \"thai\",\n \"thick\", \"thin\", \"threeddarkshadow\", \"threedface\", \"threedhighlight\",\n \"threedlightshadow\", \"threedshadow\", \"tibetan\", \"tigre\", \"tigrinya-er\",\n \"tigrinya-er-abegede\", \"tigrinya-et\", \"tigrinya-et-abegede\", \"to\", \"top\",\n \"trad-chinese-formal\", \"trad-chinese-informal\", \"transform\",\n \"translate\", \"translate3d\", \"translateX\", \"translateY\", \"translateZ\",\n \"transparent\", \"ultra-condensed\", \"ultra-expanded\", \"underline\", \"unidirectional-pan\", \"unset\", \"up\",\n \"upper-alpha\", \"upper-armenian\", \"upper-greek\", \"upper-hexadecimal\",\n \"upper-latin\", \"upper-norwegian\", \"upper-roman\", \"uppercase\", \"urdu\", \"url\",\n \"var\", \"vertical\", \"vertical-text\", \"view-box\", \"visible\", \"visibleFill\", \"visiblePainted\",\n \"visibleStroke\", \"visual\", \"w-resize\", \"wait\", \"wave\", \"wider\",\n \"window\", \"windowframe\", \"windowtext\", \"words\", \"wrap\", \"wrap-reverse\", \"x-large\", \"x-small\", \"xor\",\n \"xx-large\", \"xx-small\"\n ], valueKeywords = keySet(valueKeywords_);\n\n var allWords = documentTypes_.concat(mediaTypes_).concat(mediaFeatures_).concat(mediaValueKeywords_)\n .concat(propertyKeywords_).concat(nonStandardPropertyKeywords_).concat(colorKeywords_)\n .concat(valueKeywords_);\n CodeMirror.registerHelper(\"hintWords\", \"css\", allWords);\n\n function tokenCComment(stream, state) {\n var maybeEnd = false, ch;\n while ((ch = stream.next()) != null) {\n if (maybeEnd && ch == \"/\") {\n state.tokenize = null;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return [\"comment\", \"comment\"];\n }\n\n CodeMirror.defineMIME(\"text/css\", {\n documentTypes: documentTypes,\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n mediaValueKeywords: mediaValueKeywords,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n fontProperties: fontProperties,\n counterDescriptors: counterDescriptors,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n tokenHooks: {\n \"/\": function(stream, state) {\n if (!stream.eat(\"*\")) return false;\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n }\n },\n name: \"css\"\n });\n\n CodeMirror.defineMIME(\"text/x-scss\", {\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n mediaValueKeywords: mediaValueKeywords,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n fontProperties: fontProperties,\n allowNested: true,\n lineComment: \"//\",\n tokenHooks: {\n \"/\": function(stream, state) {\n if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return [\"comment\", \"comment\"];\n } else if (stream.eat(\"*\")) {\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n } else {\n return [\"operator\", \"operator\"];\n }\n },\n \":\": function(stream) {\n if (stream.match(/^\\s*\\{/, false))\n return [null, null]\n return false;\n },\n \"$\": function(stream) {\n stream.match(/^[\\w-]+/);\n if (stream.match(/^\\s*:/, false))\n return [\"variable-2\", \"variable-definition\"];\n return [\"variable-2\", \"variable\"];\n },\n \"#\": function(stream) {\n if (!stream.eat(\"{\")) return false;\n return [null, \"interpolation\"];\n }\n },\n name: \"css\",\n helperType: \"scss\"\n });\n\n CodeMirror.defineMIME(\"text/x-less\", {\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n mediaValueKeywords: mediaValueKeywords,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n fontProperties: fontProperties,\n allowNested: true,\n lineComment: \"//\",\n tokenHooks: {\n \"/\": function(stream, state) {\n if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return [\"comment\", \"comment\"];\n } else if (stream.eat(\"*\")) {\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n } else {\n return [\"operator\", \"operator\"];\n }\n },\n \"@\": function(stream) {\n if (stream.eat(\"{\")) return [null, \"interpolation\"];\n if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\\b/i, false)) return false;\n stream.eatWhile(/[\\w\\\\\\-]/);\n if (stream.match(/^\\s*:/, false))\n return [\"variable-2\", \"variable-definition\"];\n return [\"variable-2\", \"variable\"];\n },\n \"&\": function() {\n return [\"atom\", \"atom\"];\n }\n },\n name: \"css\",\n helperType: \"less\"\n });\n\n CodeMirror.defineMIME(\"text/x-gss\", {\n documentTypes: documentTypes,\n mediaTypes: mediaTypes,\n mediaFeatures: mediaFeatures,\n propertyKeywords: propertyKeywords,\n nonStandardPropertyKeywords: nonStandardPropertyKeywords,\n fontProperties: fontProperties,\n counterDescriptors: counterDescriptors,\n colorKeywords: colorKeywords,\n valueKeywords: valueKeywords,\n supportsAtComponent: true,\n tokenHooks: {\n \"/\": function(stream, state) {\n if (!stream.eat(\"*\")) return false;\n state.tokenize = tokenCComment;\n return tokenCComment(stream, state);\n }\n },\n name: \"css\",\n helperType: \"gss\"\n });\n\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../xml/xml\"), require(\"../javascript/javascript\"), require(\"../css/css\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../xml/xml\", \"../javascript/javascript\", \"../css/css\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var defaultTags = {\n script: [\n [\"lang\", /(javascript|babel)/i, \"javascript\"],\n [\"type\", /^(?:text|application)\\/(?:x-)?(?:java|ecma)script$|^module$|^$/i, \"javascript\"],\n [\"type\", /./, \"text/plain\"],\n [null, null, \"javascript\"]\n ],\n style: [\n [\"lang\", /^css$/i, \"css\"],\n [\"type\", /^(text\\/)?(x-)?(stylesheet|css)$/i, \"css\"],\n [\"type\", /./, \"text/plain\"],\n [null, null, \"css\"]\n ]\n };\n\n function maybeBackup(stream, pat, style) {\n var cur = stream.current(), close = cur.search(pat);\n if (close > -1) {\n stream.backUp(cur.length - close);\n } else if (cur.match(/<\\/?$/)) {\n stream.backUp(cur.length);\n if (!stream.match(pat, false)) stream.match(cur);\n }\n return style;\n }\n\n var attrRegexpCache = {};\n function getAttrRegexp(attr) {\n var regexp = attrRegexpCache[attr];\n if (regexp) return regexp;\n return attrRegexpCache[attr] = new RegExp(\"\\\\s+\" + attr + \"\\\\s*=\\\\s*('|\\\")?([^'\\\"]+)('|\\\")?\\\\s*\");\n }\n\n function getAttrValue(text, attr) {\n var match = text.match(getAttrRegexp(attr))\n return match ? /^\\s*(.*?)\\s*$/.exec(match[2])[1] : \"\"\n }\n\n function getTagRegexp(tagName, anchored) {\n return new RegExp((anchored ? \"^\" : \"\") + \"<\\/\\\\s*\" + tagName + \"\\\\s*>\", \"i\");\n }\n\n function addTags(from, to) {\n for (var tag in from) {\n var dest = to[tag] || (to[tag] = []);\n var source = from[tag];\n for (var i = source.length - 1; i >= 0; i--)\n dest.unshift(source[i])\n }\n }\n\n function findMatchingMode(tagInfo, tagText) {\n for (var i = 0; i < tagInfo.length; i++) {\n var spec = tagInfo[i];\n if (!spec[0] || spec[1].test(getAttrValue(tagText, spec[0]))) return spec[2];\n }\n }\n\n CodeMirror.defineMode(\"htmlmixed\", function (config, parserConfig) {\n var htmlMode = CodeMirror.getMode(config, {\n name: \"xml\",\n htmlMode: true,\n multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,\n multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag,\n allowMissingTagName: parserConfig.allowMissingTagName,\n });\n\n var tags = {};\n var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes;\n addTags(defaultTags, tags);\n if (configTags) addTags(configTags, tags);\n if (configScript) for (var i = configScript.length - 1; i >= 0; i--)\n tags.script.unshift([\"type\", configScript[i].matches, configScript[i].mode])\n\n function html(stream, state) {\n var style = htmlMode.token(stream, state.htmlState), tag = /\\btag\\b/.test(style), tagName\n if (tag && !/[<>\\s\\/]/.test(stream.current()) &&\n (tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase()) &&\n tags.hasOwnProperty(tagName)) {\n state.inTag = tagName + \" \"\n } else if (state.inTag && tag && />$/.test(stream.current())) {\n var inTag = /^([\\S]+) (.*)/.exec(state.inTag)\n state.inTag = null\n var modeSpec = stream.current() == \">\" && findMatchingMode(tags[inTag[1]], inTag[2])\n var mode = CodeMirror.getMode(config, modeSpec)\n var endTagA = getTagRegexp(inTag[1], true), endTag = getTagRegexp(inTag[1], false);\n state.token = function (stream, state) {\n if (stream.match(endTagA, false)) {\n state.token = html;\n state.localState = state.localMode = null;\n return null;\n }\n return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState));\n };\n state.localMode = mode;\n state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, \"\", \"\"));\n } else if (state.inTag) {\n state.inTag += stream.current()\n if (stream.eol()) state.inTag += \" \"\n }\n return style;\n };\n\n return {\n startState: function () {\n var state = CodeMirror.startState(htmlMode);\n return {token: html, inTag: null, localMode: null, localState: null, htmlState: state};\n },\n\n copyState: function (state) {\n var local;\n if (state.localState) {\n local = CodeMirror.copyState(state.localMode, state.localState);\n }\n return {token: state.token, inTag: state.inTag,\n localMode: state.localMode, localState: local,\n htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};\n },\n\n token: function (stream, state) {\n return state.token(stream, state);\n },\n\n indent: function (state, textAfter, line) {\n if (!state.localMode || /^\\s*<\\//.test(textAfter))\n return htmlMode.indent(state.htmlState, textAfter, line);\n else if (state.localMode.indent)\n return state.localMode.indent(state.localState, textAfter, line);\n else\n return CodeMirror.Pass;\n },\n\n innerMode: function (state) {\n return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};\n }\n };\n }, \"xml\", \"javascript\", \"css\");\n\n CodeMirror.defineMIME(\"text/html\", \"htmlmixed\");\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"javascript\", function(config, parserConfig) {\n var indentUnit = config.indentUnit;\n var statementIndent = parserConfig.statementIndent;\n var jsonldMode = parserConfig.jsonld;\n var jsonMode = parserConfig.json || jsonldMode;\n var trackScope = parserConfig.trackScope !== false\n var isTS = parserConfig.typescript;\n var wordRE = parserConfig.wordCharacters || /[\\w$\\xa1-\\uffff]/;\n\n // Tokenizer\n\n var keywords = function(){\n function kw(type) {return {type: type, style: \"keyword\"};}\n var A = kw(\"keyword a\"), B = kw(\"keyword b\"), C = kw(\"keyword c\"), D = kw(\"keyword d\");\n var operator = kw(\"operator\"), atom = {type: \"atom\", style: \"atom\"};\n\n return {\n \"if\": kw(\"if\"), \"while\": A, \"with\": A, \"else\": B, \"do\": B, \"try\": B, \"finally\": B,\n \"return\": D, \"break\": D, \"continue\": D, \"new\": kw(\"new\"), \"delete\": C, \"void\": C, \"throw\": C,\n \"debugger\": kw(\"debugger\"), \"var\": kw(\"var\"), \"const\": kw(\"var\"), \"let\": kw(\"var\"),\n \"function\": kw(\"function\"), \"catch\": kw(\"catch\"),\n \"for\": kw(\"for\"), \"switch\": kw(\"switch\"), \"case\": kw(\"case\"), \"default\": kw(\"default\"),\n \"in\": operator, \"typeof\": operator, \"instanceof\": operator,\n \"true\": atom, \"false\": atom, \"null\": atom, \"undefined\": atom, \"NaN\": atom, \"Infinity\": atom,\n \"this\": kw(\"this\"), \"class\": kw(\"class\"), \"super\": kw(\"atom\"),\n \"yield\": C, \"export\": kw(\"export\"), \"import\": kw(\"import\"), \"extends\": C,\n \"await\": C\n };\n }();\n\n var isOperatorChar = /[+\\-*&%=<>!?|~^@]/;\n var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)\"/;\n\n function readRegexp(stream) {\n var escaped = false, next, inSet = false;\n while ((next = stream.next()) != null) {\n if (!escaped) {\n if (next == \"/\" && !inSet) return;\n if (next == \"[\") inSet = true;\n else if (inSet && next == \"]\") inSet = false;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n }\n\n // Used as scratch variables to communicate multiple values without\n // consing up tons of objects.\n var type, content;\n function ret(tp, style, cont) {\n type = tp; content = cont;\n return style;\n }\n function tokenBase(stream, state) {\n var ch = stream.next();\n if (ch == '\"' || ch == \"'\") {\n state.tokenize = tokenString(ch);\n return state.tokenize(stream, state);\n } else if (ch == \".\" && stream.match(/^\\d[\\d_]*(?:[eE][+\\-]?[\\d_]+)?/)) {\n return ret(\"number\", \"number\");\n } else if (ch == \".\" && stream.match(\"..\")) {\n return ret(\"spread\", \"meta\");\n } else if (/[\\[\\]{}\\(\\),;\\:\\.]/.test(ch)) {\n return ret(ch);\n } else if (ch == \"=\" && stream.eat(\">\")) {\n return ret(\"=>\", \"operator\");\n } else if (ch == \"0\" && stream.match(/^(?:x[\\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) {\n return ret(\"number\", \"number\");\n } else if (/\\d/.test(ch)) {\n stream.match(/^[\\d_]*(?:n|(?:\\.[\\d_]*)?(?:[eE][+\\-]?[\\d_]+)?)?/);\n return ret(\"number\", \"number\");\n } else if (ch == \"/\") {\n if (stream.eat(\"*\")) {\n state.tokenize = tokenComment;\n return tokenComment(stream, state);\n } else if (stream.eat(\"/\")) {\n stream.skipToEnd();\n return ret(\"comment\", \"comment\");\n } else if (expressionAllowed(stream, state, 1)) {\n readRegexp(stream);\n stream.match(/^\\b(([gimyus])(?![gimyus]*\\2))+\\b/);\n return ret(\"regexp\", \"string-2\");\n } else {\n stream.eat(\"=\");\n return ret(\"operator\", \"operator\", stream.current());\n }\n } else if (ch == \"`\") {\n state.tokenize = tokenQuasi;\n return tokenQuasi(stream, state);\n } else if (ch == \"#\" && stream.peek() == \"!\") {\n stream.skipToEnd();\n return ret(\"meta\", \"meta\");\n } else if (ch == \"#\" && stream.eatWhile(wordRE)) {\n return ret(\"variable\", \"property\")\n } else if (ch == \"<\" && stream.match(\"!--\") ||\n (ch == \"-\" && stream.match(\"->\") && !/\\S/.test(stream.string.slice(0, stream.start)))) {\n stream.skipToEnd()\n return ret(\"comment\", \"comment\")\n } else if (isOperatorChar.test(ch)) {\n if (ch != \">\" || !state.lexical || state.lexical.type != \">\") {\n if (stream.eat(\"=\")) {\n if (ch == \"!\" || ch == \"=\") stream.eat(\"=\")\n } else if (/[<>*+\\-|&?]/.test(ch)) {\n stream.eat(ch)\n if (ch == \">\") stream.eat(ch)\n }\n }\n if (ch == \"?\" && stream.eat(\".\")) return ret(\".\")\n return ret(\"operator\", \"operator\", stream.current());\n } else if (wordRE.test(ch)) {\n stream.eatWhile(wordRE);\n var word = stream.current()\n if (state.lastType != \".\") {\n if (keywords.propertyIsEnumerable(word)) {\n var kw = keywords[word]\n return ret(kw.type, kw.style, word)\n }\n if (word == \"async\" && stream.match(/^(\\s|\\/\\*([^*]|\\*(?!\\/))*?\\*\\/)*[\\[\\(\\w]/, false))\n return ret(\"async\", \"keyword\", word)\n }\n return ret(\"variable\", \"variable\", word)\n }\n }\n\n function tokenString(quote) {\n return function(stream, state) {\n var escaped = false, next;\n if (jsonldMode && stream.peek() == \"@\" && stream.match(isJsonldKeyword)){\n state.tokenize = tokenBase;\n return ret(\"jsonld-keyword\", \"meta\");\n }\n while ((next = stream.next()) != null) {\n if (next == quote && !escaped) break;\n escaped = !escaped && next == \"\\\\\";\n }\n if (!escaped) state.tokenize = tokenBase;\n return ret(\"string\", \"string\");\n };\n }\n\n function tokenComment(stream, state) {\n var maybeEnd = false, ch;\n while (ch = stream.next()) {\n if (ch == \"/\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"*\");\n }\n return ret(\"comment\", \"comment\");\n }\n\n function tokenQuasi(stream, state) {\n var escaped = false, next;\n while ((next = stream.next()) != null) {\n if (!escaped && (next == \"`\" || next == \"$\" && stream.eat(\"{\"))) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && next == \"\\\\\";\n }\n return ret(\"quasi\", \"string-2\", stream.current());\n }\n\n var brackets = \"([{}])\";\n // This is a crude lookahead trick to try and notice that we're\n // parsing the argument patterns for a fat-arrow function before we\n // actually hit the arrow token. It only works if the arrow is on\n // the same line as the arguments and there's no strange noise\n // (comments) in between. Fallback is to only notice when we hit the\n // arrow, and not declare the arguments as locals for the arrow\n // body.\n function findFatArrow(stream, state) {\n if (state.fatArrowAt) state.fatArrowAt = null;\n var arrow = stream.string.indexOf(\"=>\", stream.start);\n if (arrow < 0) return;\n\n if (isTS) { // Try to skip TypeScript return type declarations after the arguments\n var m = /:\\s*(?:\\w+(?:<[^>]*>|\\[\\])?|\\{[^}]*\\})\\s*$/.exec(stream.string.slice(stream.start, arrow))\n if (m) arrow = m.index\n }\n\n var depth = 0, sawSomething = false;\n for (var pos = arrow - 1; pos >= 0; --pos) {\n var ch = stream.string.charAt(pos);\n var bracket = brackets.indexOf(ch);\n if (bracket >= 0 && bracket < 3) {\n if (!depth) { ++pos; break; }\n if (--depth == 0) { if (ch == \"(\") sawSomething = true; break; }\n } else if (bracket >= 3 && bracket < 6) {\n ++depth;\n } else if (wordRE.test(ch)) {\n sawSomething = true;\n } else if (/[\"'\\/`]/.test(ch)) {\n for (;; --pos) {\n if (pos == 0) return\n var next = stream.string.charAt(pos - 1)\n if (next == ch && stream.string.charAt(pos - 2) != \"\\\\\") { pos--; break }\n }\n } else if (sawSomething && !depth) {\n ++pos;\n break;\n }\n }\n if (sawSomething && !depth) state.fatArrowAt = pos;\n }\n\n // Parser\n\n var atomicTypes = {\"atom\": true, \"number\": true, \"variable\": true, \"string\": true,\n \"regexp\": true, \"this\": true, \"import\": true, \"jsonld-keyword\": true};\n\n function JSLexical(indented, column, type, align, prev, info) {\n this.indented = indented;\n this.column = column;\n this.type = type;\n this.prev = prev;\n this.info = info;\n if (align != null) this.align = align;\n }\n\n function inScope(state, varname) {\n if (!trackScope) return false\n for (var v = state.localVars; v; v = v.next)\n if (v.name == varname) return true;\n for (var cx = state.context; cx; cx = cx.prev) {\n for (var v = cx.vars; v; v = v.next)\n if (v.name == varname) return true;\n }\n }\n\n function parseJS(state, style, type, content, stream) {\n var cc = state.cc;\n // Communicate our context to the combinators.\n // (Less wasteful than consing up a hundred closures on every call.)\n cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style;\n\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = true;\n\n while(true) {\n var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement;\n if (combinator(type, content)) {\n while(cc.length && cc[cc.length - 1].lex)\n cc.pop()();\n if (cx.marked) return cx.marked;\n if (type == \"variable\" && inScope(state, content)) return \"variable-2\";\n return style;\n }\n }\n }\n\n // Combinator utils\n\n var cx = {state: null, column: null, marked: null, cc: null};\n function pass() {\n for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);\n }\n function cont() {\n pass.apply(null, arguments);\n return true;\n }\n function inList(name, list) {\n for (var v = list; v; v = v.next) if (v.name == name) return true\n return false;\n }\n function register(varname) {\n var state = cx.state;\n cx.marked = \"def\";\n if (!trackScope) return\n if (state.context) {\n if (state.lexical.info == \"var\" && state.context && state.context.block) {\n // FIXME function decls are also not block scoped\n var newContext = registerVarScoped(varname, state.context)\n if (newContext != null) {\n state.context = newContext\n return\n }\n } else if (!inList(varname, state.localVars)) {\n state.localVars = new Var(varname, state.localVars)\n return\n }\n }\n // Fall through means this is global\n if (parserConfig.globalVars && !inList(varname, state.globalVars))\n state.globalVars = new Var(varname, state.globalVars)\n }\n function registerVarScoped(varname, context) {\n if (!context) {\n return null\n } else if (context.block) {\n var inner = registerVarScoped(varname, context.prev)\n if (!inner) return null\n if (inner == context.prev) return context\n return new Context(inner, context.vars, true)\n } else if (inList(varname, context.vars)) {\n return context\n } else {\n return new Context(context.prev, new Var(varname, context.vars), false)\n }\n }\n\n function isModifier(name) {\n return name == \"public\" || name == \"private\" || name == \"protected\" || name == \"abstract\" || name == \"readonly\"\n }\n\n // Combinators\n\n function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block }\n function Var(name, next) { this.name = name; this.next = next }\n\n var defaultVars = new Var(\"this\", new Var(\"arguments\", null))\n function pushcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, false)\n cx.state.localVars = defaultVars\n }\n function pushblockcontext() {\n cx.state.context = new Context(cx.state.context, cx.state.localVars, true)\n cx.state.localVars = null\n }\n pushcontext.lex = pushblockcontext.lex = true\n function popcontext() {\n cx.state.localVars = cx.state.context.vars\n cx.state.context = cx.state.context.prev\n }\n popcontext.lex = true\n function pushlex(type, info) {\n var result = function() {\n var state = cx.state, indent = state.indented;\n if (state.lexical.type == \"stat\") indent = state.lexical.indented;\n else for (var outer = state.lexical; outer && outer.type == \")\" && outer.align; outer = outer.prev)\n indent = outer.indented;\n state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info);\n };\n result.lex = true;\n return result;\n }\n function poplex() {\n var state = cx.state;\n if (state.lexical.prev) {\n if (state.lexical.type == \")\")\n state.indented = state.lexical.indented;\n state.lexical = state.lexical.prev;\n }\n }\n poplex.lex = true;\n\n function expect(wanted) {\n function exp(type) {\n if (type == wanted) return cont();\n else if (wanted == \";\" || type == \"}\" || type == \")\" || type == \"]\") return pass();\n else return cont(exp);\n };\n return exp;\n }\n\n function statement(type, value) {\n if (type == \"var\") return cont(pushlex(\"vardef\", value), vardef, expect(\";\"), poplex);\n if (type == \"keyword a\") return cont(pushlex(\"form\"), parenExpr, statement, poplex);\n if (type == \"keyword b\") return cont(pushlex(\"form\"), statement, poplex);\n if (type == \"keyword d\") return cx.stream.match(/^\\s*$/, false) ? cont() : cont(pushlex(\"stat\"), maybeexpression, expect(\";\"), poplex);\n if (type == \"debugger\") return cont(expect(\";\"));\n if (type == \"{\") return cont(pushlex(\"}\"), pushblockcontext, block, poplex, popcontext);\n if (type == \";\") return cont();\n if (type == \"if\") {\n if (cx.state.lexical.info == \"else\" && cx.state.cc[cx.state.cc.length - 1] == poplex)\n cx.state.cc.pop()();\n return cont(pushlex(\"form\"), parenExpr, statement, poplex, maybeelse);\n }\n if (type == \"function\") return cont(functiondef);\n if (type == \"for\") return cont(pushlex(\"form\"), pushblockcontext, forspec, statement, popcontext, poplex);\n if (type == \"class\" || (isTS && value == \"interface\")) {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\", type == \"class\" ? type : value), className, poplex)\n }\n if (type == \"variable\") {\n if (isTS && value == \"declare\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else if (isTS && (value == \"module\" || value == \"enum\" || value == \"type\") && cx.stream.match(/^\\s*\\w/, false)) {\n cx.marked = \"keyword\"\n if (value == \"enum\") return cont(enumdef);\n else if (value == \"type\") return cont(typename, expect(\"operator\"), typeexpr, expect(\";\"));\n else return cont(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), block, poplex, poplex)\n } else if (isTS && value == \"namespace\") {\n cx.marked = \"keyword\"\n return cont(pushlex(\"form\"), expression, statement, poplex)\n } else if (isTS && value == \"abstract\") {\n cx.marked = \"keyword\"\n return cont(statement)\n } else {\n return cont(pushlex(\"stat\"), maybelabel);\n }\n }\n if (type == \"switch\") return cont(pushlex(\"form\"), parenExpr, expect(\"{\"), pushlex(\"}\", \"switch\"), pushblockcontext,\n block, poplex, poplex, popcontext);\n if (type == \"case\") return cont(expression, expect(\":\"));\n if (type == \"default\") return cont(expect(\":\"));\n if (type == \"catch\") return cont(pushlex(\"form\"), pushcontext, maybeCatchBinding, statement, poplex, popcontext);\n if (type == \"export\") return cont(pushlex(\"stat\"), afterExport, poplex);\n if (type == \"import\") return cont(pushlex(\"stat\"), afterImport, poplex);\n if (type == \"async\") return cont(statement)\n if (value == \"@\") return cont(expression, statement)\n return pass(pushlex(\"stat\"), expression, expect(\";\"), poplex);\n }\n function maybeCatchBinding(type) {\n if (type == \"(\") return cont(funarg, expect(\")\"))\n }\n function expression(type, value) {\n return expressionInner(type, value, false);\n }\n function expressionNoComma(type, value) {\n return expressionInner(type, value, true);\n }\n function parenExpr(type) {\n if (type != \"(\") return pass()\n return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex)\n }\n function expressionInner(type, value, noComma) {\n if (cx.state.fatArrowAt == cx.stream.start) {\n var body = noComma ? arrowBodyNoComma : arrowBody;\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, expect(\"=>\"), body, popcontext);\n else if (type == \"variable\") return pass(pushcontext, pattern, expect(\"=>\"), body, popcontext);\n }\n\n var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;\n if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);\n if (type == \"function\") return cont(functiondef, maybeop);\n if (type == \"class\" || (isTS && value == \"interface\")) { cx.marked = \"keyword\"; return cont(pushlex(\"form\"), classExpression, poplex); }\n if (type == \"keyword c\" || type == \"async\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"(\") return cont(pushlex(\")\"), maybeexpression, expect(\")\"), poplex, maybeop);\n if (type == \"operator\" || type == \"spread\") return cont(noComma ? expressionNoComma : expression);\n if (type == \"[\") return cont(pushlex(\"]\"), arrayLiteral, poplex, maybeop);\n if (type == \"{\") return contCommasep(objprop, \"}\", null, maybeop);\n if (type == \"quasi\") return pass(quasi, maybeop);\n if (type == \"new\") return cont(maybeTarget(noComma));\n return cont();\n }\n function maybeexpression(type) {\n if (type.match(/[;\\}\\)\\],]/)) return pass();\n return pass(expression);\n }\n\n function maybeoperatorComma(type, value) {\n if (type == \",\") return cont(maybeexpression);\n return maybeoperatorNoComma(type, value, false);\n }\n function maybeoperatorNoComma(type, value, noComma) {\n var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma;\n var expr = noComma == false ? expression : expressionNoComma;\n if (type == \"=>\") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);\n if (type == \"operator\") {\n if (/\\+\\+|--/.test(value) || isTS && value == \"!\") return cont(me);\n if (isTS && value == \"<\" && cx.stream.match(/^([^<>]|<[^<>]*>)*>\\s*\\(/, false))\n return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, me);\n if (value == \"?\") return cont(expression, expect(\":\"), expr);\n return cont(expr);\n }\n if (type == \"quasi\") { return pass(quasi, me); }\n if (type == \";\") return;\n if (type == \"(\") return contCommasep(expressionNoComma, \")\", \"call\", me);\n if (type == \".\") return cont(property, me);\n if (type == \"[\") return cont(pushlex(\"]\"), maybeexpression, expect(\"]\"), poplex, me);\n if (isTS && value == \"as\") { cx.marked = \"keyword\"; return cont(typeexpr, me) }\n if (type == \"regexp\") {\n cx.state.lastType = cx.marked = \"operator\"\n cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)\n return cont(expr)\n }\n }\n function quasi(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasi);\n return cont(maybeexpression, continueQuasi);\n }\n function continueQuasi(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasi);\n }\n }\n function arrowBody(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expression);\n }\n function arrowBodyNoComma(type) {\n findFatArrow(cx.stream, cx.state);\n return pass(type == \"{\" ? statement : expressionNoComma);\n }\n function maybeTarget(noComma) {\n return function(type) {\n if (type == \".\") return cont(noComma ? targetNoComma : target);\n else if (type == \"variable\" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma)\n else return pass(noComma ? expressionNoComma : expression);\n };\n }\n function target(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorComma); }\n }\n function targetNoComma(_, value) {\n if (value == \"target\") { cx.marked = \"keyword\"; return cont(maybeoperatorNoComma); }\n }\n function maybelabel(type) {\n if (type == \":\") return cont(poplex, statement);\n return pass(maybeoperatorComma, expect(\";\"), poplex);\n }\n function property(type) {\n if (type == \"variable\") {cx.marked = \"property\"; return cont();}\n }\n function objprop(type, value) {\n if (type == \"async\") {\n cx.marked = \"property\";\n return cont(objprop);\n } else if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n if (value == \"get\" || value == \"set\") return cont(getterSetter);\n var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params\n if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\\s*:\\s*/, false)))\n cx.state.fatArrowAt = cx.stream.pos + m[0].length\n return cont(afterprop);\n } else if (type == \"number\" || type == \"string\") {\n cx.marked = jsonldMode ? \"property\" : (cx.style + \" property\");\n return cont(afterprop);\n } else if (type == \"jsonld-keyword\") {\n return cont(afterprop);\n } else if (isTS && isModifier(value)) {\n cx.marked = \"keyword\"\n return cont(objprop)\n } else if (type == \"[\") {\n return cont(expression, maybetype, expect(\"]\"), afterprop);\n } else if (type == \"spread\") {\n return cont(expressionNoComma, afterprop);\n } else if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(objprop);\n } else if (type == \":\") {\n return pass(afterprop)\n }\n }\n function getterSetter(type) {\n if (type != \"variable\") return pass(afterprop);\n cx.marked = \"property\";\n return cont(functiondef);\n }\n function afterprop(type) {\n if (type == \":\") return cont(expressionNoComma);\n if (type == \"(\") return pass(functiondef);\n }\n function commasep(what, end, sep) {\n function proceed(type, value) {\n if (sep ? sep.indexOf(type) > -1 : type == \",\") {\n var lex = cx.state.lexical;\n if (lex.info == \"call\") lex.pos = (lex.pos || 0) + 1;\n return cont(function(type, value) {\n if (type == end || value == end) return pass()\n return pass(what)\n }, proceed);\n }\n if (type == end || value == end) return cont();\n if (sep && sep.indexOf(\";\") > -1) return pass(what)\n return cont(expect(end));\n }\n return function(type, value) {\n if (type == end || value == end) return cont();\n return pass(what, proceed);\n };\n }\n function contCommasep(what, end, info) {\n for (var i = 3; i < arguments.length; i++)\n cx.cc.push(arguments[i]);\n return cont(pushlex(end, info), commasep(what, end), poplex);\n }\n function block(type) {\n if (type == \"}\") return cont();\n return pass(statement, block);\n }\n function maybetype(type, value) {\n if (isTS) {\n if (type == \":\") return cont(typeexpr);\n if (value == \"?\") return cont(maybetype);\n }\n }\n function maybetypeOrIn(type, value) {\n if (isTS && (type == \":\" || value == \"in\")) return cont(typeexpr)\n }\n function mayberettype(type) {\n if (isTS && type == \":\") {\n if (cx.stream.match(/^\\s*\\w+\\s+is\\b/, false)) return cont(expression, isKW, typeexpr)\n else return cont(typeexpr)\n }\n }\n function isKW(_, value) {\n if (value == \"is\") {\n cx.marked = \"keyword\"\n return cont()\n }\n }\n function typeexpr(type, value) {\n if (value == \"keyof\" || value == \"typeof\" || value == \"infer\" || value == \"readonly\") {\n cx.marked = \"keyword\"\n return cont(value == \"typeof\" ? expressionNoComma : typeexpr)\n }\n if (type == \"variable\" || value == \"void\") {\n cx.marked = \"type\"\n return cont(afterType)\n }\n if (value == \"|\" || value == \"&\") return cont(typeexpr)\n if (type == \"string\" || type == \"number\" || type == \"atom\") return cont(afterType);\n if (type == \"[\") return cont(pushlex(\"]\"), commasep(typeexpr, \"]\", \",\"), poplex, afterType)\n if (type == \"{\") return cont(pushlex(\"}\"), typeprops, poplex, afterType)\n if (type == \"(\") return cont(commasep(typearg, \")\"), maybeReturnType, afterType)\n if (type == \"<\") return cont(commasep(typeexpr, \">\"), typeexpr)\n if (type == \"quasi\") { return pass(quasiType, afterType); }\n }\n function maybeReturnType(type) {\n if (type == \"=>\") return cont(typeexpr)\n }\n function typeprops(type) {\n if (type.match(/[\\}\\)\\]]/)) return cont()\n if (type == \",\" || type == \";\") return cont(typeprops)\n return pass(typeprop, typeprops)\n }\n function typeprop(type, value) {\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\"\n return cont(typeprop)\n } else if (value == \"?\" || type == \"number\" || type == \"string\") {\n return cont(typeprop)\n } else if (type == \":\") {\n return cont(typeexpr)\n } else if (type == \"[\") {\n return cont(expect(\"variable\"), maybetypeOrIn, expect(\"]\"), typeprop)\n } else if (type == \"(\") {\n return pass(functiondecl, typeprop)\n } else if (!type.match(/[;\\}\\)\\],]/)) {\n return cont()\n }\n }\n function quasiType(type, value) {\n if (type != \"quasi\") return pass();\n if (value.slice(value.length - 2) != \"${\") return cont(quasiType);\n return cont(typeexpr, continueQuasiType);\n }\n function continueQuasiType(type) {\n if (type == \"}\") {\n cx.marked = \"string-2\";\n cx.state.tokenize = tokenQuasi;\n return cont(quasiType);\n }\n }\n function typearg(type, value) {\n if (type == \"variable\" && cx.stream.match(/^\\s*[?:]/, false) || value == \"?\") return cont(typearg)\n if (type == \":\") return cont(typeexpr)\n if (type == \"spread\") return cont(typearg)\n return pass(typeexpr)\n }\n function afterType(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n if (value == \"|\" || type == \".\" || value == \"&\") return cont(typeexpr)\n if (type == \"[\") return cont(typeexpr, expect(\"]\"), afterType)\n if (value == \"extends\" || value == \"implements\") { cx.marked = \"keyword\"; return cont(typeexpr) }\n if (value == \"?\") return cont(typeexpr, expect(\":\"), typeexpr)\n }\n function maybeTypeArgs(_, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeexpr, \">\"), poplex, afterType)\n }\n function typeparam() {\n return pass(typeexpr, maybeTypeDefault)\n }\n function maybeTypeDefault(_, value) {\n if (value == \"=\") return cont(typeexpr)\n }\n function vardef(_, value) {\n if (value == \"enum\") {cx.marked = \"keyword\"; return cont(enumdef)}\n return pass(pattern, maybetype, maybeAssign, vardefCont);\n }\n function pattern(type, value) {\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(pattern) }\n if (type == \"variable\") { register(value); return cont(); }\n if (type == \"spread\") return cont(pattern);\n if (type == \"[\") return contCommasep(eltpattern, \"]\");\n if (type == \"{\") return contCommasep(proppattern, \"}\");\n }\n function proppattern(type, value) {\n if (type == \"variable\" && !cx.stream.match(/^\\s*:/, false)) {\n register(value);\n return cont(maybeAssign);\n }\n if (type == \"variable\") cx.marked = \"property\";\n if (type == \"spread\") return cont(pattern);\n if (type == \"}\") return pass();\n if (type == \"[\") return cont(expression, expect(']'), expect(':'), proppattern);\n return cont(expect(\":\"), pattern, maybeAssign);\n }\n function eltpattern() {\n return pass(pattern, maybeAssign)\n }\n function maybeAssign(_type, value) {\n if (value == \"=\") return cont(expressionNoComma);\n }\n function vardefCont(type) {\n if (type == \",\") return cont(vardef);\n }\n function maybeelse(type, value) {\n if (type == \"keyword b\" && value == \"else\") return cont(pushlex(\"form\", \"else\"), statement, poplex);\n }\n function forspec(type, value) {\n if (value == \"await\") return cont(forspec);\n if (type == \"(\") return cont(pushlex(\")\"), forspec1, poplex);\n }\n function forspec1(type) {\n if (type == \"var\") return cont(vardef, forspec2);\n if (type == \"variable\") return cont(forspec2);\n return pass(forspec2)\n }\n function forspec2(type, value) {\n if (type == \")\") return cont()\n if (type == \";\") return cont(forspec2)\n if (value == \"in\" || value == \"of\") { cx.marked = \"keyword\"; return cont(expression, forspec2) }\n return pass(expression, forspec2)\n }\n function functiondef(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondef);}\n if (type == \"variable\") {register(value); return cont(functiondef);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, statement, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondef)\n }\n function functiondecl(type, value) {\n if (value == \"*\") {cx.marked = \"keyword\"; return cont(functiondecl);}\n if (type == \"variable\") {register(value); return cont(functiondecl);}\n if (type == \"(\") return cont(pushcontext, pushlex(\")\"), commasep(funarg, \")\"), poplex, mayberettype, popcontext);\n if (isTS && value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, functiondecl)\n }\n function typename(type, value) {\n if (type == \"keyword\" || type == \"variable\") {\n cx.marked = \"type\"\n return cont(typename)\n } else if (value == \"<\") {\n return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex)\n }\n }\n function funarg(type, value) {\n if (value == \"@\") cont(expression, funarg)\n if (type == \"spread\") return cont(funarg);\n if (isTS && isModifier(value)) { cx.marked = \"keyword\"; return cont(funarg); }\n if (isTS && type == \"this\") return cont(maybetype, maybeAssign)\n return pass(pattern, maybetype, maybeAssign);\n }\n function classExpression(type, value) {\n // Class expressions may have an optional name.\n if (type == \"variable\") return className(type, value);\n return classNameAfter(type, value);\n }\n function className(type, value) {\n if (type == \"variable\") {register(value); return cont(classNameAfter);}\n }\n function classNameAfter(type, value) {\n if (value == \"<\") return cont(pushlex(\">\"), commasep(typeparam, \">\"), poplex, classNameAfter)\n if (value == \"extends\" || value == \"implements\" || (isTS && type == \",\")) {\n if (value == \"implements\") cx.marked = \"keyword\";\n return cont(isTS ? typeexpr : expression, classNameAfter);\n }\n if (type == \"{\") return cont(pushlex(\"}\"), classBody, poplex);\n }\n function classBody(type, value) {\n if (type == \"async\" ||\n (type == \"variable\" &&\n (value == \"static\" || value == \"get\" || value == \"set\" || (isTS && isModifier(value))) &&\n cx.stream.match(/^\\s+#?[\\w$\\xa1-\\uffff]/, false))) {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (type == \"variable\" || cx.style == \"keyword\") {\n cx.marked = \"property\";\n return cont(classfield, classBody);\n }\n if (type == \"number\" || type == \"string\") return cont(classfield, classBody);\n if (type == \"[\")\n return cont(expression, maybetype, expect(\"]\"), classfield, classBody)\n if (value == \"*\") {\n cx.marked = \"keyword\";\n return cont(classBody);\n }\n if (isTS && type == \"(\") return pass(functiondecl, classBody)\n if (type == \";\" || type == \",\") return cont(classBody);\n if (type == \"}\") return cont();\n if (value == \"@\") return cont(expression, classBody)\n }\n function classfield(type, value) {\n if (value == \"!\") return cont(classfield)\n if (value == \"?\") return cont(classfield)\n if (type == \":\") return cont(typeexpr, maybeAssign)\n if (value == \"=\") return cont(expressionNoComma)\n var context = cx.state.lexical.prev, isInterface = context && context.info == \"interface\"\n return pass(isInterface ? functiondecl : functiondef)\n }\n function afterExport(type, value) {\n if (value == \"*\") { cx.marked = \"keyword\"; return cont(maybeFrom, expect(\";\")); }\n if (value == \"default\") { cx.marked = \"keyword\"; return cont(expression, expect(\";\")); }\n if (type == \"{\") return cont(commasep(exportField, \"}\"), maybeFrom, expect(\";\"));\n return pass(statement);\n }\n function exportField(type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(expect(\"variable\")); }\n if (type == \"variable\") return pass(expressionNoComma, exportField);\n }\n function afterImport(type) {\n if (type == \"string\") return cont();\n if (type == \"(\") return pass(expression);\n if (type == \".\") return pass(maybeoperatorComma);\n return pass(importSpec, maybeMoreImports, maybeFrom);\n }\n function importSpec(type, value) {\n if (type == \"{\") return contCommasep(importSpec, \"}\");\n if (type == \"variable\") register(value);\n if (value == \"*\") cx.marked = \"keyword\";\n return cont(maybeAs);\n }\n function maybeMoreImports(type) {\n if (type == \",\") return cont(importSpec, maybeMoreImports)\n }\n function maybeAs(_type, value) {\n if (value == \"as\") { cx.marked = \"keyword\"; return cont(importSpec); }\n }\n function maybeFrom(_type, value) {\n if (value == \"from\") { cx.marked = \"keyword\"; return cont(expression); }\n }\n function arrayLiteral(type) {\n if (type == \"]\") return cont();\n return pass(commasep(expressionNoComma, \"]\"));\n }\n function enumdef() {\n return pass(pushlex(\"form\"), pattern, expect(\"{\"), pushlex(\"}\"), commasep(enummember, \"}\"), poplex, poplex)\n }\n function enummember() {\n return pass(pattern, maybeAssign);\n }\n\n function isContinuedStatement(state, textAfter) {\n return state.lastType == \"operator\" || state.lastType == \",\" ||\n isOperatorChar.test(textAfter.charAt(0)) ||\n /[,.]/.test(textAfter.charAt(0));\n }\n\n function expressionAllowed(stream, state, backUp) {\n return state.tokenize == tokenBase &&\n /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\\[{}\\(,;:]|=>)$/.test(state.lastType) ||\n (state.lastType == \"quasi\" && /\\{\\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))\n }\n\n // Interface\n\n return {\n startState: function(basecolumn) {\n var state = {\n tokenize: tokenBase,\n lastType: \"sof\",\n cc: [],\n lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, \"block\", false),\n localVars: parserConfig.localVars,\n context: parserConfig.localVars && new Context(null, null, false),\n indented: basecolumn || 0\n };\n if (parserConfig.globalVars && typeof parserConfig.globalVars == \"object\")\n state.globalVars = parserConfig.globalVars;\n return state;\n },\n\n token: function(stream, state) {\n if (stream.sol()) {\n if (!state.lexical.hasOwnProperty(\"align\"))\n state.lexical.align = false;\n state.indented = stream.indentation();\n findFatArrow(stream, state);\n }\n if (state.tokenize != tokenComment && stream.eatSpace()) return null;\n var style = state.tokenize(stream, state);\n if (type == \"comment\") return style;\n state.lastType = type == \"operator\" && (content == \"++\" || content == \"--\") ? \"incdec\" : type;\n return parseJS(state, style, type, content, stream);\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize == tokenComment || state.tokenize == tokenQuasi) return CodeMirror.Pass;\n if (state.tokenize != tokenBase) return 0;\n var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top\n // Kludge to prevent 'maybelse' from blocking lexical scope pops\n if (!/^\\s*else\\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) {\n var c = state.cc[i];\n if (c == poplex) lexical = lexical.prev;\n else if (c != maybeelse && c != popcontext) break;\n }\n while ((lexical.type == \"stat\" || lexical.type == \"form\") &&\n (firstChar == \"}\" || ((top = state.cc[state.cc.length - 1]) &&\n (top == maybeoperatorComma || top == maybeoperatorNoComma) &&\n !/^[,\\.=+\\-*:?[\\(]/.test(textAfter))))\n lexical = lexical.prev;\n if (statementIndent && lexical.type == \")\" && lexical.prev.type == \"stat\")\n lexical = lexical.prev;\n var type = lexical.type, closing = firstChar == type;\n\n if (type == \"vardef\") return lexical.indented + (state.lastType == \"operator\" || state.lastType == \",\" ? lexical.info.length + 1 : 0);\n else if (type == \"form\" && firstChar == \"{\") return lexical.indented;\n else if (type == \"form\") return lexical.indented + indentUnit;\n else if (type == \"stat\")\n return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0);\n else if (lexical.info == \"switch\" && !closing && parserConfig.doubleIndentSwitch != false)\n return lexical.indented + (/^(?:case|default)\\b/.test(textAfter) ? indentUnit : 2 * indentUnit);\n else if (lexical.align) return lexical.column + (closing ? 0 : 1);\n else return lexical.indented + (closing ? 0 : indentUnit);\n },\n\n electricInput: /^\\s*(?:case .*?:|default:|\\{|\\})$/,\n blockCommentStart: jsonMode ? null : \"/*\",\n blockCommentEnd: jsonMode ? null : \"*/\",\n blockCommentContinue: jsonMode ? null : \" * \",\n lineComment: jsonMode ? null : \"//\",\n fold: \"brace\",\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n\n helperType: jsonMode ? \"json\" : \"javascript\",\n jsonldMode: jsonldMode,\n jsonMode: jsonMode,\n\n expressionAllowed: expressionAllowed,\n\n skipExpression: function(state) {\n parseJS(state, \"atom\", \"atom\", \"true\", new CodeMirror.StringStream(\"\", 2, null))\n }\n };\n});\n\nCodeMirror.registerHelper(\"wordChars\", \"javascript\", /[\\w$]/);\n\nCodeMirror.defineMIME(\"text/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"text/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/x-javascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/ecmascript\", \"javascript\");\nCodeMirror.defineMIME(\"application/json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/x-json\", { name: \"javascript\", json: true });\nCodeMirror.defineMIME(\"application/manifest+json\", { name: \"javascript\", json: true })\nCodeMirror.defineMIME(\"application/ld+json\", { name: \"javascript\", jsonld: true });\nCodeMirror.defineMIME(\"text/typescript\", { name: \"javascript\", typescript: true });\nCodeMirror.defineMIME(\"application/typescript\", { name: \"javascript\", typescript: true });\n\n});\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nvar htmlConfig = {\n autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,\n 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,\n 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,\n 'track': true, 'wbr': true, 'menuitem': true},\n implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,\n 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,\n 'th': true, 'tr': true},\n contextGrabbers: {\n 'dd': {'dd': true, 'dt': true},\n 'dt': {'dd': true, 'dt': true},\n 'li': {'li': true},\n 'option': {'option': true, 'optgroup': true},\n 'optgroup': {'optgroup': true},\n 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,\n 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,\n 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,\n 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,\n 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},\n 'rp': {'rp': true, 'rt': true},\n 'rt': {'rp': true, 'rt': true},\n 'tbody': {'tbody': true, 'tfoot': true},\n 'td': {'td': true, 'th': true},\n 'tfoot': {'tbody': true},\n 'th': {'td': true, 'th': true},\n 'thead': {'tbody': true, 'tfoot': true},\n 'tr': {'tr': true}\n },\n doNotIndent: {\"pre\": true},\n allowUnquoted: true,\n allowMissing: true,\n caseFold: true\n}\n\nvar xmlConfig = {\n autoSelfClosers: {},\n implicitlyClosed: {},\n contextGrabbers: {},\n doNotIndent: {},\n allowUnquoted: false,\n allowMissing: false,\n allowMissingTagName: false,\n caseFold: false\n}\n\nCodeMirror.defineMode(\"xml\", function(editorConf, config_) {\n var indentUnit = editorConf.indentUnit\n var config = {}\n var defaults = config_.htmlMode ? htmlConfig : xmlConfig\n for (var prop in defaults) config[prop] = defaults[prop]\n for (var prop in config_) config[prop] = config_[prop]\n\n // Return variables for tokenizers\n var type, setStyle;\n\n function inText(stream, state) {\n function chain(parser) {\n state.tokenize = parser;\n return parser(stream, state);\n }\n\n var ch = stream.next();\n if (ch == \"<\") {\n if (stream.eat(\"!\")) {\n if (stream.eat(\"[\")) {\n if (stream.match(\"CDATA[\")) return chain(inBlock(\"atom\", \"]]>\"));\n else return null;\n } else if (stream.match(\"--\")) {\n return chain(inBlock(\"comment\", \"-->\"));\n } else if (stream.match(\"DOCTYPE\", true, true)) {\n stream.eatWhile(/[\\w\\._\\-]/);\n return chain(doctype(1));\n } else {\n return null;\n }\n } else if (stream.eat(\"?\")) {\n stream.eatWhile(/[\\w\\._\\-]/);\n state.tokenize = inBlock(\"meta\", \"?>\");\n return \"meta\";\n } else {\n type = stream.eat(\"/\") ? \"closeTag\" : \"openTag\";\n state.tokenize = inTag;\n return \"tag bracket\";\n }\n } else if (ch == \"&\") {\n var ok;\n if (stream.eat(\"#\")) {\n if (stream.eat(\"x\")) {\n ok = stream.eatWhile(/[a-fA-F\\d]/) && stream.eat(\";\");\n } else {\n ok = stream.eatWhile(/[\\d]/) && stream.eat(\";\");\n }\n } else {\n ok = stream.eatWhile(/[\\w\\.\\-:]/) && stream.eat(\";\");\n }\n return ok ? \"atom\" : \"error\";\n } else {\n stream.eatWhile(/[^&<]/);\n return null;\n }\n }\n inText.isInText = true;\n\n function inTag(stream, state) {\n var ch = stream.next();\n if (ch == \">\" || (ch == \"/\" && stream.eat(\">\"))) {\n state.tokenize = inText;\n type = ch == \">\" ? \"endTag\" : \"selfcloseTag\";\n return \"tag bracket\";\n } else if (ch == \"=\") {\n type = \"equals\";\n return null;\n } else if (ch == \"<\") {\n state.tokenize = inText;\n state.state = baseState;\n state.tagName = state.tagStart = null;\n var next = state.tokenize(stream, state);\n return next ? next + \" tag error\" : \"tag error\";\n } else if (/[\\'\\\"]/.test(ch)) {\n state.tokenize = inAttribute(ch);\n state.stringStartCol = stream.column();\n return state.tokenize(stream, state);\n } else {\n stream.match(/^[^\\s\\u00a0=<>\\\"\\']*[^\\s\\u00a0=<>\\\"\\'\\/]/);\n return \"word\";\n }\n }\n\n function inAttribute(quote) {\n var closure = function(stream, state) {\n while (!stream.eol()) {\n if (stream.next() == quote) {\n state.tokenize = inTag;\n break;\n }\n }\n return \"string\";\n };\n closure.isInAttribute = true;\n return closure;\n }\n\n function inBlock(style, terminator) {\n return function(stream, state) {\n while (!stream.eol()) {\n if (stream.match(terminator)) {\n state.tokenize = inText;\n break;\n }\n stream.next();\n }\n return style;\n }\n }\n\n function doctype(depth) {\n return function(stream, state) {\n var ch;\n while ((ch = stream.next()) != null) {\n if (ch == \"<\") {\n state.tokenize = doctype(depth + 1);\n return state.tokenize(stream, state);\n } else if (ch == \">\") {\n if (depth == 1) {\n state.tokenize = inText;\n break;\n } else {\n state.tokenize = doctype(depth - 1);\n return state.tokenize(stream, state);\n }\n }\n }\n return \"meta\";\n };\n }\n\n function lower(tagName) {\n return tagName && tagName.toLowerCase();\n }\n\n function Context(state, tagName, startOfLine) {\n this.prev = state.context;\n this.tagName = tagName || \"\";\n this.indent = state.indented;\n this.startOfLine = startOfLine;\n if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))\n this.noIndent = true;\n }\n function popContext(state) {\n if (state.context) state.context = state.context.prev;\n }\n function maybePopContext(state, nextTagName) {\n var parentTagName;\n while (true) {\n if (!state.context) {\n return;\n }\n parentTagName = state.context.tagName;\n if (!config.contextGrabbers.hasOwnProperty(lower(parentTagName)) ||\n !config.contextGrabbers[lower(parentTagName)].hasOwnProperty(lower(nextTagName))) {\n return;\n }\n popContext(state);\n }\n }\n\n function baseState(type, stream, state) {\n if (type == \"openTag\") {\n state.tagStart = stream.column();\n return tagNameState;\n } else if (type == \"closeTag\") {\n return closeTagNameState;\n } else {\n return baseState;\n }\n }\n function tagNameState(type, stream, state) {\n if (type == \"word\") {\n state.tagName = stream.current();\n setStyle = \"tag\";\n return attrState;\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return attrState(type, stream, state);\n } else {\n setStyle = \"error\";\n return tagNameState;\n }\n }\n function closeTagNameState(type, stream, state) {\n if (type == \"word\") {\n var tagName = stream.current();\n if (state.context && state.context.tagName != tagName &&\n config.implicitlyClosed.hasOwnProperty(lower(state.context.tagName)))\n popContext(state);\n if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {\n setStyle = \"tag\";\n return closeState;\n } else {\n setStyle = \"tag error\";\n return closeStateErr;\n }\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return closeState(type, stream, state);\n } else {\n setStyle = \"error\";\n return closeStateErr;\n }\n }\n\n function closeState(type, _stream, state) {\n if (type != \"endTag\") {\n setStyle = \"error\";\n return closeState;\n }\n popContext(state);\n return baseState;\n }\n function closeStateErr(type, stream, state) {\n setStyle = \"error\";\n return closeState(type, stream, state);\n }\n\n function attrState(type, _stream, state) {\n if (type == \"word\") {\n setStyle = \"attribute\";\n return attrEqState;\n } else if (type == \"endTag\" || type == \"selfcloseTag\") {\n var tagName = state.tagName, tagStart = state.tagStart;\n state.tagName = state.tagStart = null;\n if (type == \"selfcloseTag\" ||\n config.autoSelfClosers.hasOwnProperty(lower(tagName))) {\n maybePopContext(state, tagName);\n } else {\n maybePopContext(state, tagName);\n state.context = new Context(state, tagName, tagStart == state.indented);\n }\n return baseState;\n }\n setStyle = \"error\";\n return attrState;\n }\n function attrEqState(type, stream, state) {\n if (type == \"equals\") return attrValueState;\n if (!config.allowMissing) setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrValueState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n if (type == \"word\" && config.allowUnquoted) {setStyle = \"string\"; return attrState;}\n setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrContinuedState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n return attrState(type, stream, state);\n }\n\n return {\n startState: function(baseIndent) {\n var state = {tokenize: inText,\n state: baseState,\n indented: baseIndent || 0,\n tagName: null, tagStart: null,\n context: null}\n if (baseIndent != null) state.baseIndent = baseIndent\n return state\n },\n\n token: function(stream, state) {\n if (!state.tagName && stream.sol())\n state.indented = stream.indentation();\n\n if (stream.eatSpace()) return null;\n type = null;\n var style = state.tokenize(stream, state);\n if ((style || type) && style != \"comment\") {\n setStyle = null;\n state.state = state.state(type || style, stream, state);\n if (setStyle)\n style = setStyle == \"error\" ? style + \" error\" : setStyle;\n }\n return style;\n },\n\n indent: function(state, textAfter, fullLine) {\n var context = state.context;\n // Indent multi-line strings (e.g. css).\n if (state.tokenize.isInAttribute) {\n if (state.tagStart == state.indented)\n return state.stringStartCol + 1;\n else\n return state.indented + indentUnit;\n }\n if (context && context.noIndent) return CodeMirror.Pass;\n if (state.tokenize != inTag && state.tokenize != inText)\n return fullLine ? fullLine.match(/^(\\s*)/)[0].length : 0;\n // Indent the starts of attribute names.\n if (state.tagName) {\n if (config.multilineTagIndentPastTag !== false)\n return state.tagStart + state.tagName.length + 2;\n else\n return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);\n }\n if (config.alignCDATA && /$/,\n blockCommentStart: \"\",\n\n configuration: config.htmlMode ? \"html\" : \"xml\",\n helperType: config.htmlMode ? \"html\" : \"xml\",\n\n skipAttribute: function(state) {\n if (state.state == attrValueState)\n state.state = attrState\n },\n\n xmlCurrentTag: function(state) {\n return state.tagName ? {name: state.tagName, close: state.type == \"closeTag\"} : null\n },\n\n xmlCurrentContext: function(state) {\n var context = []\n for (var cx = state.context; cx; cx = cx.prev)\n context.push(cx.tagName)\n return context.reverse()\n }\n };\n});\n\nCodeMirror.defineMIME(\"text/xml\", \"xml\");\nCodeMirror.defineMIME(\"application/xml\", \"xml\");\nif (!CodeMirror.mimeModes.hasOwnProperty(\"text/html\"))\n CodeMirror.defineMIME(\"text/html\", {name: \"xml\", htmlMode: true});\n\n});\n","import { Model, ObjectHash, SetOptions, CombinedModelConstructorOptions } from '../common';\nimport EditorModel from '../editor/model/Editor';\nimport Module, { IBaseModule } from './Module';\n\nexport default class ModuleModel<\n TModule extends IBaseModule = Module,\n T extends ObjectHash = any,\n S = SetOptions,\n E = any\n> extends Model {\n private _module: TModule;\n\n constructor(module: TModule, attributes?: T, options?: CombinedModelConstructorOptions) {\n super(attributes, options);\n this._module = module;\n }\n\n public get module() {\n return this._module;\n }\n\n public get config(): TModule extends IBaseModule ? C : unknown {\n return this._module.config;\n }\n\n public get em(): EditorModel {\n return this._module.em;\n }\n}\n","import CanvasModule from '..';\nimport { ModuleModel } from '../../abstract';\nimport { BoxRect, LiteralUnion } from '../../common';\nimport Component from '../../dom_components/model/Component';\nimport ComponentView from '../../dom_components/view/ComponentView';\nimport { GetBoxRectOptions } from '../types';\nimport Frame from './Frame';\n\nexport enum CanvasSpotBuiltInTypes {\n Select = 'select',\n Hover = 'hover',\n Spacing = 'spacing',\n Target = 'target',\n Resize = 'resize',\n}\n\nexport type CanvasSpotBuiltInType = `${CanvasSpotBuiltInTypes}`;\n\nexport type CanvasSpotType = LiteralUnion;\n\n/** @private */\nexport interface CanvasSpotBase {\n /**\n * Spot type, eg. `select`.\n */\n type: T;\n /**\n * Spot ID.\n */\n id: string;\n /**\n * Fixed box rect of the spot, eg. `{ width: 100, height: 100, x: 0, y: 0 }`.\n */\n boxRect?: BoxRect;\n /**\n * Component to which the spot will be attached.\n */\n component?: Component;\n /**\n * ComponentView to which the spot will be attached.\n */\n componentView?: ComponentView;\n frame?: Frame;\n}\n\nexport interface CanvasSpotProps extends CanvasSpotBase {}\n\n/**\n * Canvas spots are elements drawn on top of the canvas. They can be used to represent anything you\n * might need but the most common use case of canvas spots is rendering information and managing\n * components rendered in the canvas.\n * Read here for more information about [Canvas Spots](https://grapesjs.com/docs/modules/Canvas.html#canvas-spots)\n *\n * [Component]: component.html\n *\n * @property {String} id Spot ID.\n * @property {String} type Spot type.\n * @property {[Component]} [component] Component to which the spot will be attached.\n * @property {ComponentView} [componentView] ComponentView to which the spot will be attached.\n * @property {Object} [boxRect] Fixed box rect of the spot, eg. `{ width: 100, height: 100, x: 0, y: 0 }`.\n *\n */\nexport default class CanvasSpot extends ModuleModel {\n defaults() {\n return {\n id: '',\n type: '',\n } as T;\n }\n\n get type() {\n return this.get('type') || '';\n }\n\n get component() {\n const cmp = this.get('component');\n return cmp || this.get('componentView')?.model;\n }\n\n get componentView() {\n const cmpView = this.get('componentView');\n return cmpView || this.get('component')?.getView();\n }\n\n get el() {\n return this.componentView?.el;\n }\n\n /**\n * Get the box rect of the spot.\n * @param {Object} [opts={}]\n * @returns {Object} The box rect object\n * @example\n * canvasSpot.getBoxRect();\n * // { width: 100, height: 50, x: 0, y: 0 }\n */\n getBoxRect(opts?: GetBoxRectOptions) {\n const { el, em } = this;\n const cvView = em.Canvas.getCanvasView();\n const boxRect = this.get('boxRect');\n\n if (boxRect) {\n return boxRect;\n } else if (el && cvView) {\n return cvView.getElBoxRect(el, opts);\n }\n\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n }\n\n /**\n * Get the style object of the spot.\n * @param {Object} [opts={}]\n * @returns {CSSStyleDeclaration} [opts]\n * @example\n * canvasSpot.getStyle();\n * // { width: '100px', height: '...', ... }\n */\n getStyle(opts: { boxRect?: BoxRect } & GetBoxRectOptions = {}): Partial {\n const { width, height, x, y } = opts.boxRect || this.getBoxRect(opts);\n\n return {\n width: `${width}px`,\n height: `${height}px`,\n top: '0',\n left: '0',\n position: 'absolute',\n translate: `${x}px ${y}px`,\n };\n }\n\n /**\n * Check the spot type.\n * @param {String} type\n * @returns {Boolean}\n * @example\n * canvasSpot.isType('select');\n */\n isType(type: E['type']): this is CanvasSpot {\n return this.type === type;\n }\n}\n","/**{START_EVENTS}*/\nexport enum CommandsEvents {\n /**\n * @event `command:run` Triggered on run of any command.\n * @example\n * editor.on('command:run', ({ id, result, options }) => {\n * console.log('Command id', id, 'command result', result);\n * });\n */\n run = 'command:run',\n _run = 'run',\n\n /**\n * @event `command:run:COMMAND_ID` Triggered on run of a specific command.\n * @example\n * editor.on('command:run:my-command', ({ result, options }) => { ... });\n */\n runCommand = 'command:run:',\n _runCommand = 'run:',\n\n /**\n * @event `command:run:before:COMMAND_ID` Triggered before the command is called.\n * @example\n * editor.on('command:run:before:my-command', ({ options }) => { ... });\n */\n runBeforeCommand = 'command:run:before:',\n\n /**\n * @event `command:abort:COMMAND_ID` Triggered when the command execution is aborted.\n * @example\n * editor.on('command:abort:my-command', ({ options }) => { ... });\n *\n * // The command could be aborted during the before event\n * editor.on('command:run:before:my-command', ({ options }) => {\n * if (someCondition) {\n * options.abort = true;\n * }\n * });\n */\n abort = 'command:abort:',\n _abort = 'abort:',\n\n /**\n * @event `command:stop` Triggered on stop of any command.\n * @example\n * editor.on('command:stop', ({ id, result, options }) => {\n * console.log('Command id', id, 'command result', result);\n * });\n */\n stop = 'command:stop',\n _stop = 'stop',\n\n /**\n * @event `command:stop:COMMAND_ID` Triggered on stop of a specific command.\n * @example\n * editor.on('command:run:my-command', ({ result, options }) => { ... });\n */\n stopCommand = 'command:stop:',\n _stopCommand = 'stop:',\n\n /**\n * @event `command:stop:before:COMMAND_ID` Triggered before the command is called to stop.\n * @example\n * editor.on('command:stop:before:my-command', ({ options }) => { ... });\n */\n stopBeforeCommand = 'command:stop:before:',\n}\n/**{END_EVENTS}*/\n\n// need this to avoid the TS documentation generator to break\nexport default CommandsEvents;\n","import { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed) {\n ed.Components.clear();\n ed.Css.clear();\n },\n} as CommandObject;\n","import { bindAll } from 'underscore';\nimport Dragger from '../../utils/Dragger';\nimport { getKeyChar, off, on } from '../../utils/dom';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed) {\n bindAll(this, 'onKeyUp', 'enableDragger', 'disableDragger');\n this.editor = ed;\n this.canvasModel = this.canvas.getCanvasView().model;\n this.toggleMove(1);\n },\n stop(ed) {\n this.toggleMove();\n this.disableDragger();\n },\n\n onKeyUp(ev: KeyboardEvent) {\n if (getKeyChar(ev) === ' ') {\n this.editor.stopCommand(this.id);\n }\n },\n\n enableDragger(ev: Event) {\n this.toggleDragger(1, ev);\n },\n\n disableDragger(ev: Event) {\n this.toggleDragger(0, ev);\n },\n\n toggleDragger(enable: boolean, ev: Event) {\n const { canvasModel, em } = this;\n let { dragger } = this;\n const methodCls = enable ? 'add' : 'remove';\n this.getCanvas().classList[methodCls](`${this.ppfx}is__grabbing`);\n\n if (!dragger) {\n dragger = new Dragger({\n getPosition() {\n return {\n x: canvasModel.get('x'),\n y: canvasModel.get('y'),\n };\n },\n setPosition({ x, y }) {\n canvasModel.set({ x, y });\n },\n onStart(ev, dragger) {\n em.trigger('canvas:move:start', dragger);\n },\n onDrag(ev, dragger) {\n em.trigger('canvas:move', dragger);\n },\n onEnd(ev, dragger) {\n em.trigger('canvas:move:end', dragger);\n },\n });\n this.dragger = dragger;\n }\n\n enable ? dragger.start(ev) : dragger.stop();\n },\n\n toggleMove(enable: boolean) {\n const { ppfx } = this;\n const methodCls = enable ? 'add' : 'remove';\n const methodEv = enable ? 'on' : 'off';\n const methodsEv = { on, off };\n const canvas = this.getCanvas();\n const classes = [`${ppfx}is__grab`];\n !enable && classes.push(`${ppfx}is__grabbing`);\n classes.forEach(cls => canvas.classList[methodCls](cls));\n methodsEv[methodEv](document, 'keyup', this.onKeyUp);\n methodsEv[methodEv](canvas, 'mousedown', this.enableDragger);\n methodsEv[methodEv](document, 'mouseup', this.disableDragger);\n },\n} as CommandObject<\n any,\n {\n [key: string]: any;\n }\n>;\n","import CanvasModule from '../../canvas';\nimport { Model, ObjectAny } from '../../common';\nimport Editor from '../../editor';\nimport EditorModel from '../../editor/model/Editor';\nimport CommandsEvents from '../types';\n\ninterface ICommand {\n run?: CommandAbstract['run'];\n stop?: CommandAbstract['stop'];\n id?: string;\n [key: string]: unknown;\n}\n\nexport type CommandFunction = CommandAbstract['run'];\n\nexport type Command = CommandObject | CommandFunction;\n\nexport type CommandOptions = Record;\n\nexport type CommandObject = ICommand &\n T &\n ThisType>;\n\nexport function defineCommand(def: CommandObject) {\n return def;\n}\n\nexport default class CommandAbstract extends Model {\n config: any;\n em: EditorModel;\n pfx: string;\n ppfx: string;\n hoverClass: string;\n badgeClass: string;\n plhClass: string;\n freezClass: string;\n canvas: CanvasModule;\n\n constructor(o: any) {\n super(0);\n this.config = o || {};\n this.em = this.config.em || {};\n const pfx = this.config.stylePrefix;\n this.pfx = pfx;\n this.ppfx = this.config.pStylePrefix;\n this.hoverClass = `${pfx}hover`;\n this.badgeClass = `${pfx}badge`;\n this.plhClass = `${pfx}placeholder`;\n this.freezClass = `${this.ppfx}freezed`;\n this.canvas = this.em.Canvas;\n this.init(this.config);\n }\n\n /**\n * On frame scroll callback\n * @param {[type]} e [description]\n * @return {[type]} [description]\n */\n onFrameScroll(e: any) {}\n\n /**\n * Returns canval element\n * @return {HTMLElement}\n */\n getCanvas() {\n return this.canvas.getElement();\n }\n\n /**\n * Get canvas body element\n * @return {HTMLElement}\n */\n getCanvasBody() {\n return this.canvas.getBody();\n }\n\n /**\n * Get canvas wrapper element\n * @return {HTMLElement}\n */\n getCanvasTools() {\n return this.canvas.getToolsEl();\n }\n\n /**\n * Get the offset of the element\n * @param {HTMLElement} el\n * @return {Object}\n */\n offset(el: HTMLElement) {\n var rect = el.getBoundingClientRect();\n return {\n top: rect.top + el.ownerDocument.body.scrollTop,\n left: rect.left + el.ownerDocument.body.scrollLeft,\n };\n }\n\n /**\n * Callback triggered after initialize\n * @param {Object} o Options\n * @private\n * */\n init(o: any) {}\n\n /**\n * Method that run command\n * @param {Object} editor Editor instance\n * @param {Object} [options={}] Options\n * @private\n * */\n callRun(editor: Editor, options: any = {}) {\n const { id } = this;\n editor.trigger(`${CommandsEvents.runBeforeCommand}${id}`, { options });\n editor.trigger(`${CommandsEvents._runCommand}${id}:before`, options);\n\n if (options.abort) {\n editor.trigger(`${CommandsEvents.abort}${id}`, { options });\n editor.trigger(`${CommandsEvents._abort}${id}`, options);\n return;\n }\n\n const sender = options.sender || editor;\n const result = this.run(editor, sender, options);\n const data = { id, result, options };\n editor.trigger(`${CommandsEvents.runCommand}${id}`, data);\n editor.trigger(CommandsEvents.run, data);\n // deprecated\n editor.trigger(`${CommandsEvents._runCommand}${id}`, result, options);\n editor.trigger(CommandsEvents._run, id, result, options);\n return result;\n }\n\n /**\n * Method that run command\n * @param {Object} editor Editor instance\n * @param {Object} [options={}] Options\n * @private\n * */\n callStop(editor: Editor, options: any = {}) {\n const { id } = this;\n const sender = options.sender || editor;\n editor.trigger(`${CommandsEvents.stopBeforeCommand}${id}`, { options });\n editor.trigger(`${CommandsEvents._stopCommand}${id}:before`, options);\n const result = this.stop(editor, sender, options);\n const data = { id, result, options };\n editor.trigger(`${CommandsEvents.stopCommand}${id}`, data);\n editor.trigger(CommandsEvents.stop, data);\n\n // deprecated\n editor.trigger(`${CommandsEvents._stopCommand}${id}`, result, options);\n editor.trigger(CommandsEvents._stop, id, result, options);\n return result;\n }\n\n /**\n * Stop current command\n */\n stopCommand(opts?: any) {\n this.em.Commands.stop(this.id as string, opts);\n }\n\n /**\n * Method that run command\n * @param {Object} em Editor model\n * @param {Object} sender Button sender\n * @private\n * */\n run(em: Editor, sender: any, options: O) {}\n\n /**\n * Method that stop command\n * @param {Object} em Editor model\n * @param {Object} sender Button sender\n * @private\n * */\n stop(em: Editor, sender: any, options: O) {}\n}\n","import { isArray } from 'underscore';\nimport Component from '../../dom_components/model/Component';\nimport { CommandObject } from './CommandAbstract';\n\nconst command: CommandObject<{ component?: Component }> = {\n run(ed, s, opts = {}) {\n const removed: Component[] = [];\n let components = opts.component || ed.getSelectedAll();\n components = isArray(components) ? [...components] : [components];\n\n components.filter(Boolean).forEach(component => {\n if (!component.get('removable')) {\n return this.em.logWarning('The element is not removable', {\n component,\n });\n }\n\n removed.push(component);\n const cmp = component.delegate?.remove?.(component) || component;\n cmp.remove();\n });\n\n ed.selectRemove(removed);\n\n return removed;\n },\n};\n\nexport default command;\n","import { keys, bindAll, each, isUndefined, debounce } from 'underscore';\nimport Dragger from '../../utils/Dragger';\nimport { CommandObject } from './CommandAbstract';\n\ntype Rect = { left: number; width: number; top: number; height: number };\ntype OrigRect = { left: number; width: number; top: number; height: number; rect: Rect };\n\ntype Guide = {\n type: string;\n y: number;\n x: number;\n origin: HTMLElement;\n originRect: OrigRect;\n guide: HTMLElement;\n};\n\nconst evName = 'dmode';\n\nexport default {\n run(editor, sender, opts = {}) {\n bindAll(\n this,\n 'setPosition',\n 'onStart',\n 'onDrag',\n 'onEnd',\n 'getPosition',\n 'getGuidesStatic',\n 'renderGuide',\n 'getGuidesTarget'\n );\n const { target, event, mode, dragger = {} } = opts;\n const el = target.getEl();\n const config = {\n doc: el.ownerDocument,\n onStart: this.onStart,\n onEnd: this.onEnd,\n onDrag: this.onDrag,\n getPosition: this.getPosition,\n setPosition: this.setPosition,\n guidesStatic: () => this.guidesStatic,\n guidesTarget: () => this.guidesTarget,\n ...dragger,\n };\n this.setupGuides();\n this.opts = opts;\n this.editor = editor;\n this.em = editor.getModel();\n this.target = target;\n this.isTran = mode == 'translate';\n this.guidesContainer = this.getGuidesContainer();\n this.guidesTarget = this.getGuidesTarget();\n this.guidesStatic = this.getGuidesStatic();\n let drg = this.dragger;\n\n if (!drg) {\n drg = new Dragger(config);\n this.dragger = drg;\n } else {\n drg.setOptions(config);\n }\n\n event && drg.start(event);\n this.toggleDrag(1);\n this.em.trigger(`${evName}:start`, this.getEventOpts());\n\n return drg;\n },\n\n getEventOpts() {\n return {\n mode: this.opts.mode,\n target: this.target,\n guidesTarget: this.guidesTarget,\n guidesStatic: this.guidesStatic,\n };\n },\n\n stop() {\n this.toggleDrag();\n },\n\n setupGuides() {\n (this.guides || []).forEach((item: any) => {\n const { guide } = item;\n guide && guide.parentNode.removeChild(guide);\n });\n this.guides = [];\n },\n\n getGuidesContainer() {\n let { guidesEl } = this;\n\n if (!guidesEl) {\n const { editor, em, opts } = this;\n const pfx = editor.getConfig().stylePrefix;\n const elInfoX = document.createElement('div');\n const elInfoY = document.createElement('div');\n const guideContent = `
\n
\n
`;\n guidesEl = document.createElement('div');\n guidesEl.className = `${pfx}guides`;\n elInfoX.className = `${pfx}guide-info ${pfx}guide-info__x`;\n elInfoY.className = `${pfx}guide-info ${pfx}guide-info__y`;\n elInfoX.innerHTML = guideContent;\n elInfoY.innerHTML = guideContent;\n guidesEl.appendChild(elInfoX);\n guidesEl.appendChild(elInfoY);\n editor.Canvas.getGlobalToolsEl().appendChild(guidesEl);\n this.guidesEl = guidesEl;\n this.elGuideInfoX = elInfoX;\n this.elGuideInfoY = elInfoY;\n this.elGuideInfoContentX = elInfoX.querySelector(`.${pfx}guide-info__content`);\n this.elGuideInfoContentY = elInfoY.querySelector(`.${pfx}guide-info__content`);\n\n em.on(\n 'canvas:update frame:scroll',\n debounce(() => {\n this.updateGuides();\n opts.debug && this.guides?.forEach((item: any) => this.renderGuide(item));\n }, 200)\n );\n }\n\n return guidesEl;\n },\n\n getGuidesStatic() {\n let result: any = [];\n const el = this.target.getEl();\n const { parentNode = {} } = el;\n each(parentNode.children, item => (result = result.concat(el !== item ? this.getElementGuides(item) : [])));\n\n return result.concat(this.getElementGuides(parentNode));\n },\n\n getGuidesTarget() {\n return this.getElementGuides(this.target.getEl());\n },\n\n updateGuides(guides: any) {\n let lastEl: any;\n let lastPos: any;\n (guides || this.guides).forEach((item: any) => {\n const { origin } = item;\n const pos = lastEl === origin ? lastPos : this.getElementPos(origin);\n lastEl = origin;\n lastPos = pos;\n each(this.getGuidePosUpdate(item, pos), (val, key) => (item[key] = val));\n item.originRect = pos;\n });\n },\n\n getGuidePosUpdate(item: any, rect: any) {\n const result: { x?: number; y?: number } = {};\n const { top, height, left, width } = rect;\n\n switch (item.type) {\n case 't':\n result.y = top;\n break;\n case 'b':\n result.y = top + height;\n break;\n case 'l':\n result.x = left;\n break;\n case 'r':\n result.x = left + width;\n break;\n case 'x':\n result.x = left + width / 2;\n break;\n case 'y':\n result.y = top + height / 2;\n break;\n }\n\n return result;\n },\n\n renderGuide(item: any = {}) {\n const el = item.guide || document.createElement('div');\n const un = 'px';\n const guideSize = item.active ? 2 : 1;\n let numEl = el.children[0];\n el.style = `position: absolute; background-color: ${item.active ? 'green' : 'red'};`;\n\n if (!el.children.length) {\n numEl = document.createElement('div');\n numEl.style = 'position: absolute; color: red; padding: 5px; top: 0; left: 0;';\n el.appendChild(numEl);\n }\n\n if (item.y) {\n el.style.width = '100%';\n el.style.height = `${guideSize}${un}`;\n el.style.top = `${item.y}${un}`;\n el.style.left = 0;\n } else {\n el.style.width = `${guideSize}${un}`;\n el.style.height = '100%';\n el.style.left = `${item.x}${un}`;\n el.style.top = `0${un}`;\n }\n\n !item.guide && this.guidesContainer.appendChild(el);\n return el;\n },\n\n getElementPos(el: HTMLElement) {\n return this.editor.Canvas.getElementPos(el, { noScroll: 1 });\n },\n\n getElementGuides(el: HTMLElement) {\n const { opts } = this;\n const originRect = this.getElementPos(el);\n const { top, height, left, width } = originRect;\n // @ts-ignore\n const guides: Guide[] = [\n { type: 't', y: top }, // Top\n { type: 'b', y: top + height }, // Bottom\n { type: 'l', x: left }, // Left\n { type: 'r', x: left + width }, // Right\n { type: 'x', x: left + width / 2 }, // Mid x\n { type: 'y', y: top + height / 2 }, // Mid y\n ].map(item => ({\n ...item,\n origin: el,\n originRect,\n guide: opts.debug && this.renderGuide(item),\n }));\n guides.forEach(item => this.guides?.push(item));\n\n return guides;\n },\n\n getTranslate(transform: string, axis = 'x') {\n let result = 0;\n (transform || '').split(' ').forEach(item => {\n const itemStr = item.trim();\n const fn = `translate${axis.toUpperCase()}(`;\n if (itemStr.indexOf(fn) === 0) result = parseFloat(itemStr.replace(fn, ''));\n });\n return result;\n },\n\n setTranslate(transform: string, axis: string, value: string) {\n const fn = `translate${axis.toUpperCase()}(`;\n const val = `${fn}${value})`;\n let result = (transform || '')\n .split(' ')\n .map(item => {\n const itemStr = item.trim();\n if (itemStr.indexOf(fn) === 0) item = val;\n return item;\n })\n .join(' ');\n if (result.indexOf(fn) < 0) result += ` ${val}`;\n\n return result;\n },\n\n getPosition() {\n const { target, isTran } = this;\n const { left, top, transform } = target.getStyle();\n let x = 0;\n let y = 0;\n\n if (isTran) {\n x = this.getTranslate(transform);\n y = this.getTranslate(transform, 'y');\n } else {\n x = parseFloat(left || 0);\n y = parseFloat(top || 0);\n }\n\n return { x, y };\n },\n\n setPosition({ x, y, end, position, width, height }: any) {\n const { target, isTran, em } = this;\n const unit = 'px';\n const __p = !end; // Indicate if partial change\n const left = `${parseInt(x, 10)}${unit}`;\n const top = `${parseInt(y, 10)}${unit}`;\n let styleUp = {};\n\n if (isTran) {\n let transform = target.getStyle()['transform'] || '';\n transform = this.setTranslate(transform, 'x', left);\n transform = this.setTranslate(transform, 'y', top);\n styleUp = { transform, __p };\n target.addStyle(styleUp, { avoidStore: !end });\n } else {\n const adds: any = { position, width, height };\n const style: any = { left, top, __p };\n keys(adds).forEach(add => {\n const prop = adds[add];\n if (prop) style[add] = prop;\n });\n styleUp = style;\n target.addStyle(styleUp, { avoidStore: !end });\n }\n\n em?.Styles.__emitCmpStyleUpdate(styleUp, { components: em.getSelected() });\n },\n\n _getDragData() {\n const { target } = this;\n return {\n target,\n parent: target.parent(),\n index: target.index(),\n };\n },\n\n onStart(event: Event) {\n const { target, editor, isTran, opts } = this;\n const { center, onStart } = opts;\n const { Canvas } = editor;\n const style = target.getStyle();\n const position = 'absolute';\n const relPos = [position, 'relative'];\n onStart && onStart(this._getDragData());\n if (isTran) return;\n\n if (style.position !== position) {\n let { left, top, width, height } = Canvas.offset(target.getEl());\n let parent = target.parent();\n let parentRel;\n\n // Check for the relative parent\n do {\n const pStyle = parent.getStyle();\n parentRel = relPos.indexOf(pStyle.position) >= 0 ? parent : null;\n parent = parent.parent();\n } while (parent && !parentRel);\n\n // Center the target to the pointer position (used in Droppable for Blocks)\n if (center) {\n const { x, y } = Canvas.getMouseRelativeCanvas(event);\n left = x;\n top = y;\n } else if (parentRel) {\n const offsetP = Canvas.offset(parentRel.getEl());\n left = left - offsetP.left;\n top = top - offsetP.top;\n }\n\n this.setPosition({\n x: left,\n y: top,\n width: `${width}px`,\n height: `${height}px`,\n position,\n });\n }\n },\n\n onDrag(...args: any) {\n const { guidesTarget, opts } = this;\n const { onDrag } = opts;\n this.updateGuides(guidesTarget);\n opts.debug && guidesTarget.forEach((item: any) => this.renderGuide(item));\n opts.guidesInfo && this.renderGuideInfo(guidesTarget.filter((item: any) => item.active));\n onDrag && onDrag(this._getDragData());\n },\n\n onEnd(ev: Event, dragger: any, opt = {}) {\n const { editor, opts, id } = this;\n const { onEnd } = opts;\n onEnd && onEnd(ev, opt, { event: ev, ...opt, ...this._getDragData() });\n editor.stopCommand(id);\n this.hideGuidesInfo();\n this.em.trigger(`${evName}:end`, this.getEventOpts());\n },\n\n hideGuidesInfo() {\n ['X', 'Y'].forEach(item => {\n const guide = this[`elGuideInfo${item}`];\n if (guide) guide.style.display = 'none';\n });\n },\n\n /**\n * Render guides with spacing information\n */\n renderGuideInfo(guides: Guide[] = []) {\n const { guidesStatic } = this;\n this.hideGuidesInfo();\n guides.forEach(item => {\n const { origin, x } = item;\n const rectOrigin = this.getElementPos(origin);\n const axis = isUndefined(x) ? 'y' : 'x';\n const isY = axis === 'y';\n const origEdge1 = rectOrigin[isY ? 'left' : 'top'];\n const origEdge1Raw = rectOrigin.rect[isY ? 'left' : 'top'];\n const origEdge2 = isY ? origEdge1 + rectOrigin.width : origEdge1 + rectOrigin.height;\n const origEdge2Raw = isY ? origEdge1Raw + rectOrigin.rect.width : origEdge1Raw + rectOrigin.rect.height;\n const elGuideInfo = this[`elGuideInfo${axis.toUpperCase()}`];\n const elGuideInfoCnt = this[`elGuideInfoContent${axis.toUpperCase()}`];\n const guideInfoStyle = elGuideInfo.style;\n\n // Find the nearest element\n const res = guidesStatic\n ?.filter(stat => stat.type === item.type)\n .map(stat => {\n const { left, width, top, height } = stat.originRect;\n const statEdge1 = isY ? left : top;\n const statEdge2 = isY ? left + width : top + height;\n return {\n gap: statEdge2 < origEdge1 ? origEdge1 - statEdge2 : statEdge1 - origEdge2,\n guide: stat,\n };\n })\n .filter(item => item.gap > 0)\n .sort((a, b) => a.gap - b.gap)\n .map(item => item.guide)[0];\n\n if (res) {\n const { left, width, top, height, rect } = res.originRect;\n const isEdge1 = isY ? left < rectOrigin.left : top < rectOrigin.top;\n const statEdge1 = isY ? left : top;\n const statEdge1Raw = isY ? rect.left : rect.top;\n const statEdge2 = isY ? left + width : top + height;\n const statEdge2Raw = isY ? rect.left + rect.width : rect.top + rect.height;\n const posFirst = isY ? item.y : item.x;\n const posSecond = isEdge1 ? statEdge2 : origEdge2;\n const pos2 = `${posFirst}px`;\n const size = isEdge1 ? origEdge1 - statEdge2 : statEdge1 - origEdge2;\n const sizeRaw = isEdge1 ? origEdge1Raw - statEdge2Raw : statEdge1Raw - origEdge2Raw;\n guideInfoStyle.display = '';\n guideInfoStyle[isY ? 'top' : 'left'] = pos2;\n guideInfoStyle[isY ? 'left' : 'top'] = `${posSecond}px`;\n guideInfoStyle[isY ? 'width' : 'height'] = `${size}px`;\n elGuideInfoCnt.innerHTML = `${Math.round(sizeRaw)}px`;\n this.em.trigger(`${evName}:active`, {\n ...this.getEventOpts(),\n guide: item,\n guidesStatic,\n matched: res,\n posFirst,\n posSecond,\n size,\n sizeRaw,\n elGuideInfo,\n elGuideInfoCnt,\n });\n }\n });\n },\n\n toggleDrag(enable: boolean) {\n const { ppfx, editor } = this;\n const methodCls = enable ? 'add' : 'remove';\n const classes = [`${ppfx}is__grabbing`];\n const { Canvas } = editor;\n const body = Canvas.getBody();\n classes.forEach(cls => body.classList[methodCls](cls));\n Canvas[enable ? 'startAutoscroll' : 'stopAutoscroll']();\n },\n} as CommandObject<\n any,\n {\n guidesStatic?: Guide[];\n guides?: Guide[];\n [k: string]: any;\n }\n>;\n","import Component from '../../dom_components/model/Component';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed) {\n if (!ed.Canvas.hasFocus()) return;\n const toSelect: Component[] = [];\n\n ed.getSelectedAll().forEach(component => {\n const coll = component.components();\n const next = coll && coll.filter((c: any) => c.get('selectable'))[0];\n next && toSelect.push(next);\n });\n\n toSelect.length && ed.select(toSelect);\n },\n} as CommandObject;\n","import Component from '../../dom_components/model/Component';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed, snd, opts = {}) {\n if (!ed.Canvas.hasFocus() && !opts.force) return;\n const toSelect: Component[] = [];\n\n ed.getSelectedAll().forEach(component => {\n let next = component.parent();\n\n // Recurse through the parent() chain until a selectable parent is found\n while (next && !next.get('selectable')) {\n next = next.parent();\n }\n\n next && toSelect.push(next);\n });\n\n toSelect.length && ed.select(toSelect);\n },\n} as CommandObject;\n","import Component from '../../dom_components/model/Component';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed) {\n if (!ed.Canvas.hasFocus()) return;\n const toSelect: Component[] = [];\n\n ed.getSelectedAll().forEach(cmp => {\n const parent = cmp.parent();\n if (!parent) return;\n\n const len = parent.components().length;\n let incr = 0;\n let at = 0;\n let next: any;\n\n // Get the next selectable component\n do {\n incr++;\n at = cmp.index() + incr;\n next = at <= len ? parent.getChildAt(at) : null;\n } while (next && !next.get('selectable'));\n\n toSelect.push(next || cmp);\n });\n\n toSelect.length && ed.select(toSelect);\n },\n} as CommandObject;\n","import Component from '../../dom_components/model/Component';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed) {\n if (!ed.Canvas.hasFocus()) return;\n const toSelect: Component[] = [];\n\n ed.getSelectedAll().forEach(cmp => {\n const parent = cmp.parent();\n if (!parent) return;\n\n let incr = 0;\n let at = 0;\n let next: any;\n\n // Get the first selectable component\n do {\n incr++;\n at = cmp.index() - incr;\n next = at >= 0 ? parent.getChildAt(at) : null;\n } while (next && !next.get('selectable'));\n\n toSelect.push(next || cmp);\n });\n\n toSelect.length && ed.select(toSelect);\n },\n} as CommandObject;\n","import { flatten } from 'underscore';\nimport CssRule from '../../css_composer/model/CssRule';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed, s, opts = {}) {\n const { target } = opts;\n let toRemove: CssRule[] = [];\n\n if (!target.get('styles')) return toRemove;\n\n // Find all components in the project, of the target component type\n const type = target.get('type');\n const wrappers = ed.Pages.getAllWrappers();\n const len = flatten(wrappers.map(wrp => wrp.findType(type))).length;\n\n // Remove component related styles only if there are no more components\n // of that type in the project\n if (!len) {\n const rules = ed.CssComposer.getAll();\n toRemove = rules.filter(rule => rule.get('group') === `cmp:${type}`);\n rules.remove(toRemove);\n }\n\n return toRemove;\n },\n} as CommandObject;\n","import { CommandObject } from './CommandAbstract';\n\nexport default {\n run(ed) {\n const em = ed.getModel();\n const models = [...ed.getSelectedAll()].map(md => md.delegate?.copy?.(md) || md).filter(Boolean);\n models.length && em.set('clipboard', models);\n },\n} as CommandObject;\n","import { CommandObject } from './CommandAbstract';\nimport { EditorParam } from '../../editor';\nimport { createEl } from '../../utils/dom';\n\ninterface ExportTemplateRunOptions {\n optsHtml?: EditorParam<'getHtml', 0>;\n optsCss?: EditorParam<'getCss', 0>;\n}\n\nexport default {\n run(editor, sender, opts: ExportTemplateRunOptions = {}) {\n sender && sender.set && sender.set('active', 0);\n const config = editor.getConfig();\n const modal = editor.Modal;\n const pfx = config.stylePrefix;\n this.cm = editor.CodeManager || null;\n\n if (!this.editors) {\n const oHtmlEd = this.buildEditor('htmlmixed', 'hopscotch', 'HTML');\n const oCsslEd = this.buildEditor('css', 'hopscotch', 'CSS');\n this.htmlEditor = oHtmlEd.model;\n this.cssEditor = oCsslEd.model;\n const editors = createEl('div', { class: `${pfx}export-dl` });\n editors.appendChild(oHtmlEd.el);\n editors.appendChild(oCsslEd.el);\n this.editors = editors;\n }\n\n modal\n .open({\n title: config.textViewCode,\n content: this.editors,\n })\n .getModel()\n .once('change:open', () => editor.stopCommand(`${this.id}`));\n this.htmlEditor.setContent(editor.getHtml(opts.optsHtml));\n this.cssEditor.setContent(editor.getCss(opts.optsCss));\n },\n\n stop(editor) {\n const modal = editor.Modal;\n modal && modal.close();\n },\n\n buildEditor(codeName: string, theme: string, label: string) {\n const cm = this.em.CodeManager;\n const model = cm.createViewer({\n label,\n codeName,\n theme,\n });\n\n const el = new cm.EditorView({\n model,\n config: cm.getConfig(),\n } as any).render().el;\n\n return { model, el };\n },\n} as CommandObject<{}, { [k: string]: any }>;\n","import { isElement } from 'underscore';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n /**\n * Check if fullscreen mode is enabled\n * @return {Boolean}\n */\n isEnabled() {\n const d = document;\n // @ts-ignore\n if (d.fullscreenElement || d.webkitFullscreenElement || d.mozFullScreenElement) {\n return true;\n }\n return false;\n },\n\n /**\n * Enable fullscreen mode and return browser prefix\n * @param {HTMLElement} el\n * @return {string}\n */\n enable(el: any) {\n let pfx = '';\n\n if (el.requestFullscreen) {\n el.requestFullscreen();\n } else if (el.webkitRequestFullscreen) {\n pfx = 'webkit';\n el.webkitRequestFullscreen();\n } else if (el.mozRequestFullScreen) {\n pfx = 'moz';\n el.mozRequestFullScreen();\n } else if (el.msRequestFullscreen) {\n el.msRequestFullscreen();\n }\n\n return pfx;\n },\n\n /**\n * Disable fullscreen mode\n */\n disable() {\n const d: any = document;\n\n if (this.isEnabled()) {\n if (d.exitFullscreen) d.exitFullscreen();\n else if (d.webkitExitFullscreen) d.webkitExitFullscreen();\n else if (d.mozCancelFullScreen) d.mozCancelFullScreen();\n else if (d.msExitFullscreen) d.msExitFullscreen();\n }\n },\n\n /**\n * Triggered when the state of the fullscreen is changed. Inside detects if\n * it's enabled\n * @param {strinf} pfx Browser prefix\n * @param {Event} e\n */\n fsChanged(pfx: string) {\n if (!this.isEnabled()) {\n this.stopCommand({ sender: this.sender });\n document.removeEventListener(`${pfx || ''}fullscreenchange`, this.fsChanged);\n }\n },\n\n run(editor, sender, opts = {}) {\n this.sender = sender;\n const { target } = opts;\n const targetEl = isElement(target) ? target : document.querySelector(target!);\n const pfx = this.enable(targetEl || editor.getContainer());\n this.fsChanged = this.fsChanged.bind(this, pfx);\n document.addEventListener(pfx + 'fullscreenchange', this.fsChanged);\n },\n\n stop(editor, sender) {\n if (sender && sender.set) sender.set('active', false);\n this.disable();\n },\n} as CommandObject<{ target?: HTMLElement | string }, { [k: string]: any }>;\n","import { bindAll, extend } from 'underscore';\nimport { $ } from '../../common';\nimport Component from '../../dom_components/model/Component';\nimport { off, on } from '../../utils/dom';\nimport { CommandObject } from './CommandAbstract';\nimport SelectComponent from './SelectComponent';\nimport SelectPosition from './SelectPosition';\n\nexport default extend({}, SelectPosition, SelectComponent, {\n init(o: any) {\n SelectComponent.init.apply(this, arguments);\n bindAll(this, 'initSorter', 'rollback', 'onEndMove');\n this.opt = o;\n this.hoverClass = this.ppfx + 'highlighter-warning';\n this.badgeClass = this.ppfx + 'badge-warning';\n this.noSelClass = this.ppfx + 'no-select';\n },\n\n enable(...args: any) {\n SelectComponent.enable.apply(this, args);\n this.getBadgeEl().addClass(this.badgeClass);\n this.getHighlighterEl().addClass(this.hoverClass);\n var wp = this.$wrapper;\n wp.css('cursor', 'move');\n wp.on('mousedown', this.initSorter);\n\n // Avoid strange moving behavior\n wp.addClass(this.noSelClass);\n },\n\n /**\n * Overwrite for doing nothing\n * @private\n */\n toggleClipboard() {},\n\n /**\n * Delegate sorting\n * @param {Event} e\n * @private\n * */\n initSorter(e: any) {\n var el = $(e.target).data('model');\n var drag = el.get('draggable');\n if (!drag) return;\n\n // Avoid badge showing on move\n this.cacheEl = null;\n this.startSelectPosition(e.target, this.frameEl.contentDocument);\n this.sorter.draggable = drag;\n this.sorter.onEndMove = this.onEndMove.bind(this);\n this.stopSelectComponent();\n this.$wrapper.off('mousedown', this.initSorter);\n on(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n /**\n * Init sorter from model\n * @param {Object} model\n * @private\n */\n initSorterFromModel(model: Component) {\n var drag = model.get('draggable');\n if (!drag) return;\n // Avoid badge showing on move\n this.cacheEl = null;\n // @ts-ignore\n var el = model.view.el;\n this.startSelectPosition(el, this.frameEl.contentDocument);\n this.sorter.draggable = drag;\n this.sorter.onEndMove = this.onEndMoveFromModel.bind(this);\n\n /*\n this.sorter.setDragHelper(el);\n var dragHelper = this.sorter.dragHelper;\n dragHelper.className = this.ppfx + 'drag-helper';\n dragHelper.innerHTML = '';\n dragHelper.backgroundColor = 'white';\n */\n\n this.stopSelectComponent();\n on(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n /**\n * Init sorter from models\n * @param {Object} model\n * @private\n */\n initSorterFromModels(models: Component[]) {\n // TODO: if one only check for `draggable`\n // Avoid badge showing on move\n this.cacheEl = null;\n const lastModel = models[models.length - 1];\n const frameView = this.em.getCurrentFrame();\n const el = lastModel.getEl(frameView?.model)!;\n const doc = el.ownerDocument;\n this.startSelectPosition(el, doc, { onStart: this.onStart });\n this.sorter.draggable = lastModel.get('draggable');\n this.sorter.toMove = models;\n this.sorter.onMoveClb = this.onDrag;\n this.sorter.onEndMove = this.onEndMoveFromModel.bind(this);\n this.stopSelectComponent();\n on(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n onEndMoveFromModel() {\n off(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n /**\n * Callback after sorting\n * @private\n */\n onEndMove() {\n this.enable();\n off(this.getContentWindow(), 'keydown', this.rollback);\n },\n\n /**\n * Say what to do after the component was selected (selectComponent)\n * @param {Event} e\n * @param {Object} Selected element\n * @private\n * */\n onSelect(e: any, el: any) {},\n\n /**\n * Used to bring the previous situation before start moving the component\n * @param {Event} e\n * @param {Boolean} Indicates if rollback in anycase\n * @private\n * */\n rollback(e: any, force: boolean) {\n var key = e.which || e.keyCode;\n if (key == 27 || force) {\n this.sorter.moved = false;\n this.sorter.endMove();\n }\n return;\n },\n\n /**\n * Returns badge element\n * @return {HTMLElement}\n * @private\n */\n getBadgeEl() {\n if (!this.$badge) this.$badge = $(this.getBadge());\n return this.$badge;\n },\n\n /**\n * Returns highlighter element\n * @return {HTMLElement}\n * @private\n */\n getHighlighterEl() {\n if (!this.$hl) this.$hl = $(this.canvas.getHighlighter());\n return this.$hl;\n },\n\n stop(...args) {\n // @ts-ignore\n SelectComponent.stop.apply(this, args);\n this.getBadgeEl().removeClass(this.badgeClass);\n this.getHighlighterEl().removeClass(this.hoverClass);\n var wp = this.$wrapper;\n wp.css('cursor', '').unbind().removeClass(this.noSelClass);\n },\n} as CommandObject<{}, { [k: string]: any }>);\n","import { isFunction } from 'underscore';\nimport Asset from '../../asset_manager/model/Asset';\nimport { createEl } from '../../utils/dom';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n open(content: string) {\n const { editor, title, config, am } = this;\n const { custom } = config;\n if (isFunction(custom.open)) {\n return custom.open(am.__customData());\n }\n const { Modal } = editor;\n Modal.open({ title, content }).onceClose(() => editor.stopCommand(this.id));\n },\n\n close() {\n const { custom } = this.config;\n if (isFunction(custom.close)) {\n return custom.close(this.am.__customData());\n }\n const { Modal } = this.editor;\n Modal && Modal.close();\n },\n\n run(editor, sender, opts = {}) {\n const am = editor.AssetManager;\n const config = am.getConfig();\n const { types = [], accept, select } = opts;\n this.title = opts.modalTitle || editor.t('assetManager.modalTitle') || '';\n this.editor = editor;\n this.config = config;\n this.am = am;\n\n am.setTarget(opts.target);\n am.onClick(opts.onClick);\n am.onDblClick(opts.onDblClick);\n am.onSelect(opts.onSelect);\n am.__behaviour({\n select,\n types,\n options: opts,\n });\n\n if (config.custom) {\n this.rendered = this.rendered || createEl('div');\n this.rendered.className = `${config.stylePrefix}custom-wrp`;\n am.__behaviour({ container: this.rendered });\n am.__trgCustom();\n } else {\n if (!this.rendered || types) {\n let assets: Asset[] = am.getAll().filter((i: Asset) => i);\n\n if (types && types.length) {\n assets = assets.filter(a => types.indexOf(a.get('type')) !== -1);\n }\n\n am.render(assets);\n this.rendered = am.getContainer();\n }\n\n if (accept) {\n const uploadEl = this.rendered.querySelector(`input#${config.stylePrefix}uploadFile`);\n uploadEl && uploadEl.setAttribute('accept', accept);\n }\n }\n\n this.open(this.rendered);\n return this;\n },\n\n stop(editor) {\n this.editor = editor;\n this.close(this.rendered);\n },\n} as CommandObject;\n","import { isFunction } from 'underscore';\nimport { createEl } from '../../utils/dom';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n open() {\n const { container, editor, bm, config } = this;\n const { custom, appendTo } = config;\n\n if (isFunction(custom.open)) {\n return custom.open(bm.__customData());\n }\n\n if (this.firstRender && !appendTo) {\n const id = 'views-container';\n const pn = editor.Panels;\n const panels = pn.getPanel(id) || pn.addPanel({ id });\n panels.set('appendContent', container).trigger('change:appendContent');\n if (!custom) container.appendChild(bm.render());\n }\n\n if (container) container.style.display = 'block';\n },\n\n close() {\n const { container, config } = this;\n const { custom } = config;\n\n if (isFunction(custom.close)) {\n return custom.close(this.bm.__customData());\n }\n\n if (container) container.style.display = 'none';\n },\n\n run(editor) {\n const bm = editor.Blocks;\n this.config = bm.getConfig();\n this.firstRender = !this.container;\n this.container = this.container || createEl('div');\n this.editor = editor;\n this.bm = bm;\n const { container } = this;\n bm.__behaviour({\n container,\n });\n\n if (this.config.custom) {\n bm.__trgCustom();\n }\n\n this.open();\n },\n\n stop() {\n this.close();\n },\n} as CommandObject<{}, { [k: string]: any }>;\n","import { CommandObject } from './CommandAbstract';\n\nexport default {\n run(editor) {\n const lm = editor.LayerManager;\n const pn = editor.Panels;\n const lmConfig = lm.getConfig();\n\n if (lmConfig.appendTo) return;\n\n if (!this.layers) {\n const id = 'views-container';\n const layers = document.createElement('div');\n // @ts-ignore\n const panels = pn.getPanel(id) || pn.addPanel({ id });\n\n if (lmConfig.custom) {\n lm.__trgCustom({ container: layers });\n } else {\n layers.appendChild(lm.render());\n }\n\n panels.set('appendContent', layers).trigger('change:appendContent');\n this.layers = layers;\n }\n\n this.layers.style.display = 'block';\n },\n\n stop() {\n const { layers } = this;\n layers && (layers.style.display = 'none');\n },\n} as CommandObject<{}, { [k: string]: any }>;\n","import { $ } from '../../common';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(editor, sender) {\n this.sender = sender;\n\n if (!this.$cnt) {\n const config = editor.getConfig();\n const { Panels, DeviceManager, SelectorManager, StyleManager } = editor;\n const trgEvCnt = 'change:appendContent';\n const $cnt = $('
');\n const $cntInner = $('
');\n const $cntSlm = $('
');\n const $cntSm = $('
');\n this.$cnt = $cnt;\n this.$cntInner = $cntInner;\n $cntInner.append($cntSlm);\n $cntInner.append($cntSm);\n $cnt.append($cntInner);\n\n // Device Manager\n if (DeviceManager && config.showDevices) {\n const devicePanel = Panels.addPanel({ id: 'devices-c' });\n const dvEl = DeviceManager.render();\n devicePanel.set('appendContent', dvEl).trigger(trgEvCnt);\n }\n\n // Selector Manager container\n const slmConfig = SelectorManager.getConfig();\n if (slmConfig.custom) {\n SelectorManager.__trgCustom({ container: $cntSlm.get(0) });\n } else if (!slmConfig.appendTo) {\n $cntSlm.append(SelectorManager.render([]));\n }\n\n // Style Manager\n this.sm = StyleManager;\n const smConfig = StyleManager.getConfig();\n const pfx = smConfig.stylePrefix;\n this.$header = $(`
${editor.t('styleManager.empty')}
`);\n $cnt.append(this.$header);\n\n if (smConfig.custom) {\n StyleManager.__trgCustom({ container: $cntSm.get(0) });\n } else if (!smConfig.appendTo) {\n $cntSm.append(StyleManager.render());\n }\n\n // Create panel if not exists\n const pnCnt = 'views-container';\n const pnl = Panels.getPanel(pnCnt) || Panels.addPanel({ id: pnCnt });\n\n // Add all containers to the panel\n pnl.set('appendContent', $cnt).trigger(trgEvCnt);\n\n // Toggle Style Manager on target selection\n const em = editor.getModel();\n this.listenTo(em, StyleManager.events.target, this.toggleSm);\n }\n\n this.toggleSm();\n },\n\n /**\n * Toggle Style Manager visibility\n * @private\n */\n toggleSm() {\n const { sender, sm, $cntInner, $header } = this;\n if ((sender && sender.get && !sender.get('active')) || !sm) return;\n\n if (sm.getSelected()) {\n $cntInner?.show();\n $header?.hide();\n } else {\n $cntInner?.hide();\n $header?.show();\n }\n },\n\n stop() {\n this.$cntInner?.hide();\n this.$header?.hide();\n },\n} as CommandObject<{}, { [k: string]: any }>;\n","import { CommandObject } from './CommandAbstract';\nimport { $ } from '../../common';\n\nexport default {\n run(editor, sender) {\n this.sender = sender;\n const em = editor.getModel();\n\n const config = editor.Config;\n const pfx = config.stylePrefix;\n const tm = editor.TraitManager;\n const confTm = tm.getConfig();\n let panelC;\n\n if (confTm.appendTo) return;\n\n if (!this.$cn) {\n this.$cn = $('
');\n this.$cn2 = $('
');\n this.$cn.append(this.$cn2);\n this.$header = $('
').append(`
${em.t('traitManager.empty')}
`);\n this.$cn.append(this.$header);\n\n if (confTm.custom) {\n tm.__trgCustom({ container: this.$cn2.get(0) });\n } else {\n this.$cn2.append(`
${em.t('traitManager.label')}
`);\n this.$cn2.append(tm.render());\n }\n\n var panels = editor.Panels;\n\n if (!panels.getPanel('views-container')) {\n // @ts-ignore\n panelC = panels.addPanel({ id: 'views-container' });\n } else {\n panelC = panels.getPanel('views-container');\n }\n\n panelC?.set('appendContent', this.$cn.get(0)).trigger('change:appendContent');\n\n this.target = editor.getModel();\n this.listenTo(this.target, 'component:toggled', this.toggleTm);\n }\n\n this.toggleTm();\n },\n\n /**\n * Toggle Trait Manager visibility\n * @private\n */\n toggleTm() {\n const sender = this.sender;\n if (sender && sender.get && !sender.get('active')) return;\n\n if (this.target.getSelectedAll().length === 1) {\n this.$cn2.show();\n this.$header.hide();\n } else {\n this.$cn2.hide();\n this.$header.show();\n }\n },\n\n stop() {\n this.$cn2 && this.$cn2.hide();\n this.$header && this.$header.hide();\n },\n} as CommandObject<{}, { [k: string]: any }>;\n","import { isArray, contains } from 'underscore';\nimport Component from '../../dom_components/model/Component';\nimport { CommandObject } from './CommandAbstract';\nimport Editor from '../../editor';\n\nexport default {\n run(ed, s, opts = {}) {\n const em = ed.getModel();\n const clp: Component[] | null = em.get('clipboard');\n const lastSelected = ed.getSelected();\n\n if (clp?.length && lastSelected) {\n ed.getSelectedAll().forEach(sel => {\n const selected = sel.delegate?.copy?.(sel) || sel;\n const { collection } = selected;\n let added;\n if (collection) {\n const at = selected.index() + 1;\n const addOpts = { at, action: opts.action || 'paste-component' };\n\n if (contains(clp, selected) && selected.get('copyable')) {\n added = collection.add(selected.clone(), addOpts);\n } else {\n added = doAdd(ed, clp, selected.parent()!, addOpts);\n }\n } else {\n // Page body is selected\n // Paste at the end of the body\n const pageBody = em.Pages.getSelected()?.getMainComponent();\n const addOpts = { at: pageBody?.components().length || 0, action: opts.action || 'paste-component' };\n\n added = doAdd(ed, clp, pageBody as Component, addOpts);\n }\n\n added = isArray(added) ? added : [added];\n added.forEach(add => ed.trigger('component:paste', add));\n });\n\n lastSelected.emitUpdate();\n }\n },\n} as CommandObject;\n\nfunction doAdd(ed: Editor, clp: Component[], parent: Component, addOpts: any): Component[] | Component {\n const copyable = clp.filter(cop => cop.get('copyable'));\n const pasteable = copyable.filter(cop => ed.Components.canMove(parent, cop).result);\n return parent.components().add(\n pasteable.map(cop => cop.clone()),\n addOpts\n );\n}\n","import { each } from 'underscore';\nimport Editor from '../../editor';\nimport { CommandObject } from './CommandAbstract';\n\nconst cmdOutline = 'core:component-outline';\n\nexport default {\n getPanels(editor: Editor) {\n if (!this.panels) {\n this.panels = editor.Panels.getPanels();\n }\n\n return this.panels;\n },\n\n preventDrag(opts: any) {\n opts.abort = 1;\n },\n\n tglEffects(on: boolean) {\n const { em } = this;\n const mthEv = on ? 'on' : 'off';\n if (em) {\n const canvas = em.Canvas;\n const body = canvas.getBody();\n const tlb = canvas.getToolbarEl();\n tlb && (tlb.style.display = on ? 'none' : '');\n const elP = body.querySelectorAll(`.${this.ppfx}no-pointer`);\n each(elP, item => ((item as HTMLElement).style.pointerEvents = on ? 'all' : ''));\n em[mthEv]('run:tlb-move:before', this.preventDrag);\n }\n },\n\n run(editor, sender) {\n this.sender = sender;\n this.selected = [...editor.getSelectedAll()];\n editor.select();\n\n if (!this.shouldRunSwVisibility) {\n this.shouldRunSwVisibility = editor.Commands.isActive(cmdOutline);\n }\n\n this.shouldRunSwVisibility && editor.stopCommand(cmdOutline);\n editor.getModel().stopDefault();\n\n const panels = this.getPanels(editor);\n const canvas = editor.Canvas.getElement();\n const editorEl = editor.getEl()!;\n const pfx = editor.Config.stylePrefix;\n\n if (!this.helper) {\n const helper = document.createElement('span');\n helper.className = `${pfx}off-prv fa fa-eye-slash`;\n editorEl.appendChild(helper);\n helper.onclick = () => this.stopCommand();\n this.helper = helper;\n }\n\n this.helper.style.display = 'inline-block';\n\n panels.forEach((panel: any) => panel.set('visible', false));\n\n const canvasS = canvas.style;\n canvasS.width = '100%';\n canvasS.height = '100%';\n canvasS.top = '0';\n canvasS.left = '0';\n canvasS.padding = '0';\n canvasS.margin = '0';\n editor.refresh();\n this.tglEffects(1);\n },\n\n stop(editor) {\n const { sender = {}, selected } = this;\n sender.set && sender.set('active', 0);\n const panels = this.getPanels(editor);\n\n if (this.shouldRunSwVisibility) {\n editor.runCommand(cmdOutline);\n this.shouldRunSwVisibility = false;\n }\n\n editor.getModel().runDefault();\n panels.forEach((panel: any) => panel.set('visible', true));\n\n const canvas = editor.Canvas.getElement();\n canvas.setAttribute('style', '');\n selected && editor.select(selected);\n delete this.selected;\n\n if (this.helper) {\n this.helper.style.display = 'none';\n }\n\n editor.refresh();\n this.tglEffects();\n },\n} as CommandObject<{}, { [k: string]: any }>;\n","import Resizer, { ResizerOptions } from '../../utils/Resizer';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n run(editor, sender, opts) {\n const opt = opts || {};\n const canvas = editor.Canvas;\n const canvasView = canvas.getCanvasView();\n const options: ResizerOptions = {\n appendTo: canvas.getResizerEl(),\n prefix: editor.getConfig().stylePrefix,\n posFetcher: canvasView.getElementPos.bind(canvasView),\n mousePosFetcher: canvas.getMouseRelativePos.bind(canvas),\n ...(opt.options || {}),\n };\n let { canvasResizer } = this;\n\n // Create the resizer for the canvas if not yet created\n if (!canvasResizer || opt.forceNew) {\n this.canvasResizer = new editor.Utils.Resizer(options);\n canvasResizer = this.canvasResizer;\n }\n\n canvasResizer.setOptions(options, true);\n canvasResizer.blur();\n canvasResizer.focus(opt.el);\n return canvasResizer;\n },\n\n stop() {\n this.canvasResizer?.blur();\n },\n} as CommandObject<{ options?: {}; forceNew?: boolean; el: HTMLElement }, { canvasResizer?: Resizer }>;\n","import { CommandFunction } from '../../commands/view/CommandAbstract';\nimport { Model, ObjectAny } from '../../common';\n\nexport interface ToolbarButtonProps {\n /**\n * Command name.\n */\n command: CommandFunction | string;\n\n /**\n * Button label.\n */\n label?: string;\n\n id?: string;\n attributes?: ObjectAny;\n events?: ObjectAny;\n}\n\nexport default class ToolbarButton extends Model {\n defaults() {\n return {\n command: '',\n attributes: {},\n };\n }\n}\n","import { Collection } from '../../common';\nimport ToolbarButton from './ToolbarButton';\n\nexport default class Toolbar extends Collection {}\n\nToolbar.prototype.model = ToolbarButton;\n","import { isFunction, isString } from 'underscore';\nimport { View } from '../../common';\nimport EditorModel from '../../editor/model/Editor';\nimport ToolbarButton from '../model/ToolbarButton';\n\nexport type ToolbarViewProps = { em: EditorModel };\n\nexport default class ToolbarButtonView extends View {\n em: EditorModel;\n\n events() {\n return (\n this.model.get('events') || {\n mousedown: 'handleClick',\n }\n );\n }\n\n // @ts-ignore\n attributes() {\n return this.model.get('attributes');\n }\n\n constructor(props: { config: ToolbarViewProps; model: ToolbarButton }) {\n super(props);\n this.em = props.config.em;\n }\n\n handleClick(event: MouseEvent) {\n event.preventDefault();\n event.stopPropagation();\n\n /*\n * Since the toolbar lives outside the canvas frame, the event's\n * generated on it have clientX and clientY relative to the page.\n *\n * This causes issues during events like dragging, where they depend\n * on the clientX and clientY.\n *\n * This makes sure the offsets are calculated.\n *\n * More information on\n * https://github.com/GrapesJS/grapesjs/issues/2372\n * https://github.com/GrapesJS/grapesjs/issues/2207\n */\n\n const { em } = this;\n const { left, top } = em.Canvas.getFrameEl().getBoundingClientRect();\n const ev = {\n ...event,\n clientX: event.clientX - left,\n clientY: event.clientY - top,\n };\n\n em.trigger('toolbar:run:before', { event: ev });\n this.execCommand(ev);\n }\n\n execCommand(event: MouseEvent) {\n const { em, model } = this;\n const opts = { event };\n const command = model.get('command');\n const editor = em.Editor;\n\n if (isFunction(command)) {\n command(editor, null, opts);\n }\n\n if (isString(command)) {\n editor.runCommand(command, opts);\n }\n }\n\n render() {\n const { em, $el, model } = this;\n const id = model.get('id');\n const label = model.get('label');\n const pfx = em.getConfig().stylePrefix;\n $el.addClass(`${pfx}toolbar-item`);\n id && $el.addClass(`${pfx}toolbar-item__${id}`);\n label && $el.append(label);\n return this;\n }\n}\n","import DomainViews from '../../domain_abstract/view/DomainViews';\nimport EditorModel from '../../editor/model/Editor';\nimport ToolbarButtonView, { ToolbarViewProps } from './ToolbarButtonView';\n\nexport default class ToolbarView extends DomainViews {\n em: EditorModel;\n\n constructor(opts: ToolbarViewProps) {\n super(opts);\n const { em } = opts;\n this.em = em;\n this.config = { em };\n this.listenTo(this.collection, 'reset', this.render);\n }\n\n onRender() {\n const pfx = this.em.config.stylePrefix!;\n this.el.className = `${pfx}toolbar-items`;\n }\n}\n\n// @ts-ignore\nToolbarView.prototype.itemView = ToolbarButtonView;\n","import { bindAll, debounce, isElement } from 'underscore';\nimport Component from '../../dom_components/model/Component';\nimport Toolbar from '../../dom_components/model/Toolbar';\nimport ToolbarView from '../../dom_components/view/ToolbarView';\nimport { isDoc, isTaggableNode, isVisible, off, on } from '../../utils/dom';\nimport { getComponentModel, getComponentView, getUnitFromValue, getViewEl, hasWin, isObject } from '../../utils/mixins';\nimport { CommandObject } from './CommandAbstract';\nimport { CanvasSpotBuiltInTypes } from '../../canvas/model/CanvasSpot';\nimport { ResizerOptions } from '../../utils/Resizer';\nimport { ComponentsEvents } from '../../dom_components/types';\n\nlet showOffsets: boolean;\n/**\n * This command is responsible for show selecting components and displaying\n * all the necessary tools around (component toolbar, badge, highlight box, etc.)\n *\n * The command manages different boxes to display tools and when something in\n * the canvas is updated, the command triggers the appropriate method to update\n * their position (across multiple frames/components):\n * - Global Tools (updateToolsGlobal/updateGlobalPos)\n * This box contains tools intended to be displayed only on ONE component per time,\n * like Component Toolbar (updated by updateToolbar/updateToolbarPos), this means\n * you won't be able to see more than one Component Toolbar (even with multiple\n * frames or multiple selected components)\n * - Local Tools (updateToolsLocal/updateLocalPos)\n * Each frame in the canvas has its own local box, so we're able to see more than\n * one active container at the same time. When you put a mouse over an element\n * you can see stuff like the highlight box, badge, margins/paddings offsets, etc.\n * so those elements are inside the Local Tools box\n *\n *\n */\nexport default {\n activeResizer: false,\n\n init() {\n this.onSelect = debounce(this.onSelect, 0);\n bindAll(\n this,\n 'onHover',\n 'onOut',\n 'onClick',\n 'onFrameScroll',\n 'onFrameResize',\n 'onFrameUpdated',\n 'onContainerChange'\n );\n },\n\n enable() {\n this.frameOff = this.canvasOff = this.adjScroll = null;\n this.startSelectComponent();\n showOffsets = true;\n },\n\n /**\n * Start select component event\n * @private\n * */\n startSelectComponent() {\n this.toggleSelectComponent(1);\n this.em.getSelected() && this.onSelect();\n },\n\n /**\n * Stop select component event\n * @private\n * */\n stopSelectComponent() {\n this.toggleSelectComponent();\n },\n\n /**\n * Toggle select component event\n * @private\n * */\n toggleSelectComponent(enable: boolean) {\n const { em } = this;\n const listenToEl = em.getConfig().listenToEl!;\n const { parentNode } = em.getContainer()!;\n const method = enable ? 'on' : 'off';\n const methods = { on, off };\n const eventCmpUpdate = ComponentsEvents.update;\n !listenToEl.length && parentNode && listenToEl.push(parentNode as HTMLElement);\n const trigger = (win: Window, body: HTMLBodyElement) => {\n methods[method](body, 'mouseover', this.onHover);\n methods[method](body, 'mouseleave', this.onOut);\n methods[method](body, 'click', this.onClick);\n methods[method](win, 'scroll', this.onFrameScroll, true);\n methods[method](win, 'resize', this.onFrameResize);\n };\n methods[method](window, 'resize', this.onFrameUpdated);\n methods[method](listenToEl, 'scroll', this.onContainerChange);\n em[method](`component:toggled ${eventCmpUpdate} undo redo`, this.onSelect, this);\n em[method]('change:componentHovered', this.onHovered, this);\n em[method]('component:resize styleable:change component:input', this.updateGlobalPos, this);\n em[method](`${eventCmpUpdate}:toolbar`, this._upToolbar, this);\n em[method]('frame:updated', this.onFrameUpdated, this);\n em[method]('canvas:updateTools', this.onFrameUpdated, this);\n em[method](em.Canvas.events.refresh, this.updateAttached, this);\n em.Canvas.getFrames().forEach(frame => {\n const { view } = frame;\n const win = view?.getWindow();\n win && trigger(win, view?.getBody()!);\n });\n },\n\n /**\n * Hover command\n * @param {Object} e\n * @private\n */\n onHover(ev: Event) {\n ev.stopPropagation();\n const { em } = this;\n const el = ev.target as HTMLElement;\n const view = getComponentView(el);\n const frameView = view?.frameView;\n let model = view?.model;\n\n // Get first valid model\n if (!model) {\n let parentEl = el.parentNode;\n while (!model && parentEl && !isDoc(parentEl)) {\n model = getComponentModel(parentEl);\n parentEl = parentEl.parentNode;\n }\n }\n\n this.currentDoc = el.ownerDocument;\n em.setHovered(model, { useValid: true });\n frameView && em.setCurrentFrame(frameView);\n },\n\n onFrameUpdated() {\n this.updateLocalPos();\n this.updateGlobalPos();\n },\n\n onHovered(em: any, component: Component) {\n let result = {};\n\n if (component) {\n component.views?.forEach(view => {\n const el = view.el;\n const pos = this.getElementPos(el);\n result = { el, pos, component, view: getViewEl(el) };\n\n if (el.ownerDocument === this.currentDoc) {\n this.elHovered = result;\n }\n\n this.updateToolsLocal(result);\n });\n } else {\n this.currentDoc = null;\n this.elHovered = 0;\n this.updateToolsLocal();\n this.canvas.getFrames().forEach(frame => {\n const { view } = frame;\n const el = view && view.getToolsEl();\n el && this.toggleToolsEl(0, 0, { el });\n });\n }\n },\n\n /**\n * Say what to do after the component was selected\n * @param {Object} e\n * @param {Object} el\n * @private\n * */\n onSelect() {\n const { em } = this;\n const component = em.getSelected();\n const currentFrame = em.getCurrentFrame();\n const view = component && component.getView(currentFrame?.model);\n let el = view && view.el;\n let result = {};\n\n if (el && isVisible(el)) {\n const pos = this.getElementPos(el);\n result = { el, pos, component, view: getViewEl(el) };\n }\n\n this.elSelected = result;\n this.updateToolsGlobal();\n // This will hide some elements from the select component\n this.updateLocalPos(result);\n this.initResize(component);\n },\n\n updateGlobalPos() {\n const sel = this.getElSelected();\n if (!sel.el) return;\n sel.pos = this.getElementPos(sel.el);\n this.updateToolsGlobal();\n },\n\n updateLocalPos(data: any) {\n const sel = this.getElHovered();\n if (!sel.el) return;\n sel.pos = this.getElementPos(sel.el);\n this.updateToolsLocal(data);\n },\n\n getElHovered() {\n return this.elHovered || {};\n },\n\n getElSelected() {\n return this.elSelected || {};\n },\n\n onOut() {\n this.em.setHovered();\n },\n\n toggleToolsEl(on: boolean, view: any, opts: any = {}) {\n const el = opts.el || this.canvas.getToolsEl(view);\n el && (el.style.display = on ? '' : 'none');\n return el || {};\n },\n\n /**\n * Show element offset viewer\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n showElementOffset(el: HTMLElement, pos: any, opts: any = {}) {\n if (!showOffsets) return;\n this.editor.runCommand('show-offset', {\n el,\n elPos: pos,\n view: opts.view,\n force: 1,\n top: 0,\n left: 0,\n });\n },\n\n /**\n * Hide element offset viewer\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n hideElementOffset(view: any) {\n this.editor.stopCommand('show-offset', {\n view,\n });\n },\n\n /**\n * Show fixed element offset viewer\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n showFixedElementOffset(el: HTMLElement, pos: any) {\n this.editor.runCommand('show-offset', {\n el,\n elPos: pos,\n state: 'Fixed',\n });\n },\n\n /**\n * Hide fixed element offset viewer\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n hideFixedElementOffset() {\n if (this.editor) this.editor.stopCommand('show-offset', { state: 'Fixed' });\n },\n\n /**\n * Hide Highlighter element\n */\n hideHighlighter(view: any) {\n this.canvas.getHighlighter(view).style.opacity = 0;\n },\n\n /**\n * On element click\n * @param {Event} e\n * @private\n */\n onClick(ev: Event) {\n ev.stopPropagation();\n ev.preventDefault();\n const { em } = this;\n\n if (em.get('_cmpDrag')) return em.set('_cmpDrag');\n\n const el = ev.target as HTMLElement;\n let cmp = getComponentModel(el);\n\n if (!cmp) {\n let parentEl = el.parentNode;\n\n while (!cmp && parentEl && !isDoc(parentEl)) {\n cmp = getComponentModel(parentEl);\n parentEl = parentEl.parentNode;\n }\n }\n\n if (cmp) {\n if (\n em.isEditing() &&\n // Avoid selection of inner text components during editing\n ((!cmp.get('textable') && cmp.isChildOf('text')) ||\n // Prevents selecting another component if the pointer was pressed and\n // dragged outside of the editing component\n em.getEditing() !== cmp)\n ) {\n return;\n }\n\n this.select(cmp, ev);\n }\n },\n\n /**\n * Select component\n * @param {Component} model\n * @param {Event} event\n */\n select(model: Component, event = {}) {\n if (!model) return;\n this.editor.select(model, { event, useValid: true });\n this.initResize(model);\n },\n\n /**\n * Update badge for the component\n * @param {Object} Component\n * @param {Object} pos Position object\n * @private\n * */\n updateBadge(el: HTMLElement, pos: any, opts: any = {}) {\n const { canvas } = this;\n const model = getComponentModel(el);\n const badge = this.getBadge(opts);\n const bStyle = badge.style;\n\n if (!model || !model.get('badgable')) {\n bStyle.display = 'none';\n return;\n }\n\n if (!opts.posOnly) {\n const config = this.canvas.getConfig();\n const icon = model.getIcon();\n const ppfx = config.pStylePrefix || '';\n const clsBadge = `${ppfx}badge`;\n const customeLabel = config.customBadgeLabel;\n const badgeLabel = `${icon ? `
${icon}
` : ''}\n
${model.getName()}
`;\n badge.innerHTML = customeLabel ? customeLabel(model) : badgeLabel;\n }\n\n const un = 'px';\n bStyle.display = 'block';\n\n const targetToElem = canvas.getTargetToElementFixed(el, badge, {\n pos: pos,\n });\n\n const top = targetToElem.top; //opts.topOff - badgeH < 0 ? -opts.topOff : posTop;\n const left = opts.leftOff < 0 ? -opts.leftOff : 0;\n\n bStyle.top = top + un;\n bStyle.left = left + un;\n },\n\n /**\n * Update highlighter element\n * @param {HTMLElement} el\n * @param {Object} pos Position object\n * @private\n */\n showHighlighter(view: any) {\n this.canvas.getHighlighter(view).style.opacity = '';\n },\n\n /**\n * Init resizer on the element if possible\n * @param {HTMLElement|Component} elem\n * @private\n */\n initResize(elem: HTMLElement) {\n const { em, canvas } = this;\n const editor = em.Editor;\n const model = !isElement(elem) && isTaggableNode(elem) ? elem : em.getSelected();\n const resizable = model?.get('resizable');\n const spotTypeResize = CanvasSpotBuiltInTypes.Resize;\n const hasCustomResize = canvas.hasCustomSpot(spotTypeResize);\n canvas.removeSpots({ type: spotTypeResize });\n\n if (model && resizable) {\n canvas.addSpot({ type: spotTypeResize, component: model });\n const el = isElement(elem) ? elem : model.getEl();\n const {\n onStart = () => {},\n onMove = () => {},\n onEnd = () => {},\n updateTarget = () => {},\n ...resizableOpts\n } = isObject(resizable) ? resizable : {};\n\n if (hasCustomResize || !el || this.activeResizer) return;\n\n let modelToStyle: any;\n const { config } = em;\n const pfx = config.stylePrefix || '';\n const resizeClass = `${pfx}resizing`;\n const self = this;\n const resizeEventOpts = {\n component: model,\n el,\n };\n\n const toggleBodyClass = (method: string, e: any, opts: any) => {\n const docs = opts.docs;\n docs &&\n docs.forEach((doc: Document) => {\n const body = doc.body;\n const cls = body.className || '';\n body.className = (method == 'add' ? `${cls} ${resizeClass}` : cls.replace(resizeClass, '')).trim();\n });\n };\n\n const options: ResizerOptions = {\n // Here the resizer is updated with the current element height and width\n onStart(ev, opts) {\n onStart(ev, opts);\n const { el, config, resizer } = opts;\n const { keyHeight, keyWidth, currentUnit, keepAutoHeight, keepAutoWidth } = config;\n toggleBodyClass('add', ev, opts);\n modelToStyle = em.Styles.getModelToStyle(model);\n canvas.toggleFramesEvents(false);\n const computedStyle = getComputedStyle(el);\n const modelStyle = modelToStyle.getStyle();\n\n let currentWidth = modelStyle[keyWidth];\n config.autoWidth = keepAutoWidth && currentWidth === 'auto';\n if (isNaN(parseFloat(currentWidth))) {\n currentWidth = computedStyle[keyWidth];\n }\n\n let currentHeight = modelStyle[keyHeight];\n config.autoHeight = keepAutoHeight && currentHeight === 'auto';\n if (isNaN(parseFloat(currentHeight))) {\n currentHeight = computedStyle[keyHeight];\n }\n\n resizer.startDim!.w = parseFloat(currentWidth);\n resizer.startDim!.h = parseFloat(currentHeight);\n showOffsets = false;\n\n if (currentUnit) {\n config.unitHeight = getUnitFromValue(currentHeight);\n config.unitWidth = getUnitFromValue(currentWidth);\n }\n self.activeResizer = true;\n editor.trigger('component:resize', { ...resizeEventOpts, type: 'start' });\n },\n\n // Update all positioned elements (eg. component toolbar)\n onMove(ev) {\n onMove(ev);\n editor.trigger('component:resize', { ...resizeEventOpts, type: 'move' });\n },\n\n onEnd(ev, opts) {\n onEnd(ev, opts);\n toggleBodyClass('remove', ev, opts);\n editor.trigger('component:resize', { ...resizeEventOpts, type: 'end' });\n canvas.toggleFramesEvents(true);\n showOffsets = true;\n self.activeResizer = false;\n },\n\n updateTarget(el, rect, options) {\n updateTarget(el, rect, options);\n if (!modelToStyle) {\n return;\n }\n\n const { store, selectedHandler, config } = options;\n const { keyHeight, keyWidth, autoHeight, autoWidth, unitWidth, unitHeight } = config;\n const onlyHeight = ['tc', 'bc'].indexOf(selectedHandler!) >= 0;\n const onlyWidth = ['cl', 'cr'].indexOf(selectedHandler!) >= 0;\n const style: any = {};\n\n if (!onlyHeight) {\n const bodyw = canvas.getBody().offsetWidth;\n const width = rect.w < bodyw ? rect.w : bodyw;\n style[keyWidth!] = autoWidth ? 'auto' : `${width}${unitWidth}`;\n }\n\n if (!onlyWidth) {\n style[keyHeight!] = autoHeight ? 'auto' : `${rect.h}${unitHeight}`;\n }\n\n if (em.getDragMode(model)) {\n style.top = `${rect.t}${unitHeight}`;\n style.left = `${rect.l}${unitWidth}`;\n }\n\n const finalStyle = {\n ...style,\n // value for the partial update\n __p: !store,\n };\n modelToStyle.addStyle(finalStyle, { avoidStore: !store });\n em.Styles.__emitCmpStyleUpdate(finalStyle, { components: em.getSelected() });\n },\n ...resizableOpts,\n };\n\n this.resizer = editor.runCommand('resize', { el, options, force: 1 });\n } else {\n if (hasCustomResize) return;\n\n editor.stopCommand('resize');\n this.resizer = null;\n }\n },\n\n /**\n * Update toolbar if the component has one\n * @param {Object} mod\n */\n updateToolbar(mod: Component) {\n const { canvas } = this;\n const { em } = this.config;\n const model = mod === em ? em.getSelected() : mod;\n const toolbarEl = canvas.getToolbarEl()!;\n const toolbarStyle = toolbarEl.style;\n const toolbar = model.get('toolbar');\n const showToolbar = em.config.showToolbar;\n const noCustomSpotSelect = !canvas.hasCustomSpot(CanvasSpotBuiltInTypes.Select);\n\n if (model && showToolbar && toolbar && toolbar.length && noCustomSpotSelect) {\n toolbarStyle.display = '';\n if (!this.toolbar) {\n toolbarEl.innerHTML = '';\n this.toolbar = new Toolbar(toolbar);\n // @ts-ignore\n const toolbarView = new ToolbarView({ collection: this.toolbar, em });\n toolbarEl.appendChild(toolbarView.render().el);\n }\n\n this.toolbar.reset(toolbar);\n toolbarStyle.top = '-100px';\n toolbarStyle.left = '0';\n } else {\n toolbarStyle.display = 'none';\n }\n },\n\n /**\n * Update toolbar positions\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n updateToolbarPos(pos: any) {\n const unit = 'px';\n const { style } = this.canvas.getToolbarEl()!;\n style.top = `${pos.top}${unit}`;\n style.left = `${pos.left}${unit}`;\n style.opacity = '';\n },\n\n /**\n * Return canvas dimensions and positions\n * @return {Object}\n */\n getCanvasPosition() {\n return this.canvas.getCanvasView().getPosition();\n },\n\n /**\n * Returns badge element\n * @return {HTMLElement}\n * @private\n */\n getBadge(opts: any = {}) {\n return this.canvas.getBadgeEl(opts.view);\n },\n\n /**\n * On frame scroll callback\n * @private\n */\n onFrameScroll() {\n this.updateTools();\n this.canvas.refreshSpots();\n },\n\n onFrameResize() {\n this.canvas.refresh({ all: true });\n },\n\n updateTools() {\n this.updateLocalPos();\n this.updateGlobalPos();\n },\n\n isCompSelected(comp: Component) {\n return comp && comp.get('status') === 'selected';\n },\n\n /**\n * Update tools visible on hover\n * @param {HTMLElement} el\n * @param {Object} pos\n */\n updateToolsLocal(data: any) {\n const config = this.em.getConfig();\n const { el, pos, view, component } = data || this.getElHovered();\n\n if (!el) {\n this.lastHovered = 0;\n return;\n }\n\n const isHoverEn = component.get('hoverable');\n const isNewEl = this.lastHovered !== el;\n const badgeOpts = isNewEl ? {} : { posOnly: 1 };\n const customHoverSpot = this.canvas.hasCustomSpot(CanvasSpotBuiltInTypes.Hover);\n\n if (isNewEl && isHoverEn) {\n this.lastHovered = el;\n customHoverSpot ? this.hideHighlighter(view) : this.showHighlighter(view);\n this.showElementOffset(el, pos, { view });\n }\n\n if (this.isCompSelected(component)) {\n this.hideHighlighter(view);\n !config.showOffsetsSelected && this.hideElementOffset(view);\n }\n\n const unit = 'px';\n const toolsEl = this.toggleToolsEl(1, view);\n const { style } = toolsEl;\n const frameOff = this.canvas.canvasRectOffset(el, pos);\n const topOff = frameOff.top;\n const leftOff = frameOff.left;\n\n !customHoverSpot &&\n this.updateBadge(el, pos, {\n ...badgeOpts,\n view,\n topOff,\n leftOff,\n });\n\n style.top = topOff + unit;\n style.left = leftOff + unit;\n style.width = pos.width + unit;\n style.height = pos.height + unit;\n\n this._trgToolUp('local', {\n component,\n el: toolsEl,\n top: topOff,\n left: leftOff,\n width: pos.width,\n height: pos.height,\n });\n },\n\n _upToolbar: debounce(function () {\n // @ts-ignore\n this.updateToolsGlobal({ force: 1 });\n }, 0),\n\n _trgToolUp(type: string, opts = {}) {\n this.em.trigger('canvas:tools:update', {\n type,\n ...opts,\n });\n },\n\n updateToolsGlobal(opts: any = {}) {\n const { el, pos, component } = this.getElSelected();\n\n if (!el) {\n this.toggleToolsEl(); // Hides toolbar\n this.lastSelected = 0;\n return;\n }\n\n const { canvas } = this;\n const isNewEl = this.lastSelected !== el;\n\n if (isNewEl || opts.force) {\n this.lastSelected = el;\n this.updateToolbar(component);\n }\n\n const unit = 'px';\n const toolsEl = this.toggleToolsEl(1);\n const { style } = toolsEl;\n const targetToElem = canvas.getTargetToElementFixed(el, canvas.getToolbarEl()!, { pos });\n const topOff = targetToElem.canvasOffsetTop;\n const leftOff = targetToElem.canvasOffsetLeft;\n style.top = topOff + unit;\n style.left = leftOff + unit;\n style.width = pos.width + unit;\n style.height = pos.height + unit;\n\n this.updateToolbarPos({ top: targetToElem.top, left: targetToElem.left });\n this._trgToolUp('global', {\n component,\n el: toolsEl,\n top: topOff,\n left: leftOff,\n width: pos.width,\n height: pos.height,\n });\n },\n\n /**\n * Update attached elements, eg. component toolbar\n */\n updateAttached: debounce(function () {\n // @ts-ignore\n this.updateGlobalPos();\n }, 0),\n\n onContainerChange: debounce(function () {\n // @ts-ignore\n this.em.refreshCanvas();\n }, 150),\n\n /**\n * Returns element's data info\n * @param {HTMLElement} el\n * @return {Object}\n * @private\n */\n getElementPos(el: HTMLElement) {\n return this.canvas.getCanvasView().getElementPos(el, { noScroll: true });\n },\n\n /**\n * Hide badge\n * @private\n * */\n hideBadge() {\n this.getBadge().style.display = 'none';\n },\n\n /**\n * Clean previous model from different states\n * @param {Component} model\n * @private\n */\n cleanPrevious(model: Component) {\n model &&\n model.set({\n status: '',\n state: '',\n });\n },\n\n /**\n * Returns content window\n * @private\n */\n getContentWindow() {\n return this.canvas.getWindow();\n },\n\n run(editor) {\n if (!hasWin()) return;\n // @ts-ignore\n this.editor = editor && editor.get('Editor');\n this.enable();\n },\n\n stop(ed, sender, opts = {}) {\n if (!hasWin()) return;\n const { em, editor } = this;\n this.onHovered(); // force to hide toolbar\n this.stopSelectComponent();\n !opts.preserveSelected && em.setSelected();\n this.toggleToolsEl();\n editor && editor.stopCommand('resize');\n },\n} as CommandObject;\n","import { $ } from '../../common';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n /**\n * Start select position event\n * @param {HTMLElement} trg\n * @private\n * */\n startSelectPosition(trg: HTMLElement, doc: Document, opts: any = {}) {\n this.isPointed = false;\n const utils = this.em.Utils;\n const container = trg.ownerDocument.body;\n\n if (utils && !this.sorter)\n this.sorter = new utils.Sorter({\n // @ts-ignore\n container,\n placer: this.canvas.getPlacerEl(),\n containerSel: '*',\n itemSel: '*',\n pfx: this.ppfx,\n direction: 'a',\n document: doc,\n wmargin: 1,\n nested: 1,\n em: this.em,\n canvasRelative: 1,\n scale: () => this.em.getZoomDecimal(),\n });\n\n if (opts.onStart) this.sorter.onStart = opts.onStart;\n trg && this.sorter.startSort(trg, { container });\n },\n\n /**\n * Get frame position\n * @return {Object}\n * @private\n */\n getOffsetDim() {\n var frameOff = this.offset(this.canvas.getFrameEl());\n var canvasOff = this.offset(this.canvas.getElement());\n var top = frameOff.top - canvasOff.top;\n var left = frameOff.left - canvasOff.left;\n return { top, left };\n },\n\n /**\n * Stop select position event\n * @private\n * */\n stopSelectPosition() {\n this.posTargetCollection = null;\n this.posIndex = this.posMethod == 'after' && this.cDim.length !== 0 ? this.posIndex + 1 : this.posIndex; //Normalize\n if (this.sorter) {\n this.sorter.moved = 0;\n this.sorter.endMove();\n }\n if (this.cDim) {\n this.posIsLastEl = this.cDim.length !== 0 && this.posMethod == 'after' && this.posIndex == this.cDim.length;\n this.posTargetEl =\n this.cDim.length === 0\n ? $(this.outsideElem)\n : !this.posIsLastEl && this.cDim[this.posIndex]\n ? $(this.cDim[this.posIndex][5]).parent()\n : $(this.outsideElem);\n this.posTargetModel = this.posTargetEl.data('model');\n this.posTargetCollection = this.posTargetEl.data('model-comp');\n }\n },\n\n /**\n * Enabel select position\n * @private\n */\n enable() {\n this.startSelectPosition();\n },\n\n /**\n * Check if the pointer is near to the float component\n * @param {number} index\n * @param {string} method\n * @param {Array} dims\n * @return {Boolean}\n * @private\n * */\n nearFloat(index: number, method: string, dims: any[]) {\n var i = index || 0;\n var m = method || 'before';\n var len = dims.length;\n var isLast = len !== 0 && m == 'after' && i == len;\n if (len !== 0 && ((!isLast && !dims[i][4]) || (dims[i - 1] && !dims[i - 1][4]) || (isLast && !dims[i - 1][4])))\n return 1;\n return 0;\n },\n\n run() {\n this.enable();\n },\n\n stop() {\n this.stopSelectPosition();\n this.$wrapper.css('cursor', '');\n this.$wrapper.unbind();\n },\n} as CommandObject<{}, { [k: string]: any }>;\n","import { isUndefined } from 'underscore';\nimport { CanvasSpotBuiltInTypes } from '../../canvas/model/CanvasSpot';\nimport { $ } from '../../common';\nimport { CommandObject } from './CommandAbstract';\n\nexport default {\n getOffsetMethod(state: string) {\n var method = state || '';\n return 'get' + method + 'OffsetViewerEl';\n },\n\n run(editor, sender, opts) {\n const { canvas } = this;\n const opt = opts || {};\n const state = opt.state || '';\n const config = editor.getConfig();\n const zoom = this.em.getZoomDecimal();\n const el = opt.el as HTMLElement | undefined;\n\n if (!config.showOffsets || !(el instanceof HTMLElement) || (!config.showOffsetsSelected && state == 'Fixed')) {\n editor.stopCommand(`${this.id}`, opts);\n return;\n }\n\n if (canvas.hasCustomSpot(CanvasSpotBuiltInTypes.Spacing)) {\n return;\n }\n\n var pos = { ...(opt.elPos || canvas.getElementPos(el)) };\n\n if (!isUndefined(opt.top)) {\n pos.top = opt.top;\n }\n if (!isUndefined(opt.left)) {\n pos.left = opt.left;\n }\n\n var style = window.getComputedStyle(el);\n var ppfx = this.ppfx;\n var stateVar = state + 'State';\n var method = this.getOffsetMethod(state);\n // @ts-ignore\n var offsetViewer = canvas[method](opts.view);\n offsetViewer.style.opacity = '';\n\n let marginT = this['marginT' + state];\n let marginB = this['marginB' + state];\n let marginL = this['marginL' + state];\n let marginR = this['marginR' + state];\n let padT = this['padT' + state];\n let padB = this['padB' + state];\n let padL = this['padL' + state];\n let padR = this['padR' + state];\n\n if (offsetViewer.childNodes.length) {\n this[stateVar] = '1';\n marginT = offsetViewer.querySelector('[data-offset-m-t]');\n marginB = offsetViewer.querySelector('[data-offset-m-b]');\n marginL = offsetViewer.querySelector('[data-offset-m-l]');\n marginR = offsetViewer.querySelector('[data-offset-m-r]');\n padT = offsetViewer.querySelector('[data-offset-p-t]');\n padB = offsetViewer.querySelector('[data-offset-p-b]');\n padL = offsetViewer.querySelector('[data-offset-p-l]');\n padR = offsetViewer.querySelector('[data-offset-p-r]');\n }\n\n if (!this[stateVar]) {\n var stateLow = state.toLowerCase();\n var marginName = stateLow + 'margin-v';\n var paddingName = stateLow + 'padding-v';\n var marginV = $(`
`).get(0) as HTMLElement;\n var paddingV = $(`
`).get(0) as HTMLElement;\n var marginEls = ppfx + marginName + '-el';\n var paddingEls = ppfx + paddingName + '-el';\n const fullMargName = `${marginEls} ${ppfx + marginName}`;\n const fullPadName = `${paddingEls} ${ppfx + paddingName}`;\n marginT = $(`
`).get(0);\n marginB = $(`
`).get(0);\n marginL = $(`
`).get(0);\n marginR = $(`
`).get(0);\n padT = $(`
`).get(0);\n padB = $(`
`).get(0);\n padL = $(`
`).get(0);\n padR = $(`
`).get(0);\n this['marginT' + state] = marginT;\n this['marginB' + state] = marginB;\n this['marginL' + state] = marginL;\n this['marginR' + state] = marginR;\n this['padT' + state] = padT;\n this['padB' + state] = padB;\n this['padL' + state] = padL;\n this['padR' + state] = padR;\n marginV.appendChild(marginT);\n marginV.appendChild(marginB);\n marginV.appendChild(marginL);\n marginV.appendChild(marginR);\n paddingV.appendChild(padT);\n paddingV.appendChild(padB);\n paddingV.appendChild(padL);\n paddingV.appendChild(padR);\n offsetViewer.appendChild(marginV);\n offsetViewer.appendChild(paddingV);\n this[stateVar] = '1';\n }\n\n var unit = 'px';\n var marginLeftSt = parseFloat(style.marginLeft.replace(unit, '')) * zoom;\n var marginRightSt = parseFloat(style.marginRight.replace(unit, '')) * zoom;\n var marginTopSt = parseFloat(style.marginTop.replace(unit, '')) * zoom;\n var marginBottomSt = parseFloat(style.marginBottom.replace(unit, '')) * zoom;\n var mtStyle = marginT.style;\n var mbStyle = marginB.style;\n var mlStyle = marginL.style;\n var mrStyle = marginR.style;\n var ptStyle = padT.style;\n var pbStyle = padB.style;\n var plStyle = padL.style;\n var prStyle = padR.style;\n var posLeft = parseFloat(pos.left);\n var widthEl = parseFloat(style.width) * zoom + unit;\n\n // Margin style\n mtStyle.height = marginTopSt + unit;\n mtStyle.width = widthEl;\n mtStyle.top = pos.top - marginTopSt + unit;\n mtStyle.left = posLeft + unit;\n\n mbStyle.height = marginBottomSt + unit;\n mbStyle.width = widthEl;\n mbStyle.top = pos.top + pos.height + unit;\n mbStyle.left = posLeft + unit;\n\n var marginSideH = pos.height + marginTopSt + marginBottomSt + unit;\n var marginSideT = pos.top - marginTopSt + unit;\n mlStyle.height = marginSideH;\n mlStyle.width = marginLeftSt + unit;\n mlStyle.top = marginSideT;\n mlStyle.left = posLeft - marginLeftSt + unit;\n\n mrStyle.height = marginSideH;\n mrStyle.width = marginRightSt + unit;\n mrStyle.top = marginSideT;\n mrStyle.left = posLeft + pos.width + unit;\n\n // Padding style\n var padTop = parseFloat(style.paddingTop) * zoom;\n ptStyle.height = padTop + unit;\n // ptStyle.width = widthEl;\n // ptStyle.top = pos.top + unit;\n // ptStyle.left = posLeft + unit;\n\n var padBot = parseFloat(style.paddingBottom) * zoom;\n pbStyle.height = padBot + unit;\n // pbStyle.width = widthEl;\n // pbStyle.top = pos.top + pos.height - padBot + unit;\n // pbStyle.left = posLeft + unit;\n\n var padSideH = pos.height - padBot - padTop + unit;\n var padSideT = pos.top + padTop + unit;\n plStyle.height = padSideH;\n plStyle.width = parseFloat(style.paddingLeft) * zoom + unit;\n plStyle.top = padSideT;\n // plStyle.left = pos.left + unit;\n // plStyle.right = 0;\n\n var padRight = parseFloat(style.paddingRight) * zoom;\n prStyle.height = padSideH;\n prStyle.width = padRight + unit;\n prStyle.top = padSideT;\n // prStyle.left = pos.left + pos.width - padRight + unit;\n // prStyle.left = 0;\n },\n\n stop(editor, sender, opts = {}) {\n var opt = opts || {};\n var state = opt.state || '';\n var method = this.getOffsetMethod(state);\n const { view } = opts;\n const canvas = this.canvas;\n // @ts-ignore\n var offsetViewer = canvas[method](view);\n offsetViewer.style.opacity = 0;\n },\n} as CommandObject;\n","import { bindAll } from 'underscore';\nimport Frame from '../../canvas/model/Frame';\nimport Editor from '../../editor';\nimport { CommandObject } from './CommandAbstract';\nimport { isDef } from '../../utils/mixins';\n\nexport default {\n init() {\n bindAll(this, '_onFramesChange');\n },\n\n run(ed) {\n this.toggleVis(ed, true);\n },\n\n stop(ed) {\n this.toggleVis(ed, false);\n },\n\n toggleVis(ed: Editor, active = true) {\n if (!ed.Commands.isActive('preview')) {\n const cv = ed.Canvas;\n const mth = active ? 'on' : 'off';\n const canvasModel = cv.getModel();\n canvasModel[mth]('change:frames', this._onFramesChange);\n this.handleFrames(cv.getFrames(), active);\n }\n },\n\n handleFrames(frames: Frame[], active?: boolean) {\n frames.forEach((frame: Frame & { __ol?: boolean }) => {\n frame.view?.loaded && this._upFrame(frame, active);\n\n if (!frame.__ol) {\n frame.on('loaded', () => this._upFrame(frame));\n frame.__ol = true;\n }\n });\n },\n\n _onFramesChange(_: any, frames: Frame[]) {\n this.handleFrames(frames);\n },\n\n _upFrame(frame: Frame, active?: boolean) {\n const { ppfx, em, id } = this;\n const isActive = isDef(active) ? active : em.Commands.isActive(id as string);\n const method = isActive ? 'add' : 'remove';\n const cls = `${ppfx}dashed`;\n frame.view?.getBody().classList[method](cls);\n },\n} as CommandObject<\n {},\n {\n [key: string]: any;\n }\n>;\n","import Backbone from 'backbone';\nexport { default as $ } from '../utils/cash-dom';\n\ninterface NOOP {}\n\nexport type Debounced = Function & { cancel(): void };\n\nexport type SetOptions = Backbone.ModelSetOptions & { avoidStore?: boolean };\n\nexport type AddOptions = Backbone.AddOptions & { temporary?: boolean; action?: string };\n\nexport type DisableOptions = { fromMove?: boolean };\n\nexport type LocaleOptions = { locale?: boolean };\n\nexport type RemoveOptions = Backbone.Silenceable;\n\nexport type EventHandler = Backbone.EventHandler;\n\nexport type ObjectHash = Backbone.ObjectHash;\n\nexport type ObjectAny = Record;\n\nexport type ObjectStrings = Record;\n\nexport type Nullable = undefined | null | false;\n\nexport interface OptionAsDocument {\n /**\n * Treat the HTML string as document (option valid on the root component, eg. will include doctype, html, head, etc.).\n */\n asDocument?: boolean;\n}\n\n// https://github.com/microsoft/TypeScript/issues/29729#issuecomment-1483854699\nexport type LiteralUnion = T | (U & NOOP);\n\nexport type Position = {\n x: number;\n y: number;\n};\n\nexport interface Coordinates {\n x: number;\n y: number;\n}\n\nexport interface Dimensions {\n height: number;\n width: number;\n}\n\nexport interface BoxRect extends Coordinates, Dimensions {}\n\nexport type ElementRect = {\n top: number;\n left: number;\n width: number;\n height: number;\n};\n\nexport type CombinedModelConstructorOptions<\n E,\n M extends Model = Model\n> = Backbone.ModelConstructorOptions & E;\n\nexport interface ViewOptions\n extends Backbone.ViewOptions {}\n\nexport class Model extends Backbone.Model {}\n\nexport class Collection extends Backbone.Collection {}\n\nexport class View extends Backbone.View {}\n\nexport type PickMatching = { [K in keyof T as T[K] extends V ? K : never]: T[K] };\n\nexport type ExtractMethods = PickMatching;\n\nexport enum CoordinatesTypes {\n Screen = 'screen',\n World = 'world',\n}\n\nexport const DEFAULT_COORDS: Coordinates = {\n x: 0,\n y: 0,\n};\n\nexport const DEFAULT_BOXRECT: BoxRect = {\n ...DEFAULT_COORDS,\n width: 0,\n height: 0,\n};\n\nexport type PrevToNewIdMap = Record;\n","import Component from './model/Component';\n\nexport enum ActionLabelComponents {\n remove = 'component:remove',\n add = 'component:add',\n move = 'component:move',\n}\n\nexport interface SymbolInfo {\n isSymbol: boolean;\n isMain: boolean;\n isInstance: boolean;\n isRoot: boolean;\n main?: Component;\n instances: Component[];\n relatives: Component[];\n}\n\nexport enum ComponentsEvents {\n /**\n * @event `component:add` New component added.\n * @example\n * editor.on('component:add', (component) => { ... });\n */\n add = 'component:add',\n\n /**\n * @event `component:remove` Component removed.\n * @example\n * editor.on('component:remove', (component) => { ... });\n */\n remove = 'component:remove',\n removeBefore = 'component:remove:before',\n\n /**\n * @event `component:create` Component created.\n * @example\n * editor.on('component:create', (component) => { ... });\n */\n create = 'component:create',\n\n /**\n * @event `component:update` Component is updated, the component is passed as an argument to the callback.\n * @example\n * editor.on('component:update', (component) => { ... });\n */\n update = 'component:update',\n updateInside = 'component:update-inside',\n\n /**\n * @event `symbol:main:add` Added new main symbol.\n * @example\n * editor.on('symbol:main:add', ({ component }) => { ... });\n */\n symbolMainAdd = 'symbol:main:add',\n\n /**\n * @event `symbol:main:update` Main symbol updated.\n * @example\n * editor.on('symbol:main:update', ({ component }) => { ... });\n */\n symbolMainUpdate = 'symbol:main:update',\n symbolMainUpdateDeep = 'symbol:main:update-deep',\n\n /**\n * @event `symbol:main:remove` Main symbol removed.\n * @example\n * editor.on('symbol:main:remove', ({ component }) => { ... });\n */\n symbolMainRemove = 'symbol:main:remove',\n\n /**\n * @event `symbol:main` Catch-all event related to main symbol updates.\n * @example\n * editor.on('symbol:main', ({ event, component }) => { ... });\n */\n symbolMain = 'symbol:main',\n\n /**\n * @event `symbol:instance:add` Added new root instance symbol.\n * @example\n * editor.on('symbol:instance:add', ({ component }) => { ... });\n */\n symbolInstanceAdd = 'symbol:instance:add',\n\n /**\n * @event `symbol:instance:remove` Root instance symbol removed.\n * @example\n * editor.on('symbol:instance:remove', ({ component }) => { ... });\n */\n symbolInstanceRemove = 'symbol:instance:remove',\n\n /**\n * @event `symbol:instance` Catch-all event related to instance symbol updates.\n * @example\n * editor.on('symbol:instance', ({ event, component }) => { ... });\n */\n symbolInstance = 'symbol:instance',\n\n /**\n * @event `symbol` Catch-all event for any symbol update (main or instance).\n * @example\n * editor.on('symbol', () => { ... });\n */\n symbol = 'symbol',\n}\n","import { includes } from 'underscore';\nimport { ObjectAny, View } from '../../common';\n\nexport default class DomainViews extends View {\n config?: any;\n items: any[];\n ns?: string;\n itemView?: any;\n\n // Defines the View per type\n itemsView = '' as any;\n\n itemType = 'type';\n\n reuseView = false;\n\n constructor(opts: any = {}, config?: any, autoAdd = false) {\n super(opts);\n this.config = config || opts.config || {};\n autoAdd && this.listenTo(this.collection, 'add', this.addTo);\n this.items = [];\n }\n\n /**\n * Add new model to the collection\n * @param {Model} model\n * @private\n * */\n addTo(model: any) {\n this.add(model);\n }\n\n itemViewNotFound(type: string) {\n const { config, ns } = this;\n const { em } = config;\n const warn = `${ns ? `[${ns}]: ` : ''}'${type}' type not found`;\n em && em.logWarning(warn);\n }\n\n /**\n * Render new model inside the view\n * @param {Model} model\n * @param {Object} fragment Fragment collection\n * @private\n * */\n add(model: any, fragment?: DocumentFragment) {\n const { config, reuseView, items } = this;\n const itemsView = (this.itemsView || {}) as ObjectAny;\n const inputTypes = [\n 'button',\n 'checkbox',\n 'color',\n 'date',\n 'datetime-local',\n 'email',\n 'file',\n 'hidden',\n 'image',\n 'month',\n 'number',\n 'password',\n 'radio',\n 'range',\n 'reset',\n 'search',\n 'submit',\n 'tel',\n 'text',\n 'time',\n 'url',\n 'week',\n ];\n var frag = fragment || null;\n var itemView = this.itemView;\n var typeField = model.get(this.itemType);\n let view;\n\n if (itemsView[typeField]) {\n itemView = itemsView[typeField];\n } else if (typeField && !itemsView[typeField] && !includes(inputTypes, typeField)) {\n this.itemViewNotFound(typeField);\n }\n\n if (model.view && reuseView) {\n view = model.view;\n } else {\n view = new itemView({ model, config }, config);\n }\n\n items && items.push(view);\n const rendered = view.render().el;\n\n if (frag) frag.appendChild(rendered);\n else this.$el.append(rendered);\n }\n\n render() {\n var frag = document.createDocumentFragment();\n this.clearItems();\n this.$el.empty();\n\n if (this.collection.length)\n this.collection.each(function (model) {\n // @ts-ignore\n this.add(model, frag);\n }, this);\n\n this.$el.append(frag);\n this.onRender();\n return this;\n }\n\n onRender() {}\n onRemoveBefore(items?: any, opts?: any) {}\n onRemove(items?: any, opts?: any) {}\n\n remove(opts = {}) {\n const { items } = this;\n this.onRemoveBefore(items, opts);\n this.clearItems();\n super.remove();\n this.onRemove(items, opts);\n return this;\n }\n\n clearItems() {\n const items = this.items || [];\n // TODO Traits do not update the target anymore\n // items.forEach(item => item.remove());\n // this.items = [];\n }\n}\n\n// Default view\nDomainViews.prototype.itemView = '';\n","import { bindAll, isFunction, isUndefined, result } from 'underscore';\nimport { Position } from '../common';\nimport { getPointerEvent, isEscKey, off, on } from './dom';\n\ntype DraggerPosition = Position & { end?: boolean };\n\ntype PositionXY = keyof Omit;\n\ntype Guide = {\n x: number;\n y: number;\n lock?: number;\n active?: boolean;\n};\n\ninterface DraggerOptions {\n /**\n * Element on which the drag will be executed. By default, the document will be used\n */\n container?: HTMLElement;\n\n /**\n * Callback on drag start.\n * @example\n * onStart(ev, dragger) {\n * console.log('pointer start', dragger.startPointer, 'position start', dragger.startPosition);\n * }\n */\n onStart?: (ev: Event, dragger: Dragger) => void;\n\n /**\n * Callback on drag.\n * @example\n * onDrag(ev, dragger) {\n * console.log('pointer', dragger.currentPointer, 'position', dragger.position, 'delta', dragger.delta);\n * }\n */\n onDrag?: (ev: Event, dragger: Dragger) => void;\n\n /**\n * Callback on drag end.\n * @example\n * onEnd(ev, dragger) {\n * console.log('pointer', dragger.currentPointer, 'position', dragger.position, 'delta', dragger.delta);\n * }\n */\n onEnd?: (ev: Event, dragger: Dragger, opts: { cancelled: boolean }) => void;\n\n /**\n * Indicate a callback where to pass an object with new coordinates\n */\n setPosition?: (position: DraggerPosition) => void;\n\n /**\n * Indicate a callback where to get initial coordinates.\n * @example\n * getPosition: () => {\n * // ...\n * return { x: 10, y: 100 }\n * }\n */\n getPosition?: () => DraggerPosition;\n\n /**\n * Indicate a callback where to get pointer coordinates.\n */\n getPointerPosition?: (ev: Event) => DraggerPosition;\n\n /**\n * Static guides to be snapped.\n */\n guidesStatic?: () => Guide[];\n\n /**\n * Target guides that will snap to static one.\n */\n guidesTarget?: () => Guide[];\n\n /**\n * Offset before snap to guides.\n * @default 5\n */\n snapOffset?: number;\n\n /**\n * Document on which listen to pointer events.\n */\n doc?: Document;\n\n /**\n * Scale result points, can also be a function.\n * @default 1\n */\n scale?: number | (() => number);\n}\n\nconst resetPos = () => ({ x: 0, y: 0 });\n\nconst xyArr: PositionXY[] = ['x', 'y'];\n\nexport default class Dragger {\n opts: DraggerOptions;\n startPointer: DraggerPosition;\n delta: DraggerPosition;\n lastScroll: DraggerPosition;\n lastScrollDiff: DraggerPosition;\n startPosition: DraggerPosition;\n globScrollDiff: DraggerPosition;\n currentPointer: DraggerPosition;\n position: DraggerPosition;\n el?: HTMLElement;\n guidesStatic: Guide[];\n guidesTarget: Guide[];\n lockedAxis?: any;\n docs: Document[];\n trgX?: Guide;\n trgY?: Guide;\n\n /**\n * Init the dragger\n * @param {Object} opts\n */\n constructor(opts: DraggerOptions = {}) {\n this.opts = {\n snapOffset: 5,\n scale: 1,\n };\n bindAll(this, 'drag', 'stop', 'keyHandle', 'handleScroll');\n this.setOptions(opts);\n this.delta = resetPos();\n this.lastScroll = resetPos();\n this.lastScrollDiff = resetPos();\n this.startPointer = resetPos();\n this.startPosition = resetPos();\n this.globScrollDiff = resetPos();\n this.currentPointer = resetPos();\n this.position = resetPos();\n this.guidesStatic = [];\n this.guidesTarget = [];\n this.docs = [];\n return this;\n }\n\n /**\n * Update options\n * @param {Object} options\n */\n setOptions(opts: Partial = {}) {\n this.opts = {\n ...this.opts,\n ...opts,\n };\n }\n\n toggleDrag(enable?: boolean) {\n const docs = this.getDocumentEl();\n const container = this.getContainerEl();\n const win = this.getWindowEl();\n const method = enable ? 'on' : 'off';\n const methods = { on, off };\n methods[method](container, 'mousemove dragover', this.drag);\n methods[method](docs, 'mouseup dragend touchend', this.stop);\n methods[method](docs, 'keydown', this.keyHandle);\n methods[method](win, 'scroll', this.handleScroll);\n }\n\n handleScroll() {\n const { lastScroll, delta } = this;\n const actualScroll = this.getScrollInfo();\n const scrollDiff = {\n x: actualScroll.x - lastScroll!.x,\n y: actualScroll.y - lastScroll!.y,\n };\n this.move(delta.x + scrollDiff.x, delta.y + scrollDiff.y);\n this.lastScrollDiff = scrollDiff;\n }\n\n /**\n * Start dragging\n * @param {Event} e\n */\n start(ev: Event) {\n const { opts } = this;\n const { onStart } = opts;\n this.toggleDrag(true);\n this.startPointer = this.getPointerPos(ev);\n this.guidesStatic = result(opts, 'guidesStatic') || [];\n this.guidesTarget = result(opts, 'guidesTarget') || [];\n isFunction(onStart) && onStart(ev, this);\n this.startPosition = this.getStartPosition();\n this.lastScrollDiff = resetPos();\n this.globScrollDiff = resetPos();\n this.drag(ev);\n }\n\n /**\n * Drag event\n * @param {Event} event\n */\n drag(ev: Event) {\n const { opts, lastScrollDiff, globScrollDiff } = this;\n const { onDrag } = opts;\n const { startPointer } = this;\n const currentPos = this.getPointerPos(ev);\n const glDiff = {\n x: globScrollDiff.x + lastScrollDiff.x,\n y: globScrollDiff.y + lastScrollDiff.y,\n };\n this.globScrollDiff = glDiff;\n const delta = {\n x: currentPos.x - startPointer.x + glDiff.x,\n y: currentPos.y - startPointer.y + glDiff.y,\n };\n this.lastScrollDiff = resetPos();\n let { lockedAxis } = this;\n\n // @ts-ignore Lock one axis\n if (ev.shiftKey) {\n lockedAxis = !lockedAxis && this.detectAxisLock(delta.x, delta.y);\n } else {\n lockedAxis = null;\n }\n\n if (lockedAxis === 'x') {\n delta.x = startPointer.x;\n } else if (lockedAxis === 'y') {\n delta.y = startPointer.y;\n }\n\n const moveDelta = (delta: DraggerPosition) => {\n xyArr.forEach(co => (delta[co] = delta[co] * result(opts, 'scale')));\n this.delta = delta;\n this.move(delta.x, delta.y);\n isFunction(onDrag) && onDrag(ev, this);\n };\n const deltaPre = { ...delta };\n this.currentPointer = currentPos;\n this.lockedAxis = lockedAxis;\n this.lastScroll = this.getScrollInfo();\n moveDelta(delta);\n\n if (this.guidesTarget.length) {\n const { newDelta, trgX, trgY } = this.snapGuides(deltaPre);\n (trgX || trgY) && moveDelta(newDelta);\n }\n\n // @ts-ignore In case the mouse button was released outside of the window\n ev.which === 0 && this.stop(ev);\n }\n\n /**\n * Check if the delta hits some guide\n */\n snapGuides(delta: DraggerPosition) {\n const newDelta = delta;\n let { trgX, trgY } = this;\n\n this.guidesTarget.forEach(trg => {\n // Skip the guide if its locked axis already exists\n if ((trg.x && this.trgX) || (trg.y && this.trgY)) return;\n trg.active = false;\n\n this.guidesStatic.forEach(stat => {\n if ((trg.y && stat.x) || (trg.x && stat.y)) return;\n const isY = trg.y && stat.y;\n const axs = isY ? 'y' : 'x';\n const trgPoint = trg[axs];\n const statPoint = stat[axs];\n const deltaPoint = delta[axs];\n const trgGuide = isY ? trgY : trgX;\n\n if (this.isPointIn(trgPoint, statPoint)) {\n if (isUndefined(trgGuide)) {\n const trgValue = deltaPoint - (trgPoint - statPoint);\n this.setGuideLock(trg, trgValue);\n }\n }\n });\n });\n\n trgX = this.trgX;\n trgY = this.trgY;\n\n xyArr.forEach(co => {\n const axis = co.toUpperCase();\n // @ts-ignore\n let trg = this[`trg${axis}`];\n\n if (trg && !this.isPointIn(delta[co], trg.lock)) {\n this.setGuideLock(trg, null);\n trg = null;\n }\n\n if (trg && !isUndefined(trg.lock)) {\n newDelta[co] = trg.lock;\n }\n });\n\n return {\n newDelta,\n trgX: this.trgX,\n trgY: this.trgY,\n };\n }\n\n isPointIn(src: number, trg: number, { offset }: { offset?: number } = {}) {\n const ofst = offset || this.opts.snapOffset || 0;\n return (src >= trg && src <= trg + ofst) || (src <= trg && src >= trg - ofst);\n }\n\n setGuideLock(guide: Guide, value: any) {\n const axis = !isUndefined(guide.x) ? 'X' : 'Y';\n const trgName = `trg${axis}`;\n\n if (value !== null) {\n guide.active = true;\n guide.lock = value;\n // @ts-ignore\n this[trgName] = guide;\n } else {\n delete guide.active;\n delete guide.lock;\n // @ts-ignore\n delete this[trgName];\n }\n\n return guide;\n }\n\n /**\n * Stop dragging\n */\n stop(ev: Event, opts: { cancel?: boolean } = {}) {\n const { delta } = this;\n const cancelled = !!opts.cancel;\n const x = cancelled ? 0 : delta.x;\n const y = cancelled ? 0 : delta.y;\n this.toggleDrag();\n this.lockedAxis = null;\n this.move(x, y, true);\n const { onEnd } = this.opts;\n isFunction(onEnd) && onEnd(ev, this, { cancelled });\n }\n\n keyHandle(ev: Event) {\n if (isEscKey(ev as KeyboardEvent)) {\n this.stop(ev, { cancel: true });\n }\n }\n\n /**\n * Move the element\n * @param {integer} x\n * @param {integer} y\n */\n move(x: number, y: number, end?: boolean) {\n const { el, opts } = this;\n const pos = this.startPosition;\n if (!pos) return;\n const { setPosition } = opts;\n const xPos = pos.x + x;\n const yPos = pos.y + y;\n this.position = {\n x: xPos,\n y: yPos,\n end,\n };\n\n isFunction(setPosition) && setPosition(this.position);\n\n if (el) {\n el.style.left = `${xPos}px`;\n el.style.top = `${yPos}px`;\n }\n }\n\n getContainerEl() {\n const { container } = this.opts;\n return container ? [container] : this.getDocumentEl();\n }\n\n getWindowEl() {\n const cont = this.getContainerEl();\n return cont.map(item => {\n const doc = item.ownerDocument || item;\n // @ts-ignore\n return doc.defaultView || doc.parentWindow;\n });\n }\n\n /**\n * Returns documents\n */\n getDocumentEl(el?: HTMLElement): Document[] {\n const { doc } = this.opts;\n el = el || this.el;\n\n if (!this.docs.length) {\n const docs = [document];\n el && docs.push(el.ownerDocument);\n doc && docs.push(doc);\n this.docs = docs;\n }\n\n return this.docs;\n }\n\n /**\n * Get mouse coordinates\n * @param {Event} event\n * @return {Object}\n */\n getPointerPos(ev: Event) {\n const getPos = this.opts.getPointerPosition;\n const pEv = getPointerEvent(ev);\n\n return getPos\n ? getPos(ev)\n : {\n x: pEv.clientX,\n y: pEv.clientY,\n };\n }\n\n getStartPosition() {\n const { el, opts } = this;\n const getPos = opts.getPosition;\n let result = resetPos();\n\n if (isFunction(getPos)) {\n result = getPos();\n } else if (el) {\n result = {\n x: parseFloat(el.style.left),\n y: parseFloat(el.style.top),\n };\n }\n\n return result;\n }\n\n getScrollInfo() {\n const { doc } = this.opts;\n const body = doc && doc.body;\n\n return {\n y: body ? body.scrollTop : 0,\n x: body ? body.scrollLeft : 0,\n };\n }\n\n detectAxisLock(x: number, y: number) {\n const relX = x;\n const relY = y;\n const absX = Math.abs(relX);\n const absY = Math.abs(relY);\n\n // Vertical or Horizontal lock\n if (relY >= absX || relY <= -absX) {\n return 'x';\n } else if (relX > absY || relX < -absY) {\n return 'y';\n }\n }\n}\n","// @ts-nocheck\n/* Adapted for headless */\n/* MIT https://github.com/kenwheeler/cash */\n'use strict';\n\nvar doc = typeof document !== 'undefined' ? document : null,\n win = typeof window !== 'undefined' ? window : null,\n _Array$prototype = Array.prototype,\n filter = _Array$prototype.filter,\n indexOf = _Array$prototype.indexOf,\n map = _Array$prototype.map,\n push = _Array$prototype.push,\n reverse = _Array$prototype.reverse,\n slice = _Array$prototype.slice,\n splice = _Array$prototype.splice;\nvar idRe = /^#[\\w-]*$/,\n classRe = /^\\.[\\w-]*$/,\n htmlRe = /<.+>/,\n tagRe = /^\\w+$/; // @require ./variables.js\n\nfunction find(selector, context) {\n if (context === void 0) {\n context = doc;\n }\n\n return classRe.test(selector)\n ? context.getElementsByClassName(selector.slice(1))\n : tagRe.test(selector)\n ? context.getElementsByTagName(selector)\n : context.querySelectorAll(selector);\n} // @require ./find.js\n// @require ./variables.js\n\nfunction Cash(selector, context) {\n if (context === void 0) {\n context = doc;\n }\n\n if (!selector) return;\n if (selector.__cash) return selector;\n var eles = selector;\n\n if (isString(selector)) {\n if (context.__cash) context = context[0];\n eles = idRe.test(selector)\n ? context.getElementById(selector.slice(1))\n : htmlRe.test(selector)\n ? parseHTML(selector)\n : find(selector, context);\n if (!eles) return;\n } else if (isFunction(selector)) {\n return this.ready(selector); //FIXME: `fn.ready` is not included in `core`, but it's actually a core functionality\n }\n\n if (eles.nodeType || eles === win) eles = [eles];\n this.length = eles.length;\n\n for (var i = 0, l = this.length; i < l; i++) {\n this[i] = eles[i];\n }\n}\n\nfunction cash(selector, context) {\n return new Cash(selector, context);\n}\n/* PROTOTYPE */\n\nvar fn =\n (cash.fn =\n cash.prototype =\n Cash.prototype =\n {\n constructor: cash,\n __cash: true,\n length: 0,\n splice: splice, // Ensures a cash collection gets printed as array-like in Chrome\n }); // @require core/cash.js\n// @require core/variables.js\n\nfn.get = function (index) {\n if (index === undefined) return slice.call(this);\n return this[index < 0 ? index + this.length : index];\n}; // @require core/cash.js\n// @require ./get.js\n\nfn.eq = function (index) {\n return cash(this.get(index));\n}; // @require core/cash.js\n// @require ./eq.js\n\nfn.first = function () {\n return this.eq(0);\n}; // @require core/cash.js\n// @require ./eq.js\n\nfn.last = function () {\n return this.eq(-1);\n}; // @require core/cash.js\n// @require core/variables.js\n\nfn.map = function (callback) {\n return cash(\n map.call(this, function (ele, i) {\n return callback.call(ele, i, ele);\n })\n );\n}; // @require core/cash.js\n// @require core/variables.js\n\nfn.slice = function () {\n return cash(slice.apply(this, arguments));\n}; // @require ./cash.js\n\nvar camelCaseRe = /(?:^\\w|[A-Z]|\\b\\w)/g,\n camelCaseWhitespaceRe = /[\\s-_]+/g;\n\nfunction camelCase(str) {\n return str\n .replace(camelCaseRe, function (letter, index) {\n return letter[!index ? 'toLowerCase' : 'toUpperCase']();\n })\n .replace(camelCaseWhitespaceRe, '');\n}\n\ncash.camelCase = camelCase; // @require ./cash.js\n\nfunction each(arr, callback) {\n for (var i = 0, l = arr.length; i < l; i++) {\n if (callback.call(arr[i], arr[i], i, arr) === false) break;\n }\n}\n\ncash.each = each; // @require core/cash.js\n// @require core/each.js\n\nfn.each = function (callback) {\n each(this, function (ele, i) {\n return callback.call(ele, i, ele);\n });\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.removeProp = function (prop) {\n return this.each(function (i, ele) {\n delete ele[prop];\n });\n}; // @require ./cash.js\n\nfunction extend(target) {\n if (target === void 0) {\n target = this;\n }\n\n var args = arguments,\n length = args.length;\n\n for (var i = length < 2 ? 0 : 1; i < length; i++) {\n for (var key in args[i]) {\n target[key] = args[i][key];\n }\n }\n\n return target;\n}\n\ncash.extend = fn.extend = extend; // @require ./cash.js\n\nvar guid = 1;\ncash.guid = guid; // @require ./cash.js\n\nfunction matches(ele, selector) {\n var matches =\n ele &&\n (ele.matches ||\n ele.webkitMatchesSelector ||\n ele.mozMatchesSelector ||\n ele.msMatchesSelector ||\n ele.oMatchesSelector);\n return !!matches && matches.call(ele, selector);\n}\n\ncash.matches = matches; // @require ./cash.js\n\nfunction isFunction(x) {\n return typeof x === 'function';\n}\n\ncash.isFunction = isFunction;\n\nfunction isString(x) {\n return typeof x === 'string';\n}\n\ncash.isString = isString;\n\nfunction isNumeric(x) {\n return !isNaN(parseFloat(x)) && isFinite(x);\n}\n\ncash.isNumeric = isNumeric;\nvar isArray = Array.isArray;\ncash.isArray = isArray; // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n\nfn.prop = function (prop, value) {\n if (!prop) return;\n\n if (isString(prop)) {\n if (arguments.length < 2) return this[0] && this[0][prop];\n return this.each(function (i, ele) {\n ele[prop] = value;\n });\n }\n\n for (var key in prop) {\n this.prop(key, prop[key]);\n }\n\n return this;\n}; // @require ./matches.js\n// @require ./type_checking.js\n\nfunction getCompareFunction(selector) {\n return isString(selector)\n ? function (i, ele) {\n return matches(ele, selector);\n }\n : selector.__cash\n ? function (i, ele) {\n return selector.is(ele);\n }\n : function (i, ele, selector) {\n return ele === selector;\n };\n} // @require core/cash.js\n// @require core/get_compare_function.js\n// @require core/type_checking.js\n// @require core/variables.js\n// @require collection/get.js\n\nfn.filter = function (selector) {\n if (!selector) return cash();\n var comparator = isFunction(selector) ? selector : getCompareFunction(selector);\n return cash(\n filter.call(this, function (ele, i) {\n return comparator.call(ele, i, ele, selector);\n })\n );\n}; // @require ./type_checking.js\n\nvar splitValuesRe = /\\S+/g;\n\nfunction getSplitValues(str) {\n return isString(str) ? str.match(splitValuesRe) || [] : [];\n} // @require core/cash.js\n// @require core/get_split_values.js\n// @require collection/each.js\n\nfn.hasClass = function (cls) {\n var classes = getSplitValues(cls);\n var check = false;\n\n if (classes.length) {\n this.each(function (i, ele) {\n check = ele.classList.contains(classes[0]);\n return !check;\n });\n }\n\n return check;\n}; // @require core/cash.js\n// @require core/get_split_values.js\n// @require collection/each.js\n\nfn.removeAttr = function (attr) {\n var attrs = getSplitValues(attr);\n if (!attrs.length) return this;\n return this.each(function (i, ele) {\n each(attrs, function (a) {\n ele.removeAttribute(a);\n });\n });\n}; // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./remove_attr.js\n\nfn.attr = function (attr, value) {\n if (!attr) return;\n\n if (isString(attr)) {\n if (arguments.length < 2) {\n if (!this[0]) return;\n\n var _value = this[0].getAttribute(attr);\n\n return _value === null ? undefined : _value;\n }\n\n if (value === null) return this.removeAttr(attr);\n return this.each(function (i, ele) {\n ele.setAttribute(attr, value);\n });\n }\n\n for (var key in attr) {\n this.attr(key, attr[key]);\n }\n\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require core/get_split_values.js\n// @require collection/each.js\n\nfn.toggleClass = function (cls, force) {\n var classes = getSplitValues(cls),\n isForce = force !== undefined;\n if (!classes.length) return this;\n return this.each(function (i, ele) {\n each(classes, function (c) {\n if (isForce) {\n force ? ele.classList.add(c) : ele.classList.remove(c);\n } else {\n ele.classList.toggle(c);\n }\n });\n });\n}; // @require core/cash.js\n// @require ./toggle_class.js\n\nfn.addClass = function (cls) {\n return this.toggleClass(cls, true);\n}; // @require core/cash.js\n// @require ./attr.js\n// @require ./toggle_class.js\n\nfn.removeClass = function (cls) {\n return !arguments.length ? this.attr('class', '') : this.toggleClass(cls, false);\n}; // @optional ./add_class.js\n// @optional ./attr.js\n// @optional ./has_class.js\n// @optional ./prop.js\n// @optional ./remove_attr.js\n// @optional ./remove_class.js\n// @optional ./remove_prop.js\n// @optional ./toggle_class.js\n// @require ./cash.js\n\nfunction unique(arr) {\n return arr.filter(function (item, index, self) {\n return self.indexOf(item) === index;\n });\n}\n\ncash.unique = unique; // @require core/cash.js\n// @require core/unique.js\n// @require ./get.js\n\nfn.add = function (selector, context) {\n return cash(unique(this.get().concat(cash(selector, context).get())));\n}; // @require core/variables.js\n\nfunction computeStyle(ele, prop, isVariable) {\n if (ele.nodeType !== 1) return;\n var style = win.getComputedStyle(ele, null);\n return prop ? (isVariable ? style.getPropertyValue(prop) : style[prop]) : style;\n} // @require ./compute_style.js\n\nfunction computeStyleInt(ele, prop) {\n return parseInt(computeStyle(ele, prop), 10) || 0;\n}\n\nvar cssVariableRe = /^--/; // @require ./variables.js\n\nfunction isCSSVariable(prop) {\n return cssVariableRe.test(prop);\n} // @require core/camel_case.js\n// @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require ./is_css_variable.js\n\nvar prefixedProps = {},\n docEl = doc && doc.createElement('div'),\n style = docEl ? docEl.style : {},\n vendorsPrefixes = ['webkit', 'moz', 'ms', 'o'];\n\nfunction getPrefixedProp(prop, isVariable) {\n if (isVariable === void 0) {\n isVariable = isCSSVariable(prop);\n }\n\n if (isVariable) return prop;\n\n if (!prefixedProps[prop]) {\n var propCC = camelCase(prop),\n propUC = '' + propCC.charAt(0).toUpperCase() + propCC.slice(1),\n props = (propCC + ' ' + vendorsPrefixes.join(propUC + ' ') + propUC).split(' ');\n each(props, function (p) {\n if (p in style) {\n prefixedProps[prop] = p;\n return false;\n }\n });\n }\n\n return prefixedProps[prop];\n}\n\ncash.prefixedProp = getPrefixedProp; // @require core/type_checking.js\n// @require ./is_css_variable.js\n\nvar numericProps = {\n animationIterationCount: true,\n columnCount: true,\n flexGrow: true,\n flexShrink: true,\n fontWeight: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n widows: true,\n zIndex: true,\n};\n\nfunction getSuffixedValue(prop, value, isVariable) {\n if (isVariable === void 0) {\n isVariable = isCSSVariable(prop);\n }\n\n return !isVariable && !numericProps[prop] && isNumeric(value) ? value + 'px' : value;\n} // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/compute_style.js\n// @require ./helpers/get_prefixed_prop.js\n// @require ./helpers/get_suffixed_value.js\n// @require ./helpers/is_css_variable.js\n\nfn.css = function (prop, value) {\n if (isString(prop)) {\n var isVariable = isCSSVariable(prop);\n prop = getPrefixedProp(prop, isVariable);\n if (arguments.length < 2) return this[0] && computeStyle(this[0], prop, isVariable);\n if (!prop) return this;\n value = getSuffixedValue(prop, value, isVariable);\n return this.each(function (i, ele) {\n if (ele.nodeType !== 1) return;\n\n if (isVariable) {\n ele.style.setProperty(prop, value);\n } else {\n ele.style[prop] = value;\n }\n });\n }\n\n for (var key in prop) {\n this.css(key, prop[key]);\n }\n\n return this;\n}; // @optional ./css.js\n\nvar dataNamespace = '__cashData',\n dataAttributeRe = /^data-(.*)/; // @require core/cash.js\n// @require ./helpers/variables.js\n\ncash.hasData = function (ele) {\n return dataNamespace in ele;\n}; // @require ./variables.js\n\nfunction getDataCache(ele) {\n return (ele[dataNamespace] = ele[dataNamespace] || {});\n} // @require attributes/attr.js\n// @require ./get_data_cache.js\n\nfunction getData(ele, key) {\n var cache = getDataCache(ele);\n\n if (key) {\n if (!(key in cache)) {\n var value = ele.dataset ? ele.dataset[key] || ele.dataset[camelCase(key)] : cash(ele).attr('data-' + key);\n\n if (value !== undefined) {\n try {\n value = JSON.parse(value);\n } catch (e) {}\n\n cache[key] = value;\n }\n }\n\n return cache[key];\n }\n\n return cache;\n} // @require ./variables.js\n// @require ./get_data_cache.js\n\nfunction removeData(ele, key) {\n if (key === undefined) {\n delete ele[dataNamespace];\n } else {\n delete getDataCache(ele)[key];\n }\n} // @require ./get_data_cache.js\n\nfunction setData(ele, key, value) {\n getDataCache(ele)[key] = value;\n} // @require core/cash.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/get_data.js\n// @require ./helpers/set_data.js\n// @require ./helpers/variables.js\n\nfn.data = function (name, value) {\n var _this = this;\n\n if (!name) {\n if (!this[0]) return;\n each(this[0].attributes, function (attr) {\n var match = attr.name.match(dataAttributeRe);\n if (!match) return;\n\n _this.data(match[1]);\n });\n return getData(this[0]);\n }\n\n if (isString(name)) {\n if (value === undefined) return this[0] && getData(this[0], name);\n return this.each(function (i, ele) {\n return setData(ele, name, value);\n });\n }\n\n for (var key in name) {\n this.data(key, name[key]);\n }\n\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n// @require ./helpers/remove_data.js\n\nfn.removeData = function (key) {\n return this.each(function (i, ele) {\n return removeData(ele, key);\n });\n}; // @optional ./data.js\n// @optional ./remove_data.js\n// @require css/helpers/compute_style_int.js\n\nfunction getExtraSpace(ele, xAxis) {\n return (\n computeStyleInt(ele, 'border' + (xAxis ? 'Left' : 'Top') + 'Width') +\n computeStyleInt(ele, 'padding' + (xAxis ? 'Left' : 'Top')) +\n computeStyleInt(ele, 'padding' + (xAxis ? 'Right' : 'Bottom')) +\n computeStyleInt(ele, 'border' + (xAxis ? 'Right' : 'Bottom') + 'Width')\n );\n} // @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n\neach(['Width', 'Height'], function (prop) {\n fn['inner' + prop] = function () {\n if (!this[0]) return;\n if (this[0] === win) return win['inner' + prop];\n return this[0]['client' + prop];\n };\n}); // @require core/camel_case.js\n// @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require css/helpers/compute_style.js\n// @require css/helpers/get_suffixed_value.js\n// @require ./helpers/get_extra_space.js\n\neach(['width', 'height'], function (prop, index) {\n fn[prop] = function (value) {\n if (!this[0]) return value === undefined ? undefined : this;\n\n if (!arguments.length) {\n if (this[0] === win) return this[0][camelCase('outer-' + prop)];\n return this[0].getBoundingClientRect()[prop] - getExtraSpace(this[0], !index);\n }\n\n value = parseInt(value, 10);\n return this.each(function (i, ele) {\n if (ele.nodeType !== 1) return;\n var boxSizing = computeStyle(ele, 'boxSizing');\n ele.style[prop] = getSuffixedValue(prop, value + (boxSizing === 'border-box' ? getExtraSpace(ele, !index) : 0));\n });\n };\n}); // @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require css/helpers/compute_style_int.js\n\neach(['Width', 'Height'], function (prop, index) {\n fn['outer' + prop] = function (includeMargins) {\n if (!this[0]) return;\n if (this[0] === win) return win['outer' + prop];\n return (\n this[0]['offset' + prop] +\n (includeMargins\n ? computeStyleInt(this[0], 'margin' + (!index ? 'Left' : 'Top')) +\n computeStyleInt(this[0], 'margin' + (!index ? 'Right' : 'Bottom'))\n : 0)\n );\n };\n}); // @optional ./inner.js\n// @optional ./normal.js\n// @optional ./outer.js\n\nfunction hasNamespaces(ns1, ns2) {\n for (var i = 0, l = ns2.length; i < l; i++) {\n if (ns1.indexOf(ns2[i]) < 0) return false;\n }\n\n return true;\n} // @require core/each.js\n\nfunction removeEventListeners(cache, ele, name) {\n each(cache[name], function (_ref) {\n var namespaces = _ref[0],\n callback = _ref[1];\n ele.removeEventListener(name, callback);\n });\n delete cache[name];\n}\n\nvar eventsNamespace = '__cashEvents',\n eventsNamespacesSeparator = '.'; // @require ./variables.js\n\nfunction getEventsCache(ele) {\n return (ele[eventsNamespace] = ele[eventsNamespace] || {});\n} // @require core/guid.js\n// @require events/helpers/get_events_cache.js\n\nfunction addEvent(ele, name, namespaces, callback) {\n callback.guid = callback.guid || guid++;\n var eventCache = getEventsCache(ele);\n eventCache[name] = eventCache[name] || [];\n eventCache[name].push([namespaces, callback]);\n ele.addEventListener(name, callback);\n} // @require ./variables.js\n\nfunction parseEventName(eventName) {\n var parts = eventName.split(eventsNamespacesSeparator);\n return [parts[0], parts.slice(1).sort()]; // [name, namespaces]\n} // @require core/guid.js\n// @require ./get_events_cache.js\n// @require ./has_namespaces.js\n// @require ./parse_event_name.js\n// @require ./remove_event_listeners.js\n\nfunction removeEvent(ele, name, namespaces, callback) {\n var cache = getEventsCache(ele);\n\n if (!name) {\n if (!namespaces || !namespaces.length) {\n for (name in cache) {\n removeEventListeners(cache, ele, name);\n }\n } else {\n for (name in cache) {\n removeEvent(ele, name, namespaces, callback);\n }\n }\n } else {\n var eventCache = cache[name];\n if (!eventCache) return;\n if (callback) callback.guid = callback.guid || guid++;\n cache[name] = eventCache.filter(function (_ref2) {\n var ns = _ref2[0],\n cb = _ref2[1];\n if ((callback && cb.guid !== callback.guid) || !hasNamespaces(ns, namespaces)) return true;\n ele.removeEventListener(name, cb);\n });\n }\n} // @require core/cash.js\n// @require core/each.js\n// @require collection/each.js\n// @require ./helpers/parse_event_name.js\n// @require ./helpers/remove_event.js\n\nfn.off = function (eventFullName, callback) {\n var _this2 = this;\n\n if (eventFullName === undefined) {\n this.each(function (i, ele) {\n return removeEvent(ele);\n });\n } else {\n each(getSplitValues(eventFullName), function (eventFullName) {\n var _parseEventName = parseEventName(eventFullName),\n name = _parseEventName[0],\n namespaces = _parseEventName[1];\n\n _this2.each(function (i, ele) {\n return removeEvent(ele, name, namespaces, callback);\n });\n });\n }\n\n return this;\n}; // @require core/cash.js\n// @require core/get_split_values.js\n// @require core/guid.js\n// @require core/matches.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/variables.js\n// @require ./helpers/add_event.js\n// @require ./helpers/has_namespaces.js\n// @require ./helpers/parse_event_name.js\n// @require ./helpers/remove_event.js\n\nfn.on = function (eventFullName, selector, callback, _one) {\n var _this3 = this;\n\n if (!isString(eventFullName)) {\n for (var key in eventFullName) {\n this.on(key, selector, eventFullName[key]);\n }\n\n return this;\n }\n\n if (isFunction(selector)) {\n callback = selector;\n selector = false;\n }\n\n each(getSplitValues(eventFullName), function (eventFullName) {\n var _parseEventName2 = parseEventName(eventFullName),\n name = _parseEventName2[0],\n namespaces = _parseEventName2[1];\n\n _this3.each(function (i, ele) {\n var finalCallback = function finalCallback(event) {\n if (event.namespace && !hasNamespaces(namespaces, event.namespace.split(eventsNamespacesSeparator))) return;\n var thisArg = ele;\n\n if (selector) {\n var target = event.target;\n\n while (!matches(target, selector)) {\n if (target === ele) return;\n target = target.parentNode;\n if (!target) return;\n }\n\n thisArg = target;\n }\n\n event.namespace = event.namespace || '';\n var returnValue = callback.call(thisArg, event, event.data);\n\n if (_one) {\n removeEvent(ele, name, namespaces, finalCallback);\n }\n\n if (returnValue === false) {\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n finalCallback.guid = callback.guid = callback.guid || guid++;\n addEvent(ele, name, namespaces, finalCallback);\n });\n });\n return this;\n}; // @require core/cash.js\n// @require ./on.js\n\nfn.one = function (eventFullName, delegate, callback) {\n return this.on(eventFullName, delegate, callback, true);\n}; // @require core/cash.js\n// @require core/variables.js\n\nfn.ready = function (callback) {\n var finalCallback = function finalCallback() {\n return callback(cash);\n };\n\n if (doc.readyState !== 'loading') {\n setTimeout(finalCallback);\n } else {\n doc.addEventListener('DOMContentLoaded', finalCallback);\n }\n\n return this;\n}; // @require core/cash.js\n// @require core/type_checking.js\n// @require core/variables.js\n// @require collection/each.js\n// @require ./helpers/parse_event_name.js\n// @require ./helpers/variables.js\n\nfn.trigger = function (eventFullName, data) {\n var evt = eventFullName;\n\n if (isString(eventFullName)) {\n var _parseEventName3 = parseEventName(eventFullName),\n name = _parseEventName3[0],\n namespaces = _parseEventName3[1];\n\n evt = doc.createEvent('HTMLEvents');\n evt.initEvent(name, true, true);\n evt.namespace = namespaces.join(eventsNamespacesSeparator);\n }\n\n evt.data = data;\n return this.each(function (i, ele) {\n ele.dispatchEvent(evt);\n });\n}; // @optional ./off.js\n// @optional ./on.js\n// @optional ./one.js\n// @optional ./ready.js\n// @optional ./trigger.js\n// @require core/each.js\n\nfunction getValueSelectMultiple(ele) {\n var values = [];\n each(ele.options, function (option) {\n if (option.selected && !option.disabled && !option.parentNode.disabled) {\n values.push(option.value);\n }\n });\n return values;\n}\n\nfunction getValueSelectSingle(ele) {\n return ele.selectedIndex < 0 ? null : ele.options[ele.selectedIndex].value;\n} // @require ./get_value_select_single.js\n// @require ./get_value_select_multiple.js\n\nvar selectOneRe = /select-one/i,\n selectMultipleRe = /select-multiple/i;\n\nfunction getValue(ele) {\n var type = ele.type;\n if (selectOneRe.test(type)) return getValueSelectSingle(ele);\n if (selectMultipleRe.test(type)) return getValueSelectMultiple(ele);\n return ele.value;\n}\n\nvar queryEncodeSpaceRe = /%20/g;\n\nfunction queryEncode(prop, value) {\n return '&' + encodeURIComponent(prop) + '=' + encodeURIComponent(value).replace(queryEncodeSpaceRe, '+');\n} // @require core/cash.js\n// @require core/each.js\n// @require core/type_checking.js\n// @require ./helpers/get_value.js\n// @require ./helpers/query_encode.js\n\nvar skippableRe = /file|reset|submit|button|image/i,\n checkableRe = /radio|checkbox/i;\n\nfn.serialize = function () {\n var query = '';\n this.each(function (i, ele) {\n each(ele.elements || [ele], function (ele) {\n if (ele.disabled || !ele.name || ele.tagName === 'FIELDSET') return;\n if (skippableRe.test(ele.type)) return;\n if (checkableRe.test(ele.type) && !ele.checked) return;\n var value = getValue(ele);\n if (value === undefined) return;\n var values = isArray(value) ? value : [value];\n each(values, function (value) {\n query += queryEncode(ele.name, value);\n });\n });\n });\n return query.substr(1);\n}; // @require core/cash.js\n// @require core/each.js\n// @require core/type_checking.js\n// @require collection/each.js\n// @require ./helpers/get_value.js\n\nfn.val = function (value) {\n if (value === undefined) return this[0] && getValue(this[0]);\n return this.each(function (i, ele) {\n var isMultiple = selectMultipleRe.test(ele.type),\n eleValue = value === null ? (isMultiple ? [] : '') : value;\n\n if (isMultiple && isArray(eleValue)) {\n each(ele.options, function (option) {\n option.selected = eleValue.indexOf(option.value) >= 0;\n });\n } else {\n ele.value = eleValue;\n }\n });\n}; // @optional ./serialize.js\n// @optional ./val.js\n// @require core/cash.js\n// @require collection/map.js\n\nfn.clone = function () {\n return this.map(function (i, ele) {\n return ele.cloneNode(true);\n });\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.detach = function () {\n return this.each(function (i, ele) {\n if (ele.parentNode) {\n ele.parentNode.removeChild(ele);\n }\n });\n}; // @require ./cash.js\n// @require ./variables.js\n// @require ./type_checking.js\n// @require collection/get.js\n// @require manipulation/detach.js\n\nvar fragmentRe = /^\\s*<(\\w+)[^>]*>/,\n singleTagRe = /^\\s*<(\\w+)\\s*\\/?>(?:<\\/\\1>)?\\s*$/;\nvar containers;\n\nfunction initContainers() {\n if (containers) return;\n var table = doc.createElement('table'),\n tr = doc.createElement('tr');\n containers = {\n '*': doc.createElement('div'),\n tr: doc.createElement('tbody'),\n td: tr,\n th: tr,\n thead: table,\n tbody: table,\n tfoot: table,\n };\n}\n\nfunction parseHTML(html) {\n initContainers();\n if (!isString(html)) return [];\n if (singleTagRe.test(html)) return [doc.createElement(RegExp.$1)];\n var fragment = fragmentRe.test(html) && RegExp.$1,\n container = containers[fragment] || containers['*'];\n container.innerHTML = html;\n return cash(container.childNodes).detach().get();\n}\n\ncash.parseHTML = parseHTML; // @optional ./camel_case.js\n// @optional ./each.js\n// @optional ./export.js\n// @optional ./extend.js\n// @optional ./find.js\n// @optional ./get_compare_function.js\n// @optional ./get_split_values.js\n// @optional ./guid.js\n// @optional ./matches.js\n// @optional ./parse_html.js\n// @optional ./unique.js\n// @optional ./variables.js\n// @require ./cash.js\n// @require ./type_checking.js\n// @require core/cash.js\n\nfn.empty = function () {\n var ele = this[0];\n\n if (ele) {\n while (ele.firstChild) {\n ele.removeChild(ele.firstChild);\n }\n }\n\n return this;\n};\n\nfunction insertElement(ele, child, prepend) {\n if (prepend) {\n ele.insertBefore(child, ele.childNodes[0]);\n } else {\n ele.appendChild(child);\n }\n} // @require core/each.js\n// @require core/type_checking.js\n// @require ./insert_element.js\n\nfunction insertContent(parent, child, prepend) {\n if (child === undefined) return;\n var isStr = isString(child);\n\n if (!isStr && child.length) {\n each(child, function (ele) {\n return insertContent(parent, ele, prepend);\n });\n } else {\n each(\n parent,\n isStr\n ? function (ele) {\n ele.insertAdjacentHTML(prepend ? 'afterbegin' : 'beforeend', child);\n }\n : function (ele, index) {\n return insertElement(ele, !index ? child : child.cloneNode(true), prepend);\n }\n );\n }\n} // @require core/cash.js\n// @require core/each.js\n// @require ./helpers/insert_content.js\n\nfn.append = function () {\n var _this4 = this;\n\n each(arguments, function (content) {\n insertContent(_this4, content);\n });\n return this;\n}; // @require core/cash.js\n// @require ./helpers/insert_content.js\n\nfn.appendTo = function (parent) {\n insertContent(cash(parent), this);\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.html = function (content) {\n if (content === undefined) return this[0] && this[0].innerHTML;\n var source = content.nodeType ? content[0].outerHTML : content;\n return this.each(function (i, ele) {\n ele.innerHTML = source;\n });\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.insertAfter = function (content) {\n var _this5 = this;\n\n cash(content).each(function (index, ele) {\n var parent = ele.parentNode;\n\n _this5.each(function (i, e) {\n parent.insertBefore(!index ? e : e.cloneNode(true), ele.nextSibling);\n });\n });\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require core/variables.js\n// @require collection/slice.js\n// @require ./insert_after.js\n\nfn.after = function () {\n var _this6 = this;\n\n each(reverse.apply(arguments), function (content) {\n reverse.apply(cash(content).slice()).insertAfter(_this6);\n });\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.insertBefore = function (selector) {\n var _this7 = this;\n\n cash(selector).each(function (index, ele) {\n var parent = ele.parentNode;\n\n _this7.each(function (i, e) {\n parent.insertBefore(!index ? e : e.cloneNode(true), ele);\n });\n });\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require ./insert_before.js\n\nfn.before = function () {\n var _this8 = this;\n\n each(arguments, function (content) {\n cash(content).insertBefore(_this8);\n });\n return this;\n}; // @require core/cash.js\n// @require core/each.js\n// @require ./helpers/insert_content.js\n\nfn.prepend = function () {\n var _this9 = this;\n\n each(arguments, function (content) {\n insertContent(_this9, content, true);\n });\n return this;\n}; // @require core/cash.js\n// @require core/variables.js\n// @require collection/slice.js\n// @require ./helpers/insert_content.js\n\nfn.prependTo = function (parent) {\n insertContent(cash(parent), reverse.apply(this.slice()), true);\n return this;\n}; // @require core/cash.js\n// @require events/off.js\n// @require ./detach.js\n\nfn.remove = function () {\n return this.detach().off();\n}; // @require core/cash.js\n// @require collection/each.js\n// @require collection/slice.js\n// @require ./after.js\n// @require ./remove.js\n\nfn.replaceWith = function (content) {\n var _this10 = this;\n\n return this.each(function (i, ele) {\n var parent = ele.parentNode;\n if (!parent) return;\n var $eles = i ? cash(content).clone() : cash(content);\n\n if (!$eles[0]) {\n _this10.remove();\n\n return false;\n }\n\n parent.replaceChild($eles[0], ele);\n cash($eles[0]).after($eles.slice(1));\n });\n}; // @require core/cash.js\n// @require ./replace_with.js\n\nfn.replaceAll = function (content) {\n cash(content).replaceWith(this);\n return this;\n}; // @require core/cash.js\n// @require collection/each.js\n\nfn.text = function (content) {\n if (content === undefined) return this[0] ? this[0].textContent : '';\n return this.each(function (i, ele) {\n ele.textContent = content;\n });\n}; // @optional ./after.js\n// @optional ./append.js\n// @optional ./append_to.js\n// @optional ./before.js\n// @optional ./clone.js\n// @optional ./detach.js\n// @optional ./empty.js\n// @optional ./html.js\n// @optional ./insert_after.js\n// @optional ./insert_before.js\n// @optional ./prepend.js\n// @optional ./prepend_to.js\n// @optional ./remove.js\n// @optional ./replace_all.js\n// @optional ./replace_with.js\n// @optional ./text.js\n// @require core/cash.js\n// @require core/variables.js\n\nvar docEle = doc && doc.documentElement;\n\nfn.offset = function () {\n var ele = this[0];\n if (!ele) return;\n var rect = ele.getBoundingClientRect();\n return {\n top: rect.top + win.pageYOffset - docEle.clientTop,\n left: rect.left + win.pageXOffset - docEle.clientLeft,\n };\n}; // @require core/cash.js\n\nfn.offsetParent = function () {\n return cash(this[0] && this[0].offsetParent);\n}; // @require core/cash.js\n\nfn.position = function () {\n var ele = this[0];\n if (!ele) return;\n return {\n left: ele.offsetLeft,\n top: ele.offsetTop,\n };\n}; // @optional ./offset.js\n// @optional ./offset_parent.js\n// @optional ./position.js\n// @require core/cash.js\n// @require core/matches.js\n// @require core/unique.js\n// @require collection/each.js\n// @require collection/filter.js\n\nfn.children = function (selector) {\n var result = [];\n this.each(function (i, ele) {\n push.apply(result, ele.children);\n });\n result = cash(unique(result));\n if (!selector) return result;\n return result.filter(function (i, ele) {\n return matches(ele, selector);\n });\n}; // @require core/cash.js\n// @require core/unique.js\n// @require collection/each.js\n\nfn.contents = function () {\n var result = [];\n this.each(function (i, ele) {\n push.apply(result, ele.tagName === 'IFRAME' ? [ele.contentDocument] : ele.childNodes);\n });\n return cash(result.length && unique(result));\n}; // @require core/cash.js\n// @require core/unique.js\n// @require core/find.js\n// @require core/variables.js\n\nfn.find = function (selector) {\n var result = [];\n\n for (var i = 0, l = this.length; i < l; i++) {\n var found = find(selector, this[i]);\n\n if (found.length) {\n push.apply(result, found);\n }\n }\n\n return cash(result.length && unique(result));\n}; // @require core/cash.js\n// @require core/find.js\n// @require core/type_checking.js\n// @require collection/filter.js\n\nfn.has = function (selector) {\n var comparator = isString(selector)\n ? function (i, ele) {\n return !!find(selector, ele).length;\n }\n : function (i, ele) {\n return ele.contains(selector);\n };\n return this.filter(comparator);\n}; // @require core/cash.js\n// @require core/get_compare_function.js\n// @require collection/each.js\n\nfn.is = function (selector) {\n if (!selector || !this[0]) return false;\n var comparator = getCompareFunction(selector);\n var check = false;\n this.each(function (i, ele) {\n check = comparator(i, ele, selector);\n return !check;\n });\n return check;\n}; // @require core/cash.js\n\nfn.next = function () {\n return cash(this[0] && this[0].nextElementSibling);\n}; // @require core/cash.js\n// @require core/get_compare_function.js\n// @require collection/filter.js\n\nfn.not = function (selector) {\n if (!selector || !this[0]) return this;\n var comparator = getCompareFunction(selector);\n return this.filter(function (i, ele) {\n return !comparator(i, ele, selector);\n });\n}; // @require core/cash.js\n// @require core/unique.js\n// @require collection/each.js\n\nfn.parent = function () {\n var result = [];\n this.each(function (i, ele) {\n if (ele && ele.parentNode) {\n result.push(ele.parentNode);\n }\n });\n return cash(unique(result));\n}; // @require core/cash.js\n// @require core/variables.js\n// @require traversal/children.js\n// @require traversal/parent.js\n// @require ./get.js\n//FIXME Ugly file name, is there a better option?\n\nfn.index = function (ele) {\n var child = ele ? cash(ele)[0] : this[0],\n collection = ele ? this : cash(child).parent().children();\n return indexOf.call(collection, child);\n}; // @optional ./add.js\n// @optional ./each.js\n// @optional ./eq.js\n// @optional ./filter.js\n// @optional ./first.js\n// @optional ./get.js\n// @optional ./indexFn.js\n// @optional ./last.js\n// @optional ./map.js\n// @optional ./slice.js\n// @require core/cash.js\n// @require collection/filter.js\n// @require ./is.js\n// @require ./parent.js\n\nfn.closest = function (selector) {\n if (!selector || !this[0]) return cash();\n if (this.is(selector)) return this.filter(selector);\n return this.parent().closest(selector);\n}; // @require core/cash.js\n// @require core/matches.js\n// @require core/unique.js\n// @require core/variables.js\n// @require collection/each.js\n\nfn.parents = function (selector) {\n var result = [];\n var last;\n this.each(function (i, ele) {\n last = ele;\n\n while (last && last.parentNode && last !== doc.body.parentNode) {\n last = last.parentNode;\n\n if (!selector || (selector && matches(last, selector))) {\n result.push(last);\n }\n }\n });\n return cash(unique(result));\n}; // @require core/cash.js\n\nfn.prev = function () {\n return cash(this[0] && this[0].previousElementSibling);\n}; // @require core/cash.js\n// @require collection/filter.js\n// @require ./children.js\n// @require ./parent.js\n\nfn.siblings = function () {\n var ele = this[0];\n return this.parent()\n .children()\n .filter(function (i, child) {\n return child !== ele;\n });\n}; // @optional ./children.js\n// @optional ./closest.js\n// @optional ./contents.js\n// @optional ./find.js\n// @optional ./has.js\n// @optional ./is.js\n// @optional ./next.js\n// @optional ./not.js\n// @optional ./parent.js\n// @optional ./parents.js\n// @optional ./prev.js\n// @optional ./siblings.js\n// @optional attributes/index.js\n// @optional collection/index.js\n// @optional css/index.js\n// @optional data/index.js\n// @optional dimensions/index.js\n// @optional events/index.js\n// @optional forms/index.js\n// @optional manipulation/index.js\n// @optional offset/index.js\n// @optional traversal/index.js\n// @require core/index.js\nexport default cash as any;\n","import { each, isArray, isString, isUndefined } from 'underscore';\nimport { ObjectAny } from '../common';\n\ntype vNode = {\n tag?: string;\n attributes?: ObjectAny;\n children?: vNode[];\n};\n\ntype ChildHTML = HTMLElement | string;\n\ntype ClassNameInputType = string | number | boolean | null | undefined;\n\ntype ClassNameInput = ClassNameInputType | Array;\n\nconst KEY_TAG = 'tag';\nconst KEY_ATTR = 'attributes';\nconst KEY_CHILD = 'children';\n\nexport const motionsEv = 'transitionend oTransitionEnd transitionend webkitTransitionEnd';\n\nexport const isDoc = (el?: Node): el is Document => el?.nodeType === Node.DOCUMENT_NODE;\n\nexport const removeEl = (el?: HTMLElement) => {\n const parent = el && el.parentNode;\n parent && parent.removeChild(el);\n};\n\nexport function cx(...inputs: ClassNameInput[]): string {\n const inp = Array.isArray(inputs[0]) ? inputs[0] : [...inputs];\n return inp.filter(Boolean).join(' ');\n}\n\nexport const find = (el: HTMLElement, query: string) => el.querySelectorAll(query);\n\nexport const attrUp = (el?: HTMLElement, attrs: ObjectAny = {}) =>\n el && el.setAttribute && each(attrs, (value, key) => el.setAttribute(key, value));\n\nexport const isVisible = (el?: HTMLElement) => {\n return el && !!(el.offsetWidth || el.offsetHeight || el.getClientRects?.().length);\n};\n\nexport const empty = (node: HTMLElement) => {\n while (node.firstChild) node.removeChild(node.firstChild);\n};\n\nexport const replaceWith = (oldEl: HTMLElement, newEl: HTMLElement) => {\n oldEl.parentNode?.replaceChild(newEl, oldEl);\n};\n\nexport const appendAtIndex = (parent: HTMLElement | DocumentFragment, child: ChildHTML, index?: number) => {\n const { childNodes } = parent;\n const total = childNodes.length;\n const at = isUndefined(index) ? total : index;\n\n if (isString(child)) {\n // @ts-ignore\n parent.insertAdjacentHTML('beforeEnd', child);\n child = parent.lastChild as HTMLElement;\n parent.removeChild(child);\n }\n\n if (at >= total) {\n parent.appendChild(child);\n } else {\n parent.insertBefore(child, childNodes[at]);\n }\n};\n\nexport const append = (parent: HTMLElement, child: ChildHTML) => appendAtIndex(parent, child);\n\nexport const createEl = (tag: string, attrs: ObjectAny = {}, child?: ChildHTML) => {\n const el = document.createElement(tag);\n attrs && each(attrs, (value, key) => el.setAttribute(key, value));\n\n if (child) {\n if (isString(child)) el.innerHTML = child;\n else el.appendChild(child);\n }\n\n return el;\n};\n\nexport const createText = (str: string) => document.createTextNode(str);\n\n// Unfortunately just creating `KeyboardEvent(e.type, e)` is not enough,\n// the keyCode/which will be always `0`. Even if it's an old/deprecated\n// property keymaster (and many others) still use it... using `defineProperty`\n// hack seems the only way\nexport const createCustomEvent = (e: any, cls: any) => {\n let oEvent: any;\n const { type } = e;\n try {\n // @ts-ignore\n oEvent = new window[cls](type, e);\n } catch (err) {\n oEvent = document.createEvent(cls);\n oEvent.initEvent(type, true, true);\n }\n oEvent._parentEvent = e;\n if (type.indexOf('key') === 0) {\n oEvent.keyCodeVal = e.keyCode;\n ['keyCode', 'which'].forEach(prop => {\n Object.defineProperty(oEvent, prop, {\n get() {\n return this.keyCodeVal;\n },\n });\n });\n }\n return oEvent;\n};\n\n/**\n * Append an array of vNodes to an element\n * @param {HTMLElement} node HTML element\n * @param {Array} vNodes Array of node objects\n */\nexport const appendVNodes = (node: HTMLElement, vNodes: vNode | vNode[] = []) => {\n const vNodesArr = Array.isArray(vNodes) ? vNodes : [vNodes];\n vNodesArr.forEach(vnode => {\n const tag = vnode[KEY_TAG] || 'div';\n const attr = vnode[KEY_ATTR] || {};\n const el = document.createElement(tag);\n\n each(attr, (value, key) => {\n el.setAttribute(key, value);\n });\n\n node.appendChild(el);\n });\n};\n\n/**\n * Check if element is a text node\n * @param {Node} el\n * @return {Boolean}\n */\nexport const isTextNode = (el?: Node): el is Text => el?.nodeType === Node.TEXT_NODE;\n\n/**\n * Check if element is a comment node\n * @param {Node} el\n * @return {Boolean}\n */\nexport const isCommentNode = (el?: Node): el is Comment => el?.nodeType === Node.COMMENT_NODE;\n\n/**\n * Check if taggable node\n * @param {Node} el\n * @return {Boolean}\n */\nexport const isTaggableNode = (el?: Node) => el && !isTextNode(el) && !isCommentNode(el);\n\n/**\n * Get DOMRect of the element.\n * @param el\n * @returns {DOMRect}\n */\nexport const getElRect = (el?: Element) => {\n const def = {\n top: 0,\n left: 0,\n width: 0,\n height: 0,\n };\n if (!el) return def;\n let rectText;\n\n if (isTextNode(el)) {\n const range = document.createRange();\n range.selectNode(el);\n rectText = range.getBoundingClientRect();\n range.detach();\n }\n\n return rectText || (el.getBoundingClientRect ? el.getBoundingClientRect() : def);\n};\n\n/**\n * Get document scroll coordinates\n */\nexport const getDocumentScroll = (el?: HTMLElement) => {\n const doc = el?.ownerDocument || document;\n const docEl = doc.documentElement;\n const win = doc.defaultView || window;\n\n return {\n x: (win.pageXOffset || docEl.scrollLeft || 0) - (docEl.clientLeft || 0),\n y: (win.pageYOffset || docEl.scrollTop || 0) - (docEl.clientTop || 0),\n };\n};\n\nexport const getKeyCode = (ev: KeyboardEvent) => ev.which || ev.keyCode;\n\nexport const getKeyChar = (ev: KeyboardEvent) => String.fromCharCode(getKeyCode(ev));\n\nexport const getPointerEvent = (ev: any): PointerEvent => (ev.touches && ev.touches[0] ? ev.touches[0] : ev);\n\nexport const isEscKey = (ev: KeyboardEvent) => getKeyCode(ev) === 27;\n\nexport const isEnterKey = (ev: KeyboardEvent) => getKeyCode(ev) === 13;\n\nexport const hasCtrlKey = (ev: WheelEvent) => ev.ctrlKey;\n\nexport const hasModifierKey = (ev: WheelEvent) => hasCtrlKey(ev) || ev.metaKey;\n\n// Ref: https://stackoverflow.com/a/10162353\nexport const doctypeToString = (dt?: DocumentType | null) => {\n if (!dt) return '';\n const { name, publicId, systemId } = dt;\n const pubId = publicId ? ` PUBLIC \"${publicId}\"` : '';\n const sysId = !publicId && systemId ? ` SYSTEM \"${systemId}\"` : '';\n return ``;\n};\n\nexport const attrToString = (attrs: ObjectAny = {}) => {\n const res: string[] = [];\n each(attrs, (value, key) => res.push(`${key}=\"${value}\"`));\n return res.join(' ');\n};\n\nexport const on = (\n el: EventTarget | EventTarget[],\n ev: string,\n fn: (ev: E) => void,\n opts?: boolean | AddEventListenerOptions\n) => {\n const evs = ev.split(/\\s+/);\n const els = isArray(el) ? el : [el];\n\n evs.forEach(ev => {\n els.forEach(el => el?.addEventListener(ev, fn as EventListener, opts));\n });\n};\n\nexport const off = (\n el: EventTarget | EventTarget[],\n ev: string,\n fn: (ev: E) => void,\n opts?: boolean | AddEventListenerOptions\n) => {\n const evs = ev.split(/\\s+/);\n const els = isArray(el) ? el : [el];\n\n evs.forEach(ev => {\n els.forEach(el => el?.removeEventListener(ev, fn as EventListener, opts));\n });\n};\n","import { isArray, isElement, isFunction, isUndefined, keys } from 'underscore';\nimport ComponentView from '../dom_components/view/ComponentView';\nimport EditorModel from '../editor/model/Editor';\nimport { isTextNode } from './dom';\nimport Component from '../dom_components/model/Component';\nimport { ObjectAny } from '../common';\n\nconst obj: ObjectAny = {};\n\nexport const isBultInMethod = (key: string) => isFunction(obj[key]);\n\nexport const normalizeKey = (key: string) => (isBultInMethod(key) ? `_${key}` : key);\n\nexport const wait = (mls: number = 0) => new Promise(res => setTimeout(res, mls));\n\nexport const isDef = (value: any) => typeof value !== 'undefined';\n\nexport const hasWin = () => typeof window !== 'undefined';\n\nexport const getGlobal = () =>\n typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : global;\n\nexport const toLowerCase = (str: string) => (str || '').toLowerCase();\n\nconst elProt = hasWin() ? window.Element.prototype : {};\n// @ts-ignore\nconst matches = elProt.matches || elProt.webkitMatchesSelector || elProt.mozMatchesSelector || elProt.msMatchesSelector;\n\nexport const getUiClass = (em: EditorModel, defCls: string) => {\n const { stylePrefix, customUI } = em.getConfig();\n return [customUI && `${stylePrefix}cui`, defCls].filter(i => i).join(' ');\n};\n\n/**\n * Import styles asynchronously\n * @param {String|Array} styles\n */\nconst appendStyles = (styles: {}, opts: { unique?: boolean; prepand?: boolean } = {}) => {\n const stls = isArray(styles) ? [...styles] : [styles];\n\n if (stls.length) {\n const href = stls.shift();\n\n if (href && (!opts.unique || !document.querySelector(`link[href=\"${href}\"]`))) {\n const { head } = document;\n const link = document.createElement('link');\n link.href = href;\n link.rel = 'stylesheet';\n\n if (opts.prepand) {\n head.insertBefore(link, head.firstChild);\n } else {\n head.appendChild(link);\n }\n }\n\n appendStyles(stls);\n }\n};\n\n/**\n * Returns shallow diff between 2 objects\n * @param {Object} objOrig\n * @param {Objec} objNew\n * @return {Object}\n * @example\n * var a = {foo: 'bar', baz: 1, faz: 'sop'};\n * var b = {foo: 'bar', baz: 2, bar: ''};\n * shallowDiff(a, b);\n * // -> {baz: 2, faz: null, bar: ''};\n */\nconst shallowDiff = (objOrig: ObjectAny, objNew: ObjectAny) => {\n const result: ObjectAny = {};\n const keysNew = keys(objNew);\n\n for (let prop in objOrig) {\n if (objOrig.hasOwnProperty(prop)) {\n const origValue = objOrig[prop];\n const newValue = objNew[prop];\n\n if (keysNew.indexOf(prop) >= 0) {\n if (origValue !== newValue) {\n result[prop] = newValue;\n }\n } else {\n result[prop] = null;\n }\n }\n }\n\n for (let prop in objNew) {\n if (objNew.hasOwnProperty(prop)) {\n if (isUndefined(objOrig[prop])) {\n result[prop] = objNew[prop];\n }\n }\n }\n\n return result;\n};\n\nconst getUnitFromValue = (value: any) => {\n return value.replace(parseFloat(value), '');\n};\n\nconst upFirst = (value: string) => value[0].toUpperCase() + value.toLowerCase().slice(1);\n\nconst camelCase = (value: string) => {\n return value.replace(/-./g, x => x[1].toUpperCase());\n};\n\nconst normalizeFloat = (value: any, step = 1, valueDef = 0) => {\n let stepDecimals = 0;\n if (isNaN(value)) return valueDef;\n value = parseFloat(value);\n\n if (Math.floor(value) !== value) {\n const side = step.toString().split('.')[1];\n stepDecimals = side ? side.length : 0;\n }\n\n return stepDecimals ? parseFloat(value.toFixed(stepDecimals)) : value;\n};\n\nconst hasDnd = (em: EditorModel) => {\n return 'draggable' in document.createElement('i') && (em ? em.config.nativeDnD! : true);\n};\n\n/**\n * Ensure to fetch the element from the input argument\n * @param {HTMLElement|Component} el Component or HTML element\n * @return {HTMLElement}\n */\nconst getElement = (el: HTMLElement) => {\n if (isElement(el) || isTextNode(el)) {\n return el;\n // @ts-ignore\n } else if (el && el.getEl) {\n // @ts-ignore\n return el.getEl();\n }\n};\n\nexport const find = (arr: any[], test: (item: any, i: number, arr: any[]) => boolean) => {\n let result = null;\n arr.some((el, i) => (test(el, i, arr) ? ((result = el), 1) : 0));\n return result;\n};\n\nexport const escape = (str = '') => {\n return `${str}`\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(/`/g, '`');\n};\n\nexport const escapeNodeContent = (str = '') => {\n return `${str}`.replace(/&/g, '&').replace(//g, '>');\n};\n\nexport const deepMerge = (...args: ObjectAny[]) => {\n const target = { ...args[0] };\n\n for (let i = 1; i < args.length; i++) {\n const source = { ...args[i] };\n\n for (let key in source) {\n const targValue = target[key];\n const srcValue = source[key];\n\n if (isObject(targValue) && isObject(srcValue)) {\n target[key] = deepMerge(targValue, srcValue);\n } else {\n target[key] = srcValue;\n }\n }\n }\n\n return target;\n};\n\n/**\n * Ensure to fetch the model from the input argument\n * @param {HTMLElement|Component} el Component or HTML element\n * @return {Component}\n */\nconst getModel = (el: HTMLElement & { __cashData?: any }, $?: any): Component | undefined => {\n let model;\n if (!$ && el && el.__cashData) {\n model = el.__cashData.model;\n } else if ($ && isElement(el)) {\n model = $(el).data('model');\n }\n return model;\n};\n\nconst isObject = (val: any): val is ObjectAny => val && !Array.isArray(val) && typeof val === 'object';\nconst isEmptyObj = (val: ObjectAny) => Object.keys(val).length <= 0;\n\nconst capitalize = (str: string = '') => str && str.charAt(0).toUpperCase() + str.substring(1);\nconst isRule = (obj: any) => obj && obj.toCSS;\n\nconst getViewEl = (el?: Node): T | undefined => (el as any)?.__gjsv;\n\nexport const isComponent = (obj: any): obj is Component => !!obj?.toHTML;\n\nexport const getComponentView = (el?: Node) => getViewEl(el);\n\nexport const getComponentModel = (el?: Node) => getComponentView(el)?.model;\n\nconst setViewEl = (el: any, view: any) => {\n el.__gjsv = view;\n};\n\nconst createId = (length = 16) => {\n let result = '';\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const len = chars.length;\n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * len));\n }\n return result;\n};\n\nexport const buildBase64UrlFromSvg = (svg: string) => {\n if (svg && svg.substr(0, 4) === '= 0 && sizeProperty <= MAX_ARRAY_INDEX;\n }\n}\n","// Internal helper to generate a function to obtain property `key` from `obj`.\nexport default function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n}\n","import shallowProperty from './_shallowProperty.js';\n\n// Internal helper to obtain the `byteLength` property of an object.\nexport default shallowProperty('byteLength');\n","import createSizePropertyCheck from './_createSizePropertyCheck.js';\nimport getByteLength from './_getByteLength.js';\n\n// Internal helper to determine whether we should spend extensive checks against\n// `ArrayBuffer` et al.\nexport default createSizePropertyCheck(getByteLength);\n","import { supportsArrayBuffer, nativeIsView, toString } from './_setup.js';\nimport isDataView from './isDataView.js';\nimport constant from './constant.js';\nimport isBufferLike from './_isBufferLike.js';\n\n// Is a given value a typed array?\nvar typedArrayPattern = /\\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\\]/;\nfunction isTypedArray(obj) {\n // `ArrayBuffer.isView` is the most future-proof, so use it when available.\n // Otherwise, fall back on the above regular expression.\n return nativeIsView ? (nativeIsView(obj) && !isDataView(obj)) :\n isBufferLike(obj) && typedArrayPattern.test(toString.call(obj));\n}\n\nexport default supportsArrayBuffer ? isTypedArray : constant(false);\n","import shallowProperty from './_shallowProperty.js';\n\n// Internal helper to obtain the `length` property of an object.\nexport default shallowProperty('length');\n","import { nonEnumerableProps, ObjProto } from './_setup.js';\nimport isFunction from './isFunction.js';\nimport has from './_has.js';\n\n// Internal helper to create a simple lookup structure.\n// `collectNonEnumProps` used to depend on `_.contains`, but this led to\n// circular imports. `emulatedSet` is a one-off solution that only works for\n// arrays of strings.\nfunction emulatedSet(keys) {\n var hash = {};\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n return {\n contains: function(key) { return hash[key] === true; },\n push: function(key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n}\n\n// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't\n// be iterated by `for key in ...` and thus missed. Extends `keys` in place if\n// needed.\nexport default function collectNonEnumProps(obj, keys) {\n keys = emulatedSet(keys);\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = (isFunction(constructor) && constructor.prototype) || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n keys.push(prop);\n }\n }\n}\n","import isObject from './isObject.js';\nimport { nativeKeys, hasEnumBug } from './_setup.js';\nimport has from './_has.js';\nimport collectNonEnumProps from './_collectNonEnumProps.js';\n\n// Retrieve the names of an object's own properties.\n// Delegates to **ECMAScript 5**'s native `Object.keys`.\nexport default function keys(obj) {\n if (!isObject(obj)) return [];\n if (nativeKeys) return nativeKeys(obj);\n var keys = [];\n for (var key in obj) if (has(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n}\n","import getLength from './_getLength.js';\nimport isArray from './isArray.js';\nimport isString from './isString.js';\nimport isArguments from './isArguments.js';\nimport keys from './keys.js';\n\n// Is a given array, string, or object empty?\n// An \"empty\" object has no enumerable own-properties.\nexport default function isEmpty(obj) {\n if (obj == null) return true;\n // Skip the more expensive `toString`-based type checks if `obj` has no\n // `.length`.\n var length = getLength(obj);\n if (typeof length == 'number' && (\n isArray(obj) || isString(obj) || isArguments(obj)\n )) return length === 0;\n return getLength(keys(obj)) === 0;\n}\n","import keys from './keys.js';\n\n// Returns whether an object has a given set of `key:value` pairs.\nexport default function isMatch(object, attrs) {\n var _keys = keys(attrs), length = _keys.length;\n if (object == null) return !length;\n var obj = Object(object);\n for (var i = 0; i < length; i++) {\n var key = _keys[i];\n if (attrs[key] !== obj[key] || !(key in obj)) return false;\n }\n return true;\n}\n","import { VERSION } from './_setup.js';\n\n// If Underscore is called as a function, it returns a wrapped object that can\n// be used OO-style. This wrapper holds altered versions of all functions added\n// through `_.mixin`. Wrapped objects may be chained.\nexport default function _(obj) {\n if (obj instanceof _) return obj;\n if (!(this instanceof _)) return new _(obj);\n this._wrapped = obj;\n}\n\n_.VERSION = VERSION;\n\n// Extracts the result from a wrapped and chained object.\n_.prototype.value = function() {\n return this._wrapped;\n};\n\n// Provide unwrapping proxies for some methods used in engine operations\n// such as arithmetic and JSON stringification.\n_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;\n\n_.prototype.toString = function() {\n return String(this._wrapped);\n};\n","import getByteLength from './_getByteLength.js';\n\n// Internal function to wrap or shallow-copy an ArrayBuffer,\n// typed array or DataView to a new view, reusing the buffer.\nexport default function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n getByteLength(bufferSource)\n );\n}\n","import _ from './underscore.js';\nimport { toString, SymbolProto } from './_setup.js';\nimport getByteLength from './_getByteLength.js';\nimport isTypedArray from './isTypedArray.js';\nimport isFunction from './isFunction.js';\nimport { hasStringTagBug } from './_stringTagBug.js';\nimport isDataView from './isDataView.js';\nimport keys from './keys.js';\nimport has from './_has.js';\nimport toBufferView from './_toBufferView.js';\n\n// We use this string twice, so give it a name for minification.\nvar tagDataView = '[object DataView]';\n\n// Internal recursive comparison function for `_.isEqual`.\nfunction eq(a, b, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) return a !== 0 || 1 / a === 1 / b;\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) return false;\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) return b !== b;\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;\n return deepEq(a, b, aStack, bStack);\n}\n\n// Internal recursive comparison function for `_.isEqual`.\nfunction deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n // Work around a bug in IE 10 - Edge 13.\n if (hasStringTagBug && className == '[object Object]' && isDataView(a)) {\n if (!isDataView(b)) return false;\n className = tagDataView;\n }\n switch (className) {\n // These types are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case '[object ArrayBuffer]':\n case tagDataView:\n // Coerce to typed array so we can fall through.\n return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays && isTypedArray(a)) {\n var byteLength = getByteLength(a);\n if (byteLength !== getByteLength(b)) return false;\n if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;\n areArrays = true;\n }\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor &&\n isFunction(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\n\n// Perform a deep comparison to check if two objects are equal.\nexport default function isEqual(a, b) {\n return eq(a, b);\n}\n","import isObject from './isObject.js';\nimport { hasEnumBug } from './_setup.js';\nimport collectNonEnumProps from './_collectNonEnumProps.js';\n\n// Retrieve all the enumerable property names of an object.\nexport default function allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n}\n","import getLength from './_getLength.js';\nimport isFunction from './isFunction.js';\nimport allKeys from './allKeys.js';\n\n// Since the regular `Object.prototype.toString` type tests don't work for\n// some types in IE 11, we use a fingerprinting heuristic instead, based\n// on the methods. It's not great, but it's the best we got.\n// The fingerprint method lists are defined below.\nexport function ie11fingerprint(methods) {\n var length = getLength(methods);\n return function(obj) {\n if (obj == null) return false;\n // `Map`, `WeakMap` and `Set` have no enumerable keys.\n var keys = allKeys(obj);\n if (getLength(keys)) return false;\n for (var i = 0; i < length; i++) {\n if (!isFunction(obj[methods[i]])) return false;\n }\n // If we are testing against `WeakMap`, we need to ensure that\n // `obj` doesn't have a `forEach` method in order to distinguish\n // it from a regular `Map`.\n return methods !== weakMapMethods || !isFunction(obj[forEachName]);\n };\n}\n\n// In the interest of compact minification, we write\n// each string in the fingerprints only once.\nvar forEachName = 'forEach',\n hasName = 'has',\n commonInit = ['clear', 'delete'],\n mapTail = ['get', hasName, 'set'];\n\n// `Map`, `WeakMap` and `Set` each have slightly different\n// combinations of the above sublists.\nexport var mapMethods = commonInit.concat(forEachName, mapTail),\n weakMapMethods = commonInit.concat(mapTail),\n setMethods = ['add'].concat(commonInit, forEachName, hasName);\n","import tagTester from './_tagTester.js';\nimport { isIE11 } from './_stringTagBug.js';\nimport { ie11fingerprint, mapMethods } from './_methodFingerprint.js';\n\nexport default isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map');\n","import tagTester from './_tagTester.js';\nimport { isIE11 } from './_stringTagBug.js';\nimport { ie11fingerprint, weakMapMethods } from './_methodFingerprint.js';\n\nexport default isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap');\n","import tagTester from './_tagTester.js';\nimport { isIE11 } from './_stringTagBug.js';\nimport { ie11fingerprint, setMethods } from './_methodFingerprint.js';\n\nexport default isIE11 ? ie11fingerprint(setMethods) : tagTester('Set');\n","import tagTester from './_tagTester.js';\n\nexport default tagTester('WeakSet');\n","import keys from './keys.js';\n\n// Retrieve the values of an object's properties.\nexport default function values(obj) {\n var _keys = keys(obj);\n var length = _keys.length;\n var values = Array(length);\n for (var i = 0; i < length; i++) {\n values[i] = obj[_keys[i]];\n }\n return values;\n}\n","import keys from './keys.js';\n\n// Convert an object into a list of `[key, value]` pairs.\n// The opposite of `_.object` with one argument.\nexport default function pairs(obj) {\n var _keys = keys(obj);\n var length = _keys.length;\n var pairs = Array(length);\n for (var i = 0; i < length; i++) {\n pairs[i] = [_keys[i], obj[_keys[i]]];\n }\n return pairs;\n}\n","import keys from './keys.js';\n\n// Invert the keys and values of an object. The values must be serializable.\nexport default function invert(obj) {\n var result = {};\n var _keys = keys(obj);\n for (var i = 0, length = _keys.length; i < length; i++) {\n result[obj[_keys[i]]] = _keys[i];\n }\n return result;\n}\n","import isFunction from './isFunction.js';\n\n// Return a sorted list of the function names available on the object.\nexport default function functions(obj) {\n var names = [];\n for (var key in obj) {\n if (isFunction(obj[key])) names.push(key);\n }\n return names.sort();\n}\n","// An internal function for creating assigner functions.\nexport default function createAssigner(keysFunc, defaults) {\n return function(obj) {\n var length = arguments.length;\n if (defaults) obj = Object(obj);\n if (length < 2 || obj == null) return obj;\n for (var index = 1; index < length; index++) {\n var source = arguments[index],\n keys = keysFunc(source),\n l = keys.length;\n for (var i = 0; i < l; i++) {\n var key = keys[i];\n if (!defaults || obj[key] === void 0) obj[key] = source[key];\n }\n }\n return obj;\n };\n}\n","import createAssigner from './_createAssigner.js';\nimport allKeys from './allKeys.js';\n\n// Extend a given object with all the properties in passed-in object(s).\nexport default createAssigner(allKeys);\n","import createAssigner from './_createAssigner.js';\nimport keys from './keys.js';\n\n// Assigns a given object with all the own properties in the passed-in\n// object(s).\n// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\nexport default createAssigner(keys);\n","import createAssigner from './_createAssigner.js';\nimport allKeys from './allKeys.js';\n\n// Fill in a given object with default properties.\nexport default createAssigner(allKeys, true);\n","import isObject from './isObject.js';\nimport { nativeCreate } from './_setup.js';\n\n// Create a naked function reference for surrogate-prototype-swapping.\nfunction ctor() {\n return function(){};\n}\n\n// An internal function for creating a new object that inherits from another.\nexport default function baseCreate(prototype) {\n if (!isObject(prototype)) return {};\n if (nativeCreate) return nativeCreate(prototype);\n var Ctor = ctor();\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n}\n","import baseCreate from './_baseCreate.js';\nimport extendOwn from './extendOwn.js';\n\n// Creates an object that inherits from the given prototype object.\n// If additional properties are provided then they will be added to the\n// created object.\nexport default function create(prototype, props) {\n var result = baseCreate(prototype);\n if (props) extendOwn(result, props);\n return result;\n}\n","import isObject from './isObject.js';\nimport isArray from './isArray.js';\nimport extend from './extend.js';\n\n// Create a (shallow-cloned) duplicate of an object.\nexport default function clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n}\n","// Invokes `interceptor` with the `obj` and then returns `obj`.\n// The primary purpose of this method is to \"tap into\" a method chain, in\n// order to perform operations on intermediate results within the chain.\nexport default function tap(obj, interceptor) {\n interceptor(obj);\n return obj;\n}\n","import _ from './underscore.js';\nimport isArray from './isArray.js';\n\n// Normalize a (deep) property `path` to array.\n// Like `_.iteratee`, this function can be customized.\nexport default function toPath(path) {\n return isArray(path) ? path : [path];\n}\n_.toPath = toPath;\n","import _ from './underscore.js';\nimport './toPath.js';\n\n// Internal wrapper for `_.toPath` to enable minification.\n// Similar to `cb` for `_.iteratee`.\nexport default function toPath(path) {\n return _.toPath(path);\n}\n","// Internal function to obtain a nested property in `obj` along `path`.\nexport default function deepGet(obj, path) {\n var length = path.length;\n for (var i = 0; i < length; i++) {\n if (obj == null) return void 0;\n obj = obj[path[i]];\n }\n return length ? obj : void 0;\n}\n","import toPath from './_toPath.js';\nimport deepGet from './_deepGet.js';\nimport isUndefined from './isUndefined.js';\n\n// Get the value of the (deep) property on `path` from `object`.\n// If any property in `path` does not exist or if the value is\n// `undefined`, return `defaultValue` instead.\n// The `path` is normalized through `_.toPath`.\nexport default function get(object, path, defaultValue) {\n var value = deepGet(object, toPath(path));\n return isUndefined(value) ? defaultValue : value;\n}\n","import _has from './_has.js';\nimport toPath from './_toPath.js';\n\n// Shortcut function for checking if an object has a given property directly on\n// itself (in other words, not on a prototype). Unlike the internal `has`\n// function, this public version can also traverse nested properties.\nexport default function has(obj, path) {\n path = toPath(path);\n var length = path.length;\n for (var i = 0; i < length; i++) {\n var key = path[i];\n if (!_has(obj, key)) return false;\n obj = obj[key];\n }\n return !!length;\n}\n","// Keep the identity function around for default iteratees.\nexport default function identity(value) {\n return value;\n}\n","import extendOwn from './extendOwn.js';\nimport isMatch from './isMatch.js';\n\n// Returns a predicate for checking whether an object has a given set of\n// `key:value` pairs.\nexport default function matcher(attrs) {\n attrs = extendOwn({}, attrs);\n return function(obj) {\n return isMatch(obj, attrs);\n };\n}\n","import deepGet from './_deepGet.js';\nimport toPath from './_toPath.js';\n\n// Creates a function that, when passed an object, will traverse that object’s\n// properties down the given `path`, specified as an array of keys or indices.\nexport default function property(path) {\n path = toPath(path);\n return function(obj) {\n return deepGet(obj, path);\n };\n}\n","// Internal function that returns an efficient (for current engines) version\n// of the passed-in callback, to be repeatedly applied in other Underscore\n// functions.\nexport default function optimizeCb(func, context, argCount) {\n if (context === void 0) return func;\n switch (argCount == null ? 3 : argCount) {\n case 1: return function(value) {\n return func.call(context, value);\n };\n // The 2-argument case is omitted because we’re not using it.\n case 3: return function(value, index, collection) {\n return func.call(context, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(context, accumulator, value, index, collection);\n };\n }\n return function() {\n return func.apply(context, arguments);\n };\n}\n","import identity from './identity.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isArray from './isArray.js';\nimport matcher from './matcher.js';\nimport property from './property.js';\nimport optimizeCb from './_optimizeCb.js';\n\n// An internal function to generate callbacks that can be applied to each\n// element in a collection, returning the desired result — either `_.identity`,\n// an arbitrary callback, a property matcher, or a property accessor.\nexport default function baseIteratee(value, context, argCount) {\n if (value == null) return identity;\n if (isFunction(value)) return optimizeCb(value, context, argCount);\n if (isObject(value) && !isArray(value)) return matcher(value);\n return property(value);\n}\n","import _ from './underscore.js';\nimport baseIteratee from './_baseIteratee.js';\n\n// External wrapper for our callback generator. Users may customize\n// `_.iteratee` if they want additional predicate/iteratee shorthand styles.\n// This abstraction hides the internal-only `argCount` argument.\nexport default function iteratee(value, context) {\n return baseIteratee(value, context, Infinity);\n}\n_.iteratee = iteratee;\n","import _ from './underscore.js';\nimport baseIteratee from './_baseIteratee.js';\nimport iteratee from './iteratee.js';\n\n// The function we call internally to generate a callback. It invokes\n// `_.iteratee` if overridden, otherwise `baseIteratee`.\nexport default function cb(value, context, argCount) {\n if (_.iteratee !== iteratee) return _.iteratee(value, context);\n return baseIteratee(value, context, argCount);\n}\n","import cb from './_cb.js';\nimport keys from './keys.js';\n\n// Returns the results of applying the `iteratee` to each element of `obj`.\n// In contrast to `_.map` it returns an object.\nexport default function mapObject(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var _keys = keys(obj),\n length = _keys.length,\n results = {};\n for (var index = 0; index < length; index++) {\n var currentKey = _keys[index];\n results[currentKey] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n}\n","// Predicate-generating function. Often useful outside of Underscore.\nexport default function noop(){}\n","import noop from './noop.js';\nimport get from './get.js';\n\n// Generates a function for a given object that returns a given property.\nexport default function propertyOf(obj) {\n if (obj == null) return noop;\n return function(path) {\n return get(obj, path);\n };\n}\n","import optimizeCb from './_optimizeCb.js';\n\n// Run a function **n** times.\nexport default function times(n, iteratee, context) {\n var accum = Array(Math.max(0, n));\n iteratee = optimizeCb(iteratee, context, 1);\n for (var i = 0; i < n; i++) accum[i] = iteratee(i);\n return accum;\n}\n","// Return a random integer between `min` and `max` (inclusive).\nexport default function random(min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n return min + Math.floor(Math.random() * (max - min + 1));\n}\n","// A (possibly faster) way to get the current timestamp as an integer.\nexport default Date.now || function() {\n return new Date().getTime();\n};\n","import keys from './keys.js';\n\n// Internal helper to generate functions for escaping and unescaping strings\n// to/from HTML interpolation.\nexport default function createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n}\n","// Internal list of HTML entities for escaping.\nexport default {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n};\n","import createEscaper from './_createEscaper.js';\nimport escapeMap from './_escapeMap.js';\n\n// Function for escaping strings to HTML interpolation.\nexport default createEscaper(escapeMap);\n","import invert from './invert.js';\nimport escapeMap from './_escapeMap.js';\n\n// Internal list of HTML entities for unescaping.\nexport default invert(escapeMap);\n","import createEscaper from './_createEscaper.js';\nimport unescapeMap from './_unescapeMap.js';\n\n// Function for unescaping strings from HTML interpolation.\nexport default createEscaper(unescapeMap);\n","import _ from './underscore.js';\n\n// By default, Underscore uses ERB-style template delimiters. Change the\n// following template settings to use alternative delimiters.\nexport default _.templateSettings = {\n evaluate: /<%([\\s\\S]+?)%>/g,\n interpolate: /<%=([\\s\\S]+?)%>/g,\n escape: /<%-([\\s\\S]+?)%>/g\n};\n","import defaults from './defaults.js';\nimport _ from './underscore.js';\nimport './templateSettings.js';\n\n// When customizing `_.templateSettings`, if you don't want to define an\n// interpolation, evaluation or escaping regex, we need one that is\n// guaranteed not to match.\nvar noMatch = /(.)^/;\n\n// Certain characters need to be escaped so that they can be put into a\n// string literal.\nvar escapes = {\n \"'\": \"'\",\n '\\\\': '\\\\',\n '\\r': 'r',\n '\\n': 'n',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n};\n\nvar escapeRegExp = /\\\\|'|\\r|\\n|\\u2028|\\u2029/g;\n\nfunction escapeChar(match) {\n return '\\\\' + escapes[match];\n}\n\n// In order to prevent third-party code injection through\n// `_.templateSettings.variable`, we test it against the following regular\n// expression. It is intentionally a bit more liberal than just matching valid\n// identifiers, but still prevents possible loopholes through defaults or\n// destructuring assignment.\nvar bareIdentifier = /^\\s*(\\w|\\$)+\\s*$/;\n\n// JavaScript micro-templating, similar to John Resig's implementation.\n// Underscore templating handles arbitrary delimiters, preserves whitespace,\n// and correctly escapes quotes within interpolated code.\n// NB: `oldSettings` only exists for backwards compatibility.\nexport default function template(text, settings, oldSettings) {\n if (!settings && oldSettings) settings = oldSettings;\n settings = defaults({}, settings, _.templateSettings);\n\n // Combine delimiters into one regular expression via alternation.\n var matcher = RegExp([\n (settings.escape || noMatch).source,\n (settings.interpolate || noMatch).source,\n (settings.evaluate || noMatch).source\n ].join('|') + '|$', 'g');\n\n // Compile the template source, escaping string literals appropriately.\n var index = 0;\n var source = \"__p+='\";\n text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n source += text.slice(index, offset).replace(escapeRegExp, escapeChar);\n index = offset + match.length;\n\n if (escape) {\n source += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n } else if (interpolate) {\n source += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n } else if (evaluate) {\n source += \"';\\n\" + evaluate + \"\\n__p+='\";\n }\n\n // Adobe VMs need the match returned to produce the correct offset.\n return match;\n });\n source += \"';\\n\";\n\n var argument = settings.variable;\n if (argument) {\n // Insure against third-party code injection. (CVE-2021-23358)\n if (!bareIdentifier.test(argument)) throw new Error(\n 'variable is not a bare identifier: ' + argument\n );\n } else {\n // If a variable is not specified, place data values in local scope.\n source = 'with(obj||{}){\\n' + source + '}\\n';\n argument = 'obj';\n }\n\n source = \"var __t,__p='',__j=Array.prototype.join,\" +\n \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n source + 'return __p;\\n';\n\n var render;\n try {\n render = new Function(argument, '_', source);\n } catch (e) {\n e.source = source;\n throw e;\n }\n\n var template = function(data) {\n return render.call(this, data, _);\n };\n\n // Provide the compiled source as a convenience for precompilation.\n template.source = 'function(' + argument + '){\\n' + source + '}';\n\n return template;\n}\n","import isFunction from './isFunction.js';\nimport toPath from './_toPath.js';\n\n// Traverses the children of `obj` along `path`. If a child is a function, it\n// is invoked with its parent as context. Returns the value of the final\n// child, or `fallback` if any child is undefined.\nexport default function result(obj, path, fallback) {\n path = toPath(path);\n var length = path.length;\n if (!length) {\n return isFunction(fallback) ? fallback.call(obj) : fallback;\n }\n for (var i = 0; i < length; i++) {\n var prop = obj == null ? void 0 : obj[path[i]];\n if (prop === void 0) {\n prop = fallback;\n i = length; // Ensure we don't continue iterating.\n }\n obj = isFunction(prop) ? prop.call(obj) : prop;\n }\n return obj;\n}\n","// Generate a unique integer id (unique within the entire client session).\n// Useful for temporary DOM ids.\nvar idCounter = 0;\nexport default function uniqueId(prefix) {\n var id = ++idCounter + '';\n return prefix ? prefix + id : id;\n}\n","import _ from './underscore.js';\n\n// Start chaining a wrapped Underscore object.\nexport default function chain(obj) {\n var instance = _(obj);\n instance._chain = true;\n return instance;\n}\n","import baseCreate from './_baseCreate.js';\nimport isObject from './isObject.js';\n\n// Internal function to execute `sourceFunc` bound to `context` with optional\n// `args`. Determines whether to execute a function as a constructor or as a\n// normal function.\nexport default function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}\n","import restArguments from './restArguments.js';\nimport executeBound from './_executeBound.js';\nimport _ from './underscore.js';\n\n// Partially apply a function by creating a version that has had some of its\n// arguments pre-filled, without changing its dynamic `this` context. `_` acts\n// as a placeholder by default, allowing any combination of arguments to be\n// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.\nvar partial = restArguments(function(func, boundArgs) {\n var placeholder = partial.placeholder;\n var bound = function() {\n var position = 0, length = boundArgs.length;\n var args = Array(length);\n for (var i = 0; i < length; i++) {\n args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];\n }\n while (position < arguments.length) args.push(arguments[position++]);\n return executeBound(func, bound, this, this, args);\n };\n return bound;\n});\n\npartial.placeholder = _;\nexport default partial;\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport executeBound from './_executeBound.js';\n\n// Create a function bound to a given object (assigning `this`, and arguments,\n// optionally).\nexport default restArguments(function(func, context, args) {\n if (!isFunction(func)) throw new TypeError('Bind must be called on a function');\n var bound = restArguments(function(callArgs) {\n return executeBound(func, bound, context, this, args.concat(callArgs));\n });\n return bound;\n});\n","import createSizePropertyCheck from './_createSizePropertyCheck.js';\nimport getLength from './_getLength.js';\n\n// Internal helper for collection methods to determine whether a collection\n// should be iterated as an array or as an object.\n// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\n// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\nexport default createSizePropertyCheck(getLength);\n","import getLength from './_getLength.js';\nimport isArrayLike from './_isArrayLike.js';\nimport isArray from './isArray.js';\nimport isArguments from './isArguments.js';\n\n// Internal implementation of a recursive `flatten` function.\nexport default function flatten(input, depth, strict, output) {\n output = output || [];\n if (!depth && depth !== 0) {\n depth = Infinity;\n } else if (depth <= 0) {\n return output.concat(input);\n }\n var idx = output.length;\n for (var i = 0, length = getLength(input); i < length; i++) {\n var value = input[i];\n if (isArrayLike(value) && (isArray(value) || isArguments(value))) {\n // Flatten current level of array or arguments object.\n if (depth > 1) {\n flatten(value, depth - 1, strict, output);\n idx = output.length;\n } else {\n var j = 0, len = value.length;\n while (j < len) output[idx++] = value[j++];\n }\n } else if (!strict) {\n output[idx++] = value;\n }\n }\n return output;\n}\n","import restArguments from './restArguments.js';\nimport flatten from './_flatten.js';\nimport bind from './bind.js';\n\n// Bind a number of an object's methods to that object. Remaining arguments\n// are the method names to be bound. Useful for ensuring that all callbacks\n// defined on an object belong to it.\nexport default restArguments(function(obj, keys) {\n keys = flatten(keys, false, false);\n var index = keys.length;\n if (index < 1) throw new Error('bindAll must be passed function names');\n while (index--) {\n var key = keys[index];\n obj[key] = bind(obj[key], obj);\n }\n return obj;\n});\n","import has from './_has.js';\n\n// Memoize an expensive function by storing its results.\nexport default function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}\n","import restArguments from './restArguments.js';\n\n// Delays a function for the given number of milliseconds, and then calls\n// it with the arguments supplied.\nexport default restArguments(function(func, wait, args) {\n return setTimeout(function() {\n return func.apply(null, args);\n }, wait);\n});\n","import partial from './partial.js';\nimport delay from './delay.js';\nimport _ from './underscore.js';\n\n// Defers a function, scheduling it to run after the current call stack has\n// cleared.\nexport default partial(delay, _, 1);\n","import now from './now.js';\n\n// Returns a function, that, when invoked, will only be triggered at most once\n// during a given window of time. Normally, the throttled function will run\n// as much as it can, without ever going more than once per `wait` duration;\n// but if you'd like to disable the execution on the leading edge, pass\n// `{leading: false}`. To disable execution on the trailing edge, ditto.\nexport default function throttle(func, wait, options) {\n var timeout, context, args, result;\n var previous = 0;\n if (!options) options = {};\n\n var later = function() {\n previous = options.leading === false ? 0 : now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n };\n\n var throttled = function() {\n var _now = now();\n if (!previous && options.leading === false) previous = _now;\n var remaining = wait - (_now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = _now;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n\n throttled.cancel = function() {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n\n return throttled;\n}\n","import restArguments from './restArguments.js';\nimport now from './now.js';\n\n// When a sequence of calls of the returned function ends, the argument\n// function is triggered. The end of a sequence is defined by the `wait`\n// parameter. If `immediate` is passed, the argument function will be\n// triggered at the beginning of the sequence instead of at the end.\nexport default function debounce(func, wait, immediate) {\n var timeout, previous, args, result, context;\n\n var later = function() {\n var passed = now() - previous;\n if (wait > passed) {\n timeout = setTimeout(later, wait - passed);\n } else {\n timeout = null;\n if (!immediate) result = func.apply(context, args);\n // This check is needed because `func` can recursively invoke `debounced`.\n if (!timeout) args = context = null;\n }\n };\n\n var debounced = restArguments(function(_args) {\n context = this;\n args = _args;\n previous = now();\n if (!timeout) {\n timeout = setTimeout(later, wait);\n if (immediate) result = func.apply(context, args);\n }\n return result;\n });\n\n debounced.cancel = function() {\n clearTimeout(timeout);\n timeout = args = context = null;\n };\n\n return debounced;\n}\n","import partial from './partial.js';\n\n// Returns the first function passed as an argument to the second,\n// allowing you to adjust arguments, run code before and after, and\n// conditionally execute the original function.\nexport default function wrap(func, wrapper) {\n return partial(wrapper, func);\n}\n","// Returns a negated version of the passed-in predicate.\nexport default function negate(predicate) {\n return function() {\n return !predicate.apply(this, arguments);\n };\n}\n","// Returns a function that is the composition of a list of functions, each\n// consuming the return value of the function that follows.\nexport default function compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}\n","// Returns a function that will only be executed on and after the Nth call.\nexport default function after(times, func) {\n return function() {\n if (--times < 1) {\n return func.apply(this, arguments);\n }\n };\n}\n","// Returns a function that will only be executed up to (but not including) the\n// Nth call.\nexport default function before(times, func) {\n var memo;\n return function() {\n if (--times > 0) {\n memo = func.apply(this, arguments);\n }\n if (times <= 1) func = null;\n return memo;\n };\n}\n","import partial from './partial.js';\nimport before from './before.js';\n\n// Returns a function that will be executed at most one time, no matter how\n// often you call it. Useful for lazy initialization.\nexport default partial(before, 2);\n","import cb from './_cb.js';\nimport keys from './keys.js';\n\n// Returns the first key on an object that passes a truth test.\nexport default function findKey(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = keys(obj), key;\n for (var i = 0, length = _keys.length; i < length; i++) {\n key = _keys[i];\n if (predicate(obj[key], key, obj)) return key;\n }\n}\n","import cb from './_cb.js';\nimport getLength from './_getLength.js';\n\n// Internal function to generate `_.findIndex` and `_.findLastIndex`.\nexport default function createPredicateIndexFinder(dir) {\n return function(array, predicate, context) {\n predicate = cb(predicate, context);\n var length = getLength(array);\n var index = dir > 0 ? 0 : length - 1;\n for (; index >= 0 && index < length; index += dir) {\n if (predicate(array[index], index, array)) return index;\n }\n return -1;\n };\n}\n","import createPredicateIndexFinder from './_createPredicateIndexFinder.js';\n\n// Returns the first index on an array-like that passes a truth test.\nexport default createPredicateIndexFinder(1);\n","import createPredicateIndexFinder from './_createPredicateIndexFinder.js';\n\n// Returns the last index on an array-like that passes a truth test.\nexport default createPredicateIndexFinder(-1);\n","import cb from './_cb.js';\nimport getLength from './_getLength.js';\n\n// Use a comparator function to figure out the smallest index at which\n// an object should be inserted so as to maintain order. Uses binary search.\nexport default function sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n}\n","import getLength from './_getLength.js';\nimport { slice } from './_setup.js';\nimport isNaN from './isNaN.js';\n\n// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.\nexport default function createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n}\n","import sortedIndex from './sortedIndex.js';\nimport findIndex from './findIndex.js';\nimport createIndexFinder from './_createIndexFinder.js';\n\n// Return the position of the first occurrence of an item in an array,\n// or -1 if the item is not included in the array.\n// If the array is large and already in sort order, pass `true`\n// for **isSorted** to use binary search.\nexport default createIndexFinder(1, findIndex, sortedIndex);\n","import findLastIndex from './findLastIndex.js';\nimport createIndexFinder from './_createIndexFinder.js';\n\n// Return the position of the last occurrence of an item in an array,\n// or -1 if the item is not included in the array.\nexport default createIndexFinder(-1, findLastIndex);\n","import isArrayLike from './_isArrayLike.js';\nimport findIndex from './findIndex.js';\nimport findKey from './findKey.js';\n\n// Return the first value which passes a truth test.\nexport default function find(obj, predicate, context) {\n var keyFinder = isArrayLike(obj) ? findIndex : findKey;\n var key = keyFinder(obj, predicate, context);\n if (key !== void 0 && key !== -1) return obj[key];\n}\n","import find from './find.js';\nimport matcher from './matcher.js';\n\n// Convenience version of a common use case of `_.find`: getting the first\n// object containing specific `key:value` pairs.\nexport default function findWhere(obj, attrs) {\n return find(obj, matcher(attrs));\n}\n","import optimizeCb from './_optimizeCb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// The cornerstone for collection functions, an `each`\n// implementation, aka `forEach`.\n// Handles raw objects in addition to array-likes. Treats all\n// sparse array-likes as if they were dense.\nexport default function each(obj, iteratee, context) {\n iteratee = optimizeCb(iteratee, context);\n var i, length;\n if (isArrayLike(obj)) {\n for (i = 0, length = obj.length; i < length; i++) {\n iteratee(obj[i], i, obj);\n }\n } else {\n var _keys = keys(obj);\n for (i = 0, length = _keys.length; i < length; i++) {\n iteratee(obj[_keys[i]], _keys[i], obj);\n }\n }\n return obj;\n}\n","import cb from './_cb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Return the results of applying the iteratee to each element.\nexport default function map(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n results = Array(length);\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n results[index] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\nimport optimizeCb from './_optimizeCb.js';\n\n// Internal helper to create a reducing function, iterating left or right.\nexport default function createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n}\n","import createReduce from './_createReduce.js';\n\n// **Reduce** builds up a single result from a list of values, aka `inject`,\n// or `foldl`.\nexport default createReduce(1);\n","import createReduce from './_createReduce.js';\n\n// The right-associative version of reduce, also known as `foldr`.\nexport default createReduce(-1);\n","import cb from './_cb.js';\nimport each from './each.js';\n\n// Return all the elements that pass a truth test.\nexport default function filter(obj, predicate, context) {\n var results = [];\n predicate = cb(predicate, context);\n each(obj, function(value, index, list) {\n if (predicate(value, index, list)) results.push(value);\n });\n return results;\n}\n","import filter from './filter.js';\nimport negate from './negate.js';\nimport cb from './_cb.js';\n\n// Return all the elements for which a truth test fails.\nexport default function reject(obj, predicate, context) {\n return filter(obj, negate(cb(predicate)), context);\n}\n","import cb from './_cb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Determine whether all of the elements pass a truth test.\nexport default function every(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n if (!predicate(obj[currentKey], currentKey, obj)) return false;\n }\n return true;\n}\n","import cb from './_cb.js';\nimport isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Determine if at least one element in the object passes a truth test.\nexport default function some(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = !isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n if (predicate(obj[currentKey], currentKey, obj)) return true;\n }\n return false;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport values from './values.js';\nimport indexOf from './indexOf.js';\n\n// Determine if the array or object contains a given item (using `===`).\nexport default function contains(obj, item, fromIndex, guard) {\n if (!isArrayLike(obj)) obj = values(obj);\n if (typeof fromIndex != 'number' || guard) fromIndex = 0;\n return indexOf(obj, item, fromIndex) >= 0;\n}\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport map from './map.js';\nimport deepGet from './_deepGet.js';\nimport toPath from './_toPath.js';\n\n// Invoke a method (with arguments) on every item in a collection.\nexport default restArguments(function(obj, path, args) {\n var contextPath, func;\n if (isFunction(path)) {\n func = path;\n } else {\n path = toPath(path);\n contextPath = path.slice(0, -1);\n path = path[path.length - 1];\n }\n return map(obj, function(context) {\n var method = func;\n if (!method) {\n if (contextPath && contextPath.length) {\n context = deepGet(context, contextPath);\n }\n if (context == null) return void 0;\n method = context[path];\n }\n return method == null ? method : method.apply(context, args);\n });\n});\n","import map from './map.js';\nimport property from './property.js';\n\n// Convenience version of a common use case of `_.map`: fetching a property.\nexport default function pluck(obj, key) {\n return map(obj, property(key));\n}\n","import filter from './filter.js';\nimport matcher from './matcher.js';\n\n// Convenience version of a common use case of `_.filter`: selecting only\n// objects containing specific `key:value` pairs.\nexport default function where(obj, attrs) {\n return filter(obj, matcher(attrs));\n}\n","import isArrayLike from './_isArrayLike.js';\nimport values from './values.js';\nimport cb from './_cb.js';\nimport each from './each.js';\n\n// Return the maximum element (or element-based computation).\nexport default function max(obj, iteratee, context) {\n var result = -Infinity, lastComputed = -Infinity,\n value, computed;\n if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) {\n obj = isArrayLike(obj) ? obj : values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value > result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n}\n","import isArrayLike from './_isArrayLike.js';\nimport values from './values.js';\nimport cb from './_cb.js';\nimport each from './each.js';\n\n// Return the minimum element (or element-based computation).\nexport default function min(obj, iteratee, context) {\n var result = Infinity, lastComputed = Infinity,\n value, computed;\n if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) {\n obj = isArrayLike(obj) ? obj : values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value < result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed < lastComputed || (computed === Infinity && result === Infinity)) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n}\n","import isArray from './isArray.js';\nimport { slice } from './_setup.js';\nimport isString from './isString.js';\nimport isArrayLike from './_isArrayLike.js';\nimport map from './map.js';\nimport identity from './identity.js';\nimport values from './values.js';\n\n// Safely create a real, live array from anything iterable.\nvar reStrSymbol = /[^\\ud800-\\udfff]|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff]/g;\nexport default function toArray(obj) {\n if (!obj) return [];\n if (isArray(obj)) return slice.call(obj);\n if (isString(obj)) {\n // Keep surrogate pair characters together.\n return obj.match(reStrSymbol);\n }\n if (isArrayLike(obj)) return map(obj, identity);\n return values(obj);\n}\n","import isArrayLike from './_isArrayLike.js';\nimport values from './values.js';\nimport getLength from './_getLength.js';\nimport random from './random.js';\nimport toArray from './toArray.js';\n\n// Sample **n** random values from a collection using the modern version of the\n// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n// If **n** is not specified, returns a single random element.\n// The internal `guard` argument allows it to work with `_.map`.\nexport default function sample(obj, n, guard) {\n if (n == null || guard) {\n if (!isArrayLike(obj)) obj = values(obj);\n return obj[random(obj.length - 1)];\n }\n var sample = toArray(obj);\n var length = getLength(sample);\n n = Math.max(Math.min(n, length), 0);\n var last = length - 1;\n for (var index = 0; index < n; index++) {\n var rand = random(index, last);\n var temp = sample[index];\n sample[index] = sample[rand];\n sample[rand] = temp;\n }\n return sample.slice(0, n);\n}\n","import sample from './sample.js';\n\n// Shuffle a collection.\nexport default function shuffle(obj) {\n return sample(obj, Infinity);\n}\n","import cb from './_cb.js';\nimport pluck from './pluck.js';\nimport map from './map.js';\n\n// Sort the object's values by a criterion produced by an iteratee.\nexport default function sortBy(obj, iteratee, context) {\n var index = 0;\n iteratee = cb(iteratee, context);\n return pluck(map(obj, function(value, key, list) {\n return {\n value: value,\n index: index++,\n criteria: iteratee(value, key, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index - right.index;\n }), 'value');\n}\n","import cb from './_cb.js';\nimport each from './each.js';\n\n// An internal function used for aggregate \"group by\" operations.\nexport default function group(behavior, partition) {\n return function(obj, iteratee, context) {\n var result = partition ? [[], []] : {};\n iteratee = cb(iteratee, context);\n each(obj, function(value, index) {\n var key = iteratee(value, index, obj);\n behavior(result, value, key);\n });\n return result;\n };\n}\n","import group from './_group.js';\nimport has from './_has.js';\n\n// Groups the object's values by a criterion. Pass either a string attribute\n// to group by, or a function that returns the criterion.\nexport default group(function(result, value, key) {\n if (has(result, key)) result[key].push(value); else result[key] = [value];\n});\n","import group from './_group.js';\n\n// Indexes the object's values by a criterion, similar to `_.groupBy`, but for\n// when you know that your index values will be unique.\nexport default group(function(result, value, key) {\n result[key] = value;\n});\n","import group from './_group.js';\nimport has from './_has.js';\n\n// Counts instances of an object that group by a certain criterion. Pass\n// either a string attribute to count by, or a function that returns the\n// criterion.\nexport default group(function(result, value, key) {\n if (has(result, key)) result[key]++; else result[key] = 1;\n});\n","import group from './_group.js';\n\n// Split a collection into two arrays: one whose elements all pass the given\n// truth test, and one whose elements all do not pass the truth test.\nexport default group(function(result, value, pass) {\n result[pass ? 0 : 1].push(value);\n}, true);\n","import isArrayLike from './_isArrayLike.js';\nimport keys from './keys.js';\n\n// Return the number of elements in a collection.\nexport default function size(obj) {\n if (obj == null) return 0;\n return isArrayLike(obj) ? obj.length : keys(obj).length;\n}\n","// Internal `_.pick` helper function to determine whether `key` is an enumerable\n// property name of `obj`.\nexport default function keyInObj(value, key, obj) {\n return key in obj;\n}\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport optimizeCb from './_optimizeCb.js';\nimport allKeys from './allKeys.js';\nimport keyInObj from './_keyInObj.js';\nimport flatten from './_flatten.js';\n\n// Return a copy of the object only containing the allowed properties.\nexport default restArguments(function(obj, keys) {\n var result = {}, iteratee = keys[0];\n if (obj == null) return result;\n if (isFunction(iteratee)) {\n if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);\n keys = allKeys(obj);\n } else {\n iteratee = keyInObj;\n keys = flatten(keys, false, false);\n obj = Object(obj);\n }\n for (var i = 0, length = keys.length; i < length; i++) {\n var key = keys[i];\n var value = obj[key];\n if (iteratee(value, key, obj)) result[key] = value;\n }\n return result;\n});\n","import restArguments from './restArguments.js';\nimport isFunction from './isFunction.js';\nimport negate from './negate.js';\nimport map from './map.js';\nimport flatten from './_flatten.js';\nimport contains from './contains.js';\nimport pick from './pick.js';\n\n// Return a copy of the object without the disallowed properties.\nexport default restArguments(function(obj, keys) {\n var iteratee = keys[0], context;\n if (isFunction(iteratee)) {\n iteratee = negate(iteratee);\n if (keys.length > 1) context = keys[1];\n } else {\n keys = map(flatten(keys, false, false), String);\n iteratee = function(value, key) {\n return !contains(keys, key);\n };\n }\n return pick(obj, iteratee, context);\n});\n","import { slice } from './_setup.js';\n\n// Returns everything but the last entry of the array. Especially useful on\n// the arguments object. Passing **n** will return all the values in\n// the array, excluding the last N.\nexport default function initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n}\n","import initial from './initial.js';\n\n// Get the first element of an array. Passing **n** will return the first N\n// values in the array. The **guard** check allows it to work with `_.map`.\nexport default function first(array, n, guard) {\n if (array == null || array.length < 1) return n == null || guard ? void 0 : [];\n if (n == null || guard) return array[0];\n return initial(array, array.length - n);\n}\n","import { slice } from './_setup.js';\n\n// Returns everything but the first entry of the `array`. Especially useful on\n// the `arguments` object. Passing an **n** will return the rest N values in the\n// `array`.\nexport default function rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}\n","import rest from './rest.js';\n\n// Get the last element of an array. Passing **n** will return the last N\n// values in the array.\nexport default function last(array, n, guard) {\n if (array == null || array.length < 1) return n == null || guard ? void 0 : [];\n if (n == null || guard) return array[array.length - 1];\n return rest(array, Math.max(0, array.length - n));\n}\n","import filter from './filter.js';\n\n// Trim out all falsy values from an array.\nexport default function compact(array) {\n return filter(array, Boolean);\n}\n","import _flatten from './_flatten.js';\n\n// Flatten out an array, either recursively (by default), or up to `depth`.\n// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.\nexport default function flatten(array, depth) {\n return _flatten(array, depth, false);\n}\n","import restArguments from './restArguments.js';\nimport flatten from './_flatten.js';\nimport filter from './filter.js';\nimport contains from './contains.js';\n\n// Take the difference between one array and a number of other arrays.\n// Only the elements present in just the first array will remain.\nexport default restArguments(function(array, rest) {\n rest = flatten(rest, true, true);\n return filter(array, function(value){\n return !contains(rest, value);\n });\n});\n","import restArguments from './restArguments.js';\nimport difference from './difference.js';\n\n// Return a version of the array that does not contain the specified value(s).\nexport default restArguments(function(array, otherArrays) {\n return difference(array, otherArrays);\n});\n","import isBoolean from './isBoolean.js';\nimport cb from './_cb.js';\nimport getLength from './_getLength.js';\nimport contains from './contains.js';\n\n// Produce a duplicate-free version of the array. If the array has already\n// been sorted, you have the option of using a faster algorithm.\n// The faster algorithm will not work with an iteratee if the iteratee\n// is not a one-to-one function, so providing an iteratee will disable\n// the faster algorithm.\nexport default function uniq(array, isSorted, iteratee, context) {\n if (!isBoolean(isSorted)) {\n context = iteratee;\n iteratee = isSorted;\n isSorted = false;\n }\n if (iteratee != null) iteratee = cb(iteratee, context);\n var result = [];\n var seen = [];\n for (var i = 0, length = getLength(array); i < length; i++) {\n var value = array[i],\n computed = iteratee ? iteratee(value, i, array) : value;\n if (isSorted && !iteratee) {\n if (!i || seen !== computed) result.push(value);\n seen = computed;\n } else if (iteratee) {\n if (!contains(seen, computed)) {\n seen.push(computed);\n result.push(value);\n }\n } else if (!contains(result, value)) {\n result.push(value);\n }\n }\n return result;\n}\n","import restArguments from './restArguments.js';\nimport uniq from './uniq.js';\nimport flatten from './_flatten.js';\n\n// Produce an array that contains the union: each distinct element from all of\n// the passed-in arrays.\nexport default restArguments(function(arrays) {\n return uniq(flatten(arrays, true, true));\n});\n","import getLength from './_getLength.js';\nimport contains from './contains.js';\n\n// Produce an array that contains every item shared between all the\n// passed-in arrays.\nexport default function intersection(array) {\n var result = [];\n var argsLength = arguments.length;\n for (var i = 0, length = getLength(array); i < length; i++) {\n var item = array[i];\n if (contains(result, item)) continue;\n var j;\n for (j = 1; j < argsLength; j++) {\n if (!contains(arguments[j], item)) break;\n }\n if (j === argsLength) result.push(item);\n }\n return result;\n}\n","import max from './max.js';\nimport getLength from './_getLength.js';\nimport pluck from './pluck.js';\n\n// Complement of zip. Unzip accepts an array of arrays and groups\n// each array's elements on shared indices.\nexport default function unzip(array) {\n var length = (array && max(array, getLength).length) || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = pluck(array, index);\n }\n return result;\n}\n","import restArguments from './restArguments.js';\nimport unzip from './unzip.js';\n\n// Zip together multiple lists into a single array -- elements that share\n// an index go together.\nexport default restArguments(unzip);\n","import getLength from './_getLength.js';\n\n// Converts lists into objects. Pass either a single array of `[key, value]`\n// pairs, or two parallel arrays of the same length -- one of keys, and one of\n// the corresponding values. Passing by pairs is the reverse of `_.pairs`.\nexport default function object(list, values) {\n var result = {};\n for (var i = 0, length = getLength(list); i < length; i++) {\n if (values) {\n result[list[i]] = values[i];\n } else {\n result[list[i][0]] = list[i][1];\n }\n }\n return result;\n}\n","// Generate an integer Array containing an arithmetic progression. A port of\n// the native Python `range()` function. See\n// [the Python documentation](https://docs.python.org/library/functions.html#range).\nexport default function range(start, stop, step) {\n if (stop == null) {\n stop = start || 0;\n start = 0;\n }\n if (!step) {\n step = stop < start ? -1 : 1;\n }\n\n var length = Math.max(Math.ceil((stop - start) / step), 0);\n var range = Array(length);\n\n for (var idx = 0; idx < length; idx++, start += step) {\n range[idx] = start;\n }\n\n return range;\n}\n","import { slice } from './_setup.js';\n\n// Chunk a single array into multiple arrays, each containing `count` or fewer\n// items.\nexport default function chunk(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n}\n","import _ from './underscore.js';\n\n// Helper function to continue chaining intermediate results.\nexport default function chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n}\n","import _ from './underscore.js';\nimport each from './each.js';\nimport functions from './functions.js';\nimport { push } from './_setup.js';\nimport chainResult from './_chainResult.js';\n\n// Add your own custom functions to the Underscore object.\nexport default function mixin(obj) {\n each(functions(obj), function(name) {\n var func = _[name] = obj[name];\n _.prototype[name] = function() {\n var args = [this._wrapped];\n push.apply(args, arguments);\n return chainResult(this, func.apply(_, args));\n };\n });\n return _;\n}\n","import _ from './underscore.js';\nimport each from './each.js';\nimport { ArrayProto } from './_setup.js';\nimport chainResult from './_chainResult.js';\n\n// Add all mutator `Array` functions to the wrapper.\neach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n if (obj != null) {\n method.apply(obj, arguments);\n if ((name === 'shift' || name === 'splice') && obj.length === 0) {\n delete obj[0];\n }\n }\n return chainResult(this, obj);\n };\n});\n\n// Add all accessor `Array` functions to the wrapper.\neach(['concat', 'join', 'slice'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n if (obj != null) obj = method.apply(obj, arguments);\n return chainResult(this, obj);\n };\n});\n\nexport default _;\n","// Named Exports\n// =============\n\n// Underscore.js 1.13.6\n// https://underscorejs.org\n// (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors\n// Underscore may be freely distributed under the MIT license.\n\n// Baseline setup.\nexport { VERSION } from './_setup.js';\nexport { default as restArguments } from './restArguments.js';\n\n// Object Functions\n// ----------------\n// Our most fundamental functions operate on any JavaScript object.\n// Most functions in Underscore depend on at least one function in this section.\n\n// A group of functions that check the types of core JavaScript values.\n// These are often informally referred to as the \"isType\" functions.\nexport { default as isObject } from './isObject.js';\nexport { default as isNull } from './isNull.js';\nexport { default as isUndefined } from './isUndefined.js';\nexport { default as isBoolean } from './isBoolean.js';\nexport { default as isElement } from './isElement.js';\nexport { default as isString } from './isString.js';\nexport { default as isNumber } from './isNumber.js';\nexport { default as isDate } from './isDate.js';\nexport { default as isRegExp } from './isRegExp.js';\nexport { default as isError } from './isError.js';\nexport { default as isSymbol } from './isSymbol.js';\nexport { default as isArrayBuffer } from './isArrayBuffer.js';\nexport { default as isDataView } from './isDataView.js';\nexport { default as isArray } from './isArray.js';\nexport { default as isFunction } from './isFunction.js';\nexport { default as isArguments } from './isArguments.js';\nexport { default as isFinite } from './isFinite.js';\nexport { default as isNaN } from './isNaN.js';\nexport { default as isTypedArray } from './isTypedArray.js';\nexport { default as isEmpty } from './isEmpty.js';\nexport { default as isMatch } from './isMatch.js';\nexport { default as isEqual } from './isEqual.js';\nexport { default as isMap } from './isMap.js';\nexport { default as isWeakMap } from './isWeakMap.js';\nexport { default as isSet } from './isSet.js';\nexport { default as isWeakSet } from './isWeakSet.js';\n\n// Functions that treat an object as a dictionary of key-value pairs.\nexport { default as keys } from './keys.js';\nexport { default as allKeys } from './allKeys.js';\nexport { default as values } from './values.js';\nexport { default as pairs } from './pairs.js';\nexport { default as invert } from './invert.js';\nexport { default as functions,\n default as methods } from './functions.js';\nexport { default as extend } from './extend.js';\nexport { default as extendOwn,\n default as assign } from './extendOwn.js';\nexport { default as defaults } from './defaults.js';\nexport { default as create } from './create.js';\nexport { default as clone } from './clone.js';\nexport { default as tap } from './tap.js';\nexport { default as get } from './get.js';\nexport { default as has } from './has.js';\nexport { default as mapObject } from './mapObject.js';\n\n// Utility Functions\n// -----------------\n// A bit of a grab bag: Predicate-generating functions for use with filters and\n// loops, string escaping and templating, create random numbers and unique ids,\n// and functions that facilitate Underscore's chaining and iteration conventions.\nexport { default as identity } from './identity.js';\nexport { default as constant } from './constant.js';\nexport { default as noop } from './noop.js';\nexport { default as toPath } from './toPath.js';\nexport { default as property } from './property.js';\nexport { default as propertyOf } from './propertyOf.js';\nexport { default as matcher,\n default as matches } from './matcher.js';\nexport { default as times } from './times.js';\nexport { default as random } from './random.js';\nexport { default as now } from './now.js';\nexport { default as escape } from './escape.js';\nexport { default as unescape } from './unescape.js';\nexport { default as templateSettings } from './templateSettings.js';\nexport { default as template } from './template.js';\nexport { default as result } from './result.js';\nexport { default as uniqueId } from './uniqueId.js';\nexport { default as chain } from './chain.js';\nexport { default as iteratee } from './iteratee.js';\n\n// Function (ahem) Functions\n// -------------------------\n// These functions take a function as an argument and return a new function\n// as the result. Also known as higher-order functions.\nexport { default as partial } from './partial.js';\nexport { default as bind } from './bind.js';\nexport { default as bindAll } from './bindAll.js';\nexport { default as memoize } from './memoize.js';\nexport { default as delay } from './delay.js';\nexport { default as defer } from './defer.js';\nexport { default as throttle } from './throttle.js';\nexport { default as debounce } from './debounce.js';\nexport { default as wrap } from './wrap.js';\nexport { default as negate } from './negate.js';\nexport { default as compose } from './compose.js';\nexport { default as after } from './after.js';\nexport { default as before } from './before.js';\nexport { default as once } from './once.js';\n\n// Finders\n// -------\n// Functions that extract (the position of) a single element from an object\n// or array based on some criterion.\nexport { default as findKey } from './findKey.js';\nexport { default as findIndex } from './findIndex.js';\nexport { default as findLastIndex } from './findLastIndex.js';\nexport { default as sortedIndex } from './sortedIndex.js';\nexport { default as indexOf } from './indexOf.js';\nexport { default as lastIndexOf } from './lastIndexOf.js';\nexport { default as find,\n default as detect } from './find.js';\nexport { default as findWhere } from './findWhere.js';\n\n// Collection Functions\n// --------------------\n// Functions that work on any collection of elements: either an array, or\n// an object of key-value pairs.\nexport { default as each,\n default as forEach } from './each.js';\nexport { default as map,\n default as collect } from './map.js';\nexport { default as reduce,\n default as foldl,\n default as inject } from './reduce.js';\nexport { default as reduceRight,\n default as foldr } from './reduceRight.js';\nexport { default as filter,\n default as select } from './filter.js';\nexport { default as reject } from './reject.js';\nexport { default as every,\n default as all } from './every.js';\nexport { default as some,\n default as any } from './some.js';\nexport { default as contains,\n default as includes,\n default as include } from './contains.js';\nexport { default as invoke } from './invoke.js';\nexport { default as pluck } from './pluck.js';\nexport { default as where } from './where.js';\nexport { default as max } from './max.js';\nexport { default as min } from './min.js';\nexport { default as shuffle } from './shuffle.js';\nexport { default as sample } from './sample.js';\nexport { default as sortBy } from './sortBy.js';\nexport { default as groupBy } from './groupBy.js';\nexport { default as indexBy } from './indexBy.js';\nexport { default as countBy } from './countBy.js';\nexport { default as partition } from './partition.js';\nexport { default as toArray } from './toArray.js';\nexport { default as size } from './size.js';\n\n// `_.pick` and `_.omit` are actually object functions, but we put\n// them here in order to create a more natural reading order in the\n// monolithic build as they depend on `_.contains`.\nexport { default as pick } from './pick.js';\nexport { default as omit } from './omit.js';\n\n// Array Functions\n// ---------------\n// Functions that operate on arrays (and array-likes) only, because they’re\n// expressed in terms of operations on an ordered list of values.\nexport { default as first,\n default as head,\n default as take } from './first.js';\nexport { default as initial } from './initial.js';\nexport { default as last } from './last.js';\nexport { default as rest,\n default as tail,\n default as drop } from './rest.js';\nexport { default as compact } from './compact.js';\nexport { default as flatten } from './flatten.js';\nexport { default as without } from './without.js';\nexport { default as uniq,\n default as unique } from './uniq.js';\nexport { default as union } from './union.js';\nexport { default as intersection } from './intersection.js';\nexport { default as difference } from './difference.js';\nexport { default as unzip,\n default as transpose } from './unzip.js';\nexport { default as zip } from './zip.js';\nexport { default as object } from './object.js';\nexport { default as range } from './range.js';\nexport { default as chunk } from './chunk.js';\n\n// OOP\n// ---\n// These modules support the \"object-oriented\" calling style. See also\n// `underscore.js` and `index-default.js`.\nexport { default as mixin } from './mixin.js';\nexport { default } from './underscore-array-methods.js';\n","// Default Export\n// ==============\n// In this module, we mix our bundled exports into the `_` object and export\n// the result. This is analogous to setting `module.exports = _` in CommonJS.\n// Hence, this module is also the entry point of our UMD bundle and the package\n// entry point for CommonJS and AMD users. In other words, this is (the source\n// of) the module you are interfacing with when you do any of the following:\n//\n// ```js\n// // CommonJS\n// var _ = require('underscore');\n//\n// // AMD\n// define(['underscore'], function(_) {...});\n//\n// // UMD in the browser\n// // _ is available as a global variable\n// ```\nimport * as allExports from './index.js';\nimport { mixin } from './index.js';\n\n// Add all of the Underscore functions to the wrapper object.\nvar _ = mixin(allExports);\n// Legacy Node.js API.\n_._ = _;\n// Export the Underscore API.\nexport default _;\n","// ESM Exports\n// ===========\n// This module is the package entry point for ES module users. In other words,\n// it is the module they are interfacing with when they import from the whole\n// package instead of from a submodule, like this:\n//\n// ```js\n// import { map } from 'underscore';\n// ```\n//\n// The difference with `./index-default`, which is the package entry point for\n// CommonJS, AMD and UMD users, is purely technical. In ES modules, named and\n// default exports are considered to be siblings, so when you have a default\n// export, its properties are not automatically available as named exports. For\n// this reason, we re-export the named exports in addition to providing the same\n// default export as in `./index-default`.\nexport { default } from './index-default.js';\nexport * from './index.js';\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { escape } from './mixins';\n\n/**\n * Safe ES6 tagged template strings\n * @param {Array} literals\n * @param {Array} substs\n * @returns {String}\n * @example\n * const str = 'Hello';\n * const strHtml = html`Escaped ${str}, unescaped $${str}`;\n */\nexport default function html(literals: TemplateStringsArray, ...substs: string[]) {\n const { raw } = literals;\n\n return raw.reduce((acc, lit, i) => {\n let subst = substs[i - 1];\n const last = raw[i - 1];\n\n if (Array.isArray(subst)) {\n subst = subst.join('');\n } else if (last && last.slice(-1) === '$') {\n // If the interpolation is preceded by a dollar sign, it won't be escaped\n acc = acc.slice(0, -1);\n } else {\n subst = escape(subst);\n }\n\n return acc + subst + lit;\n });\n}\n","import { AssetManagerConfig } from '../../asset_manager/config/config';\nimport { BlockManagerConfig } from '../../block_manager/config/config';\nimport { CanvasConfig } from '../../canvas/config/config';\nimport { CodeManagerConfig } from '../../code_manager/config/config';\nimport { CssComposerConfig } from '../../css_composer/config/config';\nimport { DeviceManagerConfig } from '../../device_manager/config/config';\nimport { I18nConfig } from '../../i18n/config';\nimport { ModalConfig } from '../../modal_dialog/config/config';\nimport { LayerManagerConfig } from '../../navigator/config/config';\nimport { KeymapsConfig } from '../../keymaps/config';\nimport { PageManagerConfig } from '../../pages/types';\nimport { PanelsConfig } from '../../panels/config/config';\nimport { ParserConfig } from '../../parser/config/config';\nimport { RichTextEditorConfig } from '../../rich_text_editor/config/config';\nimport { SelectorManagerConfig } from '../../selector_manager/config/config';\nimport { StorageManagerConfig } from '../../storage_manager/config/config';\nimport { UndoManagerConfig } from '../../undo_manager/config';\nimport { Plugin } from '../../plugin_manager';\nimport { TraitManagerConfig } from '../../trait_manager/config/config';\nimport { CommandsConfig } from '../../commands/config/config';\nimport { StyleManagerConfig } from '../../style_manager/config/config';\nimport { DomComponentsConfig } from '../../dom_components/config/config';\nimport { HTMLGeneratorBuildOptions } from '../../code_manager/model/HtmlGenerator';\nimport { CssGeneratorBuildOptions } from '../../code_manager/model/CssGenerator';\nimport { ObjectAny } from '../../common';\nimport { ColorPickerOptions } from '../../utils/ColorPicker';\n\nexport interface EditorConfig {\n /**\n * Style class name prefix.\n * @default 'gjs-'\n */\n stylePrefix?: string;\n\n /**\n * Selector which indicates where render the editor.\n */\n container?: string | HTMLElement;\n\n /**\n * If true, auto-render the content\n * @default true\n */\n autorender?: boolean;\n\n /**\n * Array of plugins to execute on start.\n * @default []\n */\n plugins?: (string | Plugin)[];\n\n /**\n * Custom options for plugins\n * @default {}\n */\n pluginsOpts?: Record;\n\n /**\n * Init headless editor.\n * @default false\n */\n headless?: boolean;\n\n /**\n * Initial project data (JSON containing your components/styles/etc) to load.\n */\n projectData?: ObjectAny;\n\n /**\n * HTML string or object of components\n * @deprecated Rely on `projectData` option\n * @default ''\n */\n components?: string;\n\n /**\n * CSS string or object of rules\n * @deprecated Rely on `projectData` option\n * @default ''\n */\n style?: string;\n\n /**\n * If true, will fetch HTML and CSS from the selected container.\n * @deprecated\n * @default false\n */\n fromElement?: boolean;\n\n /**\n * Show an alert before unload the page with unsaved changes\n * @default true\n */\n noticeOnUnload?: boolean;\n\n /**\n * Show paddings and margins.\n * @default false\n */\n showOffsets?: boolean;\n\n /**\n * Show paddings and margins on selected component\n * @default false\n */\n showOffsetsSelected?: boolean;\n\n /**\n * On creation of a new Component (via object), if the 'style' attribute is not\n * empty, all those roles will be moved in its new class.\n * @default true\n */\n forceClass?: boolean;\n\n /**\n * Height for the editor container\n * @default '900px'\n */\n height?: string;\n\n /**\n * Width for the editor container\n * @default '100%'\n */\n width?: string;\n\n /**\n * Type of logs to print with the logger (by default is used the devtool console).\n * Available by default: debug, info, warning, error.\n * You can use `false` to disable all of them or `true` to print all of them.\n * @default ['warning', 'error']\n */\n log?: ('debug' | 'info' | 'warning' | 'error')[] | boolean;\n\n /**\n * By default Grapes injects base CSS into the canvas. For example, it sets body margin to 0\n * and sets a default background color of white. This CSS is desired in most cases.\n * use this property if you wish to overwrite the base CSS to your own CSS. This is most\n * useful if for example your template is not based off a document with 0 as body margin.\n * @deprecated in favor of `config.canvas.frameStyle`\n * @default ''\n */\n baseCss?: string;\n\n /**\n * CSS that could only be seen (for instance, inside the code viewer)\n * @default '* { box-sizing: border-box; } body {margin: 0;}'\n */\n protectedCss?: string;\n\n /**\n * CSS for the iframe which containing the canvas, useful if you need to customize\n * something inside (eg. the style of the selected component).\n * @default ''\n */\n canvasCss?: string;\n\n /**\n * Default command\n * @default 'select-comp'\n */\n defaultCommand?: string;\n\n /**\n * Show a toolbar when the component is selected\n * @default true\n */\n showToolbar?: boolean;\n\n // Allow script tag importing\n // @deprecated in favor of `config.parser.optionsHtml.allowScripts`\n // allowScripts: 0,\n\n /**\n * If true render a select of available devices\n * @default true\n */\n showDevices?: boolean;\n\n /**\n * When enabled, on device change media rules won't be created\n * @default false\n */\n devicePreviewMode?: boolean;\n\n /**\n * The condition to use for media queries, eg. 'max-width'.\n * Comes handy for mobile-first cases.\n * @default 'max-width'\n */\n mediaCondition?: string;\n\n /**\n * Starting tag for variable inside scripts in Components\n * @deprecated Rely on 'script-props' https://grapesjs.com/docs/modules/Components-js.html#passing-properties-to-scripts\n * @default '{[ '\n */\n tagVarStart?: string;\n\n /**\n * Ending tag for variable inside scripts in Components\n * @deprecated Rely on 'script-props' https://grapesjs.com/docs/modules/Components-js.html#passing-properties-to-scripts\n * @default ' ]}'\n */\n tagVarEnd?: string;\n\n /**\n * When false, removes empty text nodes when parsed, unless they contain a space.\n * @default false\n */\n keepEmptyTextNodes?: boolean;\n\n /**\n * Return JS of components inside HTML from 'editor.getHtml()'.\n * @default true\n */\n jsInHtml?: boolean;\n\n /**\n * Enable native HTML5 drag and drop.\n * @default true\n */\n nativeDnD?: boolean;\n\n /**\n * Enable multiple component selection.\n * @default true\n */\n multipleSelection?: boolean;\n\n /**\n * Pass default available options wherever `editor.getHtml()` is called.\n * @default {}\n */\n optsHtml?: HTMLGeneratorBuildOptions;\n\n /**\n * Pass default available options wherever `editor.getCss()` is called\n * @default {}\n */\n optsCss?: CssGeneratorBuildOptions;\n\n /**\n * Usually when you update the `style` of the component this changes the\n * element's `style` attribute. Unfortunately, inline styling doesn't allow\n * use of media queries (@media) or even pseudo selectors (eg. :hover).\n * When `avoidInlineStyle` is true all styles are inserted inside the css rule\n * @deprecated Don't use this option, we don't support inline styling anymore.\n */\n avoidInlineStyle?: boolean;\n\n /**\n * Avoid default properties from storable JSON data, like `components` and `styles`.\n * With this option enabled your data will be smaller (usefull if need to\n * save some storage space).\n * @default true\n */\n avoidDefaults?: boolean;\n\n /**\n * (experimental)\n * The structure of components is always on the screen but it's not the same\n * for style rules. When you delete a component you might leave a lot of styles\n * which will never be used again, therefore they might be removed.\n * With this option set to true, styles not used from the CSS generator (so in\n * any case where `CssGenerator.build` is used) will be removed automatically.\n * But be careful, not always leaving the style not used mean you wouldn't\n * use it later, but this option comes really handy when deal with big templates.\n * @default false\n */\n clearStyles?: boolean;\n\n /**\n * Specify the global drag mode of components. By default, components are moved\n * following the HTML flow. Two other options are available:\n * 'absolute' - Move components absolutely (design tools way)\n * 'translate' - Use translate CSS from transform property\n * To get more about this feature read: https://github.com/GrapesJS/grapesjs/issues/1936.\n */\n dragMode?: 'translate' | 'absolute';\n\n /**\n * When the editor is placed in a scrollable container (eg. modals) this might\n * cause elements inside the canvas (eg. floating toolbars) to be misaligned.\n * To avoid that, you can specify an array of DOM elements on which their scroll will\n * trigger the canvas update.\n * Be default, if the array is empty, the first parent element will be appended.\n * listenToEl: [document.querySelector('#scrollable-el')],\n * @default []\n * */\n listenToEl?: HTMLElement[];\n\n /**\n * Import asynchronously CSS to use as icons.\n * @default 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css'\n * */\n cssIcons?: string;\n\n /**\n * Experimental: don't use.\n * Editor icons\n */\n icons?: ObjectAny;\n\n /**\n * Configurations for I18n.\n */\n i18n?: I18nConfig;\n\n /**\n * Configurations for Undo Manager\n */\n undoManager?: UndoManagerConfig | boolean;\n\n /**\n * Configurations for Asset Manager.\n */\n assetManager?: AssetManagerConfig;\n\n /**\n * Configurations for Canvas.\n */\n canvas?: CanvasConfig;\n\n /**\n * Configurations for Storage Manager.\n */\n storageManager?: StorageManagerConfig | boolean;\n\n /**\n * Configurations for Rich Text Editor.\n */\n richTextEditor?: RichTextEditorConfig;\n\n /**\n * Configurations for DomComponents\n */\n domComponents?: DomComponentsConfig;\n\n /**\n * Configurations for Modal Dialog.\n */\n modal?: ModalConfig;\n\n /**\n * Configurations for Code Manager.\n */\n codeManager?: CodeManagerConfig;\n\n /**\n * Configurations for Panels.\n */\n panels?: PanelsConfig;\n\n /**\n * Configurations for Commands.\n */\n commands?: CommandsConfig;\n\n /**\n * Configurations for keymaps\n */\n keymaps?: KeymapsConfig;\n\n /**\n * Configurations for Css Composer.\n */\n cssComposer?: CssComposerConfig;\n\n /**\n * Configurations for Selector Manager.\n */\n selectorManager?: SelectorManagerConfig;\n\n /**\n * Configurations for Device Manager.\n */\n deviceManager?: DeviceManagerConfig;\n\n /**\n * Configurations for Style Manager.\n */\n styleManager?: StyleManagerConfig;\n\n /**\n * Configurations for Block Manager.\n */\n blockManager?: BlockManagerConfig;\n\n /**\n * Configurations for Trait Manager.\n */\n traitManager?: TraitManagerConfig;\n\n /**\n * Configurations for Page Manager.\n */\n pageManager?: PageManagerConfig;\n\n /**\n * Configurations for Layer Manager.\n */\n layerManager?: LayerManagerConfig;\n\n /**\n * Configurations for Parser module.\n */\n parser?: ParserConfig;\n\n /** Texts **/\n textViewCode?: string;\n\n /**\n * Keep unused styles within the editor.\n * @default false\n */\n keepUnusedStyles?: boolean;\n\n /**\n * Experimental: don't use.\n * Avoid default UI styles.\n */\n customUI?: boolean;\n el?: HTMLElement;\n\n /**\n * Color picker options.\n */\n colorPicker?: ColorPickerOptions;\n pStylePrefix?: string;\n}\n\nexport type EditorConfigKeys = keyof EditorConfig;\n\nconst config: EditorConfig = {\n stylePrefix: 'gjs-',\n components: '',\n style: '',\n fromElement: false,\n projectData: undefined,\n noticeOnUnload: true,\n showOffsets: false,\n showOffsetsSelected: false,\n forceClass: true,\n height: '900px',\n width: '100%',\n log: ['warning', 'error'],\n baseCss: '',\n protectedCss: '* { box-sizing: border-box; } body {margin: 0;}',\n canvasCss: '',\n defaultCommand: 'select-comp',\n showToolbar: true,\n showDevices: true,\n devicePreviewMode: false,\n mediaCondition: 'max-width',\n tagVarStart: '{[ ',\n tagVarEnd: ' ]}',\n keepEmptyTextNodes: false,\n jsInHtml: true,\n nativeDnD: true,\n multipleSelection: true,\n optsHtml: {},\n optsCss: {},\n avoidInlineStyle: true,\n avoidDefaults: true,\n clearStyles: false,\n listenToEl: [],\n cssIcons: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css',\n icons: {\n close:\n '',\n move: '',\n plus: '',\n caret: '',\n delete:\n '',\n copy: '',\n arrowUp:\n '',\n chevron:\n '',\n eye: '',\n eyeOff:\n '',\n },\n i18n: {},\n undoManager: {},\n assetManager: {},\n canvas: {},\n layerManager: {},\n storageManager: {},\n richTextEditor: {},\n domComponents: {},\n modal: {},\n codeManager: {},\n panels: {},\n commands: {},\n cssComposer: {},\n selectorManager: {},\n deviceManager: {},\n styleManager: {},\n blockManager: {},\n traitManager: {},\n textViewCode: 'Code',\n keepUnusedStyles: false,\n customUI: false,\n};\n\nexport default config;\n","import { isObject } from 'underscore';\n\nexport default ({ $ }: { $: any }) => {\n if ($ && $.prototype && $.prototype.constructor.name !== 'jQuery') {\n const fn = $.fn;\n\n // Additional helpers\n\n fn.hide = function () {\n return this.css('display', 'none');\n };\n\n fn.show = function () {\n return this.css('display', 'block');\n };\n\n fn.focus = function () {\n const el = this.get(0);\n el && el.focus();\n return this;\n };\n\n // For spectrum compatibility\n\n fn.bind = function (ev: any, h: any) {\n return this.on(ev, h);\n };\n\n fn.unbind = function (ev: any, h: any) {\n if (isObject(ev)) {\n for (let name in ev) {\n ev.hasOwnProperty(name) && this.off(name, ev[name]);\n }\n\n return this;\n } else {\n return this.off(ev, h);\n }\n };\n\n fn.click = function (h: any) {\n return h ? this.on('click', h) : this.trigger('click');\n };\n\n fn.change = function (h: any) {\n return h ? this.on('change', h) : this.trigger('change');\n };\n\n fn.keydown = function (h: any) {\n return h ? this.on('keydown', h) : this.trigger('keydown');\n };\n\n fn.delegate = function (selector: any, events: any, data: any, handler: any) {\n if (!handler) {\n handler = data;\n }\n\n return this.on(events, selector, function (e: any) {\n e.data = data;\n handler(e);\n });\n };\n\n fn.scrollLeft = function () {\n let el = this.get(0);\n el = el.nodeType == 9 ? el.defaultView : el;\n let win = el instanceof Window ? el : null;\n return win ? win.pageXOffset : el.scrollLeft || 0;\n };\n\n fn.scrollTop = function () {\n let el = this.get(0);\n el = el.nodeType == 9 ? el.defaultView : el;\n let win = el instanceof Window ? el : null;\n return win ? win.pageYOffset : el.scrollTop || 0;\n };\n\n const offset = $.prototype.offset;\n fn.offset = function (coords: any) {\n let top, left;\n\n if (coords) {\n top = coords.top;\n left = coords.left;\n }\n\n if (typeof top != 'undefined') {\n this.css('top', `${top}px`);\n }\n if (typeof left != 'undefined') {\n this.css('left', `${left}px`);\n }\n\n return offset.call(this);\n };\n\n $.map = function (items: any, clb: any) {\n const ar = [];\n\n for (var i = 0; i < items.length; i++) {\n ar.push(clb(items[i], i));\n }\n\n return ar;\n };\n\n const indexOf = Array.prototype.indexOf;\n\n $.inArray = function (val: any, arr: any, i: any) {\n return arr == null ? -1 : indexOf.call(arr, val, i);\n };\n\n $.Event = function (src: any, props: any) {\n if (!(this instanceof $.Event)) {\n return new $.Event(src, props);\n }\n\n this.type = src;\n this.isDefaultPrevented = () => false;\n };\n }\n};\n","import { isArray } from 'underscore';\nimport { Collection, Model } from '../../common';\nimport Component from '../../dom_components/model/Component';\n\nexport class Selectable extends Model {}\n\nexport default class Selected extends Collection {\n getByComponent(component: Component) {\n return this.filter(s => this.getComponent(s) === component)[0];\n }\n\n addComponent(component: Component, opts: any) {\n const toAdd = (isArray(component) ? component : [component])\n .filter(c => !this.hasComponent(c))\n .map(component => new Selectable({ component }))[0];\n return this.push(toAdd, opts);\n }\n\n getComponent(model: Selectable): Component {\n return model.get('component');\n }\n\n hasComponent(component: Component) {\n const model = this.getByComponent(component);\n return model && this.contains(model);\n }\n\n lastComponent() {\n const last = this.last();\n return last ? this.getComponent(last) : undefined;\n }\n\n allComponents() {\n return this.map(s => this.getComponent(s)).filter(i => i);\n }\n\n removeComponent(component: Component | Component[], opts: any) {\n const toRemove = (isArray(component) ? component : [component]).map(c => this.getByComponent(c));\n return this.remove(toRemove, opts);\n }\n}\n","import { isElement, isUndefined, isString } from 'underscore';\nimport { Collection, Debounced, Model, View } from '../common';\nimport { EditorConfigKeys } from '../editor/config/config';\nimport EditorModel from '../editor/model/Editor';\nimport { ProjectData } from '../storage_manager/model/IStorage';\nimport { createId, isDef, deepMerge } from '../utils/mixins';\n\nexport interface IModule extends IBaseModule {\n destroy(): void;\n postLoad(key: any): any;\n onLoad?(): void;\n name: string;\n postRender?(view: any): void;\n}\n\nexport interface IBaseModule {\n em: EditorModel;\n config: TConfig;\n}\n\nexport interface ModuleConfig {\n name?: string;\n stylePrefix?: string;\n appendTo?: string | HTMLElement;\n}\n\nexport interface IStorableModule {\n storageKey: string[] | string;\n store(result: any): any;\n load(keys: ProjectData): void;\n clear(): void;\n}\n\nexport interface ILoadableModule {\n onLoad(): void;\n}\n\nexport default abstract class Module implements IModule {\n private _em: EditorModel;\n private _config: T & { pStylePrefix?: string };\n private _name: string;\n debounced: Debounced[] = [];\n collections: Collection[] = [];\n cls: any[] = [];\n state?: Model;\n events: any;\n model?: any;\n view?: any;\n\n constructor(em: EditorModel, moduleName: string, defaults?: T) {\n this._em = em;\n this._name = moduleName;\n const name = (this.name.charAt(0).toLowerCase() + this.name.slice(1)) as EditorConfigKeys;\n const cfgParent = !isUndefined(em.config[name]) ? em.config[name] : em.config[this.name as EditorConfigKeys];\n const cfg = (cfgParent === true ? {} : cfgParent || {}) as Record;\n cfg.pStylePrefix = em.config.pStylePrefix || '';\n\n if (!isUndefined(cfgParent) && !cfgParent) {\n cfg._disable = 1;\n }\n\n cfg.em = em;\n this._config = deepMerge(defaults || {}, cfg) as T;\n }\n\n public get em() {\n return this._em;\n }\n public get config() {\n return this._config;\n }\n\n render(opts?: any): HTMLElement | JQuery | void {}\n postLoad(key: any): void {}\n\n get name(): string {\n return this._name;\n }\n\n getConfig

(\n name?: P\n ): R & { pStylePrefix?: string } {\n // @ts-ignore\n return name ? this.config[name] : this.config;\n }\n\n __logWarn(str: string, opts = {}) {\n this.em.logWarning(`[${this.name}]: ${str}`, opts);\n }\n\n postRender?(view: any): void;\n\n destroy() {\n this.__destroy();\n }\n\n __destroy() {\n this.view?.remove();\n this.state?.stopListening();\n this.state?.clear();\n this.debounced.forEach(d => d.cancel());\n this.collections.forEach(c => {\n c.stopListening();\n c.reset();\n });\n }\n\n /**\n * Move the main DOM element of the module.\n * To execute only post editor render (in postRender)\n */\n __appendTo() {\n const elTo = this.getConfig().appendTo;\n\n if (elTo) {\n const el = isElement(elTo) ? elTo : document.querySelector(elTo);\n if (!el) return this.__logWarn('\"appendTo\" element not found');\n el.appendChild(this.render() as any);\n }\n }\n}\n\nexport abstract class ItemManagerModule<\n TConf extends ModuleConfig = ModuleConfig,\n TCollection extends Collection = Collection\n> extends Module {\n cls: any[] = [];\n protected all: TCollection;\n view?: View;\n\n constructor(\n em: EditorModel,\n moduleName: string,\n all: any,\n events?: any,\n defaults?: TConf,\n opts: { skipListen?: boolean } = {}\n ) {\n super(em, moduleName, defaults);\n this.all = all;\n this.events = events;\n !opts.skipListen && this.__initListen();\n }\n\n private: boolean = false;\n\n abstract storageKey: string;\n abstract destroy(): void;\n postLoad(key: any): void {}\n render(opts?: any) {}\n\n getProjectData(data?: any) {\n const obj: any = {};\n const key = this.storageKey;\n if (key) {\n obj[key] = data || this.getAll();\n }\n return obj;\n }\n\n loadProjectData(data: any = {}, param: { all?: TCollection; onResult?: Function; reset?: boolean } = {}) {\n const { all, onResult, reset } = param;\n const key = this.storageKey;\n const opts: any = { action: 'load' };\n const coll = all || this.all;\n let result = data[key];\n\n if (typeof result == 'string') {\n try {\n result = JSON.parse(result);\n } catch (err) {\n this.__logWarn('Data parsing failed', { input: result });\n }\n }\n\n reset && result && coll.reset(undefined, opts);\n\n if (onResult) {\n result && onResult(result, opts);\n } else if (result && isDef(result.length)) {\n coll.reset(result, opts);\n }\n\n return result;\n }\n\n clear(opts = {}) {\n const { all } = this;\n all && all.reset(undefined, opts);\n return this;\n }\n\n // getAll(): TCollection extends Collection ? C[] : TCollection {\n getAll() {\n return [...this.all.models] as TCollection | any;\n }\n\n getAllMap(): {\n [key: string]: TCollection extends Collection ? C : unknown;\n } {\n return this.getAll().reduce((acc: any, i: any) => {\n acc[i.get(i.idAttribute)] = i;\n return acc;\n }, {} as any);\n }\n\n __initListen(opts: any = {}) {\n const { all, em, events } = this;\n all &&\n em &&\n all\n .on('add', (m: any, c: any, o: any) => em.trigger(events.add, m, o))\n .on('remove', (m: any, c: any, o: any) => em.trigger(events.remove, m, o))\n .on('change', (p: any, c: any) => em.trigger(events.update, p, p.changedAttributes(), c))\n .on('all', this.__catchAllEvent, this);\n // Register collections\n this.cls = [all].concat(opts.collections || []);\n // Propagate events\n ((opts.propagate as any[]) || []).forEach(({ entity, event }) => {\n entity.on('all', (ev: any, model: any, coll: any, opts: any) => {\n const options = opts || coll;\n const opt = { event: ev, ...options };\n [em, all].map(md => md.trigger(event, model, opt));\n });\n });\n }\n\n __remove(model: any, opts: any = {}) {\n const { em } = this;\n //@ts-ignore\n const md = isString(model) ? this.get(model) : model;\n const rm = () => {\n md && this.all.remove(md, opts);\n return md;\n };\n !opts.silent && em?.trigger(this.events.removeBefore, md, rm, opts);\n return !opts.abort && rm();\n }\n\n __catchAllEvent(event: any, model: any, coll: any, opts?: any) {\n const { em, events } = this;\n const options = opts || coll;\n em && events.all && em.trigger(events.all, { event, model, options });\n this.__onAllEvent();\n }\n\n __appendTo(renderProps?: any) {\n //@ts-ignore\n const elTo = this.config.appendTo;\n\n if (elTo) {\n const el = isElement(elTo) ? elTo : document.querySelector(elTo);\n if (!el) return this.__logWarn('\"appendTo\" element not found');\n // @ts-ignore\n el.appendChild(this.render(renderProps));\n }\n }\n\n __onAllEvent() {}\n\n _createId(len = 16) {\n const all = this.getAll();\n const ln = all.length + len;\n const allMap = this.getAllMap();\n let id;\n\n do {\n id = createId(ln);\n } while (allMap[id]);\n\n return id;\n }\n\n __listenAdd(model: TCollection, event: string) {\n model.on('add', (m, c, o) => this.em.trigger(event, m, o));\n }\n\n __listenRemove(model: TCollection, event: string) {\n model.on('remove', (m, c, o) => this.em.trigger(event, m, o));\n }\n\n __listenUpdate(model: TCollection, event: string) {\n model.on('change', (p, c) => this.em.trigger(event, p, p.changedAttributes(), c));\n }\n\n __destroy() {\n this.cls.forEach(coll => {\n coll.stopListening();\n coll.reset();\n });\n this.view?.remove();\n this.view = undefined;\n }\n}\n","import Component from '../../dom_components/model/Component';\nimport { CanvasSpotBuiltInTypes } from '../model/CanvasSpot';\n\nexport interface CanvasConfig {\n stylePrefix?: string;\n\n /**\n * Append external scripts to the `` of the iframe.\n * Be aware that these scripts will not be printed in the export code.\n * @default []\n * @example\n * scripts: [ 'https://...1.js', 'https://...2.js' ]\n * // or passing objects as attributes\n * scripts: [ { src: '/file.js', someattr: 'value' }, ... ]\n */\n scripts?: (string | Record)[];\n\n /**\n * Append external styles to the `` of the iframe.\n * Be aware that these scripts will not be printed in the export code.\n * @default []\n * @example\n * styles: [ 'https://...1.css', 'https://...2.css' ]\n * // or passing objects as attributes\n * styles: [ { href: '/style.css', someattr: 'value' }, ... ]\n */\n styles?: (string | Record)[];\n\n /**\n * Add custom badge naming strategy.\n * @example\n * customBadgeLabel: component => component.getName(),\n */\n customBadgeLabel?: (component: Component) => string;\n\n /**\n * Indicate when to start the autoscroll of the canvas on component/block dragging (value in px).\n * @default 50\n */\n autoscrollLimit?: number;\n\n /**\n * Experimental: external highlighter box\n */\n extHl?: boolean;\n\n /**\n * Initial content to load in all frames.\n * The default value enables the standard mode for the iframe.\n * @default ''\n */\n frameContent?: string;\n\n /**\n * Initial style to load in all frames.\n */\n frameStyle?: string;\n\n /**\n * When some textable component is selected and focused (eg. input or text component), the editor\n * stops some commands (eg. disables the copy/paste of components with CTRL+C/V to allow the copy/paste of the text).\n * This option allows to customize, by a selector, which element should not be considered textable.\n */\n notTextable?: string[];\n\n /**\n * By default, the editor allows to drop external elements by relying on the native HTML5\n * drag & drop API (eg. like a D&D of an image file from your desktop).\n * If you want to customize how external elements are interpreted by the editor, you can rely\n * on `canvas:dragdata` event, eg. https://github.com/GrapesJS/grapesjs/discussions/3849\n * @default true\n */\n allowExternalDrop?: boolean;\n\n /**\n * Disable the rendering of built-in canvas spots.\n *\n * Read here for more information about [Canvas Spots](https://grapesjs.com/docs/modules/Canvas.html#canvas-spots).\n * @example\n * // Disable only the hover type spot\n * customSpots: { hover: true },\n *\n * // Disable all built-in spots\n * customSpots: true,\n */\n customSpots?: boolean | Partial>;\n\n /**\n * Experimental: enable infinite canvas.\n */\n infiniteCanvas?: boolean;\n}\n\nconst config: CanvasConfig = {\n stylePrefix: 'cv-',\n scripts: [],\n styles: [],\n customBadgeLabel: undefined,\n autoscrollLimit: 50,\n extHl: false,\n frameContent: '',\n frameStyle: `\n body { background-color: #fff }\n * ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1) }\n * ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2) }\n * ::-webkit-scrollbar { width: 10px }\n `,\n notTextable: ['button', 'a', 'input[type=checkbox]', 'input[type=radio]'],\n allowExternalDrop: true,\n};\n\nexport default config;\n","import { DeviceProperties } from '../model/Device';\n\nexport interface DeviceManagerConfig {\n /**\n * The device `id` to select on start, if not indicated, the first available from `devices` will be used.\n * @default ''\n */\n default?: string;\n /**\n * Default devices.\n * @example\n * devices: [{\n * id: 'desktop',\n * name: 'Desktop',\n * width: '',\n * }, {\n * id: 'tablet',\n * name: 'Tablet',\n * width: '770px',\n * widthMedia: '992px',\n * },\n * ...\n * ]\n */\n devices?: DeviceProperties[];\n}\n\nconst config: DeviceManagerConfig = {\n default: '',\n devices: [\n {\n id: 'desktop',\n name: 'Desktop',\n width: '',\n },\n {\n id: 'tablet',\n name: 'Tablet',\n width: '770px',\n widthMedia: '992px',\n },\n {\n id: 'mobileLandscape',\n name: 'Mobile landscape',\n width: '568px',\n widthMedia: '768px',\n },\n {\n id: 'mobilePortrait',\n name: 'Mobile portrait',\n width: '320px',\n widthMedia: '480px',\n },\n ],\n};\n\nexport default config;\n","import { Model } from '../../common';\n\n/** @private */\nexport interface DeviceProperties {\n id?: string;\n /**\n * Device name.\n * @example 'Mobile'\n */\n name: string;\n /**\n * Width to set for the editor iframe.\n * @example '900px'\n */\n width: string | null;\n /**\n * Height to set for the editor iframe.\n * @example '600px'\n */\n height?: string;\n /**\n * The width which will be used in media queries, if empty the `width` will be used.\n * @example '900px'\n */\n widthMedia?: string | null;\n /**\n * Setup the order of media queries\n * @example 1\n */\n priority?: number | null;\n}\n\n/**\n * @typedef Device\n * @property {String} [name=''] Device type, eg. `Mobile`\n * @property {String} [width] Width to set for the editor iframe, eg. '900px'\n * @property {String} [height=''] Height to set for the editor iframe, eg. '600px'\n * @property {String} [widthMedia=''] The width which will be used in media queries, If empty the width will be used\n * @property {Number} [priority=null] Setup the order of media queries\n */\nexport default class Device extends Model {\n defaults() {\n return {\n name: '',\n width: null,\n height: '',\n widthMedia: null,\n priority: null,\n };\n }\n\n initialize() {\n this.get('widthMedia') === null && this.set('widthMedia', this.get('width'));\n this.get('width') === null && this.set('width', this.get('widthMedia'));\n !this.get('priority') && this.set('priority', parseFloat(this.get('widthMedia')!) || 0);\n const toCheck: (keyof DeviceProperties)[] = ['width', 'height', 'widthMedia'];\n toCheck.forEach(prop => this.checkUnit(prop));\n }\n\n checkUnit(prop: keyof DeviceProperties) {\n const pr = (this.get(prop) || '') as string;\n const noUnit = (parseFloat(pr) || 0).toString() === pr.toString();\n noUnit && this.set(prop, `${pr}px`);\n }\n\n getName() {\n return this.get('name') || this.get('id');\n }\n\n getWidthMedia() {\n return this.get('widthMedia') || '';\n }\n}\n","import { Collection } from '../../common';\nimport Device from './Device';\n\nexport default class Devices extends Collection {}\n\nDevices.prototype.model = Device;\n","import { View } from '../../common';\nimport EditorModel from '../../editor/model/Editor';\nimport html from '../../utils/html';\nimport Devices from '../model/Devices';\n\nexport interface DevicesViewConfig {\n em: EditorModel;\n pStylePrefix?: string;\n}\n\nexport default class DevicesView extends View {\n em: EditorModel;\n config: DevicesViewConfig;\n ppfx: string;\n devicesEl?: JQuery;\n\n template({ ppfx, label }: { ppfx: string; label: string }) {\n return html`\n

${label}
\n
\n \n \n \n
\n
\n
\n
\n \n `;\n }\n\n events() {\n return {\n change: 'updateDevice',\n 'click [data-add-trasp]': 'startAdd',\n };\n }\n\n constructor(o: { config: DevicesViewConfig; collection: Devices }) {\n super(o);\n this.config = o.config || {};\n this.em = this.config.em;\n this.ppfx = this.config.pStylePrefix || '';\n this.listenTo(this.em, 'change:device', this.updateSelect);\n }\n\n /**\n * Start adding new device\n * @return {[type]} [description]\n * @private\n */\n startAdd() {}\n\n /**\n * Update device of the editor\n * @private\n */\n updateDevice() {\n const { em } = this;\n\n if (em) {\n const devEl = this.devicesEl;\n em.set('device', devEl ? devEl.val() : '');\n }\n }\n\n /**\n * Update select value on device update\n * @private\n */\n updateSelect() {\n const { em, devicesEl } = this;\n\n if (em && em.getDeviceModel && devicesEl) {\n const device = em.getDeviceModel();\n devicesEl.val(device ? device.get('id')! : '');\n }\n }\n\n /**\n * Return devices options\n * @return {string} String of options\n * @private\n */\n getOptions() {\n const { collection, em } = this;\n let result = '';\n\n collection.forEach(device => {\n const { name, id } = device.attributes;\n const label = (em && em.t && em.t(`deviceManager.devices.${id}`)) || name;\n result += ``;\n });\n\n return result;\n }\n\n render() {\n const { em, ppfx, $el, el } = this;\n const label = em && em.t && em.t('deviceManager.device');\n $el.html(this.template({ ppfx, label }));\n this.devicesEl = $el.find(`.${ppfx}devices`);\n this.devicesEl.append(this.getOptions());\n this.devicesEl.val(em.get('device'));\n el.className = `${ppfx}devices-c`;\n return this;\n }\n}\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/device_manager/config/config.ts)\n * ```js\n * const editor = grapesjs.init({\n * deviceManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const deviceManager = editor.Devices;\n * ```\n * ## Available Events\n * * `device:add` - Added new device. The [Device] is passed as an argument to the callback\n * * `device:remove` - Device removed. The [Device] is passed as an argument to the callback\n * * `device:select` - New device selected. The newly selected [Device] and the previous one, are passed as arguments to the callback\n * * `device:update` - Device updated. The updated [Device] and the object containing changes are passed as arguments to the callback\n * * `device` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback\n *\n * ## Methods\n * * [add](#add)\n * * [get](#get)\n * * [getDevices](#getdevices)\n * * [remove](#remove)\n * * [select](#select)\n * * [getSelected](#getselected)\n *\n * [Device]: device.html\n *\n * @module Devices\n */\nimport { isString } from 'underscore';\nimport { ItemManagerModule } from '../abstract/Module';\nimport EditorModel from '../editor/model/Editor';\nimport defaults, { DeviceManagerConfig } from './config/config';\nimport Device, { DeviceProperties } from './model/Device';\nimport Devices from './model/Devices';\nimport DevicesView from './view/DevicesView';\n\nexport const evAll = 'device';\nexport const evPfx = `${evAll}:`;\nexport const evSelect = `${evPfx}select`;\nexport const evSelectBefore = `${evSelect}:before`;\nexport const evUpdate = `${evPfx}update`;\nexport const evAdd = `${evPfx}add`;\nexport const evAddBefore = `${evAdd}:before`;\nexport const evRemove = `${evPfx}remove`;\nexport const evRemoveBefore = `${evRemove}:before`;\nconst chnSel = 'change:device';\nconst deviceEvents = {\n all: evAll,\n select: evSelect,\n update: evUpdate,\n add: evAdd,\n remove: evRemove,\n removeBefore: evRemoveBefore,\n};\n\nexport default class DeviceManager extends ItemManagerModule<\n DeviceManagerConfig & { appendTo?: HTMLElement | string },\n Devices\n> {\n devices: Devices;\n events!: typeof deviceEvents;\n view?: DevicesView;\n\n Device = Device;\n\n Devices = Devices;\n\n storageKey = '';\n\n constructor(em: EditorModel) {\n super(em, 'DeviceManager', new Devices(), deviceEvents, defaults);\n this.devices = this.all;\n this.config.devices?.forEach(device => this.add(device, { silent: true }));\n this.select(this.config.default || this.devices.at(0));\n em.on(chnSel, this._onSelect, this);\n return this;\n }\n\n _onSelect(m: EditorModel, deviceId: string, opts: Record) {\n const { em, events } = this;\n const prevId = m.previous('device');\n const newDevice = this.get(deviceId);\n const ev = events.select;\n em.trigger(ev, newDevice, this.get(prevId));\n this.__catchAllEvent(ev, newDevice, opts);\n }\n\n /**\n * Add new device\n * @param {Object} props Device properties\n * @returns {[Device]} Added device\n * @example\n * const device1 = deviceManager.add({\n * // Without an explicit ID, the `name` will be taken. In case of missing `name`, a random ID will be created.\n * id: 'tablet',\n * name: 'Tablet',\n * width: '900px', // This width will be applied on the canvas frame and for the CSS media\n * });\n * const device2 = deviceManager.add({\n * id: 'tablet2',\n * name: 'Tablet 2',\n * width: '800px', // This width will be applied on the canvas frame\n * widthMedia: '810px', // This width that will be used for the CSS media\n * height: '600px', // Height will be applied on the canvas frame\n * });\n */\n add(props: DeviceProperties, options: Record = {}) {\n let result;\n let opts = options;\n\n // Support old API\n if (isString(props)) {\n const width = options;\n opts = arguments[2] || {};\n result = {\n ...opts,\n id: props,\n name: opts.name || props,\n width,\n };\n } else {\n result = props;\n }\n\n if (!result.id) {\n result.id = result.name || this._createId();\n }\n\n return this.devices.add(result, opts);\n }\n\n /**\n * Return device by ID\n * @param {String} id ID of the device\n * @returns {[Device]|null}\n * @example\n * const device = deviceManager.get('Tablet');\n * console.log(JSON.stringify(device));\n * // {name: 'Tablet', width: '900px'}\n */\n get(id: string): Device | undefined {\n // Support old API\n const byName = this.getAll().filter(d => d.get('name') === id)[0];\n return byName || this.devices.get(id) || null;\n }\n\n /**\n * Remove device\n * @param {String|[Device]} device Device or device id\n * @returns {[Device]} Removed device\n * @example\n * const removed = deviceManager.remove('device-id');\n * // or by passing the Device\n * const device = deviceManager.get('device-id');\n * deviceManager.remove(device);\n */\n remove(device: string | Device, opts = {}) {\n return this.__remove(device, opts);\n }\n\n /**\n * Return all devices\n * @returns {Array<[Device]>}\n * @example\n * const devices = deviceManager.getDevices();\n * console.log(JSON.stringify(devices));\n * // [{name: 'Desktop', width: ''}, ...]\n */\n getDevices() {\n return this.devices.models;\n }\n\n /**\n * Change the selected device. This will update the frame in the canvas\n * @param {String|[Device]} device Device or device id\n * @example\n * deviceManager.select('some-id');\n * // or by passing the page\n * const device = deviceManager.get('some-id');\n * deviceManager.select(device);\n */\n select(device: string | Device, opts = {}) {\n const md = isString(device) ? this.get(device) : device;\n md && this.em.set('device', md.get('id'), opts);\n return this;\n }\n\n /**\n * Get the selected device\n * @returns {[Device]}\n * @example\n * const selected = deviceManager.getSelected();\n */\n getSelected() {\n return this.get(this.em.get('device'));\n }\n\n getAll() {\n return this.devices;\n }\n\n render() {\n const { em } = this;\n this.view?.remove();\n this.view = new DevicesView({\n collection: this.devices,\n config: { em, ...this.config },\n });\n return this.view.render().el;\n }\n\n destroy() {\n this.__destroy();\n }\n}\n","import { ModuleConfig } from '../abstract/Module';\nimport { PageProperties } from './model/Page';\n\nexport interface PageManagerConfig extends ModuleConfig {\n /**\n * Default pages.\n */\n pages?: PageProperties[];\n\n /**\n * ID of the page to select on editor load.\n */\n selected?: string;\n}\n\nexport interface SelectableOption {\n /**\n * Select the page.\n */\n select?: boolean;\n}\n\nexport interface AbortOption {\n abort?: boolean;\n}\n\n/**{START_EVENTS}*/\nexport enum PagesEvents {\n /**\n * @event `page:add` Added new page. The page is passed as an argument to the callback.\n * @example\n * editor.on('page:add', (page) => { ... });\n */\n add = 'page:add',\n addBefore = 'page:add:before',\n\n /**\n * @event `page:remove` Page removed. The page is passed as an argument to the callback.\n * @example\n * editor.on('page:remove', (page) => { ... });\n */\n remove = 'page:remove',\n removeBefore = 'page:remove:before',\n\n /**\n * @event `page:select` New page selected. The newly selected page and the previous one, are passed as arguments to the callback.\n * @example\n * editor.on('page:select', (page, previousPage) => { ... });\n */\n select = 'page:select',\n selectBefore = 'page:select:before',\n\n /**\n * @event `page:update` Page updated. The updated page and the object containing changes are passed as arguments to the callback.\n * @example\n * editor.on('page:update', (page, changes) => { ... });\n */\n update = 'page:update',\n\n /**\n * @event `page` Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback.\n * @example\n * editor.on('page', ({ event, model, ... }) => { ... });\n */\n all = 'page',\n}\n/**{END_EVENTS}*/\n\n// need this to avoid the TS documentation generator to break\nexport default PagesEvents;\n","import { isArray, isUndefined } from 'underscore';\nimport { AddOptions, Collection } from '../common';\nimport ModuleModel from './ModuleModel';\n\ntype ModuleExt = TModel extends ModuleModel ? M : unknown;\ntype ModelConstructor = { new (mod: ModuleExt, attr: any): TModel };\n\nexport default class ModuleCollection extends Collection {\n module!: ModuleExt;\n private newModel!: ModelConstructor;\n\n add(model: Array> | TModel, options?: AddOptions): TModel;\n add(models: Array> | TModel>, options?: AddOptions): TModel[];\n add(model?: unknown, options?: AddOptions): any {\n //Note: the undefined case needed because backbonejs not handle the reset() correctly\n var models = isArray(model) ? model : !isUndefined(model) ? [model] : undefined;\n\n models = models?.map(m => (m instanceof this.newModel ? m : new this.newModel(this.module, m))) ?? [undefined];\n\n return super.add(isArray(model) ? models : models[0], options);\n }\n\n constructor(\n module: ModuleExt,\n models: TModel[] | Array>,\n modelConstructor: ModelConstructor\n ) {\n super(models, { module, modelConstructor });\n }\n\n preinitialize(models?: TModel[] | Array>, options?: any) {\n this.newModel = options.modelConstructor;\n this.module = options.module;\n }\n}\n","import { forEach, isEmpty, isNumber, isString, keys, result } from 'underscore';\nimport CanvasModule from '..';\nimport { ModuleModel } from '../../abstract';\nimport { BoxRect, PrevToNewIdMap } from '../../common';\nimport ComponentWrapper from '../../dom_components/model/ComponentWrapper';\nimport Page from '../../pages/model/Page';\nimport { createId, isComponent, isObject } from '../../utils/mixins';\nimport FrameView from '../view/FrameView';\nimport Frames from './Frames';\nimport { CssRuleJSON } from '../../css_composer/model/CssRule';\n\nconst keyAutoW = '__aw';\nconst keyAutoH = '__ah';\n\nconst getDimension = (frame: Frame, type: 'width' | 'height') => {\n const dim = frame.get(type);\n const viewDim = frame.view?.el[type === 'width' ? 'offsetWidth' : 'offsetHeight'];\n\n if (isNumber(dim)) {\n return dim;\n } else if (isString(dim) && dim.endsWith('px')) {\n return parseFloat(dim);\n } else if (viewDim) {\n return viewDim;\n } else {\n return 0;\n }\n};\n\n/**\n * @property {Object|String} component Wrapper component definition. You can also pass an HTML string as components of the default wrapper component.\n * @property {String} [width=''] Width of the frame. By default, the canvas width will be taken.\n * @property {String} [height=''] Height of the frame. By default, the canvas height will be taken.\n * @property {Number} [x=0] Horizontal position of the frame in the canvas.\n * @property {Number} [y=0] Vertical position of the frame in the canvas.\n *\n */\nexport default class Frame extends ModuleModel {\n defaults() {\n return {\n x: 0,\n y: 0,\n changesCount: 0,\n attributes: {},\n width: null,\n height: null,\n head: [],\n component: '',\n styles: '',\n refFrame: null,\n _undo: true,\n _undoexc: ['changesCount'],\n };\n }\n view?: FrameView;\n\n /**\n * @hideconstructor\n */\n constructor(module: CanvasModule, attr: any) {\n super(module, attr);\n const { em } = this;\n const { styles, component } = this.attributes;\n const domc = em.Components;\n const conf = domc.getConfig();\n const allRules = em.Css.getAll();\n const idMap: PrevToNewIdMap = {};\n const modOpts = { em, config: conf, frame: this, idMap };\n\n if (!isComponent(component)) {\n const wrp = isObject(component) ? component : { components: component };\n !wrp.type && (wrp.type = 'wrapper');\n const Wrapper = domc.getType('wrapper')!.model;\n this.set('component', new Wrapper(wrp, modOpts));\n }\n\n if (!styles) {\n this.set('styles', allRules);\n } else if (!isObject(styles)) {\n let newStyles = styles as string | CssRuleJSON[];\n\n // Avoid losing styles on remapped components\n if (keys(idMap).length) {\n newStyles = isString(newStyles) ? em.Parser.parseCss(newStyles) : newStyles;\n em.Css.checkId(newStyles, { idMap });\n }\n\n allRules.add(newStyles);\n this.set('styles', allRules);\n }\n\n !attr.width && this.set(keyAutoW, 1);\n !attr.height && this.set(keyAutoH, 1);\n\n !this.id && this.set('id', createId());\n }\n\n get width() {\n return getDimension(this, 'width');\n }\n\n get height() {\n return getDimension(this, 'height');\n }\n\n get head(): { tag: string; attributes: any }[] {\n return this.get('head');\n }\n\n get refFrame(): Frame | undefined {\n return this.get('refFrame');\n }\n\n get root() {\n const { refFrame } = this;\n return refFrame?.getComponent() || this.getComponent();\n }\n\n initRefs() {\n const { refFrame } = this;\n if (isString(refFrame)) {\n const frame = this.module.framesById[refFrame];\n frame && this.set({ refFrame: frame }, { silent: true });\n }\n }\n\n getBoxRect(): BoxRect {\n const { x, y } = this.attributes;\n const { width, height } = this;\n\n return {\n x,\n y,\n width,\n height,\n };\n }\n\n onRemove() {\n !this.refFrame && this.getComponent().remove({ root: 1 });\n }\n\n changesUp(opt: any = {}) {\n if (opt.temporary || opt.noCount || opt.avoidStore) {\n return;\n }\n this.set('changesCount', this.get('changesCount') + 1);\n }\n\n getComponent(): ComponentWrapper {\n return this.get('component');\n }\n\n getStyles() {\n return this.get('styles');\n }\n\n disable() {\n this.trigger('disable');\n }\n\n remove() {\n this.view?.remove();\n this.view = undefined;\n const coll = this.collection;\n return coll && coll.remove(this);\n }\n\n getHead() {\n return [...this.head];\n }\n\n setHead(value: { tag: string; attributes: any }[]) {\n return this.set('head', [...value]);\n }\n\n addHeadItem(item: { tag: string; attributes: any }) {\n this.head.push(item);\n }\n\n getHeadByAttr(attr: string, value: any, tag: string) {\n return this.head.filter(item => item.attributes && item.attributes[attr] == value && (!tag || tag === item.tag))[0];\n }\n\n removeHeadByAttr(attr: string, value: any, tag: string) {\n const item = this.getHeadByAttr(attr, value, tag);\n const index = this.head.indexOf(item);\n\n if (index >= 0) {\n this.head.splice(index, 1);\n }\n }\n\n addLink(href: string) {\n const tag = 'link';\n !this.getHeadByAttr('href', href, tag) &&\n this.addHeadItem({\n tag,\n attributes: {\n href,\n rel: 'stylesheet',\n },\n });\n }\n\n removeLink(href: string) {\n this.removeHeadByAttr('href', href, 'link');\n }\n\n addScript(src: string) {\n const tag = 'script';\n !this.getHeadByAttr('src', src, tag) &&\n this.addHeadItem({\n tag,\n attributes: { src },\n });\n }\n\n removeScript(src: string) {\n this.removeHeadByAttr('src', src, 'script');\n }\n\n getPage(): Page | undefined {\n return (this.collection as unknown as Frames)?.page;\n }\n\n _emitUpdated(data = {}) {\n this.em.trigger('frame:updated', { frame: this, ...data });\n }\n\n hasAutoHeight() {\n const { height } = this.attributes;\n\n if (height === 'auto' || this.config.infiniteCanvas) {\n return true;\n }\n\n return false;\n }\n\n toJSON(opts: any = {}) {\n const obj = ModuleModel.prototype.toJSON.call(this, opts);\n const defaults = result(this, 'defaults');\n\n if (opts.fromUndo) delete obj.component;\n delete obj.styles;\n delete obj.changesCount;\n obj[keyAutoW] && delete obj.width;\n obj[keyAutoH] && delete obj.height;\n\n if (obj.refFrame) {\n obj.refFrame = obj.refFrame.id;\n delete obj.component;\n }\n\n // Remove private keys\n forEach(obj, (value, key) => {\n key.indexOf('_') === 0 && delete obj[key];\n });\n\n forEach(defaults, (value, key) => {\n if (obj[key] === value) delete obj[key];\n });\n\n forEach(['attributes', 'head'], prop => {\n if (isEmpty(obj[prop])) delete obj[prop];\n });\n\n return obj;\n }\n}\n","import { bindAll } from 'underscore';\nimport CanvasModule from '..';\nimport { ModuleCollection } from '../../abstract';\nimport Page from '../../pages/model/Page';\nimport Frame from './Frame';\n\nexport default class Frames extends ModuleCollection {\n loadedItems = 0;\n itemsToLoad = 0;\n page?: Page;\n\n constructor(module: CanvasModule, models: Frame[] | Array> = []) {\n super(module, models, Frame);\n bindAll(this, 'itemLoaded');\n this.on('add', this.onAdd);\n this.on('reset', this.onReset);\n this.on('remove', this.onRemove);\n this.forEach(frame => this.onAdd(frame));\n }\n\n onAdd(frame: Frame) {\n this.module.framesById[frame.id] = frame;\n }\n\n onReset(m: Frame, opts?: { previousModels?: Frame[] }) {\n const prev = opts?.previousModels || [];\n prev.map(p => this.onRemove(p));\n }\n\n onRemove(frame: Frame) {\n frame.onRemove();\n delete this.module.framesById[frame.id];\n }\n\n initRefs() {\n this.forEach(frame => frame.initRefs());\n }\n\n itemLoaded() {\n this.loadedItems++;\n\n if (this.loadedItems >= this.itemsToLoad) {\n this.trigger('loaded:all');\n this.listenToLoadItems(false);\n }\n }\n\n listenToLoad() {\n this.loadedItems = 0;\n this.itemsToLoad = this.length;\n this.listenToLoadItems(true);\n }\n\n listenToLoadItems(on: boolean) {\n this.forEach(item => item[on ? 'on' : 'off']('loaded', this.itemLoaded));\n }\n}\n","import CanvasModule from '..';\nimport { ModuleModel } from '../../abstract';\nimport { Coordinates, CoordinatesTypes, DEFAULT_COORDS } from '../../common';\nimport { evUpdate as evDeviceUpdate } from '../../device_manager';\nimport Page from '../../pages/model/Page';\nimport PagesEvents from '../../pages/types';\nimport Frames from './Frames';\n\nexport default class Canvas extends ModuleModel {\n defaults() {\n return {\n frame: '',\n frames: [],\n rulers: false,\n zoom: 100,\n x: 0,\n y: 0,\n // Scripts to apply on all frames\n scripts: [],\n // Styles to apply on all frames\n styles: [],\n pointer: DEFAULT_COORDS,\n pointerScreen: DEFAULT_COORDS,\n };\n }\n\n constructor(module: CanvasModule) {\n const { em, config } = module;\n const { scripts, styles } = config;\n super(module, { scripts, styles });\n this.set('frames', new Frames(module));\n this.on('change:zoom', this.onZoomChange);\n this.on('change:x change:y', this.onCoordsChange);\n this.on('change:pointer change:pointerScreen', this.onPointerChange);\n this.listenTo(em, `change:device ${evDeviceUpdate}`, this.updateDevice);\n this.listenTo(em, PagesEvents.select, this._pageUpdated);\n }\n\n get frames(): Frames {\n return this.get('frames');\n }\n\n init() {\n const { em } = this;\n const mainPage = em.Pages._initPage();\n this.set('frames', mainPage.getFrames());\n this.updateDevice({ frame: mainPage.getMainFrame() });\n }\n\n _pageUpdated(page: Page, prev?: Page) {\n const { em } = this;\n em.setSelected();\n em.get('readyCanvas') && em.stopDefault(); // We have to stop before changing current frames\n prev?.getFrames().map(frame => frame.disable());\n this.set('frames', page.getFrames());\n this.updateDevice({ frame: page.getMainFrame() });\n }\n\n updateDevice(opts: any = {}) {\n const { em } = this;\n const device = em.getDeviceModel();\n const model = opts.frame || em.getCurrentFrameModel();\n\n if (model && device) {\n const { width, height } = device.attributes;\n model.set({ width, height }, { noUndo: 1 });\n }\n }\n\n onZoomChange() {\n const { em, module } = this;\n const zoom = this.get('zoom');\n zoom < 1 && this.set('zoom', 1);\n em.trigger(module.events.zoom);\n }\n\n onCoordsChange() {\n const { em, module } = this;\n em.trigger(module.events.coords);\n }\n\n onPointerChange() {\n const { em, module } = this;\n em.trigger(module.events.pointer);\n }\n\n getPointerCoords(type: CoordinatesTypes = CoordinatesTypes.World): Coordinates {\n const { pointer, pointerScreen } = this.attributes;\n return type === CoordinatesTypes.World ? pointer : pointerScreen;\n }\n}\n","import { debounce } from 'underscore';\nimport CanvasModule from '..';\nimport { ModuleCollection } from '../../abstract';\nimport { Debounced, ObjectAny } from '../../common';\nimport EditorModel from '../../editor/model/Editor';\nimport CanvasSpot, { CanvasSpotProps } from './CanvasSpot';\nimport { ComponentsEvents } from '../../dom_components/types';\n\nexport default class CanvasSpots extends ModuleCollection {\n refreshDbn: Debounced;\n\n constructor(module: CanvasModule, models: CanvasSpot[] | CanvasSpotProps[] = []) {\n super(module, models, CanvasSpot);\n this.on('add', this.onAdd);\n this.on('change', this.onChange);\n this.on('remove', this.onRemove);\n const { em } = this;\n this.refreshDbn = debounce(() => this.refresh(), 0);\n\n const evToRefreshDbn = `component:resize styleable:change component:input ${ComponentsEvents.update} frame:updated undo redo`;\n this.listenTo(em, evToRefreshDbn, () => this.refreshDbn());\n }\n\n get em(): EditorModel {\n return this.module.em;\n }\n\n get events() {\n return this.module.events;\n }\n\n refresh() {\n const { em, events } = this;\n em.trigger(events.spot);\n }\n\n onAdd(spot: CanvasSpot) {\n this.__trgEvent(this.events.spotAdd, { spot });\n }\n\n onChange(spot: CanvasSpot) {\n this.__trgEvent(this.events.spotUpdate, { spot });\n }\n\n onRemove(spot: CanvasSpot) {\n this.__trgEvent(this.events.spotRemove, { spot });\n }\n\n __trgEvent(event: string, props: ObjectAny) {\n const { module } = this;\n const { em } = module;\n em.trigger(event, props);\n this.refreshDbn();\n }\n}\n","export interface ToScreenOption {\n toScreen?: boolean;\n}\n\nexport interface ToWorldOption {\n toWorld?: boolean;\n}\n\nexport interface GetBoxRectOptions extends ToScreenOption {\n local?: boolean;\n}\n\nexport interface CanvasRefreshOptions {\n /**\n * Refresh canvas spots.\n */\n spots?: boolean;\n all?: boolean;\n}\n\n/**{START_EVENTS}*/\nexport enum CanvasEvents {\n /**\n * @event `canvas:dragenter` Something is dragged inside the canvas, `DataTransfer` instance passed as an argument.\n */\n dragEnter = 'canvas:dragenter',\n\n /**\n * @event `canvas:dragover` Something is dragging on the canvas, `DataTransfer` instance passed as an argument.\n */\n dragOver = 'canvas:dragover',\n\n /**\n * @event `canvas:dragend` When a drag operation is ended, `DataTransfer` instance passed as an argument.\n */\n dragEnd = 'canvas:dragend',\n\n /**\n * @event `canvas:dragdata` On any dataTransfer parse, `DataTransfer` instance and the `result` are passed as arguments.\n * By changing `result.content` you're able to customize what is dropped.\n */\n dragData = 'canvas:dragdata',\n\n /**\n * @event `canvas:drop` Something is dropped in canvas, `DataTransfer` instance and the dropped model are passed as arguments.\n */\n drop = 'canvas:drop',\n\n /**\n * @event `canvas:spot` Spots updated.\n * @example\n * editor.on('canvas:spot', () => {\n * console.log('Spots', editor.Canvas.getSpots());\n * });\n */\n spot = 'canvas:spot',\n\n /**\n * @event `canvas:spot:add` New canvas spot added.\n * @example\n * editor.on('canvas:spot:add', ({ spot }) => {\n * console.log('Spot added', spot);\n * });\n */\n spotAdd = 'canvas:spot:add',\n\n /**\n * @event `canvas:spot:update` Canvas spot updated.\n * @example\n * editor.on('canvas:spot:update', ({ spot }) => {\n * console.log('Spot updated', spot);\n * });\n */\n spotUpdate = 'canvas:spot:update',\n\n /**\n * @event `canvas:spot:remove` Canvas spot removed.\n * @example\n * editor.on('canvas:spot:remove', ({ spot }) => {\n * console.log('Spot removed', spot);\n * });\n */\n spotRemove = 'canvas:spot:remove',\n\n /**\n * @event `canvas:coords` Canvas coordinates updated.\n * @example\n * editor.on('canvas:coords', () => {\n * console.log('Canvas coordinates updated:', editor.Canvas.getCoords());\n * });\n */\n coords = 'canvas:coords',\n\n /**\n * @event `canvas:zoom` Canvas zoom updated.\n * @example\n * editor.on('canvas:zoom', () => {\n * console.log('Canvas zoom updated:', editor.Canvas.getZoom());\n * });\n */\n zoom = 'canvas:zoom',\n\n /**\n * @event `canvas:pointer` Canvas pointer updated.\n * @example\n * editor.on('canvas:pointer', () => {\n * console.log('Canvas pointer updated:', editor.Canvas.getPointer());\n * });\n */\n pointer = 'canvas:pointer',\n\n /**\n * @event `canvas:refresh` Canvas was refreshed to update elements on top,\n * like spots/tools (eg. via `editor.Canvas.refresh()` or on frame resize).\n * @example\n * editor.on('canvas:refresh', (canvasRefreshOptions) => {\n * console.log('Canvas refreshed with options:', canvasRefreshOptions);\n * });\n */\n refresh = 'canvas:refresh',\n\n /**\n * @event `canvas:frame:load` Frame loaded in canvas.\n * The event is triggered right after iframe's `onload`.\n * @example\n * editor.on('canvas:frame:load', ({ window }) => {\n * console.log('Frame loaded', window);\n * });\n */\n frameLoad = 'canvas:frame:load',\n\n /**\n * @event `canvas:frame:load:head` Frame head loaded in canvas.\n * The event is triggered right after iframe's finished to load the head elemenets (eg. scripts)\n * @example\n * editor.on('canvas:frame:load:head', ({ window }) => {\n * console.log('Frame head loaded', window);\n * });\n */\n frameLoadHead = 'canvas:frame:load:head',\n\n /**\n * @event `canvas:frame:load:body` Frame body loaded in canvas.\n * The event is triggered when the body is rendered with components.\n * @example\n * editor.on('canvas:frame:load:body', ({ window }) => {\n * console.log('Frame completed the body render', window);\n * });\n */\n frameLoadBody = 'canvas:frame:load:body',\n}\n/**{END_EVENTS}*/\n\n// need this to avoid the TS documentation generator to break\nexport default CanvasEvents;\n","import ModuleCollection from './ModuleCollection';\nimport ModuleModel from './ModuleModel';\nimport { IBaseModule } from './Module';\nimport { View } from '../common';\nimport EditorModel from '../editor/model/Editor';\n\ntype ModuleFromModel = TModel extends ModuleModel ? M : unknown;\ntype ModuleModelExt = TItem extends ModuleCollection\n ? ModuleFromModel\n : TItem extends ModuleModel\n ? M\n : unknown;\n\n// type TCollection = TItem extends ModuleCollection ? TItem : unknown;\n\nexport default class ModuleView<\n TModel extends ModuleModel | ModuleCollection = ModuleModel,\n TElement extends Element = HTMLElement\n> extends View {\n protected get pfx() {\n return this.ppfx + (this.config as any).stylePrefix || '';\n }\n\n protected get ppfx() {\n return this.em.config.stylePrefix || '';\n }\n\n collection!: TModel extends ModuleModel ? ModuleCollection : TModel;\n\n protected get module(): ModuleModelExt {\n return (this.model as any)?.module ?? this.collection.module;\n }\n\n protected get em(): EditorModel {\n return this.module.em;\n }\n\n protected get config(): ModuleModelExt extends IBaseModule ? C : unknown {\n return this.module.config as any;\n }\n\n public className!: string;\n\n preinitialize(options?: any) {\n this.className = '';\n }\n}\n","import ModuleView from './ModuleView';\nimport ModuleCollection from './ModuleCollection';\nimport ModuleModel from './ModuleModel';\nimport { View } from '../common';\n\nexport default abstract class ModuleDomainViews<\n TCollection extends ModuleCollection,\n TItemView extends ModuleView\n> extends ModuleView {\n // Defines the View per type\n itemsView = '';\n\n protected itemType = 'type';\n\n reuseView = false;\n\n viewCollection: TItemView[] = [];\n constructor(opts: any = {}, autoAdd = false) {\n super(opts);\n autoAdd && this.listenTo(this.collection, 'add', this.addTo);\n }\n\n /**\n * Add new model to the collection\n * @param {ModuleModel} model\n * @private\n * */\n private addTo(model: ModuleModel) {\n this.add(model);\n }\n\n private itemViewNotFound(type: string) {\n /*const { em, ns } = this;\n const warn = `${ns ? `[${ns}]: ` : ''}'${type}' type not found`;\n em?.logWarning(warn);*/\n }\n protected abstract renderView(model: ModuleModel, itemType: string): TItemView;\n\n /**\n * Render new model inside the view\n * @param {ModuleModel} model\n * @param {Object} fragment Fragment collection\n * @private\n * */\n private add(model: ModuleModel, fragment?: DocumentFragment) {\n const { reuseView, viewCollection } = this;\n var frag = fragment || null;\n var typeField = model.get(this.itemType);\n let view;\n\n //@ts-ignore\n if (model.view && reuseView) {\n //@ts-ignore\n view = model.view;\n } else {\n view = this.renderView(model, typeField);\n }\n\n viewCollection.push(view);\n const rendered = view.render().el;\n\n if (frag) frag.appendChild(rendered);\n else this.$el.append(rendered);\n }\n\n render() {\n const frag = document.createDocumentFragment();\n this.clearItems();\n this.$el.empty();\n\n if (this.collection.length) this.collection.each(model => this.add(model, frag));\n\n this.$el.append(frag);\n this.onRender();\n return this;\n }\n\n onRender() {}\n\n onRemoveBefore(items: TItemView[], opts: any) {}\n onRemove(items: TItemView[], opts: any) {}\n\n remove(opts: any = {}) {\n const { viewCollection } = this;\n this.onRemoveBefore(viewCollection, opts);\n this.clearItems();\n View.prototype.remove.apply(this, opts);\n this.onRemove(viewCollection, opts);\n return this;\n }\n\n clearItems() {\n const items = this.viewCollection || [];\n // TODO Traits do not update the target anymore\n // items.forEach(item => item.remove());\n // this.items = [];\n }\n}\n","import { View } from '../../common';\nimport CssRule from '../model/CssRule';\n\nexport default class CssRuleView extends View {\n config: any;\n\n constructor(o: any = {}) {\n super(o);\n this.config = o.config || {};\n const { model } = this;\n this.listenTo(model, 'change', this.render);\n this.listenTo(model, 'destroy remove', this.remove);\n this.listenTo(model.get('selectors'), 'change', this.render);\n }\n\n // @ts-ignore\n tagName() {\n return 'style';\n }\n\n render() {\n const { model, el } = this;\n const important = model.get('important');\n el.innerHTML = model.toCSS({ important });\n return this;\n }\n}\n","import CssRuleView from './CssRuleView';\n\nexport default class CssGroupRuleView extends CssRuleView {\n _createElement() {\n return document.createTextNode('');\n }\n\n render() {\n const model = this.model;\n const important = model.get('important');\n this.el.textContent = model.getDeclaration({ important });\n return this;\n }\n}\n","import { bindAll } from 'underscore';\n\nimport { View } from '../../common';\nimport { createEl } from '../../utils/dom';\nimport CssRuleView from './CssRuleView';\nimport CssGroupRuleView from './CssGroupRuleView';\nimport EditorModel from '../../editor/model/Editor';\nimport CssRule from '../model/CssRule';\n\nconst getBlockId = (pfx: string, order?: string | number) => `${pfx}${order ? `-${parseFloat(order as string)}` : ''}`;\n\nexport default class CssRulesView extends View {\n atRules: Record;\n config: Record;\n em: EditorModel;\n pfx: string;\n renderStarted?: boolean;\n\n constructor(o: any) {\n super(o);\n bindAll(this, 'sortRules');\n\n const config = o.config || {};\n this.atRules = {};\n this.config = config;\n this.em = config.em;\n this.pfx = config.stylePrefix || '';\n this.className = this.pfx + 'rules';\n const coll = this.collection;\n this.listenTo(coll, 'add', this.addTo);\n this.listenTo(coll, 'reset', this.render);\n }\n\n /**\n * Add to collection\n * @param {Object} model\n * @private\n * */\n addTo(model: CssRule) {\n this.addToCollection(model);\n }\n\n /**\n * Add new object to collection\n * @param {Object} model\n * @param {Object} fragmentEl\n * @return {Object}\n * @private\n * */\n addToCollection(model: CssRule, fragmentEl?: DocumentFragment) {\n // If the render is not yet started\n if (!this.renderStarted) {\n return;\n }\n\n const fragment = fragmentEl || null;\n const { config } = this;\n const opts = { model, config };\n let rendered, view;\n\n // I have to render keyframes of the same name together\n // Unfortunately at the moment I didn't find the way of appending them\n // if not staticly, via appendData\n if (model.get('atRuleType') === 'keyframes') {\n const atRule = model.getAtRule();\n let atRuleEl = this.atRules[atRule];\n\n if (!atRuleEl) {\n const styleEl = document.createElement('style');\n atRuleEl = document.createTextNode('');\n styleEl.appendChild(document.createTextNode(`${atRule}{`));\n styleEl.appendChild(atRuleEl);\n styleEl.appendChild(document.createTextNode('}'));\n this.atRules[atRule] = atRuleEl;\n rendered = styleEl;\n }\n\n view = new CssGroupRuleView(opts);\n atRuleEl.appendData(view.render().el.textContent);\n } else {\n view = new CssRuleView(opts);\n rendered = view.render().el;\n }\n\n const clsName = this.className!;\n const mediaText = model.get('mediaText');\n const defaultBlockId = getBlockId(clsName);\n let blockId = defaultBlockId;\n\n // If the rule contains a media query it might have a different container\n // for it (eg. rules created with Device Manager)\n if (mediaText) {\n blockId = getBlockId(clsName, this.getMediaWidth(mediaText));\n }\n\n if (rendered) {\n const container = fragment || this.el;\n let contRules;\n\n // Try to find a specific container for the rule (if it\n // containes a media query), otherwise get the default one\n try {\n contRules = container.querySelector(`#${blockId}`);\n } catch (e) {}\n\n if (!contRules) {\n contRules = container.querySelector(`#${defaultBlockId}`);\n }\n\n contRules?.appendChild(rendered);\n }\n\n return rendered;\n }\n\n getMediaWidth(mediaText: string) {\n return mediaText && mediaText.replace(`(${this.em.getConfig().mediaCondition}: `, '').replace(')', '');\n }\n\n sortRules(a: number, b: number) {\n const { em } = this;\n const isMobFirst = (em.getConfig().mediaCondition || '').indexOf('min-width') !== -1;\n\n if (!isMobFirst) return 0;\n\n const left = isMobFirst ? a : b;\n const right = isMobFirst ? b : a;\n\n return left - right;\n }\n\n render() {\n this.renderStarted = true;\n this.atRules = {};\n const { em, $el, collection } = this;\n const cls = this.className!;\n const frag = document.createDocumentFragment();\n $el.empty();\n\n // Create devices related DOM structure, ensure also to have a default container\n const prs = em.Devices.getAll().pluck('priority').sort(this.sortRules) as number[];\n prs.every(pr => pr) && prs.unshift(0);\n prs.forEach(pr => frag.appendChild(createEl('div', { id: getBlockId(cls, pr) })));\n\n collection.each(model => this.addToCollection(model, frag));\n $el.append(frag);\n $el.attr('class', cls);\n return this;\n }\n}\n","import { each } from 'underscore';\nimport { HTMLParserOptions } from '../config/config';\n\nconst htmlType = 'text/html';\nconst defaultType = htmlType; // 'application/xml';\n\nexport default (str: string, config: HTMLParserOptions = {}) => {\n const parser = new DOMParser();\n const mimeType = config.htmlType || defaultType;\n const toHTML = mimeType === htmlType;\n const strF = toHTML ? str : `
${str}
`;\n const doc = parser.parseFromString(strF, mimeType);\n let res: HTMLElement;\n\n if (toHTML) {\n if (config.asDocument) return doc;\n\n // Replicate the old parser in order to avoid breaking changes\n const { head, body } = doc;\n // Move all scripts at the bottom of the page\n const scripts = head.querySelectorAll('script');\n each(scripts, node => body.appendChild(node));\n // Move inside body all head children\n const hEls: Element[] = [];\n each(head.children, n => hEls.push(n));\n each(hEls, (node, i) => body.insertBefore(node, body.children[i]));\n res = body;\n } else {\n res = doc.firstChild as HTMLElement;\n }\n\n return res;\n};\n\n/**\n * POC, custom html parser specs\n * Parse an HTML string to an array of nodes\n * example\n * parse(`
Hello
World example`)\n * // result\n * [\n * {\n * tagName: 'div',\n * attributes: { class: 'mycls', 'data-test': '' },\n * childNodes: ['Hello'],\n * },{\n * tagName: 'span',\n * childNodes: [\n * 'World ',\n * {\n * tagName: 'b',\n * childNodes: ['example'],\n * }\n * ],\n * }\n * ]\n *\n\nexport const parseNodes = nodes => {\n const result = [];\n\n for (let i = 0; i < nodes.length; i++) {\n result.push(parseNode(nodes[i]));\n }\n\n return result;\n};\n\nexport const parseAttributes = attrs => {\n const result = {};\n\n for (let j = 0; j < attrs.length; j++) {\n const attr = attrs[j];\n const nodeName = attr.nodeName;\n const nodeValue = attr.nodeValue;\n result[nodeName] = nodeValue;\n }\n\n return result;\n};\n\nexport const parseNode = el => {\n // Return the string of the textnode element\n if (el.nodeType === 3) {\n return el.nodeValue;\n }\n\n const tagName = node.tagName ? node.tagName.toLowerCase() : '';\n const attrs = el.attributes || [];\n const nodes = el.childNodes || [];\n\n return {\n ...(tagName && { tagName }),\n ...(attrs.length && {\n attributes: parseAttributes(attrs)\n }),\n ...(nodes.length && {\n childNodes: parseNodes(nodes)\n })\n };\n};\n\nexport default (str, config = {}) => {\n const result = [];\n const el = document.createElement('div');\n el.innerHTML = str;\n const nodes = el.childNodes;\n const len = nodes.length;\n\n for (let i = 0; i < len; i++) {\n result.push(parseNode(nodes[i]));\n }\n\n return result;\n};\n */\n","import { each, isArray, isFunction, isUndefined } from 'underscore';\nimport { ObjectAny, ObjectStrings } from '../../common';\nimport { ComponentDefinitionDefined, ComponentStackItem } from '../../dom_components/model/types';\nimport EditorModel from '../../editor/model/Editor';\nimport { HTMLParseResult, HTMLParserOptions, ParseNodeOptions, ParserConfig } from '../config/config';\nimport BrowserParserHtml from './BrowserParserHtml';\nimport { doctypeToString } from '../../utils/dom';\n\nconst modelAttrStart = 'data-gjs-';\nconst event = 'parse:html';\n\nconst ParserHtml = (em?: EditorModel, config: ParserConfig & { returnArray?: boolean } = {}) => {\n return {\n compTypes: [] as ComponentStackItem[],\n\n modelAttrStart,\n\n getPropAttribute(attrName: string, attrValue?: string) {\n const name = attrName.replace(this.modelAttrStart, '');\n const valueLen = attrValue?.length || 0;\n const firstChar = attrValue?.substring(0, 1);\n const lastChar = attrValue?.substring(valueLen - 1);\n let value: any = attrValue === 'true' ? true : attrValue === 'false' ? false : attrValue;\n\n // Try to parse JSON where it's possible\n // I can get false positive here (eg. a selector '[data-attr]')\n // so put it under try/catch and let fail silently\n try {\n value =\n (firstChar == '{' && lastChar == '}') || (firstChar == '[' && lastChar == ']') ? JSON.parse(value) : value;\n } catch (e) {}\n\n return {\n name,\n value,\n };\n },\n\n /**\n * Extract component props from an attribute object\n * @param {Object} attr\n * @returns {Object} An object containing props and attributes without them\n */\n splitPropsFromAttr(attr: ObjectAny = {}) {\n const props: ObjectAny = {};\n const attrs: ObjectStrings = {};\n\n each(attr, (value, key) => {\n if (key.indexOf(this.modelAttrStart) === 0) {\n const propsResult = this.getPropAttribute(key, value);\n props[propsResult.name] = propsResult.value;\n } else {\n attrs[key] = value;\n }\n });\n\n return {\n props,\n attrs,\n };\n },\n\n /**\n * Parse style string to object\n * @param {string} str\n * @return {Object}\n * @example\n * var stl = ParserHtml.parseStyle('color:black; width:100px; test:value;');\n * console.log(stl);\n * // {color: 'black', width: '100px', test: 'value'}\n */\n parseStyle(str: string) {\n const result: Record = {};\n\n while (str.indexOf('/*') >= 0) {\n const start = str.indexOf('/*');\n const end = str.indexOf('*/') + 2;\n str = str.replace(str.slice(start, end), '');\n }\n\n const decls = str.split(';');\n\n for (let i = 0, len = decls.length; i < len; i++) {\n const decl = decls[i].trim();\n if (!decl) continue;\n const prop = decl.split(':');\n const key = prop[0].trim();\n const value = prop.slice(1).join(':').trim();\n\n // Support multiple values for the same key\n if (result[key]) {\n if (!isArray(result[key])) {\n result[key] = [result[key] as string];\n }\n\n (result[key] as string[]).push(value);\n } else {\n result[key] = value;\n }\n }\n\n return result;\n },\n\n /**\n * Parse class string to array\n * @param {string} str\n * @return {Array}\n * @example\n * var res = ParserHtml.parseClass('test1 test2 test3');\n * console.log(res);\n * // ['test1', 'test2', 'test3']\n */\n parseClass(str: string) {\n const result = [];\n const cls = str.split(' ');\n\n for (let i = 0, len = cls.length; i < len; i++) {\n const cl = cls[i].trim();\n if (!cl) continue;\n result.push(cl);\n }\n\n return result;\n },\n\n parseNodeAttr(node: HTMLElement, result?: ComponentDefinitionDefined) {\n const model = result || {};\n const attrs = node.attributes || [];\n const attrsLen = attrs.length;\n\n for (let i = 0; i < attrsLen; i++) {\n const nodeName = attrs[i].nodeName;\n let nodeValue: string | boolean = attrs[i].nodeValue!;\n\n if (nodeName == 'style') {\n model.style = this.parseStyle(nodeValue);\n } else if (nodeName == 'class') {\n model.classes = this.parseClass(nodeValue);\n } else if (nodeName == 'contenteditable') {\n continue;\n } else if (nodeName.indexOf(this.modelAttrStart) === 0) {\n const propsResult = this.getPropAttribute(nodeName, nodeValue);\n model[propsResult.name] = propsResult.value;\n } else {\n // @ts-ignore Check for attributes from props (eg. required, disabled)\n if (nodeValue === '' && node[nodeName] === true) {\n nodeValue = true;\n }\n\n if (!model.attributes) {\n model.attributes = {};\n }\n\n model.attributes[nodeName] = nodeValue;\n }\n }\n\n return model;\n },\n\n detectNode(node: HTMLElement, opts: ParseNodeOptions = {}) {\n const { compTypes } = this;\n let result: ComponentDefinitionDefined = {};\n\n if (compTypes) {\n const type = node.getAttribute?.(`${this.modelAttrStart}type`);\n\n // If the type is already defined, use it\n if (type) {\n result = { type };\n } else {\n // Find the component type\n for (let i = 0; i < compTypes.length; i++) {\n const compType = compTypes[i];\n let obj = compType.model.isComponent(node, opts);\n\n if (obj) {\n if (typeof obj !== 'object') {\n obj = { type: compType.id };\n }\n result = obj\n break;\n }\n }\n }\n }\n\n return result;\n },\n\n parseNode(node: HTMLElement, opts: ParseNodeOptions = {}) {\n const nodes = (node as HTMLTemplateElement).content?.childNodes || node.childNodes;\n const nodesLen = nodes.length;\n let model = this.detectNode(node, opts);\n\n if (!model.tagName) {\n const tag = node.tagName || '';\n const ns = node.namespaceURI || '';\n model.tagName = tag && ns === 'http://www.w3.org/1999/xhtml' ? tag.toLowerCase() : tag;\n }\n\n model = this.parseNodeAttr(node, model);\n\n // Check for custom void elements (valid in XML)\n if (!nodesLen && `${node.outerHTML}`.slice(-2) === '/>') {\n model.void = true;\n }\n\n // Check for nested elements but avoid it if already provided\n if (nodesLen && !model.components && !opts.skipChildren) {\n // Avoid infinite nested text nodes\n const firstChild = nodes[0];\n\n // If there is only one child and it's a TEXTNODE\n // just make it content of the current node\n if (nodesLen === 1 && firstChild.nodeType === 3) {\n !model.type && (model.type = 'text');\n model.components = {\n type: 'textnode',\n content: firstChild.nodeValue,\n };\n } else {\n model.components = this.parseNodes(node, {\n ...opts,\n inSvg: opts.inSvg || model.type === 'svg',\n });\n }\n }\n\n // If all children are texts and there is any textnode inside, the parent should\n // be text too otherwise it won't be possible to edit texnodes.\n const comps = model.components;\n if (!model.type && comps?.length) {\n const { textTypes = [], textTags = [] } = config;\n let allTxt = true;\n let foundTextNode = false;\n\n for (let i = 0; i < comps.length; i++) {\n const comp = comps[i];\n const cType = comp.type;\n\n if (!textTypes.includes(cType) && !textTags.includes(comp.tagName)) {\n allTxt = false;\n break;\n }\n\n if (cType === 'textnode') {\n foundTextNode = true;\n }\n }\n\n if (allTxt && foundTextNode) {\n model.type = 'text';\n }\n }\n\n return model;\n },\n\n /**\n * Get data from the node element\n * @param {HTMLElement} el DOM element to traverse\n * @return {Array}\n */\n parseNodes(el: HTMLElement, opts: ParseNodeOptions = {}) {\n const result: ComponentDefinitionDefined[] = [];\n const nodes = (el as HTMLTemplateElement).content?.childNodes || el.childNodes;\n const nodesLen = nodes.length;\n\n for (let i = 0; i < nodesLen; i++) {\n const node = nodes[i] as HTMLElement;\n const nodePrev = result[result.length - 1];\n const model = this.parseNode(node, opts);\n\n // Check if it's a text node and if it could be moved to the prevous one\n if (model.type === 'textnode') {\n if (nodePrev?.type === 'textnode') {\n nodePrev.content += model.content;\n continue;\n }\n\n // Throw away empty nodes (keep spaces)\n if (!opts.keepEmptyTextNodes) {\n const content = node.nodeValue;\n if (content != ' ' && !content!.trim()) {\n continue;\n }\n }\n }\n\n // If the tagName is empty and it's not a textnode, skip it\n if (!model.tagName && isUndefined(model.content)) {\n continue;\n }\n\n result.push(model);\n }\n\n return result;\n },\n\n /**\n * Parse HTML string to a desired model object\n * @param {string} str HTML string\n * @param {ParserCss} parserCss In case there is style tags inside HTML\n * @return {Object}\n */\n parse(str: string, parserCss?: any, opts: HTMLParserOptions = {}) {\n const conf = em?.get('Config') || {};\n const res: HTMLParseResult = { html: [] };\n const cf = { ...config, ...opts };\n const options = {\n ...config.optionsHtml,\n // @ts-ignore Support previous `configParser.htmlType` option\n htmlType: config.optionsHtml?.htmlType || config.htmlType,\n ...opts,\n };\n const { preParser, asDocument } = options;\n const input = isFunction(preParser) ? preParser(str, { editor: em?.getEditor()! }) : str;\n const parseRes = isFunction(cf.parserHtml) ? cf.parserHtml(input, options) : BrowserParserHtml(input, options);\n let root = parseRes as HTMLElement;\n const docEl = parseRes as Document;\n\n if (asDocument) {\n root = docEl.documentElement;\n res.doctype = doctypeToString(docEl.doctype);\n }\n\n const scripts = root.querySelectorAll('script');\n let i = scripts.length;\n\n // Support previous `configMain.allowScripts` option\n const allowScripts = !isUndefined(conf.allowScripts) ? conf.allowScripts : options.allowScripts;\n\n // Remove script tags\n if (!allowScripts) {\n while (i--) scripts[i].parentNode?.removeChild(scripts[i]);\n }\n\n // Remove unsafe attributes\n if (!options.allowUnsafeAttr || !options.allowUnsafeAttrValue) {\n this.__sanitizeNode(root, options);\n }\n\n // Detach style tags and parse them\n if (parserCss) {\n const styles = root.querySelectorAll('style');\n let j = styles.length;\n let styleStr = '';\n\n while (j--) {\n styleStr = styles[j].innerHTML + styleStr;\n styles[j].parentNode?.removeChild(styles[j]);\n }\n\n if (styleStr) res.css = parserCss.parse(styleStr);\n }\n\n em?.trigger(`${event}:root`, { input, root: root });\n let resHtml: HTMLParseResult['html'] = [];\n\n if (asDocument) {\n res.head = this.parseNode(docEl.head, cf);\n res.root = this.parseNodeAttr(root);\n resHtml = this.parseNode(docEl.body, cf);\n } else {\n const result = this.parseNodes(root, cf);\n // I have to keep it otherwise it breaks the DomComponents.addComponent (returns always array)\n resHtml = result.length === 1 && !cf.returnArray ? result[0] : result;\n }\n\n res.html = resHtml;\n em?.trigger(event, { input, output: res });\n\n return res;\n },\n\n __sanitizeNode(node: HTMLElement, opts: HTMLParserOptions) {\n const attrs = node.attributes || [];\n const nodes = node.childNodes || [];\n const toRemove: string[] = [];\n each(attrs, attr => {\n const name = attr.nodeName || '';\n const value = attr.nodeValue || '';\n !opts.allowUnsafeAttr && name.startsWith('on') && toRemove.push(name);\n !opts.allowUnsafeAttrValue && value.startsWith('javascript:') && toRemove.push(name);\n });\n toRemove.map(name => node.removeAttribute(name));\n each(nodes, node => this.__sanitizeNode(node as HTMLElement, opts));\n },\n };\n};\n\nexport default ParserHtml;\n","import { isArray, isString, keys } from 'underscore';\nimport { Model, ObjectAny, ObjectHash, SetOptions } from '../../common';\nimport ParserHtml from '../../parser/model/ParserHtml';\nimport Selectors from '../../selector_manager/model/Selectors';\nimport { shallowDiff } from '../../utils/mixins';\n\nexport type StyleProps = Record;\n\nexport type UpdateStyleOptions = SetOptions & {\n partial?: boolean;\n addStyle?: StyleProps;\n inline?: boolean;\n noEvent?: boolean;\n};\n\nconst parserHtml = ParserHtml();\n\nexport const getLastStyleValue = (value: string | string[]) => {\n return isArray(value) ? value[value.length - 1] : value;\n};\n\nexport default class StyleableModel extends Model {\n /**\n * Forward style string to `parseStyle` to be parse to an object\n * @param {string} str\n * @returns\n */\n parseStyle(str: string) {\n return parserHtml.parseStyle(str);\n }\n\n /**\n * To trigger the style change event on models I have to\n * pass a new object instance\n * @param {Object} prop\n * @return {Object}\n */\n extendStyle(prop: ObjectAny): ObjectAny {\n return { ...this.getStyle(), ...prop };\n }\n\n /**\n * Get style object\n * @return {Object}\n */\n getStyle(prop?: string | ObjectAny): StyleProps {\n const style = this.get('style') || {};\n const result: ObjectAny = { ...style };\n return prop && isString(prop) ? result[prop] : result;\n }\n\n /**\n * Set new style object\n * @param {Object|string} prop\n * @param {Object} opts\n * @return {Object} Applied properties\n */\n setStyle(prop: string | ObjectAny = {}, opts: UpdateStyleOptions = {}) {\n if (isString(prop)) {\n prop = this.parseStyle(prop);\n }\n\n const propOrig = this.getStyle(opts);\n\n if (opts.partial || opts.avoidStore) {\n opts.avoidStore = true;\n prop.__p = true;\n } else {\n delete prop.__p;\n }\n\n const propNew = { ...prop };\n const newStyle = { ...propNew };\n // Remove empty style properties\n keys(newStyle).forEach(prop => {\n if (newStyle[prop] === '') {\n delete newStyle[prop];\n }\n });\n this.set('style', newStyle, opts as any);\n const diff = shallowDiff(propOrig, propNew);\n // Delete the property used for partial updates\n delete diff.__p;\n keys(diff).forEach(pr => {\n // @ts-ignore\n const { em } = this;\n if (opts.noEvent) return;\n this.trigger(`change:style:${pr}`);\n if (em) {\n em.trigger('styleable:change', this, pr, opts);\n em.trigger(`styleable:change:${pr}`, this, pr, opts);\n }\n });\n\n return propNew;\n }\n\n /**\n * Add style property\n * @param {Object|string} prop\n * @param {string} value\n * @example\n * this.addStyle({color: 'red'});\n * this.addStyle('color', 'blue');\n */\n addStyle(prop: string | ObjectAny, value: any = '', opts: UpdateStyleOptions = {}) {\n if (typeof prop == 'string') {\n prop = {\n [prop]: value,\n };\n } else {\n opts = value || {};\n }\n\n opts.addStyle = prop;\n prop = this.extendStyle(prop);\n this.setStyle(prop, opts);\n }\n\n /**\n * Remove style property\n * @param {string} prop\n */\n removeStyle(prop: string) {\n let style = this.getStyle();\n delete style[prop];\n this.setStyle(style);\n }\n\n /**\n * Returns string of style properties\n * @param {Object} [opts={}] Options\n * @return {String}\n */\n styleToString(opts: ObjectAny = {}) {\n const result: string[] = [];\n const style = this.getStyle(opts);\n const imp = opts.important;\n\n for (let prop in style) {\n const important = isArray(imp) ? imp.indexOf(prop) >= 0 : imp;\n const firstChars = prop.substring(0, 2);\n const isPrivate = firstChars === '__';\n\n if (isPrivate) continue;\n\n const value = style[prop];\n const values = isArray(value) ? (value as string[]) : [value];\n\n values.forEach((val: string) => {\n const value = `${val}${important ? ' !important' : ''}`;\n value && result.push(`${prop}:${value};`);\n });\n }\n\n return result.join('');\n }\n\n getSelectors() {\n return (this.get('selectors') || this.get('classes')) as Selectors;\n }\n\n getSelectorsString(opts?: ObjectAny) {\n // @ts-ignore\n return this.selectorsToString ? this.selectorsToString(opts) : this.getSelectors().getFullString();\n }\n\n // @ts-ignore\n // _validate(attr, opts) {\n // return true;\n // }\n}\n","import { isArray, isString, keys } from 'underscore';\nimport Component, { keySymbol, keySymbolOvrd, keySymbols } from './Component';\nimport { SymbolToUpOptions } from './types';\nimport { isEmptyObj } from '../../utils/mixins';\nimport Components from './Components';\n\nexport const isSymbolMain = (cmp: Component) => isArray(cmp.get(keySymbols));\n\nexport const isSymbolInstance = (cmp: Component) => !!cmp.get(keySymbol);\n\nexport const isSymbol = (cmp: Component) => !!(isSymbolMain(cmp) || isSymbolInstance(cmp));\n\nexport const isSymbolRoot = (symbol: Component) => {\n const parent = symbol.parent();\n return isSymbol(symbol) && (!parent || !isSymbol(parent));\n};\n\nexport const isSymbolNested = (symbol: Component) => {\n if (!isSymbol(symbol)) return false;\n const symbTopSelf = getSymbolTop(isSymbolMain(symbol) ? symbol : getSymbolMain(symbol)!);\n const symbTop = getSymbolTop(symbol);\n const symbTopMain = isSymbolMain(symbTop) ? symbTop : getSymbolMain(symbTop);\n return symbTopMain !== symbTopSelf;\n};\n\nexport const initSymbol = (symbol: Component) => {\n if (symbol.__symbReady) return;\n symbol.on('change', symbol.__upSymbProps);\n symbol.__symbReady = true;\n};\n\nexport const getSymbolMain = (symbol: Component): Component | undefined => {\n let result = symbol.get(keySymbol);\n\n if (result && isString(result)) {\n const ref = symbol.__getAllById()[result];\n if (ref) {\n result = ref;\n symbol.set(keySymbol, ref);\n } else {\n result = 0;\n }\n }\n\n return result || undefined;\n};\n\nexport const getSymbolInstances = (symbol?: Component): Component[] | undefined => {\n let symbs = symbol?.get(keySymbols);\n\n if (symbs && isArray(symbs)) {\n symbs.forEach((symb, idx) => {\n if (symb && isString(symb)) {\n symbs[idx] = symbol!.__getAllById()[symb];\n }\n });\n symbs = symbs.filter(symb => symb && !isString(symb));\n }\n\n return symbs || undefined;\n};\n\nexport const isSymbolOverride = (symbol?: Component, prop = '') => {\n const ovrd = symbol?.get(keySymbolOvrd);\n const [prp] = prop.split(':');\n const props = prop !== prp ? [prop, prp] : [prop];\n return ovrd === true || (isArray(ovrd) && props.some(p => ovrd.indexOf(p) >= 0));\n};\n\nexport const getSymbolsToUpdate = (symb: Component, opts: SymbolToUpOptions = {}) => {\n let result: Component[] = [];\n const { changed } = opts;\n\n if (\n opts.fromInstance ||\n opts.noPropagate ||\n opts.fromUndo ||\n // Avoid updating others if the current component has override\n (changed && isSymbolOverride(symb, changed))\n ) {\n return result;\n }\n\n const symbols = getSymbolInstances(symb) || [];\n const symbol = getSymbolMain(symb);\n const all = symbol ? [symbol, ...(getSymbolInstances(symbol) || [])] : symbols;\n result = all\n .filter(s => s !== symb)\n // Avoid updating those with override\n .filter(s => !(changed && isSymbolOverride(s, changed)));\n\n return result;\n};\n\nexport const getSymbolTop = (symbol: Component, opts?: any) => {\n let result = symbol;\n let parent = symbol.parent(opts);\n\n // while (parent && (isSymbolMain(parent) || getSymbol(parent))) {\n while (parent && isSymbol(parent)) {\n result = parent;\n parent = parent.parent(opts);\n }\n\n return result;\n};\n\nexport const detachSymbolInstance = (symbol: Component, opts: { skipRefs?: boolean } = {}) => {\n const symbolMain = getSymbolMain(symbol);\n const symbs = symbolMain && getSymbolInstances(symbolMain);\n !opts.skipRefs &&\n symbs &&\n symbolMain.set(\n keySymbols,\n symbs.filter(s => s !== symbol)\n );\n symbol.set(keySymbol, 0);\n symbol.components().forEach(s => detachSymbolInstance(s, opts));\n};\n\nexport const logSymbol = (symb: Component, type: string, toUp: Component[], opts: any = {}) => {\n const symbol = getSymbolMain(symb);\n const symbols = getSymbolInstances(symb);\n\n if (!symbol && !symbols) {\n return;\n }\n\n symb.em.log(type, { model: symb, toUp, context: 'symbols', opts });\n};\n\nexport const updateSymbolProps = (symbol: Component, opts: SymbolToUpOptions = {}) => {\n const changed = symbol.changedAttributes() || {};\n const attrs = changed.attributes || {};\n delete changed.status;\n delete changed.open;\n delete changed[keySymbols];\n delete changed[keySymbol];\n delete changed[keySymbolOvrd];\n delete changed.attributes;\n delete attrs.id;\n\n if (!isEmptyObj(attrs)) {\n changed.attributes = attrs;\n }\n\n if (!isEmptyObj(changed)) {\n const toUp = getSymbolsToUpdate(symbol, opts);\n // Avoid propagating overrides to other symbols\n keys(changed).map(prop => {\n if (isSymbolOverride(symbol, prop)) delete changed[prop];\n });\n\n logSymbol(symbol, 'props', toUp, { opts, changed });\n toUp.forEach(child => {\n const propsChanged = { ...changed };\n // Avoid updating those with override\n keys(propsChanged).map(prop => {\n if (isSymbolOverride(child, prop)) delete propsChanged[prop];\n });\n child.set(propsChanged, { fromInstance: symbol, ...opts });\n });\n }\n};\n\nexport const updateSymbolCls = (symbol: Component, opts: any = {}) => {\n const toUp = getSymbolsToUpdate(symbol, opts);\n logSymbol(symbol, 'classes', toUp, { opts });\n toUp.forEach(child => {\n // @ts-ignore This will propagate the change up to __upSymbProps\n child.set('classes', symbol.get('classes'), { fromInstance: symbol });\n });\n symbol.__changesUp(opts);\n};\n\nexport const updateSymbolComps = (symbol: Component, m: Component, c: Components, o: any) => {\n const optUp = o || c || {};\n const { fromInstance, fromUndo } = optUp;\n const toUpOpts = { fromInstance, fromUndo };\n const isTemp = m.opt.temporary;\n\n // Reset\n if (!o) {\n const coll = m as unknown as Components;\n const toUp = getSymbolsToUpdate(symbol, {\n ...toUpOpts,\n changed: 'components:reset',\n });\n const cmps = coll.models;\n const newSymbols = new Set();\n logSymbol(symbol, 'reset', toUp, { components: cmps });\n\n toUp.forEach(rel => {\n const relCmps = rel.components();\n const toReset = cmps.map((cmp, i) => {\n // This particular case here is to handle reset from `resetFromString`\n // where we can receive an array of regulat components or already\n // existing symbols (updated already before reset)\n if (!isSymbol(cmp) || newSymbols.has(cmp)) {\n newSymbols.add(cmp);\n return cmp.clone({ symbol: true });\n }\n return relCmps.at(i);\n });\n relCmps.reset(toReset, { fromInstance: symbol, ...c } as any);\n });\n // Add\n } else if (o.add) {\n let addedInstances: Component[] = [];\n const isMainSymb = !!getSymbolInstances(symbol);\n const toUp = getSymbolsToUpdate(symbol, {\n ...toUpOpts,\n changed: 'components:add',\n });\n if (toUp.length) {\n const addSymb = getSymbolMain(m);\n addedInstances = (addSymb ? getSymbolInstances(addSymb) : getSymbolInstances(m)) || [];\n addedInstances = [...addedInstances];\n addedInstances.push(addSymb ? addSymb : m);\n }\n !isTemp &&\n logSymbol(symbol, 'add', toUp, {\n opts: o,\n addedInstances: addedInstances.map(c => c.cid),\n added: m.cid,\n });\n // Here, before appending a new symbol, I have to ensure there are no previously\n // created symbols (eg. used mainly when drag components around)\n toUp.forEach(symb => {\n const symbTop = getSymbolTop(symb);\n const symbPrev = addedInstances.filter(addedInst => {\n const addedTop = getSymbolTop(addedInst, { prev: 1 });\n return symbTop && addedTop && addedTop === symbTop;\n })[0];\n const toAppend = symbPrev || m.clone({ symbol: true, symbolInv: isMainSymb });\n symb.append(toAppend, { fromInstance: symbol, ...o });\n });\n // Remove\n } else {\n // Remove instance reference from the symbol\n const symb = getSymbolMain(m);\n symb &&\n !o.temporary &&\n symb.set(\n keySymbols,\n getSymbolInstances(symb)!.filter(i => i !== m)\n );\n\n // Propagate remove only if the component is an inner symbol\n if (!isSymbolRoot(m) && !o.skipRefsUp) {\n const changed = 'components:remove';\n const { index } = o;\n const parent = m.parent();\n const opts = { fromInstance: m, ...o };\n const isSymbNested = isSymbolRoot(m);\n let toUpFn = (symb: Component) => {\n const symbPrnt = symb.parent();\n symbPrnt && !isSymbolOverride(symbPrnt, changed) && symb.remove(opts);\n };\n // Check if the parent allows the removing\n let toUp = !isSymbolOverride(parent, changed) ? getSymbolsToUpdate(m, toUpOpts) : [];\n\n if (isSymbNested) {\n toUp = parent! && getSymbolsToUpdate(parent, { ...toUpOpts, changed })!;\n toUpFn = symb => {\n const toRemove = symb.components().at(index);\n toRemove && toRemove.remove({ fromInstance: parent, ...opts });\n };\n }\n\n !isTemp &&\n logSymbol(symbol, 'remove', toUp, {\n opts: o,\n removed: m.cid,\n isSymbNested,\n });\n toUp.forEach(toUpFn);\n }\n }\n\n symbol.__changesUp(optUp);\n};\n","import { isEmpty, isArray, isString, isFunction, each, includes, extend, flatten, keys } from 'underscore';\nimport Component from './Component';\nimport { AddOptions, Collection, OptionAsDocument } from '../../common';\nimport { DomComponentsConfig } from '../config/config';\nimport EditorModel from '../../editor/model/Editor';\nimport ComponentManager from '..';\nimport CssRule from '../../css_composer/model/CssRule';\n\nimport {\n ComponentAdd,\n ComponentAddType,\n ComponentDefinition,\n ComponentDefinitionDefined,\n ComponentProperties,\n} from './types';\nimport ComponentText from './ComponentText';\nimport ComponentWrapper from './ComponentWrapper';\nimport { ComponentsEvents } from '../types';\nimport { isSymbolInstance, isSymbolRoot, updateSymbolComps } from './SymbolUtils';\n\nexport const getComponentIds = (cmp?: Component | Component[] | Components, res: string[] = []) => {\n if (!cmp) return [];\n const cmps = (isArray(cmp) || isFunction((cmp as Components).map) ? cmp : [cmp]) as Component[];\n cmps.map(cmp => {\n res.push(cmp.getId());\n getComponentIds(cmp.components().models, res);\n });\n return res;\n};\n\nconst getComponentsFromDefs = (\n items: ReturnType,\n all: ReturnType = {},\n opts: any = {}\n) => {\n opts.visitedCmps = opts.visitedCmps || {};\n const { visitedCmps } = opts;\n const itms = isArray(items) ? items : [items];\n\n return itms.map(item => {\n const { attributes = {}, components, tagName, style } = item;\n let { id, draggable, ...restAttr } = attributes;\n let result = item;\n\n if (id) {\n // Detect components with the same ID\n if (!visitedCmps[id]) {\n visitedCmps[id] = [];\n\n // Update the component if exists already\n if (all[id]) {\n result = all[id] as any;\n const cmp = result as unknown as Component;\n tagName && cmp.set({ tagName }, { ...opts, silent: true });\n keys(restAttr).length && cmp.addAttributes(restAttr, { ...opts });\n keys(style).length && cmp.addStyle(style, opts);\n }\n } else {\n // Found another component with the same ID, treat it as a new component\n visitedCmps[id].push(result);\n id = Component.getNewId(all);\n result.attributes.id = id;\n }\n }\n\n if (components) {\n const newComponents = getComponentsFromDefs(components, all);\n\n if (isFunction(result.components)) {\n const cmps = result.components();\n cmps.length > 0 && cmps.reset(newComponents, opts);\n } else {\n result.components = newComponents;\n }\n }\n\n return result;\n });\n};\n\nexport interface ComponentsOptions {\n em: EditorModel;\n config?: DomComponentsConfig;\n domc?: ComponentManager;\n}\n\ninterface AddComponentOptions extends AddOptions {\n previousModels?: Component[];\n keepIds?: string[];\n}\n\nexport default class Components extends Collection {\n opt!: ComponentsOptions;\n config?: DomComponentsConfig;\n em: EditorModel;\n domc?: ComponentManager;\n parent?: Component;\n\n constructor(models: any, opt: ComponentsOptions) {\n super(models, opt);\n this.opt = opt;\n this.listenTo(this, 'add', this.onAdd);\n this.listenTo(this, 'remove', this.removeChildren);\n this.listenTo(this, 'reset', this.resetChildren);\n const { em, config } = opt;\n this.config = config;\n this.em = em;\n this.domc = opt.domc || em?.Components;\n }\n\n get events() {\n return this.domc?.events!;\n }\n\n resetChildren(models: Components, opts: { previousModels?: Component[]; keepIds?: string[] } = {}) {\n const coll = this;\n const prev = opts.previousModels || [];\n const toRemove = prev.filter(prev => !models.get(prev.cid));\n const newIds = getComponentIds(models);\n const idsToKeep = getComponentIds(prev).filter(pr => newIds.indexOf(pr) >= 0);\n opts.keepIds = (opts.keepIds || []).concat(idsToKeep);\n toRemove.forEach(md => this.removeChildren(md, coll, opts));\n models.each(model => this.onAdd(model));\n }\n\n resetFromString(input = '', opts: { visitedCmps?: Record; keepIds?: string[] } = {}) {\n opts.keepIds = getComponentIds(this);\n const { domc, em, parent } = this;\n const cssc = em?.Css;\n const allByID = domc?.allById() || {};\n const parsed = this.parseString(input, opts);\n const newCmps = getComponentsFromDefs(parsed, allByID, opts);\n const { visitedCmps = {} } = opts;\n\n // Clone styles for duplicated components\n Object.keys(visitedCmps).forEach(id => {\n const cmps = visitedCmps[id];\n if (cmps.length) {\n // Get all available rules of the component\n const rulesToClone = cssc?.getRules(`#${id}`) || [];\n\n if (rulesToClone.length) {\n cmps.forEach(cmp => {\n rulesToClone.forEach(rule => {\n const newRule = rule.clone();\n // @ts-ignore\n newRule.set('selectors', [`#${cmp.attributes.id}`]);\n cssc!.getAll().add(newRule);\n });\n });\n }\n }\n });\n\n this.reset(newCmps, opts as any);\n em?.trigger('component:content', parent, opts, input);\n (parent as ComponentText).__checkInnerChilds?.();\n }\n\n removeChildren(removed: Component, coll?: Components, opts: any = {}) {\n // Removing a parent component can cause this function\n // to be called with an already removed child element\n if (!removed) {\n return;\n }\n\n const { domc, em } = this;\n const isTemp = opts.temporary || opts.fromUndo;\n removed.prevColl = this; // This one is required for symbols\n\n if (!isTemp) {\n // Remove the component from the global list\n const id = removed.getId();\n const sels = em.Selectors.getAll();\n const rules = em.Css.getAll();\n const canRemoveStyle = (opts.keepIds || []).indexOf(id) < 0;\n const allByID = domc ? domc.allById() : {};\n delete allByID[id];\n\n // Remove all component related styles\n const rulesRemoved = (\n canRemoveStyle\n ? rules.remove(\n rules.filter(r => r.getSelectors().getFullString() === `#${id}`),\n opts\n )\n : []\n ) as CssRule[];\n\n // Clean selectors\n sels.remove(rulesRemoved.map(rule => rule.getSelectors().at(0)));\n\n if (!removed.opt.temporary) {\n em.Commands.run('core:component-style-clear', { target: removed });\n removed.removed();\n removed.trigger('removed');\n em.trigger(ComponentsEvents.remove, removed);\n\n if (domc && isSymbolInstance(removed) && isSymbolRoot(removed)) {\n domc.symbols.__trgEvent(domc.events.symbolInstanceRemove, { component: removed }, true);\n }\n }\n\n const inner = removed.components();\n inner.forEach(it => {\n updateSymbolComps(it, it, inner, { ...opts, skipRefsUp: true });\n this.removeChildren(it, coll, opts);\n });\n }\n\n // Remove stuff registered in DomComponents.handleChanges\n const inner = removed.components();\n em.stopListening(inner);\n em.stopListening(removed);\n em.stopListening(removed.get('classes'));\n removed.__postRemove();\n }\n\n /** @ts-ignore */\n model(attrs: Partial, options: any) {\n const { opt } = options.collection;\n const em = opt.em as EditorModel;\n let model;\n const df = em.Components.componentTypes;\n options.em = em;\n options.config = opt.config;\n options.componentTypes = df;\n options.domc = opt.domc;\n\n for (let it = 0; it < df.length; it++) {\n const dfId = df[it].id;\n if (dfId == attrs.type) {\n model = df[it].model;\n break;\n }\n }\n\n // If no model found, get the default one\n if (!model) {\n model = df[df.length - 1].model;\n em &&\n attrs.type &&\n em.logWarning(`Component type '${attrs.type}' not found`, {\n attrs,\n options,\n });\n }\n\n return new model(attrs, options) as Component;\n }\n\n parseString(value: string, opt: AddOptions & OptionAsDocument & { temporary?: boolean; keepIds?: string[] } = {}) {\n const { em, domc, parent } = this;\n const asDocument = opt.asDocument && parent?.is('wrapper');\n const cssc = em.Css;\n const parsed = em.Parser.parseHtml(value, { asDocument });\n let components = parsed.html;\n\n if (asDocument) {\n const root = parent as ComponentWrapper;\n const { components: bodyCmps, ...restBody } = (parsed.html as ComponentDefinitionDefined) || {};\n const { components: headCmps, ...restHead } = parsed.head || {};\n components = bodyCmps!;\n root.set(restBody as any, opt);\n root.head.set(restHead as any, opt);\n root.head.components(headCmps, opt);\n root.docEl.set(parsed.root as any, opt);\n root.set({ doctype: parsed.doctype });\n }\n\n // We need this to avoid duplicate IDs\n Component.checkId(components, parsed.css, domc!.componentsById, opt);\n\n if (parsed.css && cssc && !opt.temporary) {\n const { at, ...optsToPass } = opt;\n cssc.addCollection(parsed.css, {\n ...optsToPass,\n extend: 1,\n });\n }\n\n return components;\n }\n\n add(model: Exclude, opt?: AddComponentOptions): Component;\n add(models: ComponentAddType[], opt?: AddComponentOptions): Component[];\n add(models: ComponentAdd, opt?: AddComponentOptions): Component | Component[];\n add(models: unknown, opt: AddComponentOptions = {}): unknown {\n if (models == undefined) return;\n\n opt.keepIds = [...(opt.keepIds || []), ...getComponentIds(opt.previousModels)];\n\n if (isString(models)) {\n models = this.parseString(models, opt)!;\n } else if (isArray(models)) {\n models.forEach((item: string, index: number) => {\n if (isString(item)) {\n const nodes = this.parseString(item, opt);\n (models as any)[index] = isArray(nodes) && !nodes.length ? null : nodes;\n }\n });\n }\n\n const processedModels = (isArray(models) ? models : [models])\n .filter(Boolean)\n .map((model: any) => this.processDef(model));\n\n models = isArray(models) ? flatten(processedModels as any, 1) : processedModels[0];\n\n return super.add(models as any, opt);\n }\n\n /**\n * Process component definition.\n */\n processDef(mdl: Component | ComponentDefinition | ComponentDefinitionDefined) {\n // Avoid processing Models\n if (mdl.cid && mdl.ccid) return mdl;\n const { em, config = {} } = this;\n const { processor } = config;\n let model = mdl;\n\n if (processor) {\n model = { ...model }; // Avoid 'Cannot delete property ...'\n const modelPr = processor(model);\n if (modelPr) {\n //@ts-ignore\n each(model, (val, key) => delete model[key]);\n extend(model, modelPr);\n }\n }\n\n // React JSX preset\n //@ts-ignore\n if (model.$$typeof && typeof model.props == 'object') {\n model = { ...model };\n model.props = { ...model.props };\n const domc = em.Components;\n const parser = em.Parser;\n const { parserHtml } = parser;\n\n each(model, (value, key) => {\n //@ts-ignore\n if (!includes(['props', 'type'], key)) delete model[key];\n });\n const { props } = model;\n const comps = props.children;\n delete props.children;\n delete model.props;\n const res = parserHtml.splitPropsFromAttr(props);\n model.attributes = res.attrs;\n\n if (comps) {\n model.components = comps;\n }\n if (!model.type) {\n model.type = 'textnode';\n } else if (!domc.getType(model.type)) {\n model.tagName = model.type;\n delete model.type;\n }\n\n extend(model, res.props);\n }\n\n return model;\n }\n\n onAdd(model: Component, c?: any, opts: { temporary?: boolean } = {}) {\n const { domc, em } = this;\n const style = model.getStyle();\n const avoidInline = em && em.getConfig().avoidInlineStyle;\n domc && domc.Component.ensureInList(model);\n\n if (!isEmpty(style) && !avoidInline && em && em.getConfig().forceClass && !opts.temporary) {\n const name = model.cid;\n em.Css.setClassRule(name, style);\n model.setStyle({});\n model.addClass(name);\n }\n\n model.__postAdd({ recursive: true });\n\n if (em && !opts.temporary) {\n const triggerAdd = (model: Component) => {\n em.trigger(ComponentsEvents.add, model, opts);\n model.components().forEach(comp => triggerAdd(comp));\n };\n triggerAdd(model);\n\n if (domc && isSymbolInstance(model) && isSymbolRoot(model)) {\n domc.symbols.__trgEvent(domc.events.symbolInstanceAdd, { component: model }, true);\n }\n }\n }\n}\n","import { result, forEach, keys } from 'underscore';\nimport { Model } from '../../common';\nimport EditorModel from '../../editor/model/Editor';\n\nconst TYPE_CLASS = 1;\nconst TYPE_ID = 2;\n\nexport interface SelectorProps {\n name: string;\n label?: string;\n type?: number;\n active?: boolean;\n private?: boolean;\n protected?: boolean;\n}\n\n/**\n * @typedef Selector\n * @property {String} name Selector name, eg. `my-class`\n * @property {String} label Selector label, eg. `My Class`\n * @property {Number} [type=1] Type of the selector. 1 (class) | 2 (id)\n * @property {Boolean} [active=true] If not active, it's not selectable by the Style Manager.\n * @property {Boolean} [private=false] If true, it can't be seen by the Style Manager, but it will be rendered in the canvas and in export code.\n * @property {Boolean} [protected=false] If true, it can't be removed from the attached component.\n */\nexport default class Selector extends Model {\n defaults() {\n return {\n name: '',\n label: '',\n type: TYPE_CLASS,\n active: true,\n private: false,\n protected: false,\n _undo: true,\n };\n }\n\n // Type selectors: https://developer.mozilla.org/it/docs/Web/CSS/CSS_Selectors\n static readonly TYPE_CLASS = TYPE_CLASS;\n static readonly TYPE_ID = TYPE_ID;\n\n em: EditorModel;\n\n /**\n * @hideconstructor\n */\n constructor(props: any, opts: any = {}) {\n super(props, opts);\n const { config = {} } = opts;\n const name = this.get('name');\n const label = this.get('label');\n\n if (!name) {\n this.set('name', label);\n } else if (!label) {\n this.set('label', name);\n }\n\n const namePreEsc = this.get('name')!;\n const { escapeName } = config;\n const nameEsc = escapeName ? escapeName(namePreEsc) : Selector.escapeName(namePreEsc);\n this.set('name', nameEsc);\n this.em = opts.em;\n }\n\n isId() {\n return this.get('type') === TYPE_ID;\n }\n\n isClass() {\n return this.get('type') === TYPE_CLASS;\n }\n\n getFullName(opts: any = {}) {\n const { escape } = opts;\n const name = this.get('name');\n let pfx = '';\n\n switch (this.get('type')) {\n case TYPE_CLASS:\n pfx = '.';\n break;\n case TYPE_ID:\n pfx = '#';\n break;\n }\n\n return pfx + (escape ? escape(name) : name);\n }\n\n /**\n * Get selector as a string.\n * @returns {String}\n * @example\n * // Given such selector: { name: 'my-selector', type: 2 }\n * console.log(selector.toString());\n * // -> `#my-selector`\n */\n toString() {\n return this.getFullName();\n }\n\n /**\n * Get selector name.\n * @returns {String}\n * @example\n * // Given such selector: { name: 'my-selector', label: 'My selector' }\n * console.log(selector.getName());\n * // -> `my-selector`\n */\n getName() {\n return this.get('name') || '';\n }\n\n /**\n * Get selector label.\n * @returns {String}\n * @example\n * // Given such selector: { name: 'my-selector', label: 'My selector' }\n * console.log(selector.getLabel());\n * // -> `My selector`\n */\n getLabel() {\n return this.get('label') || '';\n }\n\n /**\n * Update selector label.\n * @param {String} label New label\n * @example\n * // Given such selector: { name: 'my-selector', label: 'My selector' }\n * selector.setLabel('New Label')\n * console.log(selector.getLabel());\n * // -> `New Label`\n */\n setLabel(label: string) {\n return this.set('label', label);\n }\n\n /**\n * Get selector active state.\n * @returns {Boolean}\n */\n getActive() {\n return !!this.get('active');\n }\n\n /**\n * Update selector active state.\n * @param {Boolean} value New active state\n */\n setActive(value: boolean) {\n return this.set('active', value);\n }\n\n toJSON(opts = {}) {\n const { em } = this;\n let obj = Model.prototype.toJSON.call(this, [opts]);\n const defaults = result(this, 'defaults');\n\n if (em && em.getConfig().avoidDefaults) {\n forEach(defaults, (value, key) => {\n if (obj[key] === value) {\n delete obj[key];\n }\n });\n\n if (obj.label === obj.name) {\n delete obj.label;\n }\n\n const objLen = keys(obj).length;\n\n if (objLen === 1 && obj.name) {\n obj = obj.name;\n }\n\n if (objLen === 2 && obj.name && obj.type) {\n obj = this.getFullName();\n }\n }\n\n return obj;\n }\n\n /**\n * Escape string\n * @param {string} name\n * @return {string}\n * @private\n */\n static escapeName(name: string) {\n return `${name}`.trim().replace(/([^a-z0-9\\w\\-\\\\:@\\\\/#()\\.%\\+\\[\\]]+)/gi, '-');\n }\n}\n\nSelector.prototype.idAttribute = 'name';\n","import { filter } from 'underscore';\nimport { Collection } from '../../common';\nimport Selector from './Selector';\n\nconst combine = (tail: string[], curr: string): string[] => {\n return tail.reduce(\n (acc, item, n) => {\n return acc.concat(combine(tail.slice(n + 1), `${curr}${item}`));\n },\n [curr]\n );\n};\n\nexport interface FullNameOptions {\n combination?: boolean;\n array?: boolean;\n}\n\nexport default class Selectors extends Collection {\n modelId(attr: any) {\n return `${attr.name}_${attr.type || Selector.TYPE_CLASS}`;\n }\n\n getStyleable() {\n return filter(this.models, item => item.getActive() && !item.get('private'));\n }\n\n getValid({ noDisabled }: any = {}) {\n return filter(this.models, item => !item.get('private')).filter(item => (noDisabled ? item.get('active') : 1));\n }\n\n getFullString(collection?: Selector[] | null, opts: { sort?: boolean } = {}) {\n const result: string[] = [];\n const coll = collection || this;\n coll.forEach(selector => result.push(selector.getFullName(opts)));\n opts.sort && result.sort();\n return result.join('').trim();\n }\n\n getFullName(opts: T = {} as T) {\n const { combination, array } = opts;\n let result: string[] = [];\n const sels = this.map(s => s.getFullName(opts)).sort();\n\n if (combination) {\n sels.forEach((sel, n) => {\n result = result.concat(combine(sels.slice(n + 1), sel));\n });\n } else {\n result = sels;\n }\n\n return (array ? result : combination ? result.join(',') : result.join('')) as T['array'] extends true\n ? string[]\n : string;\n }\n}\n\nSelectors.prototype.model = Selector;\n","import { Model } from '../common';\nimport CategoryView from './ModuleCategoryView';\n\nexport interface CategoryProperties {\n /**\n * Category id.\n */\n id: string;\n /**\n * Category label.\n */\n label: string;\n /**\n * Category open state.\n * @default true\n */\n open?: boolean;\n /**\n * Category order.\n */\n order?: string | number;\n /**\n * Category attributes.\n * @default {}\n */\n attributes?: Record;\n}\n\nexport interface ItemsByCategory {\n category?: Category;\n items: T[];\n}\n\nexport interface ModelWithCategory {\n category?: Category;\n}\n\nexport default class Category extends Model {\n view?: CategoryView;\n\n defaults() {\n return {\n id: '',\n label: '',\n open: true,\n attributes: {},\n };\n }\n\n getId() {\n return this.get('id')!;\n }\n\n getLabel() {\n return this.get('label')!;\n }\n}\n\nexport function getItemsByCategory(allItems: T[]) {\n const categorySet = new Set();\n const categoryMap = new Map();\n const emptyItem: ItemsByCategory = { items: [] };\n\n allItems.forEach(item => {\n const { category } = item;\n\n if (category) {\n categorySet.add(category);\n const categoryItems = categoryMap.get(category);\n\n if (categoryItems) {\n categoryItems.push(item);\n } else {\n categoryMap.set(category, [item]);\n }\n } else {\n emptyItem.items.push(item);\n }\n });\n\n const categoryWithItems = Array.from(categorySet).map(category => ({\n category,\n items: categoryMap.get(category) || [],\n }));\n\n return [...categoryWithItems, emptyItem];\n}\n","import { isString } from 'underscore';\nimport { Collection, Model } from '../common';\nimport Categories from './ModuleCategories';\nimport Category, { CategoryProperties } from './ModuleCategory';\nimport { isObject } from '../utils/mixins';\n\ninterface ModelWithCategoryProps {\n category?: string | CategoryProperties;\n}\n\nconst CATEGORY_KEY = 'category';\n\nexport abstract class CollectionWithCategories> extends Collection {\n abstract getCategories(): Categories;\n\n initCategory(model: T) {\n let category = model.get(CATEGORY_KEY);\n const isDefined = category instanceof Category;\n\n // Ensure the category exists and it's not already initialized\n if (category && !isDefined) {\n if (isString(category)) {\n category = { id: category, label: category };\n } else if (isObject(category) && !category.id) {\n category.id = category.label;\n }\n\n const catModel = this.getCategories().add(category);\n model.set(CATEGORY_KEY, catModel as any, { silent: true });\n return catModel;\n } else if (isDefined) {\n const catModel = category as unknown as Category;\n this.getCategories().add(catModel);\n return catModel;\n }\n }\n}\n","import { isArray, isString } from 'underscore';\nimport { AddOptions, Collection } from '../common';\nimport { normalizeKey } from '../utils/mixins';\nimport EditorModel from '../editor/model/Editor';\nimport Category, { CategoryProperties } from './ModuleCategory';\n\ntype CategoryCollectionParams = ConstructorParameters>;\n\ninterface CategoryOptions {\n events?: { update?: string };\n em?: EditorModel;\n}\n\nexport default class Categories extends Collection {\n constructor(models?: CategoryCollectionParams[0], opts: CategoryOptions = {}) {\n super(models, opts);\n const { events, em } = opts;\n const evUpdate = events?.update;\n if (em) {\n evUpdate &&\n this.on('change', (category, options) =>\n em.trigger(evUpdate, { category, changes: category.changedAttributes(), options })\n );\n }\n }\n\n /** @ts-ignore */\n add(model: (CategoryProperties | Category)[] | CategoryProperties | Category, opts?: AddOptions) {\n const models = isArray(model) ? model : [model];\n models.forEach(md => md && (md.id = normalizeKey(`${md.id}`)));\n return super.add(model, opts);\n }\n\n get(id: string | Category) {\n return super.get(isString(id) ? normalizeKey(id) : id);\n }\n}\n\nCategories.prototype.model = Category;\n","import { CategoryProperties, ItemsByCategory } from '../abstract/ModuleCategory';\nimport Component from '../dom_components/model/Component';\nimport Editor from '../editor';\nimport EditorModel from '../editor/model/Editor';\nimport { TraitManagerConfig } from './config/config';\nimport Trait from './model/Trait';\nimport TraitView from './view/TraitView';\n\nexport interface TraitViewTypes {\n [id: string]: { new (o: any): TraitView };\n}\n\nexport interface ITraitView {\n noLabel?: TraitView['noLabel'];\n eventCapture?: TraitView['eventCapture'];\n templateInput?: TraitView['templateInput'];\n onEvent?: TraitView['onEvent'];\n onUpdate?: TraitView['onUpdate'];\n createInput?: TraitView['createInput'];\n createLabel?: TraitView['createLabel'];\n}\n\nexport type CustomTrait = ITraitView & T & ThisType;\n\nexport interface TraitModuleStateProps {\n component?: Component;\n traits: Trait[];\n}\n\nexport interface TraitsByCategory extends ItemsByCategory {}\n\nexport interface TraitManagerConfigModule extends TraitManagerConfig {\n pStylePrefix?: string;\n em: EditorModel;\n}\n\nexport interface TraitCustomData {\n container?: HTMLElement;\n}\n\nexport interface TraitProperties {\n /**\n * Trait type, defines how the trait should be rendered.\n * Possible values: `text` (default), `number`, `select`, `checkbox`, `color`, `button`\n */\n type?: string;\n\n /**\n * The name of the trait used as a key for the attribute/property.\n * By default, the name is used as attribute name or property in case `changeProp` in enabled.\n */\n name?: string;\n\n /**\n * Trait id, eg. `my-trait-id`.\n * If not specified, the `name` will be used as id.\n */\n id?: string | number;\n\n /**\n * Trait category.\n * @default ''\n */\n category?: string | CategoryProperties;\n\n /**\n * The trait label to show for the rendered trait.\n */\n label?: string | false;\n\n /**\n * If `true`, the trait value is applied on the component property, otherwise, on component attributes.\n * @default false\n */\n changeProp?: boolean;\n\n /**\n * Instead of relying on component props/attributes, define your own\n * logic on how to get the trait value.\n */\n getValue?: (props: { editor: Editor; trait: Trait; component: Component }) => any;\n\n /**\n * In conjunction with the `getValue`, define your own logic for updating the trait value.\n */\n setValue?: (props: {\n value: any;\n editor: Editor;\n trait: Trait;\n component: Component;\n partial: boolean;\n options: TraitSetValueOptions;\n emitUpdate: () => void;\n }) => void;\n\n /**\n * Custom true value for checkbox type.\n * @default 'true'\n */\n valueTrue?: string;\n\n /**\n * Custom false value for checkbox type.\n * * @default 'false'\n */\n valueFalse?: string;\n\n /**\n * Minimum number value for number type.\n */\n min?: number;\n\n /**\n * Maximum number value for number type.\n */\n max?: number;\n unit?: string;\n\n /**\n * Number of steps for number type.\n */\n step?: number;\n value?: any;\n target?: Component;\n default?: any;\n\n /**\n * Placeholder to show inside the default input (if the UI type allows it).\n */\n placeholder?: string;\n\n /**\n * Array of options for the select type.\n */\n options?: TraitOption[];\n\n /**\n * Label text to use for the button type.\n */\n text?: string;\n labelButton?: string;\n\n /**\n * Command to use for the button type.\n */\n command?: string | ((editor: Editor, trait: Trait) => any);\n\n full?: boolean;\n attributes?: Record;\n}\n\nexport interface TraitSetValueOptions {\n partial?: boolean;\n [key: string]: unknown;\n}\n\nexport interface TraitGetValueOptions {\n /**\n * Get the value based on type.\n * With this option enabled, the returned value is normalized based on the\n * trait type (eg. the checkbox will always return a boolean).\n * @default false\n */\n useType?: boolean;\n}\n\nexport interface TraitOption {\n id: string;\n label?: string;\n [key: string]: unknown;\n}\n\nexport type TraitsEvent = `${TraitsEvents}`;\n\n/**{START_EVENTS}*/\nexport enum TraitsEvents {\n /**\n * @event `trait:select` New traits selected (eg. by changing a component).\n * @example\n * editor.on('trait:select', ({ traits, component }) => { ... });\n */\n select = 'trait:select',\n\n /**\n * @event `trait:value` Trait value updated.\n * @example\n * editor.on('trait:value', ({ trait, component, value }) => { ... });\n */\n value = 'trait:value',\n\n /**\n * @event `trait:category:update` Trait category updated.\n * @example\n * editor.on('trait:category:update', ({ category, changes }) => { ... });\n */\n categoryUpdate = 'trait:category:update',\n\n /**\n * @event `trait:custom` Event to use in case of [custom Trait Manager UI](https://grapesjs.com/docs/modules/Traits.html#custom-trait-manager).\n * @example\n * editor.on('trait:custom', ({ container }) => { ... });\n */\n custom = 'trait:custom',\n\n /**\n * @event `trait` Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback.\n * @example\n * editor.on('trait', ({ event, model, ... }) => { ... });\n */\n all = 'trait',\n}\n/**{END_EVENTS}*/\n\n// need this to avoid the TS documentation generator to break\nexport default TraitsEvents;\n","import { isString, isUndefined } from 'underscore';\nimport Category from '../../abstract/ModuleCategory';\nimport { LocaleOptions, Model, SetOptions } from '../../common';\nimport Component from '../../dom_components/model/Component';\nimport EditorModel from '../../editor/model/Editor';\nimport { isDef } from '../../utils/mixins';\nimport TraitsEvents, { TraitGetValueOptions, TraitOption, TraitProperties, TraitSetValueOptions } from '../types';\nimport TraitView from '../view/TraitView';\nimport Traits from './Traits';\n\n/**\n * @property {String} id Trait id, eg. `my-trait-id`.\n * @property {String} type Trait type, defines how the trait should be rendered. Possible values: `text` (default), `number`, `select`, `checkbox`, `color`, `button`\n * @property {String} label The trait label to show for the rendered trait.\n * @property {String} name The name of the trait used as a key for the attribute/property. By default, the name is used as attribute name or property in case `changeProp` in enabled.\n * @property {String} default Default value to use in case the value is not defined on the component.\n * @property {String} placeholder Placeholder to show inside the default input (if the UI type allows it).\n * @property {String} [category=''] Trait category.\n * @property {Boolean} changeProp If `true`, the trait value is applied on the component property, otherwise, on component attributes.\n *\n * @module docsjs.Trait\n *\n */\nexport default class Trait extends Model {\n target!: Component;\n em: EditorModel;\n view?: TraitView;\n el?: HTMLElement;\n\n defaults() {\n return {\n type: 'text',\n label: '',\n name: '',\n unit: '',\n step: 1,\n value: '',\n default: '',\n placeholder: '',\n category: '',\n changeProp: false,\n options: [],\n };\n }\n\n constructor(prop: TraitProperties, em: EditorModel) {\n super(prop);\n const { target, name } = this.attributes;\n !this.get('id') && this.set('id', name);\n if (target) {\n this.setTarget(target);\n }\n this.em = em;\n }\n\n get parent() {\n return this.collection as unknown as Traits;\n }\n\n get category(): Category | undefined {\n const cat = this.get('category');\n return cat instanceof Category ? cat : undefined;\n }\n\n get component() {\n return this.target;\n }\n\n get changeProp() {\n return !!this.get('changeProp');\n }\n\n setTarget(component: Component) {\n if (component) {\n const { name, changeProp, value: initValue, getValue } = this.attributes;\n this.target = component;\n this.unset('target');\n const targetEvent = changeProp ? `change:${name}` : `change:attributes:${name}`;\n this.listenTo(component, targetEvent, this.targetUpdated);\n const value =\n initValue ||\n // Avoid the risk of loops in case the trait has a custom getValue\n (!getValue ? this.getValue() : undefined);\n !isUndefined(value) && this.set({ value }, { silent: true });\n }\n }\n\n /**\n * Get the trait id.\n * @returns {String}\n */\n getId() {\n return this.get('id')!;\n }\n\n /**\n * Get the trait type.\n * @returns {String}\n */\n getType() {\n return this.get('type')!;\n }\n\n /**\n * Get the trait name.\n * @returns {String}\n */\n getName() {\n return this.get('name')!;\n }\n\n /**\n * Get the trait label.\n * @param {Object} [opts={}] Options.\n * @param {Boolean} [opts.locale=true] Use the locale string from i18n module.\n * @returns {String}\n */\n getLabel(opts: { locale?: boolean } = {}) {\n const { locale = true } = opts;\n const id = this.getId();\n const name = this.get('label') || this.getName();\n return (locale && this.em?.t(`traitManager.traits.labels.${id}`)) || name;\n }\n\n /**\n * Get the trait value.\n * The value is taken from component attributes by default or from properties if the trait has the `changeProp` enabled.\n * @param {Object} [opts={}] Options.\n * @param {Boolean} [opts.useType=false] Get the value based on type (eg. the checkbox will always return a boolean).\n * @returns {any}\n */\n getValue(opts?: TraitGetValueOptions) {\n return this.getTargetValue(opts);\n }\n\n /**\n * Update the trait value.\n * The value is applied on component attributes by default or on properties if the trait has the `changeProp` enabled.\n * @param {any} value Value of the trait.\n * @param {Object} [opts={}] Options.\n * @param {Boolean} [opts.partial] If `true` the update won't be considered complete (not stored in UndoManager).\n */\n setValue(value: any, opts: TraitSetValueOptions = {}) {\n const { component, em } = this;\n const { partial } = opts;\n const valueOpts: { avoidStore?: boolean } = {};\n const { setValue } = this.attributes;\n\n if (setValue) {\n setValue({\n value,\n component,\n editor: em?.getEditor()!,\n trait: this,\n partial: !!partial,\n options: opts,\n emitUpdate: () => this.targetUpdated(),\n });\n return;\n }\n\n if (partial) {\n valueOpts.avoidStore = true;\n }\n\n this.setTargetValue(value, valueOpts);\n }\n\n /**\n * Get default value.\n */\n getDefault() {\n return this.get('default');\n }\n\n /**\n * Get trait options.\n */\n getOptions(): TraitOption[] {\n return this.get('options') || [];\n }\n\n /**\n * Get current selected option or by id.\n * @param {String} [id] Option id.\n * @returns {Object | null}\n */\n getOption(id?: string): TraitOption | undefined {\n const idSel = isDef(id) ? id : this.getValue();\n return this.getOptions().filter(o => this.getOptionId(o) === idSel)[0];\n }\n\n /**\n * Get the option id from the option object.\n * @param {Object} option Option object\n * @returns {String} Option id\n */\n getOptionId(option: TraitOption): string {\n return option.id || (option.value as string);\n }\n\n /**\n * Get option label.\n * @param {String|Object} id Option id or the option object\n * @param {Object} [opts={}] Options\n * @param {Boolean} [opts.locale=true] Use the locale string from i18n module\n * @returns {String} Option label\n */\n getOptionLabel(id: string | TraitOption, opts: LocaleOptions = {}): string {\n const { locale = true } = opts;\n const option = (isString(id) ? this.getOption(id) : id)!;\n const optId = this.getOptionId(option);\n const label = option.label || (option as any).name || optId;\n const propName = this.getName();\n return (locale && this.em?.t(`traitManager.traits.options.${propName}.${optId}`)) || label;\n }\n\n /**\n * Get category label.\n * @param {Object} [opts={}] Options.\n * @param {Boolean} [opts.locale=true] Use the locale string from i18n module.\n * @returns {String}\n */\n getCategoryLabel(opts: LocaleOptions = {}): string {\n const { em, category } = this;\n const { locale = true } = opts;\n const catId = category?.getId();\n const catLabel = category?.getLabel();\n return (locale && em?.t(`traitManager.categories.${catId}`)) || catLabel || '';\n }\n\n /**\n * Run the trait command (used on the button trait type).\n */\n runCommand() {\n const { em } = this;\n const { command } = this.attributes;\n\n if (command && em) {\n if (isString(command)) {\n return em.Commands.run(command);\n } else {\n return command(em.Editor, this);\n }\n }\n }\n\n props() {\n return this.attributes;\n }\n\n targetUpdated() {\n const { component, em } = this;\n const value = this.getTargetValue({ useType: true });\n this.set({ value }, { fromTarget: 1 });\n const props = { trait: this, component, value };\n component.trigger(TraitsEvents.value, props);\n em?.trigger(TraitsEvents.value, props);\n // This should be triggered for any trait prop change\n em?.trigger('trait:update', props);\n }\n\n getTargetValue(opts: TraitGetValueOptions = {}) {\n const { component, em } = this;\n const name = this.getName();\n const getValue = this.get('getValue');\n let value;\n\n if (getValue) {\n value = getValue({\n editor: em?.getEditor()!,\n trait: this,\n component,\n });\n } else if (this.changeProp) {\n value = component.get(name);\n } else {\n value = component.getAttributes()[name];\n }\n\n if (opts.useType) {\n const type = this.getType();\n if (type === 'checkbox') {\n const { valueTrue, valueFalse } = this.attributes;\n\n if (!isUndefined(valueTrue) && valueTrue === value) {\n value = true;\n } else if (!isUndefined(valueFalse) && valueFalse === value) {\n value = false;\n }\n }\n }\n\n return !isUndefined(value) ? value : '';\n }\n\n setTargetValue(value: any, opts: SetOptions = {}) {\n const { component, attributes } = this;\n const name = this.getName();\n if (isUndefined(value)) return;\n let valueToSet = value;\n\n if (value === 'false') {\n valueToSet = false;\n } else if (value === 'true') {\n valueToSet = true;\n }\n\n if (this.getType() === 'checkbox') {\n const { valueTrue, valueFalse } = attributes;\n\n if (valueToSet && !isUndefined(valueTrue)) {\n valueToSet = valueTrue;\n }\n\n if (!valueToSet && !isUndefined(valueFalse)) {\n valueToSet = valueFalse;\n }\n }\n\n const props = { [name]: valueToSet };\n // This is required for the UndoManager to properly detect changes\n props.__p = opts.avoidStore ? null : undefined;\n\n if (this.changeProp) {\n component.set(props, opts);\n } else {\n component.addAttributes(props, opts);\n }\n }\n\n setValueFromInput(value: any, final = true, opts: SetOptions = {}) {\n const toSet = { value };\n this.set(toSet, { ...opts, avoidStore: 1 });\n\n // Have to trigger the change\n if (final) {\n this.set('value', '', opts);\n this.set(toSet, opts);\n }\n }\n\n getInitValue() {\n const { component } = this;\n const name = this.getName();\n let value;\n\n if (component) {\n const attrs = component.get('attributes')!;\n value = this.changeProp ? component.get(name) : attrs[name];\n }\n\n return value || this.get('value') || this.get('default');\n }\n}\n","import { isString } from 'underscore';\nimport EditorModel from '../../editor/model/Editor';\nimport { TraitManagerConfig } from '../config/config';\nimport { TraitProperties } from '../types';\nimport Trait from './Trait';\n\nexport default class TraitFactory {\n config: Partial;\n\n constructor(config: Partial = {}) {\n this.config = config;\n }\n\n /**\n * Build props object by their name\n */\n build(prop: string | TraitProperties, em: EditorModel): Trait {\n return isString(prop) ? this.buildFromString(prop, em) : new Trait(prop, em);\n }\n\n private buildFromString(name: string, em: EditorModel): Trait {\n const obj: TraitProperties = {\n name: name,\n type: 'text',\n };\n\n switch (name) {\n case 'target':\n obj.type = 'select';\n obj.default = false;\n obj.options = this.config.optionsTarget as any;\n break;\n }\n return new Trait(obj, em);\n }\n}\n","import { isArray } from 'underscore';\nimport TraitManager from '..';\nimport { CollectionWithCategories } from '../../abstract/CollectionWithCategories';\nimport Categories from '../../abstract/ModuleCategories';\nimport { AddOptions } from '../../common';\nimport Component from '../../dom_components/model/Component';\nimport EditorModel from '../../editor/model/Editor';\nimport TraitsEvents, { TraitProperties } from '../types';\nimport Trait from './Trait';\nimport TraitFactory from './TraitFactory';\n\nexport default class Traits extends CollectionWithCategories {\n em: EditorModel;\n target!: Component;\n tf: TraitFactory;\n categories = new Categories();\n\n constructor(coll: TraitProperties[], options: { em: EditorModel }) {\n super(coll);\n const { em } = options;\n this.em = em;\n this.categories = new Categories([], {\n em,\n events: { update: TraitsEvents.categoryUpdate },\n });\n this.on('add', this.handleAdd);\n this.on('reset', this.handleReset);\n const tm = this.module;\n const tmOpts = tm?.getConfig();\n this.tf = new TraitFactory(tmOpts);\n }\n\n get module(): TraitManager {\n return this.em.Traits;\n }\n\n getCategories() {\n return this.categories;\n }\n\n handleReset(coll: TraitProperties[], { previousModels = [] }: { previousModels?: Trait[] } = {}) {\n previousModels.forEach(model => model.trigger('remove'));\n }\n\n handleAdd(model: Trait) {\n model.em = this.em;\n const target = this.target;\n\n if (target) {\n model.target = target;\n }\n\n this.initCategory(model);\n }\n\n setTarget(target: Component) {\n this.target = target;\n this.models.forEach(trait => trait.setTarget(target));\n }\n\n add(model: string | TraitProperties | Trait, options?: AddOptions): Trait;\n add(models: Array, options?: AddOptions): Trait[];\n add(models: unknown, opt?: AddOptions): any {\n if (models == undefined) {\n return undefined;\n }\n const { target, em } = this;\n\n if (isArray(models)) {\n var traits: Trait[] = [];\n for (var i = 0, len = models.length; i < len; i++) {\n const trait = models[i];\n traits[i] = trait instanceof Trait ? trait : this.tf.build(trait, em);\n traits[i].setTarget(target);\n }\n return super.add(traits, opt);\n }\n const trait = models instanceof Trait ? models : this.tf.build(models as any, em);\n trait.setTarget(target);\n\n return super.add(trait, opt);\n }\n}\n","import {\n isUndefined,\n isFunction,\n isArray,\n isEmpty,\n isBoolean,\n has,\n isString,\n forEach,\n result,\n bindAll,\n keys,\n} from 'underscore';\nimport { shallowDiff, capitalize, isEmptyObj, isObject, toLowerCase } from '../../utils/mixins';\nimport StyleableModel, { StyleProps, UpdateStyleOptions } from '../../domain_abstract/model/StyleableModel';\nimport { Model } from 'backbone';\nimport Components from './Components';\nimport Selector from '../../selector_manager/model/Selector';\nimport Selectors from '../../selector_manager/model/Selectors';\nimport Traits from '../../trait_manager/model/Traits';\nimport EditorModel from '../../editor/model/Editor';\nimport {\n AddComponentsOption,\n ComponentAdd,\n ComponentDefinition,\n ComponentDefinitionDefined,\n ComponentOptions,\n ComponentProperties,\n DragMode,\n SymbolToUpOptions,\n ToHTMLOptions,\n} from './types';\nimport Frame from '../../canvas/model/Frame';\nimport { DomComponentsConfig } from '../config/config';\nimport ComponentView from '../view/ComponentView';\nimport { AddOptions, ExtractMethods, ObjectAny, PrevToNewIdMap, SetOptions } from '../../common';\nimport CssRule, { CssRuleJSON } from '../../css_composer/model/CssRule';\nimport Trait from '../../trait_manager/model/Trait';\nimport { ToolbarButtonProps } from './ToolbarButton';\nimport { TraitProperties } from '../../trait_manager/types';\nimport { ActionLabelComponents, ComponentsEvents } from '../types';\nimport ItemView from '../../navigator/view/ItemView';\nimport {\n getSymbolMain,\n getSymbolInstances,\n initSymbol,\n isSymbol,\n isSymbolMain,\n isSymbolRoot,\n updateSymbolCls,\n updateSymbolComps,\n updateSymbolProps,\n} from './SymbolUtils';\n\nexport interface IComponent extends ExtractMethods {}\n\nexport interface SetAttrOptions extends SetOptions, UpdateStyleOptions {}\n\nconst escapeRegExp = (str: string) => {\n return str.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n};\n\nexport const avoidInline = (em: EditorModel) => !!em?.getConfig().avoidInlineStyle;\n\nexport const eventDrag = 'component:drag';\nexport const keySymbols = '__symbols';\nexport const keySymbol = '__symbol';\nexport const keySymbolOvrd = '__symbol_ovrd';\nexport const keyUpdate = ComponentsEvents.update;\nexport const keyUpdateInside = ComponentsEvents.updateInside;\n\n/**\n * The Component object represents a single node of our template structure, so when you update its properties the changes are\n * immediately reflected on the canvas and in the code to export (indeed, when you ask to export the code we just go through all\n * the tree of nodes).\n * An example on how to update properties:\n * ```js\n * component.set({\n * tagName: 'span',\n * attributes: { ... },\n * removable: false,\n * });\n * component.get('tagName');\n * // -> 'span'\n * ```\n *\n * [Component]: component.html\n *\n * @property {String} [type=''] Component type, eg. `text`, `image`, `video`, etc.\n * @property {String} [tagName='div'] HTML tag of the component, eg. `span`. Default: `div`\n * @property {Object} [attributes={}] Key-value object of the component's attributes, eg. `{ title: 'Hello' }` Default: `{}`\n * @property {String} [name=''] Name of the component. Will be used, for example, in Layers and badges\n * @property {Boolean} [removable=true] When `true` the component is removable from the canvas, default: `true`\n * @property {Boolean|String|Function} [draggable=true] Indicates if it's possible to drag the component inside others.\n * You can also specify a query string to indentify elements,\n * eg. `'.some-class[title=Hello], [data-gjs-type=column]'` means you can drag the component only inside elements\n * containing `some-class` class and `Hello` title, and `column` components. In the case of a function, target and destination components are passed as arguments, return a Boolean to indicate if the drag is possible. Default: `true`\n * @property {Boolean|String|Function} [droppable=true] Indicates if it's possible to drop other components inside. You can use\n * a query string as with `draggable`. In the case of a function, target and destination components are passed as arguments, return a Boolean to indicate if the drop is possible. Default: `true`\n * @property {Boolean} [badgable=true] Set to false if you don't want to see the badge (with the name) over the component. Default: `true`\n * @property {Boolean|Array} [stylable=true] True if it's possible to style the component.\n * You can also indicate an array of CSS properties which is possible to style, eg. `['color', 'width']`, all other properties\n * will be hidden from the style manager. Default: `true`\n * @property {Array} [stylable-require=[]] Indicate an array of style properties to show up which has been marked as `toRequire`. Default: `[]`\n * @property {Array} [unstylable=[]] Indicate an array of style properties which should be hidden from the style manager. Default: `[]`\n * @property {Boolean} [highlightable=true] It can be highlighted with 'dotted' borders if true. Default: `true`\n * @property {Boolean} [copyable=true] True if it's possible to clone the component. Default: `true`\n * @property {Boolean} [resizable=false] Indicates if it's possible to resize the component. It's also possible to pass an object as [options for the Resizer](https://github.com/GrapesJS/grapesjs/blob/master/src/utils/Resizer.ts). Default: `false`\n * @property {Boolean} [editable=false] Allow to edit the content of the component (used on Text components). Default: `false`\n * @property {Boolean} [layerable=true] Set to `false` if you need to hide the component inside Layers. Default: `true`\n * @property {Boolean} [selectable=true] Allow component to be selected when clicked. Default: `true`\n * @property {Boolean} [hoverable=true] Shows a highlight outline when hovering on the element if `true`. Default: `true`\n * @property {Boolean} [locked] Disable the selection of the component and its children in the canvas. You can unlock a children by setting its locked property to `false`. Default: `undefined`\n * @property {Boolean} [void=false] This property is used by the HTML exporter as void elements don't have closing tags, eg. `
`, `
`, etc. Default: `false`\n * @property {Object} [style={}] Component default style, eg. `{ width: '100px', height: '100px', 'background-color': 'red' }`\n * @property {String} [styles=''] Component related styles, eg. `.my-component-class { color: red }`\n * @property {String} [content=''] Content of the component (not escaped) which will be appended before children rendering. Default: `''`\n * @property {String} [icon=''] Component's icon, this string will be inserted before the name (in Layers and badge), eg. it can be an HTML string ''. Default: `''`\n * @property {String|Function} [script=''] Component's javascript. More about it [here](/modules/Components-js.html). Default: `''`\n * @property {String|Function} [script-export=''] You can specify javascript available only in export functions (eg. when you get the HTML).\n * If this property is defined it will overwrite the `script` one (in export functions). Default: `''`\n * @property {Array} [traits=''] Component's traits. More about it [here](/modules/Traits.html). Default: `['id', 'title']`\n * @property {Array} [propagate=[]] Indicates an array of properties which will be inhereted by all NEW appended children.\n * For example if you create a component likes this: `{ removable: false, draggable: false, propagate: ['removable', 'draggable'] }`\n * and append some new component inside, the new added component will get the exact same properties indicated in the `propagate` array (and the `propagate` property itself). Default: `[]`\n * @property {Array} [toolbar=null] Set an array of items to show up inside the toolbar when the component is selected (move, clone, delete).\n * Eg. `toolbar: [ { attributes: {class: 'fa fa-arrows'}, command: 'tlb-move' }, ... ]`.\n * By default, when `toolbar` property is falsy the editor will add automatically commands `core:component-exit` (select parent component, added if there is one), `tlb-move` (added if `draggable`) , `tlb-clone` (added if `copyable`), `tlb-delete` (added if `removable`).\n * @property {Collection} [components=null] Children components. Default: `null`\n * @property {Object} [delegate=null] Delegate commands to other components. Available commands `remove` | `move` | `copy` | `select`. eg. `{ remove: (cmp) => cmp.closestType('other-type') }`\n *\n * @module docsjs.Component\n */\nexport default class Component extends StyleableModel {\n /**\n * @private\n * @ts-ignore */\n get defaults(): ComponentDefinitionDefined {\n return {\n tagName: 'div',\n type: '',\n name: '',\n removable: true,\n draggable: true,\n droppable: true,\n badgable: true,\n stylable: true,\n 'stylable-require': '',\n 'style-signature': '',\n unstylable: '',\n highlightable: true,\n copyable: true,\n resizable: false,\n editable: false,\n layerable: true,\n selectable: true,\n hoverable: true,\n void: false,\n state: '', // Indicates if the component is in some CSS state like ':hover', ':active', etc.\n status: '', // State, eg. 'selected'\n content: '',\n icon: '',\n style: '',\n styles: '', // Component related styles\n classes: '', // Array of classes\n script: '',\n 'script-props': '',\n 'script-export': '',\n attributes: {},\n traits: ['id', 'title'],\n propagate: '',\n dmode: '',\n toolbar: null,\n delegate: null,\n [keySymbol]: 0,\n [keySymbols]: 0,\n [keySymbolOvrd]: 0,\n _undo: true,\n _undoexc: ['status', 'open'],\n };\n }\n\n get tagName() {\n return this.get('tagName')!;\n }\n\n get classes() {\n return this.get('classes')!;\n }\n\n get traits() {\n return this.get('traits')!;\n }\n\n get content() {\n return this.get('content') ?? '';\n }\n\n get toolbar() {\n return this.get('toolbar') || [];\n }\n\n get resizable() {\n return this.get('resizable')!;\n }\n\n get delegate() {\n return this.get('delegate');\n }\n\n get locked() {\n return this.get('locked');\n }\n\n /**\n * Hook method, called once the model is created\n */\n init() {}\n\n /**\n * Hook method, called when the model has been updated (eg. updated some model's property)\n * @param {String} property Property name, if triggered after some property update\n * @param {*} value Property value, if triggered after some property update\n * @param {*} previous Property previous value, if triggered after some property update\n */\n updated(property: string, value: any, previous: any) {}\n\n /**\n * Hook method, called once the model has been removed\n */\n removed() {}\n\n em!: EditorModel;\n opt!: ComponentOptions;\n config!: DomComponentsConfig;\n ccid!: string;\n views!: ComponentView[];\n view?: ComponentView;\n viewLayer?: ItemView;\n frame?: Frame;\n rule?: CssRule;\n prevColl?: Components;\n __hasUm?: boolean;\n __symbReady?: boolean;\n /**\n * @private\n * @ts-ignore */\n collection!: Components;\n\n constructor(props: ComponentProperties = {}, opt: ComponentOptions) {\n super(props, opt);\n bindAll(this, '__upSymbProps', '__upSymbCls', '__upSymbComps');\n const em = opt.em;\n\n // Propagate properties from parent if indicated\n const parent = this.parent();\n const parentAttr = parent?.attributes;\n const propagate = this.get('propagate');\n propagate && this.set('propagate', isArray(propagate) ? propagate : [propagate]);\n\n if (parentAttr && parentAttr.propagate && !propagate) {\n const newAttr: Partial = {};\n const toPropagate = parentAttr.propagate;\n toPropagate.forEach(prop => (newAttr[prop] = parent.get(prop as string)));\n newAttr.propagate = toPropagate;\n this.set({ ...newAttr, ...props });\n }\n\n // Check void elements\n if (opt && opt.config && opt.config.voidElements!.indexOf(this.get('tagName')!) >= 0) {\n this.set('void', true);\n }\n\n opt.em = em;\n this.opt = opt;\n this.em = em!;\n this.frame = opt.frame;\n this.config = opt.config || {};\n this.set('attributes', {\n ...(result(this, 'defaults').attributes || {}),\n ...(this.get('attributes') || {}),\n });\n this.ccid = Component.createId(this, opt);\n this.initClasses();\n this.initComponents();\n this.initTraits();\n this.initToolbar();\n this.initScriptProps();\n this.listenTo(this, 'change:script', this.scriptUpdated);\n this.listenTo(this, 'change:tagName', this.tagUpdated);\n this.listenTo(this, 'change:attributes', this.attrUpdated);\n this.listenTo(this, 'change:attributes:id', this._idUpdated);\n this.on('change:toolbar', this.__emitUpdateTlb);\n this.on('change', this.__onChange);\n this.on(keyUpdateInside, this.__propToParent);\n this.set('status', '');\n this.views = [];\n\n // Register global updates for collection properties\n ['classes', 'traits', 'components'].forEach(name => {\n const events = `add remove ${name !== 'components' ? 'change' : ''}`;\n this.listenTo(this.get(name), events.trim(), (...args) => this.emitUpdate(name, ...args));\n });\n\n if (!opt.temporary) {\n // Add component styles\n const cssc = em && em.Css;\n const { styles, type } = this.attributes;\n if (styles && cssc) {\n cssc.addCollection(styles, { avoidUpdateStyle: true }, { group: `cmp:${type}` });\n }\n\n this.__postAdd();\n this.init();\n isSymbol(this) && initSymbol(this);\n em?.trigger(ComponentsEvents.create, this, opt);\n }\n }\n\n __postAdd(opts: { recursive?: boolean } = {}) {\n const { em } = this;\n const um = em?.UndoManager;\n const comps = this.components();\n if (um && !this.__hasUm) {\n um.add(comps);\n um.add(this.getSelectors());\n this.__hasUm = true;\n }\n opts.recursive && comps.map(c => c.__postAdd(opts));\n }\n\n __postRemove() {\n const { em } = this;\n const um = em?.UndoManager;\n if (um) {\n um.remove(this.components());\n um.remove(this.getSelectors());\n delete this.__hasUm;\n }\n }\n\n __onChange(m: any, opts: any) {\n const changed = this.changedAttributes() || {};\n keys(changed).forEach(prop => this.emitUpdate(prop));\n ['status', 'open', 'toolbar', 'traits'].forEach(name => delete changed[name]);\n // Propagate component prop changes\n if (!isEmptyObj(changed)) {\n this.__changesUp(opts);\n this.__propSelfToParent({ component: this, changed, options: opts });\n }\n }\n\n __onStyleChange(newStyles: StyleProps) {\n const { em } = this;\n if (!em) return;\n\n const event = 'component:styleUpdate';\n const styleKeys = keys(newStyles);\n const pros = { style: newStyles };\n\n em.trigger(event, this, pros);\n styleKeys.forEach(key => em.trigger(`${event}:${key}`, this, pros));\n }\n\n __changesUp(opts: any) {\n const { em, frame } = this;\n [frame, em].forEach(md => md && md.changesUp(opts));\n }\n\n __propSelfToParent(props: any) {\n this.trigger(keyUpdate, props);\n this.__propToParent(props);\n }\n\n __propToParent(props: any) {\n const parent = this.parent();\n parent && parent.trigger(keyUpdateInside, props);\n }\n\n __emitUpdateTlb() {\n this.emitUpdate('toolbar');\n }\n\n __getAllById() {\n const { em } = this;\n return em ? em.Components.allById() : {};\n }\n\n __upSymbProps(m: any, opts: SymbolToUpOptions = {}) {\n updateSymbolProps(this, opts);\n }\n\n __upSymbCls(m: any, c: any, opts = {}) {\n updateSymbolCls(this, opts);\n }\n\n __upSymbComps(m: Component, c: Components, o: any) {\n updateSymbolComps(this, m, c, o);\n }\n\n /**\n * Check component's type\n * @param {string} type Component type\n * @return {Boolean}\n * @example\n * component.is('image')\n * // -> false\n */\n is(type: string) {\n return !!(this.get('type') == type);\n }\n\n /**\n * Return all the propeties\n * @returns {Object}\n */\n props() {\n return this.attributes;\n }\n\n /**\n * Get the index of the component in the parent collection.\n * @return {Number}\n */\n index() {\n const { collection } = this;\n return collection ? collection.indexOf(this) : 0;\n }\n\n /**\n * Change the drag mode of the component.\n * To get more about this feature read: https://github.com/GrapesJS/grapesjs/issues/1936\n * @param {String} value Drag mode, options: `'absolute'` | `'translate'` | `''`\n * @returns {this}\n */\n setDragMode(value?: DragMode) {\n return this.set('dmode', value);\n }\n\n /**\n * Get the drag mode of the component.\n * @returns {String} Drag mode value, options: `'absolute'` | `'translate'` | `''`\n */\n getDragMode(): DragMode {\n return this.get('dmode') || '';\n }\n\n /**\n * Set symbol override.\n * By setting override to `true`, none of its property changes will be propagated to relative symbols.\n * By setting override to specific properties, changes of those properties will be skipped from propagation.\n * @param {Boolean|String|Array} value\n * @example\n * component.setSymbolOverride(['children', 'classes']);\n */\n setSymbolOverride(value?: boolean | string | string[]) {\n this.set(keySymbolOvrd, (isString(value) ? [value] : value) ?? 0);\n }\n\n /**\n * Get symbol override value.\n * @returns {Boolean|Array}\n */\n getSymbolOverride(): boolean | string[] | undefined {\n return this.get(keySymbolOvrd);\n }\n\n /**\n * Find inner components by query string.\n * **ATTENTION**: this method works only with already rendered component\n * @param {String} query Query string\n * @return {Array} Array of components\n * @example\n * component.find('div > .class');\n * // -> [Component, Component, ...]\n */\n find(query: string) {\n const result: Component[] = [];\n const $els = this.view?.$el.find(query);\n $els?.each(i => {\n const $el = $els.eq(i);\n const model = $el.data('model');\n model && result.push(model);\n });\n\n return result;\n }\n\n /**\n * Find all inner components by component type.\n * The advantage of this method over `find` is that you can use it\n * also before rendering the component\n * @param {String} type Component type\n * @returns {Array}\n * @example\n * const allImages = component.findType('image');\n * console.log(allImages[0]) // prints the first found component\n */\n findType(type: string) {\n const result: Component[] = [];\n const find = (components: Components) =>\n components.forEach(item => {\n item.is(type) && result.push(item);\n find(item.components());\n });\n find(this.components());\n return result;\n }\n\n /**\n * Find the closest parent component by query string.\n * **ATTENTION**: this method works only with already rendered component\n * @param {string} query Query string\n * @return {Component}\n * @example\n * component.closest('div.some-class');\n * // -> Component\n */\n closest(query: string) {\n const result = this.view?.$el.closest(query);\n return result?.length ? (result.data('model') as Component) : undefined;\n }\n\n /**\n * Find the closest parent component by its type.\n * The advantage of this method over `closest` is that you can use it\n * also before rendering the component\n * @param {String} type Component type\n * @returns {Component} Found component, otherwise `undefined`\n * @example\n * const Section = component.closestType('section');\n * console.log(Section);\n */\n closestType(type: string) {\n let parent = this.parent();\n\n while (parent && !parent.is(type)) {\n parent = parent.parent();\n }\n\n return parent;\n }\n\n /**\n * The method returns a Boolean value indicating whether the passed\n * component is a descendant of a given component\n * @param {Component} component Component to check\n * @returns {Boolean}\n */\n contains(component: Component) {\n let result = !1;\n if (!component) return result;\n const contains = (components: Components) => {\n !result &&\n components.forEach(item => {\n if (item === component) result = !0;\n !result && contains(item.components());\n });\n };\n contains(this.components());\n return result;\n }\n\n /**\n * Once the tag is updated I have to rerender the element\n * @private\n */\n tagUpdated() {\n this.trigger('rerender');\n }\n\n /**\n * Replace a component with another one\n * @param {String|Component} el Component or HTML string\n * @param {Object} [opts={}] Options for the append action\n * @returns {Array} New replaced components\n * @example\n * const result = component.replaceWith('
Some new content
');\n * // result -> [Component]\n */\n replaceWith(el: ComponentAdd, opts: AddOptions = {}): C[] {\n const coll = this.collection;\n const at = coll.indexOf(this);\n coll.remove(this);\n const result = coll.add(el, { ...opts, at }) as C | C[];\n return isArray(result) ? result : [result];\n }\n\n /**\n * Emit changes for each updated attribute\n * @private\n */\n attrUpdated(m: any, v: any, opts: SetAttrOptions = {}) {\n const attrs = this.get('attributes')!;\n // Handle classes\n const classes = attrs.class;\n classes && this.setClass(classes);\n delete attrs.class;\n\n // Handle style\n const style = attrs.style;\n style && this.setStyle(style, opts);\n delete attrs.style;\n\n const attrPrev = { ...this.previous('attributes') };\n const diff = shallowDiff(attrPrev, this.get('attributes')!);\n keys(diff).forEach(pr => {\n const attrKey = `attributes:${pr}`;\n this.trigger(`change:${attrKey}`, this, diff[pr], opts);\n this.em?.trigger(`${keyUpdate}:${attrKey}`, this, diff[pr], opts);\n });\n }\n\n /**\n * Update attributes of the component\n * @param {Object} attrs Key value attributes\n * @param {Object} options Options for the model update\n * @return {this}\n * @example\n * component.setAttributes({ id: 'test', 'data-key': 'value' });\n */\n setAttributes(attrs: ObjectAny, opts: SetAttrOptions = {}) {\n this.set('attributes', { ...attrs }, opts);\n return this;\n }\n\n /**\n * Add attributes to the component\n * @param {Object} attrs Key value attributes\n * @param {Object} options Options for the model update\n * @return {this}\n * @example\n * component.addAttributes({ 'data-key': 'value' });\n */\n addAttributes(attrs: ObjectAny, opts: SetAttrOptions = {}) {\n return this.setAttributes(\n {\n ...this.getAttributes({ noClass: true }),\n ...attrs,\n },\n opts\n );\n }\n\n /**\n * Remove attributes from the component\n * @param {String|Array} attrs Array of attributes to remove\n * @param {Object} options Options for the model update\n * @return {this}\n * @example\n * component.removeAttributes('some-attr');\n * component.removeAttributes(['some-attr1', 'some-attr2']);\n */\n removeAttributes(attrs: string | string[] = [], opts: SetOptions = {}) {\n const attrArr = Array.isArray(attrs) ? attrs : [attrs];\n const compAttr = this.getAttributes();\n attrArr.map(i => delete compAttr[i]);\n return this.setAttributes(compAttr, opts);\n }\n\n /**\n * Get the style of the component\n * @return {Object}\n */\n getStyle(options: any = {}, optsAdd: any = {}) {\n const { em } = this;\n const prop = isString(options) ? options : '';\n const opts = prop ? optsAdd : options;\n\n if (avoidInline(em) && !opts.inline) {\n const state = em.get('state');\n const cc = em.Css;\n const rule = cc.getIdRule(this.getId(), { state, ...opts });\n this.rule = rule;\n\n if (rule) {\n return rule.getStyle(prop);\n }\n\n // Return empty style if not rule have been found. We cannot return inline style with the next return\n // because else on load inline style is set a #id or .class style\n return {};\n }\n\n return super.getStyle.call(this, prop);\n }\n\n /**\n * Set the style on the component\n * @param {Object} prop Key value style object\n * @return {Object}\n * @example\n * component.setStyle({ color: 'red' });\n */\n setStyle(prop: StyleProps = {}, opts: UpdateStyleOptions = {}) {\n const { opt, em } = this;\n\n if (avoidInline(em) && !opt.temporary && !opts.inline) {\n const style = this.get('style') || {};\n prop = isString(prop) ? this.parseStyle(prop) : prop;\n prop = { ...prop, ...style };\n const state = em.get('state');\n const cc = em.Css;\n const propOrig = this.getStyle(opts);\n this.rule = cc.setIdRule(this.getId(), prop, { state, ...opts });\n const diff = shallowDiff(propOrig, prop);\n this.set('style', '', { silent: true });\n keys(diff).forEach(pr => this.trigger(`change:style:${pr}`));\n } else {\n prop = super.setStyle.apply(this, arguments as any);\n }\n\n if (!opt.temporary) {\n this.__onStyleChange(opts.addStyle || prop);\n }\n\n return prop;\n }\n\n /**\n * Return all component's attributes\n * @return {Object}\n */\n getAttributes(opts: { noClass?: boolean; noStyle?: boolean } = {}) {\n const { em } = this;\n const classes: string[] = [];\n const attributes = { ...this.get('attributes') };\n const sm = em?.Selectors;\n const id = this.getId();\n\n // Add classes\n if (opts.noClass) {\n delete attributes.class;\n } else {\n this.classes.forEach(cls => classes.push(isString(cls) ? cls : cls.getName()));\n classes.length && (attributes.class = classes.join(' '));\n }\n\n // Add style\n if (!opts.noStyle) {\n const style = this.getStyle({ inline: true });\n if (isObject(style) && !isEmptyObj(style)) {\n attributes.style = this.styleToString({ inline: true });\n }\n }\n\n // Check if we need an ID on the component\n if (!has(attributes, 'id')) {\n let addId = false;\n\n // If we don't rely on inline styling we have to check\n // for the ID selector\n if (avoidInline(em) || !isEmpty(this.getStyle())) {\n addId = !!sm?.get(id, sm.Selector.TYPE_ID);\n }\n\n if (\n // Symbols should always have an id\n isSymbol(this) ||\n // Components with script should always have an id\n this.get('script-export') ||\n this.get('script')\n ) {\n addId = true;\n }\n\n if (addId) {\n attributes.id = id;\n }\n }\n\n return attributes;\n }\n\n /**\n * Add classes\n * @param {Array|String} classes Array or string of classes\n * @return {Array} Array of added selectors\n * @example\n * model.addClass('class1');\n * model.addClass('class1 class2');\n * model.addClass(['class1', 'class2']);\n * // -> [SelectorObject, ...]\n */\n addClass(classes: string | string[]) {\n const added = this.em.Selectors.addClass(classes);\n return this.classes.add(added);\n }\n\n /**\n * Set classes (resets current collection)\n * @param {Array|String} classes Array or string of classes\n * @return {Array} Array of added selectors\n * @example\n * model.setClass('class1');\n * model.setClass('class1 class2');\n * model.setClass(['class1', 'class2']);\n * // -> [SelectorObject, ...]\n */\n setClass(classes: string | string[]) {\n this.classes.reset();\n return this.addClass(classes);\n }\n\n /**\n * Remove classes\n * @param {Array|String} classes Array or string of classes\n * @return {Array} Array of removed selectors\n * @example\n * model.removeClass('class1');\n * model.removeClass('class1 class2');\n * model.removeClass(['class1', 'class2']);\n * // -> [SelectorObject, ...]\n */\n removeClass(classes: string | string[]) {\n const removed: Selector[] = [];\n classes = isArray(classes) ? classes : [classes];\n const selectors = this.classes;\n const type = Selector.TYPE_CLASS;\n\n classes.forEach(classe => {\n const classes = classe.split(' ');\n classes.forEach(name => {\n const selector = selectors.where({ name, type })[0];\n selector && removed.push(selectors.remove(selector));\n });\n });\n\n return removed;\n }\n\n /**\n * Returns component's classes as an array of strings\n * @return {Array}\n */\n getClasses() {\n const attr = this.getAttributes();\n const classStr = attr.class;\n return classStr ? classStr.split(' ') : [];\n }\n\n initClasses(m?: any, c?: any, opts: any = {}) {\n const event = 'change:classes';\n const { class: attrCls, ...restAttr } = this.get('attributes') || {};\n const toListen = [this, event, this.initClasses];\n const cls = this.get('classes') || attrCls || [];\n const clsArr = isString(cls) ? cls.split(' ') : cls;\n this.stopListening(...toListen);\n const classes = this.normalizeClasses(clsArr);\n const selectors = new Selectors([]);\n this.set('classes', selectors, opts);\n selectors.add(classes);\n selectors.on('add remove reset', this.__upSymbCls);\n // Clear attributes from classes\n attrCls && classes.length && this.set('attributes', restAttr);\n // @ts-ignore\n this.listenTo(...toListen);\n return this;\n }\n\n initComponents() {\n const event = 'change:components';\n const toListen = [this, event, this.initComponents];\n this.stopListening(...toListen);\n // Have to add components after the init, otherwise the parent\n // is not visible\n const comps = new Components([], this.opt);\n comps.parent = this;\n const components = this.get('components');\n const addChild = !this.opt.avoidChildren;\n this.set('components', comps);\n addChild && components && comps.add(isFunction(components) ? components(this) : components, this.opt as any);\n comps.on('add remove reset', this.__upSymbComps);\n // @ts-ignore\n this.listenTo(...toListen);\n return this;\n }\n\n initTraits(changed?: any) {\n const { em } = this;\n const event = 'change:traits';\n this.off(event, this.initTraits);\n this.__loadTraits();\n const attrs = { ...this.get('attributes') };\n const traits = this.traits;\n traits.each(trait => {\n if (!trait.changeProp) {\n const name = trait.getName();\n const value = trait.getInitValue();\n if (name && value) attrs[name] = value;\n }\n });\n traits.length && this.set('attributes', attrs);\n this.on(event, this.initTraits);\n changed && em && em.trigger('component:toggled');\n return this;\n }\n\n initScriptProps() {\n if (this.opt.temporary) return;\n const prop = 'script-props';\n const toListen: any = [`change:${prop}`, this.initScriptProps];\n this.off(...toListen);\n const prevProps = this.previous(prop) || [];\n const newProps = this.get(prop) || [];\n const prevPropsEv = prevProps.map(e => `change:${e}`).join(' ');\n const newPropsEv = newProps.map(e => `change:${e}`).join(' ');\n prevPropsEv && this.off(prevPropsEv, this.__scriptPropsChange);\n newPropsEv && this.on(newPropsEv, this.__scriptPropsChange);\n // @ts-ignore\n this.on(...toListen);\n }\n\n __scriptPropsChange(m: any, v: any, opts: any = {}) {\n if (opts.avoidStore) return;\n this.trigger('rerender');\n }\n\n /**\n * Add new component children\n * @param {Component|String} components Component to add\n * @param {Object} [opts={}] Options for the append action\n * @return {Array} Array of appended components\n * @example\n * someComponent.get('components').length // -> 0\n * const videoComponent = someComponent.append('
')[0];\n * // This will add 2 components (`video` and `div`) to your `someComponent`\n * someComponent.get('components').length // -> 2\n * // You can pass components directly\n * otherComponent.append(otherComponent2);\n * otherComponent.append([otherComponent3, otherComponent4]);\n * // append at specific index (eg. at the beginning)\n * someComponent.append(otherComponent, { at: 0 });\n */\n append(components: ComponentAdd, opts: AddOptions = {}): Component[] {\n const compArr = isArray(components) ? [...components] : [components];\n const toAppend = compArr.map(comp => {\n if (isString(comp)) {\n return comp;\n } else {\n // I have to remove components from the old container before adding them to a new one\n comp.collection && (comp as Component).collection.remove(comp, { temporary: true } as any);\n return comp;\n }\n });\n const result = this.components().add(toAppend, {\n action: ActionLabelComponents.add,\n ...opts,\n });\n return isArray(result) ? result : [result];\n }\n\n /**\n * Set new collection if `components` are provided, otherwise the\n * current collection is returned\n * @param {Component|Component[]|String} [components] Component Definitions or HTML string\n * @param {Object} [opts={}] Options, same as in `Component.append()`\n * @returns {Collection|Array<[Component]>}\n * @example\n * // Set new collection\n * component.components('
');\n * // Get current collection\n * const collection = component.components();\n * console.log(collection.length);\n * // -> 2\n */\n components(\n components?: T,\n opts: AddComponentsOption = {}\n ): undefined extends T ? Components : Component[] {\n const coll = this.get('components')!;\n\n if (isUndefined(components)) {\n return coll as any;\n } else {\n coll.reset(undefined, opts);\n return components ? this.append(components, opts) : ([] as any);\n }\n }\n\n /**\n * If exists, returns the child component at specific index.\n * @param {Number} index Index of the component to return\n * @returns {[Component]|null}\n * @example\n * // Return first child\n * component.getChildAt(0);\n * // Return second child\n * component.getChildAt(1);\n */\n getChildAt(index: number) {\n return this.components().at(index || 0) || undefined;\n }\n\n /**\n * If exists, returns the last child component.\n * @returns {[Component]|null}\n * @example\n * const lastChild = component.getLastChild();\n */\n getLastChild() {\n const children = this.components();\n return children.at(children.length - 1) || null;\n }\n\n /**\n * Remove all inner components\n * * @return {this}\n */\n empty(opts = {}) {\n this.components().reset(undefined, opts);\n return this;\n }\n\n /**\n * Get the parent component, if exists\n * @return {Component|null}\n * @example\n * component.parent();\n * // -> Component\n */\n parent(opts: any = {}): Component | undefined {\n const coll = this.collection || (opts.prev && this.prevColl);\n return coll ? coll.parent : undefined;\n }\n\n /**\n * Return all parents of the component.\n * @returns {Array}\n */\n parents(): Component[] {\n const parent = this.parent();\n return parent ? [parent].concat(parent.parents()) : [];\n }\n\n /**\n * Script updated\n * @private\n */\n scriptUpdated() {\n this.set('scriptUpdated', 1);\n }\n\n /**\n * Init toolbar\n * @private\n */\n initToolbar() {\n const { em } = this;\n const model = this;\n const ppfx = (em && em.getConfig().stylePrefix) || '';\n\n if (!model.get('toolbar') && em) {\n const tb: ToolbarButtonProps[] = [];\n model.collection &&\n tb.push({\n label: em.getIcon('arrowUp'),\n command: (ed: any) => ed.runCommand('core:component-exit', { force: 1 }),\n });\n model.get('draggable') &&\n tb.push({\n attributes: { class: `${ppfx}no-touch-actions`, draggable: true },\n label: em.getIcon('move'),\n command: 'tlb-move',\n });\n model.get('copyable') &&\n tb.push({\n label: em.getIcon('copy'),\n command: 'tlb-clone',\n });\n model.get('removable') &&\n tb.push({\n label: em.getIcon('delete'),\n command: 'tlb-delete',\n });\n model.set('toolbar', tb);\n }\n }\n\n __loadTraits(tr?: Traits | TraitProperties[], opts = {}) {\n let traitsI = tr || this.traits;\n\n if (!(traitsI instanceof Traits)) {\n traitsI = (isFunction(traitsI) ? traitsI(this) : traitsI) as TraitProperties[];\n const traits = new Traits([], this.opt as any);\n traits.setTarget(this);\n\n if (traitsI.length) {\n traitsI.forEach(tr => tr.attributes && delete tr.attributes.value);\n traits.add(traitsI);\n }\n\n this.set({ traits }, opts);\n }\n\n return this;\n }\n\n /**\n * Get traits.\n * @returns {Array}\n * @example\n * const traits = component.getTraits();\n * console.log(traits);\n * // [Trait, Trait, Trait, ...]\n */\n getTraits(): Trait[] {\n this.__loadTraits();\n return [...this.traits.models];\n }\n\n /**\n * Replace current collection of traits with a new one.\n * @param {Array} traits Array of trait definitions\n * @returns {Array}\n * @example\n * const traits = component.setTraits([{ type: 'checkbox', name: 'disabled'}, ...]);\n * console.log(traits);\n * // [Trait, ...]\n */\n setTraits(traits: TraitProperties[]) {\n const tr = isArray(traits) ? traits : [traits];\n // @ts-ignore\n this.set({ traits: tr });\n return this.getTraits();\n }\n\n /**\n * Get the trait by id/name.\n * @param {String} id The `id` or `name` of the trait\n * @return {Trait|null} Trait getModelToStyle\n * @example\n * const traitTitle = component.getTrait('title');\n * traitTitle && traitTitle.set('label', 'New label');\n */\n getTrait(id: string) {\n return (\n this.getTraits().filter(trait => {\n return trait.get('id') === id || trait.get('name') === id;\n })[0] || null\n );\n }\n\n /**\n * Update a trait.\n * @param {String} id The `id` or `name` of the trait\n * @param {Object} props Object with the props to update\n * @return {this}\n * @example\n * component.updateTrait('title', {\n * type: 'select',\n * options: [ 'Option 1', 'Option 2' ],\n * });\n */\n updateTrait(id: string, props: Partial) {\n const trait = this.getTrait(id);\n trait && trait.set(props);\n this.em?.trigger('component:toggled');\n return this;\n }\n\n /**\n * Get the trait position index by id/name. Useful in case you want to\n * replace some trait, at runtime, with something else.\n * @param {String} id The `id` or `name` of the trait\n * @return {Number} Index position of the current trait\n * @example\n * const traitTitle = component.getTraitIndex('title');\n * console.log(traitTitle); // 1\n */\n getTraitIndex(id: string) {\n const trait = this.getTrait(id);\n return trait ? this.traits.indexOf(trait) : -1;\n }\n\n /**\n * Remove trait/s by id/s.\n * @param {String|Array} id The `id`/`name` of the trait (or an array)\n * @return {Array} Array of removed traits\n * @example\n * component.removeTrait('title');\n * component.removeTrait(['title', 'id']);\n */\n removeTrait(id: string | string[]) {\n const ids = isArray(id) ? id : [id];\n const toRemove = ids.map(id => this.getTrait(id));\n const { traits } = this;\n const removed = toRemove.length ? traits.remove(toRemove) : [];\n this.em?.trigger('component:toggled');\n return isArray(removed) ? removed : [removed];\n }\n\n /**\n * Add new trait/s.\n * @param {String|Object|Array} trait Trait to add (or an array of traits)\n * @param {Options} opts Options for the add\n * @return {Array} Array of added traits\n * @example\n * component.addTrait('title', { at: 1 }); // Add title trait (`at` option is the position index)\n * component.addTrait({\n * type: 'checkbox',\n * name: 'disabled',\n * });\n * component.addTrait(['title', {...}, ...]);\n */\n addTrait(trait: Parameters[0], opts: AddOptions = {}) {\n this.__loadTraits();\n const added = this.traits.add(trait, opts);\n this.em?.trigger('component:toggled');\n return isArray(added) ? added : [added];\n }\n\n /**\n * Normalize input classes from array to array of objects\n * @param {Array} arr\n * @return {Array}\n * @private\n */\n normalizeClasses(arr: string[]): Selector[] {\n const res: Selector[] = [];\n const { em } = this;\n const clm = em?.Selectors;\n if (!clm) return [];\n // @ts-ignore\n if (arr.models) return [...arr.models];\n arr.forEach(val => res.push(clm.add(val) as Selector));\n return res;\n }\n\n /**\n * Override original clone method\n * @private\n * @ts-ignore */\n clone(opt: { symbol?: boolean; symbolInv?: boolean } = {}): this {\n const em = this.em;\n const attr = { ...this.attributes };\n const opts = { ...this.opt };\n const id = this.getId();\n const cssc = em?.Css;\n attr.attributes = { ...attr.attributes };\n delete attr.attributes.id;\n // @ts-ignore\n attr.components = [];\n // @ts-ignore\n attr.classes = [];\n // @ts-ignore\n attr.traits = [];\n\n if (isSymbolRoot(this)) {\n opt.symbol = true;\n }\n\n this.get('components')!.each((md, i) => {\n // @ts-ignore\n attr.components[i] = md.clone({ ...opt, _inner: 1 });\n });\n this.get('traits')!.each((md, i) => {\n // @ts-ignore\n attr.traits[i] = md.clone();\n });\n this.get('classes')!.each((md, i) => {\n // @ts-ignore\n attr.classes[i] = md.get('name');\n });\n\n attr.status = '';\n // @ts-ignore\n opts.collection = null;\n // @ts-ignore\n const cloned = new this.constructor(attr, opts);\n\n // Clone component specific rules\n const newId = `#${cloned.getId()}`;\n const rulesToClone = cssc ? cssc.getRules(`#${id}`) : [];\n rulesToClone.forEach(rule => {\n const newRule = rule.clone();\n // @ts-ignore\n newRule.set('selectors', [newId]);\n cssc.getAll().add(newRule);\n });\n\n // Symbols\n // If I clone an inner symbol, I have to reset it\n cloned.set(keySymbols, 0);\n const symbol = getSymbolMain(this);\n const symbols = getSymbolInstances(this);\n\n if (!opt.symbol && (symbol || symbols)) {\n cloned.set(keySymbol, 0);\n cloned.set(keySymbols, 0);\n } else if (symbol) {\n // Contains already a reference to a symbol\n symbol.set(keySymbols, [...getSymbolInstances(symbol)!, cloned]);\n initSymbol(cloned);\n } else if (opt.symbol) {\n // Request to create a symbol\n if (isSymbolMain(this)) {\n // Already a symbol, cloned should be an instance\n this.set(keySymbols, [...symbols!, cloned]);\n cloned.set(keySymbol, this);\n initSymbol(cloned);\n } else if (opt.symbolInv) {\n // Inverted, cloned is the instance, the origin is the main symbol\n this.set(keySymbols, [cloned]);\n cloned.set(keySymbol, this);\n [this, cloned].map(i => initSymbol(i));\n } else {\n // Cloned becomes the main symbol\n cloned.set(keySymbols, [this]);\n [this, cloned].map(i => initSymbol(i));\n this.set(keySymbol, cloned);\n }\n }\n\n const event = 'component:clone';\n em && em.trigger(event, cloned);\n this.trigger(event, cloned);\n\n return cloned;\n }\n\n /**\n * Get the name of the component.\n * @param {Object} [opts={}] Options\n * @param {Boolean} [opts.noCustom] Avoid custom name assigned to the component.\n * @returns {String}\n * */\n getName(opts: { noCustom?: boolean } = {}) {\n const { em } = this;\n const { type, tagName, name } = this.attributes;\n const defName = type || tagName;\n const nameTag = !type ? tagName : '';\n const i18nPfx = 'domComponents.names.';\n const i18nName = name && em?.t(`${i18nPfx}${name}`);\n const i18nNameTag = nameTag && em?.t(`${i18nPfx}${nameTag}`);\n const i18nDefName = em && (em.t(`${i18nPfx}${type}`) || em.t(`${i18nPfx}${tagName}`));\n const customName = this.get('custom-name');\n\n return (\n (!opts.noCustom ? customName : '') || // Used in Layers (when the user changes the name)\n i18nName || // Use local component `name` key (eg. `domComponents.names.myComponentName`)\n name || // Use component `name` key\n i18nNameTag || // Use local component `tagName` key (eg. `domComponents.names.div`)\n capitalize(nameTag) || // Use component `tagName` key\n i18nDefName || // Use local component `type` key (eg. `domComponents.names.image`)\n capitalize(defName) // Use component `type` key\n );\n }\n\n /**\n * Update component name.\n * @param {String} name New name.\n */\n setName(name?: string, opts: SetOptions = {}) {\n this.set('custom-name', name, opts);\n }\n\n /**\n * Get the icon string\n * @return {String}\n */\n getIcon() {\n let icon = this.get('icon');\n return icon ? icon + ' ' : '';\n }\n\n /**\n * Return HTML string of the component\n * @param {Object} [opts={}] Options\n * @param {String} [opts.tag] Custom tagName\n * @param {Object|Function} [opts.attributes=null] You can pass an object of custom attributes to replace with the current ones or you can even pass a function to generate attributes dynamically.\n * @param {Boolean} [opts.withProps] Include component properties as `data-gjs-*` attributes. This allows you to have re-importable HTML.\n * @param {Boolean} [opts.altQuoteAttr] In case the attribute value contains a `\"` char, instead of escaping it (`attr=\"value "\"`), the attribute will be quoted using single quotes (`attr='value \"'`).\n * @return {String} HTML string\n * @example\n * // Simple HTML return\n * component.set({ tagName: 'span' });\n * component.setAttributes({ title: 'Hello' });\n * component.toHTML();\n * // -> \n *\n * // Custom attributes\n * component.toHTML({ attributes: { 'data-test': 'Hello' } });\n * // -> \n *\n * // Custom dynamic attributes\n * component.toHTML({\n * attributes(component, attributes) {\n * if (component.get('tagName') == 'span') {\n * attributes.title = 'Custom attribute';\n * }\n * return attributes;\n * },\n * });\n * // -> \n */\n toHTML(opts: ToHTMLOptions = {}): string {\n const model = this;\n const attrs = [];\n const customTag = opts.tag;\n const tag = customTag || model.get('tagName');\n const sTag = model.get('void');\n const customAttr = opts.attributes;\n let attributes = this.getAttrToHTML(opts);\n delete opts.tag;\n\n // Get custom attributes if requested\n if (customAttr) {\n if (isFunction(customAttr)) {\n attributes = customAttr(model, attributes) || {};\n } else if (isObject(customAttr)) {\n attributes = customAttr;\n }\n }\n\n if (opts.withProps) {\n const props = this.toJSON();\n\n forEach(props, (value, key) => {\n const skipProps = ['classes', 'attributes', 'components'];\n if (key[0] !== '_' && skipProps.indexOf(key) < 0) {\n attributes[`data-gjs-${key}`] =\n isArray(value) || isObject(value) ? JSON.stringify(value) : isBoolean(value) ? `${value}` : value;\n }\n });\n }\n\n for (let attr in attributes) {\n const val = attributes[attr];\n\n if (!isUndefined(val) && val !== null) {\n if (isBoolean(val)) {\n val && attrs.push(attr);\n } else {\n let valueRes = '';\n if (opts.altQuoteAttr && isString(val) && val.indexOf('\"') >= 0) {\n valueRes = `'${val.replace(/'/g, ''')}'`;\n } else {\n const value = isString(val) ? val.replace(/\"/g, '"') : val;\n valueRes = `\"${value}\"`;\n }\n\n attrs.push(`${attr}=${valueRes}`);\n }\n }\n }\n\n const attrString = attrs.length ? ` ${attrs.join(' ')}` : '';\n const inner = model.getInnerHTML(opts);\n let code = `<${tag}${attrString}${sTag ? '/' : ''}>${inner}`;\n !sTag && (code += ``);\n\n return code;\n }\n\n /**\n * Get inner HTML of the component\n * @param {Object} [opts={}] Same options of `toHTML`\n * @returns {String} HTML string\n */\n getInnerHTML(opts?: ToHTMLOptions) {\n return this.__innerHTML(opts);\n }\n\n __innerHTML(opts: ToHTMLOptions = {}) {\n const cmps = this.components();\n return !cmps.length ? this.content : cmps.map(c => c.toHTML(opts)).join('');\n }\n\n /**\n * Returns object of attributes for HTML\n * @return {Object}\n * @private\n */\n getAttrToHTML(opts?: ToHTMLOptions) {\n const attrs = this.getAttributes();\n\n if (avoidInline(this.em) && opts?.keepInlineStyle !== true) {\n delete attrs.style;\n }\n\n return attrs;\n }\n\n /**\n * Return a shallow copy of the model's attributes for JSON\n * stringification.\n * @return {Object}\n * @private\n */\n toJSON(opts: ObjectAny = {}): ComponentDefinition {\n const obj = Model.prototype.toJSON.call(this, opts);\n obj.attributes = this.getAttributes();\n delete obj.attributes.class;\n delete obj.toolbar;\n delete obj.traits;\n delete obj.status;\n delete obj.open; // used in Layers\n delete obj._undoexc;\n delete obj.delegate;\n\n if (!opts.fromUndo) {\n const symbol = obj[keySymbol];\n const symbols = obj[keySymbols];\n if (symbols && isArray(symbols)) {\n obj[keySymbols] = symbols.filter(i => i).map(i => (i.getId ? i.getId() : i));\n }\n if (symbol && !isString(symbol)) {\n obj[keySymbol] = symbol.getId();\n }\n }\n\n if (this.em.getConfig().avoidDefaults) {\n this.getChangedProps(obj);\n }\n\n return obj;\n }\n\n /**\n * Return an object containing only changed props\n */\n getChangedProps(res: Partial): Partial {\n const obj: any = res || Model.prototype.toJSON.apply(this);\n const defaults = result(this, 'defaults');\n\n forEach(defaults, (value, key) => {\n if (['type'].indexOf(key) === -1 && obj[key] === value) {\n delete obj[key];\n }\n });\n\n if (isEmpty(obj.type)) {\n delete obj.type;\n }\n\n forEach(['attributes', 'style'], prop => {\n if (isEmpty(defaults[prop]) && isEmpty(obj[prop])) {\n delete obj[prop];\n }\n });\n\n forEach(['classes', 'components'], prop => {\n if (!obj[prop] || (isEmpty(defaults[prop]) && !obj[prop].length)) {\n delete obj[prop];\n }\n });\n\n return obj;\n }\n\n /**\n * Return the component id\n * @return {String}\n */\n getId(): string {\n let attrs = this.get('attributes') || {};\n return attrs.id || this.ccid || this.cid;\n }\n\n /**\n * Set new id on the component\n * @param {String} id\n * @return {this}\n */\n setId(id: string, opts?: SetOptions & { idUpdate?: boolean }) {\n const attrs = { ...this.get('attributes') };\n attrs.id = id;\n this.set('attributes', attrs, opts);\n return this;\n }\n\n /**\n * Get the DOM element of the component.\n * This works only if the component is already rendered\n * @param {Frame} frame Specific frame from which taking the element\n * @return {HTMLElement}\n */\n getEl(frame?: Frame) {\n const view = this.getView(frame);\n return view && view.el;\n }\n\n /**\n * Get the View of the component.\n * This works only if the component is already rendered\n * @param {Frame} frame Get View of a specific frame\n * @return {ComponentView}\n */\n getView(frame?: Frame) {\n let { view, views, em } = this;\n const frm = frame || em?.getCurrentFrameModel();\n\n if (frm) {\n view = views.filter(view => view.frameView === frm.view)[0];\n }\n\n return view;\n }\n\n getCurrentView() {\n const frameView = this.em.getCurrentFrame();\n const frame = frameView?.model;\n return this.getView(frame);\n }\n\n __getScriptProps() {\n const modelProps = this.props();\n const scrProps = this.get('script-props') || [];\n return scrProps.reduce((acc, prop) => {\n acc[prop] = modelProps[prop];\n return acc;\n }, {} as Partial);\n }\n\n /**\n * Return script in string format, cleans 'function() {..' from scripts\n * if it's a function\n * @param {string|Function} script\n * @return {string}\n * @private\n */\n getScriptString(script?: string | Function) {\n let scr = script || this.get('script') || '';\n\n if (!scr) {\n return scr;\n }\n\n if (this.get('script-props')) {\n scr = scr.toString().trim();\n } else {\n // Deprecated\n // Need to convert script functions to strings\n if (isFunction(scr)) {\n let scrStr = scr.toString().trim();\n scrStr = scrStr.slice(scrStr.indexOf('{') + 1, scrStr.lastIndexOf('}'));\n scr = scrStr.trim();\n }\n\n const config = this.em.getConfig();\n const tagVarStart = escapeRegExp(config.tagVarStart || '{[ ');\n const tagVarEnd = escapeRegExp(config.tagVarEnd || ' ]}');\n const reg = new RegExp(`${tagVarStart}([\\\\w\\\\d-]*)${tagVarEnd}`, 'g');\n scr = scr.replace(reg, (match, v) => {\n // If at least one match is found I have to track this change for a\n // better optimization inside JS generator\n this.scriptUpdated();\n const result = this.attributes[v] || '';\n return isArray(result) || typeof result == 'object' ? JSON.stringify(result) : result;\n });\n }\n return scr;\n }\n\n emitUpdate(property?: string, ...args: any[]) {\n const { em } = this;\n const event = keyUpdate + (property ? `:${property}` : '');\n const item = property && this.get(property);\n // @ts-ignore\n property && this.updated(property, item, property && this.previous(property), ...args);\n this.trigger(event, ...args);\n em && em.trigger(event, this, ...args);\n ['components', 'classes'].indexOf(property!) >= 0 &&\n this.__propSelfToParent({\n component: this,\n changed: { [property!]: item },\n options: args[2] || args[1] || {},\n });\n }\n\n /**\n * Execute callback function on itself and all inner components\n * @param {Function} clb Callback function, the model is passed as an argument\n * @return {this}\n * @example\n * component.onAll(component => {\n * // do something with component\n * })\n */\n onAll(clb: (cmp: Component) => void) {\n if (isFunction(clb)) {\n clb(this);\n this.components().forEach(model => model.onAll(clb));\n }\n return this;\n }\n\n /**\n * Execute a callback function on all inner child components.\n * @param {Function} clb Callback function, the child component is passed as an argument\n * @example\n * component.forEachChild(child => {\n * console.log(child)\n * })\n */\n forEachChild(clb: (child: Component) => void) {\n if (isFunction(clb)) {\n this.components().forEach(child => {\n clb(child);\n child.forEachChild(clb);\n });\n }\n }\n\n /**\n * Remove the component\n * @return {this}\n */\n remove(opts: any = {}) {\n const { em } = this;\n const coll = this.collection;\n const remove = () => {\n coll && coll.remove(this, { action: ActionLabelComponents.remove, ...opts });\n // Component without parent\n if (!coll) {\n this.components('', opts);\n this.components().removeChildren(this, undefined, opts);\n }\n };\n const rmOpts = { ...opts };\n [this, em].map(i => i.trigger(ComponentsEvents.removeBefore, this, remove, rmOpts));\n !rmOpts.abort && remove();\n return this;\n }\n\n /**\n * Move the component to another destination component\n * @param {Component} component Destination component (so the current one will be appended as a child)\n * @param {Object} opts Options for the append action\n * @returns {this}\n * @example\n * // Move the selected component on top of the wrapper\n * const dest = editor.getWrapper();\n * editor.getSelected().move(dest, { at: 0 });\n */\n move(component: Component, opts: AddOptions = {}) {\n if (component) {\n const { at } = opts;\n const index = this.index();\n const sameParent = component === this.parent();\n const sameIndex = index === at || index === at! - 1;\n\n if (!sameParent || !sameIndex) {\n if (sameParent && at && at > index) {\n opts.at = at - 1;\n }\n const action = ActionLabelComponents.move;\n this.remove({ action, temporary: 1 });\n component.append(this, { action, ...opts });\n this.emitUpdate();\n }\n }\n return this;\n }\n\n /**\n * Check if the component is an instance of some component type.\n * @param {String} type Component type\n * @returns {Boolean}\n * @example\n * // Add a new component type by extending an existing one\n * editor.Components.addType('text-ext', { extend: 'text' });\n * // Append a new component somewhere\n * const newTextExt = editor.getSelected().append({ type: 'text-ext' })[0];\n * newTextExt.isInstanceOf('text-ext'); // true\n * newTextExt.isInstanceOf('text'); // true\n */\n isInstanceOf(type: string) {\n const cmp = this.em?.Components.getType(type)?.model;\n\n if (!cmp) return false;\n\n // A tiny hack to make isInstanceOf work properly where there a multiple inheritance\n const { typeExtends } = this.constructor as typeof Component;\n\n return this instanceof cmp || typeExtends.has(type);\n }\n\n /**\n * Check if the component is a child of some other component (or component type)\n * @param {[Component]|String} component Component parent to check. In case a string is passed,\n * the check will be performed on the component type.\n * @returns {Boolean}\n * @example\n * const newTextComponent = editor.getSelected().append({\n * type: 'text',\n * components: 'My text here',\n * })[0];\n * const innerComponent = newTextComponent.find('b')[0];\n * innerComponent.isChildOf(newTextComponent); // true\n * innerComponent.isChildOf('text'); // true\n */\n isChildOf(component: string | Component) {\n const byType = isString(component);\n let parent = this.parent();\n\n while (parent) {\n if (byType) {\n if (parent.isInstanceOf(component)) {\n return true;\n }\n } else {\n if (parent === component) {\n return true;\n }\n }\n\n parent = parent.parent();\n }\n\n return false;\n }\n\n /**\n * Reset id of the component and any of its style rule\n * @param {Object} [opts={}] Options\n * @return {this}\n * @private\n */\n resetId(opts = {}) {\n const { em } = this;\n const oldId = this.getId();\n if (!oldId) return this;\n const newId = Component.createId(this);\n this.setId(newId);\n const rule = em?.Css.getIdRule(oldId);\n const selector = rule?.get('selectors')!.at(0);\n selector?.set('name', newId);\n return this;\n }\n\n _getStyleRule({ id }: { id?: string } = {}) {\n const { em } = this;\n const idS = id || this.getId();\n return em?.Css.getIdRule(idS);\n }\n\n _getStyleSelector(opts?: { id?: string }) {\n const rule = this._getStyleRule(opts);\n return rule?.get('selectors')!.at(0);\n }\n\n _idUpdated(m: any, v: any, opts: { idUpdate?: boolean } = {}) {\n if (opts.idUpdate) return;\n\n const { ccid } = this;\n const { id } = this.get('attributes') || {};\n const idPrev = (this.previous('attributes') || {}).id || ccid;\n const list = Component.getList(this);\n\n // If the ID already exists I need to rollback to the old one\n if (list[id] || (!id && idPrev)) {\n return this.setId(idPrev, { idUpdate: true });\n }\n\n // Remove the old ID reference and add the new one\n delete list[idPrev];\n list[id] = this;\n this.ccid = id;\n\n // Update the style selector name\n const selector = this._getStyleSelector({ id: idPrev });\n selector && selector.set({ name: id, label: id });\n }\n\n static typeExtends = new Set();\n\n static getDefaults() {\n return result(this.prototype, 'defaults');\n }\n\n static isComponent(el: HTMLElement, opts?: any): ComponentDefinitionDefined | boolean | undefined {\n return { tagName: toLowerCase(el.tagName) };\n }\n\n static ensureInList(model: Component) {\n const list = Component.getList(model);\n const id = model.getId();\n const current = list[id];\n\n if (!current) {\n // Insert in list\n list[id] = model;\n } else if (current !== model) {\n // Create new ID\n const nextId = Component.getIncrementId(id, list);\n model.setId(nextId);\n list[nextId] = model;\n }\n\n model.components().forEach(i => Component.ensureInList(i));\n }\n\n static createId(model: Component, opts: any = {}) {\n const list = Component.getList(model);\n const { idMap = {} } = opts;\n let { id } = model.get('attributes')!;\n let nextId;\n\n if (id) {\n nextId = Component.getIncrementId(id, list, opts);\n model.setId(nextId);\n if (id !== nextId) idMap[id] = nextId;\n } else {\n nextId = Component.getNewId(list);\n }\n\n list[nextId] = model;\n return nextId;\n }\n\n static getNewId(list: ObjectAny) {\n const count = Object.keys(list).length;\n // Testing 1000000 components with `+ 2` returns 0 collisions\n const ilen = count.toString().length + 2;\n const uid = (Math.random() + 1.1).toString(36).slice(-ilen);\n let newId = `i${uid}`;\n\n while (list[newId]) {\n newId = Component.getNewId(list);\n }\n\n return newId;\n }\n\n static getIncrementId(id: string, list: ObjectAny, opts: { keepIds?: string[] } = {}) {\n const { keepIds = [] } = opts;\n let counter = 1;\n let newId = id;\n\n if (keepIds.indexOf(id) < 0) {\n while (list[newId]) {\n counter++;\n newId = `${id}-${counter}`;\n }\n }\n\n return newId;\n }\n\n static getList(model: Component) {\n const { em } = model;\n const dm = em?.Components;\n return dm?.componentsById ?? {};\n }\n\n static checkId(\n components: ComponentDefinitionDefined | ComponentDefinitionDefined[],\n styles: CssRuleJSON[] = [],\n list: ObjectAny = {},\n opts: { keepIds?: string[]; idMap?: PrevToNewIdMap } = {}\n ) {\n const comps = isArray(components) ? components : [components];\n const { keepIds = [], idMap = {} } = opts;\n comps.forEach(comp => {\n comp.attributes;\n const { attributes = {}, components } = comp;\n const { id } = attributes;\n\n // Check if we have collisions with current components\n if (id && list[id] && keepIds.indexOf(id) < 0) {\n const newId = Component.getIncrementId(id, list);\n idMap[id] = newId;\n attributes.id = newId;\n // Update passed styles\n isArray(styles) &&\n styles.forEach(style => {\n const { selectors } = style;\n selectors.forEach((sel, idx) => {\n if (sel === `#${id}`) selectors[idx] = `#${newId}`;\n });\n });\n }\n\n components && Component.checkId(components, styles, list, opts);\n });\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\nimport { DraggableDroppableFn } from './types';\n\nexport const type = 'head';\nconst droppable = ['title', 'style', 'base', 'link', 'meta', 'script', 'noscript'];\n\nexport default class ComponentHead extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n draggable: false,\n highlightable: false,\n droppable: (({ tagName }) => !tagName || droppable.includes(toLowerCase(tagName))) as DraggableDroppableFn,\n };\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import { bindAll, indexOf } from 'underscore';\nimport CanvasModule from '../canvas';\nimport { ObjectStrings } from '../common';\nimport EditorModel from '../editor/model/Editor';\nimport { getDocumentScroll, off, on } from './dom';\n\n// TODO move in sorter\ntype SorterOptions = {\n sorter: any;\n event: any;\n};\n\ntype DragStop = (cancel?: boolean) => void;\n\ntype DragContent = (content: any) => void;\n\n/**\n * This class makes the canvas droppable\n */\nexport default class Droppable {\n em: EditorModel;\n canvas: CanvasModule;\n el: HTMLElement;\n counter: number;\n sortOpts?: Record | null;\n over?: boolean;\n dragStop?: DragStop;\n dragContent?: DragContent;\n sorter?: any;\n\n constructor(em: EditorModel, rootEl?: HTMLElement) {\n this.em = em;\n this.canvas = em.Canvas;\n const el = rootEl || this.canvas.getFrames().map(frame => frame.getComponent().getEl()!);\n const els = Array.isArray(el) ? el : [el];\n this.el = els[0];\n this.counter = 0;\n bindAll(this, 'handleDragEnter', 'handleDragOver', 'handleDrop', 'handleDragLeave');\n els.forEach(el => this.toggleEffects(el, true));\n }\n\n toggleEffects(el: HTMLElement, enable: boolean) {\n const methods = { on, off };\n const method = enable ? 'on' : 'off';\n methods[method](el, 'dragenter', this.handleDragEnter);\n methods[method](el, 'dragover', this.handleDragOver);\n methods[method](el, 'drop', this.handleDrop);\n methods[method](el, 'dragleave', this.handleDragLeave);\n }\n\n __customTglEff(enable: boolean) {\n const method = enable ? on : off;\n const doc = this.el.ownerDocument;\n const frameEl = doc.defaultView?.frameElement as HTMLIFrameElement;\n this.sortOpts = enable\n ? {\n onStart({ sorter }: SorterOptions) {\n on(frameEl, 'pointermove', sorter.onMove);\n },\n onEnd({ sorter }: SorterOptions) {\n off(frameEl, 'pointermove', sorter.onMove);\n },\n customTarget({ event }: SorterOptions) {\n return doc.elementFromPoint(event.clientX, event.clientY);\n },\n }\n : null;\n method(frameEl, 'pointerenter', this.handleDragEnter);\n method(frameEl, 'pointermove', this.handleDragOver);\n method(document, 'pointerup', this.handleDrop);\n method(frameEl, 'pointerout', this.handleDragLeave);\n\n // Test with touch devices (seems like frameEl is not capturing pointer events).\n // on/off(document, 'pointermove', sorter.onMove); // for the sorter\n // enable && this.handleDragEnter({}); // no way to use pointerenter/pointerout\n }\n\n startCustom() {\n this.__customTglEff(true);\n }\n\n endCustom(cancel?: boolean) {\n this.over ? this.endDrop(cancel) : this.__customTglEff(false);\n }\n\n /**\n * This function is expected to be always executed at the end of d&d.\n */\n endDrop(cancel?: boolean, ev?: Event) {\n const { em, dragStop } = this;\n this.counter = 0;\n dragStop && dragStop(cancel || !this.over);\n this.__customTglEff(false);\n em.trigger('canvas:dragend', ev);\n }\n\n handleDragLeave(ev: Event) {\n this.updateCounter(-1, ev);\n }\n\n updateCounter(value: number, ev: Event) {\n this.counter += value;\n this.counter === 0 && this.endDrop(true, ev);\n }\n\n handleDragEnter(ev: DragEvent | Event) {\n const { em, canvas } = this;\n const dt = (ev as DragEvent).dataTransfer;\n const dragContentOrigin = em.get('dragContent');\n\n if (!dragContentOrigin && !canvas.getConfig().allowExternalDrop) {\n return;\n }\n\n this.updateCounter(1, ev);\n if (this.over) return;\n this.over = true;\n const utils = em.Utils;\n // For security reason I can't read the drag data on dragenter, but\n // as I need it for the Sorter context I will use `dragContent` or just\n // any not empty element\n let content = dragContentOrigin || '
';\n let dragStop: DragStop;\n let dragContent;\n em.stopDefault();\n\n // Select the right drag provider\n if (em.inAbsoluteMode()) {\n const wrapper = em.Components.getWrapper()!;\n const target = wrapper.append({})[0];\n const dragger = em.Commands.run('core:component-drag', {\n event: ev,\n guidesInfo: 1,\n center: 1,\n target,\n onEnd: (ev: any, dragger: any, { cancelled }: any) => {\n let comp;\n if (!cancelled) {\n comp = wrapper.append(content)[0];\n const canvasOffset = canvas.getOffset();\n const { top, left, position } = target.getStyle() as ObjectStrings;\n const scroll = getDocumentScroll(ev.target);\n const postLeft = parseInt(`${parseFloat(left) + scroll.x - canvasOffset.left}`, 10);\n const posTop = parseInt(`${parseFloat(top) + scroll.y - canvasOffset.top}`, 10);\n\n comp.addStyle({\n left: postLeft + 'px',\n top: posTop + 'px',\n position,\n });\n }\n this.handleDragEnd(comp, dt);\n target.remove();\n },\n });\n dragStop = (cancel?: boolean) => dragger.stop(ev, { cancel });\n dragContent = (cnt: any) => (content = cnt);\n } else {\n const sorter = new utils.Sorter({\n // @ts-ignore\n em,\n wmargin: 1,\n nested: 1,\n canvasRelative: 1,\n direction: 'a',\n container: this.el,\n placer: canvas.getPlacerEl(),\n containerSel: '*',\n itemSel: '*',\n pfx: 'gjs-',\n onEndMove: (model: any) => this.handleDragEnd(model, dt),\n document: this.el.ownerDocument,\n ...(this.sortOpts || {}),\n });\n sorter.setDropContent(content);\n sorter.startSort();\n this.sorter = sorter;\n dragStop = (cancel?: boolean) => {\n cancel && (sorter.moved = false);\n sorter.endMove();\n };\n dragContent = (content: any) => sorter.setDropContent(content);\n }\n\n this.dragStop = dragStop;\n this.dragContent = dragContent;\n em.trigger('canvas:dragenter', dt, content);\n }\n\n handleDragEnd(model: any, dt: any) {\n const { em } = this;\n this.over = false;\n if (model) {\n em.set('dragResult', model);\n em.trigger('canvas:drop', dt, model);\n }\n em.runDefault({ preserveSelected: 1 });\n }\n\n /**\n * Always need to have this handler active for enabling the drop\n * @param {Event} ev\n */\n handleDragOver(ev: Event) {\n ev.preventDefault();\n this.em.trigger('canvas:dragover', ev);\n }\n\n /**\n * WARNING: This function might fail to run on drop, for example, when the\n * drop, accidentally, happens on some external element (DOM not inside the iframe)\n */\n handleDrop(ev: Event | DragEvent) {\n ev.preventDefault();\n const { dragContent } = this;\n const dt = (ev as DragEvent).dataTransfer;\n const content = this.getContentByData(dt).content;\n (ev.target as HTMLElement).style.border = '';\n content && dragContent && dragContent(content);\n this.endDrop(!content, ev);\n }\n\n getContentByData(dt: any) {\n const em = this.em;\n const types = dt && dt.types;\n const files = (dt && dt.files) || [];\n const dragContent = em.get('dragContent');\n let content = dt && dt.getData('text');\n\n if (files.length) {\n content = [];\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n const type = file.type.split('/')[0];\n\n if (type == 'image') {\n content.push({\n type,\n file,\n attributes: { alt: file.name },\n });\n }\n }\n } else if (dragContent) {\n content = dragContent;\n } else if (indexOf(types, 'text/html') >= 0) {\n content = dt && dt.getData('text/html').replace(/<\\/?meta[^>]*>/g, '');\n } else if (indexOf(types, 'text/uri-list') >= 0) {\n content = {\n type: 'link',\n attributes: { href: content },\n content: content,\n };\n } else if (indexOf(types, 'text/json') >= 0) {\n const json = dt && dt.getData('text/json');\n json && (content = JSON.parse(json));\n } else if (types.length === 1 && types[0] === 'text/plain') {\n // Avoid dropping non-selectable and non-editable text nodes inside the editor\n content = `
${content}
`;\n }\n\n const result = { content };\n em.trigger('canvas:dragdata', dt, result);\n\n return result;\n }\n}\n","import { bindAll, debounce, isString, isUndefined } from 'underscore';\nimport { ModuleView } from '../../abstract';\nimport { BoxRect, ObjectAny } from '../../common';\nimport CssRulesView from '../../css_composer/view/CssRulesView';\nimport ComponentWrapperView from '../../dom_components/view/ComponentWrapperView';\nimport ComponentView from '../../dom_components/view/ComponentView';\nimport { type as typeHead } from '../../dom_components/model/ComponentHead';\nimport Droppable from '../../utils/Droppable';\nimport {\n append,\n appendVNodes,\n createCustomEvent,\n createEl,\n getPointerEvent,\n motionsEv,\n off,\n on,\n} from '../../utils/dom';\nimport { hasDnd, setViewEl } from '../../utils/mixins';\nimport Canvas from '../model/Canvas';\nimport Frame from '../model/Frame';\nimport FrameWrapView from './FrameWrapView';\nimport CanvasEvents from '../types';\n\nexport default class FrameView extends ModuleView {\n /** @ts-ignore */\n get tagName() {\n return 'iframe';\n }\n /** @ts-ignore */\n get attributes() {\n return { allowfullscreen: 'allowfullscreen' };\n }\n\n dragging = false;\n loaded = false;\n droppable?: Droppable;\n rect?: DOMRect;\n\n lastClientY?: number;\n lastMaxHeight = 0;\n private jsContainer?: HTMLElement;\n private tools: { [key: string]: HTMLElement } = {};\n private wrapper?: ComponentWrapperView;\n private headView?: ComponentView;\n private frameWrapView?: FrameWrapView;\n\n constructor(model: Frame, view?: FrameWrapView) {\n super({ model });\n bindAll(this, 'updateClientY', 'stopAutoscroll', 'autoscroll', '_emitUpdate');\n const { el } = this;\n //@ts-ignore\n this.module._config = {\n ...(this.config || {}),\n //@ts-ignore\n frameView: this,\n //canvasView: view?.cv\n };\n this.frameWrapView = view;\n this.showGlobalTools = debounce(this.showGlobalTools.bind(this), 50);\n const cvModel = this.getCanvasModel();\n this.listenTo(model, 'change:head', this.updateHead);\n this.listenTo(cvModel, 'change:styles', this.renderStyles);\n model.view = this;\n setViewEl(el, this);\n }\n\n getBoxRect(): BoxRect {\n const { el, module } = this;\n const canvasView = module.getCanvasView();\n const coords = module.getCoords();\n const frameRect = el.getBoundingClientRect();\n const canvasRect = canvasView.getCanvasOffset();\n const vwDelta = canvasView.getViewportDelta();\n const zoomM = module.getZoomMultiplier();\n const x = (frameRect.x - canvasRect.left - vwDelta.x - coords.x) * zoomM;\n const y = (frameRect.y - canvasRect.top - vwDelta.y - coords.y) * zoomM;\n const width = frameRect.width * zoomM;\n const height = frameRect.height * zoomM;\n\n return {\n x,\n y,\n width,\n height,\n };\n }\n\n /**\n * Update `` content of the frame\n */\n updateHead() {\n const { model } = this;\n const headEl = this.getHead();\n const toRemove: any[] = [];\n const toAdd: any[] = [];\n const current = model.head;\n const prev = model.previous('head');\n const attrStr = (attr: any = {}) =>\n Object.keys(attr)\n .sort()\n .map(i => `[${i}=\"${attr[i]}\"]`)\n .join('');\n const find = (items: any[], stack: any[], res: any[]) => {\n items.forEach(item => {\n const { tag, attributes } = item;\n const has = stack.some(s => s.tag === tag && attrStr(s.attributes) === attrStr(attributes));\n !has && res.push(item);\n });\n };\n find(current, prev, toAdd);\n find(prev, current, toRemove);\n toRemove.forEach(stl => {\n const el = headEl.querySelector(`${stl.tag}${attrStr(stl.attributes)}`);\n el?.parentNode?.removeChild(el);\n });\n appendVNodes(headEl, toAdd);\n }\n\n getEl() {\n return this.el;\n }\n\n getCanvasModel(): Canvas {\n return this.em.Canvas.getModel();\n }\n\n getWindow() {\n return this.getEl().contentWindow as Window;\n }\n\n getDoc() {\n return this.getEl().contentDocument as Document;\n }\n\n getHead() {\n return this.getDoc().querySelector('head') as HTMLHeadElement;\n }\n\n getBody() {\n return this.getDoc().querySelector('body') as HTMLBodyElement;\n }\n\n getWrapper() {\n return this.getBody().querySelector('[data-gjs-type=wrapper]') as HTMLElement;\n }\n\n getJsContainer() {\n if (!this.jsContainer) {\n this.jsContainer = createEl('div', { class: `${this.ppfx}js-cont` });\n }\n\n return this.jsContainer;\n }\n\n getToolsEl() {\n return this.frameWrapView?.elTools as HTMLElement;\n }\n\n getGlobalToolsEl() {\n return this.em.Canvas.getGlobalToolsEl()!;\n }\n\n getHighlighter() {\n return this._getTool('[data-hl]');\n }\n\n getBadgeEl() {\n return this._getTool('[data-badge]');\n }\n\n getOffsetViewerEl() {\n return this._getTool('[data-offset]');\n }\n\n getRect() {\n if (!this.rect) {\n this.rect = this.el.getBoundingClientRect();\n }\n\n return this.rect;\n }\n\n /**\n * Get rect data, not affected by the canvas zoom\n */\n getOffsetRect() {\n const { el } = this;\n const { scrollTop, scrollLeft } = this.getBody();\n const height = el.offsetHeight;\n const width = el.offsetWidth;\n\n return {\n top: el.offsetTop,\n left: el.offsetLeft,\n height,\n width,\n scrollTop,\n scrollLeft,\n scrollBottom: scrollTop + height,\n scrollRight: scrollLeft + width,\n };\n }\n\n _getTool(name: string) {\n const { tools } = this;\n const toolsEl = this.getToolsEl();\n\n if (!tools[name]) {\n tools[name] = toolsEl.querySelector(name) as HTMLElement;\n }\n\n return tools[name];\n }\n\n remove(...args: any) {\n this._toggleEffects(false);\n this.tools = {};\n this.wrapper?.remove();\n ModuleView.prototype.remove.apply(this, args);\n return this;\n }\n\n startAutoscroll() {\n this.lastMaxHeight = this.getWrapper().offsetHeight - this.el.offsetHeight;\n\n // By detaching those from the stack avoid browsers lags\n // Noticeable with \"fast\" drag of blocks\n setTimeout(() => {\n this._toggleAutoscrollFx(true);\n requestAnimationFrame(this.autoscroll);\n }, 0);\n }\n\n autoscroll() {\n if (this.dragging) {\n const { lastClientY } = this;\n const canvas = this.em.Canvas;\n const win = this.getWindow();\n const actualTop = win.pageYOffset;\n const clientY = lastClientY || 0;\n const limitTop = canvas.getConfig().autoscrollLimit!;\n const limitBottom = this.getRect().height - limitTop;\n let nextTop = actualTop;\n\n if (clientY < limitTop) {\n nextTop -= limitTop - clientY;\n }\n\n if (clientY > limitBottom) {\n nextTop += clientY - limitBottom;\n }\n\n if (\n !isUndefined(lastClientY) && // Fixes #3134\n nextTop !== actualTop &&\n nextTop > 0 &&\n nextTop < this.lastMaxHeight\n ) {\n const toolsEl = this.getGlobalToolsEl();\n toolsEl.style.opacity = '0';\n this.showGlobalTools();\n win.scrollTo(0, nextTop);\n canvas.spots.refreshDbn();\n }\n\n requestAnimationFrame(this.autoscroll);\n }\n }\n\n updateClientY(ev: Event) {\n ev.preventDefault();\n this.lastClientY = getPointerEvent(ev).clientY * this.em.getZoomDecimal();\n }\n\n showGlobalTools() {\n this.getGlobalToolsEl().style.opacity = '';\n }\n\n stopAutoscroll() {\n this.dragging && this._toggleAutoscrollFx(false);\n }\n\n _toggleAutoscrollFx(enable: boolean) {\n this.dragging = enable;\n const win = this.getWindow();\n const method = enable ? 'on' : 'off';\n const mt = { on, off };\n mt[method](win, 'mousemove dragover', this.updateClientY);\n mt[method](win, 'mouseup', this.stopAutoscroll);\n }\n\n render() {\n const { $el, ppfx, em } = this;\n $el.attr({ class: `${ppfx}frame` });\n this.renderScripts();\n em.trigger('frame:render', this); // deprecated\n return this;\n }\n\n renderScripts() {\n const { el, model, em } = this;\n const evLoad = 'frame:load';\n const evOpts: ObjectAny = { el, model, view: this };\n const canvas = this.getCanvasModel();\n const appendScript = (scripts: any[]) => {\n if (scripts.length > 0) {\n const src = scripts.shift();\n const scriptEl = createEl('script', {\n type: 'text/javascript',\n ...(isString(src) ? { src } : src),\n });\n el.contentDocument?.head.appendChild(scriptEl);\n\n if (scriptEl.hasAttribute('nomodule') && 'noModule' in HTMLScriptElement.prototype) {\n appendScript(scripts);\n } else {\n scriptEl.onerror = scriptEl.onload = appendScript.bind(null, scripts);\n }\n } else {\n em?.trigger(CanvasEvents.frameLoadHead, evOpts);\n this.renderBody();\n em?.trigger(CanvasEvents.frameLoadBody, evOpts);\n em?.trigger(evLoad, evOpts); // deprecated\n }\n };\n\n el.onload = () => {\n const { frameContent } = this.config;\n if (frameContent) {\n const doc = this.getDoc();\n doc.open();\n doc.write(frameContent);\n doc.close();\n }\n evOpts.window = this.getWindow();\n em?.trigger(`${evLoad}:before`, evOpts); // deprecated\n em?.trigger(CanvasEvents.frameLoad, evOpts);\n this.renderHead();\n appendScript([...canvas.get('scripts')]);\n };\n }\n\n renderStyles(opts: any = {}) {\n const head = this.getHead();\n const canvas = this.getCanvasModel();\n const normalize = (stls: any[]) =>\n stls.map(href => ({\n tag: 'link',\n attributes: {\n rel: 'stylesheet',\n ...(isString(href) ? { href } : href),\n },\n }));\n const prevStyles = normalize(opts.prev || canvas.previous('styles'));\n const styles = normalize(canvas.get('styles'));\n const toRemove: any[] = [];\n const toAdd: any[] = [];\n const find = (items: any[], stack: any[], res: any[]) => {\n items.forEach(item => {\n const { href } = item.attributes;\n const has = stack.some(s => s.attributes.href === href);\n !has && res.push(item);\n });\n };\n find(styles, prevStyles, toAdd);\n find(prevStyles, styles, toRemove);\n toRemove.forEach(stl => {\n const el = head.querySelector(`link[href=\"${stl.attributes.href}\"]`);\n el?.parentNode?.removeChild(el);\n });\n appendVNodes(head, toAdd);\n }\n\n renderHead() {\n const { model, em } = this;\n const { root } = model;\n const HeadView = em.Components.getType(typeHead)!.view;\n this.headView = new HeadView({\n el: this.getHead(),\n model: root.head,\n config: {\n ...root.config,\n frameView: this,\n },\n }).render();\n }\n\n renderBody() {\n const { config, em, model, ppfx } = this;\n const doc = this.getDoc();\n const body = this.getBody();\n const win = this.getWindow();\n const hasAutoHeight = model.hasAutoHeight();\n const conf = em.config;\n //@ts-ignore This could be used inside component-related scripts to check if the\n // script is executed inside the editor.\n win._isEditor = true;\n this.renderStyles({ prev: [] });\n\n const colorWarn = '#ffca6f';\n\n append(\n body,\n ``\n );\n const { root } = model;\n const { view } = em.Components.getType('wrapper')!;\n this.wrapper = new view({\n model: root,\n config: {\n ...root.config,\n em,\n frameView: this,\n },\n }).render();\n append(body, this.wrapper?.el!);\n append(\n body,\n new CssRulesView({\n collection: model.getStyles(),\n //@ts-ignore\n config: {\n ...em.Css.getConfig(),\n frameView: this,\n },\n }).render().el\n );\n append(body, this.getJsContainer());\n // em.trigger('loaded'); // I need to manage only the first one maybe\n //this.updateOffset(); // TOFIX (check if I need it)\n\n // Avoid some default behaviours\n //@ts-ignore\n on(body, 'click', ev => ev && ev.target?.tagName == 'A' && ev.preventDefault());\n on(body, 'submit', ev => ev && ev.preventDefault());\n\n // When the iframe is focused the event dispatcher is not the same so\n // I need to delegate all events to the parent document\n [\n { event: 'keydown keyup keypress', class: 'KeyboardEvent' },\n { event: 'mousedown mousemove mouseup', class: 'MouseEvent' },\n { event: 'pointerdown pointermove pointerup', class: 'PointerEvent' },\n { event: 'wheel', class: 'WheelEvent', opts: { passive: !config.infiniteCanvas } },\n ].forEach(obj =>\n obj.event.split(' ').forEach(event => {\n doc.addEventListener(event, ev => this.el.dispatchEvent(createCustomEvent(ev, obj.class)), obj.opts);\n })\n );\n\n this._toggleEffects(true);\n\n if (hasDnd(em)) {\n this.droppable = new Droppable(em, this.wrapper?.el);\n }\n\n this.loaded = true;\n model.trigger('loaded');\n }\n\n _toggleEffects(enable: boolean) {\n const method = enable ? on : off;\n const win = this.getWindow();\n win && method(win, `${motionsEv} resize`, this._emitUpdate);\n }\n\n _emitUpdate() {\n this.model._emitUpdated();\n }\n}\n","import { bindAll, isNumber, isNull, debounce } from 'underscore';\nimport { ModuleView } from '../../abstract';\nimport FrameView from './FrameView';\nimport { createEl, removeEl } from '../../utils/dom';\nimport Dragger from '../../utils/Dragger';\nimport CanvasView from './CanvasView';\nimport Frame from '../model/Frame';\n\nexport default class FrameWrapView extends ModuleView {\n events() {\n return {\n 'click [data-action-remove]': 'remove',\n 'mousedown [data-action-move]': 'startDrag',\n };\n }\n elTools?: HTMLElement;\n frame: FrameView;\n dragger?: Dragger;\n cv: CanvasView;\n classAnim: string;\n sizeObserver?: ResizeObserver;\n\n constructor(model: Frame, canvasView: CanvasView) {\n super({ model });\n bindAll(this, 'onScroll', 'frameLoaded', 'updateOffset', 'remove', 'startDrag');\n const config = {\n ...model.config,\n frameWrapView: this,\n };\n this.cv = canvasView;\n this.frame = new FrameView(model, this);\n this.classAnim = `${this.ppfx}frame-wrapper--anim`;\n this.updateOffset = debounce(this.updateOffset.bind(this), 0);\n this.updateSize = debounce(this.updateSize.bind(this), 0);\n this.listenTo(model, 'loaded', this.frameLoaded);\n this.listenTo(model, 'change:x change:y', this.updatePos);\n this.listenTo(model, 'change:width change:height', this.updateSize);\n this.listenTo(model, 'destroy remove', this.remove);\n this.updatePos();\n this.setupDragger();\n }\n\n setupDragger() {\n const { module, model } = this;\n let dragX: number, dragY: number, zoom: number;\n const toggleEffects = (on: boolean) => {\n module.toggleFramesEvents(on);\n };\n\n this.dragger = new Dragger({\n onStart: () => {\n const { x, y } = model.attributes;\n zoom = this.em.getZoomMultiplier();\n dragX = x;\n dragY = y;\n toggleEffects(false);\n },\n onEnd: () => toggleEffects(true),\n setPosition: (posOpts: any) => {\n model.set({\n x: dragX + posOpts.x * zoom,\n y: dragY + posOpts.y * zoom,\n });\n },\n });\n }\n\n startDrag(ev?: Event) {\n ev && this.dragger?.start(ev);\n }\n\n __clear(opts?: any) {\n const { frame } = this;\n frame && frame.remove(opts);\n removeEl(this.elTools);\n }\n\n remove(opts?: any) {\n this.__clear(opts);\n ModuleView.prototype.remove.apply(this, opts);\n //@ts-ignore\n ['frame', 'dragger', 'cv', 'elTools'].forEach(i => (this[i] = 0));\n return this;\n }\n\n updateOffset() {\n const { em, $el, frame } = this;\n if (!em || em.destroyed) return;\n em.runDefault({ preserveSelected: 1 });\n $el.removeClass(this.classAnim);\n frame?.model?._emitUpdated();\n }\n\n updatePos(md?: boolean) {\n const { model, el } = this;\n const { x, y } = model.attributes;\n const { style } = el;\n this.frame.rect = undefined;\n style.left = isNaN(x) ? x : `${x}px`;\n style.top = isNaN(y) ? y : `${y}px`;\n md && this.updateOffset();\n }\n\n updateSize() {\n this.updateDim();\n }\n\n /**\n * Update dimensions of the frame\n * @private\n */\n updateDim() {\n const { em, el, $el, model, classAnim, frame } = this;\n if (!frame) return;\n frame.rect = undefined;\n $el.addClass(classAnim);\n const { noChanges, width, height } = this.__handleSize();\n\n // Set width and height from DOM (should be done only once)\n if (isNull(width) || isNull(height)) {\n model.set(\n {\n ...(!width ? { width: el.offsetWidth } : {}),\n ...(!height ? { height: el.offsetHeight } : {}),\n },\n { silent: 1 }\n );\n }\n\n // Prevent fixed highlighting box which appears when on\n // component hover during the animation\n em.stopDefault({ preserveSelected: 1 });\n noChanges ? this.updateOffset() : setTimeout(this.updateOffset, 350);\n }\n\n onScroll() {\n const { frame, em } = this;\n em.trigger('frame:scroll', {\n frame,\n body: frame.getBody(),\n target: frame.getWindow(),\n });\n }\n\n frameLoaded() {\n const { frame, config } = this;\n frame.getWindow().onscroll = this.onScroll;\n this.updateDim();\n }\n\n __handleSize() {\n const un = 'px';\n const { model, el } = this;\n const { style } = el;\n const { width, height } = model.attributes;\n const currW = style.width || '';\n const currH = style.height || '';\n const newW = width || '';\n const newH = height || '';\n const noChanges = currW == newW && currH == newH;\n const newWidth = isNumber(newW) ? `${newW}${un}` : newW;\n const newHeight = isNumber(newH) ? `${newH}${un}` : newH;\n style.width = newWidth;\n\n if (model.hasAutoHeight()) {\n const iframe = this.frame.el;\n\n if (\n iframe.contentDocument\n // this doesn't work always\n // && !this.sizeObserver\n ) {\n const { contentDocument } = iframe;\n const observer = new ResizeObserver(() => {\n style.height = `${contentDocument.body.scrollHeight}px`;\n });\n observer.observe(contentDocument.body);\n this.sizeObserver?.disconnect();\n this.sizeObserver = observer;\n }\n } else {\n style.height = newHeight;\n this.sizeObserver?.disconnect();\n delete this.sizeObserver;\n }\n\n return { noChanges, width, height, newW, newH };\n }\n\n render() {\n const { frame, $el, ppfx, cv, model, el } = this;\n const { onRender } = model.attributes;\n this.__clear();\n this.__handleSize();\n frame.render();\n $el\n .empty()\n .attr({ class: `${ppfx}frame-wrapper` })\n .append(\n `\n
\n
\n ${model.get('name') || ''}\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n `\n )\n .append(frame.el);\n const elTools = createEl(\n 'div',\n {\n class: `${ppfx}tools`,\n style: 'pointer-events:none; display: none',\n },\n `\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n `\n );\n this.elTools = elTools;\n const twrp = cv?.toolsWrapper;\n twrp && twrp.appendChild(elTools); // TODO remove on frame remove\n onRender &&\n onRender({\n el,\n elTop: el.querySelector('[data-frame-top]'),\n elRight: el.querySelector('[data-frame-right]'),\n elBottom: el.querySelector('[data-frame-bottom]'),\n elLeft: el.querySelector('[data-frame-left]'),\n frame: model,\n frameWrapperView: this,\n remove: this.remove,\n startDrag: this.startDrag,\n });\n return this;\n }\n}\n","import CanvasModule from '..';\nimport ModuleDomainViews from '../../abstract/ModuleDomainViews';\nimport Frames from '../model/Frames';\nimport CanvasView from './CanvasView';\nimport FrameWrapView from './FrameWrapView';\n\nexport default class FramesView extends ModuleDomainViews {\n canvasView: CanvasView;\n private _module: CanvasModule;\n\n constructor(opts = {}, config: any) {\n super(opts, true);\n this.listenTo(this.collection, 'reset', this.render);\n this.canvasView = config.canvasView;\n this._module = config.module;\n }\n\n onRemoveBefore(items: FrameWrapView[], opts = {}) {\n items.forEach(item => item.remove(opts));\n }\n\n onRender() {\n const { $el, ppfx } = this;\n $el.attr({ class: `${ppfx}frames` });\n }\n\n clearItems() {\n const items = this.viewCollection || [];\n items.forEach(item => item.remove());\n this.viewCollection = [];\n }\n\n protected renderView(item: any, type: string) {\n return new FrameWrapView(item, this.canvasView);\n }\n}\n","import { bindAll, isNumber } from 'underscore';\nimport { ModuleView } from '../../abstract';\nimport { BoxRect, Coordinates, CoordinatesTypes, ElementRect } from '../../common';\nimport Component from '../../dom_components/model/Component';\nimport ComponentView from '../../dom_components/view/ComponentView';\nimport {\n createEl,\n getDocumentScroll,\n getElRect,\n getKeyChar,\n hasModifierKey,\n isTextNode,\n off,\n on,\n} from '../../utils/dom';\nimport { getComponentView, getElement, getUiClass } from '../../utils/mixins';\nimport Canvas from '../model/Canvas';\nimport Frame from '../model/Frame';\nimport { GetBoxRectOptions, ToWorldOption } from '../types';\nimport FrameView from './FrameView';\nimport FramesView from './FramesView';\n\nexport interface MarginPaddingOffsets {\n marginTop?: number;\n marginRight?: number;\n marginBottom?: number;\n marginLeft?: number;\n paddingTop?: number;\n paddingRight?: number;\n paddingBottom?: number;\n paddingLeft?: number;\n borderTopWidth?: number;\n borderRightWidth?: number;\n borderBottomWidth?: number;\n borderLeftWidth?: number;\n}\n\nexport type ElementPosOpts = {\n avoidFrameOffset?: boolean;\n avoidFrameZoom?: boolean;\n noScroll?: boolean;\n};\n\nexport interface FitViewportOptions {\n frame?: Frame;\n gap?: number | { x: number; y: number };\n ignoreHeight?: boolean;\n el?: HTMLElement;\n}\n\nexport default class CanvasView extends ModuleView {\n template() {\n const { pfx } = this;\n return `\n
\n
\n
\n
\n \n `;\n }\n /*get className(){\n return this.pfx + 'canvas':\n }*/\n hlEl?: HTMLElement;\n badgeEl?: HTMLElement;\n placerEl?: HTMLElement;\n ghostEl?: HTMLElement;\n toolbarEl?: HTMLElement;\n resizerEl?: HTMLElement;\n offsetEl?: HTMLElement;\n fixedOffsetEl?: HTMLElement;\n toolsGlobEl?: HTMLElement;\n toolsEl?: HTMLElement;\n framesArea?: HTMLElement;\n toolsWrapper?: HTMLElement;\n spotsEl?: HTMLElement;\n cvStyle?: HTMLElement;\n clsUnscale: string;\n ready = false;\n\n frames!: FramesView;\n frame?: FrameView;\n\n private timerZoom?: number;\n\n private frmOff?: { top: number; left: number; width: number; height: number };\n private cvsOff?: { top: number; left: number; width: number; height: number };\n\n constructor(model: Canvas) {\n super({ model });\n bindAll(this, 'clearOff', 'onKeyPress', 'onWheel', 'onPointer');\n const { em, pfx, ppfx } = this;\n const { events } = this.module;\n this.className = `${pfx}canvas ${ppfx}no-touch-actions${!em.config.customUI ? ` ${pfx}canvas-bg` : ''}`;\n this.clsUnscale = `${pfx}unscale`;\n this._initFrames();\n this.listenTo(em, events.refresh, this.clearOff);\n this.listenTo(em, 'component:selected', this.checkSelected);\n this.listenTo(em, `${events.coords} ${events.zoom}`, this.updateFrames);\n this.listenTo(model, 'change:frames', this._onFramesUpdate);\n this.toggleListeners(true);\n }\n\n _onFramesUpdate() {\n this._initFrames();\n this._renderFrames();\n }\n\n _initFrames() {\n const { frames, model, config, em } = this;\n const collection = model.frames;\n em.set('readyCanvas', 0);\n collection.once('loaded:all', () => em.set('readyCanvas', 1));\n frames?.remove();\n this.frames = new FramesView(\n { collection },\n {\n ...config,\n canvasView: this,\n }\n );\n }\n\n checkSelected(component: Component, opts: { scroll?: ScrollIntoViewOptions } = {}) {\n const { scroll } = opts;\n const currFrame = this.em.getCurrentFrame();\n\n scroll &&\n component.views?.forEach(view => {\n view.frameView === currFrame && view.scrollIntoView(scroll);\n });\n }\n\n remove(...args: any) {\n this.frames?.remove();\n //@ts-ignore\n this.frames = undefined;\n ModuleView.prototype.remove.apply(this, args);\n this.toggleListeners(false);\n return this;\n }\n\n preventDefault(ev: Event) {\n if (ev) {\n ev.preventDefault();\n (ev as any)._parentEvent?.preventDefault();\n }\n }\n\n toggleListeners(enable: boolean) {\n const { el, config } = this;\n const fn = enable ? on : off;\n fn(document, 'keypress', this.onKeyPress);\n fn(window, 'scroll resize', this.clearOff);\n fn(el, 'wheel', this.onWheel, { passive: !config.infiniteCanvas });\n fn(el, 'pointermove', this.onPointer);\n }\n\n screenToWorld(x: number, y: number): Coordinates {\n const { module } = this;\n const coords = module.getCoords();\n const zoom = module.getZoomMultiplier();\n const vwDelta = this.getViewportDelta();\n\n return {\n x: (x - coords.x - vwDelta.x) * zoom,\n y: (y - coords.y - vwDelta.y) * zoom,\n };\n }\n\n onPointer(ev: WheelEvent) {\n if (!this.config.infiniteCanvas) return;\n\n const canvasRect = this.getCanvasOffset();\n const docScroll = getDocumentScroll();\n const screenCoords: Coordinates = {\n x: ev.clientX - canvasRect.left + docScroll.x,\n y: ev.clientY - canvasRect.top + docScroll.y,\n };\n\n if ((ev as any)._parentEvent) {\n // with _parentEvent means was triggered from the iframe\n const frameRect = (ev.target as HTMLElement).getBoundingClientRect();\n const zoom = this.module.getZoomDecimal();\n screenCoords.x = frameRect.left - canvasRect.left + docScroll.x + ev.clientX * zoom;\n screenCoords.y = frameRect.top - canvasRect.top + docScroll.y + ev.clientY * zoom;\n }\n\n this.model.set({\n pointerScreen: screenCoords,\n pointer: this.screenToWorld(screenCoords.x, screenCoords.y),\n });\n }\n\n onKeyPress(ev: KeyboardEvent) {\n const { em } = this;\n const key = getKeyChar(ev);\n\n if (key === ' ' && em.getZoomDecimal() !== 1 && !em.Canvas.isInputFocused()) {\n this.preventDefault(ev);\n em.Editor.runCommand('core:canvas-move');\n }\n }\n\n onWheel(ev: WheelEvent) {\n const { module, config } = this;\n if (config.infiniteCanvas) {\n this.preventDefault(ev);\n const { deltaX, deltaY } = ev;\n const zoom = module.getZoomDecimal();\n const isZooming = hasModifierKey(ev);\n const coords = module.getCoords();\n\n if (isZooming) {\n const newZoom = zoom - deltaY * zoom * 0.01;\n module.setZoom(newZoom * 100);\n\n // Update coordinates based on pointer\n const pointer = this.model.getPointerCoords(CoordinatesTypes.Screen);\n const canvasRect = this.getCanvasOffset();\n const pointerX = pointer.x - canvasRect.width / 2;\n const pointerY = pointer.y - canvasRect.height / 2;\n const zoomDelta = newZoom / zoom;\n const x = pointerX - (pointerX - coords.x) * zoomDelta;\n const y = pointerY - (pointerY - coords.y) * zoomDelta;\n module.setCoords(x, y);\n } else {\n this.onPointer(ev);\n module.setCoords(coords.x - deltaX, coords.y - deltaY);\n }\n }\n }\n\n updateFrames(ev: Event) {\n const { em } = this;\n const toolsWrpEl = this.toolsWrapper!;\n const defOpts = { preserveSelected: 1 };\n this.updateFramesArea();\n this.clearOff();\n toolsWrpEl.style.display = 'none';\n em.trigger('canvas:update', ev);\n this.timerZoom && clearTimeout(this.timerZoom);\n this.timerZoom = setTimeout(() => {\n em.stopDefault(defOpts);\n em.runDefault(defOpts);\n toolsWrpEl.style.display = '';\n }, 300) as any;\n }\n\n updateFramesArea() {\n const { framesArea, model, module, cvStyle, clsUnscale } = this;\n const mpl = module.getZoomMultiplier();\n\n if (framesArea) {\n const { x, y } = model.attributes;\n const zoomDc = module.getZoomDecimal();\n\n framesArea.style.transform = `scale(${zoomDc}) translate(${x * mpl}px, ${y * mpl}px)`;\n }\n\n if (cvStyle) {\n cvStyle.innerHTML = `\n .${clsUnscale} { scale: ${mpl} }\n `;\n }\n }\n\n fitViewport(opts: FitViewportOptions = {}) {\n const { em, module, model } = this;\n const canvasRect = this.getCanvasOffset();\n const { el } = opts;\n const elFrame = el && getComponentView(el)?.frameView;\n const frame = elFrame ? elFrame.model : opts.frame || em.getCurrentFrameModel() || model.frames.at(0);\n const { x, y } = frame.attributes;\n const boxRect: BoxRect = {\n x: x ?? 0,\n y: y ?? 0,\n width: frame.width,\n height: frame.height,\n };\n\n if (el) {\n const elRect = this.getElBoxRect(el);\n boxRect.x = boxRect.x + elRect.x;\n boxRect.y = boxRect.y + elRect.y;\n boxRect.width = elRect.width;\n boxRect.height = elRect.height;\n }\n\n const noHeight = opts.ignoreHeight;\n const gap = opts.gap ?? 0;\n const gapIsNum = isNumber(gap);\n const gapX = gapIsNum ? gap : gap.x;\n const gapY = gapIsNum ? gap : gap.y;\n const boxWidth = boxRect.width + gapX * 2;\n const boxHeight = boxRect.height + gapY * 2;\n const canvasWidth = canvasRect.width;\n const canvasHeight = canvasRect.height;\n const widthRatio = canvasWidth / boxWidth;\n const heightRatio = canvasHeight / boxHeight;\n\n const zoomRatio = noHeight ? widthRatio : Math.min(widthRatio, heightRatio);\n const zoom = zoomRatio * 100;\n module.setZoom(zoom);\n\n // check for the frame witdh is necessary as we're centering the frame via CSS\n const coordX = -boxRect.x + (frame.width >= canvasWidth ? canvasWidth / 2 - boxWidth / 2 : -gapX);\n const coordY = -boxRect.y + canvasHeight / 2 - boxHeight / 2;\n\n const coords = {\n x: (coordX + gapX) * zoomRatio,\n y: (coordY + gapY) * zoomRatio,\n };\n\n if (noHeight) {\n const zoomMltp = module.getZoomMultiplier();\n const canvasWorldHeight = canvasHeight * zoomMltp;\n const canvasHeightDiff = canvasWorldHeight - canvasHeight;\n const yDelta = canvasHeightDiff / 2;\n coords.y = (-boxRect.y + gapY) * zoomRatio - yDelta / zoomMltp;\n }\n\n module.setCoords(coords.x, coords.y);\n }\n\n /**\n * Checks if the element is visible in the canvas's viewport\n * @param {HTMLElement} el\n * @return {Boolean}\n */\n isElInViewport(el: HTMLElement) {\n const elem = getElement(el);\n const rect = getElRect(elem);\n const frameRect = this.getFrameOffset(elem);\n const rTop = rect.top;\n const rLeft = rect.left;\n return rTop >= 0 && rLeft >= 0 && rTop <= frameRect.height && rLeft <= frameRect.width;\n }\n\n /**\n * Get the offset of the element\n * @param {HTMLElement} el\n * @return { {top: number, left: number, width: number, height: number} }\n */\n offset(el?: HTMLElement, opts: ElementPosOpts = {}) {\n const { noScroll } = opts;\n const rect = getElRect(el);\n const scroll = noScroll ? { x: 0, y: 0 } : getDocumentScroll(el);\n\n return {\n top: rect.top + scroll.y,\n left: rect.left + scroll.x,\n width: rect.width,\n height: rect.height,\n };\n }\n\n getRectToScreen(boxRect: Partial): BoxRect {\n const zoom = this.module.getZoomDecimal();\n const coords = this.module.getCoords();\n const vwDelta = this.getViewportDelta();\n const x = (boxRect.x ?? 0) * zoom + coords.x + vwDelta.x || 0;\n const y = (boxRect.y ?? 0) * zoom + coords.y + vwDelta.y || 0;\n\n return {\n x,\n y,\n width: (boxRect.width ?? 0) * zoom,\n height: (boxRect.height ?? 0) * zoom,\n };\n }\n\n getElBoxRect(el: HTMLElement, opts: GetBoxRectOptions = {}): BoxRect {\n const { module } = this;\n const { width, height, left, top } = getElRect(el);\n const frameView = getComponentView(el)?.frameView;\n const frameRect = frameView?.getBoxRect();\n const zoomMlt = module.getZoomMultiplier();\n const frameX = frameRect?.x ?? 0;\n const frameY = frameRect?.y ?? 0;\n const canvasEl = this.el;\n const docScroll = getDocumentScroll();\n const xWithFrame = left + frameX + (canvasEl.scrollLeft + docScroll.x) * zoomMlt;\n const yWithFrame = top + frameY + (canvasEl.scrollTop + docScroll.y) * zoomMlt;\n const boxRect = {\n x: xWithFrame,\n y: yWithFrame,\n width,\n height,\n };\n\n if (opts.local) {\n boxRect.x = left;\n boxRect.y = top;\n }\n\n return opts.toScreen ? this.getRectToScreen(boxRect) : boxRect;\n }\n\n getViewportRect(opts: ToWorldOption = {}): BoxRect {\n const { top, left, width, height } = this.getCanvasOffset();\n const { module } = this;\n\n if (opts.toWorld) {\n const zoom = module.getZoomMultiplier();\n const coords = module.getCoords();\n const vwDelta = this.getViewportDelta();\n const x = -coords.x - vwDelta.x || 0;\n const y = -coords.y - vwDelta.y || 0;\n\n return {\n x: x * zoom,\n y: y * zoom,\n width: width * zoom,\n height: height * zoom,\n };\n } else {\n return {\n x: left,\n y: top,\n width,\n height,\n };\n }\n }\n\n getViewportDelta(opts: { withZoom?: number } = {}): Coordinates {\n const zoom = this.module.getZoomMultiplier();\n const { width, height } = this.getCanvasOffset();\n const worldWidth = width * zoom;\n const worldHeight = height * zoom;\n const widthDelta = worldWidth - width;\n const heightDelta = worldHeight - height;\n\n return {\n x: widthDelta / 2 / zoom,\n y: heightDelta / 2 / zoom,\n };\n }\n\n /**\n * Cleare cached offsets\n * @private\n */\n clearOff() {\n this.frmOff = undefined;\n this.cvsOff = undefined;\n }\n\n /**\n * Return frame offset\n * @return { {top: number, left: number, width: number, height: number} }\n * @public\n */\n getFrameOffset(el?: HTMLElement) {\n if (!this.frmOff || el) {\n const frame = this.frame?.el;\n const winEl = el?.ownerDocument.defaultView;\n const frEl = winEl ? (winEl.frameElement as HTMLElement) : frame;\n this.frmOff = this.offset(frEl || frame);\n }\n return this.frmOff;\n }\n\n /**\n * Return canvas offset\n * @return { {top: number, left: number, width: number, height: number} }\n * @public\n */\n getCanvasOffset() {\n if (!this.cvsOff) this.cvsOff = this.offset(this.el);\n return this.cvsOff;\n }\n\n /**\n * Returns element's rect info\n * @param {HTMLElement} el\n * @param {object} opts\n * @return { {top: number, left: number, width: number, height: number, zoom: number, rect: any} }\n * @public\n */\n getElementPos(el: HTMLElement, opts: ElementPosOpts = {}) {\n const zoom = this.module.getZoomDecimal();\n const frameOffset = this.getFrameOffset(el);\n const canvasEl = this.el;\n const canvasOffset = this.getCanvasOffset();\n const elRect = this.offset(el, opts);\n const frameTop = opts.avoidFrameOffset ? 0 : frameOffset.top;\n const frameLeft = opts.avoidFrameOffset ? 0 : frameOffset.left;\n\n const elTop = opts.avoidFrameZoom ? elRect.top : elRect.top * zoom;\n const elLeft = opts.avoidFrameZoom ? elRect.left : elRect.left * zoom;\n\n const top = opts.avoidFrameOffset ? elTop : elTop + frameTop - canvasOffset.top + canvasEl.scrollTop;\n const left = opts.avoidFrameOffset ? elLeft : elLeft + frameLeft - canvasOffset.left + canvasEl.scrollLeft;\n const height = opts.avoidFrameZoom ? elRect.height : elRect.height * zoom;\n const width = opts.avoidFrameZoom ? elRect.width : elRect.width * zoom;\n\n return { top, left, height, width, zoom, rect: elRect };\n }\n\n /**\n * Returns element's offsets like margins and paddings\n * @param {HTMLElement} el\n * @return { MarginPaddingOffsets }\n * @public\n */\n getElementOffsets(el: HTMLElement) {\n if (!el || isTextNode(el)) return {};\n const result: MarginPaddingOffsets = {};\n const styles = window.getComputedStyle(el);\n const zoom = this.module.getZoomDecimal();\n const marginPaddingOffsets: (keyof MarginPaddingOffsets)[] = [\n 'marginTop',\n 'marginRight',\n 'marginBottom',\n 'marginLeft',\n 'paddingTop',\n 'paddingRight',\n 'paddingBottom',\n 'paddingLeft',\n 'borderTopWidth',\n 'borderRightWidth',\n 'borderBottomWidth',\n 'borderLeftWidth',\n ];\n marginPaddingOffsets.forEach(offset => {\n result[offset] = parseFloat(styles[offset]) * zoom;\n });\n\n return result;\n }\n\n /**\n * Returns position data of the canvas element\n * @return { {top: number, left: number, width: number, height: number} } obj Position object\n * @public\n */\n getPosition(opts: any = {}): ElementRect {\n const doc = this.frame?.el.contentDocument;\n if (!doc) {\n return {\n top: 0,\n left: 0,\n width: 0,\n height: 0,\n };\n }\n const bEl = doc.body;\n const zoom = this.module.getZoomDecimal();\n const fo = this.getFrameOffset();\n const co = this.getCanvasOffset();\n const { noScroll } = opts;\n\n return {\n top: fo.top + (noScroll ? 0 : bEl.scrollTop) * zoom - co.top,\n left: fo.left + (noScroll ? 0 : bEl.scrollLeft) * zoom - co.left,\n width: co.width,\n height: co.height,\n };\n }\n\n /**\n * Update javascript of a specific component passed by its View\n * @param {ModuleView} view Component's View\n * @private\n */\n //TODO change type after the ComponentView was updated to ts\n updateScript(view: any) {\n const model = view.model;\n const id = model.getId();\n\n if (!view.scriptContainer) {\n view.scriptContainer = createEl('div', { 'data-id': id });\n const jsEl = this.getJsContainer();\n jsEl?.appendChild(view.scriptContainer);\n }\n\n view.el.id = id;\n view.scriptContainer.innerHTML = '';\n // In editor, I make use of setTimeout as during the append process of elements\n // those will not be available immediately, therefore 'item' variable\n const script = document.createElement('script');\n const scriptFn = model.getScriptString();\n const scriptFnStr = model.get('script-props') ? scriptFn : `function(){\\n${scriptFn}\\n;}`;\n const scriptProps = JSON.stringify(model.__getScriptProps());\n script.innerHTML = `\n setTimeout(function() {\n var item = document.getElementById('${id}');\n if (!item) return;\n (${scriptFnStr}.bind(item))(${scriptProps})\n }, 1);`;\n // #873\n // Adding setTimeout will make js components work on init of the editor\n setTimeout(() => {\n const scr = view.scriptContainer;\n scr?.appendChild(script);\n }, 0);\n }\n\n /**\n * Get javascript container\n * @private\n */\n getJsContainer(view?: ComponentView) {\n const frameView = this.getFrameView(view);\n return frameView?.getJsContainer();\n }\n\n getFrameView(view?: ComponentView) {\n return view?.frameView || this.em.getCurrentFrame();\n }\n\n _renderFrames() {\n if (!this.ready) return;\n const { model, frames, em, framesArea } = this;\n const frms = model.frames;\n frms.listenToLoad();\n frames.render();\n const mainFrame = frms.at(0);\n const currFrame = mainFrame?.view;\n em.setCurrentFrame(currFrame);\n framesArea?.appendChild(frames.el);\n this.frame = currFrame;\n this.updateFramesArea();\n }\n\n renderFrames() {\n this._renderFrames();\n }\n\n render() {\n const { el, $el, ppfx, config, em } = this;\n $el.html(this.template());\n const $frames = $el.find('[data-frames]');\n this.framesArea = $frames.get(0);\n\n const toolsWrp = $el.find('[data-tools]');\n this.toolsWrapper = toolsWrp.get(0);\n toolsWrp.append(`\n
\n
\n
\n
\n
\n
\n ${config.extHl ? `
` : ''}\n
\n
\n
\n
\n
\n
\n
\n `);\n this.toolsEl = el.querySelector(`#${ppfx}tools`)!;\n this.hlEl = el.querySelector(`.${ppfx}highlighter`)!;\n this.badgeEl = el.querySelector(`.${ppfx}badge`)!;\n this.placerEl = el.querySelector(`.${ppfx}placeholder`)!;\n this.ghostEl = el.querySelector(`.${ppfx}ghost`)!;\n this.toolbarEl = el.querySelector(`.${ppfx}toolbar`)!;\n this.resizerEl = el.querySelector(`.${ppfx}resizer`)!;\n this.offsetEl = el.querySelector(`.${ppfx}offset-v`)!;\n this.fixedOffsetEl = el.querySelector(`.${ppfx}offset-fixed-v`)!;\n this.toolsGlobEl = el.querySelector(`.${ppfx}tools-gl`)!;\n this.spotsEl = el.querySelector('[data-spots]')!;\n this.cvStyle = el.querySelector('[data-canvas-style]')!;\n this.el.className = getUiClass(em, this.className);\n this.ready = true;\n this._renderFrames();\n\n return this;\n }\n}\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/canvas/config/config.ts)\n * ```js\n * const editor = grapesjs.init({\n * canvas: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance.\n *\n * ```js\n * // Listen to events\n * editor.on('canvas:drop', () => { ... });\n *\n * // Use the API\n * const canvas = editor.Canvas;\n * canvas.setCoords(...);\n * ```\n *\n * {REPLACE_EVENTS}\n *\n * [Component]: component.html\n * [Frame]: frame.html\n * [CanvasSpot]: canvas_spot.html\n *\n * @module Canvas\n */\n\nimport { isArray, isUndefined } from 'underscore';\nimport { Module } from '../abstract';\nimport { AddOptions, Coordinates } from '../common';\nimport Component from '../dom_components/model/Component';\nimport ComponentView from '../dom_components/view/ComponentView';\nimport EditorModel from '../editor/model/Editor';\nimport { getElement, getViewEl } from '../utils/mixins';\nimport defaults, { CanvasConfig } from './config/config';\nimport Canvas from './model/Canvas';\nimport CanvasSpot, { CanvasSpotBuiltInTypes, CanvasSpotProps } from './model/CanvasSpot';\nimport CanvasSpots from './model/CanvasSpots';\nimport Frame from './model/Frame';\nimport { CanvasEvents, CanvasRefreshOptions, ToWorldOption } from './types';\nimport CanvasView, { FitViewportOptions } from './view/CanvasView';\nimport FrameView from './view/FrameView';\n\nexport type CanvasEvent = `${CanvasEvents}`;\n\nexport default class CanvasModule extends Module {\n /**\n * Get configuration object\n * @name getConfig\n * @function\n * @return {Object}\n */\n\n /**\n * Used inside RTE\n * @private\n */\n getCanvasView(): CanvasView {\n return this.canvasView as any;\n }\n\n canvas: Canvas;\n model: Canvas;\n spots: CanvasSpots;\n events = CanvasEvents;\n framesById: Record = {};\n private canvasView?: CanvasView;\n\n /**\n * Initialize module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n constructor(em: EditorModel) {\n super(em, 'Canvas', defaults);\n\n this.canvas = new Canvas(this);\n this.spots = new CanvasSpots(this);\n this.model = this.canvas;\n this.startAutoscroll = this.startAutoscroll.bind(this);\n this.stopAutoscroll = this.stopAutoscroll.bind(this);\n return this;\n }\n\n postLoad() {\n this.model.init();\n }\n\n getModel() {\n return this.canvas;\n }\n\n /**\n * Get the canvas element\n * @returns {HTMLElement}\n */\n getElement() {\n return this.getCanvasView().el;\n }\n\n getFrame(index?: number) {\n return this.getFrames()[index || 0];\n }\n\n /**\n * Get the main frame element of the canvas\n * @returns {HTMLIFrameElement}\n */\n getFrameEl() {\n const { frame } = this.canvasView || {};\n return frame?.el as HTMLIFrameElement;\n }\n\n getFramesEl() {\n return this.canvasView?.framesArea as HTMLElement;\n }\n\n /**\n * Get the main frame window instance\n * @returns {Window}\n */\n getWindow() {\n const { frame } = this.canvasView || {};\n return frame?.getWindow() as Window;\n }\n\n /**\n * Get the main frame document element\n * @returns {HTMLDocument}\n */\n getDocument() {\n const frame = this.getFrameEl();\n return frame?.contentDocument as Document;\n }\n\n /**\n * Get the main frame body element\n * @return {HTMLBodyElement}\n */\n getBody() {\n const doc = this.getDocument();\n return doc?.body as HTMLBodyElement;\n }\n\n _getLocalEl(globalEl: any, compView: ComponentView, method: keyof FrameView) {\n let result = globalEl;\n const frameView = compView?.frameView;\n result = frameView ? (frameView as any)[method]() : result;\n\n return result;\n }\n\n /**\n * Returns element containing all global canvas tools\n * @returns {HTMLElement}\n * @private\n */\n getGlobalToolsEl() {\n return this.canvasView?.toolsGlobEl;\n }\n\n /**\n * Returns element containing all canvas tools\n * @returns {HTMLElement}\n * @private\n */\n getToolsEl(compView?: any) {\n return this._getLocalEl(this.getCanvasView().toolsEl, compView, 'getToolsEl');\n }\n\n /**\n * Returns highlighter element\n * @returns {HTMLElement}\n * @private\n */\n getHighlighter(compView?: any) {\n return this._getLocalEl(this.getCanvasView().hlEl, compView, 'getHighlighter');\n }\n\n /**\n * Returns badge element\n * @returns {HTMLElement}\n * @private\n */\n getBadgeEl(compView: any) {\n return this._getLocalEl(this.getCanvasView().badgeEl, compView, 'getBadgeEl');\n }\n\n /**\n * Returns placer element\n * @returns {HTMLElement}\n * @private\n */\n getPlacerEl() {\n return this.getCanvasView().placerEl;\n }\n\n /**\n * Returns ghost element\n * @returns {HTMLElement}\n * @private\n */\n getGhostEl() {\n return this.getCanvasView().ghostEl;\n }\n\n /**\n * Returns toolbar element\n * @returns {HTMLElement}\n * @private\n */\n getToolbarEl() {\n return this.getCanvasView().toolbarEl;\n }\n\n /**\n * Returns resizer element\n * @returns {HTMLElement}\n * @private\n */\n getResizerEl() {\n return this.getCanvasView().resizerEl;\n }\n\n /**\n * Returns offset viewer element\n * @returns {HTMLElement}\n * @private\n */\n getOffsetViewerEl(compView: any) {\n return this._getLocalEl(this.getCanvasView().offsetEl, compView, 'getOffsetViewerEl');\n }\n\n /**\n * Returns fixed offset viewer element\n * @returns {HTMLElement}\n * @private\n */\n getFixedOffsetViewerEl() {\n return this.getCanvasView().fixedOffsetEl;\n }\n\n getSpotsEl() {\n return this.canvasView?.spotsEl;\n }\n\n render(): HTMLElement {\n this.canvasView?.remove();\n this.canvasView = new CanvasView(this.canvas);\n return this.canvasView.render().el;\n }\n\n /**\n * Get frame position\n * @returns {Object}\n * @private\n */\n getOffset() {\n var frameOff = this.offset(this.getFrameEl());\n var canvasOff = this.offset(this.getElement());\n return {\n top: frameOff.top - canvasOff.top,\n left: frameOff.left - canvasOff.left,\n };\n }\n\n /**\n * Get the offset of the passed component element\n * @param {HTMLElement} el\n * @returns {Object}\n * @private\n */\n offset(el: HTMLElement) {\n return this.getCanvasView().offset(el);\n }\n\n /**\n * Set custom badge naming strategy\n * @param {Function} f\n * @example\n * canvas.setCustomBadgeLabel(function(component){\n * return component.getName();\n * });\n */\n setCustomBadgeLabel(f: Function) {\n //@ts-ignore\n this.config.customBadgeLabel = f;\n }\n\n /**\n * Get element position relative to the canvas\n * @param {HTMLElement} el\n * @returns {Object}\n * @private\n */\n getElementPos(el: HTMLElement, opts?: any) {\n return this.getCanvasView().getElementPos(el, opts);\n }\n\n /**\n * Returns element's offsets like margins and paddings\n * @param {HTMLElement} el\n * @returns {Object}\n * @private\n */\n getElementOffsets(el: HTMLElement) {\n return this.getCanvasView().getElementOffsets(el);\n }\n\n /**\n * Get canvas rectangular data\n * @returns {Object}\n */\n getRect() {\n const { top = 0, left = 0 } = this.getCanvasView().getPosition() ?? {};\n return {\n ...this.getCanvasView().getCanvasOffset(),\n topScroll: top,\n leftScroll: left,\n };\n }\n\n /**\n * This method comes handy when you need to attach something like toolbars\n * to elements inside the canvas, dealing with all relative position,\n * offsets, etc. and returning as result the object with positions which are\n * viewable by the user (when the canvas is scrolled the top edge of the element\n * is not viewable by the user anymore so the new top edge is the one of the canvas)\n *\n * The target should be visible before being passed here as invisible elements\n * return empty string as width\n * @param {HTMLElement} target The target in this case could be the toolbar\n * @param {HTMLElement} element The element on which I'd attach the toolbar\n * @param {Object} options Custom options\n * @param {Boolean} options.toRight Set to true if you want the toolbar attached to the right\n * @return {Object}\n * @private\n */\n getTargetToElementDim(target: HTMLElement, element: HTMLElement, options: any = {}) {\n var opts = options || {};\n var canvasPos = this.getCanvasView().getPosition();\n if (!canvasPos) return;\n var pos = opts.elPos || this.getCanvasView().getElementPos(element);\n var toRight = options.toRight || 0;\n var targetHeight = opts.targetHeight || target.offsetHeight;\n var targetWidth = opts.targetWidth || target.offsetWidth;\n var eventToTrigger = opts.event || null;\n\n var elTop = pos.top - targetHeight;\n var elLeft = pos.left;\n elLeft += toRight ? pos.width : 0;\n elLeft = toRight ? elLeft - targetWidth : elLeft;\n\n var leftPos = elLeft < canvasPos.left ? canvasPos.left : elLeft;\n var topPos = elTop < canvasPos.top ? canvasPos.top : elTop;\n topPos = topPos > pos.top + pos.height ? pos.top + pos.height : topPos;\n\n var result = {\n top: topPos,\n left: leftPos,\n elementTop: pos.top,\n elementLeft: pos.left,\n elementWidth: pos.width,\n elementHeight: pos.height,\n targetWidth: target.offsetWidth,\n targetHeight: target.offsetHeight,\n canvasTop: canvasPos.top,\n canvasLeft: canvasPos.left,\n canvasWidth: canvasPos.width,\n canvasHeight: canvasPos.height,\n };\n\n // In this way I can catch data and also change the position strategy\n if (eventToTrigger && this.em) {\n this.em.trigger(eventToTrigger, result);\n }\n\n return result;\n }\n\n canvasRectOffset(el: HTMLElement, pos: { top: number; left: number }, opts: any = {}) {\n const getFrameElFromDoc = (doc: Document) => {\n const { defaultView } = doc;\n return defaultView?.frameElement as HTMLElement;\n };\n\n const rectOff = (el: HTMLElement, top = 1, pos: { top: number; left: number }) => {\n const zoom = this.em.getZoomDecimal();\n const side = top ? 'top' : 'left';\n const doc = el.ownerDocument;\n const { offsetTop = 0, offsetLeft = 0 } = opts.offset ? getFrameElFromDoc(doc) : {};\n const { scrollTop = 0, scrollLeft = 0 } = doc.body || {};\n const scroll = top ? scrollTop : scrollLeft;\n const offset = top ? offsetTop : offsetLeft;\n\n return pos[side] - (scroll - offset) * zoom;\n };\n\n return {\n top: rectOff(el, 1, pos),\n left: rectOff(el, 0, pos),\n };\n }\n\n /**\n *\n * @param {HTMLElement} el The component element in the canvas\n * @param {HTMLElement} targetEl The target element to position (eg. toolbar)\n * @param {Object} opts\n * @private\n */\n getTargetToElementFixed(el: HTMLElement, targetEl: HTMLElement, opts: any = {}) {\n const elRect = opts.pos || this.getElementPos(el, { noScroll: true });\n const canvasOffset = opts.canvasOff || this.canvasRectOffset(el, elRect);\n const targetHeight = targetEl.offsetHeight || 0;\n const targetWidth = targetEl.offsetWidth || 0;\n const elRight = elRect.left + elRect.width;\n const canvasView = this.getCanvasView();\n const canvasRect = canvasView.getPosition();\n const frameOffset = canvasView.getFrameOffset(el);\n const { event } = opts;\n\n let top = -targetHeight;\n let left = !isUndefined(opts.left) ? opts.left : elRect.width - targetWidth;\n left = elRect.left < -left ? -elRect.left : left;\n left = elRight > canvasRect.width ? left - (elRight - canvasRect.width) : left;\n\n // Check when the target top edge reaches the top of the viewable canvas\n if (canvasOffset.top < targetHeight) {\n const fullHeight = elRect.height + targetHeight;\n const elIsShort = fullHeight < frameOffset.height;\n\n // Scroll with the window if the top edge is reached and the\n // element is bigger than the canvas\n if (elIsShort) {\n top = top + fullHeight;\n } else {\n top = -canvasOffset.top < elRect.height ? -canvasOffset.top : elRect.height;\n }\n }\n\n const result = {\n top,\n left,\n canvasOffsetTop: canvasOffset.top,\n canvasOffsetLeft: canvasOffset.left,\n elRect,\n canvasOffset,\n canvasRect,\n targetWidth,\n targetHeight,\n };\n\n // In this way I can catch data and also change the position strategy\n event && this.em.trigger(event, result);\n\n return result;\n }\n\n /**\n * Instead of simply returning e.clientX and e.clientY this function\n * calculates also the offset based on the canvas. This is helpful when you\n * need to get X and Y position while moving between the editor area and\n * canvas area, which is in the iframe\n * @param {Event} e\n * @return {Object}\n * @private\n */\n getMouseRelativePos(e: any, opts: any = {}) {\n const subWinOffset = opts.subWinOffset;\n const doc = e.target.ownerDocument;\n const win = doc.defaultView || doc.parentWindow;\n const frame = win.frameElement;\n const yOffset = subWinOffset ? win.pageYOffset : 0;\n const xOffset = subWinOffset ? win.pageXOffset : 0;\n const zoomMlt = this.getZoomMultiplier();\n let addTop = 0;\n let addLeft = 0;\n\n if (frame) {\n var frameRect = frame.getBoundingClientRect();\n addTop = frameRect.top || 0;\n addLeft = frameRect.left || 0;\n }\n\n return {\n y: (e.clientY + addTop - yOffset) * zoomMlt,\n x: (e.clientX + addLeft - xOffset) * zoomMlt,\n };\n }\n\n /**\n * X and Y mouse position relative to the canvas\n * @param {Event} ev\n * @return {Object}\n * @private\n */\n getMouseRelativeCanvas(ev: MouseEvent, opts: any) {\n const zoom = this.getZoomDecimal();\n const { top = 0, left = 0 } = this.getCanvasView().getPosition(opts) ?? {};\n\n return {\n y: ev.clientY * zoom + top,\n x: ev.clientX * zoom + left,\n };\n }\n\n /**\n * Check if the canvas is focused\n * @returns {Boolean}\n */\n hasFocus() {\n return this.getDocument().hasFocus();\n }\n\n /**\n * Detects if some input is focused (input elements, text components, etc.)\n * @return {Boolean}\n * @private\n */\n isInputFocused() {\n const doc = this.getDocument();\n const frame = this.getFrameEl();\n const toIgnore = ['body', ...this.config.notTextable!];\n const docActive = frame && document.activeElement === frame;\n const focused = docActive ? doc && doc.activeElement : document.activeElement;\n\n return focused && !toIgnore.some(item => focused.matches(item));\n }\n\n /**\n * Scroll canvas to the element if it's not visible. The scrolling is\n * executed via `scrollIntoView` API and options of this method are\n * passed to it. For instance, you can scroll smoothly by using\n * `{ behavior: 'smooth' }`.\n * @param {HTMLElement|[Component]} el\n * @param {Object} [opts={}] Options, same as options for `scrollIntoView`\n * @param {Boolean} [opts.force=false] Force the scroll, even if the element is already visible\n * @example\n * const selected = editor.getSelected();\n * // Scroll smoothly (this behavior can be polyfilled)\n * canvas.scrollTo(selected, { behavior: 'smooth' });\n * // Force the scroll, even if the element is alredy visible\n * canvas.scrollTo(selected, { force: true });\n */\n scrollTo(el: any, opts = {}) {\n const elem = getElement(el);\n const view = elem && getViewEl(elem);\n view && view.scrollIntoView(opts);\n }\n\n /**\n * Start autoscroll\n * @private\n */\n startAutoscroll(frame?: Frame) {\n const fr = (frame && frame.view) || this.em.getCurrentFrame();\n fr && fr.startAutoscroll();\n }\n\n /**\n * Stop autoscroll\n * @private\n */\n stopAutoscroll(frame?: Frame) {\n const fr = (frame && frame.view) || this.em.getCurrentFrame();\n fr && fr.stopAutoscroll();\n }\n\n /**\n * Set canvas zoom value\n * @param {Number} value The zoom value, from 0 to 100\n * @returns {this}\n * @example\n * canvas.setZoom(50); // set zoom to 50%\n */\n setZoom(value: number | string) {\n this.canvas.set('zoom', typeof value === 'string' ? parseFloat(value) : value);\n return this;\n }\n\n /**\n * Get canvas zoom value\n * @returns {Number}\n * @example\n * canvas.setZoom(50); // set zoom to 50%\n * const zoom = canvas.getZoom(); // 50\n */\n getZoom() {\n return parseFloat(this.canvas.get('zoom'));\n }\n\n /**\n * Set canvas position coordinates\n * @param {Number} x Horizontal position\n * @param {Number} y Vertical position\n * @returns {this}\n * @example\n * canvas.setCoords(100, 100);\n */\n setCoords(x?: string | number, y?: string | number, opts: ToWorldOption = {}) {\n const hasX = x || x === 0;\n const hasY = y || y === 0;\n const coords = {\n x: this.canvas.get('x'),\n y: this.canvas.get('y'),\n };\n\n if (hasX) coords.x = parseFloat(`${x}`);\n if (hasY) coords.y = parseFloat(`${y}`);\n\n if (opts.toWorld) {\n const delta = this.canvasView?.getViewportDelta();\n if (delta) {\n if (hasX) coords.x = coords.x - delta.x;\n if (hasY) coords.y = coords.y - delta.y;\n }\n }\n\n this.canvas.set(coords);\n\n return this;\n }\n\n /**\n * Get canvas position coordinates\n * @returns {Object} Object containing coordinates\n * @example\n * canvas.setCoords(100, 100);\n * const coords = canvas.getCoords();\n * // { x: 100, y: 100 }\n */\n getCoords(): Coordinates {\n const { x, y } = this.canvas.attributes;\n return { x, y };\n }\n\n /**\n * Get canvas pointer position coordinates.\n * @returns {Object} Object containing pointer coordinates\n * @private\n * @example\n * const worldPointer = canvas.getPointer();\n * const screenPointer = canvas.getPointer(true);\n */\n getPointer(screen?: boolean): Coordinates {\n const { pointer, pointerScreen } = this.canvas.attributes;\n return screen ? pointerScreen : pointer;\n }\n\n getZoomDecimal() {\n return this.getZoom() / 100;\n }\n\n getZoomMultiplier() {\n const zoom = this.getZoomDecimal();\n return zoom ? 1 / zoom : 1;\n }\n\n fitViewport(opts?: FitViewportOptions) {\n this.canvasView?.fitViewport(opts);\n }\n\n toggleFramesEvents(on: boolean) {\n const { style } = this.getFramesEl();\n style.pointerEvents = on ? '' : 'none';\n }\n\n getFrames() {\n return this.canvas.frames.map(item => item);\n }\n\n /**\n * Add new frame to the canvas\n * @param {Object} props Frame properties\n * @returns {[Frame]}\n * @private\n * @example\n * canvas.addFrame({\n * name: 'Mobile home page',\n * x: 100, // Position in canvas\n * y: 100,\n * width: 500, // Frame dimensions\n * height: 600,\n * // device: 'DEVICE-ID',\n * components: [\n * '

Title frame

',\n * '

Paragraph frame

',\n * ],\n * styles: `\n * .testh { color: red; }\n * .testp { color: blue; }\n * `,\n * });\n */\n addFrame(props = {}, opts = {}) {\n return this.canvas.frames.add(new Frame(this, { ...props }), opts);\n }\n\n /**\n * Get the last created Component from a drag & drop to the canvas.\n * @returns {[Component]|undefined}\n */\n getLastDragResult(): Component | undefined {\n return this.em.get('dragResult');\n }\n\n /**\n * Add or update canvas spot.\n * @param {Object} props Canvas spot properties.\n * @param opts\n * @returns {[CanvasSpot]}\n * @example\n * // Add new canvas spot\n * const spot = canvas.addSpot({\n * type: 'select', // 'select' is one of the built-in spots\n * component: editor.getSelected(),\n * });\n *\n * // Add custom canvas spot\n * const spot = canvas.addSpot({\n * type: 'my-custom-spot',\n * component: editor.getSelected(),\n * });\n * // Update the same spot by reusing its ID\n * canvas.addSpot({\n * id: spot.id,\n * component: anotherComponent,\n * });\n */\n addSpot(props: Omit & { id?: string }, opts: AddOptions = {}) {\n const spotProps = props as T;\n const spots = this.getSpots(spotProps);\n\n if (spots.length) {\n const spot = spots[0];\n spot.set(spotProps);\n return spot;\n }\n\n const cmpView = spotProps.componentView || spotProps.component?.view;\n const spot = new CanvasSpot(this, {\n ...spotProps,\n id: spotProps.id || `cs_${spotProps.type}_${cmpView?.cid}`,\n type: spotProps.type || '',\n } as T);\n\n this.spots.add(spot, opts);\n\n return spot;\n }\n\n /**\n * Get canvas spots.\n * @param {Object} [spotProps] Canvas spot properties for filtering the result. With no properties, all available spots will be returned.\n * @returns {[CanvasSpot][]}\n * @example\n * canvas.addSpot({ type: 'select', component: cmp1 });\n * canvas.addSpot({ type: 'select', component: cmp2 });\n * canvas.addSpot({ type: 'target', component: cmp3 });\n *\n * // Get all spots\n * const allSpots = canvas.getSpots();\n * allSpots.length; // 3\n *\n * // Get all 'select' spots\n * const allSelectSpots = canvas.getSpots({ type: 'select' });\n * allSelectSpots.length; // 2\n */\n getSpots(spotProps: Partial = {}) {\n return this.spots.where(spotProps.id ? { id: spotProps.id } : spotProps) as CanvasSpot[];\n }\n\n /**\n * Remove canvas spots.\n * @param {Object|[CanvasSpot][]} [spotProps] Canvas spot properties for filtering spots to remove or an array of spots to remove. With no properties, all available spots will be removed.\n * @returns {[CanvasSpot][]}\n * @example\n * canvas.addSpot({ type: 'select', component: cmp1 });\n * canvas.addSpot({ type: 'select', component: cmp2 });\n * canvas.addSpot({ type: 'target', component: cmp3 });\n *\n * // Remove all 'select' spots\n * canvas.removeSpots({ type: 'select' });\n *\n * // Remove spots by an array of canvas spots\n * const filteredSpots = canvas.getSpots().filter(spot => myCustomCondition);\n * canvas.removeSpots(filteredSpots);\n *\n * // Remove all spots\n * canvas.removeSpots();\n */\n removeSpots(spotProps: Partial | CanvasSpot[] = {}) {\n const spots = isArray(spotProps) ? spotProps : this.getSpots(spotProps);\n const removed = this.spots.remove(spots);\n return removed as unknown as CanvasSpot[];\n }\n\n /**\n * Check if the built-in canvas spot has a declared custom rendering.\n * @param {String} type Built-in canvas spot type\n * @returns {Boolean}\n * @example\n * grapesjs.init({\n * // ...\n * canvas: {\n * // avoid rendering the built-in 'target' canvas spot\n * customSpots: { target: true }\n * }\n * });\n * // ...\n * canvas.hasCustomSpot('select'); // false\n * canvas.hasCustomSpot('target'); // true\n */\n hasCustomSpot(type?: CanvasSpotBuiltInTypes) {\n const { customSpots } = this.config;\n\n if (customSpots === true || (customSpots && type && customSpots[type])) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Transform a box rect from the world coordinate system to the screen one.\n * @param {Object} boxRect\n * @returns {Object}\n */\n getWorldRectToScreen(boxRect: Parameters[0]) {\n return this.canvasView?.getRectToScreen(boxRect);\n }\n\n /**\n * Update canvas for spots/tools positioning.\n * @param {Object} [opts] Options.\n * @param {Object} [opts.spots=false] Update the position of spots.\n */\n refresh(opts: CanvasRefreshOptions = {}) {\n const { em, events, canvasView } = this;\n canvasView?.clearOff();\n\n if (opts.spots || opts.all) {\n this.refreshSpots();\n em.trigger('canvas:updateTools'); // this should be deprecated\n }\n\n em.set('canvasOffset', this.getOffset()); // this should be deprecated\n em.trigger(events.refresh, opts);\n }\n\n refreshSpots() {\n this.spots.refresh();\n }\n\n destroy() {\n this.canvas.stopListening();\n this.canvasView?.remove();\n //[this.canvas, this.canvasView].forEach(i => (i = {}));\n //@ts-ignore\n ['model', 'droppable'].forEach(i => (this[i] = {}));\n }\n}\n","import Component from '../model/Component';\n\nexport interface DomComponentsConfig {\n stylePrefix?: string;\n\n /**\n * Could be used for default components.\n */\n components?: Record[];\n\n /**\n * If the component is draggable you can drag the component itself (not only from the toolbar).\n * @default true\n */\n draggableComponents?: boolean;\n\n /**\n * Experimental: Disable text inner components.\n * With this option, you're able to decide which inner component inside text should be\n * disabled (eg. no select, no hover, no layer visibility) once edited.\n * @default false\n * @example\n * // disable all inner childs\n * disableTextInnerChilds: true,\n * // disable all except link components\n * disableTextInnerChilds: (child) => !child.is('link'),\n */\n disableTextInnerChilds?: boolean | ((cmp: Component) => boolean | void);\n\n /**\n * You can setup a custom component definition processor before adding it into the editor.\n * It might be useful to transform custom objects (es. some framework specific JSX) to GrapesJS component one.\n * This custom function will be executed on ANY new added component to the editor so make smart checks/conditions\n * to avoid doing useless executions\n * By default, GrapesJS supports already elements generated from React JSX preset\n * @example\n * processor: (obj) => {\n * if (obj.$$typeof) { // eg. this is a React Element\n * const gjsComponent = {\n * type: obj.type,\n * components: obj.props.children,\n * ...\n * };\n * ...\n * return gjsComponent;\n * }\n * }\n */\n processor?: (obj: any) => Record | undefined;\n\n /**\n * List of HTML void elements.\n * https://www.w3.org/TR/2011/WD-html-markup-20110113/syntax.html#void-elements\n */\n voidElements?: string[];\n\n /**\n * Experimental: Use the frame document for DOM element creation.\n * This option might be useful when elements require the local document context to\n * work properly (eg. Web Components).\n */\n useFrameDoc?: boolean;\n}\n\nexport default {\n stylePrefix: 'comp-',\n components: [],\n draggableComponents: true,\n disableTextInnerChilds: false,\n processor: undefined,\n useFrameDoc: false,\n voidElements: [\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'keygen',\n 'link',\n 'menuitem',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n ],\n} as DomComponentsConfig;\n","import Component from './Component';\nimport { escapeNodeContent } from '../../utils/mixins';\n\nexport default class ComponentTextNode extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n tagName: '',\n droppable: false,\n layerable: false,\n selectable: false,\n editable: true,\n };\n }\n\n toHTML() {\n const { content } = this;\n const parent = this.parent();\n return parent?.is('script') ? content : this.__escapeContent(content);\n }\n\n __escapeContent(content: string) {\n return escapeNodeContent(content);\n }\n\n static isComponent(el: HTMLElement) {\n if (el.nodeType === 3) {\n return {\n type: 'textnode',\n content: el.textContent ?? '',\n };\n }\n }\n}\n","import ComponentTextNode from './ComponentTextNode';\n\nexport default class ComponentComment extends ComponentTextNode {\n get defaults() {\n // @ts-ignore\n return { ...super.defaults };\n }\n\n toHTML() {\n return ``;\n }\n\n static isComponent(el: HTMLElement) {\n if (el.nodeType == 8) {\n return {\n type: 'comment',\n content: el.textContent ?? '',\n };\n }\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\n\nconst type = 'iframe';\n\nexport default class ComponentFrame extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n droppable: false,\n resizable: true,\n traits: ['id', 'title', 'src'],\n attributes: { frameborder: '0' },\n };\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n\n// ComponentFrame.isComponent = el => toLowerCase(el.tagName) === type;\n","import { result } from 'underscore';\nimport Component from './Component';\nimport { toLowerCase, buildBase64UrlFromSvg, hasWin } from '../../utils/mixins';\nimport { ObjectStrings } from '../../common';\nimport { ComponentOptions, ComponentProperties } from './types';\n\nconst svgAttrs =\n 'xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" viewBox=\"0 0 24 24\" style=\"fill: rgba(0,0,0,0.15); transform: scale(0.75)\"';\n\nexport default class ComponentImage extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type: 'image',\n tagName: 'img',\n void: true,\n droppable: 0,\n editable: 1,\n highlightable: 0,\n resizable: { ratioDefault: 1 },\n traits: ['alt'],\n\n src: `\n \n `,\n\n // Fallback image in case the src can't be loaded\n // If you use SVG, xmlns=\"http://www.w3.org/2000/svg\" is required\n fallback: `\n \n `,\n\n // File to load asynchronously once the model is rendered\n file: '',\n };\n }\n\n constructor(props: ComponentProperties = {}, opt: ComponentOptions) {\n super(props, opt);\n const { src } = this.get('attributes')!;\n if (src && buildBase64UrlFromSvg(result(this, 'defaults').src) !== src) {\n this.set('src', src, { silent: true });\n }\n }\n\n initToolbar() {\n super.initToolbar();\n const { em } = this;\n\n if (em) {\n const cmd = em.Commands;\n const cmdName = 'image-editor';\n\n // Add Image Editor button only if the default command exists\n if (cmd.has(cmdName)) {\n let hasButtonBool = false;\n const tb = this.get('toolbar')!;\n\n for (let i = 0; i < tb.length; i++) {\n if (tb[i].command === 'image-editor') {\n hasButtonBool = true;\n break;\n }\n }\n\n if (!hasButtonBool) {\n tb.push({\n attributes: { class: 'fa fa-pencil' },\n command: cmdName,\n });\n this.set('toolbar', tb);\n }\n }\n }\n }\n\n /**\n * Returns object of attributes for HTML\n * @return {Object}\n * @private\n */\n getAttrToHTML() {\n const attr = super.getAttrToHTML();\n const src = this.getSrcResult();\n if (src) attr.src = src;\n return attr;\n }\n\n getSrcResult(opt: { fallback?: boolean } = {}) {\n const src = this.get(opt.fallback ? 'fallback' : 'src') || '';\n let result = src;\n\n if (src && src.substr(0, 4) === '[0]) {\n const obj = super.toJSON(opts);\n const { attributes } = obj;\n\n if (attributes && obj.src === attributes.src) {\n delete obj.src;\n }\n\n return obj;\n }\n\n /**\n * Parse uri\n * @param {string} uri\n * @return {object}\n * @private\n */\n parseUri(uri: string) {\n let result: HTMLAnchorElement | URL | ObjectStrings = {};\n\n const getQueryObject = (search = '') => {\n const query: ObjectStrings = {};\n const qrs = search.substring(1).split('&');\n\n for (let i = 0; i < qrs.length; i++) {\n const pair = qrs[i].split('=');\n const name = decodeURIComponent(pair[0]);\n if (name) query[name] = decodeURIComponent(pair[1] || '');\n }\n\n return query;\n };\n\n if (hasWin()) {\n result = document.createElement('a');\n result.href = uri;\n } else if (typeof URL !== 'undefined') {\n try {\n result = new URL(uri);\n } catch (e) {}\n }\n\n return {\n hostname: result.hostname || '',\n pathname: result.pathname || '',\n protocol: result.protocol || '',\n search: result.search || '',\n hash: result.hash || '',\n port: result.port || '',\n query: getQueryObject(result.search),\n };\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === 'img';\n }\n}\n","import { isFunction } from 'underscore';\nimport Component from './Component';\nimport { ComponentOptions, ComponentProperties } from './types';\n\nexport default class ComponentText extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type: 'text',\n droppable: false,\n editable: true,\n };\n }\n\n constructor(props: ComponentProperties = {}, opt: ComponentOptions) {\n super(props, opt);\n this.__checkInnerChilds();\n }\n\n __checkInnerChilds() {\n const { disableTextInnerChilds } = this.em.Components.config;\n if (disableTextInnerChilds) {\n const disableChild = (child: Component) => {\n if (!child.isInstanceOf('textnode')) {\n child.set({\n locked: true,\n layerable: false,\n });\n }\n };\n\n if (isFunction(disableTextInnerChilds)) {\n this.forEachChild(child => {\n disableTextInnerChilds(child) && disableChild(child);\n });\n } else {\n this.forEachChild(disableChild);\n }\n }\n }\n}\n","import ComponentText from './ComponentText';\nimport { toLowerCase } from '../../utils/mixins';\n\nconst type = 'label';\n\nexport default class ComponentLabel extends ComponentText {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n traits: ['id', 'title', 'for'],\n };\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import { forEach } from 'underscore';\nimport { toLowerCase } from '../../utils/mixins';\nimport ComponentText from './ComponentText';\n\nconst type = 'link';\n\nexport default class ComponentLink extends ComponentText {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: 'a',\n traits: ['title', 'href', 'target'],\n };\n }\n\n static isComponent(el: HTMLElement, opts: any = {}) {\n let result: any;\n\n if (toLowerCase(el.tagName) === 'a') {\n const textTags = opts.textTags || [];\n result = { type, editable: false };\n\n // The link is editable only if, at least, one of its\n // children is a text node (not empty one)\n const children = el.childNodes;\n const len = children.length;\n if (!len) delete result.editable;\n\n forEach(children, child => {\n const { tagName } = child as HTMLElement;\n if (\n (child.nodeType == 3 && (child as any).textContent.trim() !== '') ||\n (tagName && textTags.indexOf(toLowerCase(tagName)) >= 0)\n ) {\n delete result.editable;\n }\n });\n }\n\n return result;\n }\n}\n","import ComponentImage from './ComponentImage';\nimport { toLowerCase } from '../../utils/mixins';\nimport { ComponentOptions, ComponentProperties } from './types';\n\nexport default class ComponentMap extends ComponentImage {\n /** @ts-ignore */\n get defaults() {\n // @ts-ignore\n const defs = super.defaults;\n\n return {\n ...defs,\n type: 'map',\n src: '',\n void: false,\n mapUrl: 'https://maps.google.com/maps',\n tagName: 'iframe',\n mapType: 'q',\n address: '',\n zoom: '1',\n attributes: { frameborder: 0 },\n // @ts-ignore\n toolbar: defs.toolbar,\n traits: [\n {\n label: 'Address',\n name: 'address',\n placeholder: 'eg. London, UK',\n changeProp: true,\n },\n {\n type: 'select',\n label: 'Map type',\n name: 'mapType',\n changeProp: true,\n options: [\n { id: 'q', label: 'Roadmap' },\n { id: 'w', label: 'Satellite' },\n ],\n },\n {\n label: 'Zoom',\n name: 'zoom',\n type: 'range',\n min: 1,\n max: 20,\n changeProp: true,\n },\n ],\n };\n }\n\n constructor(props: ComponentProperties = {}, opt: ComponentOptions) {\n super(props, opt);\n if (this.get('src')) this.parseFromSrc();\n else this.updateSrc();\n\n this.listenTo(this, 'change:address change:zoom change:mapType', this.updateSrc);\n }\n\n updateSrc() {\n this.set('src', this.getMapUrl());\n }\n\n /**\n * Returns url of the map\n * @return {string}\n * @private\n */\n getMapUrl() {\n let addr = this.get('address');\n let zoom = this.get('zoom');\n let type = this.get('mapType');\n addr = addr ? '&q=' + addr : '';\n zoom = zoom ? '&z=' + zoom : '';\n type = type ? '&t=' + type : '';\n let result = this.get('mapUrl') + '?' + addr + zoom + type;\n result += '&output=embed';\n return result;\n }\n\n /**\n * Set attributes by src string\n * @private\n */\n parseFromSrc() {\n const uri = this.parseUri(this.get('src'));\n const qr = uri.query;\n if (qr.q) this.set('address', qr.q);\n if (qr.z) this.set('zoom', qr.z);\n if (qr.t) this.set('mapType', qr.t);\n }\n\n static isComponent(el: HTMLIFrameElement) {\n if (toLowerCase(el.tagName) == 'iframe' && /maps\\.google\\.com/.test(el.src)) {\n return { type: 'map', src: el.src };\n }\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\n\nconst type = 'script';\n\nexport default class ComponentScript extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n droppable: false,\n draggable: false,\n layerable: false,\n highlightable: false,\n };\n }\n\n static isComponent(el: HTMLScriptElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\n\nconst type = 'svg';\n\nexport default class ComponentSvg extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n highlightable: false,\n resizable: { ratioDefault: true },\n };\n }\n\n getName() {\n let name = this.get('tagName')!;\n const customName = this.get('custom-name');\n name = name.charAt(0).toUpperCase() + name.slice(1);\n return customName || name;\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import ComponentSvg from './ComponentSvg';\n\n/**\n * Component for inner SVG elements\n */\nexport default class ComponentSvgIn extends ComponentSvg {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n selectable: false,\n hoverable: false,\n layerable: false,\n };\n }\n\n static isComponent(el: any, opts: any = {}) {\n return !!opts.inSvg;\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\nimport { ComponentOptions, ComponentProperties } from './types';\n\nconst type = 'table';\n\nexport default class ComponentTable extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n droppable: ['tbody', 'thead', 'tfoot'],\n };\n }\n\n constructor(props: ComponentProperties = {}, opt: ComponentOptions) {\n super(props, opt);\n const components = this.get('components')!;\n !components.length && components.add({ type: 'tbody' });\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\nimport { ComponentOptions, ComponentProperties } from './types';\n\nconst type = 'tbody';\n\nexport default class ComponentTableBody extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n draggable: ['table'],\n droppable: ['tr'],\n columns: 1,\n rows: 1,\n };\n }\n\n constructor(props: ComponentProperties = {}, opt: ComponentOptions) {\n super(props, opt);\n const components = this.get('components')!;\n let columns = this.get('columns');\n let rows = this.get('rows');\n\n // Init components if empty\n if (!components.length) {\n const rowsToAdd = [];\n\n while (rows--) {\n const columnsToAdd = [];\n let clm = columns;\n\n while (clm--) {\n columnsToAdd.push({\n type: 'cell',\n classes: ['cell'],\n });\n }\n\n rowsToAdd.push({\n type: 'row',\n classes: ['row'],\n components: columnsToAdd,\n });\n }\n\n components.add(rowsToAdd);\n }\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\n\nexport default class ComponentTableCell extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type: 'cell',\n tagName: 'td',\n draggable: ['tr'],\n };\n }\n\n static isComponent(el: HTMLElement) {\n return ['td', 'th'].indexOf(toLowerCase(el.tagName)) >= 0;\n }\n}\n","import ComponentTableBody from './ComponentTableBody';\nimport { toLowerCase } from '../../utils/mixins';\n\nconst type = 'tfoot';\n\nexport default class ComponentTableFoot extends ComponentTableBody {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n };\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import ComponentTableBody from './ComponentTableBody';\nimport { toLowerCase } from '../../utils/mixins';\n\nconst type = 'thead';\n\nexport default class ComponentTableHead extends ComponentTableBody {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n };\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === type;\n }\n}\n","import Component from './Component';\nimport { toLowerCase } from '../../utils/mixins';\n\nconst tagName = 'tr';\n\nexport default class ComponentTableRow extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n tagName,\n draggable: ['thead', 'tbody', 'tfoot'],\n droppable: ['th', 'td'],\n };\n }\n\n static isComponent(el: HTMLElement) {\n return toLowerCase(el.tagName) === tagName;\n }\n}\n","import { ObjectAny } from '../../common';\nimport { isDef, isEmptyObj, toLowerCase } from '../../utils/mixins';\nimport ComponentImage from './ComponentImage';\nimport { ComponentOptions, ComponentProperties } from './types';\n\nconst type = 'video';\nconst yt = 'yt';\nconst vi = 'vi';\nconst ytnc = 'ytnc';\nconst defProvider = 'so';\n\nconst hasParam = (value: string) => value && value !== '0';\n\nexport default class ComponentVideo extends ComponentImage {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n type,\n tagName: type,\n videoId: '',\n void: false,\n provider: defProvider, // on change of provider, traits are switched\n ytUrl: 'https://www.youtube.com/embed/',\n ytncUrl: 'https://www.youtube-nocookie.com/embed/',\n viUrl: 'https://player.vimeo.com/video/',\n loop: false,\n poster: '',\n muted: 0,\n autoplay: false,\n controls: true,\n color: '',\n list: '',\n src: '',\n rel: 1, // YT related videos\n modestbranding: 0, // YT modest branding\n sources: [],\n attributes: { allowfullscreen: 'allowfullscreen' },\n };\n }\n\n constructor(props: ComponentProperties = {}, opt: ComponentOptions) {\n super(props, opt);\n if (this.get('src')) this.parseFromSrc();\n this.updatePropsFromAttr();\n this.updateTraits();\n this.on('change:provider', this.updateTraits);\n this.on('change:videoId change:provider', this.updateSrc);\n }\n\n updatePropsFromAttr() {\n if (this.get('provider') === defProvider) {\n const { controls, autoplay, loop } = this.get('attributes')!;\n const toUp: ObjectAny = {};\n\n if (isDef(controls)) toUp.controls = !!controls;\n if (isDef(autoplay)) toUp.autoplay = !!autoplay;\n if (isDef(loop)) toUp.loop = !!loop;\n\n if (!isEmptyObj(toUp)) {\n this.set(toUp);\n }\n }\n }\n\n /**\n * Update traits by provider\n * @private\n */\n updateTraits() {\n const { em } = this;\n const prov = this.get('provider');\n let tagName = 'iframe';\n let traits;\n\n switch (prov) {\n case yt:\n case ytnc:\n traits = this.getYoutubeTraits();\n break;\n case vi:\n traits = this.getVimeoTraits();\n break;\n default:\n tagName = 'video';\n traits = this.getSourceTraits();\n }\n\n this.set({ tagName }, { silent: true }); // avoid break in view\n // @ts-ignore\n this.set({ traits });\n em.get('ready') && em.trigger('component:toggled');\n }\n\n /**\n * Set attributes by src string\n */\n parseFromSrc() {\n const prov = this.get('provider');\n const uri = this.parseUri(this.get('src'));\n const qr = uri.query;\n switch (prov) {\n case yt:\n case ytnc:\n case vi:\n this.set('videoId', uri.pathname.split('/').pop());\n qr.list && this.set('list', qr.list);\n hasParam(qr.autoplay) && this.set('autoplay', true);\n hasParam(qr.loop) && this.set('loop', true);\n parseInt(qr.controls) === 0 && this.set('controls', false);\n hasParam(qr.color) && this.set('color', qr.color);\n qr.rel === '0' && this.set('rel', 0);\n qr.modestbranding === '1' && this.set('modestbranding', 1);\n break;\n default:\n }\n }\n\n /**\n * Update src on change of video ID\n * @private\n */\n updateSrc() {\n const prov = this.get('provider');\n let src = '';\n\n switch (prov) {\n case yt:\n src = this.getYoutubeSrc();\n break;\n case ytnc:\n src = this.getYoutubeNoCookieSrc();\n break;\n case vi:\n src = this.getVimeoSrc();\n break;\n }\n\n this.set({ src });\n }\n\n /**\n * Returns object of attributes for HTML\n * @return {Object}\n * @private\n */\n getAttrToHTML() {\n const attr = super.getAttrToHTML();\n const prov = this.get('provider');\n\n switch (prov) {\n case yt:\n case ytnc:\n case vi:\n break;\n default:\n attr.loop = !!this.get('loop');\n attr.autoplay = !!this.get('autoplay');\n attr.controls = !!this.get('controls');\n }\n\n return attr;\n }\n\n // Listen provider change and switch traits, in TraitView listen traits change\n\n /**\n * Return the provider trait\n * @return {Object}\n * @private\n */\n getProviderTrait() {\n return {\n type: 'select',\n label: 'Provider',\n name: 'provider',\n changeProp: true,\n options: [\n { value: 'so', name: 'HTML5 Source' },\n { value: yt, name: 'Youtube' },\n { value: ytnc, name: 'Youtube (no cookie)' },\n { value: vi, name: 'Vimeo' },\n ],\n };\n }\n\n /**\n * Return traits for the source provider\n * @return {Array}\n * @private\n */\n getSourceTraits() {\n return [\n this.getProviderTrait(),\n {\n label: 'Source',\n name: 'src',\n placeholder: 'eg. ./media/video.mp4',\n changeProp: true,\n },\n {\n label: 'Poster',\n name: 'poster',\n placeholder: 'eg. ./media/image.jpg',\n },\n this.getAutoplayTrait(),\n this.getLoopTrait(),\n this.getControlsTrait(),\n ];\n }\n /**\n * Return traits for the source provider\n * @return {Array}\n * @private\n */\n getYoutubeTraits() {\n return [\n this.getProviderTrait(),\n {\n label: 'Video ID',\n name: 'videoId',\n placeholder: 'eg. jNQXAC9IVRw',\n changeProp: true,\n },\n this.getAutoplayTrait(),\n this.getLoopTrait(),\n this.getControlsTrait(),\n {\n type: 'checkbox',\n label: 'Related',\n name: 'rel',\n changeProp: true,\n },\n {\n type: 'checkbox',\n label: 'Modest',\n name: 'modestbranding',\n changeProp: true,\n },\n ];\n }\n\n /**\n * Return traits for the source provider\n * @return {Array}\n * @private\n */\n getVimeoTraits() {\n return [\n this.getProviderTrait(),\n {\n label: 'Video ID',\n name: 'videoId',\n placeholder: 'eg. 123456789',\n changeProp: true,\n },\n {\n label: 'Color',\n name: 'color',\n placeholder: 'eg. FF0000',\n changeProp: true,\n },\n this.getAutoplayTrait(),\n this.getLoopTrait(),\n ];\n }\n\n /**\n * Return object trait\n * @return {Object}\n * @private\n */\n getAutoplayTrait() {\n return {\n type: 'checkbox',\n label: 'Autoplay',\n name: 'autoplay',\n changeProp: true,\n };\n }\n\n /**\n * Return object trait\n * @return {Object}\n * @private\n */\n getLoopTrait() {\n return {\n type: 'checkbox',\n label: 'Loop',\n name: 'loop',\n changeProp: true,\n };\n }\n\n /**\n * Return object trait\n * @return {Object}\n * @private\n */\n getControlsTrait() {\n return {\n type: 'checkbox',\n label: 'Controls',\n name: 'controls',\n changeProp: true,\n };\n }\n\n /**\n * Returns url to youtube video\n * @return {string}\n * @private\n */\n getYoutubeSrc() {\n const id = this.get('videoId');\n let url = this.get('ytUrl') as string;\n const list = this.get('list');\n url += id + (id.indexOf('?') < 0 ? '?' : '');\n url += list ? `&list=${list}` : '';\n url += this.get('autoplay') ? '&autoplay=1&mute=1' : '';\n url += !this.get('controls') ? '&controls=0&showinfo=0' : '';\n // Loop works only with playlist enabled\n // https://stackoverflow.com/questions/25779966/youtube-iframe-loop-doesnt-work\n url += this.get('loop') ? `&loop=1&playlist=${id}` : '';\n url += this.get('rel') ? '' : '&rel=0';\n url += this.get('modestbranding') ? '&modestbranding=1' : '';\n return url;\n }\n\n /**\n * Returns url to youtube no cookie video\n * @return {string}\n * @private\n */\n getYoutubeNoCookieSrc() {\n let url = this.getYoutubeSrc();\n url = url.replace(this.get('ytUrl'), this.get('ytncUrl'));\n return url;\n }\n\n /**\n * Returns url to vimeo video\n * @return {string}\n * @private\n */\n getVimeoSrc() {\n let url = this.get('viUrl') as string;\n url += this.get('videoId') + '?';\n url += this.get('autoplay') ? '&autoplay=1&muted=1' : '';\n url += this.get('loop') ? '&loop=1' : '';\n url += !this.get('controls') ? '&title=0&portrait=0&badge=0' : '';\n url += this.get('color') ? '&color=' + this.get('color') : '';\n return url;\n }\n\n static isComponent(el: HTMLVideoElement) {\n const { tagName, src } = el;\n const isYtProv = /youtube\\.com\\/embed/.test(src);\n const isYtncProv = /youtube-nocookie\\.com\\/embed/.test(src);\n const isViProv = /player\\.vimeo\\.com\\/video/.test(src);\n const isExtProv = isYtProv || isYtncProv || isViProv;\n if (toLowerCase(tagName) == type || (toLowerCase(tagName) == 'iframe' && isExtProv)) {\n const result: any = { type: 'video' };\n if (src) result.src = src;\n if (isExtProv) {\n if (isYtProv) result.provider = yt;\n else if (isYtncProv) result.provider = ytnc;\n else if (isViProv) result.provider = vi;\n }\n return result;\n }\n }\n}\n","import { isUndefined } from 'underscore';\nimport { attrToString } from '../../utils/dom';\nimport Component from './Component';\nimport ComponentHead, { type as typeHead } from './ComponentHead';\nimport { ToHTMLOptions } from './types';\n\nexport default class ComponentWrapper extends Component {\n get defaults() {\n return {\n // @ts-ignore\n ...super.defaults,\n tagName: 'body',\n removable: false,\n copyable: false,\n draggable: false,\n components: [],\n traits: [],\n doctype: '',\n head: null,\n docEl: null,\n stylable: [\n 'background',\n 'background-color',\n 'background-image',\n 'background-repeat',\n 'background-attachment',\n 'background-position',\n 'background-size',\n ],\n };\n }\n\n constructor(...args: ConstructorParameters) {\n super(...args);\n const opts = args[1];\n const cmp = opts?.em?.Components;\n const CmpHead = cmp?.getType(typeHead)?.model;\n const CmpDef = cmp?.getType('default').model;\n if (CmpHead) {\n this.set(\n {\n head: new CmpHead({}, opts),\n docEl: new CmpDef({ tagName: 'html' }, opts),\n },\n { silent: true }\n );\n }\n }\n\n get head(): ComponentHead {\n return this.get('head');\n }\n\n get docEl(): Component {\n return this.get('docEl');\n }\n\n get doctype(): string {\n return this.attributes.doctype || '';\n }\n\n toHTML(opts: ToHTMLOptions = {}) {\n const { doctype } = this;\n const asDoc = !isUndefined(opts.asDocument) ? opts.asDocument : !!doctype;\n const { head, docEl } = this;\n const body = super.toHTML(opts);\n const headStr = (asDoc && head?.toHTML(opts)) || '';\n const docElAttr = (asDoc && attrToString(docEl?.getAttrToHTML())) || '';\n const docElAttrStr = docElAttr ? ` ${docElAttr}` : '';\n return asDoc ? `${doctype}${headStr}${body}` : body;\n }\n\n __postAdd() {\n const um = this.em?.UndoManager;\n !this.__hasUm && um?.add(this);\n return super.__postAdd();\n }\n\n __postRemove() {\n const um = this.em?.UndoManager;\n um?.remove(this);\n return super.__postRemove();\n }\n\n static isComponent() {\n return false;\n }\n}\n","import { isUndefined } from 'underscore';\nimport { removeEl } from '../../utils/dom';\nimport { View } from '../../common';\nimport { DomComponentsConfig } from '../config/config';\nimport EditorModel from '../../editor/model/Editor';\nimport Component from '../model/Component';\nimport ComponentView from './ComponentView';\nimport FrameView from '../../canvas/view/FrameView';\nimport Components from '../model/Components';\n\nexport default class ComponentsView extends View {\n opts!: any;\n config!: DomComponentsConfig & { frameView?: FrameView };\n em!: EditorModel;\n parentEl?: HTMLElement;\n compView = ComponentView;\n\n initialize(o: any) {\n this.opts = o || {};\n this.config = o.config || {};\n // @ts-ignore\n this.em = this.config.em;\n const coll = this.collection;\n this.listenTo(coll, 'add', this.addTo);\n this.listenTo(coll, 'reset', this.resetChildren);\n this.listenTo(coll, 'remove', this.removeChildren);\n }\n\n removeChildren(removed: Component, coll: any, opts = {}) {\n removed.views.forEach(view => {\n if (!view) return;\n const { childrenView, scriptContainer } = view;\n childrenView && childrenView.stopListening();\n removeEl(scriptContainer);\n view.remove.apply(view);\n });\n\n const inner = removed.components();\n inner.forEach(it => this.removeChildren(it, coll, opts));\n }\n\n /**\n * Add to collection\n * @param {Model} model\n * @param {Collection} coll\n * @param {Object} opts\n * @private\n * */\n addTo(model: Component) {\n this.addToCollection(model, null, this.collection.indexOf(model));\n }\n\n /**\n * Add new object to collection\n * @param {Object} Model\n * @param {Object} Fragment collection\n * @param {Integer} Index of append\n *\n * @return {Object} Object rendered\n * @private\n * */\n addToCollection(model: Component, fragment?: DocumentFragment | null, index?: number) {\n const { config, opts, em } = this;\n const { frameView } = config;\n const sameFrameView = frameView?.model && model.getView(frameView.model);\n const dt = opts.componentTypes || em?.Components.getTypes();\n const type = model.get('type') || 'default';\n let viewObject = this.compView;\n\n for (let it = 0; it < dt.length; it++) {\n if (dt[it].id == type) {\n viewObject = dt[it].view;\n break;\n }\n }\n const view =\n sameFrameView ||\n new viewObject({\n model,\n // @ts-ignore\n config,\n componentTypes: dt,\n });\n let rendered;\n\n try {\n // Avoid breaking on DOM rendering (eg. invalid attribute name)\n rendered = view.render().el;\n } catch (error) {\n rendered = document.createTextNode('');\n em.logError(error as any);\n }\n\n if (fragment) {\n fragment.appendChild(rendered);\n } else {\n const parent = this.parentEl!;\n const children = parent.childNodes;\n\n if (!isUndefined(index)) {\n const lastIndex = children.length == index;\n\n // If the added model is the last of collection\n // need to change the logic of append\n if (lastIndex) {\n index--;\n }\n\n // In case the added is new in the collection index will be -1\n if (lastIndex || !children.length) {\n parent.appendChild(rendered);\n } else {\n parent.insertBefore(rendered, children[index]);\n }\n } else {\n parent.appendChild(rendered);\n }\n }\n\n if (!model.opt.temporary) {\n em?.trigger('component:mount', model);\n }\n\n return rendered;\n }\n\n resetChildren(models: Components, { previousModels = [] } = {}) {\n this.parentEl!.innerHTML = '';\n previousModels.forEach(md => this.removeChildren(md, this.collection));\n models.each(model => this.addToCollection(model));\n }\n\n render(parent?: HTMLElement) {\n const el = this.el;\n const frag = document.createDocumentFragment();\n this.parentEl = parent || this.el;\n this.collection.each(model => this.addToCollection(model, frag));\n el.innerHTML = '';\n el.appendChild(frag);\n return this;\n }\n}\n","import { each, isBoolean, isEmpty, keys, result } from 'underscore';\nimport { CanvasSpotBuiltInTypes } from '../../canvas/model/CanvasSpot';\nimport FrameView from '../../canvas/view/FrameView';\nimport { DisableOptions, ExtractMethods, ObjectAny, View } from '../../common';\nimport { GetSetRuleOptions } from '../../css_composer';\nimport Editor from '../../editor';\nimport EditorModel from '../../editor/model/Editor';\nimport Selectors from '../../selector_manager/model/Selectors';\nimport { replaceWith } from '../../utils/dom';\nimport { setViewEl } from '../../utils/mixins';\nimport { DomComponentsConfig } from '../config/config';\nimport Component, { avoidInline } from '../model/Component';\nimport Components from '../model/Components';\nimport { ComponentOptions } from '../model/types';\nimport ComponentsView from './ComponentsView';\n\ntype ClbObj = ReturnType;\n\nexport interface IComponentView extends ExtractMethods {}\n\nexport default class ComponentView extends View {\n /** @ts-ignore */\n model!: TComp;\n\n /** @ts-ignore */\n className() {\n return this.getClasses();\n }\n\n /** @ts-ignore */\n tagName() {\n return this.model.get('tagName')!;\n }\n\n modelOpt!: ComponentOptions;\n em!: EditorModel;\n opts?: any;\n pfx?: string;\n ppfx?: string;\n attr?: Record;\n classe?: string;\n config!: DomComponentsConfig;\n childrenView?: ComponentsView;\n getChildrenSelector?: Function;\n getTemplate?: Function;\n scriptContainer?: HTMLElement;\n\n preinitialize(opt: any = {}) {\n this.opts = opt;\n }\n\n initialize(opt: any = {}) {\n const model = this.model;\n const config = opt.config || {};\n const em = config.em;\n const modelOpt = model.opt || {};\n const { $el, el } = this;\n this.opts = opt;\n this.modelOpt = modelOpt;\n this.config = config;\n this.em = em;\n this.pfx = config.stylePrefix || '';\n this.ppfx = config.pStylePrefix || '';\n this.attr = model.get('attributes')!;\n this.classe = this.attr.class || [];\n this.listenTo(model, 'change:style', this.updateStyle);\n this.listenTo(model, 'change:attributes', this.renderAttributes);\n this.listenTo(model, 'change:highlightable', this.updateHighlight);\n this.listenTo(model, 'change:status change:locked', this.updateStatus);\n this.listenTo(model, 'change:script rerender', this.reset);\n this.listenTo(model, 'change:content', this.updateContent);\n this.listenTo(model, 'change', this.handleChange);\n this.listenTo(model, 'active', this.onActive);\n this.listenTo(model, 'disable', this.onDisable);\n $el.data('model', model);\n setViewEl(el, this);\n model.view = this;\n this.frameView && model.views.push(this);\n this.initClasses();\n this.initComponents({ avoidRender: true });\n this.events = {\n ...(this.constructor as typeof ComponentView).getEvents(),\n dragstart: 'handleDragStart',\n };\n this.delegateEvents();\n !modelOpt.temporary && this.init(this._clbObj());\n }\n\n get __cmpStyleOpts(): GetSetRuleOptions {\n return { state: '', mediaText: '' };\n }\n\n get frameView(): FrameView {\n return this.opts.config.frameView;\n }\n\n get createDoc() {\n const doc = this.frameView?.getDoc() || document;\n return this.opts.config?.useFrameDoc ? doc : document;\n }\n\n __isDraggable() {\n const { model, config } = this;\n const { draggable } = model.attributes;\n return config.draggableComponents && draggable;\n }\n\n _clbObj() {\n const { em, model, el } = this;\n return {\n editor: em?.getEditor() as Editor,\n model,\n el,\n };\n }\n\n /**\n * Initialize callback\n */\n init(opts: ClbObj) {}\n\n /**\n * Remove callback\n */\n removed(opts: ClbObj) {}\n\n /**\n * On render callback\n */\n onRender(opts: ClbObj) {}\n\n /**\n * Callback executed when the `active` event is triggered on component\n */\n onActive(ev: Event) {}\n\n /**\n * Callback executed when the `disable` event is triggered on component\n */\n onDisable(opts?: DisableOptions) {}\n\n remove() {\n super.remove();\n const { model, $el } = this;\n const { views } = model;\n const frame = this.frameView || {};\n model.components().forEach(comp => {\n const view = comp.getView(frame.model);\n view?.remove();\n });\n this.childrenView?.remove();\n views.splice(views.indexOf(this), 1);\n this.removed(this._clbObj());\n $el.data({ model: '', collection: '', view: '' });\n // delete model.view; // Sorter relies on this property\n return this;\n }\n\n handleDragStart(event: Event) {\n if (!this.__isDraggable()) return false;\n event.stopPropagation();\n event.preventDefault();\n this.em.Commands.run('tlb-move', {\n target: this.model,\n event,\n });\n }\n\n initClasses() {\n const { model } = this;\n const { classes } = model;\n const event = 'change:classes';\n\n if (classes instanceof Selectors) {\n this.stopListening(model, event, this.initClasses);\n this.listenTo(model, event, this.initClasses);\n this.listenTo(classes, 'add remove change reset', this.updateClasses);\n classes.length && this.importClasses();\n }\n }\n\n initComponents(opts: { avoidRender?: boolean } = {}) {\n const { model, $el, childrenView } = this;\n const event = 'change:components';\n const comps = model.get('components');\n const toListen = [model, event, this.initComponents];\n\n if (comps instanceof Components) {\n $el.data('collection', comps);\n childrenView && childrenView.remove();\n this.stopListening(...toListen);\n !opts.avoidRender && this.renderChildren();\n // @ts-ignore\n this.listenTo(...toListen);\n }\n }\n\n /**\n * Handle any property change\n * @private\n */\n handleChange() {\n const { model } = this;\n const chgArr = keys(model.changed);\n if (chgArr.length === 1 && chgArr[0] === 'status') return;\n model.emitUpdate();\n\n for (let prop in model.changed) {\n model.emitUpdate(prop);\n }\n }\n\n /**\n * Import, if possible, classes inside main container\n * @private\n * */\n importClasses() {\n const { em, model } = this;\n const sm = em.Selectors;\n sm && model.classes.forEach(s => sm.add(s.getName()));\n }\n\n /**\n * Update item on status change\n * @param {Event} e\n * @private\n * */\n updateStatus(opts: { noExtHl?: boolean; avoidHover?: boolean } = {}) {\n const { em, el, ppfx, model } = this;\n const canvas = em?.Canvas;\n const extHl = canvas?.config.extHl;\n const status = model.get('status');\n const selectedCls = `${ppfx}selected`;\n const selectedParentCls = `${selectedCls}-parent`;\n const freezedCls = `${ppfx}freezed`;\n const hoveredCls = `${ppfx}hovered`;\n const noPointerCls = `${ppfx}no-pointer`;\n const pointerInitCls = `${ppfx}pointer-init`;\n const toRemove = [selectedCls, selectedParentCls, freezedCls, hoveredCls, noPointerCls];\n const selCls = extHl && !opts.noExtHl ? '' : selectedCls;\n this.$el.removeClass(toRemove.join(' '));\n const actualCls = el.getAttribute('class') || '';\n const cls = [actualCls];\n const noCustomSpotSelect = !canvas?.hasCustomSpot(CanvasSpotBuiltInTypes.Select);\n const noCustomSpotTarget = !canvas?.hasCustomSpot(CanvasSpotBuiltInTypes.Target);\n\n switch (status) {\n case 'selected':\n noCustomSpotSelect && cls.push(selCls);\n break;\n case 'selected-parent':\n noCustomSpotTarget && cls.push(selectedParentCls);\n break;\n case 'freezed':\n cls.push(freezedCls);\n break;\n case 'freezed-selected':\n cls.push(freezedCls);\n noCustomSpotSelect && cls.push(selCls);\n break;\n case 'hovered':\n !opts.avoidHover && cls.push(hoveredCls);\n break;\n }\n\n if (isBoolean(model.locked)) {\n cls.push(model.locked ? noPointerCls : pointerInitCls);\n }\n\n const clsStr = cls.filter(Boolean).join(' ');\n clsStr && el.setAttribute('class', clsStr);\n }\n\n /**\n * Update highlight attribute\n * @private\n * */\n updateHighlight() {\n const { model } = this;\n const isTextable = model.get('textable');\n const hl = model.get('highlightable') && (isTextable || !model.isChildOf('text'));\n this.setAttribute('data-gjs-highlightable', hl ? true : '');\n }\n\n /**\n * Update style attribute\n * @private\n * */\n updateStyle(m?: any, v?: any, opts: ObjectAny = {}) {\n const { model, em } = this;\n\n if (avoidInline(em) && !opts.inline) {\n // Move inline styles to CSSRule\n const styleOpts = this.__cmpStyleOpts;\n const style = model.getStyle({ inline: true, ...styleOpts });\n !isEmpty(style) && model.setStyle(style, styleOpts);\n } else {\n this.setAttribute('style', model.styleToString(opts));\n }\n }\n\n /**\n * Update classe attribute\n * @private\n * */\n updateClasses() {\n const str = this.model.classes.pluck('name').join(' ');\n this.setAttribute('class', str);\n\n // Regenerate status class\n this.updateStatus();\n this.onAttrUpdate();\n }\n\n /**\n * Update single attribute\n * @param {[type]} name [description]\n * @param {[type]} value [description]\n */\n setAttribute(name: string, value: any) {\n const el = this.$el;\n value ? el.attr(name, value) : el.removeAttr(name);\n }\n\n /**\n * Get classes from attributes.\n * This method is called before initialize\n *\n * @return {Array}|null\n * @private\n * */\n getClasses() {\n return this.model.getClasses().join(' ');\n }\n\n /**\n * Update attributes\n * @private\n * */\n updateAttributes() {\n const attrs: string[] = [];\n const { model, $el, el } = this;\n const { textable, type } = model.attributes;\n\n const defaultAttr = {\n id: model.getId(),\n 'data-gjs-type': type || 'default',\n ...(this.__isDraggable() && { draggable: true }),\n ...(textable && { contenteditable: 'false' }),\n };\n\n // Remove all current attributes\n each(el.attributes, attr => attrs.push(attr.nodeName));\n attrs.forEach(attr => $el.removeAttr(attr));\n this.updateStyle();\n this.updateHighlight();\n const attr = {\n ...defaultAttr,\n ...model.getAttributes(),\n };\n\n // Remove all `false` attributes\n keys(attr).forEach(key => attr[key] === false && delete attr[key]);\n\n $el.attr(attr);\n }\n\n /**\n * Update component content\n * @private\n * */\n updateContent() {\n const { content } = this.model;\n const hasComps = this.model.components().length;\n this.getChildrenContainer().innerHTML = hasComps ? '' : content;\n }\n\n /**\n * Prevent default helper\n * @param {Event} e\n * @private\n */\n prevDef(e: Event) {\n e.preventDefault();\n }\n\n /**\n * Render component's script\n * @private\n */\n updateScript() {\n const { model, em } = this;\n if (!model.get('script')) return;\n em?.Canvas.getCanvasView().updateScript(this);\n }\n\n /**\n * Return children container\n * Differently from a simple component where children container is the\n * component itself\n * \n * \n * \n * You could have the children container more deeper\n * \n *
\n *
\n *
\n *
\n * \n *
\n *
\n *
\n * @return HTMLElement\n * @private\n */\n getChildrenContainer() {\n var container = this.el;\n\n if (typeof this.getChildrenSelector == 'function') {\n container = this.el.querySelector(this.getChildrenSelector());\n } else if (typeof this.getTemplate == 'function') {\n // Need to find deepest first child\n }\n\n return container;\n }\n\n /**\n * This returns rect informations not affected by the canvas zoom.\n * The method `getBoundingClientRect` doesn't work here and we\n * have to take in account offsetParent\n */\n getOffsetRect() {\n const rect = { top: 0, left: 0, bottom: 0, right: 0 };\n const target = this.el;\n let gtop = 0;\n let gleft = 0;\n\n const assignRect = (el: HTMLElement) => {\n const offsetParent = el.offsetParent as HTMLElement;\n\n if (offsetParent) {\n gtop += offsetParent.offsetTop;\n gleft += offsetParent.offsetLeft;\n assignRect(offsetParent);\n } else {\n rect.top = target.offsetTop + gtop;\n rect.left = target.offsetLeft + gleft;\n rect.bottom = rect.top + target.offsetHeight;\n rect.right = rect.left + target.offsetWidth;\n }\n };\n assignRect(target);\n\n return rect;\n }\n\n isInViewport() {\n const { el, em, frameView } = this;\n const canvasView = em.Canvas.getCanvasView();\n const elRect = canvasView.getElBoxRect(el, { local: true });\n const frameEl = frameView.el;\n const frameH = frameEl.clientHeight;\n const frameW = frameEl.clientWidth;\n\n const elTop = elRect.y;\n const elRight = elRect.x;\n const elBottom = elTop + elRect.height;\n const elLeft = elRight + elRect.width;\n const isTopInside = elTop >= 0 && elTop < frameH;\n const isBottomInside = elBottom > 0 && elBottom < frameH;\n const isLeftInside = elLeft >= 0 && elLeft < frameW;\n const isRightInside = elRight > 0 && elRight <= frameW;\n\n const partiallyIn = (isTopInside || isBottomInside) && (isLeftInside || isRightInside);\n\n return partiallyIn;\n }\n\n scrollIntoView(opts: { force?: boolean } & ScrollIntoViewOptions = {}) {\n const isInViewport = this.isInViewport();\n\n if (!isInViewport || opts.force) {\n const { el } = this;\n\n // PATCH: scrollIntoView won't work with multiple requests from iframes\n if (opts.behavior !== 'smooth') {\n const rect = this.getOffsetRect();\n el.ownerDocument.defaultView?.scrollTo(0, rect.top);\n } else {\n el.scrollIntoView({\n behavior: 'smooth',\n block: 'nearest',\n ...opts,\n });\n }\n }\n }\n\n /**\n * Recreate the element of the view\n */\n reset() {\n const { el } = this;\n // @ts-ignore\n this.el = '';\n this._ensureElement();\n this._setData();\n replaceWith(el, this.el);\n this.render();\n }\n\n _setData() {\n const { model } = this;\n const collection = model.components();\n const view = this;\n this.$el.data({ model, collection, view });\n }\n\n _createElement(tagName: string): Node {\n return this.createDoc.createElement(tagName);\n }\n\n /**\n * Render children components\n * @private\n */\n renderChildren() {\n this.updateContent();\n const container = this.getChildrenContainer();\n const view =\n this.childrenView ||\n new ComponentsView({\n // @ts-ignore\n collection: this.model.get('components')!,\n config: this.config,\n componentTypes: this.opts.componentTypes,\n });\n\n view.render(container);\n this.childrenView = view;\n const childNodes = Array.prototype.slice.call(view.el.childNodes);\n\n for (var i = 0, len = childNodes.length; i < len; i++) {\n container.appendChild(childNodes.shift());\n }\n }\n\n renderAttributes() {\n this.updateAttributes();\n this.updateClasses();\n }\n\n onAttrUpdate() {}\n\n render() {\n this.renderAttributes();\n if (this.modelOpt.temporary) return this;\n this.renderChildren();\n this.updateScript();\n setViewEl(this.el, this);\n this.postRender();\n\n return this;\n }\n\n postRender() {\n if (!this.modelOpt.temporary) {\n this.onRender(this._clbObj());\n }\n }\n\n static getEvents() {\n return result(this.prototype, 'events');\n }\n}\n","import ComponentTextNode from '../model/ComponentTextNode';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTextNodeView<\n TComp extends ComponentTextNode = ComponentTextNode\n> extends ComponentView {\n // Clear methods used on Nodes with attributes\n _setAttributes() {}\n renderAttributes() {}\n updateStatus() {}\n updateClasses() {}\n setAttribute() {}\n updateAttributes() {}\n initClasses() {}\n initComponents() {}\n delegateEvents() {\n return this;\n }\n\n _createElement() {\n return document.createTextNode('');\n }\n\n render() {\n const { model, el } = this;\n if (model.opt.temporary) return this;\n el.textContent = model.content;\n return this;\n }\n}\n","import ComponentTextNodeView from './ComponentTextNodeView';\n\nexport default class ComponentCommentView extends ComponentTextNodeView {\n _createElement() {\n return document.createComment(this.model.content) as Text;\n }\n}\n","import ComponentView from './ComponentView';\nimport { createEl, find, attrUp } from '../../utils/dom';\nimport ComponentFrame from '../model/ComponentFrame';\n\nexport default class ComponentFrameView extends ComponentView {\n tagName() {\n return 'div';\n }\n\n initialize(props: any) {\n super.initialize(props);\n this.listenTo(this.model, 'change:attributes:src', this.updateSrc);\n }\n\n updateSrc() {\n const frame = find(this.el, 'iframe')[0] as HTMLElement;\n frame && attrUp(frame, { src: this.__getSrc() });\n }\n\n render() {\n super.render();\n const frame = createEl('iframe', {\n class: `${this.ppfx}no-pointer`,\n style: 'width: 100%; height: 100%; border: none',\n src: this.__getSrc(),\n });\n this.el.appendChild(frame);\n return this;\n }\n\n __getSrc() {\n return this.model.getAttributes().src || '';\n }\n}\n","import { isString } from 'underscore';\nimport { ObjectAny } from '../../common';\nimport ComponentImage from '../model/ComponentImage';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentImageView extends ComponentView {\n classEmpty!: string;\n el!: HTMLImageElement;\n\n tagName() {\n return 'img';\n }\n\n events(): ObjectAny {\n return {\n dblclick: 'onActive',\n click: 'initResize',\n error: 'onError',\n load: 'onLoad',\n dragstart: 'noDrag',\n };\n }\n\n initialize(props: any) {\n super.initialize(props);\n this.listenTo(this.model, 'change:src', this.updateSrc);\n this.classEmpty = `${this.ppfx}plh-image`;\n this.fetchFile();\n }\n\n /**\n * Fetch file if exists\n */\n fetchFile() {\n if (this.modelOpt.temporary) return;\n const { model, em } = this;\n const file = model.get('file');\n\n if (file && em) {\n const fu = em.Assets.FileUploader();\n fu?.uploadFile(\n {\n // @ts-ignore\n dataTransfer: { files: [file] },\n },\n (res: any) => {\n const obj = res && res.data && res.data[0];\n const src = obj && (isString(obj) ? obj : obj.src);\n src && model.set({ src });\n }\n );\n model.set('file', '');\n }\n }\n\n /**\n * Update src attribute\n * @private\n * */\n updateSrc() {\n const { model } = this;\n model.addAttributes({ src: model.getSrcResult() });\n this.updateClasses();\n }\n\n updateClasses() {\n super.updateClasses();\n const { el, classEmpty, model } = this;\n const srcExists = model.getSrcResult() && !model.isDefaultSrc();\n const method = srcExists ? 'remove' : 'add';\n el.classList[method](classEmpty);\n }\n\n /**\n * Open dialog for image changing\n * @param {Object} e Event\n * @private\n * */\n onActive(ev: Event) {\n ev?.stopPropagation();\n const { em, model } = this;\n const am = em?.Assets;\n\n if (am && model.get('editable')) {\n am.open({\n select(asset, complete) {\n model.set({ src: asset.getSrc() });\n complete && am.close();\n },\n target: model,\n types: ['image'],\n accept: 'image/*',\n });\n }\n }\n\n onError() {\n const fallback = this.model.getSrcResult({ fallback: true });\n if (fallback) {\n this.el.src = fallback;\n }\n }\n\n onLoad() {\n // Used to update component tools box (eg. toolbar, resizer) once the image is loaded\n this.em.Canvas.refresh({ all: true });\n }\n\n noDrag(ev: Event) {\n ev.preventDefault();\n return false;\n }\n\n render() {\n this.renderAttributes();\n if (this.modelOpt.temporary) return this;\n this.updateSrc();\n const { $el, model } = this;\n const cls = $el.attr('class') || '';\n !model.get('src') && $el.attr('class', `${cls} ${this.classEmpty}`.trim());\n this.postRender();\n\n return this;\n }\n}\n","import { bindAll } from 'underscore';\nimport { AddOptions, DisableOptions, ObjectAny } from '../../common';\nimport RichTextEditorModule from '../../rich_text_editor';\nimport RichTextEditor from '../../rich_text_editor/model/RichTextEditor';\nimport { off, on } from '../../utils/dom';\nimport { getComponentModel } from '../../utils/mixins';\nimport Component from '../model/Component';\nimport { getComponentIds } from '../model/Components';\nimport ComponentText from '../model/ComponentText';\nimport { ComponentDefinition } from '../model/types';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTextView extends ComponentView {\n rte?: RichTextEditorModule;\n rteEnabled?: boolean;\n activeRte?: RichTextEditor;\n lastContent?: string;\n\n events() {\n return {\n dblclick: 'onActive',\n input: 'onInput',\n };\n }\n\n initialize(props: any) {\n super.initialize(props);\n bindAll(this, 'disableEditing', 'onDisable');\n const model = this.model;\n const em = this.em;\n this.listenTo(model, 'focus', this.onActive);\n this.listenTo(model, 'change:content', this.updateContentText);\n this.listenTo(model, 'sync:content', this.syncContent);\n this.rte = em?.RichTextEditor;\n }\n\n updateContentText(m: any, v: any, opts: { fromDisable?: boolean } = {}) {\n !opts.fromDisable && this.disableEditing();\n }\n\n canActivate() {\n const { model, rteEnabled, em } = this;\n const modelInEdit = em?.getEditing();\n const sameInEdit = modelInEdit === model;\n let result = true;\n let isInnerText = false;\n let delegate;\n\n if (rteEnabled || !model.get('editable') || sameInEdit || (isInnerText = model.isChildOf('text'))) {\n result = false;\n // If the current is inner text, select the closest text\n if (isInnerText && !model.get('textable')) {\n let parent = model.parent();\n\n while (parent && !parent.isInstanceOf('text')) {\n parent = parent.parent();\n }\n\n if (parent && parent.get('editable')) {\n delegate = parent;\n } else {\n result = true;\n }\n }\n }\n\n return { result, delegate };\n }\n\n /**\n * Enable element content editing\n * @private\n * */\n async onActive(ev: Event) {\n const { rte, em } = this;\n const { result, delegate } = this.canActivate();\n\n // We place this before stopPropagation in case of nested\n // text components will not block the editing (#1394)\n if (!result) {\n if (delegate) {\n ev?.stopPropagation?.();\n em.setSelected(delegate);\n delegate.trigger('active', ev);\n }\n return;\n }\n\n ev?.stopPropagation?.();\n this.lastContent = await this.getContent();\n\n if (rte) {\n try {\n this.activeRte = await rte.enable(this, this.activeRte!, { event: ev });\n } catch (err) {\n em.logError(err as any);\n }\n }\n\n this.toggleEvents(true);\n }\n\n onDisable(opts?: DisableOptions) {\n this.disableEditing(opts);\n }\n\n /**\n * Disable element content editing\n * @private\n * */\n async disableEditing(opts: DisableOptions = {}) {\n const { model, rte, activeRte, em } = this;\n // There are rare cases when disableEditing is called when the view is already removed\n // so, we have to check for the model, this will avoid breaking stuff.\n const editable = model && model.get('editable');\n\n if (rte) {\n try {\n await rte.disable(this, activeRte, opts);\n } catch (err) {\n em.logError(err as any);\n }\n\n if (editable && (await this.getContent()) !== this.lastContent) {\n await this.syncContent(opts);\n this.lastContent = '';\n }\n }\n\n this.toggleEvents();\n }\n\n /**\n * get content from RTE\n * @return string\n */\n async getContent() {\n const { rte, activeRte } = this;\n let result = '';\n\n if (rte) {\n result = await rte.getContent(this, activeRte!);\n }\n\n return result;\n }\n\n /**\n * Merge content from the DOM to the model\n */\n async syncContent(opts: ObjectAny = {}) {\n const { model, rte, rteEnabled } = this;\n if (!rteEnabled && !opts.force) return;\n const content = await this.getContent();\n const comps = model.components();\n const contentOpt: ObjectAny = { fromDisable: 1, ...opts };\n model.set('content', '', contentOpt);\n\n // If there is a custom RTE the content is just added staticly\n // inside 'content'\n if (rte?.customRte && !rte.customRte.parseContent) {\n comps.length &&\n comps.reset(undefined, {\n ...opts,\n // @ts-ignore\n keepIds: getComponentIds(comps),\n });\n model.set('content', content, contentOpt);\n } else {\n comps.resetFromString(content, opts);\n }\n }\n\n insertComponent(content: ComponentDefinition, opts: AddOptions & { useDomContent?: boolean } = {}) {\n const { model, el } = this;\n const doc = el.ownerDocument;\n const selection = doc.getSelection();\n\n if (selection?.rangeCount) {\n const range = selection.getRangeAt(0);\n const textNode = range.startContainer;\n const offset = range.startOffset;\n const textModel = getComponentModel(textNode);\n const newCmps: (ComponentDefinition | Component)[] = [];\n\n if (textModel && textModel.is?.('textnode')) {\n const cmps = textModel.collection;\n cmps.forEach(cmp => {\n if (cmp === textModel) {\n const type = 'textnode';\n const cnt = opts.useDomContent ? textNode.textContent || '' : cmp.content;\n newCmps.push({ type, content: cnt.slice(0, offset) });\n newCmps.push(content);\n newCmps.push({ type, content: cnt.slice(offset) });\n } else {\n newCmps.push(cmp);\n }\n });\n\n const result = newCmps.filter(Boolean);\n const index = result.indexOf(content);\n cmps.reset(result, opts);\n\n return cmps.at(index);\n }\n }\n\n return model.append(content, opts);\n }\n\n /**\n * Callback on input event\n * @param {Event} e\n */\n onInput() {\n const { em } = this;\n const evPfx = 'component';\n const ev = [`${evPfx}:update`, `${evPfx}:input`].join(' ');\n\n // Update toolbars\n em && em.trigger(ev, this.model);\n }\n\n /**\n * Isolate disable propagation method\n * @param {Event}\n * @private\n * */\n disablePropagation(e: Event) {\n e.stopPropagation();\n }\n\n /**\n * Enable/Disable events\n * @param {Boolean} enable\n */\n toggleEvents(enable?: boolean) {\n const { em, model, $el } = this;\n const mixins = { on, off };\n const method = enable ? 'on' : 'off';\n em.setEditing(enable ? this : false);\n this.rteEnabled = !!enable;\n\n // The ownerDocument is from the frame\n var elDocs = [this.el.ownerDocument, document];\n mixins.off(elDocs, 'mousedown', this.onDisable as any);\n mixins[method](elDocs, 'mousedown', this.onDisable as any);\n em[method]('toolbar:run:before', this.onDisable);\n if (model) {\n model[method]('removed', this.onDisable);\n model.trigger(`rte:${enable ? 'enable' : 'disable'}`);\n }\n\n // @ts-ignore Avoid closing edit mode on component click\n $el?.off('mousedown', this.disablePropagation);\n // @ts-ignore\n $el && $el[method]('mousedown', this.disablePropagation);\n\n // Fixes #2210 but use this also as a replacement\n // of this fix: bd7b804f3b46eb45b4398304b2345ce870f232d2\n if (this.config.draggableComponents) {\n let { el } = this;\n\n while (el) {\n el.draggable = enable ? !1 : !0;\n // Note: el.parentNode is sometimes null here\n el = el.parentNode as HTMLElement;\n if (el && el.tagName == 'BODY') {\n // @ts-ignore\n el = 0;\n }\n }\n }\n }\n}\n","import ComponentLink from '../model/ComponentLink';\nimport ComponentTextView from './ComponentTextView';\n\nexport default class ComponentLinkView extends ComponentTextView {\n render() {\n super.render();\n // I need capturing instead of bubbling as bubbled clicks from other\n // children will execute the link event\n this.el.addEventListener('click', this.prevDef, true);\n\n return this;\n }\n}\n","import ComponentLabel from '../model/ComponentLabel';\nimport ComponentLinkView from './ComponentLinkView';\n\nexport default class ComponentLabelView extends ComponentLinkView {}\n","import ComponentImageView from './ComponentImageView';\n\nexport default class ComponentMapView extends ComponentImageView {\n iframe?: HTMLIFrameElement;\n\n tagName() {\n return 'div';\n }\n\n events() {\n return {};\n }\n\n initialize(props: any) {\n super.initialize(props);\n this.classEmpty = this.ppfx + 'plh-map';\n }\n\n /**\n * Update the map on the canvas\n * @private\n */\n updateSrc() {\n this.getIframe().src = this.model.get('src');\n }\n\n getIframe() {\n if (!this.iframe) {\n const ifrm = document.createElement('iframe');\n ifrm.src = this.model.get('src');\n ifrm.frameBorder = '0';\n ifrm.style.height = '100%';\n ifrm.style.width = '100%';\n ifrm.className = this.ppfx + 'no-pointer';\n this.iframe = ifrm;\n }\n return this.iframe;\n }\n\n render() {\n super.render();\n this.updateClasses();\n this.el.appendChild(this.getIframe());\n return this;\n }\n}\n","import ComponentScript from '../model/ComponentScript';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentScriptView extends ComponentView {\n tagName() {\n return 'script';\n }\n\n events() {\n return {};\n }\n}\n","import ComponentSvg from '../model/ComponentSvg';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentSvgView extends ComponentView {\n _createElement(tagName: string) {\n return document.createElementNS('http://www.w3.org/2000/svg', tagName);\n }\n}\n","import ComponentTableBody from '../model/ComponentTableBody';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTableBodyView extends ComponentView {}\n","import ComponentTableCell from '../model/ComponentTableCell';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTableCellView extends ComponentView {}\n","import ComponentTableFoot from '../model/ComponentTableFoot';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTableFootView extends ComponentView {}\n","import ComponentTableHead from '../model/ComponentTableHead';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTableHeadView extends ComponentView {}\n","import ComponentTableRow from '../model/ComponentTableRow';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTableRowView extends ComponentView {}\n","import ComponentTable from '../model/ComponentTable';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentTableView extends ComponentView {\n events() {\n return {};\n }\n}\n","import ComponentVideo from '../model/ComponentVideo';\nimport ComponentImageView from './ComponentImageView';\nimport ComponentView from './ComponentView';\n\nexport default class ComponentVideoView extends ComponentImageView {\n videoEl?: HTMLVideoElement | HTMLIFrameElement;\n\n tagName() {\n return 'div';\n }\n\n // @ts-ignore\n events() {\n return {};\n }\n\n initialize() {\n // @ts-ignore\n ComponentView.prototype.initialize.apply(this, arguments);\n const { model } = this;\n const props = ['loop', 'autoplay', 'controls', 'color', 'rel', 'modestbranding', 'poster'];\n const events = props.map(p => `change:${p}`).join(' ');\n this.listenTo(model, 'change:provider', this.updateProvider);\n this.listenTo(model, 'change:src', this.updateSrc);\n this.listenTo(model, events, this.updateVideo);\n }\n\n /**\n * Rerender on update of the provider\n * @private\n */\n updateProvider() {\n var prov = this.model.get('provider');\n this.el.innerHTML = '';\n this.el.appendChild(this.renderByProvider(prov));\n }\n\n /**\n * Update the source of the video\n * @private\n */\n updateSrc() {\n const { model, videoEl } = this;\n if (!videoEl) return;\n const prov = model.get('provider');\n let src = model.get('src');\n\n switch (prov) {\n case 'yt':\n src = model.getYoutubeSrc();\n break;\n case 'ytnc':\n src = model.getYoutubeNoCookieSrc();\n break;\n case 'vi':\n src = model.getVimeoSrc();\n break;\n }\n\n videoEl.src = src;\n }\n\n /**\n * Update video parameters\n * @private\n */\n updateVideo() {\n const { model, videoEl } = this;\n const prov = model.get('provider');\n switch (prov) {\n case 'yt':\n case 'ytnc':\n case 'vi':\n model.trigger('change:videoId');\n break;\n default: {\n if (videoEl) {\n const el = videoEl as HTMLVideoElement;\n el.loop = model.get('loop');\n el.autoplay = model.get('autoplay');\n el.controls = model.get('controls');\n el.poster = model.get('poster');\n }\n }\n }\n }\n\n renderByProvider(prov: string) {\n let videoEl;\n\n switch (prov) {\n case 'yt':\n videoEl = this.renderYoutube();\n break;\n case 'ytnc':\n videoEl = this.renderYoutubeNoCookie();\n break;\n case 'vi':\n videoEl = this.renderVimeo();\n break;\n default:\n videoEl = this.renderSource();\n }\n\n this.videoEl = videoEl;\n return videoEl;\n }\n\n renderSource() {\n const el = document.createElement('video');\n el.src = this.model.get('src');\n this.initVideoEl(el);\n return el;\n }\n\n renderYoutube() {\n const el = document.createElement('iframe');\n el.src = this.model.getYoutubeSrc();\n el.frameBorder = '0';\n el.setAttribute('allowfullscreen', 'true');\n this.initVideoEl(el);\n return el;\n }\n\n renderYoutubeNoCookie() {\n var el = document.createElement('iframe');\n el.src = this.model.getYoutubeNoCookieSrc();\n el.frameBorder = '0';\n el.setAttribute('allowfullscreen', 'true');\n this.initVideoEl(el);\n return el;\n }\n\n renderVimeo() {\n var el = document.createElement('iframe');\n el.src = this.model.getVimeoSrc();\n el.frameBorder = '0';\n el.setAttribute('allowfullscreen', 'true');\n this.initVideoEl(el);\n return el;\n }\n\n initVideoEl(el: HTMLElement) {\n el.className = this.ppfx + 'no-pointer';\n el.style.height = '100%';\n el.style.width = '100%';\n }\n\n render() {\n ComponentView.prototype.render.apply(this);\n this.updateClasses();\n var prov = this.model.get('provider');\n this.el.appendChild(this.renderByProvider(prov));\n this.updateVideo();\n return this;\n }\n}\n","import ComponentView from './ComponentView';\n\nexport default class ComponentWrapperView extends ComponentView {\n tagName() {\n return 'div';\n }\n}\n","import { debounce } from 'underscore';\nimport { Debounced, ObjectAny } from '../../common';\nimport Component from './Component';\nimport Components from './Components';\nimport { detachSymbolInstance, getSymbolInstances } from './SymbolUtils';\n\ninterface PropsComponentUpdate {\n component: Component;\n changed: ObjectAny;\n options: ObjectAny;\n}\n\nexport default class Symbols extends Components {\n refreshDbn: Debounced;\n\n constructor(...args: ConstructorParameters) {\n super(...args);\n this.refreshDbn = debounce(() => this.refresh(), 0);\n const { events } = this;\n this.on(events.update, this.onUpdate);\n this.on(events.updateInside, this.onUpdateDeep);\n }\n\n removeChildren(component: Component, coll?: Components, opts: any = {}) {\n super.removeChildren(component, coll, opts);\n getSymbolInstances(component)?.forEach(i => detachSymbolInstance(i, { skipRefs: true }));\n this.__trgEvent(this.events.symbolMainRemove, { component });\n }\n\n onAdd(...args: Parameters) {\n super.onAdd(...args);\n const [component] = args;\n this.__trgEvent(this.events.symbolMainAdd, { component });\n }\n\n onUpdate(props: PropsComponentUpdate) {\n this.__trgEvent(this.events.symbolMainUpdate, props);\n }\n\n onUpdateDeep(props: PropsComponentUpdate) {\n this.__trgEvent(this.events.symbolMainUpdateDeep, props);\n }\n\n refresh() {\n const { em, events } = this;\n em.trigger(events.symbol);\n }\n\n __trgEvent(event: string, props: ObjectAny, isInstance = false) {\n const { em, events } = this;\n const eventType = isInstance ? events.symbolInstance : events.symbolMain;\n em.trigger(event, props);\n em.trigger(eventType, { ...props, event });\n this.refreshDbn();\n }\n}\n","/**\n * With this module is possible to manage components inside the canvas. You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/dom_components/config/config.ts)\n * ```js\n * const editor = grapesjs.init({\n * domComponents: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance.\n *\n * ```js\n * // Listen to events\n * editor.on('component:create', () => { ... });\n *\n * // Use the API\n * const cmp = editor.Components;\n * cmp.addType(...);\n * ```\n *\n * ## Available Events\n * * `component:create` - Component is created (only the model, is not yet mounted in the canvas), called after the init() method\n * * `component:mount` - Component is mounted to an element and rendered in canvas\n * * `component:add` - Triggered when a new component is added to the editor, the model is passed as an argument to the callback\n * * `component:remove` - Triggered when a component is removed, the model is passed as an argument to the callback\n * * `component:remove:before` - Triggered before the remove of the component, the model, remove function (if aborted via options, with this function you can complete the remove) and options (use options.abort = true to prevent remove), are passed as arguments to the callback\n * * `component:clone` - Triggered when a component is cloned, the new model is passed as an argument to the callback\n * * `component:update` - Triggered when a component is updated (moved, styled, etc.), the model is passed as an argument to the callback\n * * `component:update:{propertyName}` - Listen any property change, the model is passed as an argument to the callback\n * * `component:styleUpdate` - Triggered when the style of the component is updated, the model is passed as an argument to the callback\n * * `component:styleUpdate:{propertyName}` - Listen for a specific style property change, the model is passed as an argument to the callback\n * * `component:selected` - New component selected, the selected model is passed as an argument to the callback\n * * `component:deselected` - Component deselected, the deselected model is passed as an argument to the callback\n * * `component:toggled` - Component selection changed, toggled model is passed as an argument to the callback\n * * `component:type:add` - New component type added, the new type is passed as an argument to the callback\n * * `component:type:update` - Component type updated, the updated type is passed as an argument to the callback\n * * `component:drag:start` - Component drag started. Passed an object, to the callback, containing the `target` (component to drag), `parent` (parent of the component) and `index` (component index in the parent)\n * * `component:drag` - During component drag. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the current pointer\n * * `component:drag:end` - Component drag ended. Passed the same object as in `component:drag:start` event, but in this case, `parent` and `index` are updated by the final pointer\n * * `component:resize` - During component resize.\n *\n * ## Methods\n * * [getWrapper](#getwrapper)\n * * [getComponents](#getcomponents)\n * * [addComponent](#addcomponent)\n * * [clear](#clear)\n * * [addType](#addtype)\n * * [getType](#gettype)\n * * [getTypes](#gettypes)\n *\n * * [Component]: component.html\n *\n * @module Components\n */\nimport { debounce, isArray, isBoolean, isEmpty, isFunction, isString, isSymbol, result } from 'underscore';\nimport { ItemManagerModule } from '../abstract/Module';\nimport { AddOptions, ObjectAny } from '../common';\nimport EditorModel from '../editor/model/Editor';\nimport { isComponent } from '../utils/mixins';\nimport defaults, { DomComponentsConfig } from './config/config';\nimport Component, { IComponent, keyUpdate, keyUpdateInside } from './model/Component';\nimport ComponentComment from './model/ComponentComment';\nimport ComponentFrame from './model/ComponentFrame';\nimport ComponentImage from './model/ComponentImage';\nimport ComponentLabel from './model/ComponentLabel';\nimport ComponentLink from './model/ComponentLink';\nimport ComponentMap from './model/ComponentMap';\nimport ComponentScript from './model/ComponentScript';\nimport ComponentSvg from './model/ComponentSvg';\nimport ComponentSvgIn from './model/ComponentSvgIn';\nimport ComponentTable from './model/ComponentTable';\nimport ComponentTableBody from './model/ComponentTableBody';\nimport ComponentTableCell from './model/ComponentTableCell';\nimport ComponentTableFoot from './model/ComponentTableFoot';\nimport ComponentTableHead from './model/ComponentTableHead';\nimport ComponentTableRow from './model/ComponentTableRow';\nimport ComponentText from './model/ComponentText';\nimport ComponentTextNode from './model/ComponentTextNode';\nimport ComponentVideo from './model/ComponentVideo';\nimport ComponentWrapper from './model/ComponentWrapper';\nimport Components from './model/Components';\nimport { ComponentAdd, ComponentDefinition, ComponentDefinitionDefined, ComponentStackItem } from './model/types';\nimport ComponentCommentView from './view/ComponentCommentView';\nimport ComponentFrameView from './view/ComponentFrameView';\nimport ComponentImageView from './view/ComponentImageView';\nimport ComponentLabelView from './view/ComponentLabelView';\nimport ComponentLinkView from './view/ComponentLinkView';\nimport ComponentMapView from './view/ComponentMapView';\nimport ComponentScriptView from './view/ComponentScriptView';\nimport ComponentSvgView from './view/ComponentSvgView';\nimport ComponentTableBodyView from './view/ComponentTableBodyView';\nimport ComponentTableCellView from './view/ComponentTableCellView';\nimport ComponentTableFootView from './view/ComponentTableFootView';\nimport ComponentTableHeadView from './view/ComponentTableHeadView';\nimport ComponentTableRowView from './view/ComponentTableRowView';\nimport ComponentTableView from './view/ComponentTableView';\nimport ComponentTextNodeView from './view/ComponentTextNodeView';\nimport ComponentTextView from './view/ComponentTextView';\nimport ComponentVideoView from './view/ComponentVideoView';\nimport ComponentView, { IComponentView } from './view/ComponentView';\nimport ComponentWrapperView from './view/ComponentWrapperView';\nimport ComponentsView from './view/ComponentsView';\nimport ComponentHead, { type as typeHead } from './model/ComponentHead';\nimport {\n getSymbolMain,\n getSymbolInstances,\n getSymbolsToUpdate,\n isSymbolMain,\n isSymbolInstance,\n detachSymbolInstance,\n isSymbolRoot,\n} from './model/SymbolUtils';\nimport { ComponentsEvents, SymbolInfo } from './types';\nimport Symbols from './model/Symbols';\nimport { BlockProperties } from '../block_manager/model/Block';\n\nexport type ComponentEvent =\n | 'component:create'\n | 'component:mount'\n | 'component:add'\n | 'component:remove'\n | 'component:remove:before'\n | 'component:clone'\n | 'component:update'\n | 'component:styleUpdate'\n | 'component:selected'\n | 'component:deselected'\n | 'component:toggled'\n | 'component:type:add'\n | 'component:type:update'\n | 'component:drag:start'\n | 'component:drag'\n | 'component:drag:end'\n | 'component:resize';\n\nexport interface ComponentModelDefinition extends IComponent {\n defaults?: ComponentDefinition | (() => ComponentDefinition);\n [key: string]: any;\n}\n\nexport interface ComponentViewDefinition extends IComponentView {\n [key: string]: any;\n}\n\nexport interface AddComponentTypeOptions {\n isComponent?: (el: HTMLElement) => boolean | ComponentDefinitionDefined | undefined;\n model?: Partial & ThisType;\n view?: Partial & ThisType;\n block?: boolean | Partial;\n extend?: string;\n extendView?: string;\n extendFn?: string[];\n extendFnView?: string[];\n}\n\n/** @private */\nexport enum CanMoveReason {\n /**\n * Invalid source. This is a default value and should be ignored in case the `result` is true\n */\n InvalidSource = 0,\n /**\n * Source doesn't accept target as destination.\n */\n SourceReject = 1,\n /**\n * Target doesn't accept source.\n */\n TargetReject = 2,\n}\n\nexport interface CanMoveResult {\n result: boolean;\n reason: CanMoveReason;\n target: Component;\n source?: Component | null;\n}\n\nexport default class ComponentManager extends ItemManagerModule {\n componentTypes: ComponentStackItem[] = [\n {\n id: 'cell',\n model: ComponentTableCell,\n view: ComponentTableCellView,\n },\n {\n id: 'row',\n model: ComponentTableRow,\n view: ComponentTableRowView,\n },\n {\n id: 'table',\n model: ComponentTable,\n view: ComponentTableView,\n },\n {\n id: 'thead',\n model: ComponentTableHead,\n view: ComponentTableHeadView,\n },\n {\n id: 'tbody',\n model: ComponentTableBody,\n view: ComponentTableBodyView,\n },\n {\n id: 'tfoot',\n model: ComponentTableFoot,\n view: ComponentTableFootView,\n },\n {\n id: 'map',\n model: ComponentMap,\n view: ComponentMapView,\n },\n {\n id: 'link',\n model: ComponentLink,\n view: ComponentLinkView,\n },\n {\n id: 'label',\n model: ComponentLabel,\n view: ComponentLabelView,\n },\n {\n id: 'video',\n model: ComponentVideo,\n view: ComponentVideoView,\n },\n {\n id: 'image',\n model: ComponentImage,\n view: ComponentImageView,\n },\n {\n id: 'script',\n model: ComponentScript,\n view: ComponentScriptView,\n },\n {\n id: 'svg-in',\n model: ComponentSvgIn,\n view: ComponentSvgView,\n },\n {\n id: 'svg',\n model: ComponentSvg,\n view: ComponentSvgView,\n },\n {\n id: 'iframe',\n model: ComponentFrame,\n view: ComponentFrameView,\n },\n {\n id: 'comment',\n model: ComponentComment,\n view: ComponentCommentView,\n },\n {\n id: 'textnode',\n model: ComponentTextNode,\n view: ComponentTextNodeView,\n },\n {\n id: typeHead,\n model: ComponentHead,\n view: ComponentView,\n },\n {\n id: 'wrapper',\n model: ComponentWrapper,\n view: ComponentWrapperView,\n },\n {\n id: 'text',\n model: ComponentText,\n view: ComponentTextView,\n },\n {\n id: 'default',\n model: Component,\n view: ComponentView,\n },\n ];\n\n componentsById: { [id: string]: Component } = {};\n componentView?: ComponentWrapperView;\n\n Component = Component;\n\n Components = Components;\n\n ComponentView = ComponentView;\n\n ComponentsView = ComponentsView;\n\n /**\n * Name of the module\n * @type {String}\n * @private\n */\n //name = \"DomComponents\";\n\n storageKey = 'components';\n keySymbols = 'symbols';\n\n shallow?: Component;\n symbols: Symbols;\n events = ComponentsEvents;\n\n /**\n * Initialize module. Called on a new instance of the editor with configurations passed\n * inside 'domComponents' field\n * @param {Object} config Configurations\n * @private\n */\n constructor(em: EditorModel) {\n super(em, 'DomComponents', new Components(undefined, { em }));\n const { config } = this;\n this.symbols = new Symbols([], { em, config, domc: this });\n\n if (em) {\n //@ts-ignore\n this.config.components = em.config.components || this.config.components;\n }\n\n for (let name in defaults) {\n //@ts-ignore\n if (!(name in this.config)) this.config[name] = defaults[name];\n }\n\n const ppfx = this.config.pStylePrefix;\n if (ppfx) this.config.stylePrefix = ppfx + this.config.stylePrefix;\n\n // Load dependencies\n if (em) {\n em.get('Parser').compTypes = this.componentTypes;\n em.on('change:componentHovered', this.componentHovered, this);\n\n const selected = em.get('selected');\n em.listenTo(selected, 'add', (sel, c, opts) => this.selectAdd(selected.getComponent(sel), opts));\n em.listenTo(selected, 'remove', (sel, c, opts) => this.selectRemove(selected.getComponent(sel), opts));\n }\n\n return this;\n }\n\n postLoad() {\n const { em, symbols } = this;\n const { UndoManager } = em;\n UndoManager.add(symbols);\n }\n\n load(data: any) {\n const result = this.loadProjectData(data, {\n onResult: (result: Component) => {\n let wrapper = this.getWrapper()!;\n\n if (!wrapper) {\n this.em.Pages.add({}, { select: true });\n wrapper = this.getWrapper()!;\n }\n\n if (isArray(result)) {\n result.length && wrapper.components(result);\n } else {\n const { components = [], ...rest } = result;\n wrapper.set(rest);\n //@ts-ignore\n wrapper.components(components);\n }\n },\n });\n\n this.symbols.reset(data[this.keySymbols] || []);\n\n return result;\n }\n\n store() {\n return {\n [this.keySymbols]: this.symbols,\n };\n }\n\n /**\n * Returns the main wrapper.\n * @return {Object}\n * @private\n */\n getComponent() {\n const sel = this.em.Pages.getSelected();\n const frame = sel?.getMainFrame();\n return frame?.getComponent();\n }\n\n /**\n * Returns root component inside the canvas. Something like `` inside HTML page\n * The wrapper doesn't differ from the original Component Model\n * @return {[Component]} Root Component\n * @example\n * // Change background of the wrapper and set some attribute\n * var wrapper = cmp.getWrapper();\n * wrapper.set('style', {'background-color': 'red'});\n * wrapper.set('attributes', {'title': 'Hello!'});\n */\n getWrapper() {\n return this.getComponent();\n }\n\n /**\n * Returns wrapper's children collection. Once you have the collection you can\n * add other Components(Models) inside. Each component can have several nested\n * components inside and you can nest them as more as you wish.\n * @return {Components} Collection of components\n * @example\n * // Let's add some component\n * var wrapperChildren = cmp.getComponents();\n * var comp1 = wrapperChildren.add({\n * style: { 'background-color': 'red'}\n * });\n * var comp2 = wrapperChildren.add({\n * tagName: 'span',\n * attributes: { title: 'Hello!'}\n * });\n * // Now let's add an other one inside first component\n * // First we have to get the collection inside. Each\n * // component has 'components' property\n * var comp1Children = comp1.get('components');\n * // Procede as before. You could also add multiple objects\n * comp1Children.add([\n * { style: { 'background-color': 'blue'}},\n * { style: { height: '100px', width: '100px'}}\n * ]);\n * // Remove comp2\n * wrapperChildren.remove(comp2);\n */\n getComponents(): Components {\n const wrp = this.getWrapper();\n return wrp?.components()!;\n }\n\n /**\n * Add new components to the wrapper's children. It's the same\n * as 'cmp.getComponents().add(...)'\n * @param {Object|[Component]|Array} component Component/s to add\n * @param {string} [component.tagName='div'] Tag name\n * @param {string} [component.type=''] Type of the component. Available: ''(default), 'text', 'image'\n * @param {boolean} [component.removable=true] If component is removable\n * @param {boolean} [component.draggable=true] If is possible to move the component around the structure\n * @param {boolean} [component.droppable=true] If is possible to drop inside other components\n * @param {boolean} [component.badgable=true] If the badge is visible when the component is selected\n * @param {boolean} [component.stylable=true] If is possible to style component\n * @param {boolean} [component.copyable=true] If is possible to copy&paste the component\n * @param {string} [component.content=''] String inside component\n * @param {Object} [component.style={}] Style object\n * @param {Object} [component.attributes={}] Attribute object\n * @param {Object} opt the options object to be used by the [Components.add]{@link getComponents} method\n * @return {[Component]|Array<[Component]>} Component/s added\n * @example\n * // Example of a new component with some extra property\n * var comp1 = cmp.addComponent({\n * tagName: 'div',\n * removable: true, // Can't remove it\n * draggable: true, // Can't move it\n * copyable: true, // Disable copy/past\n * content: 'Content text', // Text inside component\n * style: { color: 'red'},\n * attributes: { title: 'here' }\n * });\n */\n addComponent(component: ComponentAdd, opt: AddOptions = {}): Component | Component[] {\n return this.getComponents().add(component, opt);\n }\n\n /**\n * Render and returns wrapper element with all components inside.\n * Once the wrapper is rendered, and it's what happens when you init the editor,\n * the all new components will be added automatically and property changes are all\n * updated immediately\n * @return {HTMLElement}\n * @private\n */\n render() {\n return this.componentView?.render().el;\n }\n\n /**\n * Remove all components\n * @return {this}\n */\n clear(opts = {}) {\n const components = this.getComponents();\n //@ts-ignore\n components?.filter(Boolean).forEach(i => i.remove(opts));\n return this;\n }\n\n /**\n * Set components\n * @param {Object|string} components HTML string or components model\n * @param {Object} opt the options object to be used by the {@link addComponent} method\n * @return {this}\n * @private\n */\n setComponents(components: ComponentAdd, opt: AddOptions = {}) {\n this.clear(opt).addComponent(components, opt);\n }\n\n /**\n * Add new component type.\n * Read more about this in [Define New Component](https://grapesjs.com/docs/modules/Components.html#define-new-component)\n * @param {string} type Component ID\n * @param {Object} methods Component methods\n * @return {this}\n */\n addType(type: string, methods: AddComponentTypeOptions) {\n const { em } = this;\n const { model = {}, view = {}, isComponent, extend, extendView, extendFn = [], extendFnView = [], block } = methods;\n const compType = this.getType(type);\n const extendType = this.getType(extend!);\n const extendViewType = this.getType(extendView!);\n const typeToExtend = extendType ? extendType : compType ? compType : this.getType('default');\n const modelToExt = typeToExtend.model as typeof Component;\n const viewToExt = extendViewType ? extendViewType.view : typeToExtend.view;\n\n // Function for extending source object methods\n const getExtendedObj = (fns: any[], target: any, srcToExt: any) =>\n fns.reduce((res, next) => {\n const fn = target[next];\n const parentFn = srcToExt.prototype[next];\n if (fn && parentFn) {\n res[next] = function (...args: any[]) {\n parentFn.bind(this)(...args);\n fn.bind(this)(...args);\n };\n }\n return res;\n }, {});\n\n // If the model/view is a simple object I need to extend it\n if (typeof model === 'object') {\n const modelDefaults = { defaults: model.defaults };\n delete model.defaults;\n const typeExtends = new Set(modelToExt.typeExtends);\n typeExtends.add(modelToExt.getDefaults().type);\n\n methods.model = modelToExt.extend(\n {\n ...model,\n ...getExtendedObj(extendFn, model, modelToExt),\n },\n {\n typeExtends,\n isComponent: compType && !extendType && !isComponent ? modelToExt.isComponent : isComponent || (() => 0),\n }\n );\n // Reassign the defaults getter to the model\n Object.defineProperty(methods.model!.prototype, 'defaults', {\n get: () => ({\n ...(result(modelToExt.prototype, 'defaults') || {}),\n ...(result(modelDefaults, 'defaults') || {}),\n }),\n });\n }\n\n if (typeof view === 'object') {\n methods.view = viewToExt.extend({\n ...view,\n ...getExtendedObj(extendFnView, view, viewToExt),\n });\n }\n\n if (compType) {\n compType.model = methods.model;\n compType.view = methods.view;\n } else {\n // @ts-ignore\n methods.id = type;\n this.componentTypes.unshift(methods as any);\n }\n\n if (block) {\n const defBlockProps: BlockProperties = {\n id: type,\n label: type,\n content: { type },\n };\n const blockProps: BlockProperties = block === true ? defBlockProps : { ...defBlockProps, ...block };\n em.Blocks.add(blockProps.id || type, blockProps);\n }\n\n const event = `component:type:${compType ? 'update' : 'add'}`;\n em?.trigger(event, compType || methods);\n\n return this;\n }\n\n /**\n * Get component type.\n * Read more about this in [Define New Component](https://grapesjs.com/docs/modules/Components.html#define-new-component)\n * @param {string} type Component ID\n * @return {Object} Component type definition, eg. `{ model: ..., view: ... }`\n */\n getType(type: 'default'): { id: string; model: any; view: any };\n getType(type: string): { id: string; model: any; view: any } | undefined;\n getType(type: string) {\n var df = this.componentTypes;\n\n for (var it = 0; it < df.length; it++) {\n var dfId = df[it].id;\n if (dfId == type) {\n return df[it];\n }\n }\n return;\n }\n\n /**\n * Remove component type\n * @param {string} type Component ID\n * @returns {Object|undefined} Removed component type, undefined otherwise\n */\n removeType(id: string) {\n const df = this.componentTypes;\n const type = this.getType(id);\n if (!type) return;\n const index = df.indexOf(type);\n df.splice(index, 1);\n return type;\n }\n\n /**\n * Return the array of all types\n * @return {Array}\n */\n getTypes() {\n return this.componentTypes;\n }\n\n selectAdd(component: Component, opts = {}) {\n if (component) {\n component.set({\n status: 'selected',\n });\n ['component:selected', 'component:toggled'].forEach(event => this.em.trigger(event, component, opts));\n }\n }\n\n selectRemove(component: Component, opts = {}) {\n if (component) {\n const { em } = this;\n component.set({\n status: '',\n state: '',\n });\n ['component:deselected', 'component:toggled'].forEach(event => this.em.trigger(event, component, opts));\n }\n }\n\n /**\n * Triggered when the component is hovered\n * @private\n */\n componentHovered() {\n const { em } = this;\n const model = em.get('componentHovered');\n const previous = em.previous('componentHovered');\n const state = 'hovered';\n\n // Deselect the previous component\n previous &&\n previous.get('status') == state &&\n previous.set({\n status: '',\n state: '',\n });\n\n model && isEmpty(model.get('status')) && model.set('status', state);\n }\n\n getShallowWrapper() {\n let { shallow, em } = this;\n\n if (!shallow && em) {\n const shallowEm = em.shallow;\n if (!shallowEm) return;\n const domc = shallowEm.Components;\n domc.componentTypes = this.componentTypes;\n shallow = domc.getWrapper();\n if (shallow) {\n const events = [keyUpdate, keyUpdateInside].join(' ');\n shallow.on(\n events,\n debounce(() => shallow?.components(''), 100)\n );\n }\n this.shallow = shallow;\n }\n\n return shallow;\n }\n\n /**\n * Check if the object is a [Component].\n * @param {Object} obj\n * @returns {Boolean}\n * @example\n * cmp.isComponent(editor.getSelected()); // true\n * cmp.isComponent({}); // false\n */\n isComponent(obj?: ObjectAny): obj is Component {\n return isComponent(obj);\n }\n\n /**\n * Add a new symbol from a component.\n * If the passed component is not a symbol, it will be converted to an instance and will return the main symbol.\n * If the passed component is already an instance, a new instance will be created and returned.\n * If the passed component is the main symbol, a new instance will be created and returned.\n * @param {[Component]} component Component from which create a symbol.\n * @returns {[Component]}\n * @example\n * const symbol = cmp.addSymbol(editor.getSelected());\n * // cmp.getSymbolInfo(symbol).isSymbol === true;\n */\n addSymbol(component: Component) {\n if (isSymbol(component) && !isSymbolRoot(component)) {\n return;\n }\n\n const symbol = component.clone({ symbol: true });\n isSymbolMain(symbol) && this.symbols.add(symbol);\n this.em.trigger('component:toggled');\n\n return symbol;\n }\n\n /**\n * Get the array of main symbols.\n * @returns {Array<[Component]>}\n * @example\n * const symbols = cmp.getSymbols();\n * // [Component, Component, ...]\n * // Removing the main symbol will detach all the relative instances.\n * symbols[0].remove();\n */\n getSymbols() {\n return [...this.symbols.models];\n }\n\n /**\n * Detach symbol instance from the main one.\n * The passed symbol instance will become a regular component.\n * @param {[Component]} component The component symbol to detach.\n * @example\n * const cmpInstance = editor.getSelected();\n * // cmp.getSymbolInfo(cmpInstance).isInstance === true;\n * cmp.detachSymbol(cmpInstance);\n * // cmp.getSymbolInfo(cmpInstance).isInstance === false;\n */\n detachSymbol(component: Component) {\n if (isSymbolInstance(component)) {\n detachSymbolInstance(component);\n }\n }\n\n /**\n * Get info about the symbol.\n * @param {[Component]} component Component symbol from which to get the info.\n * @returns {Object} Object containing symbol info.\n * @example\n * cmp.getSymbolInfo(editor.getSelected());\n * // > { isSymbol: true, isMain: false, isInstance: true, ... }\n */\n getSymbolInfo(component: Component, opts: { withChanges?: string } = {}): SymbolInfo {\n const isMain = isSymbolMain(component);\n const mainRef = getSymbolMain(component);\n const isInstance = !!mainRef;\n const instances = (isMain ? getSymbolInstances(component) : getSymbolInstances(mainRef)) || [];\n const main = mainRef || (isMain ? component : undefined);\n const relatives = getSymbolsToUpdate(component, { changed: opts.withChanges });\n const isSymbol = isMain || isInstance;\n const isRoot = isSymbol && isSymbolRoot(component);\n\n return {\n isSymbol,\n isMain,\n isInstance,\n isRoot,\n main,\n instances: instances,\n relatives: relatives || [],\n };\n }\n\n /**\n * Check if a component can be moved inside another one.\n * @param {[Component]} target The target component is the one that is supposed to receive the source one.\n * @param {[Component]|String} source The source can be another component, a component definition or an HTML string.\n * @param {Number} [index] Index position, if not specified, the check will be performed against appending the source to the target.\n * @returns {Object} Object containing the `result` (Boolean), `source`, `target` (as Components), and a `reason` (Number) with these meanings:\n * * `0` - Invalid source. This is a default value and should be ignored in case the `result` is true.\n * * `1` - Source doesn't accept target as destination.\n * * `2` - Target doesn't accept source.\n * @example\n * const rootComponent = editor.getWrapper();\n * const someComponent = editor.getSelected();\n *\n * // Check with two components\n * editor.Components.canMove(rootComponent, someComponent);\n *\n * // Check with component definition\n * editor.Components.canMove(rootComponent, { tagName: 'a', draggable: false });\n *\n * // Check with HTML string\n * editor.Components.canMove(rootComponent, '
...
');\n */\n canMove(target: Component, source?: Component | ComponentDefinition | string, index?: number): CanMoveResult {\n const result: CanMoveResult = {\n result: false,\n reason: CanMoveReason.InvalidSource,\n target,\n source: null,\n };\n\n if (!source || !target) return result;\n\n let srcModel = isComponent(source) ? source : null;\n\n if (!srcModel) {\n const wrapper = this.getShallowWrapper();\n srcModel = wrapper?.append(source)[0] || null;\n }\n\n result.source = srcModel;\n\n if (!srcModel) return result;\n\n // Check if the source is draggable in the target\n let draggable = srcModel.get('draggable');\n\n if (isFunction(draggable)) {\n draggable = !!draggable(srcModel, target, index);\n } else {\n const el = target.getEl();\n draggable = isArray(draggable) ? draggable.join(',') : draggable;\n draggable = isString(draggable) ? el?.matches(draggable) : draggable;\n }\n\n if (!draggable) return { ...result, reason: CanMoveReason.SourceReject };\n\n // Check if the target accepts the source\n let droppable = target.get('droppable');\n\n if (isFunction(droppable)) {\n droppable = !!droppable(srcModel, target, index);\n } else {\n if (droppable === false && target.isInstanceOf('text') && srcModel.get('textable')) {\n droppable = true;\n } else {\n const el = srcModel.getEl();\n droppable = isArray(droppable) ? droppable.join(',') : droppable;\n droppable = isString(droppable) ? el?.matches(droppable) : droppable;\n }\n }\n\n // Ensure the target is not inside the source\n const isTargetInside = [target].concat(target.parents()).indexOf(srcModel) > -1;\n\n if (!droppable || isTargetInside) return { ...result, reason: CanMoveReason.TargetReject };\n\n return { ...result, result: true };\n }\n\n allById() {\n return this.componentsById;\n }\n\n getById(id: string) {\n return this.componentsById[id] || null;\n }\n\n destroy() {\n const all = this.allById();\n Object.keys(all).forEach(id => all[id] && all[id].remove());\n this.componentView?.remove();\n [this.em, this.componentsById, this.componentView].forEach(i => (i = {}));\n }\n}\n","export interface CssComposerConfig {\n /**\n * Style prefix.\n * @default 'css-'\n */\n stylePrefix?: string;\n\n /**\n * Default CSS style rules\n */\n rules?: Array; // TODO\n}\n\nconst config: CssComposerConfig = {\n stylePrefix: 'css-',\n rules: [],\n};\n\nexport default config;\n","import { bindAll, isUndefined, each } from 'underscore';\nimport { Model } from '../../common';\nimport CssComposer from '../../css_composer';\nimport CssRule from '../../css_composer/model/CssRule';\nimport CssRules from '../../css_composer/model/CssRules';\nimport Component from '../../dom_components/model/Component';\nimport EditorModel from '../../editor/model/Editor';\nimport { hasWin } from '../../utils/mixins';\n\nconst maxValue = Number.MAX_VALUE;\n\nexport const getMediaLength = (mediaQuery: string) => {\n const length = /(-?\\d*\\.?\\d+)\\w{0,}/.exec(mediaQuery);\n return !length ? '' : length[0];\n};\n\nexport type CssGeneratorBuildOptions = {\n /**\n * Return an array of CssRules instead of the CSS string.\n */\n json?: boolean;\n\n /**\n * Return only rules matched by the passed component.\n */\n onlyMatched?: boolean;\n\n /**\n * Force keep all defined rules. Toggle on in case output looks different inside/outside of the editor.\n */\n keepUnusedStyles?: boolean;\n rules?: CssRule[];\n clearStyles?: boolean;\n};\n\ntype CssGeneratorBuildOptionsProps = CssGeneratorBuildOptions & {\n em?: EditorModel;\n cssc?: CssComposer;\n};\n\ntype AtRules = Record;\n\nexport default class CssGenerator extends Model {\n compCls: string[];\n ids: string[];\n model?: Component;\n em?: EditorModel;\n\n constructor() {\n super();\n bindAll(this, 'sortRules');\n this.compCls = [];\n this.ids = [];\n }\n\n /**\n * Get CSS from a component\n * @param {Model} model\n * @return {String}\n */\n buildFromModel(model: Component, opts: CssGeneratorBuildOptions = {}) {\n let code = '';\n const em = this.em;\n const avoidInline = em && em.getConfig().avoidInlineStyle;\n const style = model.styleToString();\n const classes = model.classes;\n this.ids.push(`#${model.getId()}`);\n\n // Let's know what classes I've found\n classes.forEach((model: any) => this.compCls.push(model.getFullName()));\n\n if (!avoidInline && style) {\n code = `#${model.getId()}{${style}}`;\n }\n\n const components = model.components();\n components.forEach((model: Component) => (code += this.buildFromModel(model, opts)));\n return code;\n }\n\n build(model: Component, opts: CssGeneratorBuildOptionsProps = {}) {\n const { json } = opts;\n const em = opts.em;\n const cssc = opts.cssc || em?.Css;\n this.em = em;\n this.compCls = [];\n this.ids = [];\n this.model = model;\n const codeJson: CssRule[] = [];\n let code = model ? this.buildFromModel(model, opts) : '';\n const clearStyles = isUndefined(opts.clearStyles) && em ? em.getConfig().clearStyles : opts.clearStyles;\n\n if (cssc) {\n let rules: CssRules | CssRule[] = opts.rules || cssc.getAll();\n const atRules: AtRules = {};\n const dump: CssRule[] = [];\n\n if (opts.onlyMatched && model && hasWin()) {\n rules = this.matchedRules(model, rules);\n }\n\n rules.forEach(rule => {\n const atRule = rule.getAtRule();\n\n if (atRule) {\n const mRules = atRules[atRule];\n if (mRules) {\n mRules.push(rule);\n } else {\n atRules[atRule] = [rule];\n }\n return;\n }\n\n const res = this.buildFromRule(rule, dump, opts);\n\n if (json) {\n codeJson.push(res as CssRule);\n } else {\n code += res;\n }\n });\n\n this.sortMediaObject(atRules).forEach(item => {\n let rulesStr = '';\n const atRule = item.key;\n const mRules = item.value;\n\n mRules.forEach(rule => {\n const ruleStr = this.buildFromRule(rule, dump, opts);\n\n if (rule.get('singleAtRule')) {\n code += `${atRule}{${ruleStr}}`;\n } else {\n rulesStr += ruleStr;\n }\n\n json && codeJson.push(ruleStr as CssRule);\n });\n\n if (rulesStr) {\n code += `${atRule}{${rulesStr}}`;\n }\n });\n\n // @ts-ignore\n em && clearStyles && rules.remove && rules.remove(dump);\n }\n\n return json ? codeJson.filter(r => r) : code;\n }\n\n /**\n * Get CSS from the rule model\n * @param {Model} rule\n * @return {string} CSS string\n */\n buildFromRule(rule: CssRule, dump: CssRule[], opts: CssGeneratorBuildOptions = {}) {\n let result: CssRule | string = '';\n const { model } = this;\n const selectorStrNoAdd = rule.selectorsToString({ skipAdd: 1 });\n const selectorsAdd = rule.get('selectorsAdd');\n const singleAtRule = rule.get('singleAtRule');\n let found;\n\n // This will not render a rule if there is no its component\n rule.get('selectors')?.forEach(selector => {\n const name = selector.getFullName();\n if (this.compCls.indexOf(name) >= 0 || this.ids.indexOf(name) >= 0 || opts.keepUnusedStyles) {\n found = 1;\n }\n });\n\n if ((selectorStrNoAdd && found) || selectorsAdd || singleAtRule || !model) {\n const block = rule.getDeclaration({ body: 1 });\n block && (opts.json ? (result = rule) : (result += block));\n } else {\n dump.push(rule);\n }\n\n return result;\n }\n\n /**\n * Get matched rules of a component\n * @param {Component} component\n * @param {Array} rules\n * @returns {Array}\n */\n matchedRules(component: Component, rules: CssRules | CssRule[]) {\n const el = component.getEl();\n let result: CssRule[] = [];\n\n rules.forEach(rule => {\n try {\n if (\n rule\n .selectorsToString()\n .split(',')\n .some(selector => el?.matches(this.__cleanSelector(selector)))\n ) {\n result.push(rule);\n }\n } catch (err) {}\n });\n\n component.components().forEach((component: Component) => {\n result = result.concat(this.matchedRules(component, rules));\n });\n\n // Remove duplicates\n result = result.filter((rule, i) => result.indexOf(rule) === i);\n\n return result;\n }\n\n /**\n * Get the numeric length of the media query string\n * @param {String} mediaQuery Media query string\n * @return {Number}\n */\n getQueryLength(mediaQuery: string) {\n const length = /(-?\\d*\\.?\\d+)\\w{0,}/.exec(mediaQuery);\n if (!length) return maxValue;\n\n return parseFloat(length[1]);\n }\n\n /**\n * Return a sorted array from media query object\n * @param {Object} items\n * @return {Array}\n */\n sortMediaObject(items: AtRules = {}) {\n const itemsArr: { key: string; value: CssRule[] }[] = [];\n each(items, (value, key) => itemsArr.push({ key, value }));\n return itemsArr.sort((a, b) => {\n const isMobFirst = [a.key, b.key].every(mquery => mquery.indexOf('min-width') !== -1);\n const left = isMobFirst ? a.key : b.key;\n const right = isMobFirst ? b.key : a.key;\n return this.getQueryLength(left) - this.getQueryLength(right);\n });\n }\n\n sortRules(a: CssRule, b: CssRule) {\n const getKey = (rule: CssRule) => rule.get('mediaText') || '';\n const isMobFirst = [getKey(a), getKey(b)].every(q => q.indexOf('min-width') !== -1);\n const left = isMobFirst ? getKey(a) : getKey(b);\n const right = isMobFirst ? getKey(b) : getKey(a);\n return this.getQueryLength(left) - this.getQueryLength(right);\n }\n\n /**\n * Return passed selector without states\n * @param {String} selector\n * @returns {String}\n * @private\n */\n __cleanSelector(selector: string) {\n return selector\n .split(' ')\n .map(item => item.split(':')[0])\n .join(' ');\n }\n}\n","import { isEmpty, forEach, isString, isArray } from 'underscore';\nimport { Model, ObjectAny } from '../../common';\nimport StyleableModel from '../../domain_abstract/model/StyleableModel';\nimport Selectors from '../../selector_manager/model/Selectors';\nimport { getMediaLength } from '../../code_manager/model/CssGenerator';\nimport { isEmptyObj, hasWin } from '../../utils/mixins';\nimport Selector, { SelectorProps } from '../../selector_manager/model/Selector';\nimport EditorModel from '../../editor/model/Editor';\n\n/** @private */\nexport interface CssRuleProperties {\n /**\n * Array of selectors\n */\n selectors: Selector[];\n /**\n * Object containing style definitions\n * @default {}\n */\n style?: Record;\n /**\n * Additional string css selectors\n * @default ''\n */\n selectorsAdd?: string;\n /**\n * Type of at-rule, eg. `media`, 'font-face'\n * @default ''\n */\n atRuleType?: string;\n /**\n * At-rule value, eg. `(max-width: 1000px)`\n * @default ''\n */\n mediaText?: string;\n /**\n * This property is used only on at-rules, like 'page' or 'font-face', where the block containes only style declarations.\n * @default false\n */\n singleAtRule?: boolean;\n /**\n * State of the rule, eg: `hover`, `focused`\n * @default ''\n */\n state?: string;\n /**\n * If true, sets `!important` on all properties. You can also pass an array to specify properties on which to use important.\n * @default false\n */\n important?: boolean | string[];\n /**\n * Indicates if the rule is stylable from the editor.\n * @default true\n */\n stylable?: boolean | string[];\n /**\n * Group for rules.\n * @default ''\n */\n group?: string;\n /**\n * If true, the rule won't be stored in JSON or showed in CSS export.\n * @default false\n */\n shallow?: boolean;\n}\n\nexport interface CssRuleJSON extends Omit {\n selectors: (string | SelectorProps)[];\n}\n\n// @ts-ignore\nconst { CSS } = hasWin() ? window : {};\n\n/**\n * @typedef CssRule\n * @property {Array} selectors Array of selectors\n * @property {Object} style Object containing style definitions\n * @property {String} [selectorsAdd=''] Additional string css selectors\n * @property {String} [atRuleType=''] Type of at-rule, eg. `media`, 'font-face'\n * @property {String} [mediaText=''] At-rule value, eg. `(max-width: 1000px)`\n * @property {Boolean} [singleAtRule=false] This property is used only on at-rules, like 'page' or 'font-face', where the block containes only style declarations\n * @property {String} [state=''] State of the rule, eg: `hover`, `focused`\n * @property {Boolean|Array} [important=false] If true, sets `!important` on all properties. You can also pass an array to specify properties on which use important\n * @property {Boolean} [stylable=true] Indicates if the rule is stylable from the editor\n *\n * [Device]: device.html\n * [State]: state.html\n * [Component]: component.html\n */\nexport default class CssRule extends StyleableModel {\n config: CssRuleProperties;\n em?: EditorModel;\n opt: any;\n\n defaults() {\n return {\n selectors: [],\n selectorsAdd: '',\n style: {},\n mediaText: '',\n state: '',\n stylable: true,\n atRuleType: '',\n singleAtRule: false,\n important: false,\n group: '',\n shallow: false,\n _undo: true,\n };\n }\n\n constructor(props: CssRuleProperties, opt: any = {}) {\n super(props);\n this.config = props || {};\n this.opt = opt;\n this.em = opt.em;\n this.ensureSelectors(null, null, {});\n this.on('change', this.__onChange);\n }\n\n __onChange(m: CssRule, opts: any) {\n const { em } = this;\n const changed = this.changedAttributes();\n changed && !isEmptyObj(changed) && em?.changesUp(opts);\n }\n\n clone(): CssRule {\n const opts = { ...this.opt };\n const attr = { ...this.attributes };\n attr.selectors = this.get('selectors')!.map(s => s.clone()) as Selector[];\n // @ts-ignore\n return new this.constructor(attr, opts);\n }\n\n ensureSelectors(m: any, c: any, opts: any) {\n const { em } = this;\n const sm = em?.get('SelectorManager');\n const toListen = [this, 'change:selectors', this.ensureSelectors];\n let sels = this.getSelectors() as any;\n this.stopListening(...toListen);\n\n if (sels.models) {\n sels = [...sels.models];\n }\n\n sels = isString(sels) ? [sels] : sels;\n\n if (Array.isArray(sels)) {\n const res = sels.filter(i => i).map(i => (sm ? sm.add(i) : i));\n sels = new Selectors(res);\n }\n\n this.set('selectors', sels, opts);\n // @ts-ignore\n this.listenTo(...toListen);\n }\n\n /**\n * Returns the at-rule statement when exists, eg. `@media (...)`, `@keyframes`\n * @returns {String}\n * @example\n * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)'\n * });\n * cssRule.getAtRule(); // \"@media (min-width: 500px)\"\n */\n getAtRule() {\n const type = this.get('atRuleType');\n const condition = this.get('mediaText');\n // Avoid breaks with the last condition\n const typeStr = type ? `@${type}` : condition ? '@media' : '';\n\n return typeStr + (condition && typeStr ? ` ${condition}` : '');\n }\n\n /**\n * Return selectors of the rule as a string\n * @param {Object} [opts] Options\n * @param {Boolean} [opts.skipState] Skip state from the result\n * @returns {String}\n * @example\n * const cssRule = editor.Css.setRule('.class1:hover', { color: 'red' });\n * cssRule.selectorsToString(); // \".class1:hover\"\n * cssRule.selectorsToString({ skipState: true }); // \".class1\"\n */\n selectorsToString(opts: ObjectAny = {}) {\n const result = [];\n const state = this.get('state');\n const addSelector = this.get('selectorsAdd');\n const selOpts = {\n escape: (str: string) => (CSS && CSS.escape ? CSS.escape(str) : str),\n };\n // @ts-ignore\n const selectors = this.get('selectors').getFullString(0, selOpts);\n const stateStr = state && !opts.skipState ? `:${state}` : '';\n selectors && result.push(`${selectors}${stateStr}`);\n addSelector && !opts.skipAdd && result.push(addSelector);\n return result.join(', ');\n }\n\n /**\n * Get declaration block (without the at-rule statement)\n * @param {Object} [opts={}] Options (same as in `selectorsToString`)\n * @returns {String}\n * @example\n * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)'\n * });\n * cssRule.getDeclaration() // \".class1{color:red;}\"\n */\n getDeclaration(opts: ObjectAny = {}) {\n let result = '';\n const { important } = this.attributes;\n const selectors = this.selectorsToString(opts);\n const style = this.styleToString({ important, ...opts });\n const singleAtRule = this.get('singleAtRule');\n\n if ((selectors || singleAtRule) && (style || opts.allowEmpty)) {\n result = singleAtRule ? style : `${selectors}{${style}}`;\n }\n\n return result;\n }\n\n /**\n * Get the Device the rule is related to.\n * @returns {[Device]|null}\n * @example\n * const device = rule.getDevice();\n * console.log(device?.getName());\n */\n getDevice() {\n const { em } = this;\n const { atRuleType, mediaText } = this.attributes;\n const devices = em?.get('DeviceManager').getDevices() || [];\n const deviceDefault = devices.filter((d: any) => d.getWidthMedia() === '')[0];\n if (atRuleType !== 'media' || !mediaText) {\n return deviceDefault || null;\n }\n return devices.filter((d: any) => d.getWidthMedia() === getMediaLength(mediaText))[0] || null;\n }\n\n /**\n * Get the State the rule is related to.\n * @returns {[State]|null}\n * @example\n * const state = rule.getState();\n * console.log(state?.getLabel());\n */\n getState() {\n const { em } = this;\n const stateValue = this.get('state');\n const states = em?.get('SelectorManager').getStates() || [];\n return states.filter((s: any) => s.getName() === stateValue)[0] || null;\n }\n\n /**\n * Returns the related Component (valid only for component-specific rules).\n * @returns {[Component]|null}\n * @example\n * const cmp = rule.getComponent();\n * console.log(cmp?.toHTML());\n */\n getComponent() {\n const sel = this.getSelectors() as any;\n const sngl = sel.length == 1 && sel.at(0);\n const cmpId = sngl && sngl.isId() && sngl.get('name');\n return (cmpId && this.em?.Components.getById(cmpId)) || null;\n }\n\n /**\n * Return the CSS string of the rule\n * @param {Object} [opts={}] Options (same as in `getDeclaration`)\n * @return {String} CSS string\n * @example\n * const cssRule = editor.Css.setRule('.class1', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)'\n * });\n * cssRule.toCSS() // \"@media (min-width: 500px){.class1{color:red;}}\"\n */\n toCSS(opts: ObjectAny = {}) {\n let result = '';\n const atRule = this.getAtRule();\n const block = this.getDeclaration(opts);\n if (block || opts.allowEmpty) {\n result = block;\n }\n\n if (atRule && result) {\n result = `${atRule}{${result}}`;\n }\n\n return result;\n }\n\n toJSON(...args: any) {\n const obj = Model.prototype.toJSON.apply(this, args);\n\n if (this.em?.getConfig().avoidDefaults) {\n const defaults = this.defaults();\n\n forEach(defaults, (value, key) => {\n if (obj[key] === value) {\n delete obj[key];\n }\n });\n\n // Delete the property used for partial updates\n delete obj.style.__p;\n\n if (isEmpty(obj.selectors)) delete obj.selectors;\n if (isEmpty(obj.style)) delete obj.style;\n }\n\n return obj;\n }\n\n /**\n * Compare the actual model with parameters\n * @param {Object} selectors Collection of selectors\n * @param {String} state Css rule state\n * @param {String} width For which device this style is oriented\n * @param {Object} ruleProps Other rule props\n * @returns {Boolean}\n * @private\n */\n compare(selectors: any, state?: string, width?: string, ruleProps: Partial = {}) {\n const st = state || '';\n const wd = width || '';\n const selAdd = ruleProps.selectorsAdd || '';\n let atRule = ruleProps.atRuleType || '';\n const sel = !isArray(selectors) && !selectors.models ? [selectors] : selectors.models || selectors;\n\n // Fix atRuleType in case is not specified with width\n if (wd && !atRule) atRule = 'media';\n\n const a1: string[] = sel.map((model: any) => model.getFullName());\n const a2: string[] = this.get('selectors')?.map(model => model.getFullName())!;\n\n // Check selectors\n const a1S = a1.slice().sort();\n const a2S = a2.slice().sort();\n if (a1.length !== a2.length || !a1S.every((v, i) => v === a2S[i])) {\n return false;\n }\n\n // Check other properties\n if (\n this.get('state') !== st ||\n this.get('mediaText') !== wd ||\n this.get('selectorsAdd') !== selAdd ||\n this.get('atRuleType') !== atRule\n ) {\n return false;\n }\n\n return true;\n }\n}\n","import { Collection } from '../../common';\nimport EditorModel from '../../editor/model/Editor';\nimport CssRule, { CssRuleProperties } from './CssRule';\n\nexport default class CssRules extends Collection {\n editor: EditorModel;\n\n constructor(props: any, opt: any) {\n super(props);\n // Inject editor\n this.editor = opt?.em;\n\n // This will put the listener post CssComposer.postLoad\n setTimeout(() => {\n this.on('remove', this.onRemove);\n this.on('add', this.onAdd);\n });\n }\n\n toJSON(opts?: any) {\n const result = Collection.prototype.toJSON.call(this, opts);\n return result.filter((rule: CssRuleProperties) => rule.style && !rule.shallow);\n }\n\n onAdd(model: CssRule, c: CssRules, o: any) {\n model.ensureSelectors(model, c, o); // required for undo\n }\n\n onRemove(removed: CssRule) {\n const em = this.editor;\n em.stopListening(removed);\n em.UndoManager.remove(removed);\n }\n\n /** @ts-ignore */\n add(models: any, opt: any = {}) {\n if (typeof models === 'string') {\n models = this.editor.get('Parser').parseCss(models);\n }\n opt.em = this.editor;\n return Collection.prototype.add.apply(this, [models, opt]);\n }\n}\n\nCssRules.prototype.model = CssRule;\n","/**\n * This module manages CSS rules in the canvas.\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/css_composer/config/config.ts)\n * ```js\n * const editor = grapesjs.init({\n * cssComposer: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API. Before using these methods you should get the module from the instance\n *\n * ```js\n * const css = editor.Css;\n * ```\n *\n * * [addRules](#addrules)\n * * [setRule](#setrule)\n * * [getRule](#getrule)\n * * [getRules](#getrules)\n * * [remove](#remove)\n * * [clear](#clear)\n *\n * [CssRule]: css_rule.html\n *\n * @module Css\n */\n\nimport { isArray, isString, isUndefined } from 'underscore';\nimport { isObject } from '../utils/mixins';\nimport Selectors from '../selector_manager/model/Selectors';\nimport Selector from '../selector_manager/model/Selector';\nimport defaults, { CssComposerConfig } from './config/config';\nimport CssRule, { CssRuleJSON, CssRuleProperties } from './model/CssRule';\nimport CssRules from './model/CssRules';\nimport CssRulesView from './view/CssRulesView';\nimport { ItemManagerModule } from '../abstract/Module';\nimport EditorModel from '../editor/model/Editor';\nimport Component from '../dom_components/model/Component';\nimport { ObjectAny, PrevToNewIdMap } from '../common';\nimport { UpdateStyleOptions } from '../domain_abstract/model/StyleableModel';\n\n/** @private */\ninterface RuleOptions {\n /**\n * At-rule type, eg. `media`\n */\n atRuleType?: string;\n /**\n * At-rule parameters, eg. `(min-width: 500px)`\n */\n atRuleParams?: string;\n}\n\n/** @private */\ninterface SetRuleOptions extends RuleOptions, UpdateStyleOptions {\n /**\n * If the rule exists already, merge passed styles instead of replacing them.\n */\n addStyles?: boolean;\n}\n\n/** @private */\nexport interface GetSetRuleOptions extends UpdateStyleOptions {\n state?: string;\n mediaText?: string;\n addOpts?: ObjectAny;\n current?: boolean;\n}\n\ntype CssRuleStyle = Required['style'];\n\nexport default class CssComposer extends ItemManagerModule {\n rules: CssRules;\n rulesView?: CssRulesView;\n\n Selectors = Selectors;\n\n storageKey = 'styles';\n\n /**\n * Initializes module. Automatically called with a new instance of the editor\n * @param {Object} config Configurations\n * @private\n */\n constructor(em: EditorModel) {\n super(em, 'CssComposer', null, {}, defaults);\n const { config } = this;\n\n const ppfx = config.pStylePrefix;\n if (ppfx) config.stylePrefix = ppfx + config.stylePrefix;\n\n // @ts-ignore\n config.rules = this.em.config.style || config.rules || '';\n\n this.rules = new CssRules([], config);\n }\n\n /**\n * On load callback\n * @private\n */\n onLoad() {\n this.rules.add(this.config.rules, { silent: true });\n }\n\n /**\n * Do stuff after load\n * @param {Editor} em\n * @private\n */\n postLoad() {\n const um = this.em?.get('UndoManager');\n um && um.add(this.getAll());\n }\n\n store() {\n return this.getProjectData();\n }\n\n load(data: any) {\n return this.loadProjectData(data, {\n // @ts-ignore Fix add() first in CssRules\n all: this.rules,\n });\n }\n\n /**\n * Add new rule to the collection, if not yet exists with the same selectors\n * @param {Array} selectors Array of selectors\n * @param {String} state Css rule state\n * @param {String} width For which device this style is oriented\n * @param {Object} props Other props for the rule\n * @param {Object} opts Options for the add of new rule\n * @return {Model}\n * @private\n * @example\n * var sm = editor.SelectorManager;\n * var sel1 = sm.add('myClass1');\n * var sel2 = sm.add('myClass2');\n * var rule = cssComposer.add([sel1, sel2], 'hover');\n * rule.set('style', {\n * width: '100px',\n * color: '#fff',\n * });\n * */\n add(selectors: any, state?: string, width?: string, opts = {}, addOpts = {}) {\n const s = state || '';\n const w = width || '';\n const opt = { ...opts } as CssRuleProperties;\n let rule = this.get(selectors, s, w, opt);\n\n // do not create rules that were found before\n // unless this is a single at-rule, for which multiple declarations\n // make sense (e.g. multiple `@font-type`s)\n if (rule && rule.config && !rule.config.singleAtRule) {\n return rule;\n } else {\n opt.state = s;\n opt.mediaText = w;\n opt.selectors = [];\n // #4727: Prevent updating atRuleType if already defined\n if (w && !opt.atRuleType) {\n opt.atRuleType = 'media';\n }\n rule = new CssRule(opt, this.config);\n // @ts-ignore\n rule.get('selectors').add(selectors, addOpts);\n this.rules.add(rule, addOpts);\n return rule;\n }\n }\n\n /**\n * Get the rule\n * @param {String|Array} selectors Array of selectors or selector string, eg `.myClass1.myClass2`\n * @param {String} state Css rule state, eg. 'hover'\n * @param {String} width Media rule value, eg. '(max-width: 992px)'\n * @param {Object} ruleProps Other rule props\n * @return {Model|null}\n * @private\n * @example\n * const sm = editor.SelectorManager;\n * const sel1 = sm.add('myClass1');\n * const sel2 = sm.add('myClass2');\n * const rule = cssComposer.get([sel1, sel2], 'hover', '(max-width: 992px)');\n * // Update the style\n * rule.set('style', {\n * width: '300px',\n * color: '#000',\n * });\n * */\n get(\n selectors: any,\n state?: string,\n width?: string,\n ruleProps?: Omit\n ): CssRule | undefined {\n let slc = selectors;\n if (isString(selectors)) {\n const sm = this.em.Selectors;\n const singleSel = selectors.split(',')[0].trim();\n const node = this.em.Parser.parserCss.checkNode({ selectors: singleSel } as any)[0];\n slc = sm.get(node.selectors as string[]);\n }\n return this.rules.find(rule => rule.compare(slc, state, width, ruleProps)) || null;\n }\n\n getAll() {\n return this.rules;\n }\n\n /**\n * Add a raw collection of rule objects\n * This method overrides styles, in case, of already defined rule\n * @param {String|Array} data CSS string or an array of rule objects, eg. [{selectors: ['class1'], style: {....}}, ..]\n * @param {Object} opts Options\n * @param {Object} props Additional properties to add on rules\n * @return {Array}\n * @private\n */\n addCollection(data: string | CssRuleJSON[], opts: Record = {}, props = {}) {\n const { em } = this;\n const result: CssRule[] = [];\n\n if (isString(data)) {\n data = em.Parser.parseCss(data);\n }\n\n const d = data instanceof Array ? data : [data];\n\n for (var i = 0, l = d.length; i < l; i++) {\n const rule = (d[i] || {}) as CssRuleJSON;\n if (!rule.selectors) continue;\n\n const sm = em?.Selectors;\n if (!sm) console.warn('Selector Manager not found');\n const sl = rule.selectors;\n const sels = sl instanceof Array ? sl : [sl];\n const newSels = [];\n\n for (let j = 0, le = sels.length; j < le; j++) {\n // @ts-ignore\n const selec = sm.add(sels[j]);\n newSels.push(selec);\n }\n\n const modelExists = this.get(newSels, rule.state, rule.mediaText, rule);\n const model = this.add(newSels, rule.state, rule.mediaText, rule, opts);\n const updateStyle = !modelExists || !opts.avoidUpdateStyle;\n const style = rule.style || {};\n\n isObject(props) && model.set(props, opts);\n\n if (updateStyle) {\n const styleUpdate = opts.extend ? { ...model.get('style'), ...style } : style;\n model.set('style', styleUpdate, opts);\n }\n\n result.push(model);\n }\n\n return result;\n }\n\n /**\n * Add CssRules via CSS string.\n * @param {String} css CSS string of rules to add.\n * @returns {Array<[CssRule]>} Array of rules\n * @example\n * const addedRules = css.addRules('.my-cls{ color: red } @media (max-width: 992px) { .my-cls{ color: darkred } }');\n * // Check rules\n * console.log(addedRules.map(rule => rule.toCSS()));\n */\n addRules(css: string) {\n return this.addCollection(css);\n }\n\n /**\n * Add/update the CssRule.\n * @param {String} selectors Selector string, eg. `.myclass`\n * @param {Object} style Style properties and values. If the rule exists, styles will be replaced unless `addStyles` option is used.\n * @param {Object} [opts={}] Additional properties.\n * @param {String} [opts.atRuleType=''] At-rule type, eg. `media`.\n * @param {String} [opts.atRuleParams=''] At-rule parameters, eg. `(min-width: 500px)`.\n * @param {Boolean} [opts.addStyles=false] If the rule exists already, merge passed styles instead of replacing them.\n * @returns {[CssRule]} The new/updated CssRule.\n * @example\n * // Simple class-based rule\n * const rule = css.setRule('.class1.class2', { color: 'red' });\n * console.log(rule.toCSS()) // output: .class1.class2 { color: red }\n * // With state and other mixed selector\n * const rule = css.setRule('.class1.class2:hover, div#myid', { color: 'red' });\n * // output: .class1.class2:hover, div#myid { color: red }\n * // With media\n * const rule = css.setRule('.class1:hover', { color: 'red' }, {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)',\n * });\n * // output: `@media (min-width: 500px) { .class1:hover { color: red } }`\n *\n * // Update styles of existent rule\n * css.setRule('.class1', { color: 'red', background: 'red' });\n * css.setRule('.class1', { color: 'blue' }, { addStyles: true });\n * // output: .class1 { color: blue; background: red }\n */\n setRule(selectors: any, style: CssRuleProperties['style'] = {}, opts: SetRuleOptions = {}) {\n const { atRuleType, atRuleParams } = opts;\n const node = this.em.Parser.parserCss.checkNode({\n selectors,\n style,\n })[0];\n const { state, selectorsAdd } = node;\n const sm = this.em.Selectors;\n const selector = sm.add(node.selectors as any);\n const rule = this.add(selector, state, atRuleParams, {\n selectorsAdd,\n atRule: atRuleType,\n });\n\n if (opts.addStyles) {\n rule.addStyle(style, opts);\n } else {\n rule.setStyle(style, opts);\n }\n\n return rule;\n }\n\n /**\n * Get the CssRule.\n * @param {String} selectors Selector string, eg. `.myclass:hover`\n * @param {Object} [opts={}] Additional properties\n * @param {String} [opts.atRuleType=''] At-rule type, eg. `media`\n * @param {String} [opts.atRuleParams=''] At-rule parameters, eg. '(min-width: 500px)'\n * @returns {[CssRule]}\n * @example\n * const rule = css.getRule('.myclass1:hover');\n * const rule2 = css.getRule('.myclass1:hover, div#myid');\n * const rule3 = css.getRule('.myclass1', {\n * atRuleType: 'media',\n * atRuleParams: '(min-width: 500px)',\n * });\n */\n getRule(selectors: any, opts: RuleOptions = {}) {\n const { em } = this;\n const sm = em.Selectors;\n const node = em.Parser.parserCss.checkNode({ selectors })[0];\n // @ts-ignore\n const selector = sm.get(node.selectors);\n const { state, selectorsAdd } = node;\n const { atRuleType, atRuleParams } = opts;\n return selector\n ? this.get(selector, state, atRuleParams, {\n selectorsAdd,\n atRuleType,\n })\n : undefined;\n }\n\n /**\n * Get all rules or filtered by a matching selector.\n * @param {String} [selector=''] Selector, eg. `.myclass`\n * @returns {Array<[CssRule]>}\n * @example\n * // Take all the component specific rules\n * const id = someComponent.getId();\n * const rules = css.getRules(`#${id}`);\n * console.log(rules.map(rule => rule.toCSS()))\n * // All rules in the project\n * console.log(css.getRules())\n */\n getRules(selector?: string) {\n const rules = this.getAll();\n if (!selector) return [...rules.models];\n const optRuleSel = { sort: true };\n const sels = isString(selector) ? selector.split(',').map(s => s.trim()) : selector;\n const result = rules.filter(r => sels.indexOf(r.getSelectors().getFullString(null, optRuleSel)) >= 0);\n return result;\n }\n\n /**\n * Add/update the CSS rule with id selector\n * @param {string} name Id selector name, eg. 'my-id'\n * @param {Object} style Style properties and values\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule} The new/updated rule\n * @private\n * @example\n * const rule = css.setIdRule('myid', { color: 'red' });\n * const ruleHover = css.setIdRule('myid', { color: 'blue' }, { state: 'hover' });\n * // This will add current CSS:\n * // #myid { color: red }\n * // #myid:hover { color: blue }\n */\n setIdRule(name: string, style: CssRuleStyle = {}, opts: GetSetRuleOptions = {}) {\n const { addOpts = {}, mediaText } = opts;\n const state = opts.state || '';\n const media = !isUndefined(mediaText) ? mediaText : this.em.getCurrentMedia();\n const sm = this.em.Selectors;\n const selector = sm.add({ name, type: Selector.TYPE_ID }, addOpts);\n const rule = this.add(selector, state, media, {}, addOpts);\n rule.setStyle(style, { ...opts, ...addOpts });\n return rule;\n }\n\n /**\n * Get the CSS rule by id selector\n * @param {string} name Id selector name, eg. 'my-id'\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule}\n * @private\n * @example\n * const rule = css.getIdRule('myid');\n * const ruleHover = css.setIdRule('myid', { state: 'hover' });\n */\n getIdRule(name: string, opts: GetSetRuleOptions = {}) {\n const { mediaText } = opts;\n const state = opts.state || '';\n const media = !isUndefined(mediaText) ? mediaText : this.em.getCurrentMedia();\n const selector = this.em.Selectors.get(name, Selector.TYPE_ID);\n return selector && this.get(selector, state, media);\n }\n\n /**\n * Add/update the CSS rule with class selector\n * @param {string} name Class selector name, eg. 'my-class'\n * @param {Object} style Style properties and values\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule} The new/updated rule\n * @private\n * @example\n * const rule = css.setClassRule('myclass', { color: 'red' });\n * const ruleHover = css.setClassRule('myclass', { color: 'blue' }, { state: 'hover' });\n * // This will add current CSS:\n * // .myclass { color: red }\n * // .myclass:hover { color: blue }\n */\n setClassRule(name: string, style: CssRuleStyle = {}, opts: GetSetRuleOptions = {}) {\n const state = opts.state || '';\n const media = opts.mediaText || this.em.getCurrentMedia();\n const sm = this.em.Selectors;\n const selector = sm.add({ name, type: Selector.TYPE_CLASS });\n const rule = this.add(selector, state, media);\n rule.setStyle(style, opts);\n return rule;\n }\n\n /**\n * Get the CSS rule by class selector\n * @param {string} name Class selector name, eg. 'my-class'\n * @param {Object} [opts={}] Custom options, like `state` and `mediaText`\n * @return {CssRule}\n * @private\n * @example\n * const rule = css.getClassRule('myclass');\n * const ruleHover = css.getClassRule('myclass', { state: 'hover' });\n */\n getClassRule(name: string, opts: GetSetRuleOptions = {}) {\n const state = opts.state || '';\n const media = opts.mediaText || this.em.getCurrentMedia();\n const selector = this.em.Selectors.get(name, Selector.TYPE_CLASS);\n return selector && this.get(selector, state, media);\n }\n\n /**\n * Remove rule, by CssRule or matching selector (eg. the selector will match also at-rules like `@media`)\n * @param {String|[CssRule]|Array<[CssRule]>} rule CssRule or matching selector.\n * @return {Array<[CssRule]>} Removed rules\n * @example\n * // Remove by CssRule\n * const toRemove = css.getRules('.my-cls');\n * css.remove(toRemove);\n * // Remove by selector\n * css.remove('.my-cls-2');\n */\n remove(rule: string | CssRule, opts?: any) {\n const toRemove = isString(rule) ? this.getRules(rule) : rule;\n const result = this.getAll().remove(toRemove, opts);\n return isArray(result) ? result : [result];\n }\n\n /**\n * Remove all rules\n * @return {this}\n */\n clear(opts = {}) {\n this.getAll().reset([], opts);\n return this;\n }\n\n getComponentRules(cmp: Component, opts: GetSetRuleOptions = {}) {\n let { state, mediaText, current } = opts;\n if (current) {\n state = this.em.get('state') || '';\n mediaText = this.em.getCurrentMedia();\n }\n const id = cmp.getId();\n const rules = this.getAll().filter(r => {\n if (!isUndefined(state) && r.get('state') !== state) return false;\n if (!isUndefined(mediaText) && r.get('mediaText') !== mediaText) return false;\n return r.getSelectorsString() === `#${id}`;\n });\n return rules;\n }\n\n /**\n * Render the block of CSS rules\n * @return {HTMLElement}\n * @private\n */\n render() {\n this.rulesView?.remove();\n this.rulesView = new CssRulesView({\n collection: this.rules,\n config: this.config,\n });\n return this.rulesView.render().el;\n }\n\n checkId(rule: CssRuleJSON | CssRuleJSON[], opts: { idMap?: PrevToNewIdMap } = {}) {\n const { idMap = {} } = opts;\n const changed: CssRuleJSON[] = [];\n\n if (!Object.keys(idMap).length) return changed;\n\n const rules = Array.isArray(rule) ? rule : [rule];\n rules.forEach(rule => {\n const sel = rule.selectors;\n\n if (sel && sel.length == 1) {\n const sSel = sel[0];\n\n if (isString(sSel)) {\n if (sSel[0] === '#') {\n const prevId = sSel.substring(1);\n const newId = idMap[prevId];\n if (prevId && newId) {\n sel[0] = `#${newId}`;\n changed.push(rule);\n }\n }\n } else if (sSel.name && sSel.type === Selector.TYPE_ID) {\n const newId = idMap[sSel.name];\n if (newId) {\n sSel.name = newId;\n changed.push(rule);\n }\n }\n }\n });\n\n return changed;\n }\n\n destroy() {\n this.rules.reset();\n this.rules.stopListening();\n this.rulesView?.remove();\n }\n}\n","import Editor from '../../editor';\nimport Block, { BlockProperties } from '../model/Block';\n\nexport interface BlockManagerConfig {\n /**\n * Specify the element to use as a container, string (query) or HTMLElement.\n * With the empty value, nothing will be rendered.\n * @default ''\n */\n appendTo?: HTMLElement | string;\n /**\n * Default blocks.\n * @default []\n */\n blocks?: BlockProperties[];\n /**\n * Append blocks to canvas on click.\n * With the `true` value, it will try to append the block to the selected component\n * If there is no selected component, the block will be appened to the wrapper.\n * You can also pass a function to this option, use it as a catch-all for all block\n * clicks and implement a custom logic for each block.\n * @default false\n * @example\n * // Example with a function\n * appendOnClick: (block, editor) => {\n * if (block.get('id') === 'some-id')\n * editor.getSelected().append(block.get('content'))\n * else\n * editor.getWrapper().append(block.get('content'))\n * }\n */\n appendOnClick?: boolean | ((block: Block, editor: Editor, opts: { event: Event }) => void);\n /**\n * Avoid rendering the default block manager UI.\n * More about it here: https://grapesjs.com/docs/modules/Blocks.html#customization\n * @default false\n */\n custom?: boolean;\n}\n\nconst config: BlockManagerConfig = {\n appendTo: '',\n blocks: [],\n appendOnClick: false,\n custom: false,\n};\n\nexport default config;\n","import { Model } from '../../common';\nimport { isFunction } from 'underscore';\nimport Editor from '../../editor';\nimport Category, { CategoryProperties } from '../../abstract/ModuleCategory';\nimport { ComponentDefinition } from '../../dom_components/model/types';\nimport Blocks from './Blocks';\n\n/** @private */\nexport interface BlockProperties {\n /**\n * Block label, eg. `My block`\n */\n label: string;\n /**\n * The content of the block. Might be an HTML string or a [Component Defintion](/modules/Components.html#component-definition)\n */\n content: string | ComponentDefinition | (string | ComponentDefinition)[];\n /**\n * HTML string for the media/icon of the block, eg. ` editor.getWrapper().append(block.get('content'))\n */\n onClick?: (block: Block, editor: Editor) => void;\n /**\n * Block attributes\n */\n attributes?: Record;\n\n id?: string;\n\n /**\n * @deprecated\n */\n activeOnRender?: boolean;\n}\n\n/**\n * @property {String} label Block label, eg. `My block`\n * @property {String|Object} content The content of the block. Might be an HTML string or a [Component Defintion](/modules/Components.html#component-definition)\n * @property {String} [media=''] HTML string for the media/icon of the block, eg. ` editor.getWrapper().append(block.get('content'))`\n * @property {Object} [attributes={}] Block attributes to apply in the view element\n *\n * @module docsjs.Block\n */\nexport default class Block extends Model {\n defaults() {\n return {\n label: '',\n content: '',\n media: '',\n category: '',\n activate: false,\n select: undefined,\n resetId: false,\n disable: false,\n onClick: undefined,\n attributes: {},\n };\n }\n\n get category(): Category | undefined {\n const cat = this.get('category');\n return cat instanceof Category ? cat : undefined;\n }\n\n get parent() {\n return this.collection as unknown as Blocks;\n }\n\n /**\n * Get block id\n * @returns {String}\n */\n getId() {\n return this.id as string;\n }\n\n /**\n * Get block label\n * @returns {String}\n */\n getLabel() {\n return this.get('label')!;\n }\n\n /**\n * Get block media\n * @returns {String}\n */\n getMedia() {\n return this.get('media');\n }\n\n /**\n * Get block content\n * @returns {Object|String|Array}\n */\n getContent() {\n return this.get('content');\n }\n\n /**\n * Get block category label\n * @returns {String}\n */\n getCategoryLabel(): string {\n const ctg = this.get('category');\n // @ts-ignore\n return isFunction(ctg?.get) ? ctg.get('label') : ctg?.label ? ctg?.label : ctg;\n }\n}\n","import { CollectionWithCategories } from '../../abstract/CollectionWithCategories';\nimport EditorModel from '../../editor/model/Editor';\nimport Block from './Block';\n\nexport default class Blocks extends CollectionWithCategories {\n em: EditorModel;\n\n constructor(coll: any[], options: { em: EditorModel }) {\n super(coll);\n this.em = options.em;\n this.on('add', this.handleAdd);\n }\n\n getCategories() {\n return this.em.Blocks.getCategories();\n }\n\n handleAdd(model: Block) {\n this.initCategory(model);\n }\n}\n\nBlocks.prototype.model = Block;\n","import { ItemsByCategory } from '../abstract/ModuleCategory';\nimport Block from './model/Block';\n\nexport interface BlocksByCategory extends ItemsByCategory {}\n\n/**{START_EVENTS}*/\nexport enum BlocksEvents {\n /**\n * @event `block:add` New block added to the collection. The [Block] is passed as an argument to the callback.\n * @example\n * editor.on('block:add', (block) => { ... });\n */\n add = 'block:add',\n\n /**\n * @event `block:remove` Block removed from the collection. The [Block] is passed as an argument to the callback.\n * @example\n * editor.on('block:remove', (block) => { ... });\n */\n remove = 'block:remove',\n\n /**\n * @event `block:remove:before` Event triggered before Block remove.\n * @example\n * editor.on('block:remove:before', (block, remove, opts) => { ... });\n */\n removeBefore = 'block:remove:before',\n\n /**\n * @event `block:update` Block updated. The [Block] and the object containing changes are passed as arguments to the callback.\n * @example\n * editor.on('block:update', (block, updatedProps) => { ... });\n */\n update = 'block:update',\n\n /**\n * @event `block:drag:start` Started dragging block. The [Block] is passed as an argument.\n * @example\n * editor.on('block:drag:start', (block) => { ... });\n */\n dragStart = 'block:drag:start',\n\n /**\n * @event `block:drag` The block is dragging. The [Block] is passed as an argument.\n * @example\n * editor.on('block:drag', (block) => { ... });\n */\n drag = 'block:drag',\n\n /**\n * @event `block:drag:stop` Dragging of the block is stopped. The dropped [Component] (if dropped successfully) and the [Block] are passed as arguments.\n * @example\n * editor.on('block:drag:stop', (component, block) => { ... });\n */\n dragEnd = 'block:drag:stop',\n\n /**\n * @event `block:category:update` Block category updated.\n * @example\n * editor.on('block:category:update', ({ category, changes }) => { ... });\n */\n categoryUpdate = 'block:category:update',\n\n /**\n * @event `block:custom` Event to use in case of [custom Block Manager UI](https://grapesjs.com/docs/modules/Blocks.html#customization).\n * @example\n * editor.on('block:custom', ({ container, blocks, ... }) => { ... });\n */\n custom = 'block:custom',\n\n /**\n * @event `block` Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback.\n * @example\n * editor.on('block', ({ event, model, ... }) => { ... });\n */\n all = 'block',\n}\n/**{END_EVENTS}*/\n\n// need this to avoid the TS documentation generator to break\nexport default BlocksEvents;\n","import { isFunction } from 'underscore';\nimport { View } from '../../common';\nimport EditorModel from '../../editor/model/Editor';\nimport { on, off } from '../../utils/dom';\nimport { hasDnd } from '../../utils/mixins';\nimport { BlockManagerConfig } from '../config/config';\nimport Block from '../model/Block';\n\nexport interface BlockViewConfig {\n em?: EditorModel;\n pStylePrefix?: string;\n appendOnClick?: BlockManagerConfig['appendOnClick'];\n getSorter?: any;\n}\n\nexport default class BlockView extends View {\n em: EditorModel;\n config: BlockViewConfig;\n ppfx: string;\n\n events() {\n return {\n click: 'handleClick',\n mousedown: 'startDrag',\n dragstart: 'handleDragStart',\n drag: 'handleDrag',\n dragend: 'handleDragEnd',\n };\n }\n\n constructor(o: any, config: BlockViewConfig = {}) {\n super(o);\n const { model } = this;\n this.em = config.em!;\n this.config = config;\n this.endDrag = this.endDrag.bind(this);\n this.ppfx = config.pStylePrefix || '';\n this.listenTo(model, 'destroy remove', this.remove);\n this.listenTo(model, 'change', this.render);\n }\n\n __getModule() {\n return this.em.Blocks;\n }\n\n handleClick(ev: Event) {\n const { config, model, em } = this;\n const onClick = model.get('onClick') || config.appendOnClick;\n em.trigger('block:click', model, ev);\n if (!onClick) {\n return;\n } else if (isFunction(onClick)) {\n return onClick(model, em?.getEditor(), { event: ev });\n }\n const sorter = config.getSorter();\n const content = model.get('content')!;\n const selected = em.getSelected();\n sorter.setDropContent(content);\n let target, valid, insertAt;\n\n // If there is a selected component, try first to append\n // the block inside, otherwise, try to place it as a next sibling\n if (selected) {\n valid = sorter.validTarget(selected.getEl(), content);\n\n if (valid.valid) {\n target = selected;\n } else {\n const parent = selected.parent();\n if (parent) {\n valid = sorter.validTarget(parent.getEl(), content);\n if (valid.valid) {\n target = parent;\n insertAt = parent.components().indexOf(selected) + 1;\n }\n }\n }\n }\n\n // If no target found yet, try to append the block to the wrapper\n if (!target) {\n const wrapper = em.getWrapper()!;\n valid = sorter.validTarget(wrapper.getEl(), content);\n if (valid.valid) target = wrapper;\n }\n\n const result = target && target.append(content, { at: insertAt })[0];\n result && em.setSelected(result, { scroll: 1 });\n }\n\n /**\n * Start block dragging\n * @private\n */\n startDrag(e: MouseEvent) {\n const { config, em, model } = this;\n const disable = model.get('disable');\n //Right or middel click\n if (e.button !== 0 || !config.getSorter || this.el.draggable || disable) return;\n em.refreshCanvas();\n const sorter = config.getSorter();\n sorter.__currentBlock = model;\n sorter.setDragHelper(this.el, e);\n sorter.setDropContent(this.model.get('content'));\n sorter.startSort(this.el);\n on(document, 'mouseup', this.endDrag);\n }\n\n handleDragStart(ev: DragEvent) {\n this.__getModule().__startDrag(this.model, ev);\n }\n\n handleDrag(ev: DragEvent) {\n this.__getModule().__drag(ev);\n }\n\n handleDragEnd() {\n this.__getModule().__endDrag();\n }\n\n /**\n * Drop block\n * @private\n */\n endDrag() {\n off(document, 'mouseup', this.endDrag);\n const sorter = this.config.getSorter();\n\n // After dropping the block in the canvas the mouseup event is not yet\n // triggerd on 'this.doc' and so clicking outside, the sorter, tries to move\n // things (throws false positives). As this method just need to drop away\n // the block helper I use the trick of 'moved = 0' to void those errors.\n sorter.moved = 0;\n sorter.endMove();\n }\n\n render() {\n const { em, el, $el, ppfx, model } = this;\n const disable = model.get('disable');\n const attr = model.get('attributes') || {};\n const cls = attr.class || '';\n const className = `${ppfx}block`;\n const label = (em && em.t(`blockManager.labels.${model.id}`)) || model.get('label');\n // @ts-ignore deprecated\n const render = model.get('render');\n const media = model.get('media');\n const clsAdd = disable ? `${className}--disable` : `${ppfx}four-color-h`;\n $el.attr(attr);\n el.className = `${cls} ${className} ${ppfx}one-bg ${clsAdd}`.trim();\n el.innerHTML = `\n ${media ? `
${media}
` : ''}\n
${label}
\n `;\n el.title = attr.title || el.textContent?.trim();\n el.setAttribute('draggable', `${hasDnd(em) && !disable ? true : false}`);\n // @ts-ignore\n const result = render && render({ el, model, className, prefix: ppfx });\n if (result) el.innerHTML = result;\n return this;\n }\n}\n","import { View } from '../common';\nimport EditorModel from '../editor/model/Editor';\nimport html from '../utils/html';\nimport Category from './ModuleCategory';\n\nexport interface CategoryViewConfig {\n em: EditorModel;\n pStylePrefix?: string;\n stylePrefix?: string;\n}\n\nexport default class CategoryView extends View {\n em: EditorModel;\n config: CategoryViewConfig;\n pfx: string;\n caretR: string;\n caretD: string;\n iconClass: string;\n activeClass: string;\n iconEl?: HTMLElement;\n typeEl?: HTMLElement;\n catName: string;\n\n events() {\n return {\n 'click [data-title]': 'toggle',\n };\n }\n\n template({ pfx, label, catName }: { pfx: string; label: string; catName: string }) {\n return html`\n
\n \n ${label}\n
\n
\n `;\n }\n\n /** @ts-ignore */\n attributes() {\n return this.model.get('attributes') || {};\n }\n\n constructor(o: any, config: CategoryViewConfig, catName: string) {\n super(o);\n this.config = config;\n const pfx = config.pStylePrefix || '';\n this.em = config.em;\n this.catName = catName;\n this.pfx = pfx;\n this.caretR = 'fa fa-caret-right';\n this.caretD = 'fa fa-caret-down';\n this.iconClass = `${pfx}caret-icon`;\n this.activeClass = `${pfx}open`;\n this.className = `${pfx}${catName}-category`;\n this.listenTo(this.model, 'change:open', this.updateVisibility);\n this.model.view = this;\n }\n\n updateVisibility() {\n if (this.model.get('open')) this.open();\n else this.close();\n }\n\n open() {\n this.$el.addClass(this.activeClass);\n this.getIconEl()!.className = `${this.iconClass} ${this.caretD}`;\n this.getTypeEl()!.style.display = '';\n }\n\n close() {\n this.$el.removeClass(this.activeClass);\n this.getIconEl()!.className = `${this.iconClass} ${this.caretR}`;\n this.getTypeEl()!.style.display = 'none';\n }\n\n toggle() {\n var model = this.model;\n model.set('open', !model.get('open'));\n }\n\n getIconEl() {\n if (!this.iconEl) {\n this.iconEl = this.el.querySelector(`.${this.iconClass}`)!;\n }\n\n return this.iconEl;\n }\n\n getTypeEl() {\n if (!this.typeEl) {\n this.typeEl = this.el.querySelector(`.${this.pfx}${this.catName}s-c`)!;\n }\n\n return this.typeEl;\n }\n\n append(el: HTMLElement) {\n this.getTypeEl().appendChild(el);\n }\n\n render() {\n const { em, el, $el, model, pfx, catName } = this;\n const label = em.t(`${catName}Manager.categories.${model.id}`) || model.get('label');\n el.innerHTML = this.template({ pfx, label, catName });\n $el.addClass(this.className!);\n $el.css({ order: model.get('order')! });\n this.updateVisibility();\n\n return this;\n }\n}\n","import { isString, isObject, bindAll } from 'underscore';\nimport BlockManager from '..';\nimport { View } from '../../common';\nimport Component from '../../dom_components/model/Component';\nimport EditorModel from '../../editor/model/Editor';\nimport Block from '../model/Block';\nimport Categories from '../../abstract/ModuleCategories';\nimport BlockView from './BlockView';\nimport CategoryView from '../../abstract/ModuleCategoryView';\n\nexport interface BlocksViewConfig {\n em: EditorModel;\n pStylePrefix?: string;\n ignoreCategories?: boolean;\n getSorter?: any;\n}\n\nexport default class BlocksView extends View {\n em: EditorModel;\n config: BlocksViewConfig;\n categories: Categories;\n renderedCategories = new Map();\n ppfx: string;\n noCatClass: string;\n blockContClass: string;\n catsClass: string;\n catsEl?: HTMLElement;\n blocksEl?: HTMLElement;\n rendered?: boolean;\n sorter: any;\n\n constructor(opts: any, config: BlocksViewConfig) {\n super(opts);\n bindAll(this, 'getSorter', 'onDrag', 'onDrop', 'onMove');\n this.config = config || {};\n this.categories = opts.categories || '';\n const ppfx = this.config.pStylePrefix || '';\n this.ppfx = ppfx;\n this.noCatClass = `${ppfx}blocks-no-cat`;\n this.blockContClass = `${ppfx}blocks-c`;\n this.catsClass = `${ppfx}block-categories`;\n const coll = this.collection;\n this.listenTo(coll, 'add', this.addTo);\n this.listenTo(coll, 'reset', this.render);\n this.em = this.config.em;\n\n if (this.em) {\n this.config.getSorter = this.getSorter;\n }\n }\n\n __getModule(): BlockManager {\n return this.em.Blocks;\n }\n\n updateConfig(opts = {}) {\n this.config = {\n ...this.config,\n ...opts,\n };\n }\n\n /**\n * Get sorter\n * @private\n */\n getSorter() {\n const { em } = this;\n if (!em) return;\n\n if (!this.sorter) {\n const utils = em.Utils;\n const canvas = em.Canvas;\n\n this.sorter = new utils.Sorter({\n // @ts-ignore\n container: canvas.getBody(),\n placer: canvas.getPlacerEl(),\n containerSel: '*',\n itemSel: '*',\n pfx: this.ppfx,\n onStart: this.onDrag,\n onEndMove: this.onDrop,\n onMove: this.onMove,\n document: canvas.getFrameEl().contentDocument,\n direction: 'a',\n wmargin: 1,\n nested: 1,\n em,\n canvasRelative: 1,\n });\n }\n\n return this.sorter;\n }\n\n onDrag(ev: Event) {\n this.em.stopDefault();\n this.__getModule().__startDrag(this.sorter.__currentBlock, ev);\n }\n\n onMove(ev: Event) {\n this.__getModule().__drag(ev);\n }\n\n onDrop(component?: Component) {\n this.em.runDefault();\n this.__getModule().__endDrag({ component });\n delete this.sorter.__currentBlock;\n }\n\n /**\n * Add new model to the collection\n * @param {Model} model\n * @private\n * */\n addTo(model: Block) {\n this.add(model);\n }\n\n /**\n * Render new model inside the view\n * @param {Model} model\n * @param {Object} fragment Fragment collection\n * @private\n * */\n add(model: Block, fragment?: DocumentFragment) {\n const { config, renderedCategories } = this;\n const attributes = model.get('attributes');\n const view = new BlockView({ model, attributes }, config);\n const rendered = view.render().el;\n const category = model.parent.initCategory(model);\n\n // Check for categories\n if (category && this.categories && !config.ignoreCategories) {\n const catId = category.getId();\n const categories = this.getCategoriesEl();\n let catView = renderedCategories.get(catId);\n\n if (!catView && categories) {\n catView = new CategoryView({ model: category }, config, 'block').render();\n renderedCategories.set(catId, catView);\n categories.appendChild(catView.el);\n }\n\n catView?.append(rendered);\n return;\n }\n\n fragment ? fragment.appendChild(rendered) : this.append(rendered);\n }\n\n getCategoriesEl() {\n if (!this.catsEl) {\n this.catsEl = this.el.querySelector(`.${this.catsClass}`)!;\n }\n\n return this.catsEl;\n }\n\n getBlocksEl() {\n if (!this.blocksEl) {\n this.blocksEl = this.el.querySelector(`.${this.noCatClass} .${this.blockContClass}`)!;\n }\n\n return this.blocksEl;\n }\n\n append(el: HTMLElement | DocumentFragment) {\n let blocks = this.getBlocksEl();\n blocks && blocks.appendChild(el);\n }\n\n render() {\n const ppfx = this.ppfx;\n const frag = document.createDocumentFragment();\n delete this.catsEl;\n delete this.blocksEl;\n this.renderedCategories = new Map();\n this.el.innerHTML = `\n
\n
\n
\n
\n `;\n\n this.collection.each(model => this.add(model, frag));\n this.append(frag);\n const cls = `${this.blockContClass}s ${ppfx}one-bg ${ppfx}two-color`;\n this.$el.addClass(cls);\n this.rendered = true;\n return this;\n }\n}\n","/**\n * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/GrapesJS/grapesjs/blob/master/src/block_manager/config/config.ts)\n * ```js\n * const editor = grapesjs.init({\n * blockManager: {\n * // options\n * }\n * })\n * ```\n *\n * Once the editor is instantiated you can use its API and listen to its events. Before using these methods, you should get the module from the instance.\n *\n * ```js\n * // Listen to events\n * editor.on('block:add', (block) => { ... });\n *\n * // Use the API\n * const blockManager = editor.Blocks;\n * blockManager.add(...);\n * ```\n *\n * {REPLACE_EVENTS}\n *\n * [Block]: block.html\n * [Component]: component.html\n *\n * @module Blocks\n */\nimport { debounce, isArray } from 'underscore';\nimport { ItemManagerModule } from '../abstract/Module';\nimport FrameView from '../canvas/view/FrameView';\nimport Component from '../dom_components/model/Component';\nimport EditorModel from '../editor/model/Editor';\nimport defaults, { BlockManagerConfig } from './config/config';\nimport Block, { BlockProperties } from './model/Block';\nimport Blocks from './model/Blocks';\nimport Categories from '../abstract/ModuleCategories';\nimport Category, { getItemsByCategory } from '../abstract/ModuleCategory';\nimport { BlocksByCategory, BlocksEvents } from './types';\nimport BlocksView from './view/BlocksView';\n\nexport type BlockEvent = `${BlocksEvents}`;\n\nexport default class BlockManager extends ItemManagerModule {\n blocks: Blocks;\n blocksVisible: Blocks;\n categories: Categories;\n blocksView?: BlocksView;\n _dragBlock?: Block;\n _bhv?: Record;\n events = BlocksEvents;\n\n Block = Block;\n\n Blocks = Blocks;\n\n Category = Category;\n\n Categories = Categories;\n\n storageKey = '';\n\n constructor(em: EditorModel) {\n super(em, 'BlockManager', new Blocks(em.config.blockManager?.blocks || [], { em }), BlocksEvents, defaults);\n\n // Global blocks collection\n this.blocks = this.all;\n this.blocksVisible = new Blocks(this.blocks.models, { em });\n this.categories = new Categories([], {\n em,\n events: { update: BlocksEvents.categoryUpdate },\n });\n\n // Setup the sync between the global and public collections\n this.blocks.on('add', model => this.blocksVisible.add(model));\n this.blocks.on('remove', model => this.blocksVisible.remove(model));\n this.blocks.on('reset', coll => this.blocksVisible.reset(coll.models));\n\n this.__onAllEvent = debounce(() => this.__trgCustom(), 0);\n\n return this;\n }\n\n /**\n * Get configuration object\n * @name getConfig\n * @function\n * @return {Object}\n */\n\n __trgCustom() {\n this.em.trigger(this.events.custom, this.__customData());\n }\n\n __customData() {\n const bhv = this.__getBehaviour();\n return {\n bm: this as BlockManager,\n blocks: this.getAll().models,\n container: bhv.container,\n dragStart: (block: Block, ev?: Event) => this.startDrag(block, ev),\n drag: (ev: Event) => this.__drag(ev),\n dragStop: (cancel?: boolean) => this.endDrag(cancel),\n };\n }\n\n __startDrag(block: Block, ev?: Event) {\n const { em, events, blocks } = this;\n const content = block.getContent ? block.getContent() : block;\n this._dragBlock = block;\n em.set({ dragResult: null, dragContent: content });\n [em, blocks].map(i => i.trigger(events.dragStart, block, ev));\n }\n\n __drag(ev: Event) {\n const { em, events, blocks } = this;\n const block = this._dragBlock;\n [em, blocks].map(i => i.trigger(events.drag, block, ev));\n }\n\n __endDrag(opts: { component?: Component } = {}) {\n const { em, events, blocks } = this;\n const block = this._dragBlock;\n const cmp = opts.component || em.get('dragResult');\n delete this._dragBlock;\n\n if (cmp && block) {\n const oldKey = 'activeOnRender';\n const oldActive = cmp.get && cmp.get(oldKey);\n const toActive = block.get('activate') || oldActive;\n const toSelect = block.get('select');\n const first = isArray(cmp) ? cmp[0] : cmp;\n\n if (toSelect || (toActive && toSelect !== false)) {\n em.setSelected(first);\n }\n\n if (toActive) {\n first.trigger('active');\n oldActive && first.unset(oldKey);\n }\n\n if (block.get('resetId')) {\n first.onAll((cmp: any) => cmp.resetId());\n }\n }\n\n em.set({ dragResult: null, dragContent: null });\n\n if (block) {\n [em, blocks].map(i => i.trigger(events.dragEnd, cmp, block));\n }\n }\n\n __getFrameViews(): FrameView[] {\n return this.em.Canvas.getFrames()\n .map(frame => frame.view!)\n .filter(Boolean);\n }\n\n __behaviour(opts = {}) {\n return (this._bhv = {\n ...(this._bhv || {}),\n ...opts,\n });\n }\n\n __getBehaviour() {\n return this._bhv || {};\n }\n\n startDrag(block: Block, ev?: Event) {\n this.__startDrag(block, ev);\n this.__getFrameViews().forEach(fv => fv.droppable?.startCustom());\n }\n\n endDrag(cancel?: boolean) {\n this.__getFrameViews().forEach(fv => fv.droppable?.endCustom(cancel));\n this.__endDrag();\n }\n\n postRender() {\n const { categories, config, em } = this;\n const collection = this.blocksVisible;\n this.blocksView = new BlocksView({ collection, categories }, { ...config, em });\n this.__appendTo(collection.models);\n this.__trgCustom();\n }\n\n /**\n * Add new block.\n * @param {String} id Block ID\n * @param {[Block]} props Block properties\n * @returns {[Block]} Added block\n * @example\n * blockManager.add('h1-block', {\n * label: 'Heading',\n * content: '

Put your title here

',\n * category: 'Basic',\n * attributes: {\n * title: 'Insert h1 block'\n * }\n * });\n */\n add(id: string, props: BlockProperties, opts = {}) {\n const prp = props || {};\n prp.id = id;\n return this.blocks.add(prp, opts);\n }\n\n /**\n * Get the block by id.\n * @param {String} id Block id\n * @returns {[Block]}\n * @example\n * const block = blockManager.get('h1-block');\n * console.log(JSON.stringify(block));\n * // {label: 'Heading', content: '

Put your ...', ...}\n */\n get(id: string) {\n return this.blocks.get(id);\n }\n\n /**\n * Return all blocks.\n * @returns {Collection<[Block]>}\n * @example\n * const blocks = blockManager.getAll();\n * console.log(JSON.stringify(blocks));\n * // [{label: 'Heading', content: '

Put your ...'}, ...]\n */\n getAll() {\n return this.blocks;\n }\n\n /**\n * Return the visible collection, which containes blocks actually rendered\n * @returns {Collection<[Block]>}\n */\n getAllVisible() {\n return this.blocksVisible;\n }\n\n /**\n * Remove block.\n * @param {String|[Block]} block Block or block ID\n * @returns {[Block]} Removed block\n * @example\n * const removed = blockManager.remove('BLOCK_ID');\n * // or by passing the Block\n * const block = blockManager.get('BLOCK_ID');\n * blockManager.remove(block);\n */\n remove(block: string | Block, opts = {}) {\n return this.__remove(block, opts);\n }\n\n /**\n * Get all available categories.\n * It's possible to add categories only within blocks via 'add()' method\n * @return {Array|Collection}\n */\n getCategories() {\n return this.categories;\n }\n\n /**\n * Return the Blocks container element\n * @return {HTMLElement}\n */\n getContainer() {\n return this.blocksView?.el;\n }\n\n /**\n * Returns currently dragging block.\n * Updated when the drag starts and cleared once it's done.\n * @returns {[Block]|undefined}\n */\n getDragBlock() {\n return this._dragBlock;\n }\n\n /**\n * Get blocks by category.\n * @example\n * blockManager.getBlocksByCategory();\n * // Returns an array of items of this type\n * // > { category?: Category; items: Block[] }\n *\n * // NOTE: The item without category is the one containing blocks without category.\n *\n * // You can also get the same output format by passing your own array of Blocks\n * const myFilteredBlocks: Block[] = [...];\n * blockManager.getBlocksByCategorymyFilteredBlocks\n */\n getBlocksByCategory(blocks?: Block[]): BlocksByCategory[] {\n return getItemsByCategory(blocks || this.getAll().models);\n }\n\n /**\n * Render blocks\n * @param {Array} blocks Blocks to render, without the argument will render all global blocks\n * @param {Object} [opts={}] Options\n * @param {Boolean} [opts.external] Render blocks in a new container (HTMLElement will be returned)\n * @param {Boolean} [opts.ignoreCategories] Render blocks without categories\n * @return {HTMLElement} Rendered element\n * @example\n * // Render all blocks (inside the global collection)\n * blockManager.render();\n *\n * // Render new set of blocks\n * const blocks = blockManager.getAll();\n * const filtered = blocks.filter(block => block.get('category') == 'sections')\n *\n * blockManager.render(filtered);\n * // Or a new set from an array\n * blockManager.render([\n * {label: 'Label text', content: '
Content
'}\n * ]);\n *\n * // Back to blocks from the global collection\n * blockManager.render();\n *\n * // You can also render your blocks outside of the main block container\n * const newBlocksEl = blockManager.render(filtered, { external: true });\n * document.getElementById('some-id').appendChild(newBlocksEl);\n */\n render(blocks?: Block[], opts: { external?: boolean } = {}) {\n const { categories, config, em } = this;\n const toRender = blocks || this.getAll().models;\n\n if (opts.external) {\n const collection = new Blocks(toRender, { em });\n return new BlocksView({ collection, categories }, { em, ...config, ...opts }).render().el;\n }\n\n if (this.blocksView) {\n this.blocksView.updateConfig(opts);\n this.blocksView.collection.reset(toRender);\n\n if (!this.blocksView.rendered) {\n this.blocksView.render();\n this.blocksView.rendered = true;\n }\n }\n\n return this.getContainer();\n }\n\n destroy() {\n const colls = [this.blocks, this.blocksVisible, this.categories];\n colls.map(c => c.stopListening());\n colls.map(c => c.reset());\n this.blocksView?.remove();\n }\n}\n","export interface SelectorManagerConfig {\n /**\n * Style prefix.\n * @default 'clm-'\n */\n stylePrefix?: string;\n\n /**\n * Specify the element to use as a container, string (query) or HTMLElement.\n * With the empty value, nothing will be rendered.\n * @default ''\n */\n appendTo?: string | HTMLElement;\n\n /**\n * Default selectors.\n * @default []\n */\n selectors?: any[];\n\n /**\n * Default states.\n * @default [{ name: 'hover' }, { name: 'active' }, { name: 'nth-of-type(2n)' }]\n */\n states?: any[];\n\n /**\n * Custom selector name escaping strategy.\n * @example\n * escapeName: name => name.replace(' ', '_'),\n */\n escapeName?: (name: string) => string;\n\n /**\n * Custom selected name strategy (the string you see after 'Selected').\n * @example\n * selectedName: ({ result, state, target }) => `${result} - ID: ${target.getId()}`,\n */\n selectedName?: (props: { result: string; state: any; target: any }) => string;\n\n /**\n * Icon used to add new selector\n */\n iconAdd?: string;\n\n /**\n * Icon used to sync styles.\n */\n iconSync?: string;\n\n /**\n * Icon to show when the selector is enabled.\n */\n iconTagOn?: string;\n\n /**\n * Icon to show when the selector is disabled.\n */\n iconTagOff?: string;\n\n /**\n * Icon used to remove the selector.\n */\n iconTagRemove?: string;\n\n /**\n * Custom render function for the Selector Manager.\n * @example\n * render: ({ el, labelHead, labelStates, labelInfo, }) => {\n * // You can use the default `el` to extend/edit the current\n * // DOM element of the Selector Manager\n * const someEl = document.createElement('div');\n * // ...\n * el.appendChild(someEl);\n * // no need to return anything from the function\n *\n * // Create and return a new DOM element\n * const newEl = document.createElement('div');\n * // ...\n * return newEl;\n *\n * // Return an HTML string for a completely different layout.\n * // Use `data-*` attributes to make the module recognize some elements:\n * // `data-states` - Where to append state `