@codernote/record-tree 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +855 -864
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.node-div[data-v-3885c8f8]{display:flex;align-items:center;position:relative}.node-text[data-v-3885c8f8]{margin-left:5px;flex:1;border:none;outline:none}.node-icon[data-v-3885c8f8]{position:relative;width:17px;height:17px;border-radius:10px;background-color:#fff;cursor:pointer;margin-left:5px;align-self:center;top:0}.node-icon-complex[data-v-3885c8f8]{align-self:flex-start;top:3px}.node-icon[data-v-3885c8f8]:after{content:"";position:absolute;top:5px;left:5px;width:7px;height:7px;border-radius:10px;background-color:#eee}.node-icon[data-v-3885c8f8]:hover{background-color:#ccc}.node-complex[data-v-3885c8f8]{display:flex;flex-direction:row;align-self:center;justify-self:center;outline:none}.holder[data-v-3885c8f8]{width:0px;overflow:hidden;border-width:1px;border-style:solid;border-color:transparent;outline:none}.node-element[data-v-3885c8f8]{display:inline-block;position:relative;margin:5px 1px}.node-element:hover .node-del[data-v-3885c8f8]{display:block}.node-image img[data-v-3885c8f8]{outline:none}.node-audio[data-v-3885c8f8]{width:300px}.node-audio audio[data-v-3885c8f8]{width:300px;outline:none}.node-video video[data-v-3885c8f8]{outline:none}.node-del[data-v-3885c8f8]{cursor:pointer;display:none;width:15px;height:15px;position:absolute;top:-3px;right:-3px;background-color:#e6f7ff;background-size:100% 100%;border-radius:50%}.node-del[data-v-3885c8f8]:before,.node-del[data-v-3885c8f8]:after{content:"";position:absolute;top:50%;left:50%;width:2px;height:10px;background-color:#595959}.node-del[data-v-3885c8f8]:before{transform:translate(-50%,-50%) rotate(45deg)}.node-del[data-v-3885c8f8]:after{transform:translate(-50%,-50%) rotate(-45deg)}.node-file-wrap[data-v-3885c8f8]{width:260px;padding:10px 16px;display:flex;background:#f2f2f2;border-radius:5px;justify-content:center;align-items:center}.node-file-left[data-v-3885c8f8]{flex:1}.node-file-left h6[data-v-3885c8f8]{font-size:14px;font-weight:700;margin:0 0 5px;padding:0;white-space:nowrap}.node-file-left p[data-v-3885c8f8]{margin:0;padding:0;font-size:12px;color:#999}.node-file-right a[data-v-3885c8f8]{color:#52a770;font-size:14px}@keyframes blinkBorder-3885c8f8{0%,to{border-color:transparent}50%{border-color:#333}}.node-complex .holder[data-v-3885c8f8]:focus{animation:blinkBorder-3885c8f8 1s infinite}.resize-handle[data-v-3885c8f8]{width:15px;height:15px;position:absolute;bottom:0;right:0;cursor:se-resize;transform:rotate(90deg);background:rgba(255,255,255,.6)}.node-ul[data-v-324f9145]{background-color:#fff;margin:0;padding:0;list-style:none}.node-li[data-v-324f9145]{padding:0;list-style:none;margin:0;line-height:1.5;position:relative;overflow:hidden}[data-v-324f9145] .sublevel .node-li{margin-left:15px}[data-v-324f9145] .drag-over-top:before{content:"";width:100%;height:1px;top:0;background-color:#eee;position:absolute}[data-v-324f9145] .drag-over-center{background-color:#eee}[data-v-324f9145] .drag-over-bottom:after{content:"";width:100%;height:1px;background-color:#eee;position:absolute;bottom:0}.collapsed>ul[data-v-324f9145]{display:none}[data-v-324f9145] .collapsed .node-icon:before{display:none}.tree-title[data-v-324f9145]{padding-left:25px;font-weight:700;outline:none;font-size:1.125rem;line-height:1.5;width:100%}[data-v-324f9145] .node-li.has-child.collapsed .node-icon:after{background-color:#aaa}[data-v-324f9145] .node-li.dragging .node-icon:before{display:none}[data-v-324f9145] .has-child>.node-div>.node-icon:before{content:"";position:absolute;top:20px;left:50%;height:9999px;width:1px;background-color:#f2f2f2}[data-v-324f9145] .has-child>.node-div>.node-icon:hover:before{background-color:#52a770}.popper{width:auto;background-color:#fafafa;color:#212121;text-align:center;padding:2px;display:inline-block;border-radius:3px;position:absolute;font-size:14px;font-weight:400;border:1px #ebebeb solid;z-index:200000;box-shadow:#3a3a3a 0 0 6px}.popper .popper__arrow{width:0;height:0;border-style:solid;position:absolute;margin:5px}.popper[x-placement^=top]{margin-bottom:5px}.popper[x-placement^=top] .popper__arrow{border-width:5px 5px 0 5px;border-color:#fafafa transparent transparent transparent;bottom:-5px;left:calc(50% - 5px);margin-top:0;margin-bottom:0}.popper[x-placement^=bottom]{margin-top:5px}.popper[x-placement^=bottom] .popper__arrow{border-width:0 5px 5px 5px;border-color:transparent transparent #fafafa transparent;top:-5px;left:calc(50% - 5px);margin-top:0;margin-bottom:0}.popper[x-placement^=right]{margin-left:5px}.popper[x-placement^=right] .popper__arrow{border-width:5px 5px 5px 0;border-color:transparent #fafafa transparent transparent;left:-5px;top:calc(50% - 5px);margin-left:0;margin-right:0}.popper[x-placement^=left]{margin-right:5px}.popper[x-placement^=left] .popper__arrow{border-width:5px 0 5px 5px;border-color:transparent transparent transparent #fafafa;right:-5px;top:calc(50% - 5px);margin-left:0;margin-right:0}[data-v-7f00d874] .popper{transform:translate3d(0,22px,0)!important}.record-tree-popper-content{display:flex;flex-wrap:wrap;padding:10px;box-shadow:0 2px 12px #1d1c1c1f;border:1px solid rgba(29,28,28,.12);border-radius:5px;overflow:hidden;background:#fff;z-index:9999}.record-tree-popper-content-item{padding:8px 10px;display:flex;align-items:center;justify-content:center;cursor:pointer}.record-tree-svg{display:inline-block;border-radius:9999px;color:#fff;cursor:pointer}.record-tree-title-bar{position:relative;display:flex;margin-bottom:3px}.record-tree-title{padding-left:25px;font-weight:700;outline:none;font-size:18px;line-height:1.5;width:100%}.record-tree-popper-reference{display:flex;position:absolute;top:0px;left:0px;text-align:center;border-radius:9999px;color:#fff}.record-tree-empty-icon{display:inline-block;border-radius:9999px}.record-tree-placeholder{position:absolute;left:0;top:0;padding-left:25px;font-weight:700;outline:none;font-size:18px;line-height:1.5;width:100%;color:#999;pointer-events:none}.record-audio[data-v-c081bad5]{position:absolute;background:#fff;padding:20px;width:400px;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:10px;z-index:999;box-shadow:0 4px 6px #0000001a,0 1px 3px #00000014}.record-audio .recwave[data-v-c081bad5]{width:300px;height:40px}.record-audio .audio-item[data-v-c081bad5]{margin-top:10px;display:flex;align-items:center}.record-audio .audio-item a[data-v-c081bad5]{color:#52a770;margin-left:10px;font-size:12px;cursor:pointer}.record-audio .audio-text[data-v-c081bad5]{background:#f5f5f5;margin-top:10px;padding:8px 12px;border-radius:5px}.record-audio .buttons[data-v-c081bad5]{margin-top:10px;display:flex;align-items:center}.record-audio .buttons .btn[data-v-c081bad5]{margin-right:10px;font-size:14px;width:80px;padding:6px 0;text-align:center;cursor:pointer;border-radius:20px}.record-audio .buttons .finish[data-v-c081bad5]{color:#fff;background:#1677ff;border:1px solid #1677ff}.record-audio .buttons .disabled[data-v-c081bad5]{background:#eee;cursor:default;border-color:#eee}.record-audio .buttons .cancel[data-v-c081bad5]{border:1px solid #eee}.record-audio .buttons .oper[data-v-c081bad5]{margin-right:10px}.record-audio .main[data-v-c081bad5]{display:flex;align-items:center}.record-audio .duration[data-v-c081bad5]{width:60px;margin-left:10px;color:#999;font-size:12px}.wrap[data-v-c081bad5]{position:fixed;left:0;top:0;bottom:0;z-index:9999}.mask[data-v-c081bad5]{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(255,255,255,.8)}.record-audio-mobile[data-v-c081bad5]{display:flex;width:100vw;position:absolute;background:#fff;padding:20px;left:50%;top:50%;transform:translate(-50%,-50%);z-index:999;align-items:center}.record-audio-mobile .recwave[data-v-c081bad5]{flex:1;height:30px}.record-audio-mobile .oper[data-v-c081bad5]{margin-right:10px}.record-video[data-v-1d5cd230]{position:absolute;background:#fff;padding:20px;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:10px;z-index:999;box-shadow:0 4px 6px #0000001a,0 1px 3px #00000014}.video-item[data-v-1d5cd230]{width:300px}.buttons[data-v-1d5cd230]{margin-top:10px;display:flex;align-items:center}.buttons .btn[data-v-1d5cd230]{margin-right:10px;font-size:14px;width:80px;padding:6px 0;text-align:center;cursor:pointer;border-radius:20px}.buttons .finish[data-v-1d5cd230]{color:#fff;background:#1677ff;border:1px solid #1677ff}.buttons .disabled[data-v-1d5cd230]{background:#eee;cursor:default;border-color:#eee}.buttons .cancel[data-v-1d5cd230]{border:1px solid #eee}.buttons .oper[data-v-1d5cd230]{margin-right:10px}.wrap[data-v-1d5cd230]{position:fixed;left:0;top:0;bottom:0;z-index:9999}.mask[data-v-1d5cd230]{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(255,255,255,.8)}.record-video[data-v-cb048d52]{position:absolute;background:#fff;padding:20px;left:50%;top:50%;width:452px;transform:translate(-50%,-50%);border-radius:10px;z-index:999;box-shadow:0 4px 6px #0000001a,0 1px 3px #00000014}.video-item[data-v-cb048d52]{width:200px}.img-item[data-v-cb048d52]{width:200px;height:150px;border:1px dashed #eee;margin-left:10px}.img-item img[data-v-cb048d52]{width:200px}.record-content[data-v-cb048d52]{display:flex}.buttons[data-v-cb048d52]{margin-top:10px;display:flex;align-items:center}.buttons .btn[data-v-cb048d52]{margin-right:10px;font-size:14px;width:80px;padding:6px 0;text-align:center;cursor:pointer;border-radius:20px}.buttons .finish[data-v-cb048d52]{color:#fff;background:#1677ff;border:1px solid #1677ff}.buttons .disabled[data-v-cb048d52]{background:#eee;cursor:default;border-color:#eee}.buttons .cancel[data-v-cb048d52]{border:1px solid #eee}.buttons .oper[data-v-cb048d52]{margin-right:10px}.wrap[data-v-cb048d52]{position:fixed;left:0;top:0;bottom:0;z-index:9999}.mask[data-v-cb048d52]{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(255,255,255,.8)}.record-tree-mobile .record-tree{height:calc(100vh - 45px);overflow-y:scroll}.record-tree-mobile .record-tree-main{padding-left:0}.record-tree-mobile .record-tree-options{padding:12px 0;display:flex;position:fixed}.record-tree-mobile .record-tree-option-item{flex:1;max-width:32px}.record-tree-mobile .node-file-wrap{width:200px}.record-tree-mobile .node-file-right{display:none}.record-tree-mobile .node-image img{width:auto;max-height:80px}.record-tree-mobile .node-audio,.record-tree-mobile .node-video{width:200px}.record-tree-mobile .node-audio audio{width:200px;outline:none}.record-tree-mobile .node-video video{width:200px;outline:none}.record-tree-container{position:relative;height:100%}.record-tree-main{padding-left:15px;overflow:scroll;flex:1}.record-tree{position:relative;padding-bottom:40px;display:flex;flex-direction:column;overflow:hidden;height:100%}.record-tree-options{position:absolute;bottom:0px;left:0px;width:100%;display:flex;justify-content:space-between;padding:5px 0;background:#fff;border-top:1px dotted #ddd}.record-tree-option-left{display:flex;flex:1;padding-left:10px}.record-tree-option-right{padding-right:10px;font-size:14px}.record-tree-option-item{margin:0 5px;cursor:pointer;display:flex;justify-content:center;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
import { uuid as Ct, detectDeviceType as Ra, byNameFindIcon as
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.node-div[data-v-3a3c7323]{display:flex;align-items:center;position:relative}.node-text[data-v-3a3c7323]{margin-left:5px;flex:1;border:none;outline:none}.node-icon[data-v-3a3c7323]{position:relative;width:17px;height:17px;border-radius:10px;background-color:#fff;cursor:pointer;margin-left:5px;align-self:center;top:0}.node-icon-complex[data-v-3a3c7323]{align-self:flex-start;top:3px}.node-icon[data-v-3a3c7323]:after{content:"";position:absolute;top:5px;left:5px;width:7px;height:7px;border-radius:10px;background-color:#eee}.node-icon[data-v-3a3c7323]:hover{background-color:#ccc}.node-complex[data-v-3a3c7323]{display:flex;flex-direction:row;align-self:center;justify-self:center;outline:none}.holder[data-v-3a3c7323]{width:0px;overflow:hidden;border-width:1px;border-style:solid;border-color:transparent;outline:none}.node-element[data-v-3a3c7323]{display:inline-block;position:relative;margin:5px 1px}.node-element:hover .node-del[data-v-3a3c7323]{display:block}.node-image img[data-v-3a3c7323]{outline:none}.node-audio[data-v-3a3c7323]{width:300px}.node-audio audio[data-v-3a3c7323]{width:300px;outline:none}.node-video video[data-v-3a3c7323]{outline:none}.node-del[data-v-3a3c7323]{cursor:pointer;display:none;width:15px;height:15px;position:absolute;top:-3px;right:-3px;background-color:#e6f7ff;background-size:100% 100%;border-radius:50%}.node-del[data-v-3a3c7323]:before,.node-del[data-v-3a3c7323]:after{content:"";position:absolute;top:50%;left:50%;width:2px;height:10px;background-color:#595959}.node-del[data-v-3a3c7323]:before{transform:translate(-50%,-50%) rotate(45deg)}.node-del[data-v-3a3c7323]:after{transform:translate(-50%,-50%) rotate(-45deg)}.node-file-wrap[data-v-3a3c7323]{width:260px;padding:10px 16px;display:flex;background:#f2f2f2;border-radius:5px;justify-content:center;align-items:center}.node-file-left[data-v-3a3c7323]{flex:1}.node-file-left h6[data-v-3a3c7323]{font-size:14px;font-weight:700;margin:0 0 5px;padding:0;white-space:nowrap}.node-file-left p[data-v-3a3c7323]{margin:0;padding:0;font-size:12px;color:#999}.node-file-right a[data-v-3a3c7323]{color:#52a770;font-size:14px}@keyframes blinkBorder-3a3c7323{0%,to{border-color:transparent}50%{border-color:#333}}.node-complex .holder[data-v-3a3c7323]:focus{animation:blinkBorder-3a3c7323 1s infinite}.resize-handle[data-v-3a3c7323]{width:15px;height:15px;position:absolute;bottom:0;right:0;cursor:se-resize;transform:rotate(90deg);background:rgba(255,255,255,.6)}.node-ul[data-v-324f9145]{background-color:#fff;margin:0;padding:0;list-style:none}.node-li[data-v-324f9145]{padding:0;list-style:none;margin:0;line-height:1.5;position:relative;overflow:hidden}[data-v-324f9145] .sublevel .node-li{margin-left:15px}[data-v-324f9145] .drag-over-top:before{content:"";width:100%;height:1px;top:0;background-color:#eee;position:absolute}[data-v-324f9145] .drag-over-center{background-color:#eee}[data-v-324f9145] .drag-over-bottom:after{content:"";width:100%;height:1px;background-color:#eee;position:absolute;bottom:0}.collapsed>ul[data-v-324f9145]{display:none}[data-v-324f9145] .collapsed .node-icon:before{display:none}.tree-title[data-v-324f9145]{padding-left:25px;font-weight:700;outline:none;font-size:1.125rem;line-height:1.5;width:100%}[data-v-324f9145] .node-li.has-child.collapsed .node-icon:after{background-color:#aaa}[data-v-324f9145] .node-li.dragging .node-icon:before{display:none}[data-v-324f9145] .has-child>.node-div>.node-icon:before{content:"";position:absolute;top:20px;left:50%;height:9999px;width:1px;background-color:#f2f2f2}[data-v-324f9145] .has-child>.node-div>.node-icon:hover:before{background-color:#52a770}.popper{width:auto;background-color:#fafafa;color:#212121;text-align:center;padding:2px;display:inline-block;border-radius:3px;position:absolute;font-size:14px;font-weight:400;border:1px #ebebeb solid;z-index:200000;box-shadow:#3a3a3a 0 0 6px}.popper .popper__arrow{width:0;height:0;border-style:solid;position:absolute;margin:5px}.popper[x-placement^=top]{margin-bottom:5px}.popper[x-placement^=top] .popper__arrow{border-width:5px 5px 0 5px;border-color:#fafafa transparent transparent transparent;bottom:-5px;left:calc(50% - 5px);margin-top:0;margin-bottom:0}.popper[x-placement^=bottom]{margin-top:5px}.popper[x-placement^=bottom] .popper__arrow{border-width:0 5px 5px 5px;border-color:transparent transparent #fafafa transparent;top:-5px;left:calc(50% - 5px);margin-top:0;margin-bottom:0}.popper[x-placement^=right]{margin-left:5px}.popper[x-placement^=right] .popper__arrow{border-width:5px 5px 5px 0;border-color:transparent #fafafa transparent transparent;left:-5px;top:calc(50% - 5px);margin-left:0;margin-right:0}.popper[x-placement^=left]{margin-right:5px}.popper[x-placement^=left] .popper__arrow{border-width:5px 0 5px 5px;border-color:transparent transparent transparent #fafafa;right:-5px;top:calc(50% - 5px);margin-left:0;margin-right:0}[data-v-7f00d874] .popper{transform:translate3d(0,22px,0)!important}.record-tree-popper-content{display:flex;flex-wrap:wrap;padding:10px;box-shadow:0 2px 12px #1d1c1c1f;border:1px solid rgba(29,28,28,.12);border-radius:5px;overflow:hidden;background:#fff;z-index:9999}.record-tree-popper-content-item{padding:8px 10px;display:flex;align-items:center;justify-content:center;cursor:pointer}.record-tree-svg{display:inline-block;border-radius:9999px;color:#fff;cursor:pointer}.record-tree-title-bar{position:relative;display:flex;margin-bottom:3px}.record-tree-title{padding-left:25px;font-weight:700;outline:none;font-size:18px;line-height:1.5;width:100%}.record-tree-popper-reference{display:flex;position:absolute;top:0px;left:0px;text-align:center;border-radius:9999px;color:#fff}.record-tree-empty-icon{display:inline-block;border-radius:9999px}.record-tree-placeholder{position:absolute;left:0;top:0;padding-left:25px;font-weight:700;outline:none;font-size:18px;line-height:1.5;width:100%;color:#999;pointer-events:none}.record-audio[data-v-c081bad5]{position:absolute;background:#fff;padding:20px;width:400px;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:10px;z-index:999;box-shadow:0 4px 6px #0000001a,0 1px 3px #00000014}.record-audio .recwave[data-v-c081bad5]{width:300px;height:40px}.record-audio .audio-item[data-v-c081bad5]{margin-top:10px;display:flex;align-items:center}.record-audio .audio-item a[data-v-c081bad5]{color:#52a770;margin-left:10px;font-size:12px;cursor:pointer}.record-audio .audio-text[data-v-c081bad5]{background:#f5f5f5;margin-top:10px;padding:8px 12px;border-radius:5px}.record-audio .buttons[data-v-c081bad5]{margin-top:10px;display:flex;align-items:center}.record-audio .buttons .btn[data-v-c081bad5]{margin-right:10px;font-size:14px;width:80px;padding:6px 0;text-align:center;cursor:pointer;border-radius:20px}.record-audio .buttons .finish[data-v-c081bad5]{color:#fff;background:#1677ff;border:1px solid #1677ff}.record-audio .buttons .disabled[data-v-c081bad5]{background:#eee;cursor:default;border-color:#eee}.record-audio .buttons .cancel[data-v-c081bad5]{border:1px solid #eee}.record-audio .buttons .oper[data-v-c081bad5]{margin-right:10px}.record-audio .main[data-v-c081bad5]{display:flex;align-items:center}.record-audio .duration[data-v-c081bad5]{width:60px;margin-left:10px;color:#999;font-size:12px}.wrap[data-v-c081bad5]{position:fixed;left:0;top:0;bottom:0;z-index:9999}.mask[data-v-c081bad5]{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(255,255,255,.8)}.record-audio-mobile[data-v-c081bad5]{display:flex;width:100vw;position:absolute;background:#fff;padding:20px;left:50%;top:50%;transform:translate(-50%,-50%);z-index:999;align-items:center}.record-audio-mobile .recwave[data-v-c081bad5]{flex:1;height:30px}.record-audio-mobile .oper[data-v-c081bad5]{margin-right:10px}.record-video[data-v-1d5cd230]{position:absolute;background:#fff;padding:20px;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:10px;z-index:999;box-shadow:0 4px 6px #0000001a,0 1px 3px #00000014}.video-item[data-v-1d5cd230]{width:300px}.buttons[data-v-1d5cd230]{margin-top:10px;display:flex;align-items:center}.buttons .btn[data-v-1d5cd230]{margin-right:10px;font-size:14px;width:80px;padding:6px 0;text-align:center;cursor:pointer;border-radius:20px}.buttons .finish[data-v-1d5cd230]{color:#fff;background:#1677ff;border:1px solid #1677ff}.buttons .disabled[data-v-1d5cd230]{background:#eee;cursor:default;border-color:#eee}.buttons .cancel[data-v-1d5cd230]{border:1px solid #eee}.buttons .oper[data-v-1d5cd230]{margin-right:10px}.wrap[data-v-1d5cd230]{position:fixed;left:0;top:0;bottom:0;z-index:9999}.mask[data-v-1d5cd230]{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(255,255,255,.8)}.record-video[data-v-cb048d52]{position:absolute;background:#fff;padding:20px;left:50%;top:50%;width:452px;transform:translate(-50%,-50%);border-radius:10px;z-index:999;box-shadow:0 4px 6px #0000001a,0 1px 3px #00000014}.video-item[data-v-cb048d52]{width:200px}.img-item[data-v-cb048d52]{width:200px;height:150px;border:1px dashed #eee;margin-left:10px}.img-item img[data-v-cb048d52]{width:200px}.record-content[data-v-cb048d52]{display:flex}.buttons[data-v-cb048d52]{margin-top:10px;display:flex;align-items:center}.buttons .btn[data-v-cb048d52]{margin-right:10px;font-size:14px;width:80px;padding:6px 0;text-align:center;cursor:pointer;border-radius:20px}.buttons .finish[data-v-cb048d52]{color:#fff;background:#1677ff;border:1px solid #1677ff}.buttons .disabled[data-v-cb048d52]{background:#eee;cursor:default;border-color:#eee}.buttons .cancel[data-v-cb048d52]{border:1px solid #eee}.buttons .oper[data-v-cb048d52]{margin-right:10px}.wrap[data-v-cb048d52]{position:fixed;left:0;top:0;bottom:0;z-index:9999}.mask[data-v-cb048d52]{position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(255,255,255,.8)}.record-tree-mobile .record-tree{height:calc(100vh - 45px);overflow-y:scroll}.record-tree-mobile .record-tree-main{padding-left:0}.record-tree-mobile .record-tree-options{padding:12px 0;display:flex;position:fixed}.record-tree-mobile .record-tree-option-item{flex:1;max-width:32px}.record-tree-mobile .node-file-wrap{width:200px}.record-tree-mobile .node-file-right{display:none}.record-tree-mobile .node-image img{width:auto;max-height:80px}.record-tree-mobile .node-audio,.record-tree-mobile .node-video{width:200px}.record-tree-mobile .node-audio audio{width:200px;outline:none}.record-tree-mobile .node-video video{width:200px;outline:none}.record-tree-container{position:relative;height:100%}.record-tree-main{padding-left:15px;overflow:scroll;flex:1}.record-tree{position:relative;padding-bottom:40px;display:flex;flex-direction:column;overflow:hidden;height:100%}.record-tree-options{position:absolute;bottom:0px;left:0px;width:100%;display:flex;justify-content:space-between;padding:5px 0;background:#fff;border-top:1px dotted #ddd}.record-tree-option-left{display:flex;flex:1;padding-left:10px}.record-tree-option-right{padding-right:10px;font-size:14px}.record-tree-option-item{margin:0 5px;cursor:pointer;display:flex;justify-content:center;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
import { formatBytes as ja, truncateString as za, uuid as Ct, detectDeviceType as Ra, byNameFindIcon as Oa, icons as Fa, getImageSize as Ua, getVideoSize as Ha, resizeResource as Pa, parseMimeType as Ya, oss as Qa } from "@codernote/utils";
|
|
3
3
|
import Pt from "vue-inline-svg";
|
|
4
|
-
import
|
|
5
|
-
class
|
|
4
|
+
import Va from "vue-popperjs";
|
|
5
|
+
class Wa {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.events = {};
|
|
8
8
|
}
|
|
9
|
-
set(t,
|
|
10
|
-
this[t] =
|
|
9
|
+
set(t, f) {
|
|
10
|
+
this[t] = f;
|
|
11
11
|
}
|
|
12
12
|
get(t) {
|
|
13
13
|
return this[t];
|
|
@@ -15,119 +15,107 @@ class Qa {
|
|
|
15
15
|
remove(t) {
|
|
16
16
|
delete this[t];
|
|
17
17
|
}
|
|
18
|
-
on(t,
|
|
19
|
-
this.events[t] =
|
|
18
|
+
on(t, f) {
|
|
19
|
+
this.events[t] = f;
|
|
20
20
|
}
|
|
21
21
|
trigger(t) {
|
|
22
22
|
this.events[t] && (this.events[t](), delete this.events[t]);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
const At = new
|
|
25
|
+
const At = new Wa();
|
|
26
26
|
function kt() {
|
|
27
27
|
if (document.activeElement && document.activeElement.classList.contains("holder-right"))
|
|
28
28
|
return 1 / 0;
|
|
29
29
|
let s = window.getSelection();
|
|
30
30
|
return s.rangeCount > 0 && s.getRangeAt(0).startOffset || 0;
|
|
31
31
|
}
|
|
32
|
-
function Lt(s, t = 0,
|
|
32
|
+
function Lt(s, t = 0, f = !1) {
|
|
33
33
|
if (!s)
|
|
34
34
|
return;
|
|
35
35
|
const h = s.querySelectorAll(".holder");
|
|
36
36
|
if (h.length) {
|
|
37
|
-
(
|
|
37
|
+
(f || t > 0 ? h[1] : h[0]).focus();
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
if (!s.isContentEditable) {
|
|
41
41
|
console.error("Element is not contenteditable");
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
const U = window.getSelection(),
|
|
44
|
+
const U = window.getSelection(), R = document.createRange();
|
|
45
45
|
U.removeAllRanges();
|
|
46
46
|
try {
|
|
47
47
|
let Y = s;
|
|
48
|
-
if (s.childNodes.length > 0 ? Y = s.childNodes[0] : (
|
|
49
|
-
|
|
48
|
+
if (s.childNodes.length > 0 ? Y = s.childNodes[0] : (f || t > 0) && (Y = document.createTextNode(""), s.appendChild(Y)), f)
|
|
49
|
+
R.selectNodeContents(Y), R.collapse(!1);
|
|
50
50
|
else {
|
|
51
51
|
const K = Math.min(t, Y.length || 0);
|
|
52
|
-
|
|
52
|
+
R.setStart(Y, K), R.collapse(!0);
|
|
53
53
|
}
|
|
54
|
-
U.addRange(
|
|
54
|
+
U.addRange(R);
|
|
55
55
|
} catch (Y) {
|
|
56
56
|
console.error("Error setting focus position:", Y);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Ga(s) {
|
|
60
60
|
const t = window.getSelection();
|
|
61
61
|
t.removeAllRanges();
|
|
62
|
-
const
|
|
63
|
-
|
|
62
|
+
const f = document.createRange();
|
|
63
|
+
f.setStart(s.childNodes[0], 0), f.setEnd(s.childNodes[0], s.innerText.length), t.addRange(f);
|
|
64
64
|
}
|
|
65
65
|
function La(s) {
|
|
66
66
|
var Y;
|
|
67
|
-
let
|
|
68
|
-
return h < U ? "top" : h <
|
|
67
|
+
let f = (((Y = s.target) == null ? void 0 : Y.querySelector(".node-div")) || s.target).getBoundingClientRect(), h = s.clientY, U = f.top + f.height / 3, R = f.top + f.height / 3 * 2;
|
|
68
|
+
return h < U ? "top" : h < R ? "center" : "bottom";
|
|
69
69
|
}
|
|
70
70
|
function ca(s) {
|
|
71
71
|
return /<(img|audio|video)/.test(s.text) || s.type;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function $a(s) {
|
|
74
74
|
return s && s.uuid ? document.getElementById(s.uuid) : null;
|
|
75
75
|
}
|
|
76
76
|
function Nt(s, t = !1) {
|
|
77
|
-
const
|
|
77
|
+
const f = $a(s), h = ".node-text";
|
|
78
78
|
if (t) {
|
|
79
|
-
const U =
|
|
79
|
+
const U = f.querySelectorAll(h);
|
|
80
80
|
return U[U.length - 1];
|
|
81
81
|
}
|
|
82
|
-
return
|
|
82
|
+
return f == null ? void 0 : f.querySelector(h);
|
|
83
83
|
}
|
|
84
84
|
function da() {
|
|
85
85
|
["drag-over-top", "drag-over-center", "drag-over-bottom"].forEach((s) => {
|
|
86
86
|
document.querySelectorAll(`.${s}`).forEach((t) => t.classList.remove(s));
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function Za(s, t) {
|
|
90
90
|
var Y;
|
|
91
|
-
const
|
|
92
|
-
if (!
|
|
91
|
+
const f = s.currentTarget, h = At.get("dragId") ? document.getElementById(At.get("dragId")) : null;
|
|
92
|
+
if (!f || At.get("dragId") === t.uuid || h != null && h.querySelector(`[id="${t.uuid}"]`)) {
|
|
93
93
|
s.dataTransfer.dropEffect = "none";
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
da();
|
|
97
|
-
const U = La(s),
|
|
98
|
-
|
|
97
|
+
const U = La(s), R = (Y = f.querySelector(".node-div")) == null ? void 0 : Y.classList;
|
|
98
|
+
R && R.add(`drag-over-${U}`);
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
const
|
|
100
|
+
function qa(s) {
|
|
101
|
+
const f = new DOMParser().parseFromString(s, "text/html"), h = f.querySelector("img"), U = f.querySelector("video"), R = f.querySelector("audio");
|
|
102
102
|
return h ? {
|
|
103
103
|
type: "image",
|
|
104
104
|
content: h.src
|
|
105
105
|
} : U ? {
|
|
106
106
|
type: "video",
|
|
107
107
|
content: U.src
|
|
108
|
-
} :
|
|
108
|
+
} : R ? {
|
|
109
109
|
type: "audio",
|
|
110
|
-
content:
|
|
110
|
+
content: R.src
|
|
111
111
|
} : null;
|
|
112
112
|
}
|
|
113
113
|
function fa(s, t) {
|
|
114
|
-
var
|
|
115
|
-
return (
|
|
114
|
+
var f;
|
|
115
|
+
return (f = t.children) != null && f.length ? t.children.some(
|
|
116
116
|
(h) => h.uuid === s.uuid || fa(s, h)
|
|
117
117
|
) : !1;
|
|
118
118
|
}
|
|
119
|
-
function Za(s, t = 0) {
|
|
120
|
-
if (s === 0)
|
|
121
|
-
return "0 Bytes";
|
|
122
|
-
const c = 1024, h = t < 0 ? 0 : t, U = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], I = Math.floor(Math.log(s) / Math.log(c));
|
|
123
|
-
return parseFloat((s / Math.pow(c, I)).toFixed(h)) + " " + U[I];
|
|
124
|
-
}
|
|
125
|
-
function qa(s, t) {
|
|
126
|
-
if (s.length <= t)
|
|
127
|
-
return s;
|
|
128
|
-
const c = s.length - t + 3;
|
|
129
|
-
return "..." + s.substring(c);
|
|
130
|
-
}
|
|
131
119
|
function Xa(s) {
|
|
132
120
|
return (s || "").replace("contenteditable", "temp");
|
|
133
121
|
}
|
|
@@ -139,10 +127,10 @@ function Ea(s = !0) {
|
|
|
139
127
|
const t = document.querySelector(".record-tree-options");
|
|
140
128
|
if (!t)
|
|
141
129
|
return;
|
|
142
|
-
const
|
|
143
|
-
window.visualViewport.height <
|
|
130
|
+
const f = window.visualViewport.height, h = () => {
|
|
131
|
+
window.visualViewport.height < f && (t.style.display = "none", setTimeout(() => {
|
|
144
132
|
if (t.style.display = "", s) {
|
|
145
|
-
const
|
|
133
|
+
const R = At.get("currentId"), Y = Nt({ uuid: R });
|
|
146
134
|
Ka(Y) || Y.scrollIntoView({
|
|
147
135
|
behavior: "smooth",
|
|
148
136
|
block: "center"
|
|
@@ -167,9 +155,9 @@ const Ja = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPS
|
|
|
167
155
|
record: lr,
|
|
168
156
|
resize: ur
|
|
169
157
|
};
|
|
170
|
-
function jt(s, t,
|
|
158
|
+
function jt(s, t, f, h, U, R, Y, K) {
|
|
171
159
|
var ve = typeof s == "function" ? s.options : s;
|
|
172
|
-
t && (ve.render = t, ve.staticRenderFns =
|
|
160
|
+
t && (ve.render = t, ve.staticRenderFns = f, ve._compiled = !0), h && (ve.functional = !0), R && (ve._scopeId = "data-v-" + R);
|
|
173
161
|
var be;
|
|
174
162
|
if (Y ? (be = function(Ee) {
|
|
175
163
|
Ee = Ee || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !Ee && typeof __VUE_SSR_CONTEXT__ < "u" && (Ee = __VUE_SSR_CONTEXT__), U && U.call(this, Ee), Ee && Ee._registeredComponents && Ee._registeredComponents.add(Y);
|
|
@@ -227,8 +215,8 @@ const cr = {
|
|
|
227
215
|
}
|
|
228
216
|
},
|
|
229
217
|
methods: {
|
|
230
|
-
formatBytes:
|
|
231
|
-
truncateString:
|
|
218
|
+
formatBytes: ja,
|
|
219
|
+
truncateString: za,
|
|
232
220
|
formatReadOnly: Xa,
|
|
233
221
|
handleFocus() {
|
|
234
222
|
const s = this.node;
|
|
@@ -237,18 +225,18 @@ const cr = {
|
|
|
237
225
|
handleResize(s) {
|
|
238
226
|
if (s.currentTarget !== this.$refs.resizableBox)
|
|
239
227
|
return;
|
|
240
|
-
const t = s.clientX,
|
|
228
|
+
const t = s.clientX, f = s.clientY, h = parseInt(
|
|
241
229
|
document.defaultView.getComputedStyle(this.$refs.resource).width,
|
|
242
230
|
10
|
|
243
231
|
), U = parseInt(
|
|
244
232
|
document.defaultView.getComputedStyle(this.$refs.resource).height,
|
|
245
233
|
10
|
|
246
|
-
),
|
|
234
|
+
), R = h / U;
|
|
247
235
|
let Y = h, K = U;
|
|
248
236
|
const ve = (Me) => {
|
|
249
|
-
let De = h + Me.clientX - t, Ee = U + Me.clientY -
|
|
237
|
+
let De = h + Me.clientX - t, Ee = U + Me.clientY - f;
|
|
250
238
|
const { origWidth: Ce, origHeight: te } = this.node.size || {};
|
|
251
|
-
Ce && te && (De = Math.min(De, Ce), Ee = Math.min(Ee, te)), De = Math.max(De, 50), Ee = Math.max(Ee, 50), De / Ee >
|
|
239
|
+
Ce && te && (De = Math.min(De, Ce), Ee = Math.min(Ee, te)), De = Math.max(De, 50), Ee = Math.max(Ee, 50), De / Ee > R ? (Y = Ee * R, K = Ee, this.$refs.resource.style.height = K + "px", this.$refs.resource.style.width = Y + "px") : (Y = De, K = De / R, this.$refs.resource.style.width = De + "px", this.$refs.resource.style.height = K + "px");
|
|
252
240
|
}, be = () => {
|
|
253
241
|
document.documentElement.removeEventListener(
|
|
254
242
|
"mousemove",
|
|
@@ -285,10 +273,10 @@ const cr = {
|
|
|
285
273
|
const h = kt(), U = (s.target.innerHTML || "").replace(
|
|
286
274
|
/<br\s*\/?>/gi,
|
|
287
275
|
""
|
|
288
|
-
),
|
|
276
|
+
), R = t.text !== U;
|
|
289
277
|
t.text = U, this.$nextTick(() => {
|
|
290
278
|
Lt(s.target, h);
|
|
291
|
-
}),
|
|
279
|
+
}), R && this.update();
|
|
292
280
|
} else
|
|
293
281
|
this.disableInput = !1;
|
|
294
282
|
},
|
|
@@ -322,7 +310,7 @@ const cr = {
|
|
|
322
310
|
}
|
|
323
311
|
},
|
|
324
312
|
handleBackspace(s) {
|
|
325
|
-
var
|
|
313
|
+
var f;
|
|
326
314
|
const t = this.node;
|
|
327
315
|
if (this.isComplex)
|
|
328
316
|
s.preventDefault(), this.$emit("toPrevFocus", t, !0), this.remove();
|
|
@@ -330,7 +318,7 @@ const cr = {
|
|
|
330
318
|
const h = window.getSelection();
|
|
331
319
|
let U = h.focusOffset - 1;
|
|
332
320
|
if (s.target && h && U < 0) {
|
|
333
|
-
if (s.preventDefault(), (
|
|
321
|
+
if (s.preventDefault(), (f = t.children) != null && f.length)
|
|
334
322
|
return;
|
|
335
323
|
this.$emit("toPrevFocus", t, !0), this.$emit("remove", t);
|
|
336
324
|
}
|
|
@@ -343,38 +331,38 @@ const cr = {
|
|
|
343
331
|
const t = this.node;
|
|
344
332
|
if (s.ctrlKey) {
|
|
345
333
|
this.$emit("collapse", t, !1);
|
|
346
|
-
const
|
|
334
|
+
const f = {
|
|
347
335
|
text: "",
|
|
348
336
|
uuid: Ct()
|
|
349
337
|
};
|
|
350
|
-
t.children ? t.children.unshift(
|
|
351
|
-
this.$emit("toFocus",
|
|
338
|
+
t.children ? t.children.unshift(f) : t.children = [f], this.update(), this.$nextTick(() => {
|
|
339
|
+
this.$emit("toFocus", f);
|
|
352
340
|
});
|
|
353
341
|
} else
|
|
354
342
|
this.isComposition || this.$emit("enter", t);
|
|
355
343
|
},
|
|
356
344
|
handleDbClick(s) {
|
|
357
|
-
|
|
345
|
+
Ga(s.target);
|
|
358
346
|
},
|
|
359
347
|
handleFocusHolder() {
|
|
360
348
|
const s = this.$refs.element.querySelector(".holder-right");
|
|
361
349
|
s && s.focus();
|
|
362
350
|
},
|
|
363
351
|
handleArrowLeft(s) {
|
|
364
|
-
const t = this.node,
|
|
365
|
-
|
|
352
|
+
const t = this.node, f = s.currentTarget, h = kt();
|
|
353
|
+
f && (h ? this.$nextTick(() => {
|
|
366
354
|
Lt(
|
|
367
|
-
|
|
355
|
+
f,
|
|
368
356
|
h === 1 / 0 ? 0 : h - 1
|
|
369
357
|
);
|
|
370
358
|
}) : this.$emit("toPrevFocus", t, !0));
|
|
371
359
|
},
|
|
372
360
|
handleArrowRight(s) {
|
|
373
|
-
const t = this.node,
|
|
374
|
-
if (!
|
|
361
|
+
const t = this.node, f = s.currentTarget, h = kt();
|
|
362
|
+
if (!f)
|
|
375
363
|
return;
|
|
376
|
-
const U = h + 1,
|
|
377
|
-
!h && t.type ? Lt(
|
|
364
|
+
const U = h + 1, R = f.innerText.length;
|
|
365
|
+
!h && t.type ? Lt(f, U, !0) : U > R ? this.$emit("toNextFocus", t, !0, !0) : Lt(f, U);
|
|
378
366
|
},
|
|
379
367
|
handleArrowDown() {
|
|
380
368
|
this.$emit("toNextFocus", this.node, !1, !0);
|
|
@@ -391,13 +379,13 @@ const cr = {
|
|
|
391
379
|
}
|
|
392
380
|
};
|
|
393
381
|
var dr = function() {
|
|
394
|
-
var t = this,
|
|
395
|
-
return
|
|
382
|
+
var t = this, f = t._self._c;
|
|
383
|
+
return f("div", { ref: "row", staticClass: "node-div" }, [f("span", { staticClass: "node-icon", class: {
|
|
396
384
|
"node-icon": !0,
|
|
397
385
|
"node-icon-complex": !!t.node.type
|
|
398
386
|
}, on: { click: function(h) {
|
|
399
387
|
return h.stopPropagation(), t.$emit("collapse", t.node);
|
|
400
|
-
} } }), t.node.type ?
|
|
388
|
+
} } }), t.node.type ? f("div", { ref: "element", staticClass: "node-text", attrs: { contenteditable: !t.readOnly }, on: { compositionstart: function(h) {
|
|
401
389
|
return h.stopPropagation(), t.handleCompositionStart.apply(null, arguments);
|
|
402
390
|
}, compositionend: function(h) {
|
|
403
391
|
return h.stopPropagation(), t.handleCompositionEnd.apply(null, arguments);
|
|
@@ -407,11 +395,11 @@ var dr = function() {
|
|
|
407
395
|
return h.stopPropagation(), h.target !== h.currentTarget ? null : t.handleFocus.apply(null, arguments);
|
|
408
396
|
}, click: function(h) {
|
|
409
397
|
return h.stopPropagation(), t.handleFocusHolder.apply(null, arguments);
|
|
410
|
-
} } }, [
|
|
398
|
+
} } }, [f("div", { class: `node-complex node-${t.node.type}`, attrs: { contenteditable: !1 } }, [f("span", { staticClass: "holder holder-left", attrs: { contenteditable: "true", tabindex: "-1" } }), f("div", { staticClass: "node-element", attrs: { contenteditable: "false" } }, [t.node.type === "image" ? f("img", { ref: "resource", attrs: { src: t.node.content, width: t.node.size ? t.node.size.width : 80, height: t.node.size ? t.node.size.height : 80 } }) : t._e(), t.node.type === "audio" ? f("audio", { ref: "resource", attrs: { src: t.node.content, controls: "", width: "300" } }) : t._e(), t.node.type === "video" ? f("video", { ref: "resource", attrs: { src: t.node.content, controls: "", width: t.node.size ? t.node.size.width : 300, height: t.node.size ? t.node.size.width : 300, poster: t.isMobile ? "data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=" : null } }) : t._e(), t.node.type === "file" ? f("div", { staticClass: "node-file-wrap", attrs: { contenteditable: !1 } }, [f("div", { staticClass: "node-file-left" }, [f("h6", [t._v(t._s(t.truncateString(t.node.name, 20)))]), f("p", [t._v(t._s(t.formatBytes(t.node.size)))])]), f("div", { staticClass: "node-file-right" }, [f("a", { attrs: { href: t.node.content, download: t.node.name, tabindex: "-1" } }, [t._v("下载")])])]) : t._e(), !t.isMobile && (t.node.type === "image" || t.node.type === "video") ? f("div", { ref: "resizableBox", staticClass: "resize-handle", on: { mousedown: function(h) {
|
|
411
399
|
return h.preventDefault(), h.stopPropagation(), t.handleResize.apply(null, arguments);
|
|
412
|
-
} } }, [
|
|
400
|
+
} } }, [f("inline-svg", { attrs: { src: t.icon.resize, width: 15, height: 15 } })], 1) : t._e(), t.readOnly ? t._e() : f("div", { staticClass: "node-del", on: { click: function(h) {
|
|
413
401
|
return h.stopPropagation(), t.remove.apply(null, arguments);
|
|
414
|
-
} } })]),
|
|
402
|
+
} } })]), f("span", { staticClass: "holder holder-right", attrs: { contenteditable: "true", tabindex: "-1" } })])]) : f("div", { staticClass: "node-text", attrs: { contenteditable: !t.readOnly }, domProps: { innerHTML: t._s(t.readOnly ? t.formatReadOnly(t.node.text) : t.node.text) }, on: { compositionstart: function(h) {
|
|
415
403
|
return h.stopPropagation(), t.handleCompositionStart.apply(null, arguments);
|
|
416
404
|
}, compositionend: function(h) {
|
|
417
405
|
return h.stopPropagation(), t.handleCompositionEnd.apply(null, arguments);
|
|
@@ -430,7 +418,7 @@ var dr = function() {
|
|
|
430
418
|
fr,
|
|
431
419
|
!1,
|
|
432
420
|
null,
|
|
433
|
-
"
|
|
421
|
+
"3a3c7323",
|
|
434
422
|
null,
|
|
435
423
|
null
|
|
436
424
|
);
|
|
@@ -485,12 +473,12 @@ const _r = {
|
|
|
485
473
|
}
|
|
486
474
|
},
|
|
487
475
|
methods: {
|
|
488
|
-
handleDragOver:
|
|
476
|
+
handleDragOver: Za,
|
|
489
477
|
handleDragLeave: da,
|
|
490
478
|
handleDragStart(s, t) {
|
|
491
479
|
s.currentTarget.classList.add("dragging"), s.dataTransfer.setData("dragNode", JSON.stringify(t)), At.on("dragEnd", () => {
|
|
492
|
-
const
|
|
493
|
-
this.update(
|
|
480
|
+
const f = this.nodes.filter((h) => h !== t);
|
|
481
|
+
this.update(f);
|
|
494
482
|
}), At.set("dragId", t.uuid);
|
|
495
483
|
},
|
|
496
484
|
handleDragEnd(s) {
|
|
@@ -498,9 +486,9 @@ const _r = {
|
|
|
498
486
|
},
|
|
499
487
|
handleDrop(s, t) {
|
|
500
488
|
s.stopPropagation();
|
|
501
|
-
const
|
|
502
|
-
if (da(),
|
|
503
|
-
this.addFiles(
|
|
489
|
+
const f = s.dataTransfer.files;
|
|
490
|
+
if (da(), f.length)
|
|
491
|
+
this.addFiles(f, t);
|
|
504
492
|
else {
|
|
505
493
|
let h = s.dataTransfer.getData("dragNode");
|
|
506
494
|
const U = La(s);
|
|
@@ -513,42 +501,42 @@ const _r = {
|
|
|
513
501
|
fa(t, h) || // 拖拽到自己的父节点
|
|
514
502
|
fa(h, t))
|
|
515
503
|
return;
|
|
516
|
-
let
|
|
517
|
-
if (
|
|
518
|
-
this.update(
|
|
504
|
+
let R = [...this.nodes];
|
|
505
|
+
if (R.find((Y) => Y.uuid === h.uuid) ? R = R.filter((Y) => Y.uuid !== h.uuid) : At.trigger("dragEnd"), At.remove("dragId"), U === "center" && (this.status[t.uuid].collapsed = !1, t.children ? t.children.push(h) : t.children = [h], this.$nextTick(() => {
|
|
506
|
+
this.update(R);
|
|
519
507
|
})), U === "top") {
|
|
520
|
-
const Y =
|
|
521
|
-
|
|
508
|
+
const Y = R.findIndex((K) => K === t);
|
|
509
|
+
R.splice(Y, 0, h), this.update(R);
|
|
522
510
|
}
|
|
523
511
|
if (U === "bottom") {
|
|
524
|
-
const Y =
|
|
525
|
-
|
|
512
|
+
const Y = R.findIndex((K) => K === t);
|
|
513
|
+
R.splice(Y + 1, 0, h), this.update(R);
|
|
526
514
|
}
|
|
527
515
|
}
|
|
528
516
|
},
|
|
529
517
|
handlePaste(s, t) {
|
|
530
|
-
const
|
|
531
|
-
if (
|
|
532
|
-
const U = [...this.nodes],
|
|
518
|
+
const f = s.clipboardData.files, h = s.target;
|
|
519
|
+
if (f.length == 0) {
|
|
520
|
+
const U = [...this.nodes], R = U.findIndex((Y) => Y === t);
|
|
533
521
|
setTimeout(() => {
|
|
534
|
-
t.text !== h.innerText && (U[
|
|
522
|
+
t.text !== h.innerText && (U[R] = {
|
|
535
523
|
...t,
|
|
536
524
|
text: h.innerText
|
|
537
525
|
}, this.update(U));
|
|
538
526
|
}, 0);
|
|
539
527
|
return;
|
|
540
528
|
}
|
|
541
|
-
this.addFiles(
|
|
529
|
+
this.addFiles(f, t), s.preventDefault();
|
|
542
530
|
},
|
|
543
531
|
handleTab(s, t) {
|
|
544
|
-
var
|
|
532
|
+
var R;
|
|
545
533
|
s.preventDefault();
|
|
546
|
-
const
|
|
534
|
+
const f = [...this.nodes], h = f.findIndex((Y) => Y === t), U = kt();
|
|
547
535
|
if (s.shiftKey)
|
|
548
536
|
this.$emit("transfer", t);
|
|
549
537
|
else if (h > 0) {
|
|
550
538
|
const Y = this.nodes[h - 1];
|
|
551
|
-
(
|
|
539
|
+
(R = this.status[Y.uuid]) != null && R.collapsed && (this.status[Y.uuid].collapsed = !1), Y.children ? Y.children.push(t) : Y.children = [t], f.splice(h, 1), this.update(f);
|
|
552
540
|
} else
|
|
553
541
|
s.target.focus();
|
|
554
542
|
this.$nextTick(() => {
|
|
@@ -556,22 +544,22 @@ const _r = {
|
|
|
556
544
|
});
|
|
557
545
|
},
|
|
558
546
|
handleRemove(s) {
|
|
559
|
-
const t = this.nodes.filter((
|
|
547
|
+
const t = this.nodes.filter((f) => f.uuid !== s.uuid);
|
|
560
548
|
if (!this.allowEmpty && this.nodes.length === 1) {
|
|
561
|
-
const
|
|
549
|
+
const f = {
|
|
562
550
|
text: "",
|
|
563
551
|
uuid: Ct()
|
|
564
552
|
};
|
|
565
|
-
t.push(
|
|
566
|
-
this.toFocus(
|
|
553
|
+
t.push(f), setTimeout(() => {
|
|
554
|
+
this.toFocus(f);
|
|
567
555
|
}, 200);
|
|
568
556
|
}
|
|
569
557
|
this.update(t);
|
|
570
558
|
},
|
|
571
559
|
// 节点跨父级移动
|
|
572
560
|
handleTransfer(s, t) {
|
|
573
|
-
const
|
|
574
|
-
s.children.splice(U, 1),
|
|
561
|
+
const f = [...this.nodes], h = f.findIndex((R) => R === s), U = s.children.findIndex((R) => R === t);
|
|
562
|
+
s.children.splice(U, 1), f.splice(h + 1, 0, t), this.update(f);
|
|
575
563
|
},
|
|
576
564
|
handleEnter(s) {
|
|
577
565
|
this.enableDbEnter ? this.timeout ? (clearTimeout(this.timeout), this.timeout = null, this.handleDbEnter()) : this.timeout = setTimeout(() => {
|
|
@@ -582,39 +570,39 @@ const _r = {
|
|
|
582
570
|
this.$emit("dbEnter");
|
|
583
571
|
},
|
|
584
572
|
keyEnter(s) {
|
|
585
|
-
const t = ca(s),
|
|
573
|
+
const t = ca(s), f = this.nodes.findIndex((Y) => Y.uuid === s.uuid), h = kt(), U = [...this.nodes], R = { text: "", uuid: Ct() };
|
|
586
574
|
if (t)
|
|
587
|
-
U.splice(
|
|
575
|
+
U.splice(f + 1, 0, R);
|
|
588
576
|
else {
|
|
589
577
|
let Y = s.text.replace(/ ?/g, " ");
|
|
590
|
-
s.text = Y.slice(0, h),
|
|
578
|
+
s.text = Y.slice(0, h), R.text = Y.slice(h, Y.length), U.splice(f + 1, 0, R);
|
|
591
579
|
}
|
|
592
580
|
this.update(U), this.$nextTick(() => {
|
|
593
|
-
const Y = Nt(
|
|
581
|
+
const Y = Nt(R);
|
|
594
582
|
Y == null || Y.focus();
|
|
595
583
|
});
|
|
596
584
|
},
|
|
597
585
|
// 聚焦上一节点
|
|
598
586
|
toPrevFocus(s, t = !1) {
|
|
599
587
|
var U;
|
|
600
|
-
let
|
|
601
|
-
const h = this.nodes.findIndex((
|
|
588
|
+
let f = kt();
|
|
589
|
+
const h = this.nodes.findIndex((R) => R === s);
|
|
602
590
|
if (h === 0)
|
|
603
591
|
this.$emit("focusPrev", t);
|
|
604
592
|
else {
|
|
605
|
-
const
|
|
593
|
+
const R = this.nodes[h - 1], Y = ((U = R.children) == null ? void 0 : U.length) && !this.status[R.uuid].collapsed, K = Nt(this.nodes[h - 1], Y), ve = t || f === 1 / 0;
|
|
606
594
|
Lt(
|
|
607
595
|
K,
|
|
608
|
-
ve ? K.innerText.length :
|
|
596
|
+
ve ? K.innerText.length : f,
|
|
609
597
|
ve
|
|
610
598
|
);
|
|
611
599
|
}
|
|
612
600
|
},
|
|
613
601
|
// 聚焦下一节点
|
|
614
|
-
toNextFocus(s, t = !1,
|
|
615
|
-
var
|
|
602
|
+
toNextFocus(s, t = !1, f = !1) {
|
|
603
|
+
var R;
|
|
616
604
|
const h = kt(), U = this.nodes.findIndex((Y) => Y === s);
|
|
617
|
-
if (
|
|
605
|
+
if (f && ((R = s.children) != null && R.length) && !this.status[s.uuid].collapsed) {
|
|
618
606
|
const Y = Nt(s.children[0]);
|
|
619
607
|
Lt(Y, t ? 0 : h);
|
|
620
608
|
} else if (U + 1 >= this.nodes.length)
|
|
@@ -626,16 +614,16 @@ const _r = {
|
|
|
626
614
|
},
|
|
627
615
|
// 聚焦到指定节点
|
|
628
616
|
toFocus(s, t = !1) {
|
|
629
|
-
let
|
|
617
|
+
let f = kt();
|
|
630
618
|
const h = Nt(s);
|
|
631
|
-
Lt(h,
|
|
619
|
+
Lt(h, f, t);
|
|
632
620
|
},
|
|
633
621
|
addFiles(s, t) {
|
|
634
622
|
if (s) {
|
|
635
|
-
const h = Array.from(s).slice(0, 5), U = (
|
|
623
|
+
const h = Array.from(s).slice(0, 5), U = (R) => {
|
|
636
624
|
const Y = [...this.nodes];
|
|
637
625
|
let K = Y.findIndex((ve) => ve === t);
|
|
638
|
-
|
|
626
|
+
R.forEach((ve, be) => {
|
|
639
627
|
!t.text && !t.content && be === 0 ? (ve.uuid = t.uuid, Y.splice(K, 1, {
|
|
640
628
|
...ve,
|
|
641
629
|
uuid: t.uuid,
|
|
@@ -652,14 +640,14 @@ const _r = {
|
|
|
652
640
|
head(s = !1) {
|
|
653
641
|
const t = Nt(this.nodes[0]);
|
|
654
642
|
if (s && t) {
|
|
655
|
-
const
|
|
656
|
-
|
|
643
|
+
const f = t.querySelector(".holder-right");
|
|
644
|
+
f ? f.focus() : t.focus();
|
|
657
645
|
}
|
|
658
646
|
return t;
|
|
659
647
|
},
|
|
660
648
|
// dfs查找并追加节点
|
|
661
|
-
appendNode(s, t = !1,
|
|
662
|
-
const h = At.get("currentId"), U = [...
|
|
649
|
+
appendNode(s, t = !1, f = this.nodes) {
|
|
650
|
+
const h = At.get("currentId"), U = [...f];
|
|
663
651
|
if (!t && (!h || !document.getElementById(h))) {
|
|
664
652
|
const Y = U[U.length - 1];
|
|
665
653
|
!(Y != null && Y.type) && !Y.text ? U[U.length - 1] = {
|
|
@@ -668,13 +656,13 @@ const _r = {
|
|
|
668
656
|
} : U.push(s), this.update(U);
|
|
669
657
|
return;
|
|
670
658
|
}
|
|
671
|
-
const
|
|
672
|
-
if (
|
|
673
|
-
const Y = U[
|
|
674
|
-
!(Y != null && Y.type) && !Y.text ? U[
|
|
659
|
+
const R = U.findIndex((Y) => Y.uuid === h);
|
|
660
|
+
if (R >= 0) {
|
|
661
|
+
const Y = U[R];
|
|
662
|
+
!(Y != null && Y.type) && !Y.text ? U[R] = {
|
|
675
663
|
...Y,
|
|
676
664
|
...s
|
|
677
|
-
} : U.splice(
|
|
665
|
+
} : U.splice(R + 1, 0, s);
|
|
678
666
|
} else
|
|
679
667
|
U.forEach((Y) => {
|
|
680
668
|
var K;
|
|
@@ -683,11 +671,11 @@ const _r = {
|
|
|
683
671
|
return t || this.update(U), U;
|
|
684
672
|
},
|
|
685
673
|
// dfs查找并更新节点
|
|
686
|
-
updateNode(s, t = !1,
|
|
687
|
-
const h = [...
|
|
688
|
-
return U >= 0 ? h[U] = s : h.forEach((
|
|
674
|
+
updateNode(s, t = !1, f = this.nodes) {
|
|
675
|
+
const h = [...f], U = h.findIndex((R) => R.uuid === s.uuid);
|
|
676
|
+
return U >= 0 ? h[U] = s : h.forEach((R) => {
|
|
689
677
|
var Y;
|
|
690
|
-
(Y =
|
|
678
|
+
(Y = R.children) != null && Y.length && (R.children = this.updateNode(s, !0, R.children));
|
|
691
679
|
}), t || this.update(h), h;
|
|
692
680
|
},
|
|
693
681
|
filterNodes(s) {
|
|
@@ -698,8 +686,8 @@ const _r = {
|
|
|
698
686
|
let s = !1;
|
|
699
687
|
this.nodes.forEach((t) => {
|
|
700
688
|
if (t.uuid || (t.uuid = Ct(), s = !0), ca(t) && !t.type) {
|
|
701
|
-
const
|
|
702
|
-
|
|
689
|
+
const f = qa(t.text);
|
|
690
|
+
f && (t.type = f.type, t.content = f.content), s = !0;
|
|
703
691
|
}
|
|
704
692
|
}), s ? this.update() : this.ensureStatus(this.nodes);
|
|
705
693
|
},
|
|
@@ -717,7 +705,7 @@ const _r = {
|
|
|
717
705
|
// 更新node节点
|
|
718
706
|
// 用于Node组件触发change
|
|
719
707
|
handleNodeChange(s) {
|
|
720
|
-
const t = this.nodes.map((
|
|
708
|
+
const t = this.nodes.map((f) => f.uuid === s.uuid ? s : f);
|
|
721
709
|
this.update(t);
|
|
722
710
|
},
|
|
723
711
|
update(s = this.nodes) {
|
|
@@ -726,22 +714,22 @@ const _r = {
|
|
|
726
714
|
}
|
|
727
715
|
};
|
|
728
716
|
var mr = function() {
|
|
729
|
-
var t = this,
|
|
730
|
-
return t.readOnly ?
|
|
717
|
+
var t = this, f = t._self._c;
|
|
718
|
+
return t.readOnly ? f("ul", { class: {
|
|
731
719
|
"node-ul": !0,
|
|
732
720
|
readOnly: !0,
|
|
733
721
|
sublevel: !0
|
|
734
722
|
} }, t._l(t.filterNodes(t.nodes), function(h) {
|
|
735
|
-
return
|
|
723
|
+
return f("li", { key: h.uuid, class: {
|
|
736
724
|
"node-li": !0,
|
|
737
725
|
collapsed: t.status[h.uuid] ? t.status[h.uuid].collapsed : !1,
|
|
738
726
|
"has-child": !!(h.children || []).length
|
|
739
|
-
}, attrs: { id: `${h.uuid}` } }, [
|
|
740
|
-
}), 0) :
|
|
727
|
+
}, attrs: { id: `${h.uuid}` } }, [f("Node", { attrs: { readOnly: "", node: h, isMobile: t.isMobile }, on: { collapse: t.handleCollapse } }), (h.children || []).length ? f("tree-editor", { attrs: { nodes: h.children, sublevel: !0, isMobile: t.isMobile } }) : t._e()], 1);
|
|
728
|
+
}), 0) : f("ul", { class: {
|
|
741
729
|
"node-ul": !0,
|
|
742
730
|
sublevel: !0
|
|
743
731
|
} }, t._l(t.filterNodes(t.nodes), function(h) {
|
|
744
|
-
return
|
|
732
|
+
return f("li", { key: h.uuid, ref: "elements", refInFor: !0, class: {
|
|
745
733
|
"node-li": !0,
|
|
746
734
|
collapsed: t.status[h.uuid] ? t.status[h.uuid].collapsed : !1,
|
|
747
735
|
"has-child": !!(h.children || []).length
|
|
@@ -757,7 +745,7 @@ var mr = function() {
|
|
|
757
745
|
return U.stopPropagation(), t.handleDragLeave(U, h);
|
|
758
746
|
}, paste: function(U) {
|
|
759
747
|
return U.stopPropagation(), t.handlePaste(U, h);
|
|
760
|
-
} } }, [
|
|
748
|
+
} } }, [f("Node", { attrs: { node: h, isMobile: t.isMobile }, on: { change: t.handleNodeChange, toPrevFocus: t.toPrevFocus, toNextFocus: t.toNextFocus, toFocus: t.toFocus, collapse: t.handleCollapse, enter: t.handleEnter, tab: t.handleTab, remove: t.handleRemove } }), (h.children || []).length ? f("tree-editor", { attrs: { nodes: h.children, enableDbEnter: t.enableDbEnter, hash: t.hash, isMobile: t.isMobile, allowEmpty: !0, sublevel: !0 }, on: { change: (U) => t.handleChangeChildren(h, U), focusPrev: (U) => t.toFocus(h, U), focusNext: (U) => t.toNextFocus(h, U), transfer: (U) => t.handleTransfer(h, U), fileUpload: (...U) => t.$emit("fileUpload", ...U), dbEnter: t.handleDbEnter } }) : t._e()], 1);
|
|
761
749
|
}), 0);
|
|
762
750
|
}, pr = [], br = /* @__PURE__ */ jt(
|
|
763
751
|
_r,
|
|
@@ -772,15 +760,15 @@ var mr = function() {
|
|
|
772
760
|
const Mr = br.exports;
|
|
773
761
|
const gr = {
|
|
774
762
|
components: {
|
|
775
|
-
Popper:
|
|
763
|
+
Popper: Va
|
|
776
764
|
}
|
|
777
765
|
};
|
|
778
766
|
var wr = function() {
|
|
779
|
-
var t = this,
|
|
780
|
-
return
|
|
767
|
+
var t = this, f = t._self._c;
|
|
768
|
+
return f("Popper", { attrs: { trigger: "hover", options: {
|
|
781
769
|
placement: "bottom",
|
|
782
770
|
modifiers: { offset: { offset: "0px, 22px" } }
|
|
783
|
-
} } }, [t._t("default"),
|
|
771
|
+
} } }, [t._t("default"), f("span", { attrs: { slot: "reference" }, slot: "reference" }, [t._t("trigger")], 2)], 2);
|
|
784
772
|
}, yr = [], Tr = /* @__PURE__ */ jt(
|
|
785
773
|
gr,
|
|
786
774
|
wr,
|
|
@@ -852,10 +840,10 @@ const Ar = {
|
|
|
852
840
|
computed: {
|
|
853
841
|
curTag() {
|
|
854
842
|
var t;
|
|
855
|
-
const s = this.tags.find((
|
|
843
|
+
const s = this.tags.find((f) => f.created_at === this.tagId);
|
|
856
844
|
return {
|
|
857
845
|
...s,
|
|
858
|
-
icon: s ? (t =
|
|
846
|
+
icon: s ? (t = Oa(s.icon)) == null ? void 0 : t.value : ""
|
|
859
847
|
};
|
|
860
848
|
},
|
|
861
849
|
tagNames() {
|
|
@@ -879,14 +867,14 @@ const Ar = {
|
|
|
879
867
|
},
|
|
880
868
|
// 根据svg的icon名找到svg实体
|
|
881
869
|
getSvgUrl(s) {
|
|
882
|
-
const t =
|
|
870
|
+
const t = Fa.find((f) => f.name === s.icon);
|
|
883
871
|
return (t == null ? void 0 : t.value) || "";
|
|
884
872
|
},
|
|
885
873
|
setCursorToPosition(s) {
|
|
886
874
|
const t = this.$refs.treeTitle;
|
|
887
875
|
if (t && t.contentEditable) {
|
|
888
|
-
var
|
|
889
|
-
|
|
876
|
+
var f = document.createRange(), h = window.getSelection();
|
|
877
|
+
f.selectNodeContents(t), s === "start" ? f.collapse(!0) : s === "end" && f.collapse(!1), h.removeAllRanges(), h.addRange(f), s === "start" ? t.scrollTop = 0 : s === "end" && (t.scrollTop = t.scrollHeight);
|
|
890
878
|
}
|
|
891
879
|
},
|
|
892
880
|
// 选择tag图标
|
|
@@ -906,12 +894,12 @@ const Ar = {
|
|
|
906
894
|
},
|
|
907
895
|
handleTitleChange(s) {
|
|
908
896
|
const t = (s.target.innerText || "").replace(/\n/g, "");
|
|
909
|
-
this.$emit("input", t), this.isComposition || this.tagNames.forEach((
|
|
910
|
-
const h = new RegExp(`^(${
|
|
897
|
+
this.$emit("input", t), this.isComposition || this.tagNames.forEach((f) => {
|
|
898
|
+
const h = new RegExp(`^(${f}[::])`), U = new RegExp(`([::]${f})$`);
|
|
911
899
|
if (h.test(t) || U.test(t)) {
|
|
912
900
|
s.target.innerText = t.replace(h, "").replace(U, ""), this.setCursorToPosition(h.test(t) ? "start" : "end");
|
|
913
|
-
const
|
|
914
|
-
this.tagSelect(
|
|
901
|
+
const R = this.tags.find((Y) => Y.name === f);
|
|
902
|
+
this.tagSelect(R);
|
|
915
903
|
}
|
|
916
904
|
}), this.titleEmpty = !t;
|
|
917
905
|
},
|
|
@@ -935,30 +923,30 @@ const Ar = {
|
|
|
935
923
|
}
|
|
936
924
|
};
|
|
937
925
|
var Dr = function() {
|
|
938
|
-
var t = this,
|
|
939
|
-
return
|
|
940
|
-
return [
|
|
941
|
-
return
|
|
926
|
+
var t = this, f = t._self._c;
|
|
927
|
+
return f("div", { staticClass: "record-tree-title-bar" }, [t.tags.length ? f("Picker", { scopedSlots: t._u([t.readOnly ? null : { key: "default", fn: function() {
|
|
928
|
+
return [f("div", { staticClass: "record-tree-popper-content", style: { width: t.tagConfig.popW, height: t.tagConfig.popH } }, t._l(t.tags, function(h, U) {
|
|
929
|
+
return f("span", { key: U, staticClass: "record-tree-popper-content-item", on: { click: function(R) {
|
|
942
930
|
return t.tagSelect(h);
|
|
943
|
-
} } }, [t.getSvgUrl(h) ?
|
|
931
|
+
} } }, [t.getSvgUrl(h) ? f("inline-svg", { staticClass: "record-tree-svg", style: { backgroundColor: h.color }, attrs: { src: t.getSvgUrl(h), width: t.tagConfig.tagSize, height: t.tagConfig.tagSize } }) : f("span", { staticClass: "record-tree-empty-icon", style: {
|
|
944
932
|
width: t.tagConfig.tagSize + "px",
|
|
945
933
|
height: t.tagConfig.tagSize + "px",
|
|
946
934
|
backgroundColor: h.color
|
|
947
935
|
} })], 1);
|
|
948
936
|
}), 0)];
|
|
949
937
|
}, proxy: !0 }, { key: "trigger", fn: function() {
|
|
950
|
-
return [
|
|
938
|
+
return [f("span", { staticClass: "record-tree-popper-reference", style: {
|
|
951
939
|
backgroundColor: t.curTag.color,
|
|
952
940
|
top: t.tagConfig.tagT,
|
|
953
941
|
left: t.tagConfig.tagL
|
|
954
|
-
} }, [t.curTag.icon ?
|
|
942
|
+
} }, [t.curTag.icon ? f("inline-svg", { staticClass: "record-tree-svg", attrs: { src: t.curTag.icon, width: t.tagConfig.tagSize, height: t.tagConfig.tagSize } }) : f("span", { staticClass: "record-tree-svg", style: {
|
|
955
943
|
width: t.tagConfig.tagSize + "px",
|
|
956
944
|
height: t.tagConfig.tagSize + "px",
|
|
957
945
|
backgroundColor: t.curTag.color
|
|
958
946
|
} })], 1)];
|
|
959
|
-
}, proxy: !0 }], null, !0) }) : t._e(), t.isMobile && t.titleEmpty ?
|
|
947
|
+
}, proxy: !0 }], null, !0) }) : t._e(), t.isMobile && t.titleEmpty ? f("div", { staticClass: "record-tree-placeholder", on: { click: function(h) {
|
|
960
948
|
return t.$refs.treeTitle.focus();
|
|
961
|
-
} } }, [t._v(" 请输入标题 ")]) : t._e(),
|
|
949
|
+
} } }, [t._v(" 请输入标题 ")]) : t._e(), f("div", { ref: "treeTitle", staticClass: "record-tree-title", attrs: { id: "tree_title", contenteditable: !t.readOnly }, domProps: { innerHTML: t._s(t.title) }, on: { blur: t.handleTitleBlur, focus: t.handleTitleFocus, click: function(h) {
|
|
962
950
|
h.stopPropagation();
|
|
963
951
|
}, keydown: function(h) {
|
|
964
952
|
return !h.type.indexOf("key") && t._k(h.keyCode, "enter", 13, h.key, "Enter") ? null : (h.preventDefault(), t.handleTitleEnter.apply(null, arguments));
|
|
@@ -980,27 +968,27 @@ function Rr(s) {
|
|
|
980
968
|
return s;
|
|
981
969
|
var t = s.default;
|
|
982
970
|
if (typeof t == "function") {
|
|
983
|
-
var
|
|
971
|
+
var f = function h() {
|
|
984
972
|
if (this instanceof h) {
|
|
985
973
|
var U = [null];
|
|
986
974
|
U.push.apply(U, arguments);
|
|
987
|
-
var
|
|
988
|
-
return new
|
|
975
|
+
var R = Function.bind.apply(t, U);
|
|
976
|
+
return new R();
|
|
989
977
|
}
|
|
990
978
|
return t.apply(this, arguments);
|
|
991
979
|
};
|
|
992
|
-
|
|
980
|
+
f.prototype = t.prototype;
|
|
993
981
|
} else
|
|
994
|
-
|
|
995
|
-
return Object.defineProperty(
|
|
982
|
+
f = {};
|
|
983
|
+
return Object.defineProperty(f, "__esModule", { value: !0 }), Object.keys(s).forEach(function(h) {
|
|
996
984
|
var U = Object.getOwnPropertyDescriptor(s, h);
|
|
997
|
-
Object.defineProperty(
|
|
985
|
+
Object.defineProperty(f, h, U.get ? U : {
|
|
998
986
|
enumerable: !0,
|
|
999
987
|
get: function() {
|
|
1000
988
|
return s[h];
|
|
1001
989
|
}
|
|
1002
990
|
});
|
|
1003
|
-
}),
|
|
991
|
+
}), f;
|
|
1004
992
|
}
|
|
1005
993
|
var ha = {}, Lr = {
|
|
1006
994
|
get exports() {
|
|
@@ -1028,26 +1016,26 @@ const kr = {}, jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
1028
1016
|
var Da;
|
|
1029
1017
|
function ta() {
|
|
1030
1018
|
return Da || (Da = 1, function(s, t) {
|
|
1031
|
-
(function(
|
|
1019
|
+
(function(f, h) {
|
|
1032
1020
|
s.exports = h();
|
|
1033
1021
|
})(st, function() {
|
|
1034
|
-
var
|
|
1035
|
-
var
|
|
1036
|
-
if (typeof window < "u" && window.crypto && (
|
|
1022
|
+
var f = f || function(h, U) {
|
|
1023
|
+
var R;
|
|
1024
|
+
if (typeof window < "u" && window.crypto && (R = window.crypto), typeof self < "u" && self.crypto && (R = self.crypto), typeof globalThis < "u" && globalThis.crypto && (R = globalThis.crypto), !R && typeof window < "u" && window.msCrypto && (R = window.msCrypto), !R && typeof st < "u" && st.crypto && (R = st.crypto), !R && typeof Er == "function")
|
|
1037
1025
|
try {
|
|
1038
|
-
|
|
1026
|
+
R = zr;
|
|
1039
1027
|
} catch {
|
|
1040
1028
|
}
|
|
1041
1029
|
var Y = function() {
|
|
1042
|
-
if (
|
|
1043
|
-
if (typeof
|
|
1030
|
+
if (R) {
|
|
1031
|
+
if (typeof R.getRandomValues == "function")
|
|
1044
1032
|
try {
|
|
1045
|
-
return
|
|
1033
|
+
return R.getRandomValues(new Uint32Array(1))[0];
|
|
1046
1034
|
} catch {
|
|
1047
1035
|
}
|
|
1048
|
-
if (typeof
|
|
1036
|
+
if (typeof R.randomBytes == "function")
|
|
1049
1037
|
try {
|
|
1050
|
-
return
|
|
1038
|
+
return R.randomBytes(4).readInt32LE();
|
|
1051
1039
|
} catch {
|
|
1052
1040
|
}
|
|
1053
1041
|
}
|
|
@@ -1522,7 +1510,7 @@ function ta() {
|
|
|
1522
1510
|
var Ue = ve.algo = {};
|
|
1523
1511
|
return ve;
|
|
1524
1512
|
}(Math);
|
|
1525
|
-
return
|
|
1513
|
+
return f;
|
|
1526
1514
|
});
|
|
1527
1515
|
}(Br)), Kt;
|
|
1528
1516
|
}
|
|
@@ -1536,11 +1524,11 @@ var Jt = {}, Or = {
|
|
|
1536
1524
|
}, Na;
|
|
1537
1525
|
function Fr() {
|
|
1538
1526
|
return Na || (Na = 1, function(s, t) {
|
|
1539
|
-
(function(
|
|
1527
|
+
(function(f, h) {
|
|
1540
1528
|
s.exports = h(ta());
|
|
1541
|
-
})(st, function(
|
|
1529
|
+
})(st, function(f) {
|
|
1542
1530
|
return function(h) {
|
|
1543
|
-
var U =
|
|
1531
|
+
var U = f, R = U.lib, Y = R.WordArray, K = R.Hasher, ve = U.algo, be = [], Me = [];
|
|
1544
1532
|
(function() {
|
|
1545
1533
|
function Ce(Ue) {
|
|
1546
1534
|
for (var E = h.sqrt(Ue), he = 2; he <= E; he++)
|
|
@@ -1581,7 +1569,7 @@ function Fr() {
|
|
|
1581
1569
|
}
|
|
1582
1570
|
});
|
|
1583
1571
|
U.SHA256 = K._createHelper(Ee), U.HmacSHA256 = K._createHmacHelper(Ee);
|
|
1584
|
-
}(Math),
|
|
1572
|
+
}(Math), f.SHA256;
|
|
1585
1573
|
});
|
|
1586
1574
|
}(Or)), Jt;
|
|
1587
1575
|
}
|
|
@@ -1595,12 +1583,12 @@ var ea = {}, Ur = {
|
|
|
1595
1583
|
}, Ca;
|
|
1596
1584
|
function Hr() {
|
|
1597
1585
|
return Ca || (Ca = 1, function(s, t) {
|
|
1598
|
-
(function(
|
|
1586
|
+
(function(f, h) {
|
|
1599
1587
|
s.exports = h(ta());
|
|
1600
|
-
})(st, function(
|
|
1588
|
+
})(st, function(f) {
|
|
1601
1589
|
(function() {
|
|
1602
|
-
var h =
|
|
1603
|
-
ve.HMAC =
|
|
1590
|
+
var h = f, U = h.lib, R = U.Base, Y = h.enc, K = Y.Utf8, ve = h.algo;
|
|
1591
|
+
ve.HMAC = R.extend({
|
|
1604
1592
|
/**
|
|
1605
1593
|
* Initializes a newly created HMAC.
|
|
1606
1594
|
*
|
|
@@ -1671,10 +1659,10 @@ function Hr() {
|
|
|
1671
1659
|
}(Ur)), ea;
|
|
1672
1660
|
}
|
|
1673
1661
|
(function(s, t) {
|
|
1674
|
-
(function(
|
|
1662
|
+
(function(f, h, U) {
|
|
1675
1663
|
s.exports = h(ta(), Fr(), Hr());
|
|
1676
|
-
})(st, function(
|
|
1677
|
-
return
|
|
1664
|
+
})(st, function(f) {
|
|
1665
|
+
return f.HmacSHA256;
|
|
1678
1666
|
});
|
|
1679
1667
|
})(Lr);
|
|
1680
1668
|
const Pr = ha;
|
|
@@ -1687,11 +1675,11 @@ var va = {}, Yr = {
|
|
|
1687
1675
|
}
|
|
1688
1676
|
};
|
|
1689
1677
|
(function(s, t) {
|
|
1690
|
-
(function(
|
|
1678
|
+
(function(f, h) {
|
|
1691
1679
|
s.exports = h(ta());
|
|
1692
|
-
})(st, function(
|
|
1680
|
+
})(st, function(f) {
|
|
1693
1681
|
return function() {
|
|
1694
|
-
var h =
|
|
1682
|
+
var h = f, U = h.lib, R = U.WordArray, Y = h.enc;
|
|
1695
1683
|
Y.Base64 = {
|
|
1696
1684
|
/**
|
|
1697
1685
|
* Converts a word array to a Base64 string.
|
|
@@ -1753,38 +1741,38 @@ var va = {}, Yr = {
|
|
|
1753
1741
|
var te = Me[ve.charCodeAt(Ce - 1)] << Ce % 4 * 2, ie = Me[ve.charCodeAt(Ce)] >>> 6 - Ce % 4 * 2, we = te | ie;
|
|
1754
1742
|
De[Ee >>> 2] |= we << 24 - Ee % 4 * 8, Ee++;
|
|
1755
1743
|
}
|
|
1756
|
-
return
|
|
1744
|
+
return R.create(De, Ee);
|
|
1757
1745
|
}
|
|
1758
|
-
}(),
|
|
1746
|
+
}(), f.enc.Base64;
|
|
1759
1747
|
});
|
|
1760
1748
|
})(Yr);
|
|
1761
1749
|
const Qr = va;
|
|
1762
1750
|
let It, Ht = "", Xt = "", Ba = null;
|
|
1763
1751
|
function Vr() {
|
|
1764
|
-
var s = "wss://iat-api.xfyun.cn/v2/iat", t = "iat-api.xfyun.cn",
|
|
1752
|
+
var s = "wss://iat-api.xfyun.cn/v2/iat", t = "iat-api.xfyun.cn", f = "4f2bbe08d7ee54da888cfd009514e89f", h = "NTc3MWNlNDNiZWFmMGM2Yzk0ZjRlZjdi", U = new Date().toGMTString(), R = "hmac-sha256", Y = "host date request-line", K = `host: ${t}
|
|
1765
1753
|
date: ${U}
|
|
1766
|
-
GET /v2/iat HTTP/1.1`, ve = Pr(K, h), be = Qr.stringify(ve), Me = `api_key="${
|
|
1754
|
+
GET /v2/iat HTTP/1.1`, ve = Pr(K, h), be = Qr.stringify(ve), Me = `api_key="${f}", algorithm="${R}", headers="${Y}", signature="${be}"`, De = btoa(Me);
|
|
1767
1755
|
return s = `${s}?authorization=${De}&date=${U}&host=${t}`, s;
|
|
1768
1756
|
}
|
|
1769
1757
|
function Wr(s) {
|
|
1770
|
-
for (var t = "",
|
|
1771
|
-
t += String.fromCharCode(
|
|
1758
|
+
for (var t = "", f = new Uint8Array(s), h = f.byteLength, U = 0; U < h; U++)
|
|
1759
|
+
t += String.fromCharCode(f[U]);
|
|
1772
1760
|
return t;
|
|
1773
1761
|
}
|
|
1774
1762
|
function Gr(s) {
|
|
1775
1763
|
let t = JSON.parse(s);
|
|
1776
1764
|
if (t.data && t.data.result) {
|
|
1777
|
-
let
|
|
1778
|
-
for (let
|
|
1779
|
-
h = h + U[
|
|
1780
|
-
|
|
1765
|
+
let f = t.data.result, h = "", U = f.ws;
|
|
1766
|
+
for (let R = 0; R < U.length; R++)
|
|
1767
|
+
h = h + U[R].cw[0].w;
|
|
1768
|
+
f.pgs ? (f.pgs === "apd" && (Ht = Xt), Xt = Ht + h) : Ht = Ht + h, Ba(Xt || Ht || "");
|
|
1781
1769
|
}
|
|
1782
1770
|
t.code === 0 && t.data.status === 2 && It.close(), t.code !== 0 && (It.close(), console.error(t));
|
|
1783
1771
|
}
|
|
1784
1772
|
function $r(s) {
|
|
1785
1773
|
const t = Vr();
|
|
1786
1774
|
It = new WebSocket(t), It.onopen = () => {
|
|
1787
|
-
var
|
|
1775
|
+
var f = {
|
|
1788
1776
|
common: {
|
|
1789
1777
|
app_id: "c54ef25c"
|
|
1790
1778
|
},
|
|
@@ -1801,24 +1789,24 @@ function $r(s) {
|
|
|
1801
1789
|
encoding: "lame"
|
|
1802
1790
|
}
|
|
1803
1791
|
};
|
|
1804
|
-
It.send(JSON.stringify(
|
|
1805
|
-
}, It.onmessage = (
|
|
1806
|
-
Gr(
|
|
1807
|
-
}, It.onerror = (
|
|
1808
|
-
console.error(
|
|
1792
|
+
It.send(JSON.stringify(f)), s();
|
|
1793
|
+
}, It.onmessage = (f) => {
|
|
1794
|
+
Gr(f.data);
|
|
1795
|
+
}, It.onerror = (f) => {
|
|
1796
|
+
console.error(f);
|
|
1809
1797
|
};
|
|
1810
1798
|
}
|
|
1811
1799
|
function Zr(s, t) {
|
|
1812
1800
|
It = null, Ht = "", Xt = "", Ba = t, $r(() => {
|
|
1813
|
-
const
|
|
1814
|
-
|
|
1801
|
+
const f = new FileReader();
|
|
1802
|
+
f.readAsArrayBuffer(s), f.onload = (h) => {
|
|
1815
1803
|
console.log(h.target.result);
|
|
1816
1804
|
const U = Wr(h.target.result);
|
|
1817
|
-
let
|
|
1818
|
-
for (;
|
|
1819
|
-
const Y = U.substring(
|
|
1820
|
-
|
|
1821
|
-
const K =
|
|
1805
|
+
let R = 0;
|
|
1806
|
+
for (; R < U.length; ) {
|
|
1807
|
+
const Y = U.substring(R, R + 1280);
|
|
1808
|
+
R += 1280;
|
|
1809
|
+
const K = R >= U.length;
|
|
1822
1810
|
It.send(
|
|
1823
1811
|
JSON.stringify({
|
|
1824
1812
|
data: {
|
|
@@ -1830,7 +1818,7 @@ function Zr(s, t) {
|
|
|
1830
1818
|
})
|
|
1831
1819
|
);
|
|
1832
1820
|
}
|
|
1833
|
-
},
|
|
1821
|
+
}, f.onerror = () => {
|
|
1834
1822
|
It.close();
|
|
1835
1823
|
};
|
|
1836
1824
|
});
|
|
@@ -1845,21 +1833,21 @@ var _a = {}, qr = {
|
|
|
1845
1833
|
};
|
|
1846
1834
|
(function(s) {
|
|
1847
1835
|
(function(t) {
|
|
1848
|
-
var
|
|
1849
|
-
t(h,
|
|
1850
|
-
})(function(t,
|
|
1836
|
+
var f = typeof window == "object" && !!window.document, h = f ? window : Object;
|
|
1837
|
+
t(h, f), s.exports && (s.exports = h.Recorder);
|
|
1838
|
+
})(function(t, f) {
|
|
1851
1839
|
var h = function() {
|
|
1852
1840
|
}, U = function(e) {
|
|
1853
1841
|
return typeof e == "number";
|
|
1854
|
-
},
|
|
1842
|
+
}, R = function(e) {
|
|
1855
1843
|
return new W(e);
|
|
1856
|
-
}, Y =
|
|
1844
|
+
}, Y = R.LM = "2023-12-24 18:09", K = "https://github.com/xiangyuecn/Recorder", ve = "Recorder", be = "getUserMedia", Me = "srcSampleRate", De = "sampleRate", Ee = "bitRate", Ce = "catch", te = t[ve];
|
|
1857
1845
|
if (te && te.LM == Y) {
|
|
1858
1846
|
te.CLog(te.i18n.$T("K8zP::重复导入{1}", 0, ve), 3);
|
|
1859
1847
|
return;
|
|
1860
1848
|
}
|
|
1861
|
-
|
|
1862
|
-
var e =
|
|
1849
|
+
R.IsOpen = function() {
|
|
1850
|
+
var e = R.Stream;
|
|
1863
1851
|
if (e) {
|
|
1864
1852
|
var l = e.getTracks && e.getTracks() || e.audioTracks || [], m = l[0];
|
|
1865
1853
|
if (m) {
|
|
@@ -1868,44 +1856,44 @@ var _a = {}, qr = {
|
|
|
1868
1856
|
}
|
|
1869
1857
|
}
|
|
1870
1858
|
return !1;
|
|
1871
|
-
},
|
|
1859
|
+
}, R.BufferSize = 4096, R.Destroy = function() {
|
|
1872
1860
|
He(ve + " Destroy"), Ze();
|
|
1873
1861
|
for (var e in ie)
|
|
1874
1862
|
ie[e]();
|
|
1875
1863
|
};
|
|
1876
1864
|
var ie = {};
|
|
1877
|
-
|
|
1865
|
+
R.BindDestroy = function(e, l) {
|
|
1878
1866
|
ie[e] = l;
|
|
1879
|
-
},
|
|
1880
|
-
if (!
|
|
1867
|
+
}, R.Support = function() {
|
|
1868
|
+
if (!f)
|
|
1881
1869
|
return !1;
|
|
1882
1870
|
var e = navigator.mediaDevices || {};
|
|
1883
|
-
return e[be] || (e = navigator, e[be] || (e[be] = e.webkitGetUserMedia || e.mozGetUserMedia || e.msGetUserMedia)), !(!e[be] || (
|
|
1884
|
-
},
|
|
1885
|
-
if (!
|
|
1871
|
+
return e[be] || (e = navigator, e[be] || (e[be] = e.webkitGetUserMedia || e.mozGetUserMedia || e.msGetUserMedia)), !(!e[be] || (R.Scope = e, !R.GetContext()));
|
|
1872
|
+
}, R.GetContext = function(e) {
|
|
1873
|
+
if (!f)
|
|
1886
1874
|
return null;
|
|
1887
1875
|
var l = window.AudioContext;
|
|
1888
1876
|
if (l || (l = window.webkitAudioContext), !l)
|
|
1889
1877
|
return null;
|
|
1890
|
-
var m =
|
|
1891
|
-
if ((!m || m.state == "closed") && (m =
|
|
1892
|
-
var b =
|
|
1893
|
-
b && b.close && (b.close(),
|
|
1894
|
-
var D =
|
|
1895
|
-
|
|
1878
|
+
var m = R.Ctx;
|
|
1879
|
+
if ((!m || m.state == "closed") && (m = R.Ctx = new l(), R.NewCtxs = R.NewCtxs || [], R.BindDestroy("Ctx", function() {
|
|
1880
|
+
var b = R.Ctx;
|
|
1881
|
+
b && b.close && (b.close(), R.Ctx = 0);
|
|
1882
|
+
var D = R.NewCtxs;
|
|
1883
|
+
R.NewCtxs = [];
|
|
1896
1884
|
for (var Z = 0; Z < D.length; Z++)
|
|
1897
1885
|
D[Z].close();
|
|
1898
1886
|
})), e && m.close)
|
|
1899
1887
|
try {
|
|
1900
|
-
m = new l(),
|
|
1888
|
+
m = new l(), R.NewCtxs.push(m);
|
|
1901
1889
|
} catch (b) {
|
|
1902
1890
|
He("GetContext tryNew Error", 1, b);
|
|
1903
1891
|
}
|
|
1904
1892
|
return m;
|
|
1905
|
-
},
|
|
1906
|
-
if (e && e !=
|
|
1893
|
+
}, R.CloseNewCtx = function(e) {
|
|
1894
|
+
if (e && e != R.Ctx) {
|
|
1907
1895
|
e.close && e.close();
|
|
1908
|
-
for (var l =
|
|
1896
|
+
for (var l = R.NewCtxs || [], m = l.length, b = 0; b < l.length; b++)
|
|
1909
1897
|
if (l[b] == e) {
|
|
1910
1898
|
l.splice(b, 1);
|
|
1911
1899
|
break;
|
|
@@ -1917,11 +1905,11 @@ var _a = {}, qr = {
|
|
|
1917
1905
|
var l = e.state, m = "ctx.state=" + l;
|
|
1918
1906
|
return l == "suspended" && (m += Be("nMIy::(注意:ctx不是running状态,rec.open和start至少要有一个在用户操作(触摸、点击等)时进行调用,否则将在rec.start时尝试进行ctx.resume,可能会产生兼容性问题(仅iOS),请参阅文档中runningContext配置)")), m;
|
|
1919
1907
|
}, Ue = "ConnectEnableWebM";
|
|
1920
|
-
|
|
1908
|
+
R[Ue] = !0;
|
|
1921
1909
|
var E = "ConnectEnableWorklet";
|
|
1922
|
-
|
|
1910
|
+
R[E] = !1;
|
|
1923
1911
|
var he = function(e, l) {
|
|
1924
|
-
var m = e.BufferSize ||
|
|
1912
|
+
var m = e.BufferSize || R.BufferSize, b = e.Stream, D = b._RC || b._c || R.GetContext(!0);
|
|
1925
1913
|
b._c = D;
|
|
1926
1914
|
var Z = function(V) {
|
|
1927
1915
|
var T = b._m = D.createMediaStreamSource(b), ce = D.destination, g = "createMediaStreamDestination";
|
|
@@ -1938,7 +1926,7 @@ var _a = {}, qr = {
|
|
|
1938
1926
|
}
|
|
1939
1927
|
}, le = "ScriptProcessor", fe = "audioWorklet", Ae = ve + " " + fe, ue = "RecProc", X = "MediaRecorder", pe = X + ".WebM.PCM", Ne = D.createScriptProcessor || D.createJavaScriptNode, Q = Be("ZGlf::。由于{1}内部1秒375次回调,在移动端可能会有性能问题导致回调丢失录音变短,PC端无影响,暂不建议开启{1}。", 0, fe), ne = function() {
|
|
1940
1928
|
o = b.isWorklet = !1, Fe(b), He(Be("7TU0::Connect采用老的{1},", 0, le) + ct.get(
|
|
1941
|
-
|
|
1929
|
+
R[E] ? Be("JwCL::但已设置{1}尝试启用{2}", 2) : Be("VGjB::可设置{1}尝试启用{2}", 2),
|
|
1942
1930
|
[ve + "." + E + "=true", fe]
|
|
1943
1931
|
) + se + Q, 3);
|
|
1944
1932
|
var V = b._p = Ne.call(D, m, 1, 1);
|
|
@@ -1946,8 +1934,8 @@ var _a = {}, qr = {
|
|
|
1946
1934
|
var ce = T.inputBuffer.getChannelData(0);
|
|
1947
1935
|
xe(ce);
|
|
1948
1936
|
};
|
|
1949
|
-
},
|
|
1950
|
-
S = b.isWebM = !1, Qe(b), o = b.isWorklet = !Ne ||
|
|
1937
|
+
}, d = function() {
|
|
1938
|
+
S = b.isWebM = !1, Qe(b), o = b.isWorklet = !Ne || R[E];
|
|
1951
1939
|
var V = window.AudioWorkletNode;
|
|
1952
1940
|
if (!(o && D[fe] && V)) {
|
|
1953
1941
|
ne();
|
|
@@ -2009,10 +1997,10 @@ var _a = {}, qr = {
|
|
|
2009
1997
|
});
|
|
2010
1998
|
}, N = function() {
|
|
2011
1999
|
var V = window[X], T = "ondataavailable", ce = "audio/webm; codecs=pcm";
|
|
2012
|
-
S = b.isWebM =
|
|
2000
|
+
S = b.isWebM = R[Ue];
|
|
2013
2001
|
var g = V && T in V.prototype && V.isTypeSupported(ce);
|
|
2014
2002
|
if (se = g ? "" : Be("VwPd::(此浏览器不支持{1})", 0, pe), !l || !S || !g) {
|
|
2015
|
-
|
|
2003
|
+
d();
|
|
2016
2004
|
return;
|
|
2017
2005
|
}
|
|
2018
2006
|
var H = function() {
|
|
@@ -2020,10 +2008,10 @@ var _a = {}, qr = {
|
|
|
2020
2008
|
};
|
|
2021
2009
|
b._ra = function() {
|
|
2022
2010
|
ee !== "" && (clearTimeout(ee), ee = setTimeout(function() {
|
|
2023
|
-
H() && (He(Be("vHnb::{1}未返回任何音频,降级使用{2}", 0, X, fe), 3),
|
|
2011
|
+
H() && (He(Be("vHnb::{1}未返回任何音频,降级使用{2}", 0, X, fe), 3), d());
|
|
2024
2012
|
}, 500));
|
|
2025
2013
|
};
|
|
2026
|
-
var oe = Object.assign({ mimeType: ce },
|
|
2014
|
+
var oe = Object.assign({ mimeType: ce }, R.ConnectWebMOptions), z = b._r = new V(b, oe), re = b._rd = { sampleRate: D[De] };
|
|
2027
2015
|
z[T] = function(j) {
|
|
2028
2016
|
var _e = new FileReader();
|
|
2029
2017
|
_e.onloadend = function() {
|
|
@@ -2032,7 +2020,7 @@ var _a = {}, qr = {
|
|
|
2032
2020
|
if (!k)
|
|
2033
2021
|
return;
|
|
2034
2022
|
if (k == -1) {
|
|
2035
|
-
|
|
2023
|
+
d();
|
|
2036
2024
|
return;
|
|
2037
2025
|
}
|
|
2038
2026
|
ee && (clearTimeout(ee), ee = ""), xe(k);
|
|
@@ -2049,23 +2037,23 @@ var _a = {}, qr = {
|
|
|
2049
2037
|
}, Qe = function(e) {
|
|
2050
2038
|
e._ra = null, e._r && (e._r.stop(), e._r = null);
|
|
2051
2039
|
}, Ze = function(e) {
|
|
2052
|
-
e = e ||
|
|
2053
|
-
var l = e ==
|
|
2054
|
-
m && (m._m && (m._m.disconnect(), m._m = null), !m._RC && m._c &&
|
|
2055
|
-
}, Ge =
|
|
2040
|
+
e = e || R;
|
|
2041
|
+
var l = e == R, m = e.Stream;
|
|
2042
|
+
m && (m._m && (m._m.disconnect(), m._m = null), !m._RC && m._c && R.CloseNewCtx(m._c), m._RC = null, m._c = null, m._d && (Ge(m._d.stream), m._d = null), m._p && (m._p.disconnect(), m._p.onaudioprocess = m._p = null), Fe(m), Qe(m), l && Ge(m)), e.Stream = 0;
|
|
2043
|
+
}, Ge = R.StopS_ = function(e) {
|
|
2056
2044
|
for (var l = e.getTracks && e.getTracks() || e.audioTracks || [], m = 0; m < l.length; m++) {
|
|
2057
2045
|
var b = l[m];
|
|
2058
2046
|
b.stop && b.stop();
|
|
2059
2047
|
}
|
|
2060
2048
|
e.stop && e.stop();
|
|
2061
2049
|
};
|
|
2062
|
-
|
|
2050
|
+
R.SampleData = function(e, l, m, b, D) {
|
|
2063
2051
|
var Z = "SampleData";
|
|
2064
2052
|
b || (b = {});
|
|
2065
2053
|
var S = b.index || 0, o = b.offset || 0, ee = b.filter;
|
|
2066
2054
|
if (ee && ee.fn && ee.sr != l && (ee = null, He(Be("d48C::{1}的filter采样率变了,重设滤波", 0, Z), 3)), !ee) {
|
|
2067
2055
|
var se = m > l * 3 / 4 ? 0 : m / 2 * 3 / 4;
|
|
2068
|
-
ee = { fn: se ?
|
|
2056
|
+
ee = { fn: se ? R.IIRFilter(!0, l, se) : 0 };
|
|
2069
2057
|
}
|
|
2070
2058
|
ee.sr = l;
|
|
2071
2059
|
var ye = ee.fn, xe = b.frameNext || [];
|
|
@@ -2082,8 +2070,8 @@ var _a = {}, qr = {
|
|
|
2082
2070
|
for (var pe = new Int16Array(Ae), Ne = 0, ue = 0; ue < xe.length; ue++)
|
|
2083
2071
|
pe[Ne] = xe[ue], Ne++;
|
|
2084
2072
|
for (; S < fe; S++) {
|
|
2085
|
-
for (var Q = e[S], ue = o, ne = Q.length,
|
|
2086
|
-
if (H < ne && (
|
|
2073
|
+
for (var Q = e[S], ue = o, ne = Q.length, d = ye && ye.Embed, N = 0, V = 0, T = 0, ce = 0, g = 0, H = 0; g < ne; g++, H++) {
|
|
2074
|
+
if (H < ne && (d ? (T = Q[H], ce = d.b0 * T + d.b1 * d.x1 + d.b0 * d.x2 - d.a1 * d.y1 - d.a2 * d.y2, d.x2 = d.x1, d.x1 = T, d.y2 = d.y1, d.y1 = ce) : ce = ye ? ye(Q[H]) : Q[H]), N = V, V = ce, H == 0) {
|
|
2087
2075
|
g--;
|
|
2088
2076
|
continue;
|
|
2089
2077
|
}
|
|
@@ -2109,7 +2097,7 @@ var _a = {}, qr = {
|
|
|
2109
2097
|
sampleRate: m,
|
|
2110
2098
|
data: pe
|
|
2111
2099
|
};
|
|
2112
|
-
},
|
|
2100
|
+
}, R.IIRFilter = function(e, l, m) {
|
|
2113
2101
|
var b = 2 * Math.PI * m / l, D = Math.sin(b), Z = Math.cos(b), S = D / 2, o = 1 + S, ee = -2 * Z / o, se = (1 - S) / o;
|
|
2114
2102
|
if (e)
|
|
2115
2103
|
var ye = (1 - Z) / 2 / o, xe = (1 - Z) / o;
|
|
@@ -2119,22 +2107,22 @@ var _a = {}, qr = {
|
|
|
2119
2107
|
return Ae = ye * Ne + xe * le + ye * fe - ee * ue - se * X, fe = le, le = Ne, X = ue, ue = Ae, Ae;
|
|
2120
2108
|
};
|
|
2121
2109
|
return pe.Embed = { x1: 0, x2: 0, y1: 0, y2: 0, b0: ye, b1: xe, a1: ee, a2: se }, pe;
|
|
2122
|
-
},
|
|
2110
|
+
}, R.PowerLevel = function(e, l) {
|
|
2123
2111
|
var m = e / l || 0, b;
|
|
2124
2112
|
return m < 1251 ? b = Math.round(m / 1250 * 10) : b = Math.round(Math.min(100, Math.max(0, (1 + Math.log(m / 1e4) / Math.log(10)) * 100))), b;
|
|
2125
|
-
},
|
|
2113
|
+
}, R.PowerDBFS = function(e) {
|
|
2126
2114
|
var l = Math.max(0.1, e || 0), m = 32767;
|
|
2127
2115
|
return l = Math.min(l, m), l = 20 * Math.log(l / m) / Math.log(10), Math.max(-100, Math.round(l));
|
|
2128
|
-
},
|
|
2116
|
+
}, R.CLog = function(e, l) {
|
|
2129
2117
|
if (typeof console == "object") {
|
|
2130
|
-
var m = new Date(), b = ("0" + m.getMinutes()).substr(-2) + ":" + ("0" + m.getSeconds()).substr(-2) + "." + ("00" + m.getMilliseconds()).substr(-3), D = this && this.envIn && this.envCheck && this.id, Z = ["[" + b + " " + ve + (D ? ":" + D : "") + "]" + e], S = arguments, o =
|
|
2118
|
+
var m = new Date(), b = ("0" + m.getMinutes()).substr(-2) + ":" + ("0" + m.getSeconds()).substr(-2) + "." + ("00" + m.getMilliseconds()).substr(-3), D = this && this.envIn && this.envCheck && this.id, Z = ["[" + b + " " + ve + (D ? ":" + D : "") + "]" + e], S = arguments, o = R.CLog, ee = 2, se = o.log || console.log;
|
|
2131
2119
|
for (U(l) ? se = l == 1 ? o.error || console.error : l == 3 ? o.warn || console.warn : se : ee = 1; ee < S.length; ee++)
|
|
2132
2120
|
Z.push(S[ee]);
|
|
2133
2121
|
Xe ? se && se("[IsLoser]" + Z[0], Z.length > 1 ? Z : "") : se.apply(console, Z);
|
|
2134
2122
|
}
|
|
2135
2123
|
};
|
|
2136
2124
|
var He = function() {
|
|
2137
|
-
|
|
2125
|
+
R.CLog.apply(this, arguments);
|
|
2138
2126
|
}, Xe = !0;
|
|
2139
2127
|
try {
|
|
2140
2128
|
Xe = !console.log.apply;
|
|
@@ -2172,15 +2160,15 @@ var _a = {}, qr = {
|
|
|
2172
2160
|
var D = m[Ee], Z = m[De];
|
|
2173
2161
|
(D && !U(D) || Z && !U(Z)) && l.CLog(Be.G("IllegalArgs-1", [Be("VtS4::{1}和{2}必须是数值", 0, De, Ee)]), 1, e), m[Ee] = +D || 16, m[De] = +Z || 16e3, l.state = 0, l._S = 9, l.Sync = { O: 9, C: 9 };
|
|
2174
2162
|
}
|
|
2175
|
-
|
|
2163
|
+
R.Sync = {
|
|
2176
2164
|
/*open*/
|
|
2177
2165
|
O: 9,
|
|
2178
2166
|
/*close*/
|
|
2179
2167
|
C: 9
|
|
2180
|
-
},
|
|
2168
|
+
}, R.prototype = W.prototype = {
|
|
2181
2169
|
CLog: He,
|
|
2182
2170
|
_streamStore: function() {
|
|
2183
|
-
return this.set.sourceStream ? this :
|
|
2171
|
+
return this.set.sourceStream ? this : R;
|
|
2184
2172
|
},
|
|
2185
2173
|
_streamCtx: function() {
|
|
2186
2174
|
var e = this._streamStore().Stream;
|
|
@@ -2189,8 +2177,8 @@ var _a = {}, qr = {
|
|
|
2189
2177
|
open: function(e, l) {
|
|
2190
2178
|
var m = this, b = m.set, D = m._streamStore(), Z = 0;
|
|
2191
2179
|
e = e || h;
|
|
2192
|
-
var S = function(
|
|
2193
|
-
N = !!N, m.CLog(Be("5tWi::录音open失败:") +
|
|
2180
|
+
var S = function(d, N) {
|
|
2181
|
+
N = !!N, m.CLog(Be("5tWi::录音open失败:") + d + ",isUserNotAllow:" + N, 1), Z && R.CloseNewCtx(Z), l && l(d, N);
|
|
2194
2182
|
};
|
|
2195
2183
|
m._streamTag = be;
|
|
2196
2184
|
var o = function() {
|
|
@@ -2199,11 +2187,11 @@ var _a = {}, qr = {
|
|
|
2199
2187
|
m._O = m._O_ = se, m._SO = m._S;
|
|
2200
2188
|
var xe = function() {
|
|
2201
2189
|
if (ye != ee.C || !m._O) {
|
|
2202
|
-
var
|
|
2203
|
-
return se == ee.O ? m.close() :
|
|
2190
|
+
var d = Be("dFm8::open被取消");
|
|
2191
|
+
return se == ee.O ? m.close() : d = Be("VtJO::open被中断"), S(d), !0;
|
|
2204
2192
|
}
|
|
2205
2193
|
};
|
|
2206
|
-
if (!
|
|
2194
|
+
if (!f) {
|
|
2207
2195
|
S(Be.G("NonBrowser-1", ["open"]) + Be("EMJq::,可尝试使用RecordApp解决方案") + "(" + K + "/tree/master/app-support-sample)");
|
|
2208
2196
|
return;
|
|
2209
2197
|
}
|
|
@@ -2213,7 +2201,7 @@ var _a = {}, qr = {
|
|
|
2213
2201
|
return;
|
|
2214
2202
|
}
|
|
2215
2203
|
if (b.sourceStream) {
|
|
2216
|
-
if (m._streamTag = "set.sourceStream", !
|
|
2204
|
+
if (m._streamTag = "set.sourceStream", !R.GetContext()) {
|
|
2217
2205
|
S(Be("1iU7::不支持此浏览器从流中获取录音"));
|
|
2218
2206
|
return;
|
|
2219
2207
|
}
|
|
@@ -2222,48 +2210,48 @@ var _a = {}, qr = {
|
|
|
2222
2210
|
fe._RC = b.runningContext, fe._call = {};
|
|
2223
2211
|
try {
|
|
2224
2212
|
he(D);
|
|
2225
|
-
} catch (
|
|
2226
|
-
Ze(D), S(Be("BTW2::从流中打开录音失败:") +
|
|
2213
|
+
} catch (d) {
|
|
2214
|
+
Ze(D), S(Be("BTW2::从流中打开录音失败:") + d.message);
|
|
2227
2215
|
return;
|
|
2228
2216
|
}
|
|
2229
2217
|
o();
|
|
2230
2218
|
return;
|
|
2231
2219
|
}
|
|
2232
|
-
var Ae = function(
|
|
2220
|
+
var Ae = function(d, N) {
|
|
2233
2221
|
try {
|
|
2234
2222
|
window.top.a;
|
|
2235
2223
|
} catch {
|
|
2236
2224
|
S(Be("Nclz::无权录音(跨域,请尝试给iframe添加麦克风访问策略,如{1})", 0, 'allow="camera;microphone"'));
|
|
2237
2225
|
return;
|
|
2238
2226
|
}
|
|
2239
|
-
/Permission|Allow/i.test(
|
|
2227
|
+
/Permission|Allow/i.test(d) ? S(Be("gyO5::用户拒绝了录音权限"), !0) : window.isSecureContext === !1 ? S(Be("oWNo::浏览器禁止不安全页面录音,可开启https解决")) : /Found/i.test(d) ? S(N + Be("jBa9::,无可用麦克风")) : S(N);
|
|
2240
2228
|
};
|
|
2241
|
-
if (
|
|
2229
|
+
if (R.IsOpen()) {
|
|
2242
2230
|
o();
|
|
2243
2231
|
return;
|
|
2244
2232
|
}
|
|
2245
|
-
if (!
|
|
2233
|
+
if (!R.Support()) {
|
|
2246
2234
|
Ae("", Be("COxc::此浏览器不支持录音"));
|
|
2247
2235
|
return;
|
|
2248
2236
|
}
|
|
2249
2237
|
var ue = b.runningContext;
|
|
2250
|
-
ue || (ue = Z =
|
|
2251
|
-
var X = function(
|
|
2238
|
+
ue || (ue = Z = R.GetContext(!0));
|
|
2239
|
+
var X = function(d) {
|
|
2252
2240
|
setTimeout(function() {
|
|
2253
|
-
|
|
2254
|
-
var N =
|
|
2255
|
-
N && (Ze(),
|
|
2241
|
+
d._call = {};
|
|
2242
|
+
var N = R.Stream;
|
|
2243
|
+
N && (Ze(), d._call = N._call), R.Stream = d, d._c = ue, d._RC = b.runningContext, !xe() && (R.IsOpen() ? (N && m.CLog(Be("upb8::发现同时多次调用open"), 1), he(D, 1), o()) : S(Be("Q1GA::录音功能无效:无音频流")));
|
|
2256
2244
|
}, 100);
|
|
2257
|
-
}, pe = function(
|
|
2258
|
-
var N =
|
|
2259
|
-
m.CLog(Be("xEQR::请求录音权限错误"), 1,
|
|
2245
|
+
}, pe = function(d) {
|
|
2246
|
+
var N = d.name || d.message || d.code + ":" + d;
|
|
2247
|
+
m.CLog(Be("xEQR::请求录音权限错误"), 1, d), Ae(N, Be("bDOG::无法录音:") + N);
|
|
2260
2248
|
}, Ne = b.audioTrackSet || {};
|
|
2261
2249
|
Ne[De] = ue[De];
|
|
2262
2250
|
var Q = { audio: Ne };
|
|
2263
2251
|
try {
|
|
2264
|
-
var ne =
|
|
2265
|
-
} catch (
|
|
2266
|
-
m.CLog(be, 3,
|
|
2252
|
+
var ne = R.Scope[be](Q, X, pe);
|
|
2253
|
+
} catch (d) {
|
|
2254
|
+
m.CLog(be, 3, d), Q = { audio: !0 }, ne = R.Scope[be](Q, X, pe);
|
|
2267
2255
|
}
|
|
2268
2256
|
m.CLog(be + "(" + JSON.stringify(Q) + ") " + we(ue) + Be("RiWe::,未配置noiseSuppression和echoCancellation时浏览器可能会自动打开降噪和回声消除,移动端可能会降低系统播放音量(关闭录音后可恢复),请参阅文档中audioTrackSet配置") + "(" + K + ") LM:" + Y + " UA:" + navigator.userAgent), ne && ne.then && ne.then(X)[Ce](pe);
|
|
2269
2257
|
},
|
|
@@ -2288,7 +2276,7 @@ var _a = {}, qr = {
|
|
|
2288
2276
|
},
|
|
2289
2277
|
envCheck: function(e) {
|
|
2290
2278
|
var l, m = this, b = m.set, D = "CPU_BE";
|
|
2291
|
-
if (!l && !
|
|
2279
|
+
if (!l && !R[D] && typeof Int8Array == "function" && !new Int8Array(new Int32Array([1]).buffer)[0] && (L(D), l = Be("Essp::不支持{1}架构", 0, D)), !l) {
|
|
2292
2280
|
var Z = b.type, S = m[Z + "_envCheck"];
|
|
2293
2281
|
b.takeoffEncodeChunk && (S ? e.canProcess || (l = Be("7uMV::{1}环境不支持实时处理", 0, e.envName)) : l = Be("2XBl::{1}类型不支持设置takeoffEncodeChunk", 0, Z) + (m[Z] ? "" : Be("LG7e::(未加载编码器)"))), !l && S && (l = m[Z + "_envCheck"](e, b));
|
|
2294
2282
|
}
|
|
@@ -2310,7 +2298,7 @@ var _a = {}, qr = {
|
|
|
2310
2298
|
m.state || m.CLog("envIn at state=0", 3);
|
|
2311
2299
|
return;
|
|
2312
2300
|
}
|
|
2313
|
-
var Z = m[Me], S = e.length, o =
|
|
2301
|
+
var Z = m[Me], S = e.length, o = R.PowerLevel(l, S), ee = m.buffers, se = ee.length;
|
|
2314
2302
|
ee.push(e);
|
|
2315
2303
|
var ye = ee, xe = se, le = Date.now(), fe = Math.round(S / Z * 1e3);
|
|
2316
2304
|
m.envInLast = le, m.buffers.length == 1 && (m.envInFirst = le - fe);
|
|
@@ -2324,8 +2312,8 @@ var _a = {}, qr = {
|
|
|
2324
2312
|
}
|
|
2325
2313
|
ue = Ne.t, X += Ne.d;
|
|
2326
2314
|
}
|
|
2327
|
-
var Q = Ae[1], ne = le - ue,
|
|
2328
|
-
if (
|
|
2315
|
+
var Q = Ae[1], ne = le - ue, d = ne - X;
|
|
2316
|
+
if (d > ne / 3 && (Q && ne > 1e3 || Ae.length >= 6)) {
|
|
2329
2317
|
var N = le - Q.t - fe;
|
|
2330
2318
|
if (N > fe / 5) {
|
|
2331
2319
|
var V = !b.disableEnvInFix;
|
|
@@ -2337,7 +2325,7 @@ var _a = {}, qr = {
|
|
|
2337
2325
|
}
|
|
2338
2326
|
var ce = m.recSize, g = S, H = ce + g;
|
|
2339
2327
|
if (m.recSize = H, D) {
|
|
2340
|
-
var oe =
|
|
2328
|
+
var oe = R.SampleData(ee, Z, b[De], D.chunkInfo);
|
|
2341
2329
|
D.chunkInfo = oe, ce = D.pcmSize, g = oe.data.length, H = ce + g, D.pcmSize = H, ee = D.pcmDatas, se = ee.length, ee.push(oe.data), Z = oe[De];
|
|
2342
2330
|
}
|
|
2343
2331
|
var z = Math.round(H / Z * 1e3), re = ee.length, j = ye.length, _e = function() {
|
|
@@ -2367,7 +2355,7 @@ var _a = {}, qr = {
|
|
|
2367
2355
|
},
|
|
2368
2356
|
start: function() {
|
|
2369
2357
|
var e = this, l = 1;
|
|
2370
|
-
if (e.set.sourceStream ? e.Stream || (l = 0) :
|
|
2358
|
+
if (e.set.sourceStream ? e.Stream || (l = 0) : R.IsOpen() || (l = 0), !l) {
|
|
2371
2359
|
e.CLog(Be("6WmN::start失败:未open"), 1);
|
|
2372
2360
|
return;
|
|
2373
2361
|
}
|
|
@@ -2412,8 +2400,8 @@ var _a = {}, qr = {
|
|
|
2412
2400
|
}, se = function(Ne) {
|
|
2413
2401
|
b.CLog(Be("u8JG::结束录音失败:") + Ne, 1), l && l(Ne), ee();
|
|
2414
2402
|
}, ye = function(Ne, Q, ne) {
|
|
2415
|
-
var
|
|
2416
|
-
if (ce == N ? H || (oe = 1) : ce ==
|
|
2403
|
+
var d = "blob", N = "arraybuffer", V = "dataType", T = "DefaultDataType", ce = b[V] || R[T] || d, g = V + "=" + ce, H = Ne instanceof ArrayBuffer, oe = 0, z = H ? Ne.byteLength : Ne.size;
|
|
2404
|
+
if (ce == N ? H || (oe = 1) : ce == d ? typeof Blob != "function" ? oe = Be.G("NonBrowser-1", [g]) + Be("1skY::,请设置{1}", 0, ve + "." + T + '="' + N + '"') : (H && (Ne = new Blob([Ne], { type: Q })), Ne instanceof Blob || (oe = 1), Q = Ne.type || Q) : oe = Be.G("NotSupport-1", [g]), b.CLog(Be("Wv7l::结束录音 编码花{1}ms 音频时长{2}ms 文件大小{3}b", 0, Date.now() - Z, ne, z) + " " + g + "," + Q), oe) {
|
|
2417
2405
|
se(oe != 1 ? oe : Be("Vkbd::{1}编码器返回的不是{2}", 0, D.type, ce) + ", " + g);
|
|
2418
2406
|
return;
|
|
2419
2407
|
}
|
|
@@ -2461,7 +2449,7 @@ var _a = {}, qr = {
|
|
|
2461
2449
|
se(Be("xkKd::音频buffers被释放"));
|
|
2462
2450
|
return;
|
|
2463
2451
|
}
|
|
2464
|
-
var ue =
|
|
2452
|
+
var ue = R.SampleData(b.buffers, b[Me], D[De]);
|
|
2465
2453
|
D[De] = ue[De];
|
|
2466
2454
|
var X = ue.data, pe = Math.round(X.length / D[De] * 1e3);
|
|
2467
2455
|
b.CLog(Be("CxeT::采样:{1} 花:{2}ms", 0, le + "->" + X.length, Date.now() - Z)), setTimeout(function() {
|
|
@@ -2503,12 +2491,12 @@ var _a = {}, qr = {
|
|
|
2503
2491
|
Ae.codec = Q;
|
|
2504
2492
|
} else if (at(ue, [225]))
|
|
2505
2493
|
for (; pe[0] < X.length; ) {
|
|
2506
|
-
var
|
|
2507
|
-
if (at(
|
|
2494
|
+
var d = vt(X, pe), N = _t(X, pe);
|
|
2495
|
+
if (at(d, [181])) {
|
|
2508
2496
|
var Ne = 0, V = new Uint8Array(N.reverse()).buffer;
|
|
2509
2497
|
N.length == 4 ? Ne = new Float32Array(V)[0] : N.length == 8 ? Ne = new Float64Array(V)[0] : He("WebM Track !Float", 1, N), Ae[De] = Math.round(Ne);
|
|
2510
2498
|
} else
|
|
2511
|
-
at(
|
|
2499
|
+
at(d, [98, 100]) ? Ae.bitDepth = et(N) : at(d, [159]) && (Ae.channels = et(N));
|
|
2512
2500
|
}
|
|
2513
2501
|
}
|
|
2514
2502
|
}
|
|
@@ -2591,7 +2579,7 @@ var _a = {}, qr = {
|
|
|
2591
2579
|
}
|
|
2592
2580
|
return l[0] = D, Z;
|
|
2593
2581
|
}
|
|
2594
|
-
}, ct =
|
|
2582
|
+
}, ct = R.i18n = {
|
|
2595
2583
|
lang: "zh-CN",
|
|
2596
2584
|
alias: { "zh-CN": "zh", "en-US": "en" },
|
|
2597
2585
|
locales: {},
|
|
@@ -2657,48 +2645,48 @@ var _a = {}, qr = {
|
|
|
2657
2645
|
return l ? b > 0 ? l : ct.v_G(l, m) : "";
|
|
2658
2646
|
}
|
|
2659
2647
|
}, Be = ct.$T;
|
|
2660
|
-
Be.G = ct.get, Be("NonBrowser-1::非浏览器环境,不支持{1}", 1), Be("IllegalArgs-1::参数错误:{1}", 1), Be("NeedImport-2::调用{1}需要先导入{2}", 2), Be("NotSupport-1::不支持:{1}", 1),
|
|
2661
|
-
var L =
|
|
2662
|
-
if (
|
|
2648
|
+
Be.G = ct.get, Be("NonBrowser-1::非浏览器环境,不支持{1}", 1), Be("IllegalArgs-1::参数错误:{1}", 1), Be("NeedImport-2::调用{1}需要先导入{2}", 2), Be("NotSupport-1::不支持:{1}", 1), R.TrafficImgUrl = "//ia.51.la/go1?id=20469973&pvFlag=1";
|
|
2649
|
+
var L = R.Traffic = function(e) {
|
|
2650
|
+
if (f) {
|
|
2663
2651
|
e = e ? "/" + ve + "/Report/" + e : "";
|
|
2664
|
-
var l =
|
|
2652
|
+
var l = R.TrafficImgUrl;
|
|
2665
2653
|
if (l) {
|
|
2666
|
-
var m =
|
|
2654
|
+
var m = R.Traffic, b = /^(https?:..[^\/#]*\/?)[^#]*/i.exec(location.href) || [], D = b[1] || "http://file/", Z = (b[0] || D) + e;
|
|
2667
2655
|
if (l.indexOf("//") == 0 && (/^https:/i.test(Z) ? l = "https:" + l : l = "http:" + l), e && (l = l + "&cu=" + encodeURIComponent(D + e)), !m[Z]) {
|
|
2668
2656
|
m[Z] = 1;
|
|
2669
2657
|
var S = new Image();
|
|
2670
|
-
S.src = l, He("Traffic Analysis Image: " + (e || ve + ".TrafficImgUrl=" +
|
|
2658
|
+
S.src = l, He("Traffic Analysis Image: " + (e || ve + ".TrafficImgUrl=" + R.TrafficImgUrl));
|
|
2671
2659
|
}
|
|
2672
2660
|
}
|
|
2673
2661
|
}
|
|
2674
2662
|
};
|
|
2675
|
-
te && (He(Be("8HO5::覆盖导入{1}", 0, ve), 1), te.Destroy()), t[ve] =
|
|
2663
|
+
te && (He(Be("8HO5::覆盖导入{1}", 0, ve), 1), te.Destroy()), t[ve] = R;
|
|
2676
2664
|
});
|
|
2677
2665
|
})(qr);
|
|
2678
2666
|
const ua = _a;
|
|
2679
2667
|
(function(s) {
|
|
2680
|
-
var t = typeof window == "object" && !!window.document,
|
|
2668
|
+
var t = typeof window == "object" && !!window.document, f = t ? window : Object, h = f.Recorder, U = h.i18n;
|
|
2681
2669
|
s(h, U, U.$T, t);
|
|
2682
|
-
})(function(s, t,
|
|
2683
|
-
var U = "48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000",
|
|
2670
|
+
})(function(s, t, f, h) {
|
|
2671
|
+
var U = "48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000", R = "8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 192, 224, 256, 320";
|
|
2684
2672
|
s.prototype.enc_mp3 = {
|
|
2685
2673
|
stable: !0,
|
|
2686
2674
|
takeEC: "full",
|
|
2687
2675
|
getTestMsg: function() {
|
|
2688
|
-
return
|
|
2676
|
+
return f("Zm7L::采样率范围:{1};比特率范围:{2}(不同比特率支持的采样率范围不同,小于32kbps时采样率需小于32000)", 0, U, R);
|
|
2689
2677
|
}
|
|
2690
2678
|
};
|
|
2691
2679
|
var Y = function(te) {
|
|
2692
2680
|
var ie = te.bitRate, we = te.sampleRate, Ue = we;
|
|
2693
|
-
if ((" " +
|
|
2681
|
+
if ((" " + R + ",").indexOf(" " + ie + ",") == -1 && s.CLog(f("eGB9::{1}不在mp3支持的取值范围:{2}", 0, "bitRate=" + ie, R), 3), (" " + U + ",").indexOf(" " + we + ",") == -1) {
|
|
2694
2682
|
for (var E = U.split(", "), he = [], Te = 0; Te < E.length; Te++)
|
|
2695
2683
|
he.push({ v: +E[Te], s: Math.abs(E[Te] - we) });
|
|
2696
2684
|
he.sort(function(Fe, Qe) {
|
|
2697
2685
|
return Fe.s - Qe.s;
|
|
2698
|
-
}), Ue = he[0].v, te.sampleRate = Ue, s.CLog(
|
|
2686
|
+
}), Ue = he[0].v, te.sampleRate = Ue, s.CLog(f("zLTa::sampleRate已更新为{1},因为{2}不在mp3支持的取值范围:{3}", 0, Ue, we, U), 3);
|
|
2699
2687
|
}
|
|
2700
2688
|
}, K = function() {
|
|
2701
|
-
return
|
|
2689
|
+
return f.G("NeedImport-2", ["mp3.js", "src/engine/mp3-engine.js"]);
|
|
2702
2690
|
}, ve = h && typeof Worker == "function";
|
|
2703
2691
|
s.prototype.mp3 = function(te, ie, we) {
|
|
2704
2692
|
var Ue = this, E = Ue.set, he = te.length;
|
|
@@ -2749,7 +2737,7 @@ const ua = _a;
|
|
|
2749
2737
|
be && (s.CLog("mp3Worker Destroy"), be.terminate(), be = null);
|
|
2750
2738
|
}), s.prototype.mp3_envCheck = function(te, ie) {
|
|
2751
2739
|
var we = "";
|
|
2752
|
-
return ie.takeoffEncodeChunk && (De() || (we =
|
|
2740
|
+
return ie.takeoffEncodeChunk && (De() || (we = f("yhUs::当前浏览器版本太低,无法实时处理"))), !we && !s.lamejs && (we = K()), we;
|
|
2753
2741
|
}, s.prototype.mp3_start = function(te) {
|
|
2754
2742
|
return De(te);
|
|
2755
2743
|
};
|
|
@@ -2835,7 +2823,7 @@ const ua = _a;
|
|
|
2835
2823
|
}), Xe;
|
|
2836
2824
|
}, he, Te = be;
|
|
2837
2825
|
if (ie || !ve)
|
|
2838
|
-
return s.CLog(
|
|
2826
|
+
return s.CLog(f("k9PT::当前环境不支持Web Worker,mp3实时编码器运行在主线程中"), 3), Te = { postMessage: function(Xe) {
|
|
2839
2827
|
we({ data: Xe });
|
|
2840
2828
|
} }, he = { wkScope: {
|
|
2841
2829
|
wk_ctxs: {},
|
|
@@ -2868,7 +2856,7 @@ const ua = _a;
|
|
|
2868
2856
|
var ie = -1;
|
|
2869
2857
|
for (var we in Me)
|
|
2870
2858
|
ie++;
|
|
2871
|
-
ie && s.CLog(
|
|
2859
|
+
ie && s.CLog(f("fT6M::mp3 worker剩{1}个未stop", 0, ie), 3);
|
|
2872
2860
|
}
|
|
2873
2861
|
}, s.prototype.mp3_encode = function(te, ie) {
|
|
2874
2862
|
te && te.worker && te.worker.postMessage({
|
|
@@ -2883,7 +2871,7 @@ const ua = _a;
|
|
|
2883
2871
|
}, te.worker.postMessage({
|
|
2884
2872
|
action: "complete",
|
|
2885
2873
|
id: te.id
|
|
2886
|
-
})) : we(
|
|
2874
|
+
})) : we(f("mPxH::mp3编码器未start"));
|
|
2887
2875
|
}, s.mp3ReadMeta = function(te, ie) {
|
|
2888
2876
|
var we = typeof window < "u" && window.parseInt || typeof self < "u" && self.parseInt || parseInt, Ue = new Uint8Array(te[0] || []);
|
|
2889
2877
|
if (Ue.length < 4)
|
|
@@ -2960,119 +2948,119 @@ const ua = _a;
|
|
|
2960
2948
|
}
|
|
2961
2949
|
}, Ce = function(te, ie) {
|
|
2962
2950
|
var we = "MP3 Info: ";
|
|
2963
|
-
(te.sampleRate && te.sampleRate != ie.sampleRate || te.bitRate && te.bitRate != ie.bitRate) && (s.CLog(we +
|
|
2951
|
+
(te.sampleRate && te.sampleRate != ie.sampleRate || te.bitRate && te.bitRate != ie.bitRate) && (s.CLog(we + f("uY9i::和设置的不匹配{1},已更新成{2}", 0, "set:" + ie.bitRate + "kbps " + ie.sampleRate + "hz", "set:" + te.bitRate + "kbps " + te.sampleRate + "hz"), 3, ie), ie.sampleRate = te.sampleRate, ie.bitRate = te.bitRate);
|
|
2964
2952
|
var Ue = te.trimFix;
|
|
2965
|
-
Ue ? (we +=
|
|
2953
|
+
Ue ? (we += f("iMSm::Fix移除{1}帧", 0, Ue.remove) + " " + Ue.removeDuration + "ms -> " + Ue.duration + "ms", Ue.remove > 2 && (te.err = (te.err ? te.err + ", " : "") + f("b9zm::移除帧数过多"))) : we += (te.duration || "-") + "ms", te.err ? s.CLog(we, 1, te.err, te) : s.CLog(we, te);
|
|
2966
2954
|
};
|
|
2967
2955
|
});
|
|
2968
2956
|
(function(s) {
|
|
2969
|
-
var t = typeof window == "object" && !!window.document,
|
|
2957
|
+
var t = typeof window == "object" && !!window.document, f = t ? window : Object, h = f.Recorder;
|
|
2970
2958
|
s(h);
|
|
2971
2959
|
})(function(s) {
|
|
2972
2960
|
function t() {
|
|
2973
|
-
var
|
|
2974
|
-
return Math.log(
|
|
2975
|
-
}, h = function(
|
|
2976
|
-
throw new Error("abort(" +
|
|
2961
|
+
var f = function(d) {
|
|
2962
|
+
return Math.log(d) / Math.log(10);
|
|
2963
|
+
}, h = function(d) {
|
|
2964
|
+
throw new Error("abort(" + d + ")");
|
|
2977
2965
|
};
|
|
2978
|
-
function U(
|
|
2979
|
-
return new Int8Array(
|
|
2966
|
+
function U(d) {
|
|
2967
|
+
return new Int8Array(d);
|
|
2980
2968
|
}
|
|
2981
|
-
function
|
|
2982
|
-
return new Int16Array(
|
|
2969
|
+
function R(d) {
|
|
2970
|
+
return new Int16Array(d);
|
|
2983
2971
|
}
|
|
2984
|
-
function Y(
|
|
2985
|
-
return new Int32Array(
|
|
2972
|
+
function Y(d) {
|
|
2973
|
+
return new Int32Array(d);
|
|
2986
2974
|
}
|
|
2987
|
-
function K(
|
|
2988
|
-
return new Float32Array(
|
|
2975
|
+
function K(d) {
|
|
2976
|
+
return new Float32Array(d);
|
|
2989
2977
|
}
|
|
2990
|
-
function ve(
|
|
2991
|
-
return new Float64Array(
|
|
2978
|
+
function ve(d) {
|
|
2979
|
+
return new Float64Array(d);
|
|
2992
2980
|
}
|
|
2993
|
-
function be(
|
|
2994
|
-
if (
|
|
2995
|
-
return K(
|
|
2996
|
-
var N =
|
|
2997
|
-
|
|
2981
|
+
function be(d) {
|
|
2982
|
+
if (d.length == 1)
|
|
2983
|
+
return K(d[0]);
|
|
2984
|
+
var N = d[0];
|
|
2985
|
+
d = d.slice(1);
|
|
2998
2986
|
for (var V = [], T = 0; T < N; T++)
|
|
2999
|
-
V.push(be(
|
|
2987
|
+
V.push(be(d));
|
|
3000
2988
|
return V;
|
|
3001
2989
|
}
|
|
3002
|
-
function Me(
|
|
3003
|
-
if (
|
|
3004
|
-
return Y(
|
|
3005
|
-
var N =
|
|
3006
|
-
|
|
2990
|
+
function Me(d) {
|
|
2991
|
+
if (d.length == 1)
|
|
2992
|
+
return Y(d[0]);
|
|
2993
|
+
var N = d[0];
|
|
2994
|
+
d = d.slice(1);
|
|
3007
2995
|
for (var V = [], T = 0; T < N; T++)
|
|
3008
|
-
V.push(Me(
|
|
2996
|
+
V.push(Me(d));
|
|
3009
2997
|
return V;
|
|
3010
2998
|
}
|
|
3011
|
-
function De(
|
|
3012
|
-
if (
|
|
3013
|
-
return
|
|
3014
|
-
var N =
|
|
3015
|
-
|
|
2999
|
+
function De(d) {
|
|
3000
|
+
if (d.length == 1)
|
|
3001
|
+
return R(d[0]);
|
|
3002
|
+
var N = d[0];
|
|
3003
|
+
d = d.slice(1);
|
|
3016
3004
|
for (var V = [], T = 0; T < N; T++)
|
|
3017
|
-
V.push(De(
|
|
3005
|
+
V.push(De(d));
|
|
3018
3006
|
return V;
|
|
3019
3007
|
}
|
|
3020
|
-
function Ee(
|
|
3021
|
-
if (
|
|
3022
|
-
return new Array(
|
|
3023
|
-
var N =
|
|
3024
|
-
|
|
3008
|
+
function Ee(d) {
|
|
3009
|
+
if (d.length == 1)
|
|
3010
|
+
return new Array(d[0]);
|
|
3011
|
+
var N = d[0];
|
|
3012
|
+
d = d.slice(1);
|
|
3025
3013
|
for (var V = [], T = 0; T < N; T++)
|
|
3026
|
-
V.push(Ee(
|
|
3014
|
+
V.push(Ee(d));
|
|
3027
3015
|
return V;
|
|
3028
3016
|
}
|
|
3029
3017
|
var Ce = {};
|
|
3030
|
-
Ce.fill = function(
|
|
3018
|
+
Ce.fill = function(d, N, V, T) {
|
|
3031
3019
|
if (arguments.length == 2)
|
|
3032
|
-
for (var ce = 0; ce <
|
|
3033
|
-
|
|
3020
|
+
for (var ce = 0; ce < d.length; ce++)
|
|
3021
|
+
d[ce] = arguments[1];
|
|
3034
3022
|
else
|
|
3035
3023
|
for (var ce = N; ce < V; ce++)
|
|
3036
|
-
|
|
3024
|
+
d[ce] = T;
|
|
3037
3025
|
};
|
|
3038
3026
|
var te = {};
|
|
3039
|
-
te.arraycopy = function(
|
|
3027
|
+
te.arraycopy = function(d, N, V, T, ce) {
|
|
3040
3028
|
for (var g = N + ce; N < g; )
|
|
3041
|
-
V[T++] =
|
|
3029
|
+
V[T++] = d[N++];
|
|
3042
3030
|
};
|
|
3043
3031
|
var ie = {};
|
|
3044
|
-
ie.SQRT2 = 1.4142135623730951, ie.FAST_LOG10 = function(
|
|
3045
|
-
return
|
|
3046
|
-
}, ie.FAST_LOG10_X = function(
|
|
3047
|
-
return
|
|
3032
|
+
ie.SQRT2 = 1.4142135623730951, ie.FAST_LOG10 = function(d) {
|
|
3033
|
+
return f(d);
|
|
3034
|
+
}, ie.FAST_LOG10_X = function(d, N) {
|
|
3035
|
+
return f(d) * N;
|
|
3048
3036
|
};
|
|
3049
|
-
function we(
|
|
3050
|
-
this.ordinal =
|
|
3037
|
+
function we(d) {
|
|
3038
|
+
this.ordinal = d;
|
|
3051
3039
|
}
|
|
3052
3040
|
we.short_block_allowed = new we(0), we.short_block_coupled = new we(1), we.short_block_dispensed = new we(2), we.short_block_forced = new we(3);
|
|
3053
3041
|
var Ue = {};
|
|
3054
3042
|
Ue.MAX_VALUE = 34028235e31;
|
|
3055
|
-
function E(
|
|
3056
|
-
this.ordinal =
|
|
3043
|
+
function E(d) {
|
|
3044
|
+
this.ordinal = d;
|
|
3057
3045
|
}
|
|
3058
3046
|
E.vbr_off = new E(0), E.vbr_mt = new E(1), E.vbr_rh = new E(2), E.vbr_abr = new E(3), E.vbr_mtrh = new E(4), E.vbr_default = E.vbr_mtrh;
|
|
3059
|
-
function he(
|
|
3060
|
-
var N =
|
|
3047
|
+
function he(d) {
|
|
3048
|
+
var N = d;
|
|
3061
3049
|
this.ordinal = function() {
|
|
3062
3050
|
return N;
|
|
3063
3051
|
};
|
|
3064
3052
|
}
|
|
3065
3053
|
he.STEREO = new he(0), he.JOINT_STEREO = new he(1), he.DUAL_CHANNEL = new he(2), he.MONO = new he(3), he.NOT_SET = new he(4);
|
|
3066
3054
|
function Te() {
|
|
3067
|
-
var
|
|
3055
|
+
var d = 3, N = 98, V = 4;
|
|
3068
3056
|
this.getLameShortVersion = function() {
|
|
3069
|
-
return
|
|
3057
|
+
return d + "." + N + "." + V;
|
|
3070
3058
|
};
|
|
3071
3059
|
}
|
|
3072
3060
|
function Fe() {
|
|
3073
|
-
var
|
|
3061
|
+
var d = null;
|
|
3074
3062
|
this.qupvt = null, this.setModules = function(v) {
|
|
3075
|
-
this.qupvt = v,
|
|
3063
|
+
this.qupvt = v, d = v;
|
|
3076
3064
|
};
|
|
3077
3065
|
function N(v) {
|
|
3078
3066
|
this.bits = 0 | v;
|
|
@@ -3125,28 +3113,28 @@ const ua = _a;
|
|
|
3125
3113
|
[6, 7]
|
|
3126
3114
|
/* 22 bands */
|
|
3127
3115
|
];
|
|
3128
|
-
function T(v, p, M, x,
|
|
3116
|
+
function T(v, p, M, x, I, r) {
|
|
3129
3117
|
var i = 0.5946 / p;
|
|
3130
3118
|
for (v = v >> 1; v-- != 0; )
|
|
3131
|
-
|
|
3119
|
+
I[r++] = i > M[x++] ? 0 : 1, I[r++] = i > M[x++] ? 0 : 1;
|
|
3132
3120
|
}
|
|
3133
|
-
function ce(v, p, M, x,
|
|
3121
|
+
function ce(v, p, M, x, I, r) {
|
|
3134
3122
|
v = v >> 1;
|
|
3135
3123
|
var i = v % 2;
|
|
3136
3124
|
for (v = v >> 1; v-- != 0; ) {
|
|
3137
3125
|
var q, B, $, de, ge, Se, Ye, $e;
|
|
3138
|
-
q = M[x++] * p, B = M[x++] * p, ge = 0 | q, $ = M[x++] * p, Se = 0 | B, de = M[x++] * p, Ye = 0 | $, q +=
|
|
3126
|
+
q = M[x++] * p, B = M[x++] * p, ge = 0 | q, $ = M[x++] * p, Se = 0 | B, de = M[x++] * p, Ye = 0 | $, q += d.adj43[ge], $e = 0 | de, B += d.adj43[Se], I[r++] = 0 | q, $ += d.adj43[Ye], I[r++] = 0 | B, de += d.adj43[$e], I[r++] = 0 | $, I[r++] = 0 | de;
|
|
3139
3127
|
}
|
|
3140
3128
|
if (i != 0) {
|
|
3141
3129
|
var q, B, ge, Se;
|
|
3142
|
-
q = M[x++] * p, B = M[x++] * p, ge = 0 | q, Se = 0 | B, q +=
|
|
3130
|
+
q = M[x++] * p, B = M[x++] * p, ge = 0 | q, Se = 0 | B, q += d.adj43[ge], B += d.adj43[Se], I[r++] = 0 | q, I[r++] = 0 | B;
|
|
3143
3131
|
}
|
|
3144
3132
|
}
|
|
3145
|
-
function g(v, p, M, x,
|
|
3133
|
+
function g(v, p, M, x, I) {
|
|
3146
3134
|
var r, i, q = 0, B, $ = 0, de = 0, ge = 0, Se = p, Ye = 0, $e = Se, Ve = 0, mt = v, bt = 0;
|
|
3147
|
-
for (B =
|
|
3135
|
+
for (B = I != null && x.global_gain == I.global_gain, x.block_type == o.SHORT_TYPE ? i = 38 : i = 21, r = 0; r <= i; r++) {
|
|
3148
3136
|
var lt = -1;
|
|
3149
|
-
if ((B || x.block_type == o.NORM_TYPE) && (lt = x.global_gain - (x.scalefac[r] + (x.preflag != 0 ?
|
|
3137
|
+
if ((B || x.block_type == o.NORM_TYPE) && (lt = x.global_gain - (x.scalefac[r] + (x.preflag != 0 ? d.pretab[r] : 0) << x.scalefac_scale + 1) - x.subblock_gain[x.window[r]] * 8), B && I.step[r] == lt)
|
|
3150
3138
|
$ != 0 && (ce(
|
|
3151
3139
|
$,
|
|
3152
3140
|
M,
|
|
@@ -3161,7 +3149,7 @@ const ua = _a;
|
|
|
3161
3149
|
var gt;
|
|
3162
3150
|
gt = x.max_nonzero_coeff - q + 1, Ce.fill(p, x.max_nonzero_coeff, 576, 0), ft = gt, ft < 0 && (ft = 0), r = i + 1;
|
|
3163
3151
|
}
|
|
3164
|
-
if ($ == 0 && de == 0 && ($e = Se, Ve = Ye, mt = v, bt = ge),
|
|
3152
|
+
if ($ == 0 && de == 0 && ($e = Se, Ve = Ye, mt = v, bt = ge), I != null && I.sfb_count1 > 0 && r >= I.sfb_count1 && I.step[r] > 0 && lt >= I.step[r] ? ($ != 0 && (ce(
|
|
3165
3153
|
$,
|
|
3166
3154
|
M,
|
|
3167
3155
|
mt,
|
|
@@ -3192,46 +3180,46 @@ const ua = _a;
|
|
|
3192
3180
|
), $ = 0), de != 0 && h();
|
|
3193
3181
|
}
|
|
3194
3182
|
function H(v, p, M) {
|
|
3195
|
-
var x = 0,
|
|
3183
|
+
var x = 0, I = 0;
|
|
3196
3184
|
do {
|
|
3197
3185
|
var r = v[p++], i = v[p++];
|
|
3198
|
-
x < r && (x = r),
|
|
3186
|
+
x < r && (x = r), I < i && (I = i);
|
|
3199
3187
|
} while (p < M);
|
|
3200
|
-
return x <
|
|
3188
|
+
return x < I && (x = I), x;
|
|
3201
3189
|
}
|
|
3202
|
-
function oe(v, p, M, x,
|
|
3203
|
-
var i = W.ht[x].xlen * 65536 + W.ht[
|
|
3190
|
+
function oe(v, p, M, x, I, r) {
|
|
3191
|
+
var i = W.ht[x].xlen * 65536 + W.ht[I].xlen, q = 0, B;
|
|
3204
3192
|
do {
|
|
3205
3193
|
var $ = v[p++], de = v[p++];
|
|
3206
3194
|
$ != 0 && ($ > 14 && ($ = 15, q += i), $ *= 16), de != 0 && (de > 14 && (de = 15, q += i), $ += de), q += W.largetbl[$];
|
|
3207
3195
|
} while (p < M);
|
|
3208
|
-
return B = q & 65535, q >>= 16, q > B && (q = B, x =
|
|
3196
|
+
return B = q & 65535, q >>= 16, q > B && (q = B, x = I), r.bits += q, x;
|
|
3209
3197
|
}
|
|
3210
3198
|
function z(v, p, M, x) {
|
|
3211
|
-
var
|
|
3199
|
+
var I = 0, r = W.ht[1].hlen;
|
|
3212
3200
|
do {
|
|
3213
3201
|
var i = v[p + 0] * 2 + v[p + 1];
|
|
3214
|
-
p += 2,
|
|
3202
|
+
p += 2, I += r[i];
|
|
3215
3203
|
} while (p < M);
|
|
3216
|
-
return x.bits +=
|
|
3204
|
+
return x.bits += I, 1;
|
|
3217
3205
|
}
|
|
3218
|
-
function re(v, p, M, x,
|
|
3206
|
+
function re(v, p, M, x, I) {
|
|
3219
3207
|
var r = 0, i, q = W.ht[x].xlen, B;
|
|
3220
3208
|
x == 2 ? B = W.table23 : B = W.table56;
|
|
3221
3209
|
do {
|
|
3222
3210
|
var $ = v[p + 0] * q + v[p + 1];
|
|
3223
3211
|
p += 2, r += B[$];
|
|
3224
3212
|
} while (p < M);
|
|
3225
|
-
return i = r & 65535, r >>= 16, r > i && (r = i, x++),
|
|
3213
|
+
return i = r & 65535, r >>= 16, r > i && (r = i, x++), I.bits += r, x;
|
|
3226
3214
|
}
|
|
3227
|
-
function j(v, p, M, x,
|
|
3215
|
+
function j(v, p, M, x, I) {
|
|
3228
3216
|
var r = 0, i = 0, q = 0, B = W.ht[x].xlen, $ = W.ht[x].hlen, de = W.ht[x + 1].hlen, ge = W.ht[x + 2].hlen;
|
|
3229
3217
|
do {
|
|
3230
3218
|
var Se = v[p + 0] * B + v[p + 1];
|
|
3231
3219
|
p += 2, r += $[Se], i += de[Se], q += ge[Se];
|
|
3232
3220
|
} while (p < M);
|
|
3233
3221
|
var Ye = x;
|
|
3234
|
-
return r > i && (r = i, Ye++), r > q && (r = q, Ye = x + 2),
|
|
3222
|
+
return r > i && (r = i, Ye++), r > q && (r = q, Ye = x + 2), I.bits += r, Ye;
|
|
3235
3223
|
}
|
|
3236
3224
|
var _e = [
|
|
3237
3225
|
1,
|
|
@@ -3251,10 +3239,10 @@ const ua = _a;
|
|
|
3251
3239
|
13
|
|
3252
3240
|
];
|
|
3253
3241
|
function k(v, p, M, x) {
|
|
3254
|
-
var
|
|
3255
|
-
switch (
|
|
3242
|
+
var I = H(v, p, M);
|
|
3243
|
+
switch (I) {
|
|
3256
3244
|
case 0:
|
|
3257
|
-
return
|
|
3245
|
+
return I;
|
|
3258
3246
|
case 1:
|
|
3259
3247
|
return z(v, p, M, x);
|
|
3260
3248
|
case 2:
|
|
@@ -3263,7 +3251,7 @@ const ua = _a;
|
|
|
3263
3251
|
v,
|
|
3264
3252
|
p,
|
|
3265
3253
|
M,
|
|
3266
|
-
_e[
|
|
3254
|
+
_e[I - 1],
|
|
3267
3255
|
x
|
|
3268
3256
|
);
|
|
3269
3257
|
case 4:
|
|
@@ -3282,44 +3270,44 @@ const ua = _a;
|
|
|
3282
3270
|
v,
|
|
3283
3271
|
p,
|
|
3284
3272
|
M,
|
|
3285
|
-
_e[
|
|
3273
|
+
_e[I - 1],
|
|
3286
3274
|
x
|
|
3287
3275
|
);
|
|
3288
3276
|
default:
|
|
3289
|
-
|
|
3277
|
+
I > e.IXMAX_VAL && h(), I -= 15;
|
|
3290
3278
|
var r;
|
|
3291
|
-
for (r = 24; r < 32 && !(W.ht[r].linmax >=
|
|
3279
|
+
for (r = 24; r < 32 && !(W.ht[r].linmax >= I); r++)
|
|
3292
3280
|
;
|
|
3293
3281
|
var i;
|
|
3294
|
-
for (i = r - 8; i < 24 && !(W.ht[i].linmax >=
|
|
3282
|
+
for (i = r - 8; i < 24 && !(W.ht[i].linmax >= I); i++)
|
|
3295
3283
|
;
|
|
3296
3284
|
return oe(v, p, M, i, r, x);
|
|
3297
3285
|
}
|
|
3298
3286
|
}
|
|
3299
3287
|
this.noquant_count_bits = function(v, p, M) {
|
|
3300
|
-
var x = p.l3_enc,
|
|
3301
|
-
for (M != null && (M.sfb_count1 = 0);
|
|
3288
|
+
var x = p.l3_enc, I = Math.min(576, p.max_nonzero_coeff + 2 >> 1 << 1);
|
|
3289
|
+
for (M != null && (M.sfb_count1 = 0); I > 1 && !(x[I - 1] | x[I - 2]); I -= 2)
|
|
3302
3290
|
;
|
|
3303
|
-
p.count1 =
|
|
3304
|
-
for (var r = 0, i = 0;
|
|
3291
|
+
p.count1 = I;
|
|
3292
|
+
for (var r = 0, i = 0; I > 3; I -= 4) {
|
|
3305
3293
|
var q;
|
|
3306
|
-
if (((x[
|
|
3294
|
+
if (((x[I - 1] | x[I - 2] | x[I - 3] | x[I - 4]) & 2147483647) > 1)
|
|
3307
3295
|
break;
|
|
3308
|
-
q = ((x[
|
|
3296
|
+
q = ((x[I - 4] * 2 + x[I - 3]) * 2 + x[I - 2]) * 2 + x[I - 1], r += W.t32l[q], i += W.t33l[q];
|
|
3309
3297
|
}
|
|
3310
3298
|
var B = r;
|
|
3311
|
-
if (p.count1table_select = 0, r > i && (B = i, p.count1table_select = 1), p.count1bits = B, p.big_values =
|
|
3299
|
+
if (p.count1table_select = 0, r > i && (B = i, p.count1table_select = 1), p.count1bits = B, p.big_values = I, I == 0)
|
|
3312
3300
|
return B;
|
|
3313
3301
|
if (p.block_type == o.SHORT_TYPE)
|
|
3314
3302
|
r = 3 * v.scalefac_band.s[3], r > p.big_values && (r = p.big_values), i = p.big_values;
|
|
3315
3303
|
else if (p.block_type == o.NORM_TYPE) {
|
|
3316
|
-
if (r = p.region0_count = v.bv_scf[
|
|
3304
|
+
if (r = p.region0_count = v.bv_scf[I - 2], i = p.region1_count = v.bv_scf[I - 1], i = v.scalefac_band.l[r + i + 2], r = v.scalefac_band.l[r + 1], i < I) {
|
|
3317
3305
|
var $ = new N(B);
|
|
3318
|
-
p.table_select[2] = k(x, i,
|
|
3306
|
+
p.table_select[2] = k(x, i, I, $), B = $.bits;
|
|
3319
3307
|
}
|
|
3320
3308
|
} else
|
|
3321
|
-
p.region0_count = 7, p.region1_count = o.SBMAX_l - 1 - 7 - 1, r = v.scalefac_band.l[7 + 1], i =
|
|
3322
|
-
if (r = Math.min(r,
|
|
3309
|
+
p.region0_count = 7, p.region1_count = o.SBMAX_l - 1 - 7 - 1, r = v.scalefac_band.l[7 + 1], i = I, r > i && (r = i);
|
|
3310
|
+
if (r = Math.min(r, I), i = Math.min(i, I), 0 < r) {
|
|
3323
3311
|
var $ = new N(B);
|
|
3324
3312
|
p.table_select[0] = k(x, 0, r, $), B = $.bits;
|
|
3325
3313
|
}
|
|
@@ -3334,10 +3322,10 @@ const ua = _a;
|
|
|
3334
3322
|
}
|
|
3335
3323
|
return B;
|
|
3336
3324
|
}, this.count_bits = function(v, p, M, x) {
|
|
3337
|
-
var
|
|
3338
|
-
return M.xrpow_max > r ? e.LARGE_BITS : (g(p,
|
|
3325
|
+
var I = M.l3_enc, r = e.IXMAX_VAL / d.IPOW20(M.global_gain);
|
|
3326
|
+
return M.xrpow_max > r ? e.LARGE_BITS : (g(p, I, d.IPOW20(M.global_gain), M, x), v.substep_shaping & 2 && h(), this.noquant_count_bits(v, M, x));
|
|
3339
3327
|
};
|
|
3340
|
-
function O(v, p, M, x,
|
|
3328
|
+
function O(v, p, M, x, I, r, i) {
|
|
3341
3329
|
for (var q = p.big_values, B = 0; B <= 7 + 15; B++)
|
|
3342
3330
|
x[B] = e.LARGE_BITS;
|
|
3343
3331
|
for (var B = 0; B < 16; B++) {
|
|
@@ -3353,16 +3341,16 @@ const ua = _a;
|
|
|
3353
3341
|
var Ve = de;
|
|
3354
3342
|
ge = new N(Ve);
|
|
3355
3343
|
var mt = k(M, $, $e, ge);
|
|
3356
|
-
Ve = ge.bits, x[B + Ye] > Ve && (x[B + Ye] = Ve,
|
|
3344
|
+
Ve = ge.bits, x[B + Ye] > Ve && (x[B + Ye] = Ve, I[B + Ye] = B, r[B + Ye] = Se, i[B + Ye] = mt);
|
|
3357
3345
|
}
|
|
3358
3346
|
}
|
|
3359
3347
|
}
|
|
3360
|
-
function a(v, p, M, x,
|
|
3348
|
+
function a(v, p, M, x, I, r, i, q) {
|
|
3361
3349
|
for (var B = p.big_values, $ = 2; $ < o.SBMAX_l + 1; $++) {
|
|
3362
3350
|
var de = v.scalefac_band.l[$];
|
|
3363
3351
|
if (de >= B)
|
|
3364
3352
|
break;
|
|
3365
|
-
var ge =
|
|
3353
|
+
var ge = I[$ - 2] + p.count1bits;
|
|
3366
3354
|
if (M.part2_3_length <= ge)
|
|
3367
3355
|
break;
|
|
3368
3356
|
var Se = new N(ge), Ye = k(x, de, B, Se);
|
|
@@ -3370,14 +3358,14 @@ const ua = _a;
|
|
|
3370
3358
|
}
|
|
3371
3359
|
}
|
|
3372
3360
|
this.best_huffman_divide = function(v, p) {
|
|
3373
|
-
var M = new m(), x = p.l3_enc,
|
|
3361
|
+
var M = new m(), x = p.l3_enc, I = Y(7 + 15 + 1), r = Y(7 + 15 + 1), i = Y(7 + 15 + 1), q = Y(7 + 15 + 1);
|
|
3374
3362
|
if (!(p.block_type == o.SHORT_TYPE && v.mode_gr == 1)) {
|
|
3375
|
-
M.assign(p), p.block_type == o.NORM_TYPE && (O(v, p, x,
|
|
3363
|
+
M.assign(p), p.block_type == o.NORM_TYPE && (O(v, p, x, I, r, i, q), a(
|
|
3376
3364
|
v,
|
|
3377
3365
|
M,
|
|
3378
3366
|
p,
|
|
3379
3367
|
x,
|
|
3380
|
-
|
|
3368
|
+
I,
|
|
3381
3369
|
r,
|
|
3382
3370
|
i,
|
|
3383
3371
|
q
|
|
@@ -3395,7 +3383,7 @@ const ua = _a;
|
|
|
3395
3383
|
M,
|
|
3396
3384
|
p,
|
|
3397
3385
|
x,
|
|
3398
|
-
|
|
3386
|
+
I,
|
|
3399
3387
|
r,
|
|
3400
3388
|
i,
|
|
3401
3389
|
q
|
|
@@ -3417,8 +3405,8 @@ const ua = _a;
|
|
|
3417
3405
|
var u = [1, 1, 1, 1, 8, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16], A = [1, 2, 4, 8, 1, 2, 4, 8, 2, 4, 8, 2, 4, 8, 4, 8], P = [0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4], y = [0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3];
|
|
3418
3406
|
Fe.slen1_tab = P, Fe.slen2_tab = y;
|
|
3419
3407
|
function _(v, p) {
|
|
3420
|
-
for (var M, x = p.tt[1][v],
|
|
3421
|
-
for (M = W.scfsi_band[r]; M < W.scfsi_band[r + 1] && !(
|
|
3408
|
+
for (var M, x = p.tt[1][v], I = p.tt[0][v], r = 0; r < W.scfsi_band.length - 1; r++) {
|
|
3409
|
+
for (M = W.scfsi_band[r]; M < W.scfsi_band[r + 1] && !(I.scalefac[M] != x.scalefac[M] && x.scalefac[M] >= 0); M++)
|
|
3422
3410
|
;
|
|
3423
3411
|
if (M == W.scfsi_band[r + 1]) {
|
|
3424
3412
|
for (M = W.scfsi_band[r]; M < W.scfsi_band[r + 1]; M++)
|
|
@@ -3438,37 +3426,37 @@ const ua = _a;
|
|
|
3438
3426
|
}
|
|
3439
3427
|
}
|
|
3440
3428
|
this.best_scalefac_store = function(v, p, M, x) {
|
|
3441
|
-
var
|
|
3442
|
-
for (q = 0, r = 0; r <
|
|
3443
|
-
var de =
|
|
3444
|
-
for (q += de, B = -de; B < 0 &&
|
|
3429
|
+
var I = x.tt[p][M], r, i, q, B, $ = 0;
|
|
3430
|
+
for (q = 0, r = 0; r < I.sfbmax; r++) {
|
|
3431
|
+
var de = I.width[r];
|
|
3432
|
+
for (q += de, B = -de; B < 0 && I.l3_enc[B + q] == 0; B++)
|
|
3445
3433
|
;
|
|
3446
|
-
B == 0 && (
|
|
3434
|
+
B == 0 && (I.scalefac[r] = $ = -2);
|
|
3447
3435
|
}
|
|
3448
|
-
if (
|
|
3436
|
+
if (I.scalefac_scale == 0 && I.preflag == 0) {
|
|
3449
3437
|
var ge = 0;
|
|
3450
|
-
for (r = 0; r <
|
|
3451
|
-
|
|
3438
|
+
for (r = 0; r < I.sfbmax; r++)
|
|
3439
|
+
I.scalefac[r] > 0 && (ge |= I.scalefac[r]);
|
|
3452
3440
|
if (!(ge & 1) && ge != 0) {
|
|
3453
|
-
for (r = 0; r <
|
|
3454
|
-
|
|
3455
|
-
|
|
3441
|
+
for (r = 0; r < I.sfbmax; r++)
|
|
3442
|
+
I.scalefac[r] > 0 && (I.scalefac[r] >>= 1);
|
|
3443
|
+
I.scalefac_scale = $ = 1;
|
|
3456
3444
|
}
|
|
3457
3445
|
}
|
|
3458
|
-
if (
|
|
3459
|
-
for (r = 11; r < o.SBPSY_l && !(
|
|
3446
|
+
if (I.preflag == 0 && I.block_type != o.SHORT_TYPE && v.mode_gr == 2) {
|
|
3447
|
+
for (r = 11; r < o.SBPSY_l && !(I.scalefac[r] < d.pretab[r] && I.scalefac[r] != -2); r++)
|
|
3460
3448
|
;
|
|
3461
3449
|
if (r == o.SBPSY_l) {
|
|
3462
3450
|
for (r = 11; r < o.SBPSY_l; r++)
|
|
3463
|
-
|
|
3464
|
-
|
|
3451
|
+
I.scalefac[r] > 0 && (I.scalefac[r] -= d.pretab[r]);
|
|
3452
|
+
I.preflag = $ = 1;
|
|
3465
3453
|
}
|
|
3466
3454
|
}
|
|
3467
3455
|
for (i = 0; i < 4; i++)
|
|
3468
3456
|
x.scfsi[M][i] = 0;
|
|
3469
|
-
for (v.mode_gr == 2 && p == 1 && x.tt[0][M].block_type != o.SHORT_TYPE && x.tt[1][M].block_type != o.SHORT_TYPE && (_(M, x), $ = 0), r = 0; r <
|
|
3470
|
-
|
|
3471
|
-
$ != 0 && (v.mode_gr == 2 ? this.scale_bitcount(
|
|
3457
|
+
for (v.mode_gr == 2 && p == 1 && x.tt[0][M].block_type != o.SHORT_TYPE && x.tt[1][M].block_type != o.SHORT_TYPE && (_(M, x), $ = 0), r = 0; r < I.sfbmax; r++)
|
|
3458
|
+
I.scalefac[r] == -2 && (I.scalefac[r] = 0);
|
|
3459
|
+
$ != 0 && (v.mode_gr == 2 ? this.scale_bitcount(I) : this.scale_bitcount_lsf(v, I));
|
|
3472
3460
|
};
|
|
3473
3461
|
var w = [
|
|
3474
3462
|
0,
|
|
@@ -3487,7 +3475,7 @@ const ua = _a;
|
|
|
3487
3475
|
108,
|
|
3488
3476
|
108,
|
|
3489
3477
|
126
|
|
3490
|
-
],
|
|
3478
|
+
], c = [
|
|
3491
3479
|
0,
|
|
3492
3480
|
18,
|
|
3493
3481
|
36,
|
|
@@ -3523,22 +3511,22 @@ const ua = _a;
|
|
|
3523
3511
|
74
|
|
3524
3512
|
];
|
|
3525
3513
|
this.scale_bitcount = function(v) {
|
|
3526
|
-
var p, M, x = 0,
|
|
3514
|
+
var p, M, x = 0, I = 0, r, i = v.scalefac;
|
|
3527
3515
|
if (v.block_type == o.SHORT_TYPE)
|
|
3528
|
-
r = w, v.mixed_block_flag != 0 && (r =
|
|
3516
|
+
r = w, v.mixed_block_flag != 0 && (r = c);
|
|
3529
3517
|
else if (r = C, v.preflag == 0) {
|
|
3530
|
-
for (M = 11; M < o.SBPSY_l && !(i[M] <
|
|
3518
|
+
for (M = 11; M < o.SBPSY_l && !(i[M] < d.pretab[M]); M++)
|
|
3531
3519
|
;
|
|
3532
3520
|
if (M == o.SBPSY_l)
|
|
3533
3521
|
for (v.preflag = 1, M = 11; M < o.SBPSY_l; M++)
|
|
3534
|
-
i[M] -=
|
|
3522
|
+
i[M] -= d.pretab[M];
|
|
3535
3523
|
}
|
|
3536
3524
|
for (M = 0; M < v.sfbdivide; M++)
|
|
3537
3525
|
x < i[M] && (x = i[M]);
|
|
3538
3526
|
for (; M < v.sfbmax; M++)
|
|
3539
|
-
|
|
3527
|
+
I < i[M] && (I = i[M]);
|
|
3540
3528
|
for (v.part2_length = e.LARGE_BITS, p = 0; p < 16; p++)
|
|
3541
|
-
x < u[p] &&
|
|
3529
|
+
x < u[p] && I < A[p] && v.part2_length > r[p] && (v.part2_length = r[p], v.scalefac_compress = p);
|
|
3542
3530
|
return v.part2_length == e.LARGE_BITS;
|
|
3543
3531
|
};
|
|
3544
3532
|
var n = [
|
|
@@ -3550,29 +3538,29 @@ const ua = _a;
|
|
|
3550
3538
|
[3, 3, 0, 0]
|
|
3551
3539
|
];
|
|
3552
3540
|
this.scale_bitcount_lsf = function(v, p) {
|
|
3553
|
-
var M, x,
|
|
3541
|
+
var M, x, I, r, i, q, B, $, de = Y(4), ge = p.scalefac;
|
|
3554
3542
|
for (p.preflag != 0 ? M = 2 : M = 0, B = 0; B < 4; B++)
|
|
3555
3543
|
de[B] = 0;
|
|
3556
3544
|
if (p.block_type == o.SHORT_TYPE) {
|
|
3557
3545
|
x = 1;
|
|
3558
|
-
var Se =
|
|
3559
|
-
for ($ = 0,
|
|
3560
|
-
for (r = Se[
|
|
3546
|
+
var Se = d.nr_of_sfb_block[M][x];
|
|
3547
|
+
for ($ = 0, I = 0; I < 4; I++)
|
|
3548
|
+
for (r = Se[I] / 3, B = 0; B < r; B++, $++)
|
|
3561
3549
|
for (i = 0; i < 3; i++)
|
|
3562
|
-
ge[$ * 3 + i] > de[
|
|
3550
|
+
ge[$ * 3 + i] > de[I] && (de[I] = ge[$ * 3 + i]);
|
|
3563
3551
|
} else {
|
|
3564
3552
|
x = 0;
|
|
3565
|
-
var Se =
|
|
3566
|
-
for ($ = 0,
|
|
3567
|
-
for (r = Se[
|
|
3568
|
-
ge[$] > de[
|
|
3553
|
+
var Se = d.nr_of_sfb_block[M][x];
|
|
3554
|
+
for ($ = 0, I = 0; I < 4; I++)
|
|
3555
|
+
for (r = Se[I], B = 0; B < r; B++, $++)
|
|
3556
|
+
ge[$] > de[I] && (de[I] = ge[$]);
|
|
3569
3557
|
}
|
|
3570
|
-
for (q = !1,
|
|
3571
|
-
de[
|
|
3558
|
+
for (q = !1, I = 0; I < 4; I++)
|
|
3559
|
+
de[I] > n[M][I] && (q = !0);
|
|
3572
3560
|
if (!q) {
|
|
3573
3561
|
var Ye, $e, Ve, mt;
|
|
3574
|
-
for (p.sfb_partition_table =
|
|
3575
|
-
p.slen[
|
|
3562
|
+
for (p.sfb_partition_table = d.nr_of_sfb_block[M][x], I = 0; I < 4; I++)
|
|
3563
|
+
p.slen[I] = G[de[I]];
|
|
3576
3564
|
switch (Ye = p.slen[0], $e = p.slen[1], Ve = p.slen[2], mt = p.slen[3], M) {
|
|
3577
3565
|
case 0:
|
|
3578
3566
|
p.scalefac_compress = (Ye * 5 + $e << 4) + (Ve << 2) + mt;
|
|
@@ -3586,8 +3574,8 @@ const ua = _a;
|
|
|
3586
3574
|
}
|
|
3587
3575
|
}
|
|
3588
3576
|
if (!q)
|
|
3589
|
-
for (p.part2_length = 0,
|
|
3590
|
-
p.part2_length += p.slen[
|
|
3577
|
+
for (p.part2_length = 0, I = 0; I < 4; I++)
|
|
3578
|
+
p.part2_length += p.slen[I] * p.sfb_partition_table[I];
|
|
3591
3579
|
return q;
|
|
3592
3580
|
};
|
|
3593
3581
|
var G = [
|
|
@@ -3624,7 +3612,7 @@ const ua = _a;
|
|
|
3624
3612
|
function Qe() {
|
|
3625
3613
|
}
|
|
3626
3614
|
function Ze() {
|
|
3627
|
-
function
|
|
3615
|
+
function d(g, H, oe, z, re, j, _e, k, O, a, u, A, P, y) {
|
|
3628
3616
|
this.quant_comp = H, this.quant_comp_s = oe, this.safejoint = z, this.nsmsfix = re, this.st_lrm = j, this.st_s = _e, this.nsbass = k, this.scale = O, this.masking_adj = a, this.ath_lower = u, this.ath_curve = A, this.interch = P, this.sfscale = y;
|
|
3629
3617
|
}
|
|
3630
3618
|
var N;
|
|
@@ -3635,39 +3623,39 @@ const ua = _a;
|
|
|
3635
3623
|
h();
|
|
3636
3624
|
}
|
|
3637
3625
|
var T = [
|
|
3638
|
-
new
|
|
3626
|
+
new d(8, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -30, 11, 12e-4, 1),
|
|
3639
3627
|
/* 8, impossible to use in stereo */
|
|
3640
|
-
new
|
|
3628
|
+
new d(16, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -25, 11, 1e-3, 1),
|
|
3641
3629
|
/* 16 */
|
|
3642
|
-
new
|
|
3630
|
+
new d(24, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -20, 11, 1e-3, 1),
|
|
3643
3631
|
/* 24 */
|
|
3644
|
-
new
|
|
3632
|
+
new d(32, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -15, 11, 1e-3, 1),
|
|
3645
3633
|
/* 32 */
|
|
3646
|
-
new
|
|
3634
|
+
new d(40, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -10, 11, 9e-4, 1),
|
|
3647
3635
|
/* 40 */
|
|
3648
|
-
new
|
|
3636
|
+
new d(48, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -10, 11, 9e-4, 1),
|
|
3649
3637
|
/* 48 */
|
|
3650
|
-
new
|
|
3638
|
+
new d(56, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -6, 11, 8e-4, 1),
|
|
3651
3639
|
/* 56 */
|
|
3652
|
-
new
|
|
3640
|
+
new d(64, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -2, 11, 8e-4, 1),
|
|
3653
3641
|
/* 64 */
|
|
3654
|
-
new
|
|
3642
|
+
new d(80, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, 0, 8, 7e-4, 1),
|
|
3655
3643
|
/* 80 */
|
|
3656
|
-
new
|
|
3644
|
+
new d(96, 9, 9, 0, 2.5, 6.6, 145, 0, 0.95, 0, 1, 5.5, 6e-4, 1),
|
|
3657
3645
|
/* 96 */
|
|
3658
|
-
new
|
|
3646
|
+
new d(112, 9, 9, 0, 2.25, 6.6, 145, 0, 0.95, 0, 2, 4.5, 5e-4, 1),
|
|
3659
3647
|
/* 112 */
|
|
3660
|
-
new
|
|
3648
|
+
new d(128, 9, 9, 0, 1.95, 6.4, 140, 0, 0.95, 0, 3, 4, 2e-4, 1),
|
|
3661
3649
|
/* 128 */
|
|
3662
|
-
new
|
|
3650
|
+
new d(160, 9, 9, 1, 1.79, 6, 135, 0, 0.95, -2, 5, 3.5, 0, 1),
|
|
3663
3651
|
/* 160 */
|
|
3664
|
-
new
|
|
3652
|
+
new d(192, 9, 9, 1, 1.49, 5.6, 125, 0, 0.97, -4, 7, 3, 0, 0),
|
|
3665
3653
|
/* 192 */
|
|
3666
|
-
new
|
|
3654
|
+
new d(224, 9, 9, 1, 1.25, 5.2, 125, 0, 0.98, -6, 9, 2, 0, 0),
|
|
3667
3655
|
/* 224 */
|
|
3668
|
-
new
|
|
3656
|
+
new d(256, 9, 9, 1, 0.97, 5.2, 125, 0, 1, -8, 10, 1, 0, 0),
|
|
3669
3657
|
/* 256 */
|
|
3670
|
-
new
|
|
3658
|
+
new d(320, 9, 9, 1, 0.9, 5.2, 125, 0, 1, -10, 12, 0, 0, 0)
|
|
3671
3659
|
/* 320 */
|
|
3672
3660
|
];
|
|
3673
3661
|
function ce(g, H, oe) {
|
|
@@ -3737,11 +3725,11 @@ const ua = _a;
|
|
|
3737
3725
|
};
|
|
3738
3726
|
}
|
|
3739
3727
|
function Ge() {
|
|
3740
|
-
var
|
|
3728
|
+
var d;
|
|
3741
3729
|
this.setModules = function(N) {
|
|
3742
|
-
|
|
3730
|
+
d = N;
|
|
3743
3731
|
}, this.ResvFrameBegin = function(N, V) {
|
|
3744
|
-
var T = N.internal_flags, ce, g = T.l3_side, H =
|
|
3732
|
+
var T = N.internal_flags, ce, g = T.l3_side, H = d.getframebits(N);
|
|
3745
3733
|
V.bits = (H - T.sideinfo_len * 8) / T.mode_gr;
|
|
3746
3734
|
var oe = 8 * 256 * T.mode_gr - 8;
|
|
3747
3735
|
N.brate > 320 ? h() : (ce = 8 * 1440, N.strict_ISO && h()), T.ResvMax = ce - H, T.ResvMax > oe && (T.ResvMax = oe), (T.ResvMax < 0 || N.disable_reservoir) && (T.ResvMax = 0);
|
|
@@ -3770,7 +3758,7 @@ const ua = _a;
|
|
|
3770
3758
|
function He() {
|
|
3771
3759
|
this.setModules = function(V, T, ce) {
|
|
3772
3760
|
};
|
|
3773
|
-
var
|
|
3761
|
+
var d = [
|
|
3774
3762
|
0,
|
|
3775
3763
|
49345,
|
|
3776
3764
|
49537,
|
|
@@ -4030,103 +4018,103 @@ const ua = _a;
|
|
|
4030
4018
|
];
|
|
4031
4019
|
function N(V, T) {
|
|
4032
4020
|
var ce = T ^ V;
|
|
4033
|
-
return T = T >> 8 ^
|
|
4021
|
+
return T = T >> 8 ^ d[ce & 255], T;
|
|
4034
4022
|
}
|
|
4035
4023
|
this.updateMusicCRC = function(V, T, ce, g) {
|
|
4036
4024
|
for (var H = 0; H < g; ++H)
|
|
4037
4025
|
V[0] = N(T[ce + H], V[0]);
|
|
4038
4026
|
};
|
|
4039
4027
|
}
|
|
4040
|
-
Xe.EQ = function(
|
|
4041
|
-
return Math.abs(
|
|
4042
|
-
}, Xe.NEQ = function(
|
|
4043
|
-
return !Xe.EQ(
|
|
4028
|
+
Xe.EQ = function(d, N) {
|
|
4029
|
+
return Math.abs(d) > Math.abs(N) ? Math.abs(d - N) <= Math.abs(d) * 1e-6 : Math.abs(d - N) <= Math.abs(N) * 1e-6;
|
|
4030
|
+
}, Xe.NEQ = function(d, N) {
|
|
4031
|
+
return !Xe.EQ(d, N);
|
|
4044
4032
|
};
|
|
4045
4033
|
function Xe() {
|
|
4046
|
-
var
|
|
4047
|
-
this.setModules = function(_, w,
|
|
4048
|
-
N =
|
|
4034
|
+
var d = this, N = null, V = null;
|
|
4035
|
+
this.setModules = function(_, w, c, C) {
|
|
4036
|
+
N = c, V = C;
|
|
4049
4037
|
};
|
|
4050
4038
|
var T = null, ce = 0, g = 0, H = 0;
|
|
4051
4039
|
this.getframebits = function(_) {
|
|
4052
|
-
var w = _.internal_flags,
|
|
4053
|
-
w.bitrate_index != 0 ?
|
|
4054
|
-
var C = 0 | (_.version + 1) * 72e3 *
|
|
4040
|
+
var w = _.internal_flags, c;
|
|
4041
|
+
w.bitrate_index != 0 ? c = W.bitrate_table[_.version][w.bitrate_index] : c = _.brate;
|
|
4042
|
+
var C = 0 | (_.version + 1) * 72e3 * c / _.out_samplerate + w.padding;
|
|
4055
4043
|
return 8 * C;
|
|
4056
4044
|
};
|
|
4057
4045
|
function oe(_) {
|
|
4058
4046
|
te.arraycopy(_.header[_.w_ptr].buf, 0, T, g, _.sideinfo_len), g += _.sideinfo_len, ce += _.sideinfo_len * 8, _.w_ptr = _.w_ptr + 1 & le.MAX_HEADER_BUF - 1;
|
|
4059
4047
|
}
|
|
4060
|
-
function z(_, w,
|
|
4061
|
-
for (;
|
|
4048
|
+
function z(_, w, c) {
|
|
4049
|
+
for (; c > 0; ) {
|
|
4062
4050
|
var C;
|
|
4063
|
-
H == 0 && (H = 8, g++, _.header[_.w_ptr].write_timing == ce && oe(_), T[g] = 0), C = Math.min(
|
|
4051
|
+
H == 0 && (H = 8, g++, _.header[_.w_ptr].write_timing == ce && oe(_), T[g] = 0), C = Math.min(c, H), c -= C, H -= C, T[g] |= w >> c << H, ce += C;
|
|
4064
4052
|
}
|
|
4065
4053
|
}
|
|
4066
4054
|
function re(_, w) {
|
|
4067
|
-
var
|
|
4068
|
-
if (w >= 8 && (z(
|
|
4055
|
+
var c = _.internal_flags, C;
|
|
4056
|
+
if (w >= 8 && (z(c, 76, 8), w -= 8), w >= 8 && (z(c, 65, 8), w -= 8), w >= 8 && (z(c, 77, 8), w -= 8), w >= 8 && (z(c, 69, 8), w -= 8), w >= 32) {
|
|
4069
4057
|
var n = N.getLameShortVersion();
|
|
4070
4058
|
if (w >= 32)
|
|
4071
4059
|
for (C = 0; C < n.length && w >= 8; ++C)
|
|
4072
|
-
w -= 8, z(
|
|
4060
|
+
w -= 8, z(c, n.charCodeAt(C), 8);
|
|
4073
4061
|
}
|
|
4074
4062
|
for (; w >= 1; w -= 1)
|
|
4075
|
-
z(
|
|
4063
|
+
z(c, c.ancillary_flag, 1), c.ancillary_flag ^= _.disable_reservoir ? 0 : 1;
|
|
4076
4064
|
}
|
|
4077
|
-
function j(_, w,
|
|
4078
|
-
for (var C = _.header[_.h_ptr].ptr;
|
|
4079
|
-
var n = Math.min(
|
|
4080
|
-
|
|
4065
|
+
function j(_, w, c) {
|
|
4066
|
+
for (var C = _.header[_.h_ptr].ptr; c > 0; ) {
|
|
4067
|
+
var n = Math.min(c, 8 - (C & 7));
|
|
4068
|
+
c -= n, _.header[_.h_ptr].buf[C >> 3] |= w >> c << 8 - (C & 7) - n, C += n;
|
|
4081
4069
|
}
|
|
4082
4070
|
_.header[_.h_ptr].ptr = C;
|
|
4083
4071
|
}
|
|
4084
4072
|
function _e(_, w) {
|
|
4085
|
-
var
|
|
4086
|
-
if (C =
|
|
4087
|
-
for (j(
|
|
4073
|
+
var c = _.internal_flags, C, n, G;
|
|
4074
|
+
if (C = c.l3_side, c.header[c.h_ptr].ptr = 0, Ce.fill(c.header[c.h_ptr].buf, 0, c.sideinfo_len, 0), _.out_samplerate < 16e3 ? j(c, 4094, 12) : j(c, 4095, 12), j(c, _.version, 1), j(c, 4 - 3, 2), j(c, _.error_protection ? 0 : 1, 1), j(c, c.bitrate_index, 4), j(c, c.samplerate_index, 2), j(c, c.padding, 1), j(c, _.extension, 1), j(c, _.mode.ordinal(), 2), j(c, c.mode_ext, 2), j(c, _.copyright, 1), j(c, _.original, 1), j(c, _.emphasis, 2), _.error_protection && j(c, 0, 16), _.version == 1) {
|
|
4075
|
+
for (j(c, C.main_data_begin, 9), c.channels_out == 2 ? j(c, C.private_bits, 3) : j(c, C.private_bits, 5), G = 0; G < c.channels_out; G++) {
|
|
4088
4076
|
var v;
|
|
4089
4077
|
for (v = 0; v < 4; v++)
|
|
4090
|
-
j(
|
|
4078
|
+
j(c, C.scfsi[G][v], 1);
|
|
4091
4079
|
}
|
|
4092
4080
|
for (n = 0; n < 2; n++)
|
|
4093
|
-
for (G = 0; G <
|
|
4081
|
+
for (G = 0; G < c.channels_out; G++) {
|
|
4094
4082
|
var p = C.tt[n][G];
|
|
4095
|
-
j(
|
|
4083
|
+
j(c, p.part2_3_length + p.part2_length, 12), j(c, p.big_values / 2, 9), j(c, p.global_gain, 8), j(c, p.scalefac_compress, 4), p.block_type != o.NORM_TYPE ? (j(c, 1, 1), j(c, p.block_type, 2), j(c, p.mixed_block_flag, 1), p.table_select[0] == 14 && (p.table_select[0] = 16), j(c, p.table_select[0], 5), p.table_select[1] == 14 && (p.table_select[1] = 16), j(c, p.table_select[1], 5), j(c, p.subblock_gain[0], 3), j(c, p.subblock_gain[1], 3), j(c, p.subblock_gain[2], 3)) : (j(c, 0, 1), p.table_select[0] == 14 && (p.table_select[0] = 16), j(c, p.table_select[0], 5), p.table_select[1] == 14 && (p.table_select[1] = 16), j(c, p.table_select[1], 5), p.table_select[2] == 14 && (p.table_select[2] = 16), j(c, p.table_select[2], 5), j(c, p.region0_count, 4), j(c, p.region1_count, 3)), j(c, p.preflag, 1), j(c, p.scalefac_scale, 1), j(c, p.count1table_select, 1);
|
|
4096
4084
|
}
|
|
4097
4085
|
} else
|
|
4098
|
-
for (j(
|
|
4086
|
+
for (j(c, C.main_data_begin, 8), j(c, C.private_bits, c.channels_out), n = 0, G = 0; G < c.channels_out; G++) {
|
|
4099
4087
|
var p = C.tt[n][G];
|
|
4100
|
-
j(
|
|
4088
|
+
j(c, p.part2_3_length + p.part2_length, 12), j(c, p.big_values / 2, 9), j(c, p.global_gain, 8), j(c, p.scalefac_compress, 9), p.block_type != o.NORM_TYPE ? (j(c, 1, 1), j(c, p.block_type, 2), j(c, p.mixed_block_flag, 1), p.table_select[0] == 14 && (p.table_select[0] = 16), j(c, p.table_select[0], 5), p.table_select[1] == 14 && (p.table_select[1] = 16), j(c, p.table_select[1], 5), j(c, p.subblock_gain[0], 3), j(c, p.subblock_gain[1], 3), j(c, p.subblock_gain[2], 3)) : (j(c, 0, 1), p.table_select[0] == 14 && (p.table_select[0] = 16), j(c, p.table_select[0], 5), p.table_select[1] == 14 && (p.table_select[1] = 16), j(c, p.table_select[1], 5), p.table_select[2] == 14 && (p.table_select[2] = 16), j(c, p.table_select[2], 5), j(c, p.region0_count, 4), j(c, p.region1_count, 3)), j(c, p.scalefac_scale, 1), j(c, p.count1table_select, 1);
|
|
4101
4089
|
}
|
|
4102
4090
|
_.error_protection && h();
|
|
4103
4091
|
{
|
|
4104
|
-
var M =
|
|
4105
|
-
|
|
4092
|
+
var M = c.h_ptr;
|
|
4093
|
+
c.h_ptr = M + 1 & le.MAX_HEADER_BUF - 1, c.header[c.h_ptr].write_timing = c.header[M].write_timing + w, c.h_ptr == c.w_ptr;
|
|
4106
4094
|
}
|
|
4107
4095
|
}
|
|
4108
4096
|
function k(_, w) {
|
|
4109
|
-
var
|
|
4097
|
+
var c = W.ht[w.count1table_select + 32], C, n = 0, G = w.big_values, v = w.big_values;
|
|
4110
4098
|
for (C = (w.count1 - w.big_values) / 4; C > 0; --C) {
|
|
4111
4099
|
var p = 0, M = 0, x;
|
|
4112
|
-
x = w.l3_enc[G + 0], x != 0 && (M += 8, w.xr[v + 0] < 0 && p++), x = w.l3_enc[G + 1], x != 0 && (M += 4, p *= 2, w.xr[v + 1] < 0 && p++), x = w.l3_enc[G + 2], x != 0 && (M += 2, p *= 2, w.xr[v + 2] < 0 && p++), x = w.l3_enc[G + 3], x != 0 && (M++, p *= 2, w.xr[v + 3] < 0 && p++), G += 4, v += 4, z(_, p +
|
|
4100
|
+
x = w.l3_enc[G + 0], x != 0 && (M += 8, w.xr[v + 0] < 0 && p++), x = w.l3_enc[G + 1], x != 0 && (M += 4, p *= 2, w.xr[v + 1] < 0 && p++), x = w.l3_enc[G + 2], x != 0 && (M += 2, p *= 2, w.xr[v + 2] < 0 && p++), x = w.l3_enc[G + 3], x != 0 && (M++, p *= 2, w.xr[v + 3] < 0 && p++), G += 4, v += 4, z(_, p + c.table[M], c.hlen[M]), n += c.hlen[M];
|
|
4113
4101
|
}
|
|
4114
4102
|
return n;
|
|
4115
4103
|
}
|
|
4116
|
-
function O(_, w,
|
|
4104
|
+
function O(_, w, c, C, n) {
|
|
4117
4105
|
var G = W.ht[w], v = 0;
|
|
4118
4106
|
if (w == 0)
|
|
4119
4107
|
return v;
|
|
4120
|
-
for (var p =
|
|
4121
|
-
var M = 0, x = 0,
|
|
4108
|
+
for (var p = c; p < C; p += 2) {
|
|
4109
|
+
var M = 0, x = 0, I = G.xlen, r = G.xlen, i = 0, q = n.l3_enc[p], B = n.l3_enc[p + 1];
|
|
4122
4110
|
if (q != 0 && (n.xr[p] < 0 && i++, M--), w > 15) {
|
|
4123
4111
|
if (q > 14) {
|
|
4124
4112
|
var $ = q - 15;
|
|
4125
|
-
i |= $ << 1, x =
|
|
4113
|
+
i |= $ << 1, x = I, q = 15;
|
|
4126
4114
|
}
|
|
4127
4115
|
if (B > 14) {
|
|
4128
4116
|
var de = B - 15;
|
|
4129
|
-
i <<=
|
|
4117
|
+
i <<= I, i |= de, x += I, B = 15;
|
|
4130
4118
|
}
|
|
4131
4119
|
r = 16;
|
|
4132
4120
|
}
|
|
@@ -4135,22 +4123,22 @@ const ua = _a;
|
|
|
4135
4123
|
return v;
|
|
4136
4124
|
}
|
|
4137
4125
|
function a(_, w) {
|
|
4138
|
-
var
|
|
4139
|
-
|
|
4140
|
-
var C = O(_, w.table_select[0], 0,
|
|
4126
|
+
var c = 3 * _.scalefac_band.s[3];
|
|
4127
|
+
c > w.big_values && (c = w.big_values);
|
|
4128
|
+
var C = O(_, w.table_select[0], 0, c, w);
|
|
4141
4129
|
return C += O(
|
|
4142
4130
|
_,
|
|
4143
4131
|
w.table_select[1],
|
|
4144
|
-
|
|
4132
|
+
c,
|
|
4145
4133
|
w.big_values,
|
|
4146
4134
|
w
|
|
4147
4135
|
), C;
|
|
4148
4136
|
}
|
|
4149
4137
|
function u(_, w) {
|
|
4150
|
-
var
|
|
4151
|
-
|
|
4138
|
+
var c, C, n, G;
|
|
4139
|
+
c = w.big_values;
|
|
4152
4140
|
var v = w.region0_count + 1;
|
|
4153
|
-
return n = _.scalefac_band.l[v], v += w.region1_count + 1, G = _.scalefac_band.l[v], n >
|
|
4141
|
+
return n = _.scalefac_band.l[v], v += w.region1_count + 1, G = _.scalefac_band.l[v], n > c && (n = c), G > c && (G = c), C = O(_, w.table_select[0], 0, n, w), C += O(
|
|
4154
4142
|
_,
|
|
4155
4143
|
w.table_select[1],
|
|
4156
4144
|
n,
|
|
@@ -4160,25 +4148,25 @@ const ua = _a;
|
|
|
4160
4148
|
_,
|
|
4161
4149
|
w.table_select[2],
|
|
4162
4150
|
G,
|
|
4163
|
-
|
|
4151
|
+
c,
|
|
4164
4152
|
w
|
|
4165
4153
|
), C;
|
|
4166
4154
|
}
|
|
4167
4155
|
function A(_) {
|
|
4168
|
-
var w,
|
|
4156
|
+
var w, c, C, n, G = 0, v = _.internal_flags, p = v.l3_side;
|
|
4169
4157
|
if (_.version == 1)
|
|
4170
4158
|
for (w = 0; w < 2; w++)
|
|
4171
|
-
for (
|
|
4172
|
-
var M = p.tt[w][
|
|
4159
|
+
for (c = 0; c < v.channels_out; c++) {
|
|
4160
|
+
var M = p.tt[w][c], x = Fe.slen1_tab[M.scalefac_compress], I = Fe.slen2_tab[M.scalefac_compress];
|
|
4173
4161
|
for (n = 0, C = 0; C < M.sfbdivide; C++)
|
|
4174
4162
|
M.scalefac[C] != -1 && (z(v, M.scalefac[C], x), n += x);
|
|
4175
4163
|
for (; C < M.sfbmax; C++)
|
|
4176
|
-
M.scalefac[C] != -1 && (z(v, M.scalefac[C],
|
|
4164
|
+
M.scalefac[C] != -1 && (z(v, M.scalefac[C], I), n += I);
|
|
4177
4165
|
M.block_type == o.SHORT_TYPE ? n += a(v, M) : n += u(v, M), n += k(v, M), G += n;
|
|
4178
4166
|
}
|
|
4179
4167
|
else
|
|
4180
|
-
for (w = 0,
|
|
4181
|
-
var M = p.tt[w][
|
|
4168
|
+
for (w = 0, c = 0; c < v.channels_out; c++) {
|
|
4169
|
+
var M = p.tt[w][c], r, i, q = 0;
|
|
4182
4170
|
if (n = 0, C = 0, i = 0, M.block_type == o.SHORT_TYPE) {
|
|
4183
4171
|
for (; i < 4; i++) {
|
|
4184
4172
|
var B = M.sfb_partition_table[i] / 3, $ = M.slen[i];
|
|
@@ -4214,42 +4202,42 @@ const ua = _a;
|
|
|
4214
4202
|
this.total = 0;
|
|
4215
4203
|
}
|
|
4216
4204
|
function y(_, w) {
|
|
4217
|
-
var
|
|
4218
|
-
return
|
|
4205
|
+
var c = _.internal_flags, C, n, G;
|
|
4206
|
+
return c.w_ptr, G = c.h_ptr - 1, G == -1 && (G = le.MAX_HEADER_BUF - 1), C = c.header[G].write_timing - ce, w.total = C, C >= 0 && h(), n = d.getframebits(_), C += n, w.total += n, w.total % 8 != 0 ? w.total = 1 + w.total / 8 : w.total = w.total / 8, w.total += g + 1, C;
|
|
4219
4207
|
}
|
|
4220
4208
|
this.flush_bitstream = function(_) {
|
|
4221
|
-
var w = _.internal_flags,
|
|
4222
|
-
w.h_ptr - 1,
|
|
4209
|
+
var w = _.internal_flags, c, C;
|
|
4210
|
+
w.h_ptr - 1, c = w.l3_side, !((C = y(_, new P())) < 0) && (re(_, C), w.ResvSize = 0, c.main_data_begin = 0, w.findReplayGain && h(), w.findPeakSample && h());
|
|
4223
4211
|
}, this.format_bitstream = function(_) {
|
|
4224
|
-
var w = _.internal_flags,
|
|
4225
|
-
|
|
4212
|
+
var w = _.internal_flags, c;
|
|
4213
|
+
c = w.l3_side;
|
|
4226
4214
|
var C = this.getframebits(_);
|
|
4227
|
-
re(_,
|
|
4215
|
+
re(_, c.resvDrain_pre), _e(_, C);
|
|
4228
4216
|
var n = 8 * w.sideinfo_len;
|
|
4229
|
-
if (n += A(_), re(_,
|
|
4217
|
+
if (n += A(_), re(_, c.resvDrain_post), n += c.resvDrain_post, c.main_data_begin += (C - n) / 8, y(_, new P()) != w.ResvSize, c.main_data_begin * 8 != w.ResvSize && (w.ResvSize = c.main_data_begin * 8), ce > 1e9) {
|
|
4230
4218
|
var G;
|
|
4231
4219
|
for (G = 0; G < le.MAX_HEADER_BUF; ++G)
|
|
4232
4220
|
w.header[G].write_timing -= ce;
|
|
4233
4221
|
ce = 0;
|
|
4234
4222
|
}
|
|
4235
4223
|
return 0;
|
|
4236
|
-
}, this.copy_buffer = function(_, w,
|
|
4224
|
+
}, this.copy_buffer = function(_, w, c, C, n) {
|
|
4237
4225
|
var G = g + 1;
|
|
4238
4226
|
if (G <= 0)
|
|
4239
4227
|
return 0;
|
|
4240
4228
|
if (C != 0 && G > C)
|
|
4241
4229
|
return -1;
|
|
4242
|
-
if (te.arraycopy(T, 0, w,
|
|
4230
|
+
if (te.arraycopy(T, 0, w, c, G), g = -1, H = 0, n != 0) {
|
|
4243
4231
|
var v = Y(1);
|
|
4244
|
-
v[0] = _.nMusicCRC, V.updateMusicCRC(v, w,
|
|
4232
|
+
v[0] = _.nMusicCRC, V.updateMusicCRC(v, w, c, G), _.nMusicCRC = v[0], G > 0 && (_.VBR_seek_table.nBytesWritten += G), _.decode_on_the_fly && h();
|
|
4245
4233
|
}
|
|
4246
4234
|
return G;
|
|
4247
4235
|
}, this.init_bit_stream_w = function(_) {
|
|
4248
4236
|
T = U(ue.LAME_MAXMP3BUFFER), _.h_ptr = _.w_ptr = 0, _.header[_.h_ptr].write_timing = 0, g = -1, H = 0, ce = 0;
|
|
4249
4237
|
};
|
|
4250
4238
|
}
|
|
4251
|
-
function ke(
|
|
4252
|
-
this.xlen =
|
|
4239
|
+
function ke(d, N, V, T) {
|
|
4240
|
+
this.xlen = d, this.linmax = N, this.table = V, this.hlen = T;
|
|
4253
4241
|
}
|
|
4254
4242
|
var W = {};
|
|
4255
4243
|
W.t1HB = [
|
|
@@ -7697,14 +7685,14 @@ const ua = _a;
|
|
|
7697
7685
|
[44100, 48e3, 32e3, -1],
|
|
7698
7686
|
[11025, 12e3, 8e3, -1]
|
|
7699
7687
|
], W.scfsi_band = [0, 6, 11, 16, 21];
|
|
7700
|
-
function pt(
|
|
7701
|
-
this.bits =
|
|
7688
|
+
function pt(d) {
|
|
7689
|
+
this.bits = d;
|
|
7702
7690
|
}
|
|
7703
7691
|
function at() {
|
|
7704
7692
|
this.over_noise = 0, this.tot_noise = 0, this.max_noise = 0, this.over_count = 0, this.over_SSD = 0, this.bits = 0;
|
|
7705
7693
|
}
|
|
7706
7694
|
function et() {
|
|
7707
|
-
this.setModules = function(
|
|
7695
|
+
this.setModules = function(d, N) {
|
|
7708
7696
|
};
|
|
7709
7697
|
}
|
|
7710
7698
|
function vt() {
|
|
@@ -7713,8 +7701,8 @@ const ua = _a;
|
|
|
7713
7701
|
function _t() {
|
|
7714
7702
|
this.class_id = 0, this.num_samples = 0, this.num_channels = 0, this.in_samplerate = 0, this.out_samplerate = 0, this.scale = 0, this.scale_left = 0, this.scale_right = 0, this.analysis = !1, this.bWriteVbrTag = !1, this.decode_only = !1, this.quality = 0, this.mode = he.STEREO, this.force_ms = !1, this.free_format = !1, this.findReplayGain = !1, this.decode_on_the_fly = !1, this.write_id3tag_automatic = !1, this.brate = 0, this.compression_ratio = 0, this.copyright = 0, this.original = 0, this.extension = 0, this.emphasis = 0, this.error_protection = 0, this.strict_ISO = !1, this.disable_reservoir = !1, this.quant_comp = 0, this.quant_comp_short = 0, this.experimentalY = !1, this.experimentalZ = 0, this.exp_nspsytune = 0, this.preset = 0, this.VBR = null, this.VBR_q_frac = 0, this.VBR_q = 0, this.VBR_mean_bitrate_kbps = 0, this.VBR_min_bitrate_kbps = 0, this.VBR_max_bitrate_kbps = 0, this.VBR_hard_min = 0, this.lowpassfreq = 0, this.highpassfreq = 0, this.lowpasswidth = 0, this.highpasswidth = 0, this.maskingadjust = 0, this.maskingadjust_short = 0, this.ATHonly = !1, this.ATHshort = !1, this.noATH = !1, this.ATHtype = 0, this.ATHcurve = 0, this.ATHlower = 0, this.athaa_type = 0, this.athaa_loudapprox = 0, this.athaa_sensitivity = 0, this.short_blocks = null, this.useTemporal = !1, this.interChRatio = 0, this.msfix = 0, this.tune = !1, this.tune_value_a = 0, this.version = 0, this.encoder_delay = 0, this.encoder_padding = 0, this.framesize = 0, this.frameNum = 0, this.lame_allocated_gfp = 0, this.internal_flags = null;
|
|
7715
7703
|
}
|
|
7716
|
-
function ct(
|
|
7717
|
-
var N =
|
|
7704
|
+
function ct(d) {
|
|
7705
|
+
var N = d;
|
|
7718
7706
|
this.quantize = N, this.iteration_loop = function(V, T, ce, g) {
|
|
7719
7707
|
var H = V.internal_flags, oe = K(b.SFBMAX), z = K(576), re = Y(2), j = 0, _e = H.l3_side, k = new pt(j);
|
|
7720
7708
|
this.quantize.rv.ResvFrameBegin(V, k), j = k.bits;
|
|
@@ -7752,16 +7740,16 @@ const ua = _a;
|
|
|
7752
7740
|
}
|
|
7753
7741
|
function Be() {
|
|
7754
7742
|
}
|
|
7755
|
-
function L(
|
|
7743
|
+
function L(d, N, V, T) {
|
|
7756
7744
|
this.l = Y(1 + o.SBMAX_l), this.s = Y(1 + o.SBMAX_s), this.psfb21 = Y(1 + o.PSFB21), this.psfb12 = Y(1 + o.PSFB12);
|
|
7757
7745
|
var ce = this.l, g = this.s;
|
|
7758
7746
|
arguments.length == 4 && (this.arrL = arguments[0], this.arrS = arguments[1], this.arr21 = arguments[2], this.arr12 = arguments[3], te.arraycopy(this.arrL, 0, ce, 0, Math.min(this.arrL.length, this.l.length)), te.arraycopy(this.arrS, 0, g, 0, Math.min(this.arrS.length, this.s.length)), te.arraycopy(this.arr21, 0, this.psfb21, 0, Math.min(this.arr21.length, this.psfb21.length)), te.arraycopy(this.arr12, 0, this.psfb12, 0, Math.min(this.arr12.length, this.psfb12.length)));
|
|
7759
7747
|
}
|
|
7760
7748
|
e.Q_MAX = 256 + 1, e.Q_MAX2 = 116, e.LARGE_BITS = 1e5, e.IXMAX_VAL = 8206;
|
|
7761
7749
|
function e() {
|
|
7762
|
-
var
|
|
7750
|
+
var d = null, N = null, V = null;
|
|
7763
7751
|
this.setModules = function(y, _, w) {
|
|
7764
|
-
|
|
7752
|
+
d = y, N = _, V = w;
|
|
7765
7753
|
};
|
|
7766
7754
|
function T(y) {
|
|
7767
7755
|
return _e[y + e.Q_MAX2];
|
|
@@ -8145,11 +8133,11 @@ const ua = _a;
|
|
|
8145
8133
|
return w -= re, w = Math.pow(10, w / 10 + y.ATHlower), w;
|
|
8146
8134
|
}
|
|
8147
8135
|
function A(y) {
|
|
8148
|
-
for (var _ = y.internal_flags.ATH.l, w = y.internal_flags.ATH.psfb21,
|
|
8136
|
+
for (var _ = y.internal_flags.ATH.l, w = y.internal_flags.ATH.psfb21, c = y.internal_flags.ATH.s, C = y.internal_flags.ATH.psfb12, n = y.internal_flags, G = y.out_samplerate, v = 0; v < o.SBMAX_l; v++) {
|
|
8149
8137
|
var p = n.scalefac_band.l[v], M = n.scalefac_band.l[v + 1];
|
|
8150
8138
|
_[v] = Ue.MAX_VALUE;
|
|
8151
8139
|
for (var x = p; x < M; x++) {
|
|
8152
|
-
var
|
|
8140
|
+
var I = x * G / 1152, r = u(y, I);
|
|
8153
8141
|
_[v] = Math.min(_[v], r);
|
|
8154
8142
|
}
|
|
8155
8143
|
}
|
|
@@ -8157,66 +8145,66 @@ const ua = _a;
|
|
|
8157
8145
|
var p = n.scalefac_band.psfb21[v], M = n.scalefac_band.psfb21[v + 1];
|
|
8158
8146
|
w[v] = Ue.MAX_VALUE;
|
|
8159
8147
|
for (var x = p; x < M; x++) {
|
|
8160
|
-
var
|
|
8148
|
+
var I = x * G / 1152, r = u(y, I);
|
|
8161
8149
|
w[v] = Math.min(w[v], r);
|
|
8162
8150
|
}
|
|
8163
8151
|
}
|
|
8164
8152
|
for (var v = 0; v < o.SBMAX_s; v++) {
|
|
8165
8153
|
var p = n.scalefac_band.s[v], M = n.scalefac_band.s[v + 1];
|
|
8166
|
-
|
|
8154
|
+
c[v] = Ue.MAX_VALUE;
|
|
8167
8155
|
for (var x = p; x < M; x++) {
|
|
8168
|
-
var
|
|
8169
|
-
|
|
8156
|
+
var I = x * G / 384, r = u(y, I);
|
|
8157
|
+
c[v] = Math.min(c[v], r);
|
|
8170
8158
|
}
|
|
8171
|
-
|
|
8159
|
+
c[v] *= n.scalefac_band.s[v + 1] - n.scalefac_band.s[v];
|
|
8172
8160
|
}
|
|
8173
8161
|
for (var v = 0; v < o.PSFB12; v++) {
|
|
8174
8162
|
var p = n.scalefac_band.psfb12[v], M = n.scalefac_band.psfb12[v + 1];
|
|
8175
8163
|
C[v] = Ue.MAX_VALUE;
|
|
8176
8164
|
for (var x = p; x < M; x++) {
|
|
8177
|
-
var
|
|
8165
|
+
var I = x * G / 384, r = u(y, I);
|
|
8178
8166
|
C[v] = Math.min(C[v], r);
|
|
8179
8167
|
}
|
|
8180
8168
|
C[v] *= n.scalefac_band.s[13] - n.scalefac_band.s[12];
|
|
8181
8169
|
}
|
|
8182
|
-
y.noATH && h(), n.ATH.floor = 10 *
|
|
8170
|
+
y.noATH && h(), n.ATH.floor = 10 * f(u(y, -1));
|
|
8183
8171
|
}
|
|
8184
8172
|
this.iteration_init = function(y) {
|
|
8185
|
-
var _ = y.internal_flags, w = _.l3_side,
|
|
8173
|
+
var _ = y.internal_flags, w = _.l3_side, c;
|
|
8186
8174
|
if (_.iteration_init_init == 0) {
|
|
8187
|
-
for (_.iteration_init_init = 1, w.main_data_begin = 0, A(y), O[0] = 0,
|
|
8188
|
-
O[
|
|
8189
|
-
for (
|
|
8190
|
-
a[
|
|
8191
|
-
0.5 * (O[
|
|
8175
|
+
for (_.iteration_init_init = 1, w.main_data_begin = 0, A(y), O[0] = 0, c = 1; c < H; c++)
|
|
8176
|
+
O[c] = Math.pow(c, 4 / 3);
|
|
8177
|
+
for (c = 0; c < H - 1; c++)
|
|
8178
|
+
a[c] = c + 1 - Math.pow(
|
|
8179
|
+
0.5 * (O[c] + O[c + 1]),
|
|
8192
8180
|
0.75
|
|
8193
8181
|
);
|
|
8194
|
-
for (a[
|
|
8195
|
-
k[
|
|
8196
|
-
for (
|
|
8197
|
-
_e[
|
|
8198
|
-
|
|
8182
|
+
for (a[c] = 0.5, c = 0; c < oe; c++)
|
|
8183
|
+
k[c] = Math.pow(2, (c - 210) * -0.1875);
|
|
8184
|
+
for (c = 0; c <= oe + z; c++)
|
|
8185
|
+
_e[c] = Math.pow(2, (c - 210 - z) * 0.25);
|
|
8186
|
+
d.huffman_init(_);
|
|
8199
8187
|
{
|
|
8200
8188
|
var C, n, G, v;
|
|
8201
|
-
for (
|
|
8189
|
+
for (c = y.exp_nspsytune >> 2 & 63, c >= 32 && (c -= 64), C = Math.pow(10, c / 4 / 10), c = y.exp_nspsytune >> 8 & 63, c >= 32 && (c -= 64), n = Math.pow(10, c / 4 / 10), c = y.exp_nspsytune >> 14 & 63, c >= 32 && (c -= 64), G = Math.pow(10, c / 4 / 10), c = y.exp_nspsytune >> 20 & 63, c >= 32 && (c -= 64), v = G * Math.pow(10, c / 4 / 10), c = 0; c < o.SBMAX_l; c++) {
|
|
8202
8190
|
var p;
|
|
8203
|
-
|
|
8191
|
+
c <= 6 ? p = C : c <= 13 ? p = n : c <= 20 ? p = G : p = v, _.nsPsy.longfact[c] = p;
|
|
8204
8192
|
}
|
|
8205
|
-
for (
|
|
8193
|
+
for (c = 0; c < o.SBMAX_s; c++) {
|
|
8206
8194
|
var p;
|
|
8207
|
-
|
|
8195
|
+
c <= 5 ? p = C : c <= 10 ? p = n : c <= 11 ? p = G : p = v, _.nsPsy.shortfact[c] = p;
|
|
8208
8196
|
}
|
|
8209
8197
|
}
|
|
8210
8198
|
}
|
|
8211
|
-
}, this.on_pe = function(y, _, w,
|
|
8212
|
-
var G = y.internal_flags, v = 0, p, M = Y(2), x,
|
|
8213
|
-
v =
|
|
8199
|
+
}, this.on_pe = function(y, _, w, c, C, n) {
|
|
8200
|
+
var G = y.internal_flags, v = 0, p, M = Y(2), x, I = new pt(v), r = N.ResvMaxBits(y, c, I, n);
|
|
8201
|
+
v = I.bits;
|
|
8214
8202
|
var i = v + r;
|
|
8215
8203
|
for (i > le.MAX_BITS_PER_GRANULE && (i = le.MAX_BITS_PER_GRANULE), p = 0, x = 0; x < G.channels_out; ++x)
|
|
8216
8204
|
w[x] = Math.min(
|
|
8217
8205
|
le.MAX_BITS_PER_CHANNEL,
|
|
8218
8206
|
v / G.channels_out
|
|
8219
|
-
), M[x] = 0 | w[x] * _[C][x] / 700 - w[x], M[x] >
|
|
8207
|
+
), M[x] = 0 | w[x] * _[C][x] / 700 - w[x], M[x] > c * 3 / 4 && (M[x] = c * 3 / 4), M[x] < 0 && (M[x] = 0), M[x] + w[x] > le.MAX_BITS_PER_CHANNEL && (M[x] = Math.max(
|
|
8220
8208
|
0,
|
|
8221
8209
|
le.MAX_BITS_PER_CHANNEL - w[x]
|
|
8222
8210
|
)), p += M[x];
|
|
@@ -8229,10 +8217,10 @@ const ua = _a;
|
|
|
8229
8217
|
p += w[x];
|
|
8230
8218
|
return p > le.MAX_BITS_PER_GRANULE && h(), i;
|
|
8231
8219
|
}, this.athAdjust = function(y, _, w) {
|
|
8232
|
-
var
|
|
8233
|
-
return n -= w, G > 1e-20 && (v = 1 + ie.FAST_LOG10_X(G, 10 /
|
|
8234
|
-
}, this.calc_xmin = function(y, _, w,
|
|
8235
|
-
var C = 0, n = y.internal_flags, G, v = 0, p = 0, M = n.ATH, x = w.xr,
|
|
8220
|
+
var c = 90.30873362, C = 94.82444863, n = ie.FAST_LOG10_X(_, 10), G = y * y, v = 0;
|
|
8221
|
+
return n -= w, G > 1e-20 && (v = 1 + ie.FAST_LOG10_X(G, 10 / c)), v < 0 && (v = 0), n *= v, n += w + c - C, Math.pow(10, 0.1 * n);
|
|
8222
|
+
}, this.calc_xmin = function(y, _, w, c) {
|
|
8223
|
+
var C = 0, n = y.internal_flags, G, v = 0, p = 0, M = n.ATH, x = w.xr, I = y.VBR == E.vbr_mtrh ? 1 : 0, r = n.masking_lower;
|
|
8236
8224
|
for ((y.VBR == E.vbr_mtrh || y.VBR == E.vbr_mt) && (r = 1), G = 0; G < w.psy_lmax; G++) {
|
|
8237
8225
|
var i, q, B, $, de, ge;
|
|
8238
8226
|
y.VBR == E.vbr_rh || y.VBR == E.vbr_mtrh ? q = athAdjust(M.adjust, M.l[G], M.floor) : q = M.adjust * M.l[G], de = w.width[G], B = q / de, $ = ce, ge = de >> 1, i = 0;
|
|
@@ -8240,14 +8228,14 @@ const ua = _a;
|
|
|
8240
8228
|
var Se, Ye;
|
|
8241
8229
|
Se = x[v] * x[v], i += Se, $ += Se < B ? Se : B, v++, Ye = x[v] * x[v], i += Ye, $ += Ye < B ? Ye : B, v++;
|
|
8242
8230
|
} while (--ge > 0);
|
|
8243
|
-
if (i > q && p++, G == o.SBPSY_l && h(),
|
|
8231
|
+
if (i > q && p++, G == o.SBPSY_l && h(), I != 0 && (q = $), !y.ATHonly) {
|
|
8244
8232
|
var $e = _.en.l[G];
|
|
8245
8233
|
if ($e > 0) {
|
|
8246
8234
|
var Ve;
|
|
8247
|
-
Ve = i * _.thm.l[G] * r / $e,
|
|
8235
|
+
Ve = i * _.thm.l[G] * r / $e, I != 0 && (Ve *= n.nsPsy.longfact[G]), q < Ve && (q = Ve);
|
|
8248
8236
|
}
|
|
8249
8237
|
}
|
|
8250
|
-
|
|
8238
|
+
I != 0 ? c[C++] = q : c[C++] = q * n.nsPsy.longfact[G];
|
|
8251
8239
|
}
|
|
8252
8240
|
var mt = 575;
|
|
8253
8241
|
if (w.block_type != o.SHORT_TYPE)
|
|
@@ -8263,23 +8251,23 @@ const ua = _a;
|
|
|
8263
8251
|
var Se, Ye;
|
|
8264
8252
|
Se = x[v] * x[v], i += Se, $ += Se < B ? Se : B, v++, Ye = x[v] * x[v], i += Ye, $ += Ye < B ? Ye : B, v++;
|
|
8265
8253
|
} while (--ge > 0);
|
|
8266
|
-
if (i > gt && p++, lt == o.SBPSY_s && h(),
|
|
8254
|
+
if (i > gt && p++, lt == o.SBPSY_s && h(), I != 0 ? q = $ : q = gt, !y.ATHonly && !y.ATHshort) {
|
|
8267
8255
|
var $e = _.en.s[lt][ft];
|
|
8268
8256
|
if ($e > 0) {
|
|
8269
8257
|
var Ve;
|
|
8270
|
-
Ve = i * _.thm.s[lt][ft] * r / $e,
|
|
8258
|
+
Ve = i * _.thm.s[lt][ft] * r / $e, I != 0 && (Ve *= n.nsPsy.shortfact[lt]), q < Ve && (q = Ve);
|
|
8271
8259
|
}
|
|
8272
8260
|
}
|
|
8273
|
-
|
|
8261
|
+
I != 0 ? c[C++] = q : c[C++] = q * n.nsPsy.shortfact[lt];
|
|
8274
8262
|
}
|
|
8275
|
-
y.useTemporal && (
|
|
8263
|
+
y.useTemporal && (c[C - 3] > c[C - 3 + 1] && (c[C - 3 + 1] += (c[C - 3] - c[C - 3 + 1]) * n.decay), c[C - 3 + 1] > c[C - 3 + 2] && (c[C - 3 + 2] += (c[C - 3 + 1] - c[C - 3 + 2]) * n.decay));
|
|
8276
8264
|
}
|
|
8277
8265
|
return p;
|
|
8278
8266
|
};
|
|
8279
8267
|
function P(y) {
|
|
8280
8268
|
this.s = y;
|
|
8281
8269
|
}
|
|
8282
|
-
this.calc_noise_core = function(y, _, w,
|
|
8270
|
+
this.calc_noise_core = function(y, _, w, c) {
|
|
8283
8271
|
var C = 0, n = _.s, G = y.l3_enc;
|
|
8284
8272
|
if (n > y.count1)
|
|
8285
8273
|
for (; w-- != 0; ) {
|
|
@@ -8288,19 +8276,19 @@ const ua = _a;
|
|
|
8288
8276
|
}
|
|
8289
8277
|
else if (n > y.big_values) {
|
|
8290
8278
|
var p = K(2);
|
|
8291
|
-
for (p[0] = 0, p[1] =
|
|
8279
|
+
for (p[0] = 0, p[1] = c; w-- != 0; ) {
|
|
8292
8280
|
var v;
|
|
8293
8281
|
v = Math.abs(y.xr[n]) - p[G[n]], n++, C += v * v, v = Math.abs(y.xr[n]) - p[G[n]], n++, C += v * v;
|
|
8294
8282
|
}
|
|
8295
8283
|
} else
|
|
8296
8284
|
for (; w-- != 0; ) {
|
|
8297
8285
|
var v;
|
|
8298
|
-
v = Math.abs(y.xr[n]) - O[G[n]] *
|
|
8286
|
+
v = Math.abs(y.xr[n]) - O[G[n]] * c, n++, C += v * v, v = Math.abs(y.xr[n]) - O[G[n]] * c, n++, C += v * v;
|
|
8299
8287
|
}
|
|
8300
8288
|
return _.s = n, C;
|
|
8301
|
-
}, this.calc_noise = function(y, _, w,
|
|
8302
|
-
var n = 0, G = 0, v, p, M = 0, x = 0,
|
|
8303
|
-
for (
|
|
8289
|
+
}, this.calc_noise = function(y, _, w, c, C) {
|
|
8290
|
+
var n = 0, G = 0, v, p, M = 0, x = 0, I = 0, r = -20, i = 0, q = y.scalefac, B = 0;
|
|
8291
|
+
for (c.over_SSD = 0, v = 0; v < y.psymax; v++) {
|
|
8304
8292
|
var $ = y.global_gain - (q[B++] + (y.preflag != 0 ? j[v] : 0) << y.scalefac_scale + 1) - y.subblock_gain[y.window[v]] * 8, de = 0;
|
|
8305
8293
|
if (C != null && C.step[v] == $)
|
|
8306
8294
|
de = C.noise[v], i += y.width[v], w[n++] = de / _[G++], de = C.noise_log[v];
|
|
@@ -8313,13 +8301,13 @@ const ua = _a;
|
|
|
8313
8301
|
var Ye = new P(i);
|
|
8314
8302
|
de = this.calc_noise_core(y, Ye, p, ge), i = Ye.s, C != null && (C.step[v] = $, C.noise[v] = de), de = w[n++] = de / _[G++], de = ie.FAST_LOG10(Math.max(de, 1e-20)), C != null && (C.noise_log[v] = de);
|
|
8315
8303
|
}
|
|
8316
|
-
if (C != null && (C.global_gain = y.global_gain),
|
|
8304
|
+
if (C != null && (C.global_gain = y.global_gain), I += de, de > 0) {
|
|
8317
8305
|
var $e;
|
|
8318
|
-
$e = Math.max(0 | de * 10 + 0.5, 1),
|
|
8306
|
+
$e = Math.max(0 | de * 10 + 0.5, 1), c.over_SSD += $e * $e, M++, x += de;
|
|
8319
8307
|
}
|
|
8320
8308
|
r = Math.max(r, de);
|
|
8321
8309
|
}
|
|
8322
|
-
return
|
|
8310
|
+
return c.over_count = M, c.tot_noise = I, c.over_noise = x, c.max_noise = r, M;
|
|
8323
8311
|
};
|
|
8324
8312
|
}
|
|
8325
8313
|
function l() {
|
|
@@ -8327,7 +8315,7 @@ const ua = _a;
|
|
|
8327
8315
|
}
|
|
8328
8316
|
function m() {
|
|
8329
8317
|
this.xr = K(576), this.l3_enc = Y(576), this.scalefac = Y(b.SFBMAX), this.xrpow_max = 0, this.part2_3_length = 0, this.big_values = 0, this.count1 = 0, this.global_gain = 0, this.scalefac_compress = 0, this.block_type = 0, this.mixed_block_flag = 0, this.table_select = Y(3), this.subblock_gain = Y(3 + 1), this.region0_count = 0, this.region1_count = 0, this.preflag = 0, this.scalefac_scale = 0, this.count1table_select = 0, this.part2_length = 0, this.sfb_lmax = 0, this.sfb_smin = 0, this.psy_lmax = 0, this.sfbmax = 0, this.psymax = 0, this.sfbdivide = 0, this.width = Y(b.SFBMAX), this.window = Y(b.SFBMAX), this.count1bits = 0, this.sfb_partition_table = null, this.slen = Y(4), this.max_nonzero_coeff = 0;
|
|
8330
|
-
var
|
|
8318
|
+
var d = this;
|
|
8331
8319
|
function N(T) {
|
|
8332
8320
|
return new Int32Array(T);
|
|
8333
8321
|
}
|
|
@@ -8335,18 +8323,18 @@ const ua = _a;
|
|
|
8335
8323
|
return new Float32Array(T);
|
|
8336
8324
|
}
|
|
8337
8325
|
this.assign = function(T) {
|
|
8338
|
-
|
|
8326
|
+
d.xr = V(T.xr), d.l3_enc = N(T.l3_enc), d.scalefac = N(T.scalefac), d.xrpow_max = T.xrpow_max, d.part2_3_length = T.part2_3_length, d.big_values = T.big_values, d.count1 = T.count1, d.global_gain = T.global_gain, d.scalefac_compress = T.scalefac_compress, d.block_type = T.block_type, d.mixed_block_flag = T.mixed_block_flag, d.table_select = N(T.table_select), d.subblock_gain = N(T.subblock_gain), d.region0_count = T.region0_count, d.region1_count = T.region1_count, d.preflag = T.preflag, d.scalefac_scale = T.scalefac_scale, d.count1table_select = T.count1table_select, d.part2_length = T.part2_length, d.sfb_lmax = T.sfb_lmax, d.sfb_smin = T.sfb_smin, d.psy_lmax = T.psy_lmax, d.sfbmax = T.sfbmax, d.psymax = T.psymax, d.sfbdivide = T.sfbdivide, d.width = N(T.width), d.window = N(T.window), d.count1bits = T.count1bits, d.sfb_partition_table = T.sfb_partition_table.slice(0), d.slen = N(T.slen), d.max_nonzero_coeff = T.max_nonzero_coeff;
|
|
8339
8327
|
};
|
|
8340
8328
|
}
|
|
8341
8329
|
var b = {};
|
|
8342
8330
|
b.SFBMAX = o.SBMAX_s * 3;
|
|
8343
8331
|
function D() {
|
|
8344
8332
|
this.rv = null;
|
|
8345
|
-
var
|
|
8333
|
+
var d;
|
|
8346
8334
|
this.qupvt = null;
|
|
8347
8335
|
var N, V = new et(), T;
|
|
8348
8336
|
this.setModules = function(a, u, A, P) {
|
|
8349
|
-
|
|
8337
|
+
d = u, this.rv = u, N = A, this.qupvt = A, T = P, V.setModules(N, T);
|
|
8350
8338
|
};
|
|
8351
8339
|
function ce(a, u, A, P) {
|
|
8352
8340
|
P = 0;
|
|
@@ -8371,13 +8359,13 @@ const ua = _a;
|
|
|
8371
8359
|
var A = a.ATH, P = u.xr;
|
|
8372
8360
|
if (u.block_type != o.SHORT_TYPE)
|
|
8373
8361
|
for (var y = !1, _ = o.PSFB21 - 1; _ >= 0 && !y; _--) {
|
|
8374
|
-
var w = a.scalefac_band.psfb21[_],
|
|
8362
|
+
var w = a.scalefac_band.psfb21[_], c = a.scalefac_band.psfb21[_ + 1], C = N.athAdjust(
|
|
8375
8363
|
A.adjust,
|
|
8376
8364
|
A.psfb21[_],
|
|
8377
8365
|
A.floor
|
|
8378
8366
|
);
|
|
8379
8367
|
a.nsPsy.longfact[21] > 1e-12 && (C *= a.nsPsy.longfact[21]);
|
|
8380
|
-
for (var n =
|
|
8368
|
+
for (var n = c - 1; n >= w; n--)
|
|
8381
8369
|
if (Math.abs(P[n]) < C)
|
|
8382
8370
|
P[n] = 0;
|
|
8383
8371
|
else {
|
|
@@ -8388,13 +8376,13 @@ const ua = _a;
|
|
|
8388
8376
|
else
|
|
8389
8377
|
for (var G = 0; G < 3; G++)
|
|
8390
8378
|
for (var y = !1, _ = o.PSFB12 - 1; _ >= 0 && !y; _--) {
|
|
8391
|
-
var w = a.scalefac_band.s[12] * 3 + (a.scalefac_band.s[13] - a.scalefac_band.s[12]) * G + (a.scalefac_band.psfb12[_] - a.scalefac_band.psfb12[0]),
|
|
8379
|
+
var w = a.scalefac_band.s[12] * 3 + (a.scalefac_band.s[13] - a.scalefac_band.s[12]) * G + (a.scalefac_band.psfb12[_] - a.scalefac_band.psfb12[0]), c = w + (a.scalefac_band.psfb12[_ + 1] - a.scalefac_band.psfb12[_]), v = N.athAdjust(
|
|
8392
8380
|
A.adjust,
|
|
8393
8381
|
A.psfb12[_],
|
|
8394
8382
|
A.floor
|
|
8395
8383
|
);
|
|
8396
8384
|
a.nsPsy.shortfact[12] > 1e-12 && (v *= a.nsPsy.shortfact[12]);
|
|
8397
|
-
for (var n =
|
|
8385
|
+
for (var n = c - 1; n >= w; n--)
|
|
8398
8386
|
if (Math.abs(P[n]) < v)
|
|
8399
8387
|
P[n] = 0;
|
|
8400
8388
|
else {
|
|
@@ -8413,9 +8401,9 @@ const ua = _a;
|
|
|
8413
8401
|
var y = a.scalefac_band.l[u.sfb_lmax];
|
|
8414
8402
|
te.arraycopy(u.xr, 0, P, 0, 576);
|
|
8415
8403
|
for (var A = u.sfb_smin; A < o.SBMAX_s; A++)
|
|
8416
|
-
for (var _ = a.scalefac_band.s[A], w = a.scalefac_band.s[A + 1],
|
|
8404
|
+
for (var _ = a.scalefac_band.s[A], w = a.scalefac_band.s[A + 1], c = 0; c < 3; c++)
|
|
8417
8405
|
for (var C = _; C < w; C++)
|
|
8418
|
-
u.xr[y++] = P[3 * C +
|
|
8406
|
+
u.xr[y++] = P[3 * C + c];
|
|
8419
8407
|
for (var n = u.sfb_lmax, A = u.sfb_smin; A < o.SBMAX_s; A++)
|
|
8420
8408
|
u.width[n] = u.width[n + 1] = u.width[n + 2] = a.scalefac_band.s[A + 1] - a.scalefac_band.s[A], u.window[n] = 0, u.window[n + 1] = 1, u.window[n + 2] = 2, n += 3;
|
|
8421
8409
|
}
|
|
@@ -8426,12 +8414,12 @@ const ua = _a;
|
|
|
8426
8414
|
}
|
|
8427
8415
|
H.BINSEARCH_NONE = new H(0), H.BINSEARCH_UP = new H(1), H.BINSEARCH_DOWN = new H(2);
|
|
8428
8416
|
function oe(a, u, A, P, y) {
|
|
8429
|
-
var _, w = a.CurrentStep[P],
|
|
8417
|
+
var _, w = a.CurrentStep[P], c = !1, C = a.OldValue[P], n = H.BINSEARCH_NONE;
|
|
8430
8418
|
for (u.global_gain = C, A -= u.part2_length; ; ) {
|
|
8431
8419
|
var G;
|
|
8432
8420
|
if (_ = T.count_bits(a, y, u, null), w == 1 || _ == A)
|
|
8433
8421
|
break;
|
|
8434
|
-
_ > A ? (n == H.BINSEARCH_DOWN && (
|
|
8422
|
+
_ > A ? (n == H.BINSEARCH_DOWN && (c = !0), c && (w /= 2), n = H.BINSEARCH_UP, G = w) : (n == H.BINSEARCH_UP && (c = !0), c && (w /= 2), n = H.BINSEARCH_DOWN, G = -w), u.global_gain += G, u.global_gain < 0 && h(), u.global_gain > 255 && h();
|
|
8435
8423
|
}
|
|
8436
8424
|
for (; _ > A && u.global_gain < 255; )
|
|
8437
8425
|
u.global_gain++, _ = T.count_bits(a, y, u, null);
|
|
@@ -8483,23 +8471,23 @@ const ua = _a;
|
|
|
8483
8471
|
function j(a, u, A, P, y) {
|
|
8484
8472
|
var _ = a.internal_flags, w;
|
|
8485
8473
|
u.scalefac_scale == 0 ? w = 1.2968395546510096 : w = 1.6817928305074292;
|
|
8486
|
-
for (var
|
|
8487
|
-
|
|
8474
|
+
for (var c = 0, C = 0; C < u.sfbmax; C++)
|
|
8475
|
+
c < A[C] && (c = A[C]);
|
|
8488
8476
|
var n = _.noise_shaping_amp;
|
|
8489
8477
|
switch (n == 3 && h(), n) {
|
|
8490
8478
|
case 2:
|
|
8491
8479
|
break;
|
|
8492
8480
|
case 1:
|
|
8493
|
-
|
|
8481
|
+
c > 1 ? c = Math.pow(c, 0.5) : c *= 0.95;
|
|
8494
8482
|
break;
|
|
8495
8483
|
case 0:
|
|
8496
8484
|
default:
|
|
8497
|
-
|
|
8485
|
+
c > 1 ? c = 1 : c *= 0.95;
|
|
8498
8486
|
break;
|
|
8499
8487
|
}
|
|
8500
8488
|
for (var G = 0, C = 0; C < u.sfbmax; C++) {
|
|
8501
8489
|
var v = u.width[C], p;
|
|
8502
|
-
if (G += v, !(A[C] <
|
|
8490
|
+
if (G += v, !(A[C] < c)) {
|
|
8503
8491
|
for (_.substep_shaping & 2 && h(), u.scalefac[C]++, p = -v; p < 0; p++)
|
|
8504
8492
|
P[G + p] *= w, P[G + p] > u.xrpow_max && (u.xrpow_max = P[G + p]);
|
|
8505
8493
|
if (_.noise_shaping_amp == 2)
|
|
@@ -8512,8 +8500,8 @@ const ua = _a;
|
|
|
8512
8500
|
var _ = a.width[y], w = a.scalefac[y];
|
|
8513
8501
|
if (a.preflag != 0 && (w += N.pretab[y]), P += _, w & 1) {
|
|
8514
8502
|
w++;
|
|
8515
|
-
for (var
|
|
8516
|
-
u[P +
|
|
8503
|
+
for (var c = -_; c < 0; c++)
|
|
8504
|
+
u[P + c] *= A, u[P + c] > a.xrpow_max && (a.xrpow_max = u[P + c]);
|
|
8517
8505
|
}
|
|
8518
8506
|
a.scalefac[y] = w >> 1;
|
|
8519
8507
|
}
|
|
@@ -8525,12 +8513,12 @@ const ua = _a;
|
|
|
8525
8513
|
if (y[P] >= 16)
|
|
8526
8514
|
return !0;
|
|
8527
8515
|
for (var _ = 0; _ < 3; _++) {
|
|
8528
|
-
var w = 0,
|
|
8516
|
+
var w = 0, c = 0;
|
|
8529
8517
|
for (P = u.sfb_lmax + _; P < u.sfbdivide; P += 3)
|
|
8530
8518
|
w < y[P] && (w = y[P]);
|
|
8531
8519
|
for (; P < u.sfbmax; P += 3)
|
|
8532
|
-
|
|
8533
|
-
if (!(w < 16 &&
|
|
8520
|
+
c < y[P] && (c = y[P]);
|
|
8521
|
+
if (!(w < 16 && c < 8)) {
|
|
8534
8522
|
if (u.subblock_gain[_] >= 7)
|
|
8535
8523
|
return !0;
|
|
8536
8524
|
u.subblock_gain[_]++;
|
|
@@ -8568,7 +8556,7 @@ const ua = _a;
|
|
|
8568
8556
|
return w ? !1 : (_.mode_gr == 2 ? w = T.scale_bitcount(u) : w = T.scale_bitcount_lsf(_, u), w ? (_.noise_shaping > 1 && (Ce.fill(_.pseudohalf, 0), u.scalefac_scale == 0 ? (_e(u, P), w = !1) : u.block_type == o.SHORT_TYPE && _.subblock_gain > 0 && (w = k(_, u, P) || z(u))), w || (_.mode_gr == 2 ? w = T.scale_bitcount(u) : w = T.scale_bitcount_lsf(_, u)), !w) : !0);
|
|
8569
8557
|
}
|
|
8570
8558
|
this.outer_loop = function(a, u, A, P, y, _) {
|
|
8571
|
-
var w = a.internal_flags,
|
|
8559
|
+
var w = a.internal_flags, c = new m(), C = K(576), n = K(b.SFBMAX), G = new at(), v, p = new l(), M = 9999999, x = !1, I = !1, r = 0;
|
|
8572
8560
|
if (oe(w, u, _, y, P), w.noise_shaping == 0)
|
|
8573
8561
|
return 100;
|
|
8574
8562
|
N.calc_noise(
|
|
@@ -8577,58 +8565,58 @@ const ua = _a;
|
|
|
8577
8565
|
n,
|
|
8578
8566
|
G,
|
|
8579
8567
|
p
|
|
8580
|
-
), G.bits = u.part2_3_length,
|
|
8568
|
+
), G.bits = u.part2_3_length, c.assign(u);
|
|
8581
8569
|
var i = 0;
|
|
8582
8570
|
for (te.arraycopy(P, 0, C, 0, 576); !x; ) {
|
|
8583
8571
|
do {
|
|
8584
8572
|
var q = new at(), B, $ = 255;
|
|
8585
|
-
if (w.substep_shaping & 2 ? B = 20 : B = 3, w.sfb21_extra && h(), !O(a,
|
|
8573
|
+
if (w.substep_shaping & 2 ? B = 20 : B = 3, w.sfb21_extra && h(), !O(a, c, n, P))
|
|
8586
8574
|
break;
|
|
8587
|
-
|
|
8588
|
-
var de = _ -
|
|
8575
|
+
c.scalefac_scale != 0 && ($ = 254);
|
|
8576
|
+
var de = _ - c.part2_length;
|
|
8589
8577
|
if (de <= 0)
|
|
8590
8578
|
break;
|
|
8591
|
-
for (; (
|
|
8579
|
+
for (; (c.part2_3_length = T.count_bits(
|
|
8592
8580
|
w,
|
|
8593
8581
|
P,
|
|
8594
|
-
|
|
8582
|
+
c,
|
|
8595
8583
|
p
|
|
8596
|
-
)) > de &&
|
|
8597
|
-
|
|
8598
|
-
if (
|
|
8584
|
+
)) > de && c.global_gain <= $; )
|
|
8585
|
+
c.global_gain++;
|
|
8586
|
+
if (c.global_gain > $)
|
|
8599
8587
|
break;
|
|
8600
8588
|
if (G.over_count == 0) {
|
|
8601
|
-
for (; (
|
|
8589
|
+
for (; (c.part2_3_length = T.count_bits(
|
|
8602
8590
|
w,
|
|
8603
8591
|
P,
|
|
8604
|
-
|
|
8592
|
+
c,
|
|
8605
8593
|
p
|
|
8606
|
-
)) > M &&
|
|
8607
|
-
|
|
8608
|
-
if (
|
|
8594
|
+
)) > M && c.global_gain <= $; )
|
|
8595
|
+
c.global_gain++;
|
|
8596
|
+
if (c.global_gain > $)
|
|
8609
8597
|
break;
|
|
8610
8598
|
}
|
|
8611
8599
|
if (N.calc_noise(
|
|
8612
|
-
|
|
8600
|
+
c,
|
|
8613
8601
|
A,
|
|
8614
8602
|
n,
|
|
8615
8603
|
q,
|
|
8616
8604
|
p
|
|
8617
|
-
), q.bits =
|
|
8618
|
-
M = u.part2_3_length, G = q, u.assign(
|
|
8619
|
-
else if (w.full_outer_loop == 0 && (++i > B && G.over_count == 0 || w.noise_shaping_amp == 3 &&
|
|
8605
|
+
), q.bits = c.part2_3_length, u.block_type != o.SHORT_TYPE ? v = a.quant_comp : v = a.quant_comp_short, v = re(v, G, q) ? 1 : 0, v != 0)
|
|
8606
|
+
M = u.part2_3_length, G = q, u.assign(c), i = 0, te.arraycopy(P, 0, C, 0, 576);
|
|
8607
|
+
else if (w.full_outer_loop == 0 && (++i > B && G.over_count == 0 || w.noise_shaping_amp == 3 && I && i > 30 || w.noise_shaping_amp == 3 && I && c.global_gain - r > 15))
|
|
8620
8608
|
break;
|
|
8621
|
-
} while (
|
|
8609
|
+
} while (c.global_gain + c.scalefac_scale < 255);
|
|
8622
8610
|
w.noise_shaping_amp == 3 ? h() : x = !0;
|
|
8623
8611
|
}
|
|
8624
8612
|
return a.VBR == E.vbr_rh || a.VBR == E.vbr_mtrh ? te.arraycopy(C, 0, P, 0, 576) : w.substep_shaping & 1 && h(), G.over_count;
|
|
8625
8613
|
}, this.iteration_finish_one = function(a, u, A) {
|
|
8626
8614
|
var P = a.l3_side, y = P.tt[u][A];
|
|
8627
|
-
T.best_scalefac_store(a, u, A, P), a.use_best_huffman == 1 && T.best_huffman_divide(a, y),
|
|
8615
|
+
T.best_scalefac_store(a, u, A, P), a.use_best_huffman == 1 && T.best_huffman_divide(a, y), d.ResvAdjust(a, y);
|
|
8628
8616
|
};
|
|
8629
8617
|
}
|
|
8630
8618
|
function Z() {
|
|
8631
|
-
var
|
|
8619
|
+
var d = [
|
|
8632
8620
|
-0.1482523854003001,
|
|
8633
8621
|
32.308141959636465,
|
|
8634
8622
|
296.40344946382766,
|
|
@@ -9123,15 +9111,15 @@ const ua = _a;
|
|
|
9123
9111
|
function re(k, O, a) {
|
|
9124
9112
|
for (var u = 10, A = O + 238 - 14 - 286, P = -15; P < 0; P++) {
|
|
9125
9113
|
var y, _, w;
|
|
9126
|
-
y =
|
|
9114
|
+
y = d[u + -10], _ = k[A + -224] * y, w = k[O + 224] * y, y = d[u + -9], _ += k[A + -160] * y, w += k[O + 160] * y, y = d[u + -8], _ += k[A + -96] * y, w += k[O + 96] * y, y = d[u + -7], _ += k[A + -32] * y, w += k[O + 32] * y, y = d[u + -6], _ += k[A + 32] * y, w += k[O + -32] * y, y = d[u + -5], _ += k[A + 96] * y, w += k[O + -96] * y, y = d[u + -4], _ += k[A + 160] * y, w += k[O + -160] * y, y = d[u + -3], _ += k[A + 224] * y, w += k[O + -224] * y, y = d[u + -2], _ += k[O + -256] * y, w -= k[A + 256] * y, y = d[u + -1], _ += k[O + -192] * y, w -= k[A + 192] * y, y = d[u + 0], _ += k[O + -128] * y, w -= k[A + 128] * y, y = d[u + 1], _ += k[O + -64] * y, w -= k[A + 64] * y, y = d[u + 2], _ += k[O + 0] * y, w -= k[A + 0] * y, y = d[u + 3], _ += k[O + 64] * y, w -= k[A + -64] * y, y = d[u + 4], _ += k[O + 128] * y, w -= k[A + -128] * y, y = d[u + 5], _ += k[O + 192] * y, w -= k[A + -192] * y, _ *= d[u + 6], y = w - _, a[30 + P * 2] = w + _, a[31 + P * 2] = d[u + 7] * y, u += 18, O--, A++;
|
|
9127
9115
|
}
|
|
9128
9116
|
{
|
|
9129
|
-
var _, w,
|
|
9130
|
-
w = k[O + -16] *
|
|
9117
|
+
var _, w, c, C;
|
|
9118
|
+
w = k[O + -16] * d[u + -10], _ = k[O + -32] * d[u + -2], w += (k[O + -48] - k[O + 16]) * d[u + -9], _ += k[O + -96] * d[u + -1], w += (k[O + -80] + k[O + 48]) * d[u + -8], _ += k[O + -160] * d[u + 0], w += (k[O + -112] - k[O + 80]) * d[u + -7], _ += k[O + -224] * d[u + 1], w += (k[O + -144] + k[O + 112]) * d[u + -6], _ -= k[O + 32] * d[u + 2], w += (k[O + -176] - k[O + 144]) * d[u + -5], _ -= k[O + 96] * d[u + 3], w += (k[O + -208] + k[O + 176]) * d[u + -4], _ -= k[O + 160] * d[u + 4], w += (k[O + -240] - k[O + 208]) * d[u + -3], _ -= k[O + 224], c = _ - w, C = _ + w, w = a[14], _ = a[15] - w, a[31] = C + w, a[30] = c + _, a[15] = c - _, a[14] = C - w;
|
|
9131
9119
|
}
|
|
9132
9120
|
{
|
|
9133
9121
|
var n;
|
|
9134
|
-
n = a[28] - a[0], a[0] += a[28], a[28] = n *
|
|
9122
|
+
n = a[28] - a[0], a[0] += a[28], a[28] = n * d[u + -2 * 18 + 7], n = a[29] - a[1], a[1] += a[29], a[29] = n * d[u + -2 * 18 + 7], n = a[26] - a[2], a[2] += a[26], a[26] = n * d[u + -4 * 18 + 7], n = a[27] - a[3], a[3] += a[27], a[27] = n * d[u + -4 * 18 + 7], n = a[24] - a[4], a[4] += a[24], a[24] = n * d[u + -6 * 18 + 7], n = a[25] - a[5], a[5] += a[25], a[25] = n * d[u + -6 * 18 + 7], n = a[22] - a[6], a[6] += a[22], a[22] = n * ie.SQRT2, n = a[23] - a[7], a[7] += a[23], a[23] = n * ie.SQRT2 - a[7], a[7] -= a[6], a[22] -= a[7], a[23] -= a[22], n = a[6], a[6] = a[31] - n, a[31] = a[31] + n, n = a[7], a[7] = a[30] - n, a[30] = a[30] + n, n = a[22], a[22] = a[15] - n, a[15] = a[15] + n, n = a[23], a[23] = a[14] - n, a[14] = a[14] + n, n = a[20] - a[8], a[8] += a[20], a[20] = n * d[u + -10 * 18 + 7], n = a[21] - a[9], a[9] += a[21], a[21] = n * d[u + -10 * 18 + 7], n = a[18] - a[10], a[10] += a[18], a[18] = n * d[u + -12 * 18 + 7], n = a[19] - a[11], a[11] += a[19], a[19] = n * d[u + -12 * 18 + 7], n = a[16] - a[12], a[12] += a[16], a[16] = n * d[u + -14 * 18 + 7], n = a[17] - a[13], a[13] += a[17], a[17] = n * d[u + -14 * 18 + 7], n = -a[20] + a[24], a[20] += a[24], a[24] = n * d[u + -12 * 18 + 7], n = -a[21] + a[25], a[21] += a[25], a[25] = n * d[u + -12 * 18 + 7], n = a[4] - a[8], a[4] += a[8], a[8] = n * d[u + -12 * 18 + 7], n = a[5] - a[9], a[5] += a[9], a[9] = n * d[u + -12 * 18 + 7], n = a[0] - a[12], a[0] += a[12], a[12] = n * d[u + -4 * 18 + 7], n = a[1] - a[13], a[1] += a[13], a[13] = n * d[u + -4 * 18 + 7], n = a[16] - a[28], a[16] += a[28], a[28] = n * d[u + -4 * 18 + 7], n = -a[17] + a[29], a[17] += a[29], a[29] = n * d[u + -4 * 18 + 7], n = ie.SQRT2 * (a[2] - a[10]), a[2] += a[10], a[10] = n, n = ie.SQRT2 * (a[3] - a[11]), a[3] += a[11], a[11] = n, n = ie.SQRT2 * (-a[18] + a[26]), a[18] += a[26], a[26] = n - a[18], n = ie.SQRT2 * (-a[19] + a[27]), a[19] += a[27], a[27] = n - a[19], n = a[2], a[19] -= a[3], a[3] -= n, a[2] = a[31] - n, a[31] += n, n = a[3], a[11] -= a[19], a[18] -= n, a[3] = a[30] - n, a[30] += n, n = a[18], a[27] -= a[11], a[19] -= n, a[18] = a[15] - n, a[15] += n, n = a[19], a[10] -= n, a[19] = a[14] - n, a[14] += n, n = a[10], a[11] -= n, a[10] = a[23] - n, a[23] += n, n = a[11], a[26] -= n, a[11] = a[22] - n, a[22] += n, n = a[26], a[27] -= n, a[26] = a[7] - n, a[7] += n, n = a[27], a[27] = a[6] - n, a[6] += n, n = ie.SQRT2 * (a[0] - a[4]), a[0] += a[4], a[4] = n, n = ie.SQRT2 * (a[1] - a[5]), a[1] += a[5], a[5] = n, n = ie.SQRT2 * (a[16] - a[20]), a[16] += a[20], a[20] = n, n = ie.SQRT2 * (a[17] - a[21]), a[17] += a[21], a[21] = n, n = -ie.SQRT2 * (a[8] - a[12]), a[8] += a[12], a[12] = n - a[8], n = -ie.SQRT2 * (a[9] - a[13]), a[9] += a[13], a[13] = n - a[9], n = -ie.SQRT2 * (a[25] - a[29]), a[25] += a[29], a[29] = n - a[25], n = -ie.SQRT2 * (a[24] + a[28]), a[24] -= a[28], a[28] = n - a[24], n = a[24] - a[16], a[24] = n, n = a[20] - n, a[20] = n, n = a[28] - n, a[28] = n, n = a[25] - a[17], a[25] = n, n = a[21] - n, a[21] = n, n = a[29] - n, a[29] = n, n = a[17] - a[1], a[17] = n, n = a[9] - n, a[9] = n, n = a[25] - n, a[25] = n, n = a[5] - n, a[5] = n, n = a[21] - n, a[21] = n, n = a[13] - n, a[13] = n, n = a[29] - n, a[29] = n, n = a[1] - a[0], a[1] = n, n = a[16] - n, a[16] = n, n = a[17] - n, a[17] = n, n = a[8] - n, a[8] = n, n = a[9] - n, a[9] = n, n = a[24] - n, a[24] = n, n = a[25] - n, a[25] = n, n = a[4] - n, a[4] = n, n = a[5] - n, a[5] = n, n = a[20] - n, a[20] = n, n = a[21] - n, a[21] = n, n = a[12] - n, a[12] = n, n = a[13] - n, a[13] = n, n = a[28] - n, a[28] = n, n = a[29] - n, a[29] = n, n = a[0], a[0] += a[31], a[31] -= n, n = a[1], a[1] += a[30], a[30] -= n, n = a[16], a[16] += a[15], a[15] -= n, n = a[17], a[17] += a[14], a[14] -= n, n = a[8], a[8] += a[23], a[23] -= n, n = a[9], a[9] += a[22], a[22] -= n, n = a[24], a[24] += a[7], a[7] -= n, n = a[25], a[25] += a[6], a[6] -= n, n = a[4], a[4] += a[27], a[27] -= n, n = a[5], a[5] += a[26], a[26] -= n, n = a[20], a[20] += a[11], a[11] -= n, n = a[21], a[21] += a[10], a[10] -= n, n = a[12], a[12] += a[19], a[19] -= n, n = a[13], a[13] += a[18], a[18] -= n, n = a[28], a[28] += a[3], a[3] -= n, n = a[29], a[29] += a[2], a[2] -= n;
|
|
9135
9123
|
}
|
|
9136
9124
|
}
|
|
9137
9125
|
function j(k, O) {
|
|
@@ -9143,46 +9131,46 @@ const ua = _a;
|
|
|
9143
9131
|
function _e(k, O, a) {
|
|
9144
9132
|
var u, A;
|
|
9145
9133
|
{
|
|
9146
|
-
var P, y, _, w,
|
|
9147
|
-
P = a[17] - a[9], _ = a[15] - a[11], w = a[14] - a[12],
|
|
9134
|
+
var P, y, _, w, c, C, n, G;
|
|
9135
|
+
P = a[17] - a[9], _ = a[15] - a[11], w = a[14] - a[12], c = a[0] + a[8], C = a[1] + a[7], n = a[2] + a[6], G = a[3] + a[5], k[O + 17] = c + n - G - (C - a[4]), A = (c + n - G) * g[12 + 7] + (C - a[4]), u = (P - _ - w) * g[12 + 6], k[O + 5] = u + A, k[O + 6] = u - A, y = (a[16] - a[10]) * g[12 + 6], C = C * g[12 + 7] + a[4], u = P * g[12 + 0] + y + _ * g[12 + 1] + w * g[12 + 2], A = -c * g[12 + 4] + C - n * g[12 + 5] + G * g[12 + 3], k[O + 1] = u + A, k[O + 2] = u - A, u = P * g[12 + 1] - y - _ * g[12 + 2] + w * g[12 + 0], A = -c * g[12 + 5] + C - n * g[12 + 3] + G * g[12 + 4], k[O + 9] = u + A, k[O + 10] = u - A, u = P * g[12 + 2] - y + _ * g[12 + 0] - w * g[12 + 1], A = c * g[12 + 3] - C + n * g[12 + 4] - G * g[12 + 5], k[O + 13] = u + A, k[O + 14] = u - A;
|
|
9148
9136
|
}
|
|
9149
9137
|
{
|
|
9150
|
-
var v, p, M, x,
|
|
9151
|
-
v = a[8] - a[0], M = a[6] - a[2], x = a[5] - a[3],
|
|
9138
|
+
var v, p, M, x, I, r, i, q;
|
|
9139
|
+
v = a[8] - a[0], M = a[6] - a[2], x = a[5] - a[3], I = a[17] + a[9], r = a[16] + a[10], i = a[15] + a[11], q = a[14] + a[12], k[O + 0] = I + i + q + (r + a[13]), u = (I + i + q) * g[12 + 7] - (r + a[13]), A = (v - M + x) * g[12 + 6], k[O + 11] = u + A, k[O + 12] = u - A, p = (a[7] - a[1]) * g[12 + 6], r = a[13] - r * g[12 + 7], u = I * g[12 + 3] - r + i * g[12 + 4] + q * g[12 + 5], A = v * g[12 + 2] + p + M * g[12 + 0] + x * g[12 + 1], k[O + 3] = u + A, k[O + 4] = u - A, u = -I * g[12 + 5] + r - i * g[12 + 3] - q * g[12 + 4], A = v * g[12 + 1] + p - M * g[12 + 2] - x * g[12 + 0], k[O + 7] = u + A, k[O + 8] = u - A, u = -I * g[12 + 4] + r - i * g[12 + 5] - q * g[12 + 3], A = v * g[12 + 0] - p + M * g[12 + 1] - x * g[12 + 2], k[O + 15] = u + A, k[O + 16] = u - A;
|
|
9152
9140
|
}
|
|
9153
9141
|
}
|
|
9154
9142
|
this.mdct_sub48 = function(k, O, a) {
|
|
9155
9143
|
for (var u = O, A = 286, P = 0; P < k.channels_out; P++) {
|
|
9156
9144
|
for (var y = 0; y < k.mode_gr; y++) {
|
|
9157
|
-
for (var _, w = k.l3_side.tt[y][P],
|
|
9145
|
+
for (var _, w = k.l3_side.tt[y][P], c = w.xr, C = 0, n = k.sb_sample[P][1 - y], G = 0, v = 0; v < 18 / 2; v++)
|
|
9158
9146
|
for (re(u, A, n[G]), re(u, A + 32, n[G + 1]), G += 2, A += 64, _ = 1; _ < 32; _ += 2)
|
|
9159
9147
|
n[G - 1][_] *= -1;
|
|
9160
9148
|
for (_ = 0; _ < 32; _++, C += 18) {
|
|
9161
9149
|
var p = w.block_type, M = k.sb_sample[P][y], x = k.sb_sample[P][1 - y];
|
|
9162
9150
|
if (w.mixed_block_flag != 0 && _ < 2 && (p = 0), k.amp_filter[_] < 1e-12)
|
|
9163
9151
|
Ce.fill(
|
|
9164
|
-
|
|
9152
|
+
c,
|
|
9165
9153
|
C + 0,
|
|
9166
9154
|
C + 18,
|
|
9167
9155
|
0
|
|
9168
9156
|
);
|
|
9169
9157
|
else if (k.amp_filter[_] < 1 && h(), p == o.SHORT_TYPE) {
|
|
9170
9158
|
for (var v = -N / 4; v < 0; v++) {
|
|
9171
|
-
var
|
|
9172
|
-
|
|
9159
|
+
var I = T[o.SHORT_TYPE][v + 3];
|
|
9160
|
+
c[C + v * 3 + 9] = M[9 + v][z[_]] * I - M[8 - v][z[_]], c[C + v * 3 + 18] = M[14 - v][z[_]] * I + M[15 + v][z[_]], c[C + v * 3 + 10] = M[15 + v][z[_]] * I - M[14 - v][z[_]], c[C + v * 3 + 19] = x[2 - v][z[_]] * I + x[3 + v][z[_]], c[C + v * 3 + 11] = x[3 + v][z[_]] * I - x[2 - v][z[_]], c[C + v * 3 + 20] = x[8 - v][z[_]] * I + x[9 + v][z[_]];
|
|
9173
9161
|
}
|
|
9174
|
-
j(
|
|
9162
|
+
j(c, C);
|
|
9175
9163
|
} else {
|
|
9176
9164
|
for (var r = K(18), v = -V / 4; v < 0; v++) {
|
|
9177
9165
|
var i, q;
|
|
9178
9166
|
i = T[p][v + 27] * x[v + 9][z[_]] + T[p][v + 36] * x[8 - v][z[_]], q = T[p][v + 9] * M[v + 9][z[_]] - T[p][v + 18] * M[8 - v][z[_]], r[v + 9] = i - q * ce[3 + v + 9], r[v + 18] = i * ce[3 + v + 9] + q;
|
|
9179
9167
|
}
|
|
9180
|
-
_e(
|
|
9168
|
+
_e(c, C, r);
|
|
9181
9169
|
}
|
|
9182
9170
|
if (p != o.SHORT_TYPE && _ != 0)
|
|
9183
9171
|
for (var v = 7; v >= 0; --v) {
|
|
9184
9172
|
var B, $;
|
|
9185
|
-
B =
|
|
9173
|
+
B = c[C + v] * H[20 + v] + c[C + -1 - v] * oe[28 + v], $ = c[C + v] * oe[28 + v] - c[C + -1 - v] * H[20 + v], c[C + -1 - v] = B, c[C + v] = $;
|
|
9186
9174
|
}
|
|
9187
9175
|
}
|
|
9188
9176
|
}
|
|
@@ -9213,7 +9201,7 @@ const ua = _a;
|
|
|
9213
9201
|
0.187098 * 5
|
|
9214
9202
|
];
|
|
9215
9203
|
function o() {
|
|
9216
|
-
var
|
|
9204
|
+
var d = o.MPG_MD_MS_LR, N = null;
|
|
9217
9205
|
this.psy = null;
|
|
9218
9206
|
var V = null, T = null;
|
|
9219
9207
|
this.setModules = function(z, re, j, _e) {
|
|
@@ -9258,16 +9246,16 @@ const ua = _a;
|
|
|
9258
9246
|
u[0][0] = new S(), u[0][1] = new S(), u[1][0] = new S(), u[1][1] = new S();
|
|
9259
9247
|
var A = Ee([2, 2]);
|
|
9260
9248
|
A[0][0] = new S(), A[0][1] = new S(), A[1][0] = new S(), A[1][1] = new S();
|
|
9261
|
-
var P, y = [null, null], _ = z.internal_flags, w = be([2, 4]),
|
|
9249
|
+
var P, y = [null, null], _ = z.internal_flags, w = be([2, 4]), c = [0.5, 0.5], C = [[0, 0], [0, 0]], n = [[0, 0], [0, 0]], G, v, p;
|
|
9262
9250
|
if (y[0] = re, y[1] = j, _.lame_encode_frame_init == 0 && oe(z, y), _.padding = 0, (_.slot_lag -= _.frac_SpF) < 0 && (_.slot_lag += z.out_samplerate, _.padding = 1), _.psymodel != 0) {
|
|
9263
|
-
var M, x = [null, null],
|
|
9251
|
+
var M, x = [null, null], I = 0, r = Y(2);
|
|
9264
9252
|
for (p = 0; p < _.mode_gr; p++) {
|
|
9265
9253
|
for (v = 0; v < _.channels_out; v++)
|
|
9266
|
-
x[v] = y[v],
|
|
9254
|
+
x[v] = y[v], I = 576 + p * 576 - o.FFTOFFSET;
|
|
9267
9255
|
if (z.VBR == E.vbr_mtrh || z.VBR == E.vbr_mt ? h() : M = V.L3psycho_anal_ns(
|
|
9268
9256
|
z,
|
|
9269
9257
|
x,
|
|
9270
|
-
|
|
9258
|
+
I,
|
|
9271
9259
|
p,
|
|
9272
9260
|
u,
|
|
9273
9261
|
A,
|
|
@@ -9284,7 +9272,7 @@ const ua = _a;
|
|
|
9284
9272
|
}
|
|
9285
9273
|
} else
|
|
9286
9274
|
h();
|
|
9287
|
-
if (g(_), ce.mdct_sub48(_, y[0], y[1]), _.mode_ext = o.MPG_MD_LR_LR, z.force_ms ? _.mode_ext = o.MPG_MD_MS_LR : z.mode == he.JOINT_STEREO && h(), _.mode_ext ==
|
|
9275
|
+
if (g(_), ce.mdct_sub48(_, y[0], y[1]), _.mode_ext = o.MPG_MD_LR_LR, z.force_ms ? _.mode_ext = o.MPG_MD_MS_LR : z.mode == he.JOINT_STEREO && h(), _.mode_ext == d ? (P = A, G = n) : (P = u, G = C), z.analysis && _.pinfo != null && h(), z.VBR == E.vbr_off || z.VBR == E.vbr_abr) {
|
|
9288
9276
|
var q, B;
|
|
9289
9277
|
for (q = 0; q < 18; q++)
|
|
9290
9278
|
_.nsPsy.pefirbuf[q] = _.nsPsy.pefirbuf[q + 1];
|
|
@@ -9297,7 +9285,7 @@ const ua = _a;
|
|
|
9297
9285
|
for (v = 0; v < _.channels_out; v++)
|
|
9298
9286
|
G[p][v] *= B;
|
|
9299
9287
|
}
|
|
9300
|
-
return _.iteration_loop.iteration_loop(z, G,
|
|
9288
|
+
return _.iteration_loop.iteration_loop(z, G, c, P), N.format_bitstream(z), a = N.copy_buffer(_, _e, k, O, 1), z.bWriteVbrTag && T.addVbrFrame(z), z.analysis && _.pinfo != null && h(), H(_), a;
|
|
9301
9289
|
};
|
|
9302
9290
|
}
|
|
9303
9291
|
function ee() {
|
|
@@ -9305,18 +9293,18 @@ const ua = _a;
|
|
|
9305
9293
|
}
|
|
9306
9294
|
function se() {
|
|
9307
9295
|
this.tt = [[null, null], [null, null]], this.main_data_begin = 0, this.private_bits = 0, this.resvDrain_pre = 0, this.resvDrain_post = 0, this.scfsi = [Y(4), Y(4)];
|
|
9308
|
-
for (var
|
|
9296
|
+
for (var d = 0; d < 2; d++)
|
|
9309
9297
|
for (var N = 0; N < 2; N++)
|
|
9310
|
-
this.tt[
|
|
9298
|
+
this.tt[d][N] = new m();
|
|
9311
9299
|
}
|
|
9312
9300
|
function ye() {
|
|
9313
9301
|
this.l = K(o.SBMAX_l), this.s = be([o.SBMAX_s, 3]);
|
|
9314
|
-
var
|
|
9302
|
+
var d = this;
|
|
9315
9303
|
this.assign = function(N) {
|
|
9316
|
-
te.arraycopy(N.l, 0,
|
|
9304
|
+
te.arraycopy(N.l, 0, d.l, 0, o.SBMAX_l);
|
|
9317
9305
|
for (var V = 0; V < o.SBMAX_s; V++)
|
|
9318
9306
|
for (var T = 0; T < 3; T++)
|
|
9319
|
-
|
|
9307
|
+
d.s[V][T] = N.s[V][T];
|
|
9320
9308
|
};
|
|
9321
9309
|
}
|
|
9322
9310
|
function xe() {
|
|
@@ -9324,10 +9312,10 @@ const ua = _a;
|
|
|
9324
9312
|
}
|
|
9325
9313
|
le.MFSIZE = 3 * 1152 + o.ENCDELAY - o.MDCTDELAY, le.MAX_HEADER_BUF = 256, le.MAX_BITS_PER_CHANNEL = 4095, le.MAX_BITS_PER_GRANULE = 7680, le.BPC = 320;
|
|
9326
9314
|
function le() {
|
|
9327
|
-
var
|
|
9315
|
+
var d = 40;
|
|
9328
9316
|
this.Class_ID = 0, this.lame_encode_frame_init = 0, this.iteration_init_init = 0, this.fill_buffer_resample_init = 0, this.mfbuf = be([2, le.MFSIZE]), this.mode_gr = 0, this.channels_in = 0, this.channels_out = 0, this.resample_ratio = 0, this.mf_samples_to_encode = 0, this.mf_size = 0, this.VBR_min_bitrate = 0, this.VBR_max_bitrate = 0, this.bitrate_index = 0, this.samplerate_index = 0, this.mode_ext = 0, this.lowpass1 = 0, this.lowpass2 = 0, this.highpass1 = 0, this.highpass2 = 0, this.noise_shaping = 0, this.noise_shaping_amp = 0, this.substep_shaping = 0, this.psymodel = 0, this.noise_shaping_stop = 0, this.subblock_gain = 0, this.use_best_huffman = 0, this.full_outer_loop = 0, this.l3_side = new se(), this.ms_ratio = K(2), this.padding = 0, this.frac_SpF = 0, this.slot_lag = 0, this.tag_spec = null, this.nMusicCRC = 0, this.OldValue = Y(2), this.CurrentStep = Y(2), this.masking_lower = 0, this.bv_scf = Y(576), this.pseudohalf = Y(b.SFBMAX), this.sfb21_extra = !1, this.inbuf_old = new Array(2), this.blackfilt = new Array(2 * le.BPC + 1), this.itime = ve(2), this.sideinfo_len = 0, this.sb_sample = be([2, 2, 18, o.SBLIMIT]), this.amp_filter = K(32);
|
|
9329
9317
|
function N() {
|
|
9330
|
-
this.write_timing = 0, this.ptr = 0, this.buf = U(
|
|
9318
|
+
this.write_timing = 0, this.ptr = 0, this.buf = U(d);
|
|
9331
9319
|
}
|
|
9332
9320
|
this.header = new Array(le.MAX_HEADER_BUF), this.h_ptr = 0, this.w_ptr = 0, this.ancillary_flag = 0, this.ResvSize = 0, this.ResvMax = 0, this.scalefac_band = new L(), this.minval_l = K(o.CBANDS), this.minval_s = K(o.CBANDS), this.nb_1 = be([4, o.CBANDS]), this.nb_2 = be([4, o.CBANDS]), this.nb_s1 = be([4, o.CBANDS]), this.nb_s2 = be([4, o.CBANDS]), this.s3_ss = null, this.s3_ll = null, this.decay = 0, this.thm = new Array(4), this.en = new Array(4), this.tot_ener = K(4), this.loudness_sq = be([2, 2]), this.loudness_sq_save = K(2), this.mld_l = K(o.SBMAX_l), this.mld_s = K(o.SBMAX_s), this.bm_l = Y(o.SBMAX_l), this.bo_l = Y(o.SBMAX_l), this.bm_s = Y(o.SBMAX_s), this.bo_s = Y(o.SBMAX_s), this.npart_l = 0, this.npart_s = 0, this.s3ind = Me([o.CBANDS, 2]), this.s3ind_s = Me([o.CBANDS, 2]), this.numlines_s = Y(o.CBANDS), this.numlines_l = Y(o.CBANDS), this.rnumlines_l = K(o.CBANDS), this.mld_cb_l = K(o.CBANDS), this.mld_cb_s = K(o.CBANDS), this.numlines_s_num1 = 0, this.numlines_l_num1 = 0, this.pe = K(4), this.ms_ratio_s_old = 0, this.ms_ratio_l_old = 0, this.ms_ener_ratio_old = 0, this.blocktype_old = Y(2), this.nsPsy = new xe(), this.VBR_seek_table = new ee(), this.ATH = null, this.PSY = null, this.nogap_total = 0, this.nogap_current = 0, this.decode_on_the_fly = !0, this.findReplayGain = !0, this.findPeakSample = !0, this.PeakSample = 0, this.RadioGain = 0, this.AudiophileGain = 0, this.rgdata = null, this.noclipGainChange = 0, this.noclipScale = 0, this.bitrate_stereoMode_Hist = Me([16, 4 + 1]), this.bitrate_blockType_Hist = Me([16, 4 + 1 + 1]), this.pinfo = null, this.hip = null, this.in_buffer_nsamples = 0, this.in_buffer_0 = null, this.in_buffer_1 = null, this.iteration_loop = null;
|
|
9333
9321
|
for (var V = 0; V < this.en.length; V++)
|
|
@@ -9338,7 +9326,7 @@ const ua = _a;
|
|
|
9338
9326
|
this.header[V] = new N();
|
|
9339
9327
|
}
|
|
9340
9328
|
function fe() {
|
|
9341
|
-
var
|
|
9329
|
+
var d = K(o.BLKSIZE), N = K(o.BLKSIZE_s / 2), V = [
|
|
9342
9330
|
0.9238795325112867,
|
|
9343
9331
|
0.3826834323650898,
|
|
9344
9332
|
0.9951847266721969,
|
|
@@ -9357,15 +9345,15 @@ const ua = _a;
|
|
|
9357
9345
|
var O, a, u, A, P, y, _;
|
|
9358
9346
|
_ = re >> 1, A = re, P = re << 1, y = P + A, re = P << 1, j = H, _e = j + _;
|
|
9359
9347
|
do {
|
|
9360
|
-
var w,
|
|
9361
|
-
|
|
9348
|
+
var w, c, C, n;
|
|
9349
|
+
c = g[j + 0] - g[j + A], w = g[j + 0] + g[j + A], n = g[j + P] - g[j + y], C = g[j + P] + g[j + y], g[j + P] = w - C, g[j + 0] = w + C, g[j + y] = c - n, g[j + A] = c + n, c = g[_e + 0] - g[_e + A], w = g[_e + 0] + g[_e + A], n = ie.SQRT2 * g[_e + y], C = ie.SQRT2 * g[_e + P], g[_e + P] = w - C, g[_e + 0] = w + C, g[_e + y] = c - n, g[_e + A] = c + n, _e += re, j += re;
|
|
9362
9350
|
} while (j < k);
|
|
9363
9351
|
for (a = V[z + 0], O = V[z + 1], u = 1; u < _; u++) {
|
|
9364
9352
|
var G, v;
|
|
9365
9353
|
G = 1 - 2 * O * O, v = 2 * O * a, j = H + u, _e = H + A - u;
|
|
9366
9354
|
do {
|
|
9367
|
-
var p, M, x, w,
|
|
9368
|
-
M = v * g[j + A] - G * g[_e + A], p = G * g[j + A] + v * g[_e + A],
|
|
9355
|
+
var p, M, x, w, c, I, C, r, n, i;
|
|
9356
|
+
M = v * g[j + A] - G * g[_e + A], p = G * g[j + A] + v * g[_e + A], c = g[j + 0] - p, w = g[j + 0] + p, I = g[_e + 0] - M, x = g[_e + 0] + M, M = v * g[j + y] - G * g[_e + y], p = G * g[j + y] + v * g[_e + y], n = g[j + P] - p, C = g[j + P] + p, i = g[_e + P] - M, r = g[_e + P] + M, M = O * C - a * i, p = a * C + O * i, g[j + P] = w - p, g[j + 0] = w + p, g[_e + y] = I - M, g[_e + A] = I + M, M = a * r - O * n, p = O * r + a * n, g[_e + P] = x - p, g[_e + 0] = x + p, g[j + y] = c - M, g[j + A] = c + M, _e += re, j += re;
|
|
9369
9357
|
} while (j < k);
|
|
9370
9358
|
G = a, a = G * V[z + 0] - O * V[z + 1], O = G * V[z + 1] + O * V[z + 0];
|
|
9371
9359
|
}
|
|
@@ -9515,18 +9503,18 @@ const ua = _a;
|
|
|
9515
9503
|
var j = o.BLKSIZE / 8 - 1, _e = o.BLKSIZE / 2;
|
|
9516
9504
|
do {
|
|
9517
9505
|
var k, O, a, u, A, P = ce[j] & 255;
|
|
9518
|
-
k =
|
|
9506
|
+
k = d[P] * z[oe][re + P], A = d[P + 512] * z[oe][re + P + 512], O = k - A, k = k + A, a = d[P + 256] * z[oe][re + P + 256], A = d[P + 768] * z[oe][re + P + 768], u = a - A, a = a + A, _e -= 4, H[_e + 0] = k + a, H[_e + 2] = k - a, H[_e + 1] = O + u, H[_e + 3] = O - u, k = d[P + 1] * z[oe][re + P + 1], A = d[P + 513] * z[oe][re + P + 513], O = k - A, k = k + A, a = d[P + 257] * z[oe][re + P + 257], A = d[P + 769] * z[oe][re + P + 769], u = a - A, a = a + A, H[_e + o.BLKSIZE / 2 + 0] = k + a, H[_e + o.BLKSIZE / 2 + 2] = k - a, H[_e + o.BLKSIZE / 2 + 1] = O + u, H[_e + o.BLKSIZE / 2 + 3] = O - u;
|
|
9519
9507
|
} while (--j >= 0);
|
|
9520
9508
|
T(H, _e, o.BLKSIZE / 2);
|
|
9521
9509
|
}, this.init_fft = function(g) {
|
|
9522
9510
|
for (var H = 0; H < o.BLKSIZE; H++)
|
|
9523
|
-
|
|
9511
|
+
d[H] = 0.42 - 0.5 * Math.cos(2 * Math.PI * (H + 0.5) / o.BLKSIZE) + 0.08 * Math.cos(4 * Math.PI * (H + 0.5) / o.BLKSIZE);
|
|
9524
9512
|
for (var H = 0; H < o.BLKSIZE_s / 2; H++)
|
|
9525
9513
|
N[H] = 0.5 * (1 - Math.cos(2 * Math.PI * (H + 0.5) / o.BLKSIZE_s));
|
|
9526
9514
|
};
|
|
9527
9515
|
}
|
|
9528
9516
|
function Ae() {
|
|
9529
|
-
var
|
|
9517
|
+
var d = new fe(), N = 2.302585092994046, V = 2, T = 16, ce = 2, g = 16, H = 0.34, oe = 1 / (14752 * 14752) / (o.BLKSIZE / 2), z = 0.01, re = 0.8, j = 0.6, _e = 0.3, k = 3.5, O = 21, a = 0.2302585093;
|
|
9530
9518
|
function u(ae, F) {
|
|
9531
9519
|
for (var J = 0, je = 0; je < o.BLKSIZE / 2; ++je)
|
|
9532
9520
|
J += ae[je] * F.ATH.eql_w[je];
|
|
@@ -9534,7 +9522,7 @@ const ua = _a;
|
|
|
9534
9522
|
}
|
|
9535
9523
|
function A(ae, F, J, je, Ie, me, Re, Le, ze, Ke, Oe) {
|
|
9536
9524
|
var ut = ae.internal_flags;
|
|
9537
|
-
ze < 2 ? (
|
|
9525
|
+
ze < 2 ? (d.fft_long(ut, je[Ie], ze, Ke, Oe), d.fft_short(ut, me[Re], ze, Ke, Oe)) : ze == 2 && h(), F[0] = je[Ie + 0][0], F[0] *= F[0];
|
|
9538
9526
|
for (var tt = o.BLKSIZE / 2 - 1; tt >= 0; --tt) {
|
|
9539
9527
|
var ot = je[Ie + 0][o.BLKSIZE / 2 - tt], ht = je[Ie + 0][o.BLKSIZE / 2 + tt];
|
|
9540
9528
|
F[o.BLKSIZE / 2 - tt] = (ot * ot + ht * ht) * 0.5;
|
|
@@ -9553,7 +9541,7 @@ const ua = _a;
|
|
|
9553
9541
|
}
|
|
9554
9542
|
ae.analysis && h(), ae.athaa_loudapprox == 2 && ze < 2 && (ut.loudness_sq[Le][ze] = ut.loudness_sq_save[ze], ut.loudness_sq_save[ze] = u(F, ut));
|
|
9555
9543
|
}
|
|
9556
|
-
var P = 8, y = 23, _ = 15, w,
|
|
9544
|
+
var P = 8, y = 23, _ = 15, w, c, C, n = [
|
|
9557
9545
|
1,
|
|
9558
9546
|
0.79433,
|
|
9559
9547
|
0.63096,
|
|
@@ -9565,7 +9553,7 @@ const ua = _a;
|
|
|
9565
9553
|
0.11749
|
|
9566
9554
|
];
|
|
9567
9555
|
function G() {
|
|
9568
|
-
w = Math.pow(10, (P + 1) / 16),
|
|
9556
|
+
w = Math.pow(10, (P + 1) / 16), c = Math.pow(10, (y + 1) / 16), C = Math.pow(10, _ / 10);
|
|
9569
9557
|
}
|
|
9570
9558
|
var v = [
|
|
9571
9559
|
3.3246 * 3.3246,
|
|
@@ -9623,12 +9611,12 @@ const ua = _a;
|
|
|
9623
9611
|
function x(ae, F, J, je, Ie, me) {
|
|
9624
9612
|
var Re;
|
|
9625
9613
|
if (F > ae)
|
|
9626
|
-
if (F < ae *
|
|
9614
|
+
if (F < ae * c)
|
|
9627
9615
|
Re = F / ae;
|
|
9628
9616
|
else
|
|
9629
9617
|
return ae + F;
|
|
9630
9618
|
else {
|
|
9631
|
-
if (ae >= F *
|
|
9619
|
+
if (ae >= F * c)
|
|
9632
9620
|
return ae + F;
|
|
9633
9621
|
Re = ae / F;
|
|
9634
9622
|
}
|
|
@@ -9648,7 +9636,7 @@ const ua = _a;
|
|
|
9648
9636
|
}
|
|
9649
9637
|
return ae * v[Le];
|
|
9650
9638
|
}
|
|
9651
|
-
function
|
|
9639
|
+
function I(ae, F, J, je, Ie) {
|
|
9652
9640
|
var me, Re, Le = 0, ze = 0;
|
|
9653
9641
|
for (me = Re = 0; me < o.SBMAX_s; ++Re, ++me) {
|
|
9654
9642
|
for (var Ke = ae.bo_s[me], Oe = ae.npart_s, ut = Ke < Oe ? Ke : Oe; Re < ut; )
|
|
@@ -9870,7 +9858,7 @@ const ua = _a;
|
|
|
9870
9858
|
J
|
|
9871
9859
|
), Ye(Oe, Ta, ot, wa, ya), $e(Oe, wa, ya, zt), it = 0; it < 3; it++) {
|
|
9872
9860
|
var sa, xt;
|
|
9873
|
-
for (i(ae, xa, ht, rt, Pe, it),
|
|
9861
|
+
for (i(ae, xa, ht, rt, Pe, it), I(Oe, ht, rt, Pe, it), Tt = 0; Tt < o.SBMAX_s; Tt++) {
|
|
9874
9862
|
if (xt = Oe.thm[Pe].s[Tt][it], xt *= re, Mt[it] >= 2 || Mt[it + 1] == 1) {
|
|
9875
9863
|
var Gt = it != 0 ? it - 1 : 2, yt = B(
|
|
9876
9864
|
Oe.thm[Pe].s[Tt][Gt],
|
|
@@ -10085,7 +10073,7 @@ const ua = _a;
|
|
|
10085
10073
|
ut,
|
|
10086
10074
|
tt,
|
|
10087
10075
|
je
|
|
10088
|
-
), G(),
|
|
10076
|
+
), G(), d.init_fft(F), F.decay = Math.exp(-1 * N / (z * ot / 192));
|
|
10089
10077
|
{
|
|
10090
10078
|
var We;
|
|
10091
10079
|
We = k, ae.exp_nspsytune & 2 && (We = 1), Math.abs(ae.msfix) > 0 && (We = ae.msfix), ae.msfix = We;
|
|
@@ -10153,7 +10141,7 @@ const ua = _a;
|
|
|
10153
10141
|
};
|
|
10154
10142
|
}
|
|
10155
10143
|
function ue() {
|
|
10156
|
-
var
|
|
10144
|
+
var d = this, N = 128 * 1024;
|
|
10157
10145
|
ue.V9 = 410, ue.V8 = 420, ue.V7 = 430, ue.V6 = 440, ue.V5 = 450, ue.V4 = 460, ue.V3 = 470, ue.V2 = 480, ue.V1 = 490, ue.V0 = 500, ue.R3MIX = 1e3, ue.STANDARD = 1001, ue.EXTREME = 1002, ue.INSANE = 1003, ue.STANDARD_FAST = 1004, ue.EXTREME_FAST = 1005, ue.MEDIUM = 1006, ue.MEDIUM_FAST = 1007;
|
|
10158
10146
|
var V = 16384 + N;
|
|
10159
10147
|
ue.LAME_MAXMP3BUFFER = V;
|
|
@@ -10266,10 +10254,10 @@ const ua = _a;
|
|
|
10266
10254
|
new O(224, 19400),
|
|
10267
10255
|
new O(256, 19700),
|
|
10268
10256
|
new O(320, 20500)
|
|
10269
|
-
], B =
|
|
10257
|
+
], B = d.nearestBitrateFullIndex(i);
|
|
10270
10258
|
r.lowerlimit = q[B].lowpass;
|
|
10271
10259
|
}
|
|
10272
|
-
function
|
|
10260
|
+
function c(r) {
|
|
10273
10261
|
var i = r.internal_flags, q = 32;
|
|
10274
10262
|
if (i.lowpass1 > 0) {
|
|
10275
10263
|
for (var B = 999, $ = 0; $ <= 31; $++) {
|
|
@@ -10390,7 +10378,7 @@ const ua = _a;
|
|
|
10390
10378
|
r.compression_ratio = r.out_samplerate * 16 * i.channels_out / (1e3 * r.brate);
|
|
10391
10379
|
break;
|
|
10392
10380
|
}
|
|
10393
|
-
r.mode == he.NOT_SET && (r.mode = he.JOINT_STEREO), r.highpassfreq > 0 ? h() : (i.highpass1 = 0, i.highpass2 = 0), r.lowpassfreq > 0 ? (i.lowpass2 = 2 * r.lowpassfreq, r.lowpasswidth >= 0 ? h() : i.lowpass1 = (1 - 0) * 2 * r.lowpassfreq, i.lowpass1 /= r.out_samplerate, i.lowpass2 /= r.out_samplerate) : h(),
|
|
10381
|
+
r.mode == he.NOT_SET && (r.mode = he.JOINT_STEREO), r.highpassfreq > 0 ? h() : (i.highpass1 = 0, i.highpass2 = 0), r.lowpassfreq > 0 ? (i.lowpass2 = 2 * r.lowpassfreq, r.lowpasswidth >= 0 ? h() : i.lowpass1 = (1 - 0) * 2 * r.lowpassfreq, i.lowpass1 /= r.out_samplerate, i.lowpass2 /= r.out_samplerate) : h(), c(r), i.samplerate_index = P(r.out_samplerate, r), i.samplerate_index < 0 && h(), r.VBR == E.vbr_off ? r.free_format ? i.bitrate_index = 0 : (r.brate = y(
|
|
10394
10382
|
r.brate,
|
|
10395
10383
|
r.version,
|
|
10396
10384
|
r.out_samplerate
|
|
@@ -10509,7 +10497,7 @@ const ua = _a;
|
|
|
10509
10497
|
var ae = [null, null], F = 0, J = 0;
|
|
10510
10498
|
ae[0] = gt[0], ae[1] = gt[1];
|
|
10511
10499
|
var je = new x();
|
|
10512
|
-
if (
|
|
10500
|
+
if (I(
|
|
10513
10501
|
r,
|
|
10514
10502
|
ft,
|
|
10515
10503
|
ae,
|
|
@@ -10545,7 +10533,7 @@ const ua = _a;
|
|
|
10545
10533
|
return Ye;
|
|
10546
10534
|
}
|
|
10547
10535
|
function M(r, i, q, B, $, de) {
|
|
10548
|
-
var ge =
|
|
10536
|
+
var ge = d.enc.lame_encode_mp3_frame(
|
|
10549
10537
|
r,
|
|
10550
10538
|
i,
|
|
10551
10539
|
q,
|
|
@@ -10558,7 +10546,7 @@ const ua = _a;
|
|
|
10558
10546
|
function x() {
|
|
10559
10547
|
this.n_in = 0, this.n_out = 0;
|
|
10560
10548
|
}
|
|
10561
|
-
function
|
|
10549
|
+
function I(r, i, q, B, $, de) {
|
|
10562
10550
|
var ge = r.internal_flags;
|
|
10563
10551
|
if (ge.resample_ratio < 0.9999 || ge.resample_ratio > 1.0001)
|
|
10564
10552
|
h();
|
|
@@ -10570,33 +10558,33 @@ const ua = _a;
|
|
|
10570
10558
|
}
|
|
10571
10559
|
}
|
|
10572
10560
|
function X() {
|
|
10573
|
-
this.setModules = function(
|
|
10561
|
+
this.setModules = function(d, N) {
|
|
10574
10562
|
};
|
|
10575
10563
|
}
|
|
10576
10564
|
function pe() {
|
|
10577
|
-
this.setModules = function(
|
|
10565
|
+
this.setModules = function(d, N, V) {
|
|
10578
10566
|
};
|
|
10579
10567
|
}
|
|
10580
10568
|
function Ne() {
|
|
10581
10569
|
}
|
|
10582
10570
|
function Q() {
|
|
10583
|
-
this.setModules = function(
|
|
10571
|
+
this.setModules = function(d, N) {
|
|
10584
10572
|
};
|
|
10585
10573
|
}
|
|
10586
|
-
function ne(
|
|
10587
|
-
|
|
10574
|
+
function ne(d, N, V) {
|
|
10575
|
+
d != 1 && h("fix cc: only supports mono");
|
|
10588
10576
|
var T = new ue(), ce = new X(), g = new Qe(), H = new Xe(), oe = new Ze(), z = new e(), re = new D(), j = new He(), _e = new Te(), k = new Q(), O = new Ge(), a = new Fe(), u = new pe(), A = new Ne();
|
|
10589
10577
|
T.setModules(g, H, oe, z, re, j, _e, k, A), H.setModules(g, A, _e, j), k.setModules(H, _e), oe.setModules(T), re.setModules(H, O, z, a), z.setModules(a, O, T.enc.psy), O.setModules(H), a.setModules(z), j.setModules(T, H, _e), ce.setModules(u, A), u.setModules(_e, k, oe);
|
|
10590
10578
|
var P = T.lame_init();
|
|
10591
|
-
P.num_channels =
|
|
10579
|
+
P.num_channels = d, P.in_samplerate = N, P.out_samplerate = N, P.brate = V, P.mode = he.STEREO, P.quality = 3, P.bWriteVbrTag = !1, P.disable_reservoir = !0, P.write_id3tag_automatic = !1, T.lame_init_params(P);
|
|
10592
10580
|
var y = 1152, _ = 0 | 1.25 * y + 7200, w = U(_);
|
|
10593
|
-
this.encodeBuffer = function(
|
|
10594
|
-
|
|
10595
|
-
var n = T.lame_encode_buffer(P,
|
|
10581
|
+
this.encodeBuffer = function(c, C) {
|
|
10582
|
+
d == 1 && (C = c), c.length > y && (y = c.length, _ = 0 | 1.25 * y + 7200, w = U(_));
|
|
10583
|
+
var n = T.lame_encode_buffer(P, c, C, c.length, w, 0, _);
|
|
10596
10584
|
return new Int8Array(w.subarray(0, n));
|
|
10597
10585
|
}, this.flush = function() {
|
|
10598
|
-
var
|
|
10599
|
-
return new Int8Array(w.subarray(0,
|
|
10586
|
+
var c = T.lame_encode_flush(P, w, 0, _);
|
|
10587
|
+
return new Int8Array(w.subarray(0, c));
|
|
10600
10588
|
};
|
|
10601
10589
|
}
|
|
10602
10590
|
b.SFBMAX = o.SBMAX_s * 3, t.Mp3Encoder = ne;
|
|
@@ -10604,12 +10592,12 @@ const ua = _a;
|
|
|
10604
10592
|
t(), s.lamejs = t;
|
|
10605
10593
|
});
|
|
10606
10594
|
(function(s) {
|
|
10607
|
-
var t = typeof window == "object" && !!window.document,
|
|
10595
|
+
var t = typeof window == "object" && !!window.document, f = t ? window : Object, h = f.Recorder, U = h.i18n;
|
|
10608
10596
|
s(h, U, U.$T, t);
|
|
10609
|
-
})(function(s, t,
|
|
10597
|
+
})(function(s, t, f, h) {
|
|
10610
10598
|
var U = function(K) {
|
|
10611
10599
|
return new Y(K);
|
|
10612
|
-
},
|
|
10600
|
+
}, R = "WaveView", Y = function(K) {
|
|
10613
10601
|
var ve = this, be = {
|
|
10614
10602
|
/*
|
|
10615
10603
|
elem:"css selector" //自动显示到dom,并以此dom大小为显示大小
|
|
@@ -10643,7 +10631,7 @@ const ua = _a;
|
|
|
10643
10631
|
var Ee = ve.canvas = K[De];
|
|
10644
10632
|
else {
|
|
10645
10633
|
if (!h)
|
|
10646
|
-
throw new Error(
|
|
10634
|
+
throw new Error(f.G("NonBrowser-1", [R]));
|
|
10647
10635
|
var Ce = K.elem;
|
|
10648
10636
|
Ce && (typeof Ce == "string" ? Ce = document.querySelector(Ce) : Ce.length && (Ce = Ce[0])), Ce && (K.width = Ce.offsetWidth, K.height = Ce.offsetHeight);
|
|
10649
10637
|
var te = ve.elem = document.createElement("div");
|
|
@@ -10653,7 +10641,7 @@ const ua = _a;
|
|
|
10653
10641
|
}
|
|
10654
10642
|
var ie = K.scale, we = K.width * ie, Ue = K.height * ie;
|
|
10655
10643
|
if (!we || !Ue)
|
|
10656
|
-
throw new Error(
|
|
10644
|
+
throw new Error(f.G("IllegalArgs-1", [R + " width=0 height=0"]));
|
|
10657
10645
|
Ee.width = we, Ee.height = Ue;
|
|
10658
10646
|
var E = ve.ctx = Ee.getContext("2d");
|
|
10659
10647
|
ve.linear1 = ve.genLinear(E, we, K.linear1), ve.linear2 = ve.genLinear(E, we, K.linear2), ve.linearBg = ve.genLinear(E, Ue, K.linearBg, !0), ve._phase = 0;
|
|
@@ -10705,7 +10693,7 @@ const ua = _a;
|
|
|
10705
10693
|
ie == 0 ? De.moveTo(ie, K[te]) : De.lineTo(ie, K[te]);
|
|
10706
10694
|
De.lineWidth = Me.lineWidth * Ee, De.strokeStyle = ve, De.stroke();
|
|
10707
10695
|
}
|
|
10708
|
-
}, s[
|
|
10696
|
+
}, s[R] = U;
|
|
10709
10697
|
});
|
|
10710
10698
|
const Xr = {
|
|
10711
10699
|
components: { InlineSvg: Pt },
|
|
@@ -10726,8 +10714,8 @@ const Xr = {
|
|
|
10726
10714
|
sampleRate: 16e3,
|
|
10727
10715
|
bitRate: 16,
|
|
10728
10716
|
//mp3格式,指定采样率hz、比特率kbps,其他参数使用默认配置;注意:是数字的参数必须提供数字,不要用字符串;需要使用的type类型,需提前把格式支持文件加载进来,比如使用wav格式需要提前加载wav.js编码引擎
|
|
10729
|
-
onProcess: (s, t,
|
|
10730
|
-
this.duration = this.formatMilliseconds(
|
|
10717
|
+
onProcess: (s, t, f, h) => {
|
|
10718
|
+
this.duration = this.formatMilliseconds(f), this.wave && this.wave.input(
|
|
10731
10719
|
s[s.length - 1],
|
|
10732
10720
|
t,
|
|
10733
10721
|
h
|
|
@@ -10763,8 +10751,8 @@ const Xr = {
|
|
|
10763
10751
|
},
|
|
10764
10752
|
methods: {
|
|
10765
10753
|
formatMilliseconds(s) {
|
|
10766
|
-
const t = Math.floor(s / 1e3),
|
|
10767
|
-
return `${U}:${
|
|
10754
|
+
const t = Math.floor(s / 1e3), f = Math.floor(t / 60), h = t % 60, U = f.toString().padStart(2, "0"), R = h.toString().padStart(2, "0");
|
|
10755
|
+
return `${U}:${R}`;
|
|
10768
10756
|
},
|
|
10769
10757
|
start() {
|
|
10770
10758
|
this.ready && (this.pending = !0, this.rec.start());
|
|
@@ -10780,7 +10768,7 @@ const Xr = {
|
|
|
10780
10768
|
);
|
|
10781
10769
|
},
|
|
10782
10770
|
handleFinish() {
|
|
10783
|
-
const [, s] = this.blob.type.split("/"), t = new Date().getTime(),
|
|
10771
|
+
const [, s] = this.blob.type.split("/"), t = new Date().getTime(), f = `${t}.${s}`, h = new File([this.blob], f, {
|
|
10784
10772
|
type: this.blob.type,
|
|
10785
10773
|
lastModified: t
|
|
10786
10774
|
});
|
|
@@ -10793,7 +10781,7 @@ const Xr = {
|
|
|
10793
10781
|
this.$emit("cancel");
|
|
10794
10782
|
},
|
|
10795
10783
|
handleTranslate() {
|
|
10796
|
-
const [, s] = this.blob.type.split("/"), t = new Date().getTime(),
|
|
10784
|
+
const [, s] = this.blob.type.split("/"), t = new Date().getTime(), f = `${t}.${s}`, h = new File([this.blob], f, {
|
|
10797
10785
|
type: this.blob.type,
|
|
10798
10786
|
lastModified: t
|
|
10799
10787
|
});
|
|
@@ -10804,17 +10792,17 @@ const Xr = {
|
|
|
10804
10792
|
}
|
|
10805
10793
|
};
|
|
10806
10794
|
var Kr = function() {
|
|
10807
|
-
var t = this,
|
|
10808
|
-
return
|
|
10795
|
+
var t = this, f = t._self._c;
|
|
10796
|
+
return f("div", { staticClass: "wrap", style: {
|
|
10809
10797
|
width: t.width
|
|
10810
|
-
} }, [t.isMobile ?
|
|
10798
|
+
} }, [t.isMobile ? f("div", { staticClass: "record-audio-mobile" }, [t.pending ? f("a", { staticClass: "oper", attrs: { title: "停止录制" }, on: { click: t.stop } }, [f("inline-svg", { attrs: { src: t.icon.stop, width: 24, height: 24 } })], 1) : f("a", { staticClass: "oper", attrs: { title: "开始录制" }, on: { click: t.start } }, [f("inline-svg", { attrs: { src: t.icon.record, width: 24, height: 24 } })], 1), f("div", { staticClass: "recwave" })]) : f("div", { staticClass: "record-audio" }, [f("div", { staticClass: "main" }, [f("div", { staticClass: "recwave" }), f("div", { staticClass: "duration" }, [t._v(t._s(t.duration))])]), t.url && !t.isMobile ? f("div", { staticClass: "audio-item" }, [f("audio", { ref: "audio", attrs: { src: t.url, controls: "" } }), f("a", { on: { click: t.handleTranslate } }, [t._v("转文本")])]) : t._e(), t.text ? f("div", { staticClass: "audio-text" }, [t._v(t._s(t.text))]) : t._e(), f("div", { staticClass: "buttons" }, [t.pending ? f("a", { staticClass: "oper", attrs: { title: "停止录制" }, on: { click: t.stop } }, [f("inline-svg", { attrs: { src: t.icon.stop, width: 24, height: 24 } })], 1) : f("a", { staticClass: "oper", attrs: { title: "开始录制" }, on: { click: t.start } }, [f("inline-svg", { attrs: { src: t.icon.record, width: 24, height: 24 } })], 1), f("a", { class: {
|
|
10811
10799
|
btn: !0,
|
|
10812
10800
|
finish: !0,
|
|
10813
10801
|
disabled: !t.blob
|
|
10814
|
-
}, on: { click: t.handleFinish } }, [t._v(" 插入音频 ")]), t.text ?
|
|
10802
|
+
}, on: { click: t.handleFinish } }, [t._v(" 插入音频 ")]), t.text ? f("a", { class: {
|
|
10815
10803
|
btn: !0,
|
|
10816
10804
|
finish: !0
|
|
10817
|
-
}, on: { click: t.handleFinishText } }, [t._v(" 插入文本 ")]) : t._e(),
|
|
10805
|
+
}, on: { click: t.handleFinishText } }, [t._v(" 插入文本 ")]) : t._e(), f("a", { staticClass: "cancel btn", on: { click: t.handleCancel } }, [t._v("取消")])])]), f("div", { staticClass: "mask", on: { click: t.handleCancel } })]);
|
|
10818
10806
|
}, Jr = [], ei = /* @__PURE__ */ jt(
|
|
10819
10807
|
Xr,
|
|
10820
10808
|
Kr,
|
|
@@ -10858,10 +10846,10 @@ var ma = {}, ai = {
|
|
|
10858
10846
|
throw "First parameter is required.";
|
|
10859
10847
|
e = e || {
|
|
10860
10848
|
type: "video"
|
|
10861
|
-
}, e = new
|
|
10849
|
+
}, e = new f(L, e);
|
|
10862
10850
|
var l = this;
|
|
10863
10851
|
function m(X) {
|
|
10864
|
-
return e.disableLogs || console.log("RecordRTC version: ", l.version), X && (e = new
|
|
10852
|
+
return e.disableLogs || console.log("RecordRTC version: ", l.version), X && (e = new f(L, X)), e.disableLogs || console.log("started recording " + e.type + " stream."), fe ? (fe.clearRecordedData(), fe.record(), ye("recording"), l.recordingDuration && se(), l) : (b(function() {
|
|
10865
10853
|
l.recordingDuration && se();
|
|
10866
10854
|
}), l);
|
|
10867
10855
|
}
|
|
@@ -10890,8 +10878,8 @@ var ma = {}, ai = {
|
|
|
10890
10878
|
typeof X.call == "function" ? X.call(l, "") : X("");
|
|
10891
10879
|
return;
|
|
10892
10880
|
}
|
|
10893
|
-
Object.keys(fe).forEach(function(
|
|
10894
|
-
typeof fe[
|
|
10881
|
+
Object.keys(fe).forEach(function(d) {
|
|
10882
|
+
typeof fe[d] != "function" && (l[d] = fe[d]);
|
|
10895
10883
|
});
|
|
10896
10884
|
var Q = fe.blob;
|
|
10897
10885
|
if (!Q)
|
|
@@ -10907,9 +10895,9 @@ var ma = {}, ai = {
|
|
|
10907
10895
|
}
|
|
10908
10896
|
typeof X.call == "function" ? X.call(l, ne) : X(ne);
|
|
10909
10897
|
}
|
|
10910
|
-
e.autoWriteToDisk && ee(function(
|
|
10898
|
+
e.autoWriteToDisk && ee(function(d) {
|
|
10911
10899
|
var N = {};
|
|
10912
|
-
N[e.type + "Blob"] =
|
|
10900
|
+
N[e.type + "Blob"] = d, at.Store(N);
|
|
10913
10901
|
});
|
|
10914
10902
|
}
|
|
10915
10903
|
}
|
|
@@ -10949,7 +10937,7 @@ var ma = {}, ai = {
|
|
|
10949
10937
|
return;
|
|
10950
10938
|
}
|
|
10951
10939
|
if (typeof Worker < "u" && !navigator.mozGetUserMedia) {
|
|
10952
|
-
var Q =
|
|
10940
|
+
var Q = d(o);
|
|
10953
10941
|
Q.onmessage = function(N) {
|
|
10954
10942
|
X(N.data);
|
|
10955
10943
|
}, Q.postMessage(Ne);
|
|
@@ -10959,7 +10947,7 @@ var ma = {}, ai = {
|
|
|
10959
10947
|
X(N.target.result);
|
|
10960
10948
|
};
|
|
10961
10949
|
}
|
|
10962
|
-
function
|
|
10950
|
+
function d(N) {
|
|
10963
10951
|
try {
|
|
10964
10952
|
var V = Me.createObjectURL(new Blob([
|
|
10965
10953
|
N.toString(),
|
|
@@ -11437,7 +11425,7 @@ var ma = {}, ai = {
|
|
|
11437
11425
|
* @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
|
|
11438
11426
|
* @param {object} config - {type:"video", disableLogs: true, numberOfAudioChannels: 1, bufferSize: 0, sampleRate: 0, video: HTMLVideoElement, getNativeBlob:true, etc.}
|
|
11439
11427
|
*/
|
|
11440
|
-
function
|
|
11428
|
+
function f(L, e) {
|
|
11441
11429
|
return !e.recorderType && !e.type && (e.audio && e.video ? e.type = "video" : e.audio && !e.video && (e.type = "audio")), e.recorderType && !e.type && (e.recorderType === W || e.recorderType === ke || typeof Be < "u" && e.recorderType === Be ? e.type = "video" : e.recorderType === et ? e.type = "gif" : e.recorderType === Xe ? e.type = "audio" : e.recorderType === He && (Te(L, "audio").length && Te(L, "video").length || !Te(L, "audio").length && Te(L, "video").length ? e.type = "video" : Te(L, "audio").length && !Te(L, "video").length && (e.type = "audio"))), typeof He < "u" && typeof MediaRecorder < "u" && "requestData" in MediaRecorder.prototype && (e.mimeType || (e.mimeType = "video/webm"), e.type || (e.type = e.mimeType.split("/")[0]), e.bitsPerSecond), e.type || (e.mimeType && (e.type = e.mimeType.split("/")[0]), e.type || (e.type = "audio")), e;
|
|
11442
11430
|
}
|
|
11443
11431
|
/**
|
|
@@ -11632,10 +11620,10 @@ var ma = {}, ai = {
|
|
|
11632
11620
|
};
|
|
11633
11621
|
}
|
|
11634
11622
|
U.getFromDisk = t.getFromDisk, U.writeToDisk = t.writeToDisk, typeof t < "u" && (t.MRecordRTC = U);
|
|
11635
|
-
var
|
|
11623
|
+
var R = "Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45";
|
|
11636
11624
|
(function(L) {
|
|
11637
11625
|
L && (typeof window < "u" || typeof st > "u" || (st.navigator = {
|
|
11638
|
-
userAgent:
|
|
11626
|
+
userAgent: R,
|
|
11639
11627
|
getUserMedia: function() {
|
|
11640
11628
|
}
|
|
11641
11629
|
}, st.console || (st.console = {}), (typeof st.console.log > "u" || typeof st.console.error > "u") && (st.console.error = st.console.log = st.console.log || function() {
|
|
@@ -11986,39 +11974,39 @@ var ma = {}, ai = {
|
|
|
11986
11974
|
function g(oe, z) {
|
|
11987
11975
|
var re = oe.numberOfAudioChannels, j = oe.leftBuffers.slice(0), _e = oe.rightBuffers.slice(0), k = oe.sampleRate, O = oe.internalInterleavedLength, a = oe.desiredSampRate;
|
|
11988
11976
|
re === 2 && (j = P(j, O), _e = P(_e, O), a && (j = u(j, a, k), _e = u(_e, a, k))), re === 1 && (j = P(j, O), a && (j = u(j, a, k))), a && (k = a);
|
|
11989
|
-
function u(
|
|
11990
|
-
var q = Math.round(
|
|
11991
|
-
B[0] =
|
|
11977
|
+
function u(I, r, i) {
|
|
11978
|
+
var q = Math.round(I.length * (r / i)), B = [], $ = Number((I.length - 1) / (q - 1));
|
|
11979
|
+
B[0] = I[0];
|
|
11992
11980
|
for (var de = 1; de < q - 1; de++) {
|
|
11993
11981
|
var ge = de * $, Se = Number(Math.floor(ge)).toFixed(), Ye = Number(Math.ceil(ge)).toFixed(), $e = ge - Se;
|
|
11994
|
-
B[de] = A(
|
|
11982
|
+
B[de] = A(I[Se], I[Ye], $e);
|
|
11995
11983
|
}
|
|
11996
|
-
return B[q - 1] =
|
|
11984
|
+
return B[q - 1] = I[I.length - 1], B;
|
|
11997
11985
|
}
|
|
11998
|
-
function A(
|
|
11999
|
-
return
|
|
11986
|
+
function A(I, r, i) {
|
|
11987
|
+
return I + (r - I) * i;
|
|
12000
11988
|
}
|
|
12001
|
-
function P(
|
|
12002
|
-
for (var i = new Float64Array(r), q = 0, B =
|
|
12003
|
-
var de =
|
|
11989
|
+
function P(I, r) {
|
|
11990
|
+
for (var i = new Float64Array(r), q = 0, B = I.length, $ = 0; $ < B; $++) {
|
|
11991
|
+
var de = I[$];
|
|
12004
11992
|
i.set(de, q), q += de.length;
|
|
12005
11993
|
}
|
|
12006
11994
|
return i;
|
|
12007
11995
|
}
|
|
12008
|
-
function y(
|
|
12009
|
-
for (var i =
|
|
12010
|
-
q[$++] =
|
|
11996
|
+
function y(I, r) {
|
|
11997
|
+
for (var i = I.length + r.length, q = new Float64Array(i), B = 0, $ = 0; $ < i; )
|
|
11998
|
+
q[$++] = I[B], q[$++] = r[B], B++;
|
|
12011
11999
|
return q;
|
|
12012
12000
|
}
|
|
12013
|
-
function _(
|
|
12001
|
+
function _(I, r, i) {
|
|
12014
12002
|
for (var q = i.length, B = 0; B < q; B++)
|
|
12015
|
-
|
|
12003
|
+
I.setUint8(r + B, i.charCodeAt(B));
|
|
12016
12004
|
}
|
|
12017
12005
|
var w;
|
|
12018
12006
|
re === 2 && (w = y(j, _e)), re === 1 && (w = j);
|
|
12019
|
-
var
|
|
12020
|
-
_(G, 0, "RIFF"), G.setUint32(4, 36 +
|
|
12021
|
-
for (var v =
|
|
12007
|
+
var c = w.length, C = 44 + c * 2, n = new ArrayBuffer(C), G = new DataView(n);
|
|
12008
|
+
_(G, 0, "RIFF"), G.setUint32(4, 36 + c * 2, !0), _(G, 8, "WAVE"), _(G, 12, "fmt "), G.setUint32(16, 16, !0), G.setUint16(20, 1, !0), G.setUint16(22, re, !0), G.setUint32(24, k, !0), G.setUint32(28, k * re * 2, !0), G.setUint16(32, re * 2, !0), G.setUint16(34, 16, !0), _(G, 36, "data"), G.setUint32(40, c * 2, !0);
|
|
12009
|
+
for (var v = c, p = 44, M = 1, x = 0; x < v; x++)
|
|
12022
12010
|
G.setInt16(p, w[x] * (32767 * M), !0), p += 2;
|
|
12023
12011
|
if (z)
|
|
12024
12012
|
return z({
|
|
@@ -12107,7 +12095,7 @@ var ma = {}, ai = {
|
|
|
12107
12095
|
return this.name;
|
|
12108
12096
|
};
|
|
12109
12097
|
var ne = !1;
|
|
12110
|
-
function
|
|
12098
|
+
function d(T) {
|
|
12111
12099
|
if (!pe) {
|
|
12112
12100
|
if (se() === !1 && (e.disableLogs || console.log("MediaStream seems stopped."), S.disconnect(), D = !1), !D) {
|
|
12113
12101
|
fe && (fe.disconnect(), fe = null);
|
|
@@ -12122,7 +12110,7 @@ var ma = {}, ai = {
|
|
|
12122
12110
|
Z += ue, l.recordingLength = Z, typeof e.timeSlice < "u" && (N.recordingLength += ue, N.left.push(g), o === 2 && N.right.push(oe));
|
|
12123
12111
|
}
|
|
12124
12112
|
}
|
|
12125
|
-
S.onaudioprocess =
|
|
12113
|
+
S.onaudioprocess = d, le.createMediaStreamDestination ? S.connect(le.createMediaStreamDestination()) : S.connect(le.destination), this.leftchannel = m, this.rightchannel = b, this.numberOfAudioChannels = o, this.desiredSampRate = ee, this.sampleRate = X, l.recordingLength = Z;
|
|
12126
12114
|
var N = {
|
|
12127
12115
|
left: [],
|
|
12128
12116
|
right: [],
|
|
@@ -12339,7 +12327,7 @@ var ma = {}, ai = {
|
|
|
12339
12327
|
function b(le, fe, Ae, ue, X) {
|
|
12340
12328
|
var pe = document.createElement("canvas");
|
|
12341
12329
|
pe.width = o.width, pe.height = o.height;
|
|
12342
|
-
var Ne = pe.getContext("2d"), Q = [], ne = fe === -1,
|
|
12330
|
+
var Ne = pe.getContext("2d"), Q = [], ne = fe === -1, d = fe && fe > 0 && fe <= le.length ? fe : le.length, N = {
|
|
12343
12331
|
r: 0,
|
|
12344
12332
|
g: 0,
|
|
12345
12333
|
b: 0
|
|
@@ -12347,7 +12335,7 @@ var ma = {}, ai = {
|
|
|
12347
12335
|
Math.pow(255, 2) + Math.pow(255, 2) + Math.pow(255, 2)
|
|
12348
12336
|
), T = Ae && Ae >= 0 && Ae <= 1 ? Ae : 0, ce = ue && ue >= 0 && ue <= 1 ? ue : 0, g = !1;
|
|
12349
12337
|
m({
|
|
12350
|
-
length:
|
|
12338
|
+
length: d,
|
|
12351
12339
|
functionToLoop: function(H, oe) {
|
|
12352
12340
|
var z, re, j, _e = function() {
|
|
12353
12341
|
!g && j - z <= j * ce || (ne && (g = !0), Q.push(le[oe])), H();
|
|
@@ -12375,7 +12363,7 @@ var ma = {}, ai = {
|
|
|
12375
12363
|
}
|
|
12376
12364
|
},
|
|
12377
12365
|
callback: function() {
|
|
12378
|
-
Q = Q.concat(le.slice(
|
|
12366
|
+
Q = Q.concat(le.slice(d)), Q.length <= 0 && Q.push(le[le.length - 1]), X(Q);
|
|
12379
12367
|
}
|
|
12380
12368
|
});
|
|
12381
12369
|
}
|
|
@@ -12555,7 +12543,7 @@ var ma = {}, ai = {
|
|
|
12555
12543
|
}]
|
|
12556
12544
|
}]
|
|
12557
12545
|
}]
|
|
12558
|
-
}], ne = 0,
|
|
12546
|
+
}], ne = 0, d = 0; ne < X.length; ) {
|
|
12559
12547
|
var N = [], V = 0;
|
|
12560
12548
|
do
|
|
12561
12549
|
N.push(X[ne]), V += X[ne].duration, ne++;
|
|
@@ -12563,9 +12551,9 @@ var ma = {}, ai = {
|
|
|
12563
12551
|
var T = 0, ce = {
|
|
12564
12552
|
id: 524531317,
|
|
12565
12553
|
// Cluster
|
|
12566
|
-
data: D(
|
|
12554
|
+
data: D(d, T, N)
|
|
12567
12555
|
};
|
|
12568
|
-
Q[1].data.push(ce),
|
|
12556
|
+
Q[1].data.push(ce), d += V;
|
|
12569
12557
|
}
|
|
12570
12558
|
return se(Q);
|
|
12571
12559
|
}
|
|
@@ -12626,7 +12614,7 @@ var ma = {}, ai = {
|
|
|
12626
12614
|
for (var pe = [], Ne = 0; Ne < X.length; Ne++) {
|
|
12627
12615
|
var Q = X[Ne].data;
|
|
12628
12616
|
typeof Q == "object" && (Q = se(Q)), typeof Q == "number" && (Q = ee(Q.toString(2))), typeof Q == "string" && (Q = o(Q));
|
|
12629
|
-
var ne = Q.size || Q.byteLength || Q.length,
|
|
12617
|
+
var ne = Q.size || Q.byteLength || Q.length, d = Math.ceil(Math.ceil(Math.log(ne) / Math.log(2)) / 8), N = ne.toString(2), V = new Array(d * 7 + 7 + 1 - N.length).join("0") + N, T = new Array(d).join("0") + "1" + V;
|
|
12630
12618
|
pe.push(S(X[Ne].id)), pe.push(ee(T)), pe.push(Q);
|
|
12631
12619
|
}
|
|
12632
12620
|
return new Blob(pe, {
|
|
@@ -12645,9 +12633,9 @@ var ma = {}, ai = {
|
|
|
12645
12633
|
function xe(X) {
|
|
12646
12634
|
for (var pe = X.RIFF[0].WEBP[0], Ne = pe.indexOf("*"), Q = 0, ne = []; Q < 4; Q++)
|
|
12647
12635
|
ne[Q] = pe.charCodeAt(Ne + 3 + Q);
|
|
12648
|
-
var
|
|
12649
|
-
return V = ne[1] << 8 | ne[0],
|
|
12650
|
-
width:
|
|
12636
|
+
var d, N, V;
|
|
12637
|
+
return V = ne[1] << 8 | ne[0], d = V & 16383, V = ne[3] << 8 | ne[2], N = V & 16383, {
|
|
12638
|
+
width: d,
|
|
12651
12639
|
height: N,
|
|
12652
12640
|
data: pe,
|
|
12653
12641
|
riff: X
|
|
@@ -12661,8 +12649,8 @@ var ma = {}, ai = {
|
|
|
12661
12649
|
}
|
|
12662
12650
|
function fe(X) {
|
|
12663
12651
|
for (var pe = 0, Ne = {}; pe < X.length; ) {
|
|
12664
|
-
var Q = X.substr(pe, 4), ne = le(X, pe),
|
|
12665
|
-
pe += 4 + 4 + ne, Ne[Q] = Ne[Q] || [], Q === "RIFF" || Q === "LIST" ? Ne[Q].push(fe(
|
|
12652
|
+
var Q = X.substr(pe, 4), ne = le(X, pe), d = X.substr(pe + 4 + 4, ne);
|
|
12653
|
+
pe += 4 + 4 + ne, Ne[Q] = Ne[Q] || [], Q === "RIFF" || Q === "LIST" ? Ne[Q].push(fe(d)) : Ne[Q].push(d);
|
|
12666
12654
|
}
|
|
12667
12655
|
return Ne;
|
|
12668
12656
|
}
|
|
@@ -12978,37 +12966,37 @@ var ma = {}, ai = {
|
|
|
12978
12966
|
};
|
|
12979
12967
|
function le() {
|
|
12980
12968
|
if (!b) {
|
|
12981
|
-
var Q = m.length, ne = !1,
|
|
12969
|
+
var Q = m.length, ne = !1, d = [];
|
|
12982
12970
|
if (m.forEach(function(V) {
|
|
12983
|
-
V.stream || (V.stream = {}), V.stream.fullcanvas ? ne = V :
|
|
12971
|
+
V.stream || (V.stream = {}), V.stream.fullcanvas ? ne = V : d.push(V);
|
|
12984
12972
|
}), ne)
|
|
12985
12973
|
D.width = ne.stream.width, D.height = ne.stream.height;
|
|
12986
|
-
else if (
|
|
12987
|
-
D.width = Q > 1 ?
|
|
12974
|
+
else if (d.length) {
|
|
12975
|
+
D.width = Q > 1 ? d[0].width * 2 : d[0].width;
|
|
12988
12976
|
var N = 1;
|
|
12989
|
-
(Q === 3 || Q === 4) && (N = 2), (Q === 5 || Q === 6) && (N = 3), (Q === 7 || Q === 8) && (N = 4), (Q === 9 || Q === 10) && (N = 5), D.height =
|
|
12977
|
+
(Q === 3 || Q === 4) && (N = 2), (Q === 5 || Q === 6) && (N = 3), (Q === 7 || Q === 8) && (N = 4), (Q === 9 || Q === 10) && (N = 5), D.height = d[0].height * N;
|
|
12990
12978
|
} else
|
|
12991
12979
|
D.width = S.width || 360, D.height = S.height || 240;
|
|
12992
|
-
ne && ne instanceof HTMLVideoElement && fe(ne),
|
|
12980
|
+
ne && ne instanceof HTMLVideoElement && fe(ne), d.forEach(function(V, T) {
|
|
12993
12981
|
fe(V, T);
|
|
12994
12982
|
}), setTimeout(le, S.frameInterval);
|
|
12995
12983
|
}
|
|
12996
12984
|
}
|
|
12997
12985
|
function fe(Q, ne) {
|
|
12998
12986
|
if (!b) {
|
|
12999
|
-
var
|
|
13000
|
-
ne === 1 && (
|
|
12987
|
+
var d = 0, N = 0, V = Q.width, T = Q.height;
|
|
12988
|
+
ne === 1 && (d = Q.width), ne === 2 && (N = Q.height), ne === 3 && (d = Q.width, N = Q.height), ne === 4 && (N = Q.height * 2), ne === 5 && (d = Q.width, N = Q.height * 2), ne === 6 && (N = Q.height * 3), ne === 7 && (d = Q.width, N = Q.height * 3), typeof Q.stream.left < "u" && (d = Q.stream.left), typeof Q.stream.top < "u" && (N = Q.stream.top), typeof Q.stream.width < "u" && (V = Q.stream.width), typeof Q.stream.height < "u" && (T = Q.stream.height), Z.drawImage(Q, d, N, V, T), typeof Q.stream.onRender == "function" && Q.stream.onRender(Z, d, N, V, T, ne);
|
|
13001
12989
|
}
|
|
13002
12990
|
}
|
|
13003
12991
|
function Ae() {
|
|
13004
12992
|
b = !1;
|
|
13005
12993
|
var Q = ue(), ne = X();
|
|
13006
|
-
return ne && ne.getTracks().filter(function(
|
|
13007
|
-
return
|
|
13008
|
-
}).forEach(function(
|
|
13009
|
-
Q.addTrack(
|
|
13010
|
-
}), L.forEach(function(
|
|
13011
|
-
|
|
12994
|
+
return ne && ne.getTracks().filter(function(d) {
|
|
12995
|
+
return d.kind === "audio";
|
|
12996
|
+
}).forEach(function(d) {
|
|
12997
|
+
Q.addTrack(d);
|
|
12998
|
+
}), L.forEach(function(d) {
|
|
12999
|
+
d.fullcanvas;
|
|
13012
13000
|
}), Q;
|
|
13013
13001
|
}
|
|
13014
13002
|
function ue() {
|
|
@@ -13016,10 +13004,10 @@ var ma = {}, ai = {
|
|
|
13016
13004
|
var Q;
|
|
13017
13005
|
"captureStream" in D ? Q = D.captureStream() : "mozCaptureStream" in D ? Q = D.mozCaptureStream() : S.disableLogs || console.error("Upgrade to latest Chrome or otherwise enable this flag: chrome://flags/#enable-experimental-web-platform-features");
|
|
13018
13006
|
var ne = new se();
|
|
13019
|
-
return Q.getTracks().filter(function(
|
|
13020
|
-
return
|
|
13021
|
-
}).forEach(function(
|
|
13022
|
-
ne.addTrack(
|
|
13007
|
+
return Q.getTracks().filter(function(d) {
|
|
13008
|
+
return d.kind === "video";
|
|
13009
|
+
}).forEach(function(d) {
|
|
13010
|
+
ne.addTrack(d);
|
|
13023
13011
|
}), D.stream = ne, ne;
|
|
13024
13012
|
}
|
|
13025
13013
|
function X() {
|
|
@@ -13030,8 +13018,8 @@ var ma = {}, ai = {
|
|
|
13030
13018
|
return N.kind === "audio";
|
|
13031
13019
|
}).length) {
|
|
13032
13020
|
Q++;
|
|
13033
|
-
var
|
|
13034
|
-
S.useGainNode === !0 &&
|
|
13021
|
+
var d = S.audioContext.createMediaStreamSource(ne);
|
|
13022
|
+
S.useGainNode === !0 && d.connect(S.gainNode), S.audioSources.push(d);
|
|
13035
13023
|
}
|
|
13036
13024
|
}), !!Q)
|
|
13037
13025
|
return S.audioDestination = S.audioContext.createMediaStreamDestination(), S.audioSources.forEach(function(ne) {
|
|
@@ -13046,12 +13034,12 @@ var ma = {}, ai = {
|
|
|
13046
13034
|
if (!Q)
|
|
13047
13035
|
throw "First parameter is required.";
|
|
13048
13036
|
Q instanceof Array || (Q = [Q]), Q.forEach(function(ne) {
|
|
13049
|
-
var
|
|
13037
|
+
var d = new se();
|
|
13050
13038
|
if (ne.getTracks().filter(function(T) {
|
|
13051
13039
|
return T.kind === "video";
|
|
13052
13040
|
}).length) {
|
|
13053
13041
|
var N = pe(ne);
|
|
13054
|
-
N.stream = ne, m.push(N),
|
|
13042
|
+
N.stream = ne, m.push(N), d.addTrack(ne.getTracks().filter(function(T) {
|
|
13055
13043
|
return T.kind === "video";
|
|
13056
13044
|
})[0]);
|
|
13057
13045
|
}
|
|
@@ -13059,11 +13047,11 @@ var ma = {}, ai = {
|
|
|
13059
13047
|
return T.kind === "audio";
|
|
13060
13048
|
}).length) {
|
|
13061
13049
|
var V = S.audioContext.createMediaStreamSource(ne);
|
|
13062
|
-
S.audioDestination = S.audioContext.createMediaStreamDestination(), V.connect(S.audioDestination),
|
|
13050
|
+
S.audioDestination = S.audioContext.createMediaStreamDestination(), V.connect(S.audioDestination), d.addTrack(S.audioDestination.stream.getTracks().filter(function(T) {
|
|
13063
13051
|
return T.kind === "audio";
|
|
13064
13052
|
})[0]);
|
|
13065
13053
|
}
|
|
13066
|
-
L.push(
|
|
13054
|
+
L.push(d);
|
|
13067
13055
|
});
|
|
13068
13056
|
}, this.releaseStreams = function() {
|
|
13069
13057
|
m = [], b = !0, S.gainNode && (S.gainNode.disconnect(), S.gainNode = null), S.audioSources.length && (S.audioSources.forEach(function(Q) {
|
|
@@ -13077,8 +13065,8 @@ var ma = {}, ai = {
|
|
|
13077
13065
|
if (ne.getTracks().filter(function(N) {
|
|
13078
13066
|
return N.kind === "video";
|
|
13079
13067
|
}).length) {
|
|
13080
|
-
var
|
|
13081
|
-
|
|
13068
|
+
var d = pe(ne);
|
|
13069
|
+
d.stream = ne, m.push(d);
|
|
13082
13070
|
}
|
|
13083
13071
|
});
|
|
13084
13072
|
}
|
|
@@ -13435,7 +13423,7 @@ const ri = {
|
|
|
13435
13423
|
handleFinish() {
|
|
13436
13424
|
if (!this.blob)
|
|
13437
13425
|
return;
|
|
13438
|
-
const [, s] = this.blob.type.replace(/(;.*$)/, "").split("/"), t = new Date().getTime(),
|
|
13426
|
+
const [, s] = this.blob.type.replace(/(;.*$)/, "").split("/"), t = new Date().getTime(), f = `${t}.${s}`, h = new File([this.blob], f, {
|
|
13439
13427
|
type: this.blob.type,
|
|
13440
13428
|
lastModified: t
|
|
13441
13429
|
});
|
|
@@ -13447,13 +13435,13 @@ const ri = {
|
|
|
13447
13435
|
}
|
|
13448
13436
|
};
|
|
13449
13437
|
var ii = function() {
|
|
13450
|
-
var t = this,
|
|
13451
|
-
return
|
|
13438
|
+
var t = this, f = t._self._c;
|
|
13439
|
+
return f("div", { staticClass: "wrap", style: {
|
|
13452
13440
|
width: t.width
|
|
13453
|
-
} }, [
|
|
13441
|
+
} }, [f("div", { staticClass: "record-video" }, [f("video", { ref: "video", staticClass: "video-item", attrs: { volume: 1, controls: "" }, domProps: { muted: !1 } }), f("div", { staticClass: "buttons" }, [t.pending ? f("a", { staticClass: "oper", attrs: { title: "停止录制" }, on: { click: t.stop } }, [f("inline-svg", { attrs: { src: t.icon.stop, width: 24, height: 24 } })], 1) : f("a", { staticClass: "oper", attrs: { title: "开始录制" }, on: { click: t.start } }, [f("inline-svg", { attrs: { src: t.icon.record, width: 24, height: 24 } })], 1), f("a", { staticClass: "btn", class: {
|
|
13454
13442
|
finish: !0,
|
|
13455
13443
|
disabled: !t.blob
|
|
13456
|
-
}, on: { click: t.handleFinish } }, [t._v("完成")]),
|
|
13444
|
+
}, on: { click: t.handleFinish } }, [t._v("完成")]), f("a", { staticClass: "cancel btn", on: { click: t.handleCancel } }, [t._v("取消")])])]), f("div", { staticClass: "mask", on: { click: t.handleCancel } })]);
|
|
13457
13445
|
}, ni = [], si = /* @__PURE__ */ jt(
|
|
13458
13446
|
ri,
|
|
13459
13447
|
ii,
|
|
@@ -13503,13 +13491,13 @@ const li = {
|
|
|
13503
13491
|
), this.url = this.$refs.canvas.toDataURL("image/jpeg");
|
|
13504
13492
|
},
|
|
13505
13493
|
handleFinish() {
|
|
13506
|
-
const t = `${new Date().getTime()}.jpeg`,
|
|
13507
|
-
this.$emit("finish", [
|
|
13494
|
+
const t = `${new Date().getTime()}.jpeg`, f = this.dataURLtoFile(this.url, t);
|
|
13495
|
+
this.$emit("finish", [f]), this.$emit("cancel");
|
|
13508
13496
|
},
|
|
13509
13497
|
dataURLtoFile(s, t) {
|
|
13510
|
-
let
|
|
13511
|
-
for (;
|
|
13512
|
-
Y[
|
|
13498
|
+
let f = s.split(","), h = f[0].match(/:(.*?);/)[1], U = atob(f[1]), R = U.length, Y = new Uint8Array(R);
|
|
13499
|
+
for (; R--; )
|
|
13500
|
+
Y[R] = U.charCodeAt(R);
|
|
13513
13501
|
return new File([Y], t, { type: h });
|
|
13514
13502
|
},
|
|
13515
13503
|
handleCancel() {
|
|
@@ -13518,13 +13506,13 @@ const li = {
|
|
|
13518
13506
|
}
|
|
13519
13507
|
};
|
|
13520
13508
|
var ui = function() {
|
|
13521
|
-
var t = this,
|
|
13522
|
-
return
|
|
13509
|
+
var t = this, f = t._self._c;
|
|
13510
|
+
return f("div", { staticClass: "wrap", style: {
|
|
13523
13511
|
width: t.width
|
|
13524
|
-
} }, [
|
|
13512
|
+
} }, [f("div", { staticClass: "record-video" }, [f("div", { staticClass: "record-content" }, [f("video", { ref: "video", staticClass: "video-item", attrs: { volume: 0, autoplay: "", controls: "" }, domProps: { muted: !0 } }), f("div", { staticClass: "img-item" }, [t.url ? f("img", { attrs: { src: t.url } }) : t._e()])]), f("canvas", { ref: "canvas", staticStyle: { display: "none" }, attrs: { width: "640", height: "480" } }), f("div", { staticClass: "buttons" }, [t.pending ? t._e() : f("a", { staticClass: "oper", attrs: { title: "拍照" }, on: { click: t.start } }, [f("inline-svg", { attrs: { src: t.icon.photo, width: 24, height: 24 } })], 1), f("a", { staticClass: "btn", class: {
|
|
13525
13513
|
finish: !0,
|
|
13526
13514
|
disabled: !t.url
|
|
13527
|
-
}, on: { click: t.handleFinish } }, [t._v("完成")]),
|
|
13515
|
+
}, on: { click: t.handleFinish } }, [t._v("完成")]), f("a", { staticClass: "cancel btn", on: { click: t.handleCancel } }, [t._v("取消")])])]), f("div", { staticClass: "mask", on: { click: t.handleCancel } })]);
|
|
13528
13516
|
}, ci = [], di = /* @__PURE__ */ jt(
|
|
13529
13517
|
li,
|
|
13530
13518
|
ui,
|
|
@@ -13629,8 +13617,8 @@ const Ia = "KEY_PENDING_NODES", hi = {
|
|
|
13629
13617
|
},
|
|
13630
13618
|
checkModified(s = this.note.title) {
|
|
13631
13619
|
if (!this.note.created_at) {
|
|
13632
|
-
const t = this.isEmptyContent(),
|
|
13633
|
-
this.modified = !
|
|
13620
|
+
const t = this.isEmptyContent(), f = !s;
|
|
13621
|
+
this.modified = !f || !t;
|
|
13634
13622
|
}
|
|
13635
13623
|
},
|
|
13636
13624
|
isEmptyContent() {
|
|
@@ -13717,13 +13705,13 @@ const Ia = "KEY_PENDING_NODES", hi = {
|
|
|
13717
13705
|
this.isMobile ? this.$refs.selectPhoto.click() : this.recordPhotoVisible = !0;
|
|
13718
13706
|
},
|
|
13719
13707
|
async getSize(s, t) {
|
|
13720
|
-
let
|
|
13721
|
-
t === "image" ?
|
|
13722
|
-
const { width: h, height: U } =
|
|
13708
|
+
let f = {};
|
|
13709
|
+
t === "image" ? f = await Ua(s) : t === "video" && (f = await Ha(s));
|
|
13710
|
+
const { width: h, height: U } = f, { width: R, height: Y } = Pa(h, U);
|
|
13723
13711
|
return {
|
|
13724
13712
|
origWidth: h,
|
|
13725
13713
|
origHeight: U,
|
|
13726
|
-
width:
|
|
13714
|
+
width: R,
|
|
13727
13715
|
height: Y
|
|
13728
13716
|
};
|
|
13729
13717
|
},
|
|
@@ -13736,10 +13724,10 @@ const Ia = "KEY_PENDING_NODES", hi = {
|
|
|
13736
13724
|
async handleFileUpload(s, t) {
|
|
13737
13725
|
if (!s.length)
|
|
13738
13726
|
return;
|
|
13739
|
-
const
|
|
13740
|
-
const Y =
|
|
13727
|
+
const f = Array.from(s).map(async (R) => {
|
|
13728
|
+
const Y = Ya(R.type), K = URL.createObjectURL(R);
|
|
13741
13729
|
let ve = {};
|
|
13742
|
-
switch ((Y.mainType === "image" || Y.mainType === "video") && (ve = await this.getSize(
|
|
13730
|
+
switch ((Y.mainType === "image" || Y.mainType === "video") && (ve = await this.getSize(R, Y.mainType)), Y.mainType) {
|
|
13743
13731
|
case "image":
|
|
13744
13732
|
case "audio":
|
|
13745
13733
|
case "video":
|
|
@@ -13755,19 +13743,19 @@ const Ia = "KEY_PENDING_NODES", hi = {
|
|
|
13755
13743
|
return {
|
|
13756
13744
|
uuid: Ct(),
|
|
13757
13745
|
type: "file",
|
|
13758
|
-
name:
|
|
13746
|
+
name: R.name,
|
|
13759
13747
|
content: K,
|
|
13760
|
-
size:
|
|
13748
|
+
size: R.size,
|
|
13761
13749
|
pending: !0,
|
|
13762
13750
|
hash: this.hash
|
|
13763
13751
|
};
|
|
13764
13752
|
}
|
|
13765
|
-
}), h = await Promise.all(
|
|
13766
|
-
t ? t(h) : h.forEach((
|
|
13767
|
-
this.$refs.treeEditor.appendNode(
|
|
13753
|
+
}), h = await Promise.all(f);
|
|
13754
|
+
t ? t(h) : h.forEach((R) => {
|
|
13755
|
+
this.$refs.treeEditor.appendNode(R);
|
|
13768
13756
|
});
|
|
13769
13757
|
const U = this.note.id;
|
|
13770
|
-
|
|
13758
|
+
Qa.uploadFile(s, (R, Y) => {
|
|
13771
13759
|
Y && Y.forEach((K, ve) => {
|
|
13772
13760
|
const be = h[ve], Me = K.data;
|
|
13773
13761
|
if (K.code === 0) {
|
|
@@ -13788,13 +13776,13 @@ const Ia = "KEY_PENDING_NODES", hi = {
|
|
|
13788
13776
|
});
|
|
13789
13777
|
},
|
|
13790
13778
|
savePendingNodes(s, t) {
|
|
13791
|
-
const
|
|
13792
|
-
h.push(t), window.localStorage.setItem(
|
|
13779
|
+
const f = `${Ia}_${s}`, h = JSON.parse(window.localStorage.getItem(f) || "[]");
|
|
13780
|
+
h.push(t), window.localStorage.setItem(f, JSON.stringify(h));
|
|
13793
13781
|
},
|
|
13794
13782
|
restorePendingNodes(s) {
|
|
13795
|
-
const t = `${Ia}_${s}`,
|
|
13796
|
-
|
|
13797
|
-
const h = JSON.parse(
|
|
13783
|
+
const t = `${Ia}_${s}`, f = window.localStorage.getItem(t);
|
|
13784
|
+
f && this.$nextTick(() => {
|
|
13785
|
+
const h = JSON.parse(f);
|
|
13798
13786
|
window.localStorage.removeItem(t), h.forEach((U) => {
|
|
13799
13787
|
this.$refs.treeEditor.updateNode(U);
|
|
13800
13788
|
});
|
|
@@ -13803,19 +13791,19 @@ const Ia = "KEY_PENDING_NODES", hi = {
|
|
|
13803
13791
|
}
|
|
13804
13792
|
};
|
|
13805
13793
|
var vi = function() {
|
|
13806
|
-
var t = this,
|
|
13807
|
-
return
|
|
13794
|
+
var t = this, f = t._self._c;
|
|
13795
|
+
return f("div", { class: {
|
|
13808
13796
|
"record-tree-container": !0,
|
|
13809
13797
|
"record-tree-mobile": t.isMobile
|
|
13810
|
-
} }, [
|
|
13798
|
+
} }, [f("div", { staticClass: "record-tree", on: { mouseenter: t.hideHoverNote } }, [f("RecordTitle", { attrs: { title: t.note.title, tags: t.tags, tagId: t.note.tag_id, readOnly: t.readOnly, enableDbEnter: t.enableDbEnter }, on: { focusContent: t.focusContent, change: t.handleChangeTitle, tagChange: t.handleChangeTag, file: t.handleTitleFile, dbEnter: t.handleDbEnter, input: t.checkModified } }), f("div", { staticClass: "record-tree-main" }, [f("div", { attrs: { id: "root_tree" } }, [f("TreeEditor", { ref: "treeEditor", attrs: { nodes: t.curNodes, readOnly: t.readOnly, enableDbEnter: t.enableDbEnter, hash: t.hash, isMobile: t.isMobile }, on: { change: t.handleChangeNodes, fileUpload: t.handleFileUpload, dbEnter: function(h) {
|
|
13811
13799
|
return t.$emit("dbEnter");
|
|
13812
|
-
} } })], 1)])], 1), t.bar ?
|
|
13800
|
+
} } })], 1)])], 1), t.bar ? f("div", { staticClass: "record-tree-options" }, [f("div", { staticClass: "record-tree-option-left" }, [f("div", { staticClass: "record-tree-option-item", attrs: { title: "左缩进" }, on: { click: t.setToParent } }, [f("inline-svg", { attrs: { src: t.icon.left, width: 20, height: 20 } })], 1), f("div", { staticClass: "record-tree-option-item", attrs: { title: "右缩进" }, on: { click: t.setToChild } }, [f("inline-svg", { attrs: { src: t.icon.right, width: 20, height: 20 } })], 1), f("div", { staticClass: "record-tree-option-item", attrs: { title: "上移" }, on: { click: t.setToUp } }, [f("inline-svg", { attrs: { src: t.icon.up, width: 20, height: 20 } })], 1), f("div", { staticClass: "record-tree-option-item", attrs: { title: "移动" }, on: { click: t.setToDown } }, [f("inline-svg", { attrs: { src: t.icon.down, width: 20, height: 20 } })], 1), f("div", { staticClass: "record-tree-option-item", attrs: { title: "添加附件" }, on: { click: t.handleSelectFile } }, [f("inline-svg", { attrs: { src: t.icon.attach, width: 20, height: 20 } })], 1), f("div", { staticClass: "record-tree-option-item", attrs: { title: "录制音频" }, on: { click: t.handleRecordAudio } }, [f("inline-svg", { attrs: { src: t.icon.audio, width: 20, height: 20 } })], 1), f("div", { staticClass: "record-tree-option-item", attrs: { title: "录制视频" }, on: { click: t.handleRecordVideo } }, [f("inline-svg", { attrs: { src: t.icon.video, width: 20, height: 20 } })], 1), f("div", { staticClass: "record-tree-option-item", attrs: { title: "拍照" }, on: { click: t.handleRecordPhoto } }, [f("inline-svg", { attrs: { src: t.icon.photo, width: 20, height: 20 } })], 1)]), t.isMobile ? f("div", { staticClass: "record-tree-option-right" }, [f("div", { staticClass: "record-tree-option-item", on: { click: function(h) {
|
|
13813
13801
|
return h.stopPropagation(), t.handleComplete.apply(null, arguments);
|
|
13814
|
-
} } }, [t._v(" " + t._s(t.modified || t.note.created_at ? "完成" : "取消") + " ")])]) : t._e(),
|
|
13802
|
+
} } }, [t._v(" " + t._s(t.modified || t.note.created_at ? "完成" : "取消") + " ")])]) : t._e(), f("div", { staticStyle: { display: "none" } }, [f("input", { ref: "selectFile", attrs: { type: "file" }, on: { change: (h) => t.handleFileUpload(h.target.files) } }), f("input", { ref: "selectPhoto", attrs: { type: "file", accept: "image/*", capture: "camera" }, on: { change: (h) => t.handleFileUpload(h.target.files) } }), f("input", { ref: "selectVideo", attrs: { type: "file", accept: "video/*", capture: "camcorder" }, on: { change: (h) => t.handleFileUpload(h.target.files) } })])]) : t._e(), t.recordAudioVisible ? f("RecordAudio", { attrs: { isMobile: t.isMobile, responsive: t.responsive }, on: { finish: t.handleFinishAudio, cancel: function(h) {
|
|
13815
13803
|
t.recordAudioVisible = !1;
|
|
13816
|
-
} } }) : t._e(), t.recordVideoVisible ?
|
|
13804
|
+
} } }) : t._e(), t.recordVideoVisible ? f("RecordVideo", { attrs: { responsive: t.responsive }, on: { finish: t.handleFileUpload, cancel: function(h) {
|
|
13817
13805
|
t.recordVideoVisible = !1;
|
|
13818
|
-
} } }) : t._e(), t.recordPhotoVisible ?
|
|
13806
|
+
} } }) : t._e(), t.recordPhotoVisible ? f("RecordPhoto", { attrs: { responsive: t.responsive }, on: { finish: t.handleFileUpload, cancel: function(h) {
|
|
13819
13807
|
t.recordPhotoVisible = !1;
|
|
13820
13808
|
} } }) : t._e()], 1);
|
|
13821
13809
|
}, _i = [], mi = /* @__PURE__ */ jt(
|
|
@@ -13830,5 +13818,8 @@ var vi = function() {
|
|
|
13830
13818
|
);
|
|
13831
13819
|
const gi = mi.exports;
|
|
13832
13820
|
export {
|
|
13833
|
-
|
|
13821
|
+
ti as RecordAudio,
|
|
13822
|
+
fi as RecordPhoto,
|
|
13823
|
+
gi as RecordTree,
|
|
13824
|
+
oi as RecordVideo
|
|
13834
13825
|
};
|