@codernote/record-tree 1.6.0 → 1.6.2
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 -867
- 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-448e18a2]{display:flex;align-items:center;position:relative}.node-text[data-v-448e18a2]{margin-left:5px;flex:1;border:none;outline:none;word-break:break-all}.node-icon[data-v-448e18a2]{position:relative;width:17px;height:17px;border-radius:10px;background-color:#fff;cursor:pointer;margin-left:5px;align-self:flex-start;top:3px}.node-icon[data-v-448e18a2]:after{content:"";position:absolute;top:5px;left:5px;width:7px;height:7px;border-radius:10px;background-color:#eee}.node-icon[data-v-448e18a2]:hover{background-color:#ccc}.node-complex[data-v-448e18a2]{display:flex;flex-direction:row;align-self:center;justify-self:center;outline:none}.holder[data-v-448e18a2]{width:0px;overflow:hidden;border-width:1px;border-style:solid;border-color:transparent;outline:none}.node-element[data-v-448e18a2]{display:inline-block;position:relative;margin:5px 1px}.node-element:hover .node-del[data-v-448e18a2]{display:block}.node-image img[data-v-448e18a2]{outline:none}.node-audio[data-v-448e18a2]{width:300px}.node-audio audio[data-v-448e18a2]{width:300px;outline:none}.node-video video[data-v-448e18a2]{outline:none}.node-del[data-v-448e18a2]{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-448e18a2]:before,.node-del[data-v-448e18a2]:after{content:"";position:absolute;top:50%;left:50%;width:2px;height:10px;background-color:#595959}.node-del[data-v-448e18a2]:before{transform:translate(-50%,-50%) rotate(45deg)}.node-del[data-v-448e18a2]:after{transform:translate(-50%,-50%) rotate(-45deg)}.node-file-wrap[data-v-448e18a2]{width:260px;padding:10px 16px;display:flex;background:#f2f2f2;border-radius:5px;justify-content:center;align-items:center}.node-file-left[data-v-448e18a2]{flex:1}.node-file-left h6[data-v-448e18a2]{font-size:14px;font-weight:700;margin:0 0 5px;padding:0;white-space:nowrap}.node-file-left p[data-v-448e18a2]{margin:0;padding:0;font-size:12px;color:#999}.node-file-right a[data-v-448e18a2]{color:#52a770;font-size:14px}@keyframes blinkBorder-448e18a2{0%,to{border-color:transparent}50%{border-color:#333}}.node-complex .holder[data-v-448e18a2]:focus{animation:blinkBorder-448e18a2 1s infinite}.resize-handle[data-v-448e18a2]{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,10 @@ const cr = {
|
|
|
391
379
|
}
|
|
392
380
|
};
|
|
393
381
|
var dr = function() {
|
|
394
|
-
var t = this,
|
|
395
|
-
return
|
|
396
|
-
"node-icon": !0,
|
|
397
|
-
"node-icon-complex": !!t.node.type
|
|
398
|
-
}, on: { click: function(h) {
|
|
382
|
+
var t = this, f = t._self._c;
|
|
383
|
+
return f("div", { ref: "row", staticClass: "node-div" }, [f("span", { staticClass: "node-icon", on: { click: function(h) {
|
|
399
384
|
return h.stopPropagation(), t.$emit("collapse", t.node);
|
|
400
|
-
} } }), t.node.type ?
|
|
385
|
+
} } }), t.node.type ? f("div", { ref: "element", staticClass: "node-text", attrs: { contenteditable: !t.readOnly }, on: { compositionstart: function(h) {
|
|
401
386
|
return h.stopPropagation(), t.handleCompositionStart.apply(null, arguments);
|
|
402
387
|
}, compositionend: function(h) {
|
|
403
388
|
return h.stopPropagation(), t.handleCompositionEnd.apply(null, arguments);
|
|
@@ -407,11 +392,11 @@ var dr = function() {
|
|
|
407
392
|
return h.stopPropagation(), h.target !== h.currentTarget ? null : t.handleFocus.apply(null, arguments);
|
|
408
393
|
}, click: function(h) {
|
|
409
394
|
return h.stopPropagation(), t.handleFocusHolder.apply(null, arguments);
|
|
410
|
-
} } }, [
|
|
395
|
+
} } }, [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
396
|
return h.preventDefault(), h.stopPropagation(), t.handleResize.apply(null, arguments);
|
|
412
|
-
} } }, [
|
|
397
|
+
} } }, [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
398
|
return h.stopPropagation(), t.remove.apply(null, arguments);
|
|
414
|
-
} } })]),
|
|
399
|
+
} } })]), 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
400
|
return h.stopPropagation(), t.handleCompositionStart.apply(null, arguments);
|
|
416
401
|
}, compositionend: function(h) {
|
|
417
402
|
return h.stopPropagation(), t.handleCompositionEnd.apply(null, arguments);
|
|
@@ -430,7 +415,7 @@ var dr = function() {
|
|
|
430
415
|
fr,
|
|
431
416
|
!1,
|
|
432
417
|
null,
|
|
433
|
-
"
|
|
418
|
+
"448e18a2",
|
|
434
419
|
null,
|
|
435
420
|
null
|
|
436
421
|
);
|
|
@@ -485,12 +470,12 @@ const _r = {
|
|
|
485
470
|
}
|
|
486
471
|
},
|
|
487
472
|
methods: {
|
|
488
|
-
handleDragOver:
|
|
473
|
+
handleDragOver: Za,
|
|
489
474
|
handleDragLeave: da,
|
|
490
475
|
handleDragStart(s, t) {
|
|
491
476
|
s.currentTarget.classList.add("dragging"), s.dataTransfer.setData("dragNode", JSON.stringify(t)), At.on("dragEnd", () => {
|
|
492
|
-
const
|
|
493
|
-
this.update(
|
|
477
|
+
const f = this.nodes.filter((h) => h !== t);
|
|
478
|
+
this.update(f);
|
|
494
479
|
}), At.set("dragId", t.uuid);
|
|
495
480
|
},
|
|
496
481
|
handleDragEnd(s) {
|
|
@@ -498,9 +483,9 @@ const _r = {
|
|
|
498
483
|
},
|
|
499
484
|
handleDrop(s, t) {
|
|
500
485
|
s.stopPropagation();
|
|
501
|
-
const
|
|
502
|
-
if (da(),
|
|
503
|
-
this.addFiles(
|
|
486
|
+
const f = s.dataTransfer.files;
|
|
487
|
+
if (da(), f.length)
|
|
488
|
+
this.addFiles(f, t);
|
|
504
489
|
else {
|
|
505
490
|
let h = s.dataTransfer.getData("dragNode");
|
|
506
491
|
const U = La(s);
|
|
@@ -513,42 +498,42 @@ const _r = {
|
|
|
513
498
|
fa(t, h) || // 拖拽到自己的父节点
|
|
514
499
|
fa(h, t))
|
|
515
500
|
return;
|
|
516
|
-
let
|
|
517
|
-
if (
|
|
518
|
-
this.update(
|
|
501
|
+
let R = [...this.nodes];
|
|
502
|
+
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(() => {
|
|
503
|
+
this.update(R);
|
|
519
504
|
})), U === "top") {
|
|
520
|
-
const Y =
|
|
521
|
-
|
|
505
|
+
const Y = R.findIndex((K) => K === t);
|
|
506
|
+
R.splice(Y, 0, h), this.update(R);
|
|
522
507
|
}
|
|
523
508
|
if (U === "bottom") {
|
|
524
|
-
const Y =
|
|
525
|
-
|
|
509
|
+
const Y = R.findIndex((K) => K === t);
|
|
510
|
+
R.splice(Y + 1, 0, h), this.update(R);
|
|
526
511
|
}
|
|
527
512
|
}
|
|
528
513
|
},
|
|
529
514
|
handlePaste(s, t) {
|
|
530
|
-
const
|
|
531
|
-
if (
|
|
532
|
-
const U = [...this.nodes],
|
|
515
|
+
const f = s.clipboardData.files, h = s.target;
|
|
516
|
+
if (f.length == 0) {
|
|
517
|
+
const U = [...this.nodes], R = U.findIndex((Y) => Y === t);
|
|
533
518
|
setTimeout(() => {
|
|
534
|
-
t.text !== h.innerText && (U[
|
|
519
|
+
t.text !== h.innerText && (U[R] = {
|
|
535
520
|
...t,
|
|
536
521
|
text: h.innerText
|
|
537
522
|
}, this.update(U));
|
|
538
523
|
}, 0);
|
|
539
524
|
return;
|
|
540
525
|
}
|
|
541
|
-
this.addFiles(
|
|
526
|
+
this.addFiles(f, t), s.preventDefault();
|
|
542
527
|
},
|
|
543
528
|
handleTab(s, t) {
|
|
544
|
-
var
|
|
529
|
+
var R;
|
|
545
530
|
s.preventDefault();
|
|
546
|
-
const
|
|
531
|
+
const f = [...this.nodes], h = f.findIndex((Y) => Y === t), U = kt();
|
|
547
532
|
if (s.shiftKey)
|
|
548
533
|
this.$emit("transfer", t);
|
|
549
534
|
else if (h > 0) {
|
|
550
535
|
const Y = this.nodes[h - 1];
|
|
551
|
-
(
|
|
536
|
+
(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
537
|
} else
|
|
553
538
|
s.target.focus();
|
|
554
539
|
this.$nextTick(() => {
|
|
@@ -556,22 +541,22 @@ const _r = {
|
|
|
556
541
|
});
|
|
557
542
|
},
|
|
558
543
|
handleRemove(s) {
|
|
559
|
-
const t = this.nodes.filter((
|
|
544
|
+
const t = this.nodes.filter((f) => f.uuid !== s.uuid);
|
|
560
545
|
if (!this.allowEmpty && this.nodes.length === 1) {
|
|
561
|
-
const
|
|
546
|
+
const f = {
|
|
562
547
|
text: "",
|
|
563
548
|
uuid: Ct()
|
|
564
549
|
};
|
|
565
|
-
t.push(
|
|
566
|
-
this.toFocus(
|
|
550
|
+
t.push(f), setTimeout(() => {
|
|
551
|
+
this.toFocus(f);
|
|
567
552
|
}, 200);
|
|
568
553
|
}
|
|
569
554
|
this.update(t);
|
|
570
555
|
},
|
|
571
556
|
// 节点跨父级移动
|
|
572
557
|
handleTransfer(s, t) {
|
|
573
|
-
const
|
|
574
|
-
s.children.splice(U, 1),
|
|
558
|
+
const f = [...this.nodes], h = f.findIndex((R) => R === s), U = s.children.findIndex((R) => R === t);
|
|
559
|
+
s.children.splice(U, 1), f.splice(h + 1, 0, t), this.update(f);
|
|
575
560
|
},
|
|
576
561
|
handleEnter(s) {
|
|
577
562
|
this.enableDbEnter ? this.timeout ? (clearTimeout(this.timeout), this.timeout = null, this.handleDbEnter()) : this.timeout = setTimeout(() => {
|
|
@@ -582,39 +567,39 @@ const _r = {
|
|
|
582
567
|
this.$emit("dbEnter");
|
|
583
568
|
},
|
|
584
569
|
keyEnter(s) {
|
|
585
|
-
const t = ca(s),
|
|
570
|
+
const t = ca(s), f = this.nodes.findIndex((Y) => Y.uuid === s.uuid), h = kt(), U = [...this.nodes], R = { text: "", uuid: Ct() };
|
|
586
571
|
if (t)
|
|
587
|
-
U.splice(
|
|
572
|
+
U.splice(f + 1, 0, R);
|
|
588
573
|
else {
|
|
589
574
|
let Y = s.text.replace(/ ?/g, " ");
|
|
590
|
-
s.text = Y.slice(0, h),
|
|
575
|
+
s.text = Y.slice(0, h), R.text = Y.slice(h, Y.length), U.splice(f + 1, 0, R);
|
|
591
576
|
}
|
|
592
577
|
this.update(U), this.$nextTick(() => {
|
|
593
|
-
const Y = Nt(
|
|
578
|
+
const Y = Nt(R);
|
|
594
579
|
Y == null || Y.focus();
|
|
595
580
|
});
|
|
596
581
|
},
|
|
597
582
|
// 聚焦上一节点
|
|
598
583
|
toPrevFocus(s, t = !1) {
|
|
599
584
|
var U;
|
|
600
|
-
let
|
|
601
|
-
const h = this.nodes.findIndex((
|
|
585
|
+
let f = kt();
|
|
586
|
+
const h = this.nodes.findIndex((R) => R === s);
|
|
602
587
|
if (h === 0)
|
|
603
588
|
this.$emit("focusPrev", t);
|
|
604
589
|
else {
|
|
605
|
-
const
|
|
590
|
+
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
591
|
Lt(
|
|
607
592
|
K,
|
|
608
|
-
ve ? K.innerText.length :
|
|
593
|
+
ve ? K.innerText.length : f,
|
|
609
594
|
ve
|
|
610
595
|
);
|
|
611
596
|
}
|
|
612
597
|
},
|
|
613
598
|
// 聚焦下一节点
|
|
614
|
-
toNextFocus(s, t = !1,
|
|
615
|
-
var
|
|
599
|
+
toNextFocus(s, t = !1, f = !1) {
|
|
600
|
+
var R;
|
|
616
601
|
const h = kt(), U = this.nodes.findIndex((Y) => Y === s);
|
|
617
|
-
if (
|
|
602
|
+
if (f && ((R = s.children) != null && R.length) && !this.status[s.uuid].collapsed) {
|
|
618
603
|
const Y = Nt(s.children[0]);
|
|
619
604
|
Lt(Y, t ? 0 : h);
|
|
620
605
|
} else if (U + 1 >= this.nodes.length)
|
|
@@ -626,16 +611,16 @@ const _r = {
|
|
|
626
611
|
},
|
|
627
612
|
// 聚焦到指定节点
|
|
628
613
|
toFocus(s, t = !1) {
|
|
629
|
-
let
|
|
614
|
+
let f = kt();
|
|
630
615
|
const h = Nt(s);
|
|
631
|
-
Lt(h,
|
|
616
|
+
Lt(h, f, t);
|
|
632
617
|
},
|
|
633
618
|
addFiles(s, t) {
|
|
634
619
|
if (s) {
|
|
635
|
-
const h = Array.from(s).slice(0, 5), U = (
|
|
620
|
+
const h = Array.from(s).slice(0, 5), U = (R) => {
|
|
636
621
|
const Y = [...this.nodes];
|
|
637
622
|
let K = Y.findIndex((ve) => ve === t);
|
|
638
|
-
|
|
623
|
+
R.forEach((ve, be) => {
|
|
639
624
|
!t.text && !t.content && be === 0 ? (ve.uuid = t.uuid, Y.splice(K, 1, {
|
|
640
625
|
...ve,
|
|
641
626
|
uuid: t.uuid,
|
|
@@ -652,14 +637,14 @@ const _r = {
|
|
|
652
637
|
head(s = !1) {
|
|
653
638
|
const t = Nt(this.nodes[0]);
|
|
654
639
|
if (s && t) {
|
|
655
|
-
const
|
|
656
|
-
|
|
640
|
+
const f = t.querySelector(".holder-right");
|
|
641
|
+
f ? f.focus() : t.focus();
|
|
657
642
|
}
|
|
658
643
|
return t;
|
|
659
644
|
},
|
|
660
645
|
// dfs查找并追加节点
|
|
661
|
-
appendNode(s, t = !1,
|
|
662
|
-
const h = At.get("currentId"), U = [...
|
|
646
|
+
appendNode(s, t = !1, f = this.nodes) {
|
|
647
|
+
const h = At.get("currentId"), U = [...f];
|
|
663
648
|
if (!t && (!h || !document.getElementById(h))) {
|
|
664
649
|
const Y = U[U.length - 1];
|
|
665
650
|
!(Y != null && Y.type) && !Y.text ? U[U.length - 1] = {
|
|
@@ -668,13 +653,13 @@ const _r = {
|
|
|
668
653
|
} : U.push(s), this.update(U);
|
|
669
654
|
return;
|
|
670
655
|
}
|
|
671
|
-
const
|
|
672
|
-
if (
|
|
673
|
-
const Y = U[
|
|
674
|
-
!(Y != null && Y.type) && !Y.text ? U[
|
|
656
|
+
const R = U.findIndex((Y) => Y.uuid === h);
|
|
657
|
+
if (R >= 0) {
|
|
658
|
+
const Y = U[R];
|
|
659
|
+
!(Y != null && Y.type) && !Y.text ? U[R] = {
|
|
675
660
|
...Y,
|
|
676
661
|
...s
|
|
677
|
-
} : U.splice(
|
|
662
|
+
} : U.splice(R + 1, 0, s);
|
|
678
663
|
} else
|
|
679
664
|
U.forEach((Y) => {
|
|
680
665
|
var K;
|
|
@@ -683,11 +668,11 @@ const _r = {
|
|
|
683
668
|
return t || this.update(U), U;
|
|
684
669
|
},
|
|
685
670
|
// dfs查找并更新节点
|
|
686
|
-
updateNode(s, t = !1,
|
|
687
|
-
const h = [...
|
|
688
|
-
return U >= 0 ? h[U] = s : h.forEach((
|
|
671
|
+
updateNode(s, t = !1, f = this.nodes) {
|
|
672
|
+
const h = [...f], U = h.findIndex((R) => R.uuid === s.uuid);
|
|
673
|
+
return U >= 0 ? h[U] = s : h.forEach((R) => {
|
|
689
674
|
var Y;
|
|
690
|
-
(Y =
|
|
675
|
+
(Y = R.children) != null && Y.length && (R.children = this.updateNode(s, !0, R.children));
|
|
691
676
|
}), t || this.update(h), h;
|
|
692
677
|
},
|
|
693
678
|
filterNodes(s) {
|
|
@@ -698,8 +683,8 @@ const _r = {
|
|
|
698
683
|
let s = !1;
|
|
699
684
|
this.nodes.forEach((t) => {
|
|
700
685
|
if (t.uuid || (t.uuid = Ct(), s = !0), ca(t) && !t.type) {
|
|
701
|
-
const
|
|
702
|
-
|
|
686
|
+
const f = qa(t.text);
|
|
687
|
+
f && (t.type = f.type, t.content = f.content), s = !0;
|
|
703
688
|
}
|
|
704
689
|
}), s ? this.update() : this.ensureStatus(this.nodes);
|
|
705
690
|
},
|
|
@@ -717,7 +702,7 @@ const _r = {
|
|
|
717
702
|
// 更新node节点
|
|
718
703
|
// 用于Node组件触发change
|
|
719
704
|
handleNodeChange(s) {
|
|
720
|
-
const t = this.nodes.map((
|
|
705
|
+
const t = this.nodes.map((f) => f.uuid === s.uuid ? s : f);
|
|
721
706
|
this.update(t);
|
|
722
707
|
},
|
|
723
708
|
update(s = this.nodes) {
|
|
@@ -726,22 +711,22 @@ const _r = {
|
|
|
726
711
|
}
|
|
727
712
|
};
|
|
728
713
|
var mr = function() {
|
|
729
|
-
var t = this,
|
|
730
|
-
return t.readOnly ?
|
|
714
|
+
var t = this, f = t._self._c;
|
|
715
|
+
return t.readOnly ? f("ul", { class: {
|
|
731
716
|
"node-ul": !0,
|
|
732
717
|
readOnly: !0,
|
|
733
718
|
sublevel: !0
|
|
734
719
|
} }, t._l(t.filterNodes(t.nodes), function(h) {
|
|
735
|
-
return
|
|
720
|
+
return f("li", { key: h.uuid, class: {
|
|
736
721
|
"node-li": !0,
|
|
737
722
|
collapsed: t.status[h.uuid] ? t.status[h.uuid].collapsed : !1,
|
|
738
723
|
"has-child": !!(h.children || []).length
|
|
739
|
-
}, attrs: { id: `${h.uuid}` } }, [
|
|
740
|
-
}), 0) :
|
|
724
|
+
}, 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);
|
|
725
|
+
}), 0) : f("ul", { class: {
|
|
741
726
|
"node-ul": !0,
|
|
742
727
|
sublevel: !0
|
|
743
728
|
} }, t._l(t.filterNodes(t.nodes), function(h) {
|
|
744
|
-
return
|
|
729
|
+
return f("li", { key: h.uuid, ref: "elements", refInFor: !0, class: {
|
|
745
730
|
"node-li": !0,
|
|
746
731
|
collapsed: t.status[h.uuid] ? t.status[h.uuid].collapsed : !1,
|
|
747
732
|
"has-child": !!(h.children || []).length
|
|
@@ -757,7 +742,7 @@ var mr = function() {
|
|
|
757
742
|
return U.stopPropagation(), t.handleDragLeave(U, h);
|
|
758
743
|
}, paste: function(U) {
|
|
759
744
|
return U.stopPropagation(), t.handlePaste(U, h);
|
|
760
|
-
} } }, [
|
|
745
|
+
} } }, [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
746
|
}), 0);
|
|
762
747
|
}, pr = [], br = /* @__PURE__ */ jt(
|
|
763
748
|
_r,
|
|
@@ -772,15 +757,15 @@ var mr = function() {
|
|
|
772
757
|
const Mr = br.exports;
|
|
773
758
|
const gr = {
|
|
774
759
|
components: {
|
|
775
|
-
Popper:
|
|
760
|
+
Popper: Va
|
|
776
761
|
}
|
|
777
762
|
};
|
|
778
763
|
var wr = function() {
|
|
779
|
-
var t = this,
|
|
780
|
-
return
|
|
764
|
+
var t = this, f = t._self._c;
|
|
765
|
+
return f("Popper", { attrs: { trigger: "hover", options: {
|
|
781
766
|
placement: "bottom",
|
|
782
767
|
modifiers: { offset: { offset: "0px, 22px" } }
|
|
783
|
-
} } }, [t._t("default"),
|
|
768
|
+
} } }, [t._t("default"), f("span", { attrs: { slot: "reference" }, slot: "reference" }, [t._t("trigger")], 2)], 2);
|
|
784
769
|
}, yr = [], Tr = /* @__PURE__ */ jt(
|
|
785
770
|
gr,
|
|
786
771
|
wr,
|
|
@@ -852,10 +837,10 @@ const Ar = {
|
|
|
852
837
|
computed: {
|
|
853
838
|
curTag() {
|
|
854
839
|
var t;
|
|
855
|
-
const s = this.tags.find((
|
|
840
|
+
const s = this.tags.find((f) => f.created_at === this.tagId);
|
|
856
841
|
return {
|
|
857
842
|
...s,
|
|
858
|
-
icon: s ? (t =
|
|
843
|
+
icon: s ? (t = Oa(s.icon)) == null ? void 0 : t.value : ""
|
|
859
844
|
};
|
|
860
845
|
},
|
|
861
846
|
tagNames() {
|
|
@@ -879,14 +864,14 @@ const Ar = {
|
|
|
879
864
|
},
|
|
880
865
|
// 根据svg的icon名找到svg实体
|
|
881
866
|
getSvgUrl(s) {
|
|
882
|
-
const t =
|
|
867
|
+
const t = Fa.find((f) => f.name === s.icon);
|
|
883
868
|
return (t == null ? void 0 : t.value) || "";
|
|
884
869
|
},
|
|
885
870
|
setCursorToPosition(s) {
|
|
886
871
|
const t = this.$refs.treeTitle;
|
|
887
872
|
if (t && t.contentEditable) {
|
|
888
|
-
var
|
|
889
|
-
|
|
873
|
+
var f = document.createRange(), h = window.getSelection();
|
|
874
|
+
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
875
|
}
|
|
891
876
|
},
|
|
892
877
|
// 选择tag图标
|
|
@@ -906,12 +891,12 @@ const Ar = {
|
|
|
906
891
|
},
|
|
907
892
|
handleTitleChange(s) {
|
|
908
893
|
const t = (s.target.innerText || "").replace(/\n/g, "");
|
|
909
|
-
this.$emit("input", t), this.isComposition || this.tagNames.forEach((
|
|
910
|
-
const h = new RegExp(`^(${
|
|
894
|
+
this.$emit("input", t), this.isComposition || this.tagNames.forEach((f) => {
|
|
895
|
+
const h = new RegExp(`^(${f}[::])`), U = new RegExp(`([::]${f})$`);
|
|
911
896
|
if (h.test(t) || U.test(t)) {
|
|
912
897
|
s.target.innerText = t.replace(h, "").replace(U, ""), this.setCursorToPosition(h.test(t) ? "start" : "end");
|
|
913
|
-
const
|
|
914
|
-
this.tagSelect(
|
|
898
|
+
const R = this.tags.find((Y) => Y.name === f);
|
|
899
|
+
this.tagSelect(R);
|
|
915
900
|
}
|
|
916
901
|
}), this.titleEmpty = !t;
|
|
917
902
|
},
|
|
@@ -935,30 +920,30 @@ const Ar = {
|
|
|
935
920
|
}
|
|
936
921
|
};
|
|
937
922
|
var Dr = function() {
|
|
938
|
-
var t = this,
|
|
939
|
-
return
|
|
940
|
-
return [
|
|
941
|
-
return
|
|
923
|
+
var t = this, f = t._self._c;
|
|
924
|
+
return f("div", { staticClass: "record-tree-title-bar" }, [t.tags.length ? f("Picker", { scopedSlots: t._u([t.readOnly ? null : { key: "default", fn: function() {
|
|
925
|
+
return [f("div", { staticClass: "record-tree-popper-content", style: { width: t.tagConfig.popW, height: t.tagConfig.popH } }, t._l(t.tags, function(h, U) {
|
|
926
|
+
return f("span", { key: U, staticClass: "record-tree-popper-content-item", on: { click: function(R) {
|
|
942
927
|
return t.tagSelect(h);
|
|
943
|
-
} } }, [t.getSvgUrl(h) ?
|
|
928
|
+
} } }, [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
929
|
width: t.tagConfig.tagSize + "px",
|
|
945
930
|
height: t.tagConfig.tagSize + "px",
|
|
946
931
|
backgroundColor: h.color
|
|
947
932
|
} })], 1);
|
|
948
933
|
}), 0)];
|
|
949
934
|
}, proxy: !0 }, { key: "trigger", fn: function() {
|
|
950
|
-
return [
|
|
935
|
+
return [f("span", { staticClass: "record-tree-popper-reference", style: {
|
|
951
936
|
backgroundColor: t.curTag.color,
|
|
952
937
|
top: t.tagConfig.tagT,
|
|
953
938
|
left: t.tagConfig.tagL
|
|
954
|
-
} }, [t.curTag.icon ?
|
|
939
|
+
} }, [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
940
|
width: t.tagConfig.tagSize + "px",
|
|
956
941
|
height: t.tagConfig.tagSize + "px",
|
|
957
942
|
backgroundColor: t.curTag.color
|
|
958
943
|
} })], 1)];
|
|
959
|
-
}, proxy: !0 }], null, !0) }) : t._e(), t.isMobile && t.titleEmpty ?
|
|
944
|
+
}, proxy: !0 }], null, !0) }) : t._e(), t.isMobile && t.titleEmpty ? f("div", { staticClass: "record-tree-placeholder", on: { click: function(h) {
|
|
960
945
|
return t.$refs.treeTitle.focus();
|
|
961
|
-
} } }, [t._v(" 请输入标题 ")]) : t._e(),
|
|
946
|
+
} } }, [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
947
|
h.stopPropagation();
|
|
963
948
|
}, keydown: function(h) {
|
|
964
949
|
return !h.type.indexOf("key") && t._k(h.keyCode, "enter", 13, h.key, "Enter") ? null : (h.preventDefault(), t.handleTitleEnter.apply(null, arguments));
|
|
@@ -980,27 +965,27 @@ function Rr(s) {
|
|
|
980
965
|
return s;
|
|
981
966
|
var t = s.default;
|
|
982
967
|
if (typeof t == "function") {
|
|
983
|
-
var
|
|
968
|
+
var f = function h() {
|
|
984
969
|
if (this instanceof h) {
|
|
985
970
|
var U = [null];
|
|
986
971
|
U.push.apply(U, arguments);
|
|
987
|
-
var
|
|
988
|
-
return new
|
|
972
|
+
var R = Function.bind.apply(t, U);
|
|
973
|
+
return new R();
|
|
989
974
|
}
|
|
990
975
|
return t.apply(this, arguments);
|
|
991
976
|
};
|
|
992
|
-
|
|
977
|
+
f.prototype = t.prototype;
|
|
993
978
|
} else
|
|
994
|
-
|
|
995
|
-
return Object.defineProperty(
|
|
979
|
+
f = {};
|
|
980
|
+
return Object.defineProperty(f, "__esModule", { value: !0 }), Object.keys(s).forEach(function(h) {
|
|
996
981
|
var U = Object.getOwnPropertyDescriptor(s, h);
|
|
997
|
-
Object.defineProperty(
|
|
982
|
+
Object.defineProperty(f, h, U.get ? U : {
|
|
998
983
|
enumerable: !0,
|
|
999
984
|
get: function() {
|
|
1000
985
|
return s[h];
|
|
1001
986
|
}
|
|
1002
987
|
});
|
|
1003
|
-
}),
|
|
988
|
+
}), f;
|
|
1004
989
|
}
|
|
1005
990
|
var ha = {}, Lr = {
|
|
1006
991
|
get exports() {
|
|
@@ -1028,26 +1013,26 @@ const kr = {}, jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
1028
1013
|
var Da;
|
|
1029
1014
|
function ta() {
|
|
1030
1015
|
return Da || (Da = 1, function(s, t) {
|
|
1031
|
-
(function(
|
|
1016
|
+
(function(f, h) {
|
|
1032
1017
|
s.exports = h();
|
|
1033
1018
|
})(st, function() {
|
|
1034
|
-
var
|
|
1035
|
-
var
|
|
1036
|
-
if (typeof window < "u" && window.crypto && (
|
|
1019
|
+
var f = f || function(h, U) {
|
|
1020
|
+
var R;
|
|
1021
|
+
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
1022
|
try {
|
|
1038
|
-
|
|
1023
|
+
R = zr;
|
|
1039
1024
|
} catch {
|
|
1040
1025
|
}
|
|
1041
1026
|
var Y = function() {
|
|
1042
|
-
if (
|
|
1043
|
-
if (typeof
|
|
1027
|
+
if (R) {
|
|
1028
|
+
if (typeof R.getRandomValues == "function")
|
|
1044
1029
|
try {
|
|
1045
|
-
return
|
|
1030
|
+
return R.getRandomValues(new Uint32Array(1))[0];
|
|
1046
1031
|
} catch {
|
|
1047
1032
|
}
|
|
1048
|
-
if (typeof
|
|
1033
|
+
if (typeof R.randomBytes == "function")
|
|
1049
1034
|
try {
|
|
1050
|
-
return
|
|
1035
|
+
return R.randomBytes(4).readInt32LE();
|
|
1051
1036
|
} catch {
|
|
1052
1037
|
}
|
|
1053
1038
|
}
|
|
@@ -1522,7 +1507,7 @@ function ta() {
|
|
|
1522
1507
|
var Ue = ve.algo = {};
|
|
1523
1508
|
return ve;
|
|
1524
1509
|
}(Math);
|
|
1525
|
-
return
|
|
1510
|
+
return f;
|
|
1526
1511
|
});
|
|
1527
1512
|
}(Br)), Kt;
|
|
1528
1513
|
}
|
|
@@ -1536,11 +1521,11 @@ var Jt = {}, Or = {
|
|
|
1536
1521
|
}, Na;
|
|
1537
1522
|
function Fr() {
|
|
1538
1523
|
return Na || (Na = 1, function(s, t) {
|
|
1539
|
-
(function(
|
|
1524
|
+
(function(f, h) {
|
|
1540
1525
|
s.exports = h(ta());
|
|
1541
|
-
})(st, function(
|
|
1526
|
+
})(st, function(f) {
|
|
1542
1527
|
return function(h) {
|
|
1543
|
-
var U =
|
|
1528
|
+
var U = f, R = U.lib, Y = R.WordArray, K = R.Hasher, ve = U.algo, be = [], Me = [];
|
|
1544
1529
|
(function() {
|
|
1545
1530
|
function Ce(Ue) {
|
|
1546
1531
|
for (var E = h.sqrt(Ue), he = 2; he <= E; he++)
|
|
@@ -1581,7 +1566,7 @@ function Fr() {
|
|
|
1581
1566
|
}
|
|
1582
1567
|
});
|
|
1583
1568
|
U.SHA256 = K._createHelper(Ee), U.HmacSHA256 = K._createHmacHelper(Ee);
|
|
1584
|
-
}(Math),
|
|
1569
|
+
}(Math), f.SHA256;
|
|
1585
1570
|
});
|
|
1586
1571
|
}(Or)), Jt;
|
|
1587
1572
|
}
|
|
@@ -1595,12 +1580,12 @@ var ea = {}, Ur = {
|
|
|
1595
1580
|
}, Ca;
|
|
1596
1581
|
function Hr() {
|
|
1597
1582
|
return Ca || (Ca = 1, function(s, t) {
|
|
1598
|
-
(function(
|
|
1583
|
+
(function(f, h) {
|
|
1599
1584
|
s.exports = h(ta());
|
|
1600
|
-
})(st, function(
|
|
1585
|
+
})(st, function(f) {
|
|
1601
1586
|
(function() {
|
|
1602
|
-
var h =
|
|
1603
|
-
ve.HMAC =
|
|
1587
|
+
var h = f, U = h.lib, R = U.Base, Y = h.enc, K = Y.Utf8, ve = h.algo;
|
|
1588
|
+
ve.HMAC = R.extend({
|
|
1604
1589
|
/**
|
|
1605
1590
|
* Initializes a newly created HMAC.
|
|
1606
1591
|
*
|
|
@@ -1671,10 +1656,10 @@ function Hr() {
|
|
|
1671
1656
|
}(Ur)), ea;
|
|
1672
1657
|
}
|
|
1673
1658
|
(function(s, t) {
|
|
1674
|
-
(function(
|
|
1659
|
+
(function(f, h, U) {
|
|
1675
1660
|
s.exports = h(ta(), Fr(), Hr());
|
|
1676
|
-
})(st, function(
|
|
1677
|
-
return
|
|
1661
|
+
})(st, function(f) {
|
|
1662
|
+
return f.HmacSHA256;
|
|
1678
1663
|
});
|
|
1679
1664
|
})(Lr);
|
|
1680
1665
|
const Pr = ha;
|
|
@@ -1687,11 +1672,11 @@ var va = {}, Yr = {
|
|
|
1687
1672
|
}
|
|
1688
1673
|
};
|
|
1689
1674
|
(function(s, t) {
|
|
1690
|
-
(function(
|
|
1675
|
+
(function(f, h) {
|
|
1691
1676
|
s.exports = h(ta());
|
|
1692
|
-
})(st, function(
|
|
1677
|
+
})(st, function(f) {
|
|
1693
1678
|
return function() {
|
|
1694
|
-
var h =
|
|
1679
|
+
var h = f, U = h.lib, R = U.WordArray, Y = h.enc;
|
|
1695
1680
|
Y.Base64 = {
|
|
1696
1681
|
/**
|
|
1697
1682
|
* Converts a word array to a Base64 string.
|
|
@@ -1753,38 +1738,38 @@ var va = {}, Yr = {
|
|
|
1753
1738
|
var te = Me[ve.charCodeAt(Ce - 1)] << Ce % 4 * 2, ie = Me[ve.charCodeAt(Ce)] >>> 6 - Ce % 4 * 2, we = te | ie;
|
|
1754
1739
|
De[Ee >>> 2] |= we << 24 - Ee % 4 * 8, Ee++;
|
|
1755
1740
|
}
|
|
1756
|
-
return
|
|
1741
|
+
return R.create(De, Ee);
|
|
1757
1742
|
}
|
|
1758
|
-
}(),
|
|
1743
|
+
}(), f.enc.Base64;
|
|
1759
1744
|
});
|
|
1760
1745
|
})(Yr);
|
|
1761
1746
|
const Qr = va;
|
|
1762
1747
|
let It, Ht = "", Xt = "", Ba = null;
|
|
1763
1748
|
function Vr() {
|
|
1764
|
-
var s = "wss://iat-api.xfyun.cn/v2/iat", t = "iat-api.xfyun.cn",
|
|
1749
|
+
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
1750
|
date: ${U}
|
|
1766
|
-
GET /v2/iat HTTP/1.1`, ve = Pr(K, h), be = Qr.stringify(ve), Me = `api_key="${
|
|
1751
|
+
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
1752
|
return s = `${s}?authorization=${De}&date=${U}&host=${t}`, s;
|
|
1768
1753
|
}
|
|
1769
1754
|
function Wr(s) {
|
|
1770
|
-
for (var t = "",
|
|
1771
|
-
t += String.fromCharCode(
|
|
1755
|
+
for (var t = "", f = new Uint8Array(s), h = f.byteLength, U = 0; U < h; U++)
|
|
1756
|
+
t += String.fromCharCode(f[U]);
|
|
1772
1757
|
return t;
|
|
1773
1758
|
}
|
|
1774
1759
|
function Gr(s) {
|
|
1775
1760
|
let t = JSON.parse(s);
|
|
1776
1761
|
if (t.data && t.data.result) {
|
|
1777
|
-
let
|
|
1778
|
-
for (let
|
|
1779
|
-
h = h + U[
|
|
1780
|
-
|
|
1762
|
+
let f = t.data.result, h = "", U = f.ws;
|
|
1763
|
+
for (let R = 0; R < U.length; R++)
|
|
1764
|
+
h = h + U[R].cw[0].w;
|
|
1765
|
+
f.pgs ? (f.pgs === "apd" && (Ht = Xt), Xt = Ht + h) : Ht = Ht + h, Ba(Xt || Ht || "");
|
|
1781
1766
|
}
|
|
1782
1767
|
t.code === 0 && t.data.status === 2 && It.close(), t.code !== 0 && (It.close(), console.error(t));
|
|
1783
1768
|
}
|
|
1784
1769
|
function $r(s) {
|
|
1785
1770
|
const t = Vr();
|
|
1786
1771
|
It = new WebSocket(t), It.onopen = () => {
|
|
1787
|
-
var
|
|
1772
|
+
var f = {
|
|
1788
1773
|
common: {
|
|
1789
1774
|
app_id: "c54ef25c"
|
|
1790
1775
|
},
|
|
@@ -1801,24 +1786,24 @@ function $r(s) {
|
|
|
1801
1786
|
encoding: "lame"
|
|
1802
1787
|
}
|
|
1803
1788
|
};
|
|
1804
|
-
It.send(JSON.stringify(
|
|
1805
|
-
}, It.onmessage = (
|
|
1806
|
-
Gr(
|
|
1807
|
-
}, It.onerror = (
|
|
1808
|
-
console.error(
|
|
1789
|
+
It.send(JSON.stringify(f)), s();
|
|
1790
|
+
}, It.onmessage = (f) => {
|
|
1791
|
+
Gr(f.data);
|
|
1792
|
+
}, It.onerror = (f) => {
|
|
1793
|
+
console.error(f);
|
|
1809
1794
|
};
|
|
1810
1795
|
}
|
|
1811
1796
|
function Zr(s, t) {
|
|
1812
1797
|
It = null, Ht = "", Xt = "", Ba = t, $r(() => {
|
|
1813
|
-
const
|
|
1814
|
-
|
|
1798
|
+
const f = new FileReader();
|
|
1799
|
+
f.readAsArrayBuffer(s), f.onload = (h) => {
|
|
1815
1800
|
console.log(h.target.result);
|
|
1816
1801
|
const U = Wr(h.target.result);
|
|
1817
|
-
let
|
|
1818
|
-
for (;
|
|
1819
|
-
const Y = U.substring(
|
|
1820
|
-
|
|
1821
|
-
const K =
|
|
1802
|
+
let R = 0;
|
|
1803
|
+
for (; R < U.length; ) {
|
|
1804
|
+
const Y = U.substring(R, R + 1280);
|
|
1805
|
+
R += 1280;
|
|
1806
|
+
const K = R >= U.length;
|
|
1822
1807
|
It.send(
|
|
1823
1808
|
JSON.stringify({
|
|
1824
1809
|
data: {
|
|
@@ -1830,7 +1815,7 @@ function Zr(s, t) {
|
|
|
1830
1815
|
})
|
|
1831
1816
|
);
|
|
1832
1817
|
}
|
|
1833
|
-
},
|
|
1818
|
+
}, f.onerror = () => {
|
|
1834
1819
|
It.close();
|
|
1835
1820
|
};
|
|
1836
1821
|
});
|
|
@@ -1845,21 +1830,21 @@ var _a = {}, qr = {
|
|
|
1845
1830
|
};
|
|
1846
1831
|
(function(s) {
|
|
1847
1832
|
(function(t) {
|
|
1848
|
-
var
|
|
1849
|
-
t(h,
|
|
1850
|
-
})(function(t,
|
|
1833
|
+
var f = typeof window == "object" && !!window.document, h = f ? window : Object;
|
|
1834
|
+
t(h, f), s.exports && (s.exports = h.Recorder);
|
|
1835
|
+
})(function(t, f) {
|
|
1851
1836
|
var h = function() {
|
|
1852
1837
|
}, U = function(e) {
|
|
1853
1838
|
return typeof e == "number";
|
|
1854
|
-
},
|
|
1839
|
+
}, R = function(e) {
|
|
1855
1840
|
return new W(e);
|
|
1856
|
-
}, Y =
|
|
1841
|
+
}, 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
1842
|
if (te && te.LM == Y) {
|
|
1858
1843
|
te.CLog(te.i18n.$T("K8zP::重复导入{1}", 0, ve), 3);
|
|
1859
1844
|
return;
|
|
1860
1845
|
}
|
|
1861
|
-
|
|
1862
|
-
var e =
|
|
1846
|
+
R.IsOpen = function() {
|
|
1847
|
+
var e = R.Stream;
|
|
1863
1848
|
if (e) {
|
|
1864
1849
|
var l = e.getTracks && e.getTracks() || e.audioTracks || [], m = l[0];
|
|
1865
1850
|
if (m) {
|
|
@@ -1868,44 +1853,44 @@ var _a = {}, qr = {
|
|
|
1868
1853
|
}
|
|
1869
1854
|
}
|
|
1870
1855
|
return !1;
|
|
1871
|
-
},
|
|
1856
|
+
}, R.BufferSize = 4096, R.Destroy = function() {
|
|
1872
1857
|
He(ve + " Destroy"), Ze();
|
|
1873
1858
|
for (var e in ie)
|
|
1874
1859
|
ie[e]();
|
|
1875
1860
|
};
|
|
1876
1861
|
var ie = {};
|
|
1877
|
-
|
|
1862
|
+
R.BindDestroy = function(e, l) {
|
|
1878
1863
|
ie[e] = l;
|
|
1879
|
-
},
|
|
1880
|
-
if (!
|
|
1864
|
+
}, R.Support = function() {
|
|
1865
|
+
if (!f)
|
|
1881
1866
|
return !1;
|
|
1882
1867
|
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 (!
|
|
1868
|
+
return e[be] || (e = navigator, e[be] || (e[be] = e.webkitGetUserMedia || e.mozGetUserMedia || e.msGetUserMedia)), !(!e[be] || (R.Scope = e, !R.GetContext()));
|
|
1869
|
+
}, R.GetContext = function(e) {
|
|
1870
|
+
if (!f)
|
|
1886
1871
|
return null;
|
|
1887
1872
|
var l = window.AudioContext;
|
|
1888
1873
|
if (l || (l = window.webkitAudioContext), !l)
|
|
1889
1874
|
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
|
-
|
|
1875
|
+
var m = R.Ctx;
|
|
1876
|
+
if ((!m || m.state == "closed") && (m = R.Ctx = new l(), R.NewCtxs = R.NewCtxs || [], R.BindDestroy("Ctx", function() {
|
|
1877
|
+
var b = R.Ctx;
|
|
1878
|
+
b && b.close && (b.close(), R.Ctx = 0);
|
|
1879
|
+
var D = R.NewCtxs;
|
|
1880
|
+
R.NewCtxs = [];
|
|
1896
1881
|
for (var Z = 0; Z < D.length; Z++)
|
|
1897
1882
|
D[Z].close();
|
|
1898
1883
|
})), e && m.close)
|
|
1899
1884
|
try {
|
|
1900
|
-
m = new l(),
|
|
1885
|
+
m = new l(), R.NewCtxs.push(m);
|
|
1901
1886
|
} catch (b) {
|
|
1902
1887
|
He("GetContext tryNew Error", 1, b);
|
|
1903
1888
|
}
|
|
1904
1889
|
return m;
|
|
1905
|
-
},
|
|
1906
|
-
if (e && e !=
|
|
1890
|
+
}, R.CloseNewCtx = function(e) {
|
|
1891
|
+
if (e && e != R.Ctx) {
|
|
1907
1892
|
e.close && e.close();
|
|
1908
|
-
for (var l =
|
|
1893
|
+
for (var l = R.NewCtxs || [], m = l.length, b = 0; b < l.length; b++)
|
|
1909
1894
|
if (l[b] == e) {
|
|
1910
1895
|
l.splice(b, 1);
|
|
1911
1896
|
break;
|
|
@@ -1917,11 +1902,11 @@ var _a = {}, qr = {
|
|
|
1917
1902
|
var l = e.state, m = "ctx.state=" + l;
|
|
1918
1903
|
return l == "suspended" && (m += Be("nMIy::(注意:ctx不是running状态,rec.open和start至少要有一个在用户操作(触摸、点击等)时进行调用,否则将在rec.start时尝试进行ctx.resume,可能会产生兼容性问题(仅iOS),请参阅文档中runningContext配置)")), m;
|
|
1919
1904
|
}, Ue = "ConnectEnableWebM";
|
|
1920
|
-
|
|
1905
|
+
R[Ue] = !0;
|
|
1921
1906
|
var E = "ConnectEnableWorklet";
|
|
1922
|
-
|
|
1907
|
+
R[E] = !1;
|
|
1923
1908
|
var he = function(e, l) {
|
|
1924
|
-
var m = e.BufferSize ||
|
|
1909
|
+
var m = e.BufferSize || R.BufferSize, b = e.Stream, D = b._RC || b._c || R.GetContext(!0);
|
|
1925
1910
|
b._c = D;
|
|
1926
1911
|
var Z = function(V) {
|
|
1927
1912
|
var T = b._m = D.createMediaStreamSource(b), ce = D.destination, g = "createMediaStreamDestination";
|
|
@@ -1938,7 +1923,7 @@ var _a = {}, qr = {
|
|
|
1938
1923
|
}
|
|
1939
1924
|
}, 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
1925
|
o = b.isWorklet = !1, Fe(b), He(Be("7TU0::Connect采用老的{1},", 0, le) + ct.get(
|
|
1941
|
-
|
|
1926
|
+
R[E] ? Be("JwCL::但已设置{1}尝试启用{2}", 2) : Be("VGjB::可设置{1}尝试启用{2}", 2),
|
|
1942
1927
|
[ve + "." + E + "=true", fe]
|
|
1943
1928
|
) + se + Q, 3);
|
|
1944
1929
|
var V = b._p = Ne.call(D, m, 1, 1);
|
|
@@ -1946,8 +1931,8 @@ var _a = {}, qr = {
|
|
|
1946
1931
|
var ce = T.inputBuffer.getChannelData(0);
|
|
1947
1932
|
xe(ce);
|
|
1948
1933
|
};
|
|
1949
|
-
},
|
|
1950
|
-
S = b.isWebM = !1, Qe(b), o = b.isWorklet = !Ne ||
|
|
1934
|
+
}, d = function() {
|
|
1935
|
+
S = b.isWebM = !1, Qe(b), o = b.isWorklet = !Ne || R[E];
|
|
1951
1936
|
var V = window.AudioWorkletNode;
|
|
1952
1937
|
if (!(o && D[fe] && V)) {
|
|
1953
1938
|
ne();
|
|
@@ -2009,10 +1994,10 @@ var _a = {}, qr = {
|
|
|
2009
1994
|
});
|
|
2010
1995
|
}, N = function() {
|
|
2011
1996
|
var V = window[X], T = "ondataavailable", ce = "audio/webm; codecs=pcm";
|
|
2012
|
-
S = b.isWebM =
|
|
1997
|
+
S = b.isWebM = R[Ue];
|
|
2013
1998
|
var g = V && T in V.prototype && V.isTypeSupported(ce);
|
|
2014
1999
|
if (se = g ? "" : Be("VwPd::(此浏览器不支持{1})", 0, pe), !l || !S || !g) {
|
|
2015
|
-
|
|
2000
|
+
d();
|
|
2016
2001
|
return;
|
|
2017
2002
|
}
|
|
2018
2003
|
var H = function() {
|
|
@@ -2020,10 +2005,10 @@ var _a = {}, qr = {
|
|
|
2020
2005
|
};
|
|
2021
2006
|
b._ra = function() {
|
|
2022
2007
|
ee !== "" && (clearTimeout(ee), ee = setTimeout(function() {
|
|
2023
|
-
H() && (He(Be("vHnb::{1}未返回任何音频,降级使用{2}", 0, X, fe), 3),
|
|
2008
|
+
H() && (He(Be("vHnb::{1}未返回任何音频,降级使用{2}", 0, X, fe), 3), d());
|
|
2024
2009
|
}, 500));
|
|
2025
2010
|
};
|
|
2026
|
-
var oe = Object.assign({ mimeType: ce },
|
|
2011
|
+
var oe = Object.assign({ mimeType: ce }, R.ConnectWebMOptions), z = b._r = new V(b, oe), re = b._rd = { sampleRate: D[De] };
|
|
2027
2012
|
z[T] = function(j) {
|
|
2028
2013
|
var _e = new FileReader();
|
|
2029
2014
|
_e.onloadend = function() {
|
|
@@ -2032,7 +2017,7 @@ var _a = {}, qr = {
|
|
|
2032
2017
|
if (!k)
|
|
2033
2018
|
return;
|
|
2034
2019
|
if (k == -1) {
|
|
2035
|
-
|
|
2020
|
+
d();
|
|
2036
2021
|
return;
|
|
2037
2022
|
}
|
|
2038
2023
|
ee && (clearTimeout(ee), ee = ""), xe(k);
|
|
@@ -2049,23 +2034,23 @@ var _a = {}, qr = {
|
|
|
2049
2034
|
}, Qe = function(e) {
|
|
2050
2035
|
e._ra = null, e._r && (e._r.stop(), e._r = null);
|
|
2051
2036
|
}, 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 =
|
|
2037
|
+
e = e || R;
|
|
2038
|
+
var l = e == R, m = e.Stream;
|
|
2039
|
+
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;
|
|
2040
|
+
}, Ge = R.StopS_ = function(e) {
|
|
2056
2041
|
for (var l = e.getTracks && e.getTracks() || e.audioTracks || [], m = 0; m < l.length; m++) {
|
|
2057
2042
|
var b = l[m];
|
|
2058
2043
|
b.stop && b.stop();
|
|
2059
2044
|
}
|
|
2060
2045
|
e.stop && e.stop();
|
|
2061
2046
|
};
|
|
2062
|
-
|
|
2047
|
+
R.SampleData = function(e, l, m, b, D) {
|
|
2063
2048
|
var Z = "SampleData";
|
|
2064
2049
|
b || (b = {});
|
|
2065
2050
|
var S = b.index || 0, o = b.offset || 0, ee = b.filter;
|
|
2066
2051
|
if (ee && ee.fn && ee.sr != l && (ee = null, He(Be("d48C::{1}的filter采样率变了,重设滤波", 0, Z), 3)), !ee) {
|
|
2067
2052
|
var se = m > l * 3 / 4 ? 0 : m / 2 * 3 / 4;
|
|
2068
|
-
ee = { fn: se ?
|
|
2053
|
+
ee = { fn: se ? R.IIRFilter(!0, l, se) : 0 };
|
|
2069
2054
|
}
|
|
2070
2055
|
ee.sr = l;
|
|
2071
2056
|
var ye = ee.fn, xe = b.frameNext || [];
|
|
@@ -2082,8 +2067,8 @@ var _a = {}, qr = {
|
|
|
2082
2067
|
for (var pe = new Int16Array(Ae), Ne = 0, ue = 0; ue < xe.length; ue++)
|
|
2083
2068
|
pe[Ne] = xe[ue], Ne++;
|
|
2084
2069
|
for (; S < fe; S++) {
|
|
2085
|
-
for (var Q = e[S], ue = o, ne = Q.length,
|
|
2086
|
-
if (H < ne && (
|
|
2070
|
+
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++) {
|
|
2071
|
+
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
2072
|
g--;
|
|
2088
2073
|
continue;
|
|
2089
2074
|
}
|
|
@@ -2109,7 +2094,7 @@ var _a = {}, qr = {
|
|
|
2109
2094
|
sampleRate: m,
|
|
2110
2095
|
data: pe
|
|
2111
2096
|
};
|
|
2112
|
-
},
|
|
2097
|
+
}, R.IIRFilter = function(e, l, m) {
|
|
2113
2098
|
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
2099
|
if (e)
|
|
2115
2100
|
var ye = (1 - Z) / 2 / o, xe = (1 - Z) / o;
|
|
@@ -2119,22 +2104,22 @@ var _a = {}, qr = {
|
|
|
2119
2104
|
return Ae = ye * Ne + xe * le + ye * fe - ee * ue - se * X, fe = le, le = Ne, X = ue, ue = Ae, Ae;
|
|
2120
2105
|
};
|
|
2121
2106
|
return pe.Embed = { x1: 0, x2: 0, y1: 0, y2: 0, b0: ye, b1: xe, a1: ee, a2: se }, pe;
|
|
2122
|
-
},
|
|
2107
|
+
}, R.PowerLevel = function(e, l) {
|
|
2123
2108
|
var m = e / l || 0, b;
|
|
2124
2109
|
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
|
-
},
|
|
2110
|
+
}, R.PowerDBFS = function(e) {
|
|
2126
2111
|
var l = Math.max(0.1, e || 0), m = 32767;
|
|
2127
2112
|
return l = Math.min(l, m), l = 20 * Math.log(l / m) / Math.log(10), Math.max(-100, Math.round(l));
|
|
2128
|
-
},
|
|
2113
|
+
}, R.CLog = function(e, l) {
|
|
2129
2114
|
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 =
|
|
2115
|
+
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
2116
|
for (U(l) ? se = l == 1 ? o.error || console.error : l == 3 ? o.warn || console.warn : se : ee = 1; ee < S.length; ee++)
|
|
2132
2117
|
Z.push(S[ee]);
|
|
2133
2118
|
Xe ? se && se("[IsLoser]" + Z[0], Z.length > 1 ? Z : "") : se.apply(console, Z);
|
|
2134
2119
|
}
|
|
2135
2120
|
};
|
|
2136
2121
|
var He = function() {
|
|
2137
|
-
|
|
2122
|
+
R.CLog.apply(this, arguments);
|
|
2138
2123
|
}, Xe = !0;
|
|
2139
2124
|
try {
|
|
2140
2125
|
Xe = !console.log.apply;
|
|
@@ -2172,15 +2157,15 @@ var _a = {}, qr = {
|
|
|
2172
2157
|
var D = m[Ee], Z = m[De];
|
|
2173
2158
|
(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
2159
|
}
|
|
2175
|
-
|
|
2160
|
+
R.Sync = {
|
|
2176
2161
|
/*open*/
|
|
2177
2162
|
O: 9,
|
|
2178
2163
|
/*close*/
|
|
2179
2164
|
C: 9
|
|
2180
|
-
},
|
|
2165
|
+
}, R.prototype = W.prototype = {
|
|
2181
2166
|
CLog: He,
|
|
2182
2167
|
_streamStore: function() {
|
|
2183
|
-
return this.set.sourceStream ? this :
|
|
2168
|
+
return this.set.sourceStream ? this : R;
|
|
2184
2169
|
},
|
|
2185
2170
|
_streamCtx: function() {
|
|
2186
2171
|
var e = this._streamStore().Stream;
|
|
@@ -2189,8 +2174,8 @@ var _a = {}, qr = {
|
|
|
2189
2174
|
open: function(e, l) {
|
|
2190
2175
|
var m = this, b = m.set, D = m._streamStore(), Z = 0;
|
|
2191
2176
|
e = e || h;
|
|
2192
|
-
var S = function(
|
|
2193
|
-
N = !!N, m.CLog(Be("5tWi::录音open失败:") +
|
|
2177
|
+
var S = function(d, N) {
|
|
2178
|
+
N = !!N, m.CLog(Be("5tWi::录音open失败:") + d + ",isUserNotAllow:" + N, 1), Z && R.CloseNewCtx(Z), l && l(d, N);
|
|
2194
2179
|
};
|
|
2195
2180
|
m._streamTag = be;
|
|
2196
2181
|
var o = function() {
|
|
@@ -2199,11 +2184,11 @@ var _a = {}, qr = {
|
|
|
2199
2184
|
m._O = m._O_ = se, m._SO = m._S;
|
|
2200
2185
|
var xe = function() {
|
|
2201
2186
|
if (ye != ee.C || !m._O) {
|
|
2202
|
-
var
|
|
2203
|
-
return se == ee.O ? m.close() :
|
|
2187
|
+
var d = Be("dFm8::open被取消");
|
|
2188
|
+
return se == ee.O ? m.close() : d = Be("VtJO::open被中断"), S(d), !0;
|
|
2204
2189
|
}
|
|
2205
2190
|
};
|
|
2206
|
-
if (!
|
|
2191
|
+
if (!f) {
|
|
2207
2192
|
S(Be.G("NonBrowser-1", ["open"]) + Be("EMJq::,可尝试使用RecordApp解决方案") + "(" + K + "/tree/master/app-support-sample)");
|
|
2208
2193
|
return;
|
|
2209
2194
|
}
|
|
@@ -2213,7 +2198,7 @@ var _a = {}, qr = {
|
|
|
2213
2198
|
return;
|
|
2214
2199
|
}
|
|
2215
2200
|
if (b.sourceStream) {
|
|
2216
|
-
if (m._streamTag = "set.sourceStream", !
|
|
2201
|
+
if (m._streamTag = "set.sourceStream", !R.GetContext()) {
|
|
2217
2202
|
S(Be("1iU7::不支持此浏览器从流中获取录音"));
|
|
2218
2203
|
return;
|
|
2219
2204
|
}
|
|
@@ -2222,48 +2207,48 @@ var _a = {}, qr = {
|
|
|
2222
2207
|
fe._RC = b.runningContext, fe._call = {};
|
|
2223
2208
|
try {
|
|
2224
2209
|
he(D);
|
|
2225
|
-
} catch (
|
|
2226
|
-
Ze(D), S(Be("BTW2::从流中打开录音失败:") +
|
|
2210
|
+
} catch (d) {
|
|
2211
|
+
Ze(D), S(Be("BTW2::从流中打开录音失败:") + d.message);
|
|
2227
2212
|
return;
|
|
2228
2213
|
}
|
|
2229
2214
|
o();
|
|
2230
2215
|
return;
|
|
2231
2216
|
}
|
|
2232
|
-
var Ae = function(
|
|
2217
|
+
var Ae = function(d, N) {
|
|
2233
2218
|
try {
|
|
2234
2219
|
window.top.a;
|
|
2235
2220
|
} catch {
|
|
2236
2221
|
S(Be("Nclz::无权录音(跨域,请尝试给iframe添加麦克风访问策略,如{1})", 0, 'allow="camera;microphone"'));
|
|
2237
2222
|
return;
|
|
2238
2223
|
}
|
|
2239
|
-
/Permission|Allow/i.test(
|
|
2224
|
+
/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
2225
|
};
|
|
2241
|
-
if (
|
|
2226
|
+
if (R.IsOpen()) {
|
|
2242
2227
|
o();
|
|
2243
2228
|
return;
|
|
2244
2229
|
}
|
|
2245
|
-
if (!
|
|
2230
|
+
if (!R.Support()) {
|
|
2246
2231
|
Ae("", Be("COxc::此浏览器不支持录音"));
|
|
2247
2232
|
return;
|
|
2248
2233
|
}
|
|
2249
2234
|
var ue = b.runningContext;
|
|
2250
|
-
ue || (ue = Z =
|
|
2251
|
-
var X = function(
|
|
2235
|
+
ue || (ue = Z = R.GetContext(!0));
|
|
2236
|
+
var X = function(d) {
|
|
2252
2237
|
setTimeout(function() {
|
|
2253
|
-
|
|
2254
|
-
var N =
|
|
2255
|
-
N && (Ze(),
|
|
2238
|
+
d._call = {};
|
|
2239
|
+
var N = R.Stream;
|
|
2240
|
+
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
2241
|
}, 100);
|
|
2257
|
-
}, pe = function(
|
|
2258
|
-
var N =
|
|
2259
|
-
m.CLog(Be("xEQR::请求录音权限错误"), 1,
|
|
2242
|
+
}, pe = function(d) {
|
|
2243
|
+
var N = d.name || d.message || d.code + ":" + d;
|
|
2244
|
+
m.CLog(Be("xEQR::请求录音权限错误"), 1, d), Ae(N, Be("bDOG::无法录音:") + N);
|
|
2260
2245
|
}, Ne = b.audioTrackSet || {};
|
|
2261
2246
|
Ne[De] = ue[De];
|
|
2262
2247
|
var Q = { audio: Ne };
|
|
2263
2248
|
try {
|
|
2264
|
-
var ne =
|
|
2265
|
-
} catch (
|
|
2266
|
-
m.CLog(be, 3,
|
|
2249
|
+
var ne = R.Scope[be](Q, X, pe);
|
|
2250
|
+
} catch (d) {
|
|
2251
|
+
m.CLog(be, 3, d), Q = { audio: !0 }, ne = R.Scope[be](Q, X, pe);
|
|
2267
2252
|
}
|
|
2268
2253
|
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
2254
|
},
|
|
@@ -2288,7 +2273,7 @@ var _a = {}, qr = {
|
|
|
2288
2273
|
},
|
|
2289
2274
|
envCheck: function(e) {
|
|
2290
2275
|
var l, m = this, b = m.set, D = "CPU_BE";
|
|
2291
|
-
if (!l && !
|
|
2276
|
+
if (!l && !R[D] && typeof Int8Array == "function" && !new Int8Array(new Int32Array([1]).buffer)[0] && (L(D), l = Be("Essp::不支持{1}架构", 0, D)), !l) {
|
|
2292
2277
|
var Z = b.type, S = m[Z + "_envCheck"];
|
|
2293
2278
|
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
2279
|
}
|
|
@@ -2310,7 +2295,7 @@ var _a = {}, qr = {
|
|
|
2310
2295
|
m.state || m.CLog("envIn at state=0", 3);
|
|
2311
2296
|
return;
|
|
2312
2297
|
}
|
|
2313
|
-
var Z = m[Me], S = e.length, o =
|
|
2298
|
+
var Z = m[Me], S = e.length, o = R.PowerLevel(l, S), ee = m.buffers, se = ee.length;
|
|
2314
2299
|
ee.push(e);
|
|
2315
2300
|
var ye = ee, xe = se, le = Date.now(), fe = Math.round(S / Z * 1e3);
|
|
2316
2301
|
m.envInLast = le, m.buffers.length == 1 && (m.envInFirst = le - fe);
|
|
@@ -2324,8 +2309,8 @@ var _a = {}, qr = {
|
|
|
2324
2309
|
}
|
|
2325
2310
|
ue = Ne.t, X += Ne.d;
|
|
2326
2311
|
}
|
|
2327
|
-
var Q = Ae[1], ne = le - ue,
|
|
2328
|
-
if (
|
|
2312
|
+
var Q = Ae[1], ne = le - ue, d = ne - X;
|
|
2313
|
+
if (d > ne / 3 && (Q && ne > 1e3 || Ae.length >= 6)) {
|
|
2329
2314
|
var N = le - Q.t - fe;
|
|
2330
2315
|
if (N > fe / 5) {
|
|
2331
2316
|
var V = !b.disableEnvInFix;
|
|
@@ -2337,7 +2322,7 @@ var _a = {}, qr = {
|
|
|
2337
2322
|
}
|
|
2338
2323
|
var ce = m.recSize, g = S, H = ce + g;
|
|
2339
2324
|
if (m.recSize = H, D) {
|
|
2340
|
-
var oe =
|
|
2325
|
+
var oe = R.SampleData(ee, Z, b[De], D.chunkInfo);
|
|
2341
2326
|
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
2327
|
}
|
|
2343
2328
|
var z = Math.round(H / Z * 1e3), re = ee.length, j = ye.length, _e = function() {
|
|
@@ -2367,7 +2352,7 @@ var _a = {}, qr = {
|
|
|
2367
2352
|
},
|
|
2368
2353
|
start: function() {
|
|
2369
2354
|
var e = this, l = 1;
|
|
2370
|
-
if (e.set.sourceStream ? e.Stream || (l = 0) :
|
|
2355
|
+
if (e.set.sourceStream ? e.Stream || (l = 0) : R.IsOpen() || (l = 0), !l) {
|
|
2371
2356
|
e.CLog(Be("6WmN::start失败:未open"), 1);
|
|
2372
2357
|
return;
|
|
2373
2358
|
}
|
|
@@ -2412,8 +2397,8 @@ var _a = {}, qr = {
|
|
|
2412
2397
|
}, se = function(Ne) {
|
|
2413
2398
|
b.CLog(Be("u8JG::结束录音失败:") + Ne, 1), l && l(Ne), ee();
|
|
2414
2399
|
}, ye = function(Ne, Q, ne) {
|
|
2415
|
-
var
|
|
2416
|
-
if (ce == N ? H || (oe = 1) : ce ==
|
|
2400
|
+
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;
|
|
2401
|
+
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
2402
|
se(oe != 1 ? oe : Be("Vkbd::{1}编码器返回的不是{2}", 0, D.type, ce) + ", " + g);
|
|
2418
2403
|
return;
|
|
2419
2404
|
}
|
|
@@ -2461,7 +2446,7 @@ var _a = {}, qr = {
|
|
|
2461
2446
|
se(Be("xkKd::音频buffers被释放"));
|
|
2462
2447
|
return;
|
|
2463
2448
|
}
|
|
2464
|
-
var ue =
|
|
2449
|
+
var ue = R.SampleData(b.buffers, b[Me], D[De]);
|
|
2465
2450
|
D[De] = ue[De];
|
|
2466
2451
|
var X = ue.data, pe = Math.round(X.length / D[De] * 1e3);
|
|
2467
2452
|
b.CLog(Be("CxeT::采样:{1} 花:{2}ms", 0, le + "->" + X.length, Date.now() - Z)), setTimeout(function() {
|
|
@@ -2503,12 +2488,12 @@ var _a = {}, qr = {
|
|
|
2503
2488
|
Ae.codec = Q;
|
|
2504
2489
|
} else if (at(ue, [225]))
|
|
2505
2490
|
for (; pe[0] < X.length; ) {
|
|
2506
|
-
var
|
|
2507
|
-
if (at(
|
|
2491
|
+
var d = vt(X, pe), N = _t(X, pe);
|
|
2492
|
+
if (at(d, [181])) {
|
|
2508
2493
|
var Ne = 0, V = new Uint8Array(N.reverse()).buffer;
|
|
2509
2494
|
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
2495
|
} else
|
|
2511
|
-
at(
|
|
2496
|
+
at(d, [98, 100]) ? Ae.bitDepth = et(N) : at(d, [159]) && (Ae.channels = et(N));
|
|
2512
2497
|
}
|
|
2513
2498
|
}
|
|
2514
2499
|
}
|
|
@@ -2591,7 +2576,7 @@ var _a = {}, qr = {
|
|
|
2591
2576
|
}
|
|
2592
2577
|
return l[0] = D, Z;
|
|
2593
2578
|
}
|
|
2594
|
-
}, ct =
|
|
2579
|
+
}, ct = R.i18n = {
|
|
2595
2580
|
lang: "zh-CN",
|
|
2596
2581
|
alias: { "zh-CN": "zh", "en-US": "en" },
|
|
2597
2582
|
locales: {},
|
|
@@ -2657,48 +2642,48 @@ var _a = {}, qr = {
|
|
|
2657
2642
|
return l ? b > 0 ? l : ct.v_G(l, m) : "";
|
|
2658
2643
|
}
|
|
2659
2644
|
}, 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 (
|
|
2645
|
+
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";
|
|
2646
|
+
var L = R.Traffic = function(e) {
|
|
2647
|
+
if (f) {
|
|
2663
2648
|
e = e ? "/" + ve + "/Report/" + e : "";
|
|
2664
|
-
var l =
|
|
2649
|
+
var l = R.TrafficImgUrl;
|
|
2665
2650
|
if (l) {
|
|
2666
|
-
var m =
|
|
2651
|
+
var m = R.Traffic, b = /^(https?:..[^\/#]*\/?)[^#]*/i.exec(location.href) || [], D = b[1] || "http://file/", Z = (b[0] || D) + e;
|
|
2667
2652
|
if (l.indexOf("//") == 0 && (/^https:/i.test(Z) ? l = "https:" + l : l = "http:" + l), e && (l = l + "&cu=" + encodeURIComponent(D + e)), !m[Z]) {
|
|
2668
2653
|
m[Z] = 1;
|
|
2669
2654
|
var S = new Image();
|
|
2670
|
-
S.src = l, He("Traffic Analysis Image: " + (e || ve + ".TrafficImgUrl=" +
|
|
2655
|
+
S.src = l, He("Traffic Analysis Image: " + (e || ve + ".TrafficImgUrl=" + R.TrafficImgUrl));
|
|
2671
2656
|
}
|
|
2672
2657
|
}
|
|
2673
2658
|
}
|
|
2674
2659
|
};
|
|
2675
|
-
te && (He(Be("8HO5::覆盖导入{1}", 0, ve), 1), te.Destroy()), t[ve] =
|
|
2660
|
+
te && (He(Be("8HO5::覆盖导入{1}", 0, ve), 1), te.Destroy()), t[ve] = R;
|
|
2676
2661
|
});
|
|
2677
2662
|
})(qr);
|
|
2678
2663
|
const ua = _a;
|
|
2679
2664
|
(function(s) {
|
|
2680
|
-
var t = typeof window == "object" && !!window.document,
|
|
2665
|
+
var t = typeof window == "object" && !!window.document, f = t ? window : Object, h = f.Recorder, U = h.i18n;
|
|
2681
2666
|
s(h, U, U.$T, t);
|
|
2682
|
-
})(function(s, t,
|
|
2683
|
-
var U = "48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000",
|
|
2667
|
+
})(function(s, t, f, h) {
|
|
2668
|
+
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
2669
|
s.prototype.enc_mp3 = {
|
|
2685
2670
|
stable: !0,
|
|
2686
2671
|
takeEC: "full",
|
|
2687
2672
|
getTestMsg: function() {
|
|
2688
|
-
return
|
|
2673
|
+
return f("Zm7L::采样率范围:{1};比特率范围:{2}(不同比特率支持的采样率范围不同,小于32kbps时采样率需小于32000)", 0, U, R);
|
|
2689
2674
|
}
|
|
2690
2675
|
};
|
|
2691
2676
|
var Y = function(te) {
|
|
2692
2677
|
var ie = te.bitRate, we = te.sampleRate, Ue = we;
|
|
2693
|
-
if ((" " +
|
|
2678
|
+
if ((" " + R + ",").indexOf(" " + ie + ",") == -1 && s.CLog(f("eGB9::{1}不在mp3支持的取值范围:{2}", 0, "bitRate=" + ie, R), 3), (" " + U + ",").indexOf(" " + we + ",") == -1) {
|
|
2694
2679
|
for (var E = U.split(", "), he = [], Te = 0; Te < E.length; Te++)
|
|
2695
2680
|
he.push({ v: +E[Te], s: Math.abs(E[Te] - we) });
|
|
2696
2681
|
he.sort(function(Fe, Qe) {
|
|
2697
2682
|
return Fe.s - Qe.s;
|
|
2698
|
-
}), Ue = he[0].v, te.sampleRate = Ue, s.CLog(
|
|
2683
|
+
}), Ue = he[0].v, te.sampleRate = Ue, s.CLog(f("zLTa::sampleRate已更新为{1},因为{2}不在mp3支持的取值范围:{3}", 0, Ue, we, U), 3);
|
|
2699
2684
|
}
|
|
2700
2685
|
}, K = function() {
|
|
2701
|
-
return
|
|
2686
|
+
return f.G("NeedImport-2", ["mp3.js", "src/engine/mp3-engine.js"]);
|
|
2702
2687
|
}, ve = h && typeof Worker == "function";
|
|
2703
2688
|
s.prototype.mp3 = function(te, ie, we) {
|
|
2704
2689
|
var Ue = this, E = Ue.set, he = te.length;
|
|
@@ -2749,7 +2734,7 @@ const ua = _a;
|
|
|
2749
2734
|
be && (s.CLog("mp3Worker Destroy"), be.terminate(), be = null);
|
|
2750
2735
|
}), s.prototype.mp3_envCheck = function(te, ie) {
|
|
2751
2736
|
var we = "";
|
|
2752
|
-
return ie.takeoffEncodeChunk && (De() || (we =
|
|
2737
|
+
return ie.takeoffEncodeChunk && (De() || (we = f("yhUs::当前浏览器版本太低,无法实时处理"))), !we && !s.lamejs && (we = K()), we;
|
|
2753
2738
|
}, s.prototype.mp3_start = function(te) {
|
|
2754
2739
|
return De(te);
|
|
2755
2740
|
};
|
|
@@ -2835,7 +2820,7 @@ const ua = _a;
|
|
|
2835
2820
|
}), Xe;
|
|
2836
2821
|
}, he, Te = be;
|
|
2837
2822
|
if (ie || !ve)
|
|
2838
|
-
return s.CLog(
|
|
2823
|
+
return s.CLog(f("k9PT::当前环境不支持Web Worker,mp3实时编码器运行在主线程中"), 3), Te = { postMessage: function(Xe) {
|
|
2839
2824
|
we({ data: Xe });
|
|
2840
2825
|
} }, he = { wkScope: {
|
|
2841
2826
|
wk_ctxs: {},
|
|
@@ -2868,7 +2853,7 @@ const ua = _a;
|
|
|
2868
2853
|
var ie = -1;
|
|
2869
2854
|
for (var we in Me)
|
|
2870
2855
|
ie++;
|
|
2871
|
-
ie && s.CLog(
|
|
2856
|
+
ie && s.CLog(f("fT6M::mp3 worker剩{1}个未stop", 0, ie), 3);
|
|
2872
2857
|
}
|
|
2873
2858
|
}, s.prototype.mp3_encode = function(te, ie) {
|
|
2874
2859
|
te && te.worker && te.worker.postMessage({
|
|
@@ -2883,7 +2868,7 @@ const ua = _a;
|
|
|
2883
2868
|
}, te.worker.postMessage({
|
|
2884
2869
|
action: "complete",
|
|
2885
2870
|
id: te.id
|
|
2886
|
-
})) : we(
|
|
2871
|
+
})) : we(f("mPxH::mp3编码器未start"));
|
|
2887
2872
|
}, s.mp3ReadMeta = function(te, ie) {
|
|
2888
2873
|
var we = typeof window < "u" && window.parseInt || typeof self < "u" && self.parseInt || parseInt, Ue = new Uint8Array(te[0] || []);
|
|
2889
2874
|
if (Ue.length < 4)
|
|
@@ -2960,119 +2945,119 @@ const ua = _a;
|
|
|
2960
2945
|
}
|
|
2961
2946
|
}, Ce = function(te, ie) {
|
|
2962
2947
|
var we = "MP3 Info: ";
|
|
2963
|
-
(te.sampleRate && te.sampleRate != ie.sampleRate || te.bitRate && te.bitRate != ie.bitRate) && (s.CLog(we +
|
|
2948
|
+
(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
2949
|
var Ue = te.trimFix;
|
|
2965
|
-
Ue ? (we +=
|
|
2950
|
+
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
2951
|
};
|
|
2967
2952
|
});
|
|
2968
2953
|
(function(s) {
|
|
2969
|
-
var t = typeof window == "object" && !!window.document,
|
|
2954
|
+
var t = typeof window == "object" && !!window.document, f = t ? window : Object, h = f.Recorder;
|
|
2970
2955
|
s(h);
|
|
2971
2956
|
})(function(s) {
|
|
2972
2957
|
function t() {
|
|
2973
|
-
var
|
|
2974
|
-
return Math.log(
|
|
2975
|
-
}, h = function(
|
|
2976
|
-
throw new Error("abort(" +
|
|
2958
|
+
var f = function(d) {
|
|
2959
|
+
return Math.log(d) / Math.log(10);
|
|
2960
|
+
}, h = function(d) {
|
|
2961
|
+
throw new Error("abort(" + d + ")");
|
|
2977
2962
|
};
|
|
2978
|
-
function U(
|
|
2979
|
-
return new Int8Array(
|
|
2963
|
+
function U(d) {
|
|
2964
|
+
return new Int8Array(d);
|
|
2980
2965
|
}
|
|
2981
|
-
function
|
|
2982
|
-
return new Int16Array(
|
|
2966
|
+
function R(d) {
|
|
2967
|
+
return new Int16Array(d);
|
|
2983
2968
|
}
|
|
2984
|
-
function Y(
|
|
2985
|
-
return new Int32Array(
|
|
2969
|
+
function Y(d) {
|
|
2970
|
+
return new Int32Array(d);
|
|
2986
2971
|
}
|
|
2987
|
-
function K(
|
|
2988
|
-
return new Float32Array(
|
|
2972
|
+
function K(d) {
|
|
2973
|
+
return new Float32Array(d);
|
|
2989
2974
|
}
|
|
2990
|
-
function ve(
|
|
2991
|
-
return new Float64Array(
|
|
2975
|
+
function ve(d) {
|
|
2976
|
+
return new Float64Array(d);
|
|
2992
2977
|
}
|
|
2993
|
-
function be(
|
|
2994
|
-
if (
|
|
2995
|
-
return K(
|
|
2996
|
-
var N =
|
|
2997
|
-
|
|
2978
|
+
function be(d) {
|
|
2979
|
+
if (d.length == 1)
|
|
2980
|
+
return K(d[0]);
|
|
2981
|
+
var N = d[0];
|
|
2982
|
+
d = d.slice(1);
|
|
2998
2983
|
for (var V = [], T = 0; T < N; T++)
|
|
2999
|
-
V.push(be(
|
|
2984
|
+
V.push(be(d));
|
|
3000
2985
|
return V;
|
|
3001
2986
|
}
|
|
3002
|
-
function Me(
|
|
3003
|
-
if (
|
|
3004
|
-
return Y(
|
|
3005
|
-
var N =
|
|
3006
|
-
|
|
2987
|
+
function Me(d) {
|
|
2988
|
+
if (d.length == 1)
|
|
2989
|
+
return Y(d[0]);
|
|
2990
|
+
var N = d[0];
|
|
2991
|
+
d = d.slice(1);
|
|
3007
2992
|
for (var V = [], T = 0; T < N; T++)
|
|
3008
|
-
V.push(Me(
|
|
2993
|
+
V.push(Me(d));
|
|
3009
2994
|
return V;
|
|
3010
2995
|
}
|
|
3011
|
-
function De(
|
|
3012
|
-
if (
|
|
3013
|
-
return
|
|
3014
|
-
var N =
|
|
3015
|
-
|
|
2996
|
+
function De(d) {
|
|
2997
|
+
if (d.length == 1)
|
|
2998
|
+
return R(d[0]);
|
|
2999
|
+
var N = d[0];
|
|
3000
|
+
d = d.slice(1);
|
|
3016
3001
|
for (var V = [], T = 0; T < N; T++)
|
|
3017
|
-
V.push(De(
|
|
3002
|
+
V.push(De(d));
|
|
3018
3003
|
return V;
|
|
3019
3004
|
}
|
|
3020
|
-
function Ee(
|
|
3021
|
-
if (
|
|
3022
|
-
return new Array(
|
|
3023
|
-
var N =
|
|
3024
|
-
|
|
3005
|
+
function Ee(d) {
|
|
3006
|
+
if (d.length == 1)
|
|
3007
|
+
return new Array(d[0]);
|
|
3008
|
+
var N = d[0];
|
|
3009
|
+
d = d.slice(1);
|
|
3025
3010
|
for (var V = [], T = 0; T < N; T++)
|
|
3026
|
-
V.push(Ee(
|
|
3011
|
+
V.push(Ee(d));
|
|
3027
3012
|
return V;
|
|
3028
3013
|
}
|
|
3029
3014
|
var Ce = {};
|
|
3030
|
-
Ce.fill = function(
|
|
3015
|
+
Ce.fill = function(d, N, V, T) {
|
|
3031
3016
|
if (arguments.length == 2)
|
|
3032
|
-
for (var ce = 0; ce <
|
|
3033
|
-
|
|
3017
|
+
for (var ce = 0; ce < d.length; ce++)
|
|
3018
|
+
d[ce] = arguments[1];
|
|
3034
3019
|
else
|
|
3035
3020
|
for (var ce = N; ce < V; ce++)
|
|
3036
|
-
|
|
3021
|
+
d[ce] = T;
|
|
3037
3022
|
};
|
|
3038
3023
|
var te = {};
|
|
3039
|
-
te.arraycopy = function(
|
|
3024
|
+
te.arraycopy = function(d, N, V, T, ce) {
|
|
3040
3025
|
for (var g = N + ce; N < g; )
|
|
3041
|
-
V[T++] =
|
|
3026
|
+
V[T++] = d[N++];
|
|
3042
3027
|
};
|
|
3043
3028
|
var ie = {};
|
|
3044
|
-
ie.SQRT2 = 1.4142135623730951, ie.FAST_LOG10 = function(
|
|
3045
|
-
return
|
|
3046
|
-
}, ie.FAST_LOG10_X = function(
|
|
3047
|
-
return
|
|
3029
|
+
ie.SQRT2 = 1.4142135623730951, ie.FAST_LOG10 = function(d) {
|
|
3030
|
+
return f(d);
|
|
3031
|
+
}, ie.FAST_LOG10_X = function(d, N) {
|
|
3032
|
+
return f(d) * N;
|
|
3048
3033
|
};
|
|
3049
|
-
function we(
|
|
3050
|
-
this.ordinal =
|
|
3034
|
+
function we(d) {
|
|
3035
|
+
this.ordinal = d;
|
|
3051
3036
|
}
|
|
3052
3037
|
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
3038
|
var Ue = {};
|
|
3054
3039
|
Ue.MAX_VALUE = 34028235e31;
|
|
3055
|
-
function E(
|
|
3056
|
-
this.ordinal =
|
|
3040
|
+
function E(d) {
|
|
3041
|
+
this.ordinal = d;
|
|
3057
3042
|
}
|
|
3058
3043
|
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 =
|
|
3044
|
+
function he(d) {
|
|
3045
|
+
var N = d;
|
|
3061
3046
|
this.ordinal = function() {
|
|
3062
3047
|
return N;
|
|
3063
3048
|
};
|
|
3064
3049
|
}
|
|
3065
3050
|
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
3051
|
function Te() {
|
|
3067
|
-
var
|
|
3052
|
+
var d = 3, N = 98, V = 4;
|
|
3068
3053
|
this.getLameShortVersion = function() {
|
|
3069
|
-
return
|
|
3054
|
+
return d + "." + N + "." + V;
|
|
3070
3055
|
};
|
|
3071
3056
|
}
|
|
3072
3057
|
function Fe() {
|
|
3073
|
-
var
|
|
3058
|
+
var d = null;
|
|
3074
3059
|
this.qupvt = null, this.setModules = function(v) {
|
|
3075
|
-
this.qupvt = v,
|
|
3060
|
+
this.qupvt = v, d = v;
|
|
3076
3061
|
};
|
|
3077
3062
|
function N(v) {
|
|
3078
3063
|
this.bits = 0 | v;
|
|
@@ -3125,28 +3110,28 @@ const ua = _a;
|
|
|
3125
3110
|
[6, 7]
|
|
3126
3111
|
/* 22 bands */
|
|
3127
3112
|
];
|
|
3128
|
-
function T(v, p, M, x,
|
|
3113
|
+
function T(v, p, M, x, I, r) {
|
|
3129
3114
|
var i = 0.5946 / p;
|
|
3130
3115
|
for (v = v >> 1; v-- != 0; )
|
|
3131
|
-
|
|
3116
|
+
I[r++] = i > M[x++] ? 0 : 1, I[r++] = i > M[x++] ? 0 : 1;
|
|
3132
3117
|
}
|
|
3133
|
-
function ce(v, p, M, x,
|
|
3118
|
+
function ce(v, p, M, x, I, r) {
|
|
3134
3119
|
v = v >> 1;
|
|
3135
3120
|
var i = v % 2;
|
|
3136
3121
|
for (v = v >> 1; v-- != 0; ) {
|
|
3137
3122
|
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 +=
|
|
3123
|
+
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
3124
|
}
|
|
3140
3125
|
if (i != 0) {
|
|
3141
3126
|
var q, B, ge, Se;
|
|
3142
|
-
q = M[x++] * p, B = M[x++] * p, ge = 0 | q, Se = 0 | B, q +=
|
|
3127
|
+
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
3128
|
}
|
|
3144
3129
|
}
|
|
3145
|
-
function g(v, p, M, x,
|
|
3130
|
+
function g(v, p, M, x, I) {
|
|
3146
3131
|
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 =
|
|
3132
|
+
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
3133
|
var lt = -1;
|
|
3149
|
-
if ((B || x.block_type == o.NORM_TYPE) && (lt = x.global_gain - (x.scalefac[r] + (x.preflag != 0 ?
|
|
3134
|
+
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
3135
|
$ != 0 && (ce(
|
|
3151
3136
|
$,
|
|
3152
3137
|
M,
|
|
@@ -3161,7 +3146,7 @@ const ua = _a;
|
|
|
3161
3146
|
var gt;
|
|
3162
3147
|
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
3148
|
}
|
|
3164
|
-
if ($ == 0 && de == 0 && ($e = Se, Ve = Ye, mt = v, bt = ge),
|
|
3149
|
+
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
3150
|
$,
|
|
3166
3151
|
M,
|
|
3167
3152
|
mt,
|
|
@@ -3192,46 +3177,46 @@ const ua = _a;
|
|
|
3192
3177
|
), $ = 0), de != 0 && h();
|
|
3193
3178
|
}
|
|
3194
3179
|
function H(v, p, M) {
|
|
3195
|
-
var x = 0,
|
|
3180
|
+
var x = 0, I = 0;
|
|
3196
3181
|
do {
|
|
3197
3182
|
var r = v[p++], i = v[p++];
|
|
3198
|
-
x < r && (x = r),
|
|
3183
|
+
x < r && (x = r), I < i && (I = i);
|
|
3199
3184
|
} while (p < M);
|
|
3200
|
-
return x <
|
|
3185
|
+
return x < I && (x = I), x;
|
|
3201
3186
|
}
|
|
3202
|
-
function oe(v, p, M, x,
|
|
3203
|
-
var i = W.ht[x].xlen * 65536 + W.ht[
|
|
3187
|
+
function oe(v, p, M, x, I, r) {
|
|
3188
|
+
var i = W.ht[x].xlen * 65536 + W.ht[I].xlen, q = 0, B;
|
|
3204
3189
|
do {
|
|
3205
3190
|
var $ = v[p++], de = v[p++];
|
|
3206
3191
|
$ != 0 && ($ > 14 && ($ = 15, q += i), $ *= 16), de != 0 && (de > 14 && (de = 15, q += i), $ += de), q += W.largetbl[$];
|
|
3207
3192
|
} while (p < M);
|
|
3208
|
-
return B = q & 65535, q >>= 16, q > B && (q = B, x =
|
|
3193
|
+
return B = q & 65535, q >>= 16, q > B && (q = B, x = I), r.bits += q, x;
|
|
3209
3194
|
}
|
|
3210
3195
|
function z(v, p, M, x) {
|
|
3211
|
-
var
|
|
3196
|
+
var I = 0, r = W.ht[1].hlen;
|
|
3212
3197
|
do {
|
|
3213
3198
|
var i = v[p + 0] * 2 + v[p + 1];
|
|
3214
|
-
p += 2,
|
|
3199
|
+
p += 2, I += r[i];
|
|
3215
3200
|
} while (p < M);
|
|
3216
|
-
return x.bits +=
|
|
3201
|
+
return x.bits += I, 1;
|
|
3217
3202
|
}
|
|
3218
|
-
function re(v, p, M, x,
|
|
3203
|
+
function re(v, p, M, x, I) {
|
|
3219
3204
|
var r = 0, i, q = W.ht[x].xlen, B;
|
|
3220
3205
|
x == 2 ? B = W.table23 : B = W.table56;
|
|
3221
3206
|
do {
|
|
3222
3207
|
var $ = v[p + 0] * q + v[p + 1];
|
|
3223
3208
|
p += 2, r += B[$];
|
|
3224
3209
|
} while (p < M);
|
|
3225
|
-
return i = r & 65535, r >>= 16, r > i && (r = i, x++),
|
|
3210
|
+
return i = r & 65535, r >>= 16, r > i && (r = i, x++), I.bits += r, x;
|
|
3226
3211
|
}
|
|
3227
|
-
function j(v, p, M, x,
|
|
3212
|
+
function j(v, p, M, x, I) {
|
|
3228
3213
|
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
3214
|
do {
|
|
3230
3215
|
var Se = v[p + 0] * B + v[p + 1];
|
|
3231
3216
|
p += 2, r += $[Se], i += de[Se], q += ge[Se];
|
|
3232
3217
|
} while (p < M);
|
|
3233
3218
|
var Ye = x;
|
|
3234
|
-
return r > i && (r = i, Ye++), r > q && (r = q, Ye = x + 2),
|
|
3219
|
+
return r > i && (r = i, Ye++), r > q && (r = q, Ye = x + 2), I.bits += r, Ye;
|
|
3235
3220
|
}
|
|
3236
3221
|
var _e = [
|
|
3237
3222
|
1,
|
|
@@ -3251,10 +3236,10 @@ const ua = _a;
|
|
|
3251
3236
|
13
|
|
3252
3237
|
];
|
|
3253
3238
|
function k(v, p, M, x) {
|
|
3254
|
-
var
|
|
3255
|
-
switch (
|
|
3239
|
+
var I = H(v, p, M);
|
|
3240
|
+
switch (I) {
|
|
3256
3241
|
case 0:
|
|
3257
|
-
return
|
|
3242
|
+
return I;
|
|
3258
3243
|
case 1:
|
|
3259
3244
|
return z(v, p, M, x);
|
|
3260
3245
|
case 2:
|
|
@@ -3263,7 +3248,7 @@ const ua = _a;
|
|
|
3263
3248
|
v,
|
|
3264
3249
|
p,
|
|
3265
3250
|
M,
|
|
3266
|
-
_e[
|
|
3251
|
+
_e[I - 1],
|
|
3267
3252
|
x
|
|
3268
3253
|
);
|
|
3269
3254
|
case 4:
|
|
@@ -3282,44 +3267,44 @@ const ua = _a;
|
|
|
3282
3267
|
v,
|
|
3283
3268
|
p,
|
|
3284
3269
|
M,
|
|
3285
|
-
_e[
|
|
3270
|
+
_e[I - 1],
|
|
3286
3271
|
x
|
|
3287
3272
|
);
|
|
3288
3273
|
default:
|
|
3289
|
-
|
|
3274
|
+
I > e.IXMAX_VAL && h(), I -= 15;
|
|
3290
3275
|
var r;
|
|
3291
|
-
for (r = 24; r < 32 && !(W.ht[r].linmax >=
|
|
3276
|
+
for (r = 24; r < 32 && !(W.ht[r].linmax >= I); r++)
|
|
3292
3277
|
;
|
|
3293
3278
|
var i;
|
|
3294
|
-
for (i = r - 8; i < 24 && !(W.ht[i].linmax >=
|
|
3279
|
+
for (i = r - 8; i < 24 && !(W.ht[i].linmax >= I); i++)
|
|
3295
3280
|
;
|
|
3296
3281
|
return oe(v, p, M, i, r, x);
|
|
3297
3282
|
}
|
|
3298
3283
|
}
|
|
3299
3284
|
this.noquant_count_bits = function(v, p, M) {
|
|
3300
|
-
var x = p.l3_enc,
|
|
3301
|
-
for (M != null && (M.sfb_count1 = 0);
|
|
3285
|
+
var x = p.l3_enc, I = Math.min(576, p.max_nonzero_coeff + 2 >> 1 << 1);
|
|
3286
|
+
for (M != null && (M.sfb_count1 = 0); I > 1 && !(x[I - 1] | x[I - 2]); I -= 2)
|
|
3302
3287
|
;
|
|
3303
|
-
p.count1 =
|
|
3304
|
-
for (var r = 0, i = 0;
|
|
3288
|
+
p.count1 = I;
|
|
3289
|
+
for (var r = 0, i = 0; I > 3; I -= 4) {
|
|
3305
3290
|
var q;
|
|
3306
|
-
if (((x[
|
|
3291
|
+
if (((x[I - 1] | x[I - 2] | x[I - 3] | x[I - 4]) & 2147483647) > 1)
|
|
3307
3292
|
break;
|
|
3308
|
-
q = ((x[
|
|
3293
|
+
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
3294
|
}
|
|
3310
3295
|
var B = r;
|
|
3311
|
-
if (p.count1table_select = 0, r > i && (B = i, p.count1table_select = 1), p.count1bits = B, p.big_values =
|
|
3296
|
+
if (p.count1table_select = 0, r > i && (B = i, p.count1table_select = 1), p.count1bits = B, p.big_values = I, I == 0)
|
|
3312
3297
|
return B;
|
|
3313
3298
|
if (p.block_type == o.SHORT_TYPE)
|
|
3314
3299
|
r = 3 * v.scalefac_band.s[3], r > p.big_values && (r = p.big_values), i = p.big_values;
|
|
3315
3300
|
else if (p.block_type == o.NORM_TYPE) {
|
|
3316
|
-
if (r = p.region0_count = v.bv_scf[
|
|
3301
|
+
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
3302
|
var $ = new N(B);
|
|
3318
|
-
p.table_select[2] = k(x, i,
|
|
3303
|
+
p.table_select[2] = k(x, i, I, $), B = $.bits;
|
|
3319
3304
|
}
|
|
3320
3305
|
} 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,
|
|
3306
|
+
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);
|
|
3307
|
+
if (r = Math.min(r, I), i = Math.min(i, I), 0 < r) {
|
|
3323
3308
|
var $ = new N(B);
|
|
3324
3309
|
p.table_select[0] = k(x, 0, r, $), B = $.bits;
|
|
3325
3310
|
}
|
|
@@ -3334,10 +3319,10 @@ const ua = _a;
|
|
|
3334
3319
|
}
|
|
3335
3320
|
return B;
|
|
3336
3321
|
}, this.count_bits = function(v, p, M, x) {
|
|
3337
|
-
var
|
|
3338
|
-
return M.xrpow_max > r ? e.LARGE_BITS : (g(p,
|
|
3322
|
+
var I = M.l3_enc, r = e.IXMAX_VAL / d.IPOW20(M.global_gain);
|
|
3323
|
+
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
3324
|
};
|
|
3340
|
-
function O(v, p, M, x,
|
|
3325
|
+
function O(v, p, M, x, I, r, i) {
|
|
3341
3326
|
for (var q = p.big_values, B = 0; B <= 7 + 15; B++)
|
|
3342
3327
|
x[B] = e.LARGE_BITS;
|
|
3343
3328
|
for (var B = 0; B < 16; B++) {
|
|
@@ -3353,16 +3338,16 @@ const ua = _a;
|
|
|
3353
3338
|
var Ve = de;
|
|
3354
3339
|
ge = new N(Ve);
|
|
3355
3340
|
var mt = k(M, $, $e, ge);
|
|
3356
|
-
Ve = ge.bits, x[B + Ye] > Ve && (x[B + Ye] = Ve,
|
|
3341
|
+
Ve = ge.bits, x[B + Ye] > Ve && (x[B + Ye] = Ve, I[B + Ye] = B, r[B + Ye] = Se, i[B + Ye] = mt);
|
|
3357
3342
|
}
|
|
3358
3343
|
}
|
|
3359
3344
|
}
|
|
3360
|
-
function a(v, p, M, x,
|
|
3345
|
+
function a(v, p, M, x, I, r, i, q) {
|
|
3361
3346
|
for (var B = p.big_values, $ = 2; $ < o.SBMAX_l + 1; $++) {
|
|
3362
3347
|
var de = v.scalefac_band.l[$];
|
|
3363
3348
|
if (de >= B)
|
|
3364
3349
|
break;
|
|
3365
|
-
var ge =
|
|
3350
|
+
var ge = I[$ - 2] + p.count1bits;
|
|
3366
3351
|
if (M.part2_3_length <= ge)
|
|
3367
3352
|
break;
|
|
3368
3353
|
var Se = new N(ge), Ye = k(x, de, B, Se);
|
|
@@ -3370,14 +3355,14 @@ const ua = _a;
|
|
|
3370
3355
|
}
|
|
3371
3356
|
}
|
|
3372
3357
|
this.best_huffman_divide = function(v, p) {
|
|
3373
|
-
var M = new m(), x = p.l3_enc,
|
|
3358
|
+
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
3359
|
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,
|
|
3360
|
+
M.assign(p), p.block_type == o.NORM_TYPE && (O(v, p, x, I, r, i, q), a(
|
|
3376
3361
|
v,
|
|
3377
3362
|
M,
|
|
3378
3363
|
p,
|
|
3379
3364
|
x,
|
|
3380
|
-
|
|
3365
|
+
I,
|
|
3381
3366
|
r,
|
|
3382
3367
|
i,
|
|
3383
3368
|
q
|
|
@@ -3395,7 +3380,7 @@ const ua = _a;
|
|
|
3395
3380
|
M,
|
|
3396
3381
|
p,
|
|
3397
3382
|
x,
|
|
3398
|
-
|
|
3383
|
+
I,
|
|
3399
3384
|
r,
|
|
3400
3385
|
i,
|
|
3401
3386
|
q
|
|
@@ -3417,8 +3402,8 @@ const ua = _a;
|
|
|
3417
3402
|
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
3403
|
Fe.slen1_tab = P, Fe.slen2_tab = y;
|
|
3419
3404
|
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] && !(
|
|
3405
|
+
for (var M, x = p.tt[1][v], I = p.tt[0][v], r = 0; r < W.scfsi_band.length - 1; r++) {
|
|
3406
|
+
for (M = W.scfsi_band[r]; M < W.scfsi_band[r + 1] && !(I.scalefac[M] != x.scalefac[M] && x.scalefac[M] >= 0); M++)
|
|
3422
3407
|
;
|
|
3423
3408
|
if (M == W.scfsi_band[r + 1]) {
|
|
3424
3409
|
for (M = W.scfsi_band[r]; M < W.scfsi_band[r + 1]; M++)
|
|
@@ -3438,37 +3423,37 @@ const ua = _a;
|
|
|
3438
3423
|
}
|
|
3439
3424
|
}
|
|
3440
3425
|
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 &&
|
|
3426
|
+
var I = x.tt[p][M], r, i, q, B, $ = 0;
|
|
3427
|
+
for (q = 0, r = 0; r < I.sfbmax; r++) {
|
|
3428
|
+
var de = I.width[r];
|
|
3429
|
+
for (q += de, B = -de; B < 0 && I.l3_enc[B + q] == 0; B++)
|
|
3445
3430
|
;
|
|
3446
|
-
B == 0 && (
|
|
3431
|
+
B == 0 && (I.scalefac[r] = $ = -2);
|
|
3447
3432
|
}
|
|
3448
|
-
if (
|
|
3433
|
+
if (I.scalefac_scale == 0 && I.preflag == 0) {
|
|
3449
3434
|
var ge = 0;
|
|
3450
|
-
for (r = 0; r <
|
|
3451
|
-
|
|
3435
|
+
for (r = 0; r < I.sfbmax; r++)
|
|
3436
|
+
I.scalefac[r] > 0 && (ge |= I.scalefac[r]);
|
|
3452
3437
|
if (!(ge & 1) && ge != 0) {
|
|
3453
|
-
for (r = 0; r <
|
|
3454
|
-
|
|
3455
|
-
|
|
3438
|
+
for (r = 0; r < I.sfbmax; r++)
|
|
3439
|
+
I.scalefac[r] > 0 && (I.scalefac[r] >>= 1);
|
|
3440
|
+
I.scalefac_scale = $ = 1;
|
|
3456
3441
|
}
|
|
3457
3442
|
}
|
|
3458
|
-
if (
|
|
3459
|
-
for (r = 11; r < o.SBPSY_l && !(
|
|
3443
|
+
if (I.preflag == 0 && I.block_type != o.SHORT_TYPE && v.mode_gr == 2) {
|
|
3444
|
+
for (r = 11; r < o.SBPSY_l && !(I.scalefac[r] < d.pretab[r] && I.scalefac[r] != -2); r++)
|
|
3460
3445
|
;
|
|
3461
3446
|
if (r == o.SBPSY_l) {
|
|
3462
3447
|
for (r = 11; r < o.SBPSY_l; r++)
|
|
3463
|
-
|
|
3464
|
-
|
|
3448
|
+
I.scalefac[r] > 0 && (I.scalefac[r] -= d.pretab[r]);
|
|
3449
|
+
I.preflag = $ = 1;
|
|
3465
3450
|
}
|
|
3466
3451
|
}
|
|
3467
3452
|
for (i = 0; i < 4; i++)
|
|
3468
3453
|
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(
|
|
3454
|
+
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++)
|
|
3455
|
+
I.scalefac[r] == -2 && (I.scalefac[r] = 0);
|
|
3456
|
+
$ != 0 && (v.mode_gr == 2 ? this.scale_bitcount(I) : this.scale_bitcount_lsf(v, I));
|
|
3472
3457
|
};
|
|
3473
3458
|
var w = [
|
|
3474
3459
|
0,
|
|
@@ -3487,7 +3472,7 @@ const ua = _a;
|
|
|
3487
3472
|
108,
|
|
3488
3473
|
108,
|
|
3489
3474
|
126
|
|
3490
|
-
],
|
|
3475
|
+
], c = [
|
|
3491
3476
|
0,
|
|
3492
3477
|
18,
|
|
3493
3478
|
36,
|
|
@@ -3523,22 +3508,22 @@ const ua = _a;
|
|
|
3523
3508
|
74
|
|
3524
3509
|
];
|
|
3525
3510
|
this.scale_bitcount = function(v) {
|
|
3526
|
-
var p, M, x = 0,
|
|
3511
|
+
var p, M, x = 0, I = 0, r, i = v.scalefac;
|
|
3527
3512
|
if (v.block_type == o.SHORT_TYPE)
|
|
3528
|
-
r = w, v.mixed_block_flag != 0 && (r =
|
|
3513
|
+
r = w, v.mixed_block_flag != 0 && (r = c);
|
|
3529
3514
|
else if (r = C, v.preflag == 0) {
|
|
3530
|
-
for (M = 11; M < o.SBPSY_l && !(i[M] <
|
|
3515
|
+
for (M = 11; M < o.SBPSY_l && !(i[M] < d.pretab[M]); M++)
|
|
3531
3516
|
;
|
|
3532
3517
|
if (M == o.SBPSY_l)
|
|
3533
3518
|
for (v.preflag = 1, M = 11; M < o.SBPSY_l; M++)
|
|
3534
|
-
i[M] -=
|
|
3519
|
+
i[M] -= d.pretab[M];
|
|
3535
3520
|
}
|
|
3536
3521
|
for (M = 0; M < v.sfbdivide; M++)
|
|
3537
3522
|
x < i[M] && (x = i[M]);
|
|
3538
3523
|
for (; M < v.sfbmax; M++)
|
|
3539
|
-
|
|
3524
|
+
I < i[M] && (I = i[M]);
|
|
3540
3525
|
for (v.part2_length = e.LARGE_BITS, p = 0; p < 16; p++)
|
|
3541
|
-
x < u[p] &&
|
|
3526
|
+
x < u[p] && I < A[p] && v.part2_length > r[p] && (v.part2_length = r[p], v.scalefac_compress = p);
|
|
3542
3527
|
return v.part2_length == e.LARGE_BITS;
|
|
3543
3528
|
};
|
|
3544
3529
|
var n = [
|
|
@@ -3550,29 +3535,29 @@ const ua = _a;
|
|
|
3550
3535
|
[3, 3, 0, 0]
|
|
3551
3536
|
];
|
|
3552
3537
|
this.scale_bitcount_lsf = function(v, p) {
|
|
3553
|
-
var M, x,
|
|
3538
|
+
var M, x, I, r, i, q, B, $, de = Y(4), ge = p.scalefac;
|
|
3554
3539
|
for (p.preflag != 0 ? M = 2 : M = 0, B = 0; B < 4; B++)
|
|
3555
3540
|
de[B] = 0;
|
|
3556
3541
|
if (p.block_type == o.SHORT_TYPE) {
|
|
3557
3542
|
x = 1;
|
|
3558
|
-
var Se =
|
|
3559
|
-
for ($ = 0,
|
|
3560
|
-
for (r = Se[
|
|
3543
|
+
var Se = d.nr_of_sfb_block[M][x];
|
|
3544
|
+
for ($ = 0, I = 0; I < 4; I++)
|
|
3545
|
+
for (r = Se[I] / 3, B = 0; B < r; B++, $++)
|
|
3561
3546
|
for (i = 0; i < 3; i++)
|
|
3562
|
-
ge[$ * 3 + i] > de[
|
|
3547
|
+
ge[$ * 3 + i] > de[I] && (de[I] = ge[$ * 3 + i]);
|
|
3563
3548
|
} else {
|
|
3564
3549
|
x = 0;
|
|
3565
|
-
var Se =
|
|
3566
|
-
for ($ = 0,
|
|
3567
|
-
for (r = Se[
|
|
3568
|
-
ge[$] > de[
|
|
3550
|
+
var Se = d.nr_of_sfb_block[M][x];
|
|
3551
|
+
for ($ = 0, I = 0; I < 4; I++)
|
|
3552
|
+
for (r = Se[I], B = 0; B < r; B++, $++)
|
|
3553
|
+
ge[$] > de[I] && (de[I] = ge[$]);
|
|
3569
3554
|
}
|
|
3570
|
-
for (q = !1,
|
|
3571
|
-
de[
|
|
3555
|
+
for (q = !1, I = 0; I < 4; I++)
|
|
3556
|
+
de[I] > n[M][I] && (q = !0);
|
|
3572
3557
|
if (!q) {
|
|
3573
3558
|
var Ye, $e, Ve, mt;
|
|
3574
|
-
for (p.sfb_partition_table =
|
|
3575
|
-
p.slen[
|
|
3559
|
+
for (p.sfb_partition_table = d.nr_of_sfb_block[M][x], I = 0; I < 4; I++)
|
|
3560
|
+
p.slen[I] = G[de[I]];
|
|
3576
3561
|
switch (Ye = p.slen[0], $e = p.slen[1], Ve = p.slen[2], mt = p.slen[3], M) {
|
|
3577
3562
|
case 0:
|
|
3578
3563
|
p.scalefac_compress = (Ye * 5 + $e << 4) + (Ve << 2) + mt;
|
|
@@ -3586,8 +3571,8 @@ const ua = _a;
|
|
|
3586
3571
|
}
|
|
3587
3572
|
}
|
|
3588
3573
|
if (!q)
|
|
3589
|
-
for (p.part2_length = 0,
|
|
3590
|
-
p.part2_length += p.slen[
|
|
3574
|
+
for (p.part2_length = 0, I = 0; I < 4; I++)
|
|
3575
|
+
p.part2_length += p.slen[I] * p.sfb_partition_table[I];
|
|
3591
3576
|
return q;
|
|
3592
3577
|
};
|
|
3593
3578
|
var G = [
|
|
@@ -3624,7 +3609,7 @@ const ua = _a;
|
|
|
3624
3609
|
function Qe() {
|
|
3625
3610
|
}
|
|
3626
3611
|
function Ze() {
|
|
3627
|
-
function
|
|
3612
|
+
function d(g, H, oe, z, re, j, _e, k, O, a, u, A, P, y) {
|
|
3628
3613
|
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
3614
|
}
|
|
3630
3615
|
var N;
|
|
@@ -3635,39 +3620,39 @@ const ua = _a;
|
|
|
3635
3620
|
h();
|
|
3636
3621
|
}
|
|
3637
3622
|
var T = [
|
|
3638
|
-
new
|
|
3623
|
+
new d(8, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -30, 11, 12e-4, 1),
|
|
3639
3624
|
/* 8, impossible to use in stereo */
|
|
3640
|
-
new
|
|
3625
|
+
new d(16, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -25, 11, 1e-3, 1),
|
|
3641
3626
|
/* 16 */
|
|
3642
|
-
new
|
|
3627
|
+
new d(24, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -20, 11, 1e-3, 1),
|
|
3643
3628
|
/* 24 */
|
|
3644
|
-
new
|
|
3629
|
+
new d(32, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -15, 11, 1e-3, 1),
|
|
3645
3630
|
/* 32 */
|
|
3646
|
-
new
|
|
3631
|
+
new d(40, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -10, 11, 9e-4, 1),
|
|
3647
3632
|
/* 40 */
|
|
3648
|
-
new
|
|
3633
|
+
new d(48, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -10, 11, 9e-4, 1),
|
|
3649
3634
|
/* 48 */
|
|
3650
|
-
new
|
|
3635
|
+
new d(56, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -6, 11, 8e-4, 1),
|
|
3651
3636
|
/* 56 */
|
|
3652
|
-
new
|
|
3637
|
+
new d(64, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, -2, 11, 8e-4, 1),
|
|
3653
3638
|
/* 64 */
|
|
3654
|
-
new
|
|
3639
|
+
new d(80, 9, 9, 0, 0, 6.6, 145, 0, 0.95, 0, 0, 8, 7e-4, 1),
|
|
3655
3640
|
/* 80 */
|
|
3656
|
-
new
|
|
3641
|
+
new d(96, 9, 9, 0, 2.5, 6.6, 145, 0, 0.95, 0, 1, 5.5, 6e-4, 1),
|
|
3657
3642
|
/* 96 */
|
|
3658
|
-
new
|
|
3643
|
+
new d(112, 9, 9, 0, 2.25, 6.6, 145, 0, 0.95, 0, 2, 4.5, 5e-4, 1),
|
|
3659
3644
|
/* 112 */
|
|
3660
|
-
new
|
|
3645
|
+
new d(128, 9, 9, 0, 1.95, 6.4, 140, 0, 0.95, 0, 3, 4, 2e-4, 1),
|
|
3661
3646
|
/* 128 */
|
|
3662
|
-
new
|
|
3647
|
+
new d(160, 9, 9, 1, 1.79, 6, 135, 0, 0.95, -2, 5, 3.5, 0, 1),
|
|
3663
3648
|
/* 160 */
|
|
3664
|
-
new
|
|
3649
|
+
new d(192, 9, 9, 1, 1.49, 5.6, 125, 0, 0.97, -4, 7, 3, 0, 0),
|
|
3665
3650
|
/* 192 */
|
|
3666
|
-
new
|
|
3651
|
+
new d(224, 9, 9, 1, 1.25, 5.2, 125, 0, 0.98, -6, 9, 2, 0, 0),
|
|
3667
3652
|
/* 224 */
|
|
3668
|
-
new
|
|
3653
|
+
new d(256, 9, 9, 1, 0.97, 5.2, 125, 0, 1, -8, 10, 1, 0, 0),
|
|
3669
3654
|
/* 256 */
|
|
3670
|
-
new
|
|
3655
|
+
new d(320, 9, 9, 1, 0.9, 5.2, 125, 0, 1, -10, 12, 0, 0, 0)
|
|
3671
3656
|
/* 320 */
|
|
3672
3657
|
];
|
|
3673
3658
|
function ce(g, H, oe) {
|
|
@@ -3737,11 +3722,11 @@ const ua = _a;
|
|
|
3737
3722
|
};
|
|
3738
3723
|
}
|
|
3739
3724
|
function Ge() {
|
|
3740
|
-
var
|
|
3725
|
+
var d;
|
|
3741
3726
|
this.setModules = function(N) {
|
|
3742
|
-
|
|
3727
|
+
d = N;
|
|
3743
3728
|
}, this.ResvFrameBegin = function(N, V) {
|
|
3744
|
-
var T = N.internal_flags, ce, g = T.l3_side, H =
|
|
3729
|
+
var T = N.internal_flags, ce, g = T.l3_side, H = d.getframebits(N);
|
|
3745
3730
|
V.bits = (H - T.sideinfo_len * 8) / T.mode_gr;
|
|
3746
3731
|
var oe = 8 * 256 * T.mode_gr - 8;
|
|
3747
3732
|
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 +3755,7 @@ const ua = _a;
|
|
|
3770
3755
|
function He() {
|
|
3771
3756
|
this.setModules = function(V, T, ce) {
|
|
3772
3757
|
};
|
|
3773
|
-
var
|
|
3758
|
+
var d = [
|
|
3774
3759
|
0,
|
|
3775
3760
|
49345,
|
|
3776
3761
|
49537,
|
|
@@ -4030,103 +4015,103 @@ const ua = _a;
|
|
|
4030
4015
|
];
|
|
4031
4016
|
function N(V, T) {
|
|
4032
4017
|
var ce = T ^ V;
|
|
4033
|
-
return T = T >> 8 ^
|
|
4018
|
+
return T = T >> 8 ^ d[ce & 255], T;
|
|
4034
4019
|
}
|
|
4035
4020
|
this.updateMusicCRC = function(V, T, ce, g) {
|
|
4036
4021
|
for (var H = 0; H < g; ++H)
|
|
4037
4022
|
V[0] = N(T[ce + H], V[0]);
|
|
4038
4023
|
};
|
|
4039
4024
|
}
|
|
4040
|
-
Xe.EQ = function(
|
|
4041
|
-
return Math.abs(
|
|
4042
|
-
}, Xe.NEQ = function(
|
|
4043
|
-
return !Xe.EQ(
|
|
4025
|
+
Xe.EQ = function(d, N) {
|
|
4026
|
+
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;
|
|
4027
|
+
}, Xe.NEQ = function(d, N) {
|
|
4028
|
+
return !Xe.EQ(d, N);
|
|
4044
4029
|
};
|
|
4045
4030
|
function Xe() {
|
|
4046
|
-
var
|
|
4047
|
-
this.setModules = function(_, w,
|
|
4048
|
-
N =
|
|
4031
|
+
var d = this, N = null, V = null;
|
|
4032
|
+
this.setModules = function(_, w, c, C) {
|
|
4033
|
+
N = c, V = C;
|
|
4049
4034
|
};
|
|
4050
4035
|
var T = null, ce = 0, g = 0, H = 0;
|
|
4051
4036
|
this.getframebits = function(_) {
|
|
4052
|
-
var w = _.internal_flags,
|
|
4053
|
-
w.bitrate_index != 0 ?
|
|
4054
|
-
var C = 0 | (_.version + 1) * 72e3 *
|
|
4037
|
+
var w = _.internal_flags, c;
|
|
4038
|
+
w.bitrate_index != 0 ? c = W.bitrate_table[_.version][w.bitrate_index] : c = _.brate;
|
|
4039
|
+
var C = 0 | (_.version + 1) * 72e3 * c / _.out_samplerate + w.padding;
|
|
4055
4040
|
return 8 * C;
|
|
4056
4041
|
};
|
|
4057
4042
|
function oe(_) {
|
|
4058
4043
|
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
4044
|
}
|
|
4060
|
-
function z(_, w,
|
|
4061
|
-
for (;
|
|
4045
|
+
function z(_, w, c) {
|
|
4046
|
+
for (; c > 0; ) {
|
|
4062
4047
|
var C;
|
|
4063
|
-
H == 0 && (H = 8, g++, _.header[_.w_ptr].write_timing == ce && oe(_), T[g] = 0), C = Math.min(
|
|
4048
|
+
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
4049
|
}
|
|
4065
4050
|
}
|
|
4066
4051
|
function re(_, w) {
|
|
4067
|
-
var
|
|
4068
|
-
if (w >= 8 && (z(
|
|
4052
|
+
var c = _.internal_flags, C;
|
|
4053
|
+
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
4054
|
var n = N.getLameShortVersion();
|
|
4070
4055
|
if (w >= 32)
|
|
4071
4056
|
for (C = 0; C < n.length && w >= 8; ++C)
|
|
4072
|
-
w -= 8, z(
|
|
4057
|
+
w -= 8, z(c, n.charCodeAt(C), 8);
|
|
4073
4058
|
}
|
|
4074
4059
|
for (; w >= 1; w -= 1)
|
|
4075
|
-
z(
|
|
4060
|
+
z(c, c.ancillary_flag, 1), c.ancillary_flag ^= _.disable_reservoir ? 0 : 1;
|
|
4076
4061
|
}
|
|
4077
|
-
function j(_, w,
|
|
4078
|
-
for (var C = _.header[_.h_ptr].ptr;
|
|
4079
|
-
var n = Math.min(
|
|
4080
|
-
|
|
4062
|
+
function j(_, w, c) {
|
|
4063
|
+
for (var C = _.header[_.h_ptr].ptr; c > 0; ) {
|
|
4064
|
+
var n = Math.min(c, 8 - (C & 7));
|
|
4065
|
+
c -= n, _.header[_.h_ptr].buf[C >> 3] |= w >> c << 8 - (C & 7) - n, C += n;
|
|
4081
4066
|
}
|
|
4082
4067
|
_.header[_.h_ptr].ptr = C;
|
|
4083
4068
|
}
|
|
4084
4069
|
function _e(_, w) {
|
|
4085
|
-
var
|
|
4086
|
-
if (C =
|
|
4087
|
-
for (j(
|
|
4070
|
+
var c = _.internal_flags, C, n, G;
|
|
4071
|
+
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) {
|
|
4072
|
+
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
4073
|
var v;
|
|
4089
4074
|
for (v = 0; v < 4; v++)
|
|
4090
|
-
j(
|
|
4075
|
+
j(c, C.scfsi[G][v], 1);
|
|
4091
4076
|
}
|
|
4092
4077
|
for (n = 0; n < 2; n++)
|
|
4093
|
-
for (G = 0; G <
|
|
4078
|
+
for (G = 0; G < c.channels_out; G++) {
|
|
4094
4079
|
var p = C.tt[n][G];
|
|
4095
|
-
j(
|
|
4080
|
+
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
4081
|
}
|
|
4097
4082
|
} else
|
|
4098
|
-
for (j(
|
|
4083
|
+
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
4084
|
var p = C.tt[n][G];
|
|
4100
|
-
j(
|
|
4085
|
+
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
4086
|
}
|
|
4102
4087
|
_.error_protection && h();
|
|
4103
4088
|
{
|
|
4104
|
-
var M =
|
|
4105
|
-
|
|
4089
|
+
var M = c.h_ptr;
|
|
4090
|
+
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
4091
|
}
|
|
4107
4092
|
}
|
|
4108
4093
|
function k(_, w) {
|
|
4109
|
-
var
|
|
4094
|
+
var c = W.ht[w.count1table_select + 32], C, n = 0, G = w.big_values, v = w.big_values;
|
|
4110
4095
|
for (C = (w.count1 - w.big_values) / 4; C > 0; --C) {
|
|
4111
4096
|
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 +
|
|
4097
|
+
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
4098
|
}
|
|
4114
4099
|
return n;
|
|
4115
4100
|
}
|
|
4116
|
-
function O(_, w,
|
|
4101
|
+
function O(_, w, c, C, n) {
|
|
4117
4102
|
var G = W.ht[w], v = 0;
|
|
4118
4103
|
if (w == 0)
|
|
4119
4104
|
return v;
|
|
4120
|
-
for (var p =
|
|
4121
|
-
var M = 0, x = 0,
|
|
4105
|
+
for (var p = c; p < C; p += 2) {
|
|
4106
|
+
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
4107
|
if (q != 0 && (n.xr[p] < 0 && i++, M--), w > 15) {
|
|
4123
4108
|
if (q > 14) {
|
|
4124
4109
|
var $ = q - 15;
|
|
4125
|
-
i |= $ << 1, x =
|
|
4110
|
+
i |= $ << 1, x = I, q = 15;
|
|
4126
4111
|
}
|
|
4127
4112
|
if (B > 14) {
|
|
4128
4113
|
var de = B - 15;
|
|
4129
|
-
i <<=
|
|
4114
|
+
i <<= I, i |= de, x += I, B = 15;
|
|
4130
4115
|
}
|
|
4131
4116
|
r = 16;
|
|
4132
4117
|
}
|
|
@@ -4135,22 +4120,22 @@ const ua = _a;
|
|
|
4135
4120
|
return v;
|
|
4136
4121
|
}
|
|
4137
4122
|
function a(_, w) {
|
|
4138
|
-
var
|
|
4139
|
-
|
|
4140
|
-
var C = O(_, w.table_select[0], 0,
|
|
4123
|
+
var c = 3 * _.scalefac_band.s[3];
|
|
4124
|
+
c > w.big_values && (c = w.big_values);
|
|
4125
|
+
var C = O(_, w.table_select[0], 0, c, w);
|
|
4141
4126
|
return C += O(
|
|
4142
4127
|
_,
|
|
4143
4128
|
w.table_select[1],
|
|
4144
|
-
|
|
4129
|
+
c,
|
|
4145
4130
|
w.big_values,
|
|
4146
4131
|
w
|
|
4147
4132
|
), C;
|
|
4148
4133
|
}
|
|
4149
4134
|
function u(_, w) {
|
|
4150
|
-
var
|
|
4151
|
-
|
|
4135
|
+
var c, C, n, G;
|
|
4136
|
+
c = w.big_values;
|
|
4152
4137
|
var v = w.region0_count + 1;
|
|
4153
|
-
return n = _.scalefac_band.l[v], v += w.region1_count + 1, G = _.scalefac_band.l[v], n >
|
|
4138
|
+
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
4139
|
_,
|
|
4155
4140
|
w.table_select[1],
|
|
4156
4141
|
n,
|
|
@@ -4160,25 +4145,25 @@ const ua = _a;
|
|
|
4160
4145
|
_,
|
|
4161
4146
|
w.table_select[2],
|
|
4162
4147
|
G,
|
|
4163
|
-
|
|
4148
|
+
c,
|
|
4164
4149
|
w
|
|
4165
4150
|
), C;
|
|
4166
4151
|
}
|
|
4167
4152
|
function A(_) {
|
|
4168
|
-
var w,
|
|
4153
|
+
var w, c, C, n, G = 0, v = _.internal_flags, p = v.l3_side;
|
|
4169
4154
|
if (_.version == 1)
|
|
4170
4155
|
for (w = 0; w < 2; w++)
|
|
4171
|
-
for (
|
|
4172
|
-
var M = p.tt[w][
|
|
4156
|
+
for (c = 0; c < v.channels_out; c++) {
|
|
4157
|
+
var M = p.tt[w][c], x = Fe.slen1_tab[M.scalefac_compress], I = Fe.slen2_tab[M.scalefac_compress];
|
|
4173
4158
|
for (n = 0, C = 0; C < M.sfbdivide; C++)
|
|
4174
4159
|
M.scalefac[C] != -1 && (z(v, M.scalefac[C], x), n += x);
|
|
4175
4160
|
for (; C < M.sfbmax; C++)
|
|
4176
|
-
M.scalefac[C] != -1 && (z(v, M.scalefac[C],
|
|
4161
|
+
M.scalefac[C] != -1 && (z(v, M.scalefac[C], I), n += I);
|
|
4177
4162
|
M.block_type == o.SHORT_TYPE ? n += a(v, M) : n += u(v, M), n += k(v, M), G += n;
|
|
4178
4163
|
}
|
|
4179
4164
|
else
|
|
4180
|
-
for (w = 0,
|
|
4181
|
-
var M = p.tt[w][
|
|
4165
|
+
for (w = 0, c = 0; c < v.channels_out; c++) {
|
|
4166
|
+
var M = p.tt[w][c], r, i, q = 0;
|
|
4182
4167
|
if (n = 0, C = 0, i = 0, M.block_type == o.SHORT_TYPE) {
|
|
4183
4168
|
for (; i < 4; i++) {
|
|
4184
4169
|
var B = M.sfb_partition_table[i] / 3, $ = M.slen[i];
|
|
@@ -4214,42 +4199,42 @@ const ua = _a;
|
|
|
4214
4199
|
this.total = 0;
|
|
4215
4200
|
}
|
|
4216
4201
|
function y(_, w) {
|
|
4217
|
-
var
|
|
4218
|
-
return
|
|
4202
|
+
var c = _.internal_flags, C, n, G;
|
|
4203
|
+
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
4204
|
}
|
|
4220
4205
|
this.flush_bitstream = function(_) {
|
|
4221
|
-
var w = _.internal_flags,
|
|
4222
|
-
w.h_ptr - 1,
|
|
4206
|
+
var w = _.internal_flags, c, C;
|
|
4207
|
+
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
4208
|
}, this.format_bitstream = function(_) {
|
|
4224
|
-
var w = _.internal_flags,
|
|
4225
|
-
|
|
4209
|
+
var w = _.internal_flags, c;
|
|
4210
|
+
c = w.l3_side;
|
|
4226
4211
|
var C = this.getframebits(_);
|
|
4227
|
-
re(_,
|
|
4212
|
+
re(_, c.resvDrain_pre), _e(_, C);
|
|
4228
4213
|
var n = 8 * w.sideinfo_len;
|
|
4229
|
-
if (n += A(_), re(_,
|
|
4214
|
+
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
4215
|
var G;
|
|
4231
4216
|
for (G = 0; G < le.MAX_HEADER_BUF; ++G)
|
|
4232
4217
|
w.header[G].write_timing -= ce;
|
|
4233
4218
|
ce = 0;
|
|
4234
4219
|
}
|
|
4235
4220
|
return 0;
|
|
4236
|
-
}, this.copy_buffer = function(_, w,
|
|
4221
|
+
}, this.copy_buffer = function(_, w, c, C, n) {
|
|
4237
4222
|
var G = g + 1;
|
|
4238
4223
|
if (G <= 0)
|
|
4239
4224
|
return 0;
|
|
4240
4225
|
if (C != 0 && G > C)
|
|
4241
4226
|
return -1;
|
|
4242
|
-
if (te.arraycopy(T, 0, w,
|
|
4227
|
+
if (te.arraycopy(T, 0, w, c, G), g = -1, H = 0, n != 0) {
|
|
4243
4228
|
var v = Y(1);
|
|
4244
|
-
v[0] = _.nMusicCRC, V.updateMusicCRC(v, w,
|
|
4229
|
+
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
4230
|
}
|
|
4246
4231
|
return G;
|
|
4247
4232
|
}, this.init_bit_stream_w = function(_) {
|
|
4248
4233
|
T = U(ue.LAME_MAXMP3BUFFER), _.h_ptr = _.w_ptr = 0, _.header[_.h_ptr].write_timing = 0, g = -1, H = 0, ce = 0;
|
|
4249
4234
|
};
|
|
4250
4235
|
}
|
|
4251
|
-
function ke(
|
|
4252
|
-
this.xlen =
|
|
4236
|
+
function ke(d, N, V, T) {
|
|
4237
|
+
this.xlen = d, this.linmax = N, this.table = V, this.hlen = T;
|
|
4253
4238
|
}
|
|
4254
4239
|
var W = {};
|
|
4255
4240
|
W.t1HB = [
|
|
@@ -7697,14 +7682,14 @@ const ua = _a;
|
|
|
7697
7682
|
[44100, 48e3, 32e3, -1],
|
|
7698
7683
|
[11025, 12e3, 8e3, -1]
|
|
7699
7684
|
], W.scfsi_band = [0, 6, 11, 16, 21];
|
|
7700
|
-
function pt(
|
|
7701
|
-
this.bits =
|
|
7685
|
+
function pt(d) {
|
|
7686
|
+
this.bits = d;
|
|
7702
7687
|
}
|
|
7703
7688
|
function at() {
|
|
7704
7689
|
this.over_noise = 0, this.tot_noise = 0, this.max_noise = 0, this.over_count = 0, this.over_SSD = 0, this.bits = 0;
|
|
7705
7690
|
}
|
|
7706
7691
|
function et() {
|
|
7707
|
-
this.setModules = function(
|
|
7692
|
+
this.setModules = function(d, N) {
|
|
7708
7693
|
};
|
|
7709
7694
|
}
|
|
7710
7695
|
function vt() {
|
|
@@ -7713,8 +7698,8 @@ const ua = _a;
|
|
|
7713
7698
|
function _t() {
|
|
7714
7699
|
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
7700
|
}
|
|
7716
|
-
function ct(
|
|
7717
|
-
var N =
|
|
7701
|
+
function ct(d) {
|
|
7702
|
+
var N = d;
|
|
7718
7703
|
this.quantize = N, this.iteration_loop = function(V, T, ce, g) {
|
|
7719
7704
|
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
7705
|
this.quantize.rv.ResvFrameBegin(V, k), j = k.bits;
|
|
@@ -7752,16 +7737,16 @@ const ua = _a;
|
|
|
7752
7737
|
}
|
|
7753
7738
|
function Be() {
|
|
7754
7739
|
}
|
|
7755
|
-
function L(
|
|
7740
|
+
function L(d, N, V, T) {
|
|
7756
7741
|
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
7742
|
var ce = this.l, g = this.s;
|
|
7758
7743
|
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
7744
|
}
|
|
7760
7745
|
e.Q_MAX = 256 + 1, e.Q_MAX2 = 116, e.LARGE_BITS = 1e5, e.IXMAX_VAL = 8206;
|
|
7761
7746
|
function e() {
|
|
7762
|
-
var
|
|
7747
|
+
var d = null, N = null, V = null;
|
|
7763
7748
|
this.setModules = function(y, _, w) {
|
|
7764
|
-
|
|
7749
|
+
d = y, N = _, V = w;
|
|
7765
7750
|
};
|
|
7766
7751
|
function T(y) {
|
|
7767
7752
|
return _e[y + e.Q_MAX2];
|
|
@@ -8145,11 +8130,11 @@ const ua = _a;
|
|
|
8145
8130
|
return w -= re, w = Math.pow(10, w / 10 + y.ATHlower), w;
|
|
8146
8131
|
}
|
|
8147
8132
|
function A(y) {
|
|
8148
|
-
for (var _ = y.internal_flags.ATH.l, w = y.internal_flags.ATH.psfb21,
|
|
8133
|
+
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
8134
|
var p = n.scalefac_band.l[v], M = n.scalefac_band.l[v + 1];
|
|
8150
8135
|
_[v] = Ue.MAX_VALUE;
|
|
8151
8136
|
for (var x = p; x < M; x++) {
|
|
8152
|
-
var
|
|
8137
|
+
var I = x * G / 1152, r = u(y, I);
|
|
8153
8138
|
_[v] = Math.min(_[v], r);
|
|
8154
8139
|
}
|
|
8155
8140
|
}
|
|
@@ -8157,66 +8142,66 @@ const ua = _a;
|
|
|
8157
8142
|
var p = n.scalefac_band.psfb21[v], M = n.scalefac_band.psfb21[v + 1];
|
|
8158
8143
|
w[v] = Ue.MAX_VALUE;
|
|
8159
8144
|
for (var x = p; x < M; x++) {
|
|
8160
|
-
var
|
|
8145
|
+
var I = x * G / 1152, r = u(y, I);
|
|
8161
8146
|
w[v] = Math.min(w[v], r);
|
|
8162
8147
|
}
|
|
8163
8148
|
}
|
|
8164
8149
|
for (var v = 0; v < o.SBMAX_s; v++) {
|
|
8165
8150
|
var p = n.scalefac_band.s[v], M = n.scalefac_band.s[v + 1];
|
|
8166
|
-
|
|
8151
|
+
c[v] = Ue.MAX_VALUE;
|
|
8167
8152
|
for (var x = p; x < M; x++) {
|
|
8168
|
-
var
|
|
8169
|
-
|
|
8153
|
+
var I = x * G / 384, r = u(y, I);
|
|
8154
|
+
c[v] = Math.min(c[v], r);
|
|
8170
8155
|
}
|
|
8171
|
-
|
|
8156
|
+
c[v] *= n.scalefac_band.s[v + 1] - n.scalefac_band.s[v];
|
|
8172
8157
|
}
|
|
8173
8158
|
for (var v = 0; v < o.PSFB12; v++) {
|
|
8174
8159
|
var p = n.scalefac_band.psfb12[v], M = n.scalefac_band.psfb12[v + 1];
|
|
8175
8160
|
C[v] = Ue.MAX_VALUE;
|
|
8176
8161
|
for (var x = p; x < M; x++) {
|
|
8177
|
-
var
|
|
8162
|
+
var I = x * G / 384, r = u(y, I);
|
|
8178
8163
|
C[v] = Math.min(C[v], r);
|
|
8179
8164
|
}
|
|
8180
8165
|
C[v] *= n.scalefac_band.s[13] - n.scalefac_band.s[12];
|
|
8181
8166
|
}
|
|
8182
|
-
y.noATH && h(), n.ATH.floor = 10 *
|
|
8167
|
+
y.noATH && h(), n.ATH.floor = 10 * f(u(y, -1));
|
|
8183
8168
|
}
|
|
8184
8169
|
this.iteration_init = function(y) {
|
|
8185
|
-
var _ = y.internal_flags, w = _.l3_side,
|
|
8170
|
+
var _ = y.internal_flags, w = _.l3_side, c;
|
|
8186
8171
|
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[
|
|
8172
|
+
for (_.iteration_init_init = 1, w.main_data_begin = 0, A(y), O[0] = 0, c = 1; c < H; c++)
|
|
8173
|
+
O[c] = Math.pow(c, 4 / 3);
|
|
8174
|
+
for (c = 0; c < H - 1; c++)
|
|
8175
|
+
a[c] = c + 1 - Math.pow(
|
|
8176
|
+
0.5 * (O[c] + O[c + 1]),
|
|
8192
8177
|
0.75
|
|
8193
8178
|
);
|
|
8194
|
-
for (a[
|
|
8195
|
-
k[
|
|
8196
|
-
for (
|
|
8197
|
-
_e[
|
|
8198
|
-
|
|
8179
|
+
for (a[c] = 0.5, c = 0; c < oe; c++)
|
|
8180
|
+
k[c] = Math.pow(2, (c - 210) * -0.1875);
|
|
8181
|
+
for (c = 0; c <= oe + z; c++)
|
|
8182
|
+
_e[c] = Math.pow(2, (c - 210 - z) * 0.25);
|
|
8183
|
+
d.huffman_init(_);
|
|
8199
8184
|
{
|
|
8200
8185
|
var C, n, G, v;
|
|
8201
|
-
for (
|
|
8186
|
+
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
8187
|
var p;
|
|
8203
|
-
|
|
8188
|
+
c <= 6 ? p = C : c <= 13 ? p = n : c <= 20 ? p = G : p = v, _.nsPsy.longfact[c] = p;
|
|
8204
8189
|
}
|
|
8205
|
-
for (
|
|
8190
|
+
for (c = 0; c < o.SBMAX_s; c++) {
|
|
8206
8191
|
var p;
|
|
8207
|
-
|
|
8192
|
+
c <= 5 ? p = C : c <= 10 ? p = n : c <= 11 ? p = G : p = v, _.nsPsy.shortfact[c] = p;
|
|
8208
8193
|
}
|
|
8209
8194
|
}
|
|
8210
8195
|
}
|
|
8211
|
-
}, this.on_pe = function(y, _, w,
|
|
8212
|
-
var G = y.internal_flags, v = 0, p, M = Y(2), x,
|
|
8213
|
-
v =
|
|
8196
|
+
}, this.on_pe = function(y, _, w, c, C, n) {
|
|
8197
|
+
var G = y.internal_flags, v = 0, p, M = Y(2), x, I = new pt(v), r = N.ResvMaxBits(y, c, I, n);
|
|
8198
|
+
v = I.bits;
|
|
8214
8199
|
var i = v + r;
|
|
8215
8200
|
for (i > le.MAX_BITS_PER_GRANULE && (i = le.MAX_BITS_PER_GRANULE), p = 0, x = 0; x < G.channels_out; ++x)
|
|
8216
8201
|
w[x] = Math.min(
|
|
8217
8202
|
le.MAX_BITS_PER_CHANNEL,
|
|
8218
8203
|
v / G.channels_out
|
|
8219
|
-
), M[x] = 0 | w[x] * _[C][x] / 700 - w[x], M[x] >
|
|
8204
|
+
), 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
8205
|
0,
|
|
8221
8206
|
le.MAX_BITS_PER_CHANNEL - w[x]
|
|
8222
8207
|
)), p += M[x];
|
|
@@ -8229,10 +8214,10 @@ const ua = _a;
|
|
|
8229
8214
|
p += w[x];
|
|
8230
8215
|
return p > le.MAX_BITS_PER_GRANULE && h(), i;
|
|
8231
8216
|
}, 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,
|
|
8217
|
+
var c = 90.30873362, C = 94.82444863, n = ie.FAST_LOG10_X(_, 10), G = y * y, v = 0;
|
|
8218
|
+
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);
|
|
8219
|
+
}, this.calc_xmin = function(y, _, w, c) {
|
|
8220
|
+
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
8221
|
for ((y.VBR == E.vbr_mtrh || y.VBR == E.vbr_mt) && (r = 1), G = 0; G < w.psy_lmax; G++) {
|
|
8237
8222
|
var i, q, B, $, de, ge;
|
|
8238
8223
|
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 +8225,14 @@ const ua = _a;
|
|
|
8240
8225
|
var Se, Ye;
|
|
8241
8226
|
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
8227
|
} while (--ge > 0);
|
|
8243
|
-
if (i > q && p++, G == o.SBPSY_l && h(),
|
|
8228
|
+
if (i > q && p++, G == o.SBPSY_l && h(), I != 0 && (q = $), !y.ATHonly) {
|
|
8244
8229
|
var $e = _.en.l[G];
|
|
8245
8230
|
if ($e > 0) {
|
|
8246
8231
|
var Ve;
|
|
8247
|
-
Ve = i * _.thm.l[G] * r / $e,
|
|
8232
|
+
Ve = i * _.thm.l[G] * r / $e, I != 0 && (Ve *= n.nsPsy.longfact[G]), q < Ve && (q = Ve);
|
|
8248
8233
|
}
|
|
8249
8234
|
}
|
|
8250
|
-
|
|
8235
|
+
I != 0 ? c[C++] = q : c[C++] = q * n.nsPsy.longfact[G];
|
|
8251
8236
|
}
|
|
8252
8237
|
var mt = 575;
|
|
8253
8238
|
if (w.block_type != o.SHORT_TYPE)
|
|
@@ -8263,23 +8248,23 @@ const ua = _a;
|
|
|
8263
8248
|
var Se, Ye;
|
|
8264
8249
|
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
8250
|
} while (--ge > 0);
|
|
8266
|
-
if (i > gt && p++, lt == o.SBPSY_s && h(),
|
|
8251
|
+
if (i > gt && p++, lt == o.SBPSY_s && h(), I != 0 ? q = $ : q = gt, !y.ATHonly && !y.ATHshort) {
|
|
8267
8252
|
var $e = _.en.s[lt][ft];
|
|
8268
8253
|
if ($e > 0) {
|
|
8269
8254
|
var Ve;
|
|
8270
|
-
Ve = i * _.thm.s[lt][ft] * r / $e,
|
|
8255
|
+
Ve = i * _.thm.s[lt][ft] * r / $e, I != 0 && (Ve *= n.nsPsy.shortfact[lt]), q < Ve && (q = Ve);
|
|
8271
8256
|
}
|
|
8272
8257
|
}
|
|
8273
|
-
|
|
8258
|
+
I != 0 ? c[C++] = q : c[C++] = q * n.nsPsy.shortfact[lt];
|
|
8274
8259
|
}
|
|
8275
|
-
y.useTemporal && (
|
|
8260
|
+
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
8261
|
}
|
|
8277
8262
|
return p;
|
|
8278
8263
|
};
|
|
8279
8264
|
function P(y) {
|
|
8280
8265
|
this.s = y;
|
|
8281
8266
|
}
|
|
8282
|
-
this.calc_noise_core = function(y, _, w,
|
|
8267
|
+
this.calc_noise_core = function(y, _, w, c) {
|
|
8283
8268
|
var C = 0, n = _.s, G = y.l3_enc;
|
|
8284
8269
|
if (n > y.count1)
|
|
8285
8270
|
for (; w-- != 0; ) {
|
|
@@ -8288,19 +8273,19 @@ const ua = _a;
|
|
|
8288
8273
|
}
|
|
8289
8274
|
else if (n > y.big_values) {
|
|
8290
8275
|
var p = K(2);
|
|
8291
|
-
for (p[0] = 0, p[1] =
|
|
8276
|
+
for (p[0] = 0, p[1] = c; w-- != 0; ) {
|
|
8292
8277
|
var v;
|
|
8293
8278
|
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
8279
|
}
|
|
8295
8280
|
} else
|
|
8296
8281
|
for (; w-- != 0; ) {
|
|
8297
8282
|
var v;
|
|
8298
|
-
v = Math.abs(y.xr[n]) - O[G[n]] *
|
|
8283
|
+
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
8284
|
}
|
|
8300
8285
|
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 (
|
|
8286
|
+
}, this.calc_noise = function(y, _, w, c, C) {
|
|
8287
|
+
var n = 0, G = 0, v, p, M = 0, x = 0, I = 0, r = -20, i = 0, q = y.scalefac, B = 0;
|
|
8288
|
+
for (c.over_SSD = 0, v = 0; v < y.psymax; v++) {
|
|
8304
8289
|
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
8290
|
if (C != null && C.step[v] == $)
|
|
8306
8291
|
de = C.noise[v], i += y.width[v], w[n++] = de / _[G++], de = C.noise_log[v];
|
|
@@ -8313,13 +8298,13 @@ const ua = _a;
|
|
|
8313
8298
|
var Ye = new P(i);
|
|
8314
8299
|
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
8300
|
}
|
|
8316
|
-
if (C != null && (C.global_gain = y.global_gain),
|
|
8301
|
+
if (C != null && (C.global_gain = y.global_gain), I += de, de > 0) {
|
|
8317
8302
|
var $e;
|
|
8318
|
-
$e = Math.max(0 | de * 10 + 0.5, 1),
|
|
8303
|
+
$e = Math.max(0 | de * 10 + 0.5, 1), c.over_SSD += $e * $e, M++, x += de;
|
|
8319
8304
|
}
|
|
8320
8305
|
r = Math.max(r, de);
|
|
8321
8306
|
}
|
|
8322
|
-
return
|
|
8307
|
+
return c.over_count = M, c.tot_noise = I, c.over_noise = x, c.max_noise = r, M;
|
|
8323
8308
|
};
|
|
8324
8309
|
}
|
|
8325
8310
|
function l() {
|
|
@@ -8327,7 +8312,7 @@ const ua = _a;
|
|
|
8327
8312
|
}
|
|
8328
8313
|
function m() {
|
|
8329
8314
|
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
|
|
8315
|
+
var d = this;
|
|
8331
8316
|
function N(T) {
|
|
8332
8317
|
return new Int32Array(T);
|
|
8333
8318
|
}
|
|
@@ -8335,18 +8320,18 @@ const ua = _a;
|
|
|
8335
8320
|
return new Float32Array(T);
|
|
8336
8321
|
}
|
|
8337
8322
|
this.assign = function(T) {
|
|
8338
|
-
|
|
8323
|
+
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
8324
|
};
|
|
8340
8325
|
}
|
|
8341
8326
|
var b = {};
|
|
8342
8327
|
b.SFBMAX = o.SBMAX_s * 3;
|
|
8343
8328
|
function D() {
|
|
8344
8329
|
this.rv = null;
|
|
8345
|
-
var
|
|
8330
|
+
var d;
|
|
8346
8331
|
this.qupvt = null;
|
|
8347
8332
|
var N, V = new et(), T;
|
|
8348
8333
|
this.setModules = function(a, u, A, P) {
|
|
8349
|
-
|
|
8334
|
+
d = u, this.rv = u, N = A, this.qupvt = A, T = P, V.setModules(N, T);
|
|
8350
8335
|
};
|
|
8351
8336
|
function ce(a, u, A, P) {
|
|
8352
8337
|
P = 0;
|
|
@@ -8371,13 +8356,13 @@ const ua = _a;
|
|
|
8371
8356
|
var A = a.ATH, P = u.xr;
|
|
8372
8357
|
if (u.block_type != o.SHORT_TYPE)
|
|
8373
8358
|
for (var y = !1, _ = o.PSFB21 - 1; _ >= 0 && !y; _--) {
|
|
8374
|
-
var w = a.scalefac_band.psfb21[_],
|
|
8359
|
+
var w = a.scalefac_band.psfb21[_], c = a.scalefac_band.psfb21[_ + 1], C = N.athAdjust(
|
|
8375
8360
|
A.adjust,
|
|
8376
8361
|
A.psfb21[_],
|
|
8377
8362
|
A.floor
|
|
8378
8363
|
);
|
|
8379
8364
|
a.nsPsy.longfact[21] > 1e-12 && (C *= a.nsPsy.longfact[21]);
|
|
8380
|
-
for (var n =
|
|
8365
|
+
for (var n = c - 1; n >= w; n--)
|
|
8381
8366
|
if (Math.abs(P[n]) < C)
|
|
8382
8367
|
P[n] = 0;
|
|
8383
8368
|
else {
|
|
@@ -8388,13 +8373,13 @@ const ua = _a;
|
|
|
8388
8373
|
else
|
|
8389
8374
|
for (var G = 0; G < 3; G++)
|
|
8390
8375
|
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]),
|
|
8376
|
+
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
8377
|
A.adjust,
|
|
8393
8378
|
A.psfb12[_],
|
|
8394
8379
|
A.floor
|
|
8395
8380
|
);
|
|
8396
8381
|
a.nsPsy.shortfact[12] > 1e-12 && (v *= a.nsPsy.shortfact[12]);
|
|
8397
|
-
for (var n =
|
|
8382
|
+
for (var n = c - 1; n >= w; n--)
|
|
8398
8383
|
if (Math.abs(P[n]) < v)
|
|
8399
8384
|
P[n] = 0;
|
|
8400
8385
|
else {
|
|
@@ -8413,9 +8398,9 @@ const ua = _a;
|
|
|
8413
8398
|
var y = a.scalefac_band.l[u.sfb_lmax];
|
|
8414
8399
|
te.arraycopy(u.xr, 0, P, 0, 576);
|
|
8415
8400
|
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],
|
|
8401
|
+
for (var _ = a.scalefac_band.s[A], w = a.scalefac_band.s[A + 1], c = 0; c < 3; c++)
|
|
8417
8402
|
for (var C = _; C < w; C++)
|
|
8418
|
-
u.xr[y++] = P[3 * C +
|
|
8403
|
+
u.xr[y++] = P[3 * C + c];
|
|
8419
8404
|
for (var n = u.sfb_lmax, A = u.sfb_smin; A < o.SBMAX_s; A++)
|
|
8420
8405
|
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
8406
|
}
|
|
@@ -8426,12 +8411,12 @@ const ua = _a;
|
|
|
8426
8411
|
}
|
|
8427
8412
|
H.BINSEARCH_NONE = new H(0), H.BINSEARCH_UP = new H(1), H.BINSEARCH_DOWN = new H(2);
|
|
8428
8413
|
function oe(a, u, A, P, y) {
|
|
8429
|
-
var _, w = a.CurrentStep[P],
|
|
8414
|
+
var _, w = a.CurrentStep[P], c = !1, C = a.OldValue[P], n = H.BINSEARCH_NONE;
|
|
8430
8415
|
for (u.global_gain = C, A -= u.part2_length; ; ) {
|
|
8431
8416
|
var G;
|
|
8432
8417
|
if (_ = T.count_bits(a, y, u, null), w == 1 || _ == A)
|
|
8433
8418
|
break;
|
|
8434
|
-
_ > A ? (n == H.BINSEARCH_DOWN && (
|
|
8419
|
+
_ > 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
8420
|
}
|
|
8436
8421
|
for (; _ > A && u.global_gain < 255; )
|
|
8437
8422
|
u.global_gain++, _ = T.count_bits(a, y, u, null);
|
|
@@ -8483,23 +8468,23 @@ const ua = _a;
|
|
|
8483
8468
|
function j(a, u, A, P, y) {
|
|
8484
8469
|
var _ = a.internal_flags, w;
|
|
8485
8470
|
u.scalefac_scale == 0 ? w = 1.2968395546510096 : w = 1.6817928305074292;
|
|
8486
|
-
for (var
|
|
8487
|
-
|
|
8471
|
+
for (var c = 0, C = 0; C < u.sfbmax; C++)
|
|
8472
|
+
c < A[C] && (c = A[C]);
|
|
8488
8473
|
var n = _.noise_shaping_amp;
|
|
8489
8474
|
switch (n == 3 && h(), n) {
|
|
8490
8475
|
case 2:
|
|
8491
8476
|
break;
|
|
8492
8477
|
case 1:
|
|
8493
|
-
|
|
8478
|
+
c > 1 ? c = Math.pow(c, 0.5) : c *= 0.95;
|
|
8494
8479
|
break;
|
|
8495
8480
|
case 0:
|
|
8496
8481
|
default:
|
|
8497
|
-
|
|
8482
|
+
c > 1 ? c = 1 : c *= 0.95;
|
|
8498
8483
|
break;
|
|
8499
8484
|
}
|
|
8500
8485
|
for (var G = 0, C = 0; C < u.sfbmax; C++) {
|
|
8501
8486
|
var v = u.width[C], p;
|
|
8502
|
-
if (G += v, !(A[C] <
|
|
8487
|
+
if (G += v, !(A[C] < c)) {
|
|
8503
8488
|
for (_.substep_shaping & 2 && h(), u.scalefac[C]++, p = -v; p < 0; p++)
|
|
8504
8489
|
P[G + p] *= w, P[G + p] > u.xrpow_max && (u.xrpow_max = P[G + p]);
|
|
8505
8490
|
if (_.noise_shaping_amp == 2)
|
|
@@ -8512,8 +8497,8 @@ const ua = _a;
|
|
|
8512
8497
|
var _ = a.width[y], w = a.scalefac[y];
|
|
8513
8498
|
if (a.preflag != 0 && (w += N.pretab[y]), P += _, w & 1) {
|
|
8514
8499
|
w++;
|
|
8515
|
-
for (var
|
|
8516
|
-
u[P +
|
|
8500
|
+
for (var c = -_; c < 0; c++)
|
|
8501
|
+
u[P + c] *= A, u[P + c] > a.xrpow_max && (a.xrpow_max = u[P + c]);
|
|
8517
8502
|
}
|
|
8518
8503
|
a.scalefac[y] = w >> 1;
|
|
8519
8504
|
}
|
|
@@ -8525,12 +8510,12 @@ const ua = _a;
|
|
|
8525
8510
|
if (y[P] >= 16)
|
|
8526
8511
|
return !0;
|
|
8527
8512
|
for (var _ = 0; _ < 3; _++) {
|
|
8528
|
-
var w = 0,
|
|
8513
|
+
var w = 0, c = 0;
|
|
8529
8514
|
for (P = u.sfb_lmax + _; P < u.sfbdivide; P += 3)
|
|
8530
8515
|
w < y[P] && (w = y[P]);
|
|
8531
8516
|
for (; P < u.sfbmax; P += 3)
|
|
8532
|
-
|
|
8533
|
-
if (!(w < 16 &&
|
|
8517
|
+
c < y[P] && (c = y[P]);
|
|
8518
|
+
if (!(w < 16 && c < 8)) {
|
|
8534
8519
|
if (u.subblock_gain[_] >= 7)
|
|
8535
8520
|
return !0;
|
|
8536
8521
|
u.subblock_gain[_]++;
|
|
@@ -8568,7 +8553,7 @@ const ua = _a;
|
|
|
8568
8553
|
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
8554
|
}
|
|
8570
8555
|
this.outer_loop = function(a, u, A, P, y, _) {
|
|
8571
|
-
var w = a.internal_flags,
|
|
8556
|
+
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
8557
|
if (oe(w, u, _, y, P), w.noise_shaping == 0)
|
|
8573
8558
|
return 100;
|
|
8574
8559
|
N.calc_noise(
|
|
@@ -8577,58 +8562,58 @@ const ua = _a;
|
|
|
8577
8562
|
n,
|
|
8578
8563
|
G,
|
|
8579
8564
|
p
|
|
8580
|
-
), G.bits = u.part2_3_length,
|
|
8565
|
+
), G.bits = u.part2_3_length, c.assign(u);
|
|
8581
8566
|
var i = 0;
|
|
8582
8567
|
for (te.arraycopy(P, 0, C, 0, 576); !x; ) {
|
|
8583
8568
|
do {
|
|
8584
8569
|
var q = new at(), B, $ = 255;
|
|
8585
|
-
if (w.substep_shaping & 2 ? B = 20 : B = 3, w.sfb21_extra && h(), !O(a,
|
|
8570
|
+
if (w.substep_shaping & 2 ? B = 20 : B = 3, w.sfb21_extra && h(), !O(a, c, n, P))
|
|
8586
8571
|
break;
|
|
8587
|
-
|
|
8588
|
-
var de = _ -
|
|
8572
|
+
c.scalefac_scale != 0 && ($ = 254);
|
|
8573
|
+
var de = _ - c.part2_length;
|
|
8589
8574
|
if (de <= 0)
|
|
8590
8575
|
break;
|
|
8591
|
-
for (; (
|
|
8576
|
+
for (; (c.part2_3_length = T.count_bits(
|
|
8592
8577
|
w,
|
|
8593
8578
|
P,
|
|
8594
|
-
|
|
8579
|
+
c,
|
|
8595
8580
|
p
|
|
8596
|
-
)) > de &&
|
|
8597
|
-
|
|
8598
|
-
if (
|
|
8581
|
+
)) > de && c.global_gain <= $; )
|
|
8582
|
+
c.global_gain++;
|
|
8583
|
+
if (c.global_gain > $)
|
|
8599
8584
|
break;
|
|
8600
8585
|
if (G.over_count == 0) {
|
|
8601
|
-
for (; (
|
|
8586
|
+
for (; (c.part2_3_length = T.count_bits(
|
|
8602
8587
|
w,
|
|
8603
8588
|
P,
|
|
8604
|
-
|
|
8589
|
+
c,
|
|
8605
8590
|
p
|
|
8606
|
-
)) > M &&
|
|
8607
|
-
|
|
8608
|
-
if (
|
|
8591
|
+
)) > M && c.global_gain <= $; )
|
|
8592
|
+
c.global_gain++;
|
|
8593
|
+
if (c.global_gain > $)
|
|
8609
8594
|
break;
|
|
8610
8595
|
}
|
|
8611
8596
|
if (N.calc_noise(
|
|
8612
|
-
|
|
8597
|
+
c,
|
|
8613
8598
|
A,
|
|
8614
8599
|
n,
|
|
8615
8600
|
q,
|
|
8616
8601
|
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 &&
|
|
8602
|
+
), 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)
|
|
8603
|
+
M = u.part2_3_length, G = q, u.assign(c), i = 0, te.arraycopy(P, 0, C, 0, 576);
|
|
8604
|
+
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
8605
|
break;
|
|
8621
|
-
} while (
|
|
8606
|
+
} while (c.global_gain + c.scalefac_scale < 255);
|
|
8622
8607
|
w.noise_shaping_amp == 3 ? h() : x = !0;
|
|
8623
8608
|
}
|
|
8624
8609
|
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
8610
|
}, this.iteration_finish_one = function(a, u, A) {
|
|
8626
8611
|
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),
|
|
8612
|
+
T.best_scalefac_store(a, u, A, P), a.use_best_huffman == 1 && T.best_huffman_divide(a, y), d.ResvAdjust(a, y);
|
|
8628
8613
|
};
|
|
8629
8614
|
}
|
|
8630
8615
|
function Z() {
|
|
8631
|
-
var
|
|
8616
|
+
var d = [
|
|
8632
8617
|
-0.1482523854003001,
|
|
8633
8618
|
32.308141959636465,
|
|
8634
8619
|
296.40344946382766,
|
|
@@ -9123,15 +9108,15 @@ const ua = _a;
|
|
|
9123
9108
|
function re(k, O, a) {
|
|
9124
9109
|
for (var u = 10, A = O + 238 - 14 - 286, P = -15; P < 0; P++) {
|
|
9125
9110
|
var y, _, w;
|
|
9126
|
-
y =
|
|
9111
|
+
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
9112
|
}
|
|
9128
9113
|
{
|
|
9129
|
-
var _, w,
|
|
9130
|
-
w = k[O + -16] *
|
|
9114
|
+
var _, w, c, C;
|
|
9115
|
+
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
9116
|
}
|
|
9132
9117
|
{
|
|
9133
9118
|
var n;
|
|
9134
|
-
n = a[28] - a[0], a[0] += a[28], a[28] = n *
|
|
9119
|
+
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
9120
|
}
|
|
9136
9121
|
}
|
|
9137
9122
|
function j(k, O) {
|
|
@@ -9143,46 +9128,46 @@ const ua = _a;
|
|
|
9143
9128
|
function _e(k, O, a) {
|
|
9144
9129
|
var u, A;
|
|
9145
9130
|
{
|
|
9146
|
-
var P, y, _, w,
|
|
9147
|
-
P = a[17] - a[9], _ = a[15] - a[11], w = a[14] - a[12],
|
|
9131
|
+
var P, y, _, w, c, C, n, G;
|
|
9132
|
+
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
9133
|
}
|
|
9149
9134
|
{
|
|
9150
|
-
var v, p, M, x,
|
|
9151
|
-
v = a[8] - a[0], M = a[6] - a[2], x = a[5] - a[3],
|
|
9135
|
+
var v, p, M, x, I, r, i, q;
|
|
9136
|
+
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
9137
|
}
|
|
9153
9138
|
}
|
|
9154
9139
|
this.mdct_sub48 = function(k, O, a) {
|
|
9155
9140
|
for (var u = O, A = 286, P = 0; P < k.channels_out; P++) {
|
|
9156
9141
|
for (var y = 0; y < k.mode_gr; y++) {
|
|
9157
|
-
for (var _, w = k.l3_side.tt[y][P],
|
|
9142
|
+
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
9143
|
for (re(u, A, n[G]), re(u, A + 32, n[G + 1]), G += 2, A += 64, _ = 1; _ < 32; _ += 2)
|
|
9159
9144
|
n[G - 1][_] *= -1;
|
|
9160
9145
|
for (_ = 0; _ < 32; _++, C += 18) {
|
|
9161
9146
|
var p = w.block_type, M = k.sb_sample[P][y], x = k.sb_sample[P][1 - y];
|
|
9162
9147
|
if (w.mixed_block_flag != 0 && _ < 2 && (p = 0), k.amp_filter[_] < 1e-12)
|
|
9163
9148
|
Ce.fill(
|
|
9164
|
-
|
|
9149
|
+
c,
|
|
9165
9150
|
C + 0,
|
|
9166
9151
|
C + 18,
|
|
9167
9152
|
0
|
|
9168
9153
|
);
|
|
9169
9154
|
else if (k.amp_filter[_] < 1 && h(), p == o.SHORT_TYPE) {
|
|
9170
9155
|
for (var v = -N / 4; v < 0; v++) {
|
|
9171
|
-
var
|
|
9172
|
-
|
|
9156
|
+
var I = T[o.SHORT_TYPE][v + 3];
|
|
9157
|
+
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
9158
|
}
|
|
9174
|
-
j(
|
|
9159
|
+
j(c, C);
|
|
9175
9160
|
} else {
|
|
9176
9161
|
for (var r = K(18), v = -V / 4; v < 0; v++) {
|
|
9177
9162
|
var i, q;
|
|
9178
9163
|
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
9164
|
}
|
|
9180
|
-
_e(
|
|
9165
|
+
_e(c, C, r);
|
|
9181
9166
|
}
|
|
9182
9167
|
if (p != o.SHORT_TYPE && _ != 0)
|
|
9183
9168
|
for (var v = 7; v >= 0; --v) {
|
|
9184
9169
|
var B, $;
|
|
9185
|
-
B =
|
|
9170
|
+
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
9171
|
}
|
|
9187
9172
|
}
|
|
9188
9173
|
}
|
|
@@ -9213,7 +9198,7 @@ const ua = _a;
|
|
|
9213
9198
|
0.187098 * 5
|
|
9214
9199
|
];
|
|
9215
9200
|
function o() {
|
|
9216
|
-
var
|
|
9201
|
+
var d = o.MPG_MD_MS_LR, N = null;
|
|
9217
9202
|
this.psy = null;
|
|
9218
9203
|
var V = null, T = null;
|
|
9219
9204
|
this.setModules = function(z, re, j, _e) {
|
|
@@ -9258,16 +9243,16 @@ const ua = _a;
|
|
|
9258
9243
|
u[0][0] = new S(), u[0][1] = new S(), u[1][0] = new S(), u[1][1] = new S();
|
|
9259
9244
|
var A = Ee([2, 2]);
|
|
9260
9245
|
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]),
|
|
9246
|
+
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
9247
|
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],
|
|
9248
|
+
var M, x = [null, null], I = 0, r = Y(2);
|
|
9264
9249
|
for (p = 0; p < _.mode_gr; p++) {
|
|
9265
9250
|
for (v = 0; v < _.channels_out; v++)
|
|
9266
|
-
x[v] = y[v],
|
|
9251
|
+
x[v] = y[v], I = 576 + p * 576 - o.FFTOFFSET;
|
|
9267
9252
|
if (z.VBR == E.vbr_mtrh || z.VBR == E.vbr_mt ? h() : M = V.L3psycho_anal_ns(
|
|
9268
9253
|
z,
|
|
9269
9254
|
x,
|
|
9270
|
-
|
|
9255
|
+
I,
|
|
9271
9256
|
p,
|
|
9272
9257
|
u,
|
|
9273
9258
|
A,
|
|
@@ -9284,7 +9269,7 @@ const ua = _a;
|
|
|
9284
9269
|
}
|
|
9285
9270
|
} else
|
|
9286
9271
|
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 ==
|
|
9272
|
+
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
9273
|
var q, B;
|
|
9289
9274
|
for (q = 0; q < 18; q++)
|
|
9290
9275
|
_.nsPsy.pefirbuf[q] = _.nsPsy.pefirbuf[q + 1];
|
|
@@ -9297,7 +9282,7 @@ const ua = _a;
|
|
|
9297
9282
|
for (v = 0; v < _.channels_out; v++)
|
|
9298
9283
|
G[p][v] *= B;
|
|
9299
9284
|
}
|
|
9300
|
-
return _.iteration_loop.iteration_loop(z, G,
|
|
9285
|
+
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
9286
|
};
|
|
9302
9287
|
}
|
|
9303
9288
|
function ee() {
|
|
@@ -9305,18 +9290,18 @@ const ua = _a;
|
|
|
9305
9290
|
}
|
|
9306
9291
|
function se() {
|
|
9307
9292
|
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
|
|
9293
|
+
for (var d = 0; d < 2; d++)
|
|
9309
9294
|
for (var N = 0; N < 2; N++)
|
|
9310
|
-
this.tt[
|
|
9295
|
+
this.tt[d][N] = new m();
|
|
9311
9296
|
}
|
|
9312
9297
|
function ye() {
|
|
9313
9298
|
this.l = K(o.SBMAX_l), this.s = be([o.SBMAX_s, 3]);
|
|
9314
|
-
var
|
|
9299
|
+
var d = this;
|
|
9315
9300
|
this.assign = function(N) {
|
|
9316
|
-
te.arraycopy(N.l, 0,
|
|
9301
|
+
te.arraycopy(N.l, 0, d.l, 0, o.SBMAX_l);
|
|
9317
9302
|
for (var V = 0; V < o.SBMAX_s; V++)
|
|
9318
9303
|
for (var T = 0; T < 3; T++)
|
|
9319
|
-
|
|
9304
|
+
d.s[V][T] = N.s[V][T];
|
|
9320
9305
|
};
|
|
9321
9306
|
}
|
|
9322
9307
|
function xe() {
|
|
@@ -9324,10 +9309,10 @@ const ua = _a;
|
|
|
9324
9309
|
}
|
|
9325
9310
|
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
9311
|
function le() {
|
|
9327
|
-
var
|
|
9312
|
+
var d = 40;
|
|
9328
9313
|
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
9314
|
function N() {
|
|
9330
|
-
this.write_timing = 0, this.ptr = 0, this.buf = U(
|
|
9315
|
+
this.write_timing = 0, this.ptr = 0, this.buf = U(d);
|
|
9331
9316
|
}
|
|
9332
9317
|
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
9318
|
for (var V = 0; V < this.en.length; V++)
|
|
@@ -9338,7 +9323,7 @@ const ua = _a;
|
|
|
9338
9323
|
this.header[V] = new N();
|
|
9339
9324
|
}
|
|
9340
9325
|
function fe() {
|
|
9341
|
-
var
|
|
9326
|
+
var d = K(o.BLKSIZE), N = K(o.BLKSIZE_s / 2), V = [
|
|
9342
9327
|
0.9238795325112867,
|
|
9343
9328
|
0.3826834323650898,
|
|
9344
9329
|
0.9951847266721969,
|
|
@@ -9357,15 +9342,15 @@ const ua = _a;
|
|
|
9357
9342
|
var O, a, u, A, P, y, _;
|
|
9358
9343
|
_ = re >> 1, A = re, P = re << 1, y = P + A, re = P << 1, j = H, _e = j + _;
|
|
9359
9344
|
do {
|
|
9360
|
-
var w,
|
|
9361
|
-
|
|
9345
|
+
var w, c, C, n;
|
|
9346
|
+
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
9347
|
} while (j < k);
|
|
9363
9348
|
for (a = V[z + 0], O = V[z + 1], u = 1; u < _; u++) {
|
|
9364
9349
|
var G, v;
|
|
9365
9350
|
G = 1 - 2 * O * O, v = 2 * O * a, j = H + u, _e = H + A - u;
|
|
9366
9351
|
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],
|
|
9352
|
+
var p, M, x, w, c, I, C, r, n, i;
|
|
9353
|
+
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
9354
|
} while (j < k);
|
|
9370
9355
|
G = a, a = G * V[z + 0] - O * V[z + 1], O = G * V[z + 1] + O * V[z + 0];
|
|
9371
9356
|
}
|
|
@@ -9515,18 +9500,18 @@ const ua = _a;
|
|
|
9515
9500
|
var j = o.BLKSIZE / 8 - 1, _e = o.BLKSIZE / 2;
|
|
9516
9501
|
do {
|
|
9517
9502
|
var k, O, a, u, A, P = ce[j] & 255;
|
|
9518
|
-
k =
|
|
9503
|
+
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
9504
|
} while (--j >= 0);
|
|
9520
9505
|
T(H, _e, o.BLKSIZE / 2);
|
|
9521
9506
|
}, this.init_fft = function(g) {
|
|
9522
9507
|
for (var H = 0; H < o.BLKSIZE; H++)
|
|
9523
|
-
|
|
9508
|
+
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
9509
|
for (var H = 0; H < o.BLKSIZE_s / 2; H++)
|
|
9525
9510
|
N[H] = 0.5 * (1 - Math.cos(2 * Math.PI * (H + 0.5) / o.BLKSIZE_s));
|
|
9526
9511
|
};
|
|
9527
9512
|
}
|
|
9528
9513
|
function Ae() {
|
|
9529
|
-
var
|
|
9514
|
+
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
9515
|
function u(ae, F) {
|
|
9531
9516
|
for (var J = 0, je = 0; je < o.BLKSIZE / 2; ++je)
|
|
9532
9517
|
J += ae[je] * F.ATH.eql_w[je];
|
|
@@ -9534,7 +9519,7 @@ const ua = _a;
|
|
|
9534
9519
|
}
|
|
9535
9520
|
function A(ae, F, J, je, Ie, me, Re, Le, ze, Ke, Oe) {
|
|
9536
9521
|
var ut = ae.internal_flags;
|
|
9537
|
-
ze < 2 ? (
|
|
9522
|
+
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
9523
|
for (var tt = o.BLKSIZE / 2 - 1; tt >= 0; --tt) {
|
|
9539
9524
|
var ot = je[Ie + 0][o.BLKSIZE / 2 - tt], ht = je[Ie + 0][o.BLKSIZE / 2 + tt];
|
|
9540
9525
|
F[o.BLKSIZE / 2 - tt] = (ot * ot + ht * ht) * 0.5;
|
|
@@ -9553,7 +9538,7 @@ const ua = _a;
|
|
|
9553
9538
|
}
|
|
9554
9539
|
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
9540
|
}
|
|
9556
|
-
var P = 8, y = 23, _ = 15, w,
|
|
9541
|
+
var P = 8, y = 23, _ = 15, w, c, C, n = [
|
|
9557
9542
|
1,
|
|
9558
9543
|
0.79433,
|
|
9559
9544
|
0.63096,
|
|
@@ -9565,7 +9550,7 @@ const ua = _a;
|
|
|
9565
9550
|
0.11749
|
|
9566
9551
|
];
|
|
9567
9552
|
function G() {
|
|
9568
|
-
w = Math.pow(10, (P + 1) / 16),
|
|
9553
|
+
w = Math.pow(10, (P + 1) / 16), c = Math.pow(10, (y + 1) / 16), C = Math.pow(10, _ / 10);
|
|
9569
9554
|
}
|
|
9570
9555
|
var v = [
|
|
9571
9556
|
3.3246 * 3.3246,
|
|
@@ -9623,12 +9608,12 @@ const ua = _a;
|
|
|
9623
9608
|
function x(ae, F, J, je, Ie, me) {
|
|
9624
9609
|
var Re;
|
|
9625
9610
|
if (F > ae)
|
|
9626
|
-
if (F < ae *
|
|
9611
|
+
if (F < ae * c)
|
|
9627
9612
|
Re = F / ae;
|
|
9628
9613
|
else
|
|
9629
9614
|
return ae + F;
|
|
9630
9615
|
else {
|
|
9631
|
-
if (ae >= F *
|
|
9616
|
+
if (ae >= F * c)
|
|
9632
9617
|
return ae + F;
|
|
9633
9618
|
Re = ae / F;
|
|
9634
9619
|
}
|
|
@@ -9648,7 +9633,7 @@ const ua = _a;
|
|
|
9648
9633
|
}
|
|
9649
9634
|
return ae * v[Le];
|
|
9650
9635
|
}
|
|
9651
|
-
function
|
|
9636
|
+
function I(ae, F, J, je, Ie) {
|
|
9652
9637
|
var me, Re, Le = 0, ze = 0;
|
|
9653
9638
|
for (me = Re = 0; me < o.SBMAX_s; ++Re, ++me) {
|
|
9654
9639
|
for (var Ke = ae.bo_s[me], Oe = ae.npart_s, ut = Ke < Oe ? Ke : Oe; Re < ut; )
|
|
@@ -9870,7 +9855,7 @@ const ua = _a;
|
|
|
9870
9855
|
J
|
|
9871
9856
|
), Ye(Oe, Ta, ot, wa, ya), $e(Oe, wa, ya, zt), it = 0; it < 3; it++) {
|
|
9872
9857
|
var sa, xt;
|
|
9873
|
-
for (i(ae, xa, ht, rt, Pe, it),
|
|
9858
|
+
for (i(ae, xa, ht, rt, Pe, it), I(Oe, ht, rt, Pe, it), Tt = 0; Tt < o.SBMAX_s; Tt++) {
|
|
9874
9859
|
if (xt = Oe.thm[Pe].s[Tt][it], xt *= re, Mt[it] >= 2 || Mt[it + 1] == 1) {
|
|
9875
9860
|
var Gt = it != 0 ? it - 1 : 2, yt = B(
|
|
9876
9861
|
Oe.thm[Pe].s[Tt][Gt],
|
|
@@ -10085,7 +10070,7 @@ const ua = _a;
|
|
|
10085
10070
|
ut,
|
|
10086
10071
|
tt,
|
|
10087
10072
|
je
|
|
10088
|
-
), G(),
|
|
10073
|
+
), G(), d.init_fft(F), F.decay = Math.exp(-1 * N / (z * ot / 192));
|
|
10089
10074
|
{
|
|
10090
10075
|
var We;
|
|
10091
10076
|
We = k, ae.exp_nspsytune & 2 && (We = 1), Math.abs(ae.msfix) > 0 && (We = ae.msfix), ae.msfix = We;
|
|
@@ -10153,7 +10138,7 @@ const ua = _a;
|
|
|
10153
10138
|
};
|
|
10154
10139
|
}
|
|
10155
10140
|
function ue() {
|
|
10156
|
-
var
|
|
10141
|
+
var d = this, N = 128 * 1024;
|
|
10157
10142
|
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
10143
|
var V = 16384 + N;
|
|
10159
10144
|
ue.LAME_MAXMP3BUFFER = V;
|
|
@@ -10266,10 +10251,10 @@ const ua = _a;
|
|
|
10266
10251
|
new O(224, 19400),
|
|
10267
10252
|
new O(256, 19700),
|
|
10268
10253
|
new O(320, 20500)
|
|
10269
|
-
], B =
|
|
10254
|
+
], B = d.nearestBitrateFullIndex(i);
|
|
10270
10255
|
r.lowerlimit = q[B].lowpass;
|
|
10271
10256
|
}
|
|
10272
|
-
function
|
|
10257
|
+
function c(r) {
|
|
10273
10258
|
var i = r.internal_flags, q = 32;
|
|
10274
10259
|
if (i.lowpass1 > 0) {
|
|
10275
10260
|
for (var B = 999, $ = 0; $ <= 31; $++) {
|
|
@@ -10390,7 +10375,7 @@ const ua = _a;
|
|
|
10390
10375
|
r.compression_ratio = r.out_samplerate * 16 * i.channels_out / (1e3 * r.brate);
|
|
10391
10376
|
break;
|
|
10392
10377
|
}
|
|
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(),
|
|
10378
|
+
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
10379
|
r.brate,
|
|
10395
10380
|
r.version,
|
|
10396
10381
|
r.out_samplerate
|
|
@@ -10509,7 +10494,7 @@ const ua = _a;
|
|
|
10509
10494
|
var ae = [null, null], F = 0, J = 0;
|
|
10510
10495
|
ae[0] = gt[0], ae[1] = gt[1];
|
|
10511
10496
|
var je = new x();
|
|
10512
|
-
if (
|
|
10497
|
+
if (I(
|
|
10513
10498
|
r,
|
|
10514
10499
|
ft,
|
|
10515
10500
|
ae,
|
|
@@ -10545,7 +10530,7 @@ const ua = _a;
|
|
|
10545
10530
|
return Ye;
|
|
10546
10531
|
}
|
|
10547
10532
|
function M(r, i, q, B, $, de) {
|
|
10548
|
-
var ge =
|
|
10533
|
+
var ge = d.enc.lame_encode_mp3_frame(
|
|
10549
10534
|
r,
|
|
10550
10535
|
i,
|
|
10551
10536
|
q,
|
|
@@ -10558,7 +10543,7 @@ const ua = _a;
|
|
|
10558
10543
|
function x() {
|
|
10559
10544
|
this.n_in = 0, this.n_out = 0;
|
|
10560
10545
|
}
|
|
10561
|
-
function
|
|
10546
|
+
function I(r, i, q, B, $, de) {
|
|
10562
10547
|
var ge = r.internal_flags;
|
|
10563
10548
|
if (ge.resample_ratio < 0.9999 || ge.resample_ratio > 1.0001)
|
|
10564
10549
|
h();
|
|
@@ -10570,33 +10555,33 @@ const ua = _a;
|
|
|
10570
10555
|
}
|
|
10571
10556
|
}
|
|
10572
10557
|
function X() {
|
|
10573
|
-
this.setModules = function(
|
|
10558
|
+
this.setModules = function(d, N) {
|
|
10574
10559
|
};
|
|
10575
10560
|
}
|
|
10576
10561
|
function pe() {
|
|
10577
|
-
this.setModules = function(
|
|
10562
|
+
this.setModules = function(d, N, V) {
|
|
10578
10563
|
};
|
|
10579
10564
|
}
|
|
10580
10565
|
function Ne() {
|
|
10581
10566
|
}
|
|
10582
10567
|
function Q() {
|
|
10583
|
-
this.setModules = function(
|
|
10568
|
+
this.setModules = function(d, N) {
|
|
10584
10569
|
};
|
|
10585
10570
|
}
|
|
10586
|
-
function ne(
|
|
10587
|
-
|
|
10571
|
+
function ne(d, N, V) {
|
|
10572
|
+
d != 1 && h("fix cc: only supports mono");
|
|
10588
10573
|
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
10574
|
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
10575
|
var P = T.lame_init();
|
|
10591
|
-
P.num_channels =
|
|
10576
|
+
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
10577
|
var y = 1152, _ = 0 | 1.25 * y + 7200, w = U(_);
|
|
10593
|
-
this.encodeBuffer = function(
|
|
10594
|
-
|
|
10595
|
-
var n = T.lame_encode_buffer(P,
|
|
10578
|
+
this.encodeBuffer = function(c, C) {
|
|
10579
|
+
d == 1 && (C = c), c.length > y && (y = c.length, _ = 0 | 1.25 * y + 7200, w = U(_));
|
|
10580
|
+
var n = T.lame_encode_buffer(P, c, C, c.length, w, 0, _);
|
|
10596
10581
|
return new Int8Array(w.subarray(0, n));
|
|
10597
10582
|
}, this.flush = function() {
|
|
10598
|
-
var
|
|
10599
|
-
return new Int8Array(w.subarray(0,
|
|
10583
|
+
var c = T.lame_encode_flush(P, w, 0, _);
|
|
10584
|
+
return new Int8Array(w.subarray(0, c));
|
|
10600
10585
|
};
|
|
10601
10586
|
}
|
|
10602
10587
|
b.SFBMAX = o.SBMAX_s * 3, t.Mp3Encoder = ne;
|
|
@@ -10604,12 +10589,12 @@ const ua = _a;
|
|
|
10604
10589
|
t(), s.lamejs = t;
|
|
10605
10590
|
});
|
|
10606
10591
|
(function(s) {
|
|
10607
|
-
var t = typeof window == "object" && !!window.document,
|
|
10592
|
+
var t = typeof window == "object" && !!window.document, f = t ? window : Object, h = f.Recorder, U = h.i18n;
|
|
10608
10593
|
s(h, U, U.$T, t);
|
|
10609
|
-
})(function(s, t,
|
|
10594
|
+
})(function(s, t, f, h) {
|
|
10610
10595
|
var U = function(K) {
|
|
10611
10596
|
return new Y(K);
|
|
10612
|
-
},
|
|
10597
|
+
}, R = "WaveView", Y = function(K) {
|
|
10613
10598
|
var ve = this, be = {
|
|
10614
10599
|
/*
|
|
10615
10600
|
elem:"css selector" //自动显示到dom,并以此dom大小为显示大小
|
|
@@ -10643,7 +10628,7 @@ const ua = _a;
|
|
|
10643
10628
|
var Ee = ve.canvas = K[De];
|
|
10644
10629
|
else {
|
|
10645
10630
|
if (!h)
|
|
10646
|
-
throw new Error(
|
|
10631
|
+
throw new Error(f.G("NonBrowser-1", [R]));
|
|
10647
10632
|
var Ce = K.elem;
|
|
10648
10633
|
Ce && (typeof Ce == "string" ? Ce = document.querySelector(Ce) : Ce.length && (Ce = Ce[0])), Ce && (K.width = Ce.offsetWidth, K.height = Ce.offsetHeight);
|
|
10649
10634
|
var te = ve.elem = document.createElement("div");
|
|
@@ -10653,7 +10638,7 @@ const ua = _a;
|
|
|
10653
10638
|
}
|
|
10654
10639
|
var ie = K.scale, we = K.width * ie, Ue = K.height * ie;
|
|
10655
10640
|
if (!we || !Ue)
|
|
10656
|
-
throw new Error(
|
|
10641
|
+
throw new Error(f.G("IllegalArgs-1", [R + " width=0 height=0"]));
|
|
10657
10642
|
Ee.width = we, Ee.height = Ue;
|
|
10658
10643
|
var E = ve.ctx = Ee.getContext("2d");
|
|
10659
10644
|
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 +10690,7 @@ const ua = _a;
|
|
|
10705
10690
|
ie == 0 ? De.moveTo(ie, K[te]) : De.lineTo(ie, K[te]);
|
|
10706
10691
|
De.lineWidth = Me.lineWidth * Ee, De.strokeStyle = ve, De.stroke();
|
|
10707
10692
|
}
|
|
10708
|
-
}, s[
|
|
10693
|
+
}, s[R] = U;
|
|
10709
10694
|
});
|
|
10710
10695
|
const Xr = {
|
|
10711
10696
|
components: { InlineSvg: Pt },
|
|
@@ -10726,8 +10711,8 @@ const Xr = {
|
|
|
10726
10711
|
sampleRate: 16e3,
|
|
10727
10712
|
bitRate: 16,
|
|
10728
10713
|
//mp3格式,指定采样率hz、比特率kbps,其他参数使用默认配置;注意:是数字的参数必须提供数字,不要用字符串;需要使用的type类型,需提前把格式支持文件加载进来,比如使用wav格式需要提前加载wav.js编码引擎
|
|
10729
|
-
onProcess: (s, t,
|
|
10730
|
-
this.duration = this.formatMilliseconds(
|
|
10714
|
+
onProcess: (s, t, f, h) => {
|
|
10715
|
+
this.duration = this.formatMilliseconds(f), this.wave && this.wave.input(
|
|
10731
10716
|
s[s.length - 1],
|
|
10732
10717
|
t,
|
|
10733
10718
|
h
|
|
@@ -10763,8 +10748,8 @@ const Xr = {
|
|
|
10763
10748
|
},
|
|
10764
10749
|
methods: {
|
|
10765
10750
|
formatMilliseconds(s) {
|
|
10766
|
-
const t = Math.floor(s / 1e3),
|
|
10767
|
-
return `${U}:${
|
|
10751
|
+
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");
|
|
10752
|
+
return `${U}:${R}`;
|
|
10768
10753
|
},
|
|
10769
10754
|
start() {
|
|
10770
10755
|
this.ready && (this.pending = !0, this.rec.start());
|
|
@@ -10780,7 +10765,7 @@ const Xr = {
|
|
|
10780
10765
|
);
|
|
10781
10766
|
},
|
|
10782
10767
|
handleFinish() {
|
|
10783
|
-
const [, s] = this.blob.type.split("/"), t = new Date().getTime(),
|
|
10768
|
+
const [, s] = this.blob.type.split("/"), t = new Date().getTime(), f = `${t}.${s}`, h = new File([this.blob], f, {
|
|
10784
10769
|
type: this.blob.type,
|
|
10785
10770
|
lastModified: t
|
|
10786
10771
|
});
|
|
@@ -10793,7 +10778,7 @@ const Xr = {
|
|
|
10793
10778
|
this.$emit("cancel");
|
|
10794
10779
|
},
|
|
10795
10780
|
handleTranslate() {
|
|
10796
|
-
const [, s] = this.blob.type.split("/"), t = new Date().getTime(),
|
|
10781
|
+
const [, s] = this.blob.type.split("/"), t = new Date().getTime(), f = `${t}.${s}`, h = new File([this.blob], f, {
|
|
10797
10782
|
type: this.blob.type,
|
|
10798
10783
|
lastModified: t
|
|
10799
10784
|
});
|
|
@@ -10804,17 +10789,17 @@ const Xr = {
|
|
|
10804
10789
|
}
|
|
10805
10790
|
};
|
|
10806
10791
|
var Kr = function() {
|
|
10807
|
-
var t = this,
|
|
10808
|
-
return
|
|
10792
|
+
var t = this, f = t._self._c;
|
|
10793
|
+
return f("div", { staticClass: "wrap", style: {
|
|
10809
10794
|
width: t.width
|
|
10810
|
-
} }, [t.isMobile ?
|
|
10795
|
+
} }, [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
10796
|
btn: !0,
|
|
10812
10797
|
finish: !0,
|
|
10813
10798
|
disabled: !t.blob
|
|
10814
|
-
}, on: { click: t.handleFinish } }, [t._v(" 插入音频 ")]), t.text ?
|
|
10799
|
+
}, on: { click: t.handleFinish } }, [t._v(" 插入音频 ")]), t.text ? f("a", { class: {
|
|
10815
10800
|
btn: !0,
|
|
10816
10801
|
finish: !0
|
|
10817
|
-
}, on: { click: t.handleFinishText } }, [t._v(" 插入文本 ")]) : t._e(),
|
|
10802
|
+
}, 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
10803
|
}, Jr = [], ei = /* @__PURE__ */ jt(
|
|
10819
10804
|
Xr,
|
|
10820
10805
|
Kr,
|
|
@@ -10858,10 +10843,10 @@ var ma = {}, ai = {
|
|
|
10858
10843
|
throw "First parameter is required.";
|
|
10859
10844
|
e = e || {
|
|
10860
10845
|
type: "video"
|
|
10861
|
-
}, e = new
|
|
10846
|
+
}, e = new f(L, e);
|
|
10862
10847
|
var l = this;
|
|
10863
10848
|
function m(X) {
|
|
10864
|
-
return e.disableLogs || console.log("RecordRTC version: ", l.version), X && (e = new
|
|
10849
|
+
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
10850
|
l.recordingDuration && se();
|
|
10866
10851
|
}), l);
|
|
10867
10852
|
}
|
|
@@ -10890,8 +10875,8 @@ var ma = {}, ai = {
|
|
|
10890
10875
|
typeof X.call == "function" ? X.call(l, "") : X("");
|
|
10891
10876
|
return;
|
|
10892
10877
|
}
|
|
10893
|
-
Object.keys(fe).forEach(function(
|
|
10894
|
-
typeof fe[
|
|
10878
|
+
Object.keys(fe).forEach(function(d) {
|
|
10879
|
+
typeof fe[d] != "function" && (l[d] = fe[d]);
|
|
10895
10880
|
});
|
|
10896
10881
|
var Q = fe.blob;
|
|
10897
10882
|
if (!Q)
|
|
@@ -10907,9 +10892,9 @@ var ma = {}, ai = {
|
|
|
10907
10892
|
}
|
|
10908
10893
|
typeof X.call == "function" ? X.call(l, ne) : X(ne);
|
|
10909
10894
|
}
|
|
10910
|
-
e.autoWriteToDisk && ee(function(
|
|
10895
|
+
e.autoWriteToDisk && ee(function(d) {
|
|
10911
10896
|
var N = {};
|
|
10912
|
-
N[e.type + "Blob"] =
|
|
10897
|
+
N[e.type + "Blob"] = d, at.Store(N);
|
|
10913
10898
|
});
|
|
10914
10899
|
}
|
|
10915
10900
|
}
|
|
@@ -10949,7 +10934,7 @@ var ma = {}, ai = {
|
|
|
10949
10934
|
return;
|
|
10950
10935
|
}
|
|
10951
10936
|
if (typeof Worker < "u" && !navigator.mozGetUserMedia) {
|
|
10952
|
-
var Q =
|
|
10937
|
+
var Q = d(o);
|
|
10953
10938
|
Q.onmessage = function(N) {
|
|
10954
10939
|
X(N.data);
|
|
10955
10940
|
}, Q.postMessage(Ne);
|
|
@@ -10959,7 +10944,7 @@ var ma = {}, ai = {
|
|
|
10959
10944
|
X(N.target.result);
|
|
10960
10945
|
};
|
|
10961
10946
|
}
|
|
10962
|
-
function
|
|
10947
|
+
function d(N) {
|
|
10963
10948
|
try {
|
|
10964
10949
|
var V = Me.createObjectURL(new Blob([
|
|
10965
10950
|
N.toString(),
|
|
@@ -11437,7 +11422,7 @@ var ma = {}, ai = {
|
|
|
11437
11422
|
* @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
|
|
11438
11423
|
* @param {object} config - {type:"video", disableLogs: true, numberOfAudioChannels: 1, bufferSize: 0, sampleRate: 0, video: HTMLVideoElement, getNativeBlob:true, etc.}
|
|
11439
11424
|
*/
|
|
11440
|
-
function
|
|
11425
|
+
function f(L, e) {
|
|
11441
11426
|
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
11427
|
}
|
|
11443
11428
|
/**
|
|
@@ -11632,10 +11617,10 @@ var ma = {}, ai = {
|
|
|
11632
11617
|
};
|
|
11633
11618
|
}
|
|
11634
11619
|
U.getFromDisk = t.getFromDisk, U.writeToDisk = t.writeToDisk, typeof t < "u" && (t.MRecordRTC = U);
|
|
11635
|
-
var
|
|
11620
|
+
var R = "Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45";
|
|
11636
11621
|
(function(L) {
|
|
11637
11622
|
L && (typeof window < "u" || typeof st > "u" || (st.navigator = {
|
|
11638
|
-
userAgent:
|
|
11623
|
+
userAgent: R,
|
|
11639
11624
|
getUserMedia: function() {
|
|
11640
11625
|
}
|
|
11641
11626
|
}, 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 +11971,39 @@ var ma = {}, ai = {
|
|
|
11986
11971
|
function g(oe, z) {
|
|
11987
11972
|
var re = oe.numberOfAudioChannels, j = oe.leftBuffers.slice(0), _e = oe.rightBuffers.slice(0), k = oe.sampleRate, O = oe.internalInterleavedLength, a = oe.desiredSampRate;
|
|
11988
11973
|
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] =
|
|
11974
|
+
function u(I, r, i) {
|
|
11975
|
+
var q = Math.round(I.length * (r / i)), B = [], $ = Number((I.length - 1) / (q - 1));
|
|
11976
|
+
B[0] = I[0];
|
|
11992
11977
|
for (var de = 1; de < q - 1; de++) {
|
|
11993
11978
|
var ge = de * $, Se = Number(Math.floor(ge)).toFixed(), Ye = Number(Math.ceil(ge)).toFixed(), $e = ge - Se;
|
|
11994
|
-
B[de] = A(
|
|
11979
|
+
B[de] = A(I[Se], I[Ye], $e);
|
|
11995
11980
|
}
|
|
11996
|
-
return B[q - 1] =
|
|
11981
|
+
return B[q - 1] = I[I.length - 1], B;
|
|
11997
11982
|
}
|
|
11998
|
-
function A(
|
|
11999
|
-
return
|
|
11983
|
+
function A(I, r, i) {
|
|
11984
|
+
return I + (r - I) * i;
|
|
12000
11985
|
}
|
|
12001
|
-
function P(
|
|
12002
|
-
for (var i = new Float64Array(r), q = 0, B =
|
|
12003
|
-
var de =
|
|
11986
|
+
function P(I, r) {
|
|
11987
|
+
for (var i = new Float64Array(r), q = 0, B = I.length, $ = 0; $ < B; $++) {
|
|
11988
|
+
var de = I[$];
|
|
12004
11989
|
i.set(de, q), q += de.length;
|
|
12005
11990
|
}
|
|
12006
11991
|
return i;
|
|
12007
11992
|
}
|
|
12008
|
-
function y(
|
|
12009
|
-
for (var i =
|
|
12010
|
-
q[$++] =
|
|
11993
|
+
function y(I, r) {
|
|
11994
|
+
for (var i = I.length + r.length, q = new Float64Array(i), B = 0, $ = 0; $ < i; )
|
|
11995
|
+
q[$++] = I[B], q[$++] = r[B], B++;
|
|
12011
11996
|
return q;
|
|
12012
11997
|
}
|
|
12013
|
-
function _(
|
|
11998
|
+
function _(I, r, i) {
|
|
12014
11999
|
for (var q = i.length, B = 0; B < q; B++)
|
|
12015
|
-
|
|
12000
|
+
I.setUint8(r + B, i.charCodeAt(B));
|
|
12016
12001
|
}
|
|
12017
12002
|
var w;
|
|
12018
12003
|
re === 2 && (w = y(j, _e)), re === 1 && (w = j);
|
|
12019
|
-
var
|
|
12020
|
-
_(G, 0, "RIFF"), G.setUint32(4, 36 +
|
|
12021
|
-
for (var v =
|
|
12004
|
+
var c = w.length, C = 44 + c * 2, n = new ArrayBuffer(C), G = new DataView(n);
|
|
12005
|
+
_(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);
|
|
12006
|
+
for (var v = c, p = 44, M = 1, x = 0; x < v; x++)
|
|
12022
12007
|
G.setInt16(p, w[x] * (32767 * M), !0), p += 2;
|
|
12023
12008
|
if (z)
|
|
12024
12009
|
return z({
|
|
@@ -12107,7 +12092,7 @@ var ma = {}, ai = {
|
|
|
12107
12092
|
return this.name;
|
|
12108
12093
|
};
|
|
12109
12094
|
var ne = !1;
|
|
12110
|
-
function
|
|
12095
|
+
function d(T) {
|
|
12111
12096
|
if (!pe) {
|
|
12112
12097
|
if (se() === !1 && (e.disableLogs || console.log("MediaStream seems stopped."), S.disconnect(), D = !1), !D) {
|
|
12113
12098
|
fe && (fe.disconnect(), fe = null);
|
|
@@ -12122,7 +12107,7 @@ var ma = {}, ai = {
|
|
|
12122
12107
|
Z += ue, l.recordingLength = Z, typeof e.timeSlice < "u" && (N.recordingLength += ue, N.left.push(g), o === 2 && N.right.push(oe));
|
|
12123
12108
|
}
|
|
12124
12109
|
}
|
|
12125
|
-
S.onaudioprocess =
|
|
12110
|
+
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
12111
|
var N = {
|
|
12127
12112
|
left: [],
|
|
12128
12113
|
right: [],
|
|
@@ -12339,7 +12324,7 @@ var ma = {}, ai = {
|
|
|
12339
12324
|
function b(le, fe, Ae, ue, X) {
|
|
12340
12325
|
var pe = document.createElement("canvas");
|
|
12341
12326
|
pe.width = o.width, pe.height = o.height;
|
|
12342
|
-
var Ne = pe.getContext("2d"), Q = [], ne = fe === -1,
|
|
12327
|
+
var Ne = pe.getContext("2d"), Q = [], ne = fe === -1, d = fe && fe > 0 && fe <= le.length ? fe : le.length, N = {
|
|
12343
12328
|
r: 0,
|
|
12344
12329
|
g: 0,
|
|
12345
12330
|
b: 0
|
|
@@ -12347,7 +12332,7 @@ var ma = {}, ai = {
|
|
|
12347
12332
|
Math.pow(255, 2) + Math.pow(255, 2) + Math.pow(255, 2)
|
|
12348
12333
|
), T = Ae && Ae >= 0 && Ae <= 1 ? Ae : 0, ce = ue && ue >= 0 && ue <= 1 ? ue : 0, g = !1;
|
|
12349
12334
|
m({
|
|
12350
|
-
length:
|
|
12335
|
+
length: d,
|
|
12351
12336
|
functionToLoop: function(H, oe) {
|
|
12352
12337
|
var z, re, j, _e = function() {
|
|
12353
12338
|
!g && j - z <= j * ce || (ne && (g = !0), Q.push(le[oe])), H();
|
|
@@ -12375,7 +12360,7 @@ var ma = {}, ai = {
|
|
|
12375
12360
|
}
|
|
12376
12361
|
},
|
|
12377
12362
|
callback: function() {
|
|
12378
|
-
Q = Q.concat(le.slice(
|
|
12363
|
+
Q = Q.concat(le.slice(d)), Q.length <= 0 && Q.push(le[le.length - 1]), X(Q);
|
|
12379
12364
|
}
|
|
12380
12365
|
});
|
|
12381
12366
|
}
|
|
@@ -12555,7 +12540,7 @@ var ma = {}, ai = {
|
|
|
12555
12540
|
}]
|
|
12556
12541
|
}]
|
|
12557
12542
|
}]
|
|
12558
|
-
}], ne = 0,
|
|
12543
|
+
}], ne = 0, d = 0; ne < X.length; ) {
|
|
12559
12544
|
var N = [], V = 0;
|
|
12560
12545
|
do
|
|
12561
12546
|
N.push(X[ne]), V += X[ne].duration, ne++;
|
|
@@ -12563,9 +12548,9 @@ var ma = {}, ai = {
|
|
|
12563
12548
|
var T = 0, ce = {
|
|
12564
12549
|
id: 524531317,
|
|
12565
12550
|
// Cluster
|
|
12566
|
-
data: D(
|
|
12551
|
+
data: D(d, T, N)
|
|
12567
12552
|
};
|
|
12568
|
-
Q[1].data.push(ce),
|
|
12553
|
+
Q[1].data.push(ce), d += V;
|
|
12569
12554
|
}
|
|
12570
12555
|
return se(Q);
|
|
12571
12556
|
}
|
|
@@ -12626,7 +12611,7 @@ var ma = {}, ai = {
|
|
|
12626
12611
|
for (var pe = [], Ne = 0; Ne < X.length; Ne++) {
|
|
12627
12612
|
var Q = X[Ne].data;
|
|
12628
12613
|
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,
|
|
12614
|
+
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
12615
|
pe.push(S(X[Ne].id)), pe.push(ee(T)), pe.push(Q);
|
|
12631
12616
|
}
|
|
12632
12617
|
return new Blob(pe, {
|
|
@@ -12645,9 +12630,9 @@ var ma = {}, ai = {
|
|
|
12645
12630
|
function xe(X) {
|
|
12646
12631
|
for (var pe = X.RIFF[0].WEBP[0], Ne = pe.indexOf("*"), Q = 0, ne = []; Q < 4; Q++)
|
|
12647
12632
|
ne[Q] = pe.charCodeAt(Ne + 3 + Q);
|
|
12648
|
-
var
|
|
12649
|
-
return V = ne[1] << 8 | ne[0],
|
|
12650
|
-
width:
|
|
12633
|
+
var d, N, V;
|
|
12634
|
+
return V = ne[1] << 8 | ne[0], d = V & 16383, V = ne[3] << 8 | ne[2], N = V & 16383, {
|
|
12635
|
+
width: d,
|
|
12651
12636
|
height: N,
|
|
12652
12637
|
data: pe,
|
|
12653
12638
|
riff: X
|
|
@@ -12661,8 +12646,8 @@ var ma = {}, ai = {
|
|
|
12661
12646
|
}
|
|
12662
12647
|
function fe(X) {
|
|
12663
12648
|
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(
|
|
12649
|
+
var Q = X.substr(pe, 4), ne = le(X, pe), d = X.substr(pe + 4 + 4, ne);
|
|
12650
|
+
pe += 4 + 4 + ne, Ne[Q] = Ne[Q] || [], Q === "RIFF" || Q === "LIST" ? Ne[Q].push(fe(d)) : Ne[Q].push(d);
|
|
12666
12651
|
}
|
|
12667
12652
|
return Ne;
|
|
12668
12653
|
}
|
|
@@ -12978,37 +12963,37 @@ var ma = {}, ai = {
|
|
|
12978
12963
|
};
|
|
12979
12964
|
function le() {
|
|
12980
12965
|
if (!b) {
|
|
12981
|
-
var Q = m.length, ne = !1,
|
|
12966
|
+
var Q = m.length, ne = !1, d = [];
|
|
12982
12967
|
if (m.forEach(function(V) {
|
|
12983
|
-
V.stream || (V.stream = {}), V.stream.fullcanvas ? ne = V :
|
|
12968
|
+
V.stream || (V.stream = {}), V.stream.fullcanvas ? ne = V : d.push(V);
|
|
12984
12969
|
}), ne)
|
|
12985
12970
|
D.width = ne.stream.width, D.height = ne.stream.height;
|
|
12986
|
-
else if (
|
|
12987
|
-
D.width = Q > 1 ?
|
|
12971
|
+
else if (d.length) {
|
|
12972
|
+
D.width = Q > 1 ? d[0].width * 2 : d[0].width;
|
|
12988
12973
|
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 =
|
|
12974
|
+
(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
12975
|
} else
|
|
12991
12976
|
D.width = S.width || 360, D.height = S.height || 240;
|
|
12992
|
-
ne && ne instanceof HTMLVideoElement && fe(ne),
|
|
12977
|
+
ne && ne instanceof HTMLVideoElement && fe(ne), d.forEach(function(V, T) {
|
|
12993
12978
|
fe(V, T);
|
|
12994
12979
|
}), setTimeout(le, S.frameInterval);
|
|
12995
12980
|
}
|
|
12996
12981
|
}
|
|
12997
12982
|
function fe(Q, ne) {
|
|
12998
12983
|
if (!b) {
|
|
12999
|
-
var
|
|
13000
|
-
ne === 1 && (
|
|
12984
|
+
var d = 0, N = 0, V = Q.width, T = Q.height;
|
|
12985
|
+
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
12986
|
}
|
|
13002
12987
|
}
|
|
13003
12988
|
function Ae() {
|
|
13004
12989
|
b = !1;
|
|
13005
12990
|
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
|
-
|
|
12991
|
+
return ne && ne.getTracks().filter(function(d) {
|
|
12992
|
+
return d.kind === "audio";
|
|
12993
|
+
}).forEach(function(d) {
|
|
12994
|
+
Q.addTrack(d);
|
|
12995
|
+
}), L.forEach(function(d) {
|
|
12996
|
+
d.fullcanvas;
|
|
13012
12997
|
}), Q;
|
|
13013
12998
|
}
|
|
13014
12999
|
function ue() {
|
|
@@ -13016,10 +13001,10 @@ var ma = {}, ai = {
|
|
|
13016
13001
|
var Q;
|
|
13017
13002
|
"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
13003
|
var ne = new se();
|
|
13019
|
-
return Q.getTracks().filter(function(
|
|
13020
|
-
return
|
|
13021
|
-
}).forEach(function(
|
|
13022
|
-
ne.addTrack(
|
|
13004
|
+
return Q.getTracks().filter(function(d) {
|
|
13005
|
+
return d.kind === "video";
|
|
13006
|
+
}).forEach(function(d) {
|
|
13007
|
+
ne.addTrack(d);
|
|
13023
13008
|
}), D.stream = ne, ne;
|
|
13024
13009
|
}
|
|
13025
13010
|
function X() {
|
|
@@ -13030,8 +13015,8 @@ var ma = {}, ai = {
|
|
|
13030
13015
|
return N.kind === "audio";
|
|
13031
13016
|
}).length) {
|
|
13032
13017
|
Q++;
|
|
13033
|
-
var
|
|
13034
|
-
S.useGainNode === !0 &&
|
|
13018
|
+
var d = S.audioContext.createMediaStreamSource(ne);
|
|
13019
|
+
S.useGainNode === !0 && d.connect(S.gainNode), S.audioSources.push(d);
|
|
13035
13020
|
}
|
|
13036
13021
|
}), !!Q)
|
|
13037
13022
|
return S.audioDestination = S.audioContext.createMediaStreamDestination(), S.audioSources.forEach(function(ne) {
|
|
@@ -13046,12 +13031,12 @@ var ma = {}, ai = {
|
|
|
13046
13031
|
if (!Q)
|
|
13047
13032
|
throw "First parameter is required.";
|
|
13048
13033
|
Q instanceof Array || (Q = [Q]), Q.forEach(function(ne) {
|
|
13049
|
-
var
|
|
13034
|
+
var d = new se();
|
|
13050
13035
|
if (ne.getTracks().filter(function(T) {
|
|
13051
13036
|
return T.kind === "video";
|
|
13052
13037
|
}).length) {
|
|
13053
13038
|
var N = pe(ne);
|
|
13054
|
-
N.stream = ne, m.push(N),
|
|
13039
|
+
N.stream = ne, m.push(N), d.addTrack(ne.getTracks().filter(function(T) {
|
|
13055
13040
|
return T.kind === "video";
|
|
13056
13041
|
})[0]);
|
|
13057
13042
|
}
|
|
@@ -13059,11 +13044,11 @@ var ma = {}, ai = {
|
|
|
13059
13044
|
return T.kind === "audio";
|
|
13060
13045
|
}).length) {
|
|
13061
13046
|
var V = S.audioContext.createMediaStreamSource(ne);
|
|
13062
|
-
S.audioDestination = S.audioContext.createMediaStreamDestination(), V.connect(S.audioDestination),
|
|
13047
|
+
S.audioDestination = S.audioContext.createMediaStreamDestination(), V.connect(S.audioDestination), d.addTrack(S.audioDestination.stream.getTracks().filter(function(T) {
|
|
13063
13048
|
return T.kind === "audio";
|
|
13064
13049
|
})[0]);
|
|
13065
13050
|
}
|
|
13066
|
-
L.push(
|
|
13051
|
+
L.push(d);
|
|
13067
13052
|
});
|
|
13068
13053
|
}, this.releaseStreams = function() {
|
|
13069
13054
|
m = [], b = !0, S.gainNode && (S.gainNode.disconnect(), S.gainNode = null), S.audioSources.length && (S.audioSources.forEach(function(Q) {
|
|
@@ -13077,8 +13062,8 @@ var ma = {}, ai = {
|
|
|
13077
13062
|
if (ne.getTracks().filter(function(N) {
|
|
13078
13063
|
return N.kind === "video";
|
|
13079
13064
|
}).length) {
|
|
13080
|
-
var
|
|
13081
|
-
|
|
13065
|
+
var d = pe(ne);
|
|
13066
|
+
d.stream = ne, m.push(d);
|
|
13082
13067
|
}
|
|
13083
13068
|
});
|
|
13084
13069
|
}
|
|
@@ -13435,7 +13420,7 @@ const ri = {
|
|
|
13435
13420
|
handleFinish() {
|
|
13436
13421
|
if (!this.blob)
|
|
13437
13422
|
return;
|
|
13438
|
-
const [, s] = this.blob.type.replace(/(;.*$)/, "").split("/"), t = new Date().getTime(),
|
|
13423
|
+
const [, s] = this.blob.type.replace(/(;.*$)/, "").split("/"), t = new Date().getTime(), f = `${t}.${s}`, h = new File([this.blob], f, {
|
|
13439
13424
|
type: this.blob.type,
|
|
13440
13425
|
lastModified: t
|
|
13441
13426
|
});
|
|
@@ -13447,13 +13432,13 @@ const ri = {
|
|
|
13447
13432
|
}
|
|
13448
13433
|
};
|
|
13449
13434
|
var ii = function() {
|
|
13450
|
-
var t = this,
|
|
13451
|
-
return
|
|
13435
|
+
var t = this, f = t._self._c;
|
|
13436
|
+
return f("div", { staticClass: "wrap", style: {
|
|
13452
13437
|
width: t.width
|
|
13453
|
-
} }, [
|
|
13438
|
+
} }, [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
13439
|
finish: !0,
|
|
13455
13440
|
disabled: !t.blob
|
|
13456
|
-
}, on: { click: t.handleFinish } }, [t._v("完成")]),
|
|
13441
|
+
}, 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
13442
|
}, ni = [], si = /* @__PURE__ */ jt(
|
|
13458
13443
|
ri,
|
|
13459
13444
|
ii,
|
|
@@ -13503,13 +13488,13 @@ const li = {
|
|
|
13503
13488
|
), this.url = this.$refs.canvas.toDataURL("image/jpeg");
|
|
13504
13489
|
},
|
|
13505
13490
|
handleFinish() {
|
|
13506
|
-
const t = `${new Date().getTime()}.jpeg`,
|
|
13507
|
-
this.$emit("finish", [
|
|
13491
|
+
const t = `${new Date().getTime()}.jpeg`, f = this.dataURLtoFile(this.url, t);
|
|
13492
|
+
this.$emit("finish", [f]), this.$emit("cancel");
|
|
13508
13493
|
},
|
|
13509
13494
|
dataURLtoFile(s, t) {
|
|
13510
|
-
let
|
|
13511
|
-
for (;
|
|
13512
|
-
Y[
|
|
13495
|
+
let f = s.split(","), h = f[0].match(/:(.*?);/)[1], U = atob(f[1]), R = U.length, Y = new Uint8Array(R);
|
|
13496
|
+
for (; R--; )
|
|
13497
|
+
Y[R] = U.charCodeAt(R);
|
|
13513
13498
|
return new File([Y], t, { type: h });
|
|
13514
13499
|
},
|
|
13515
13500
|
handleCancel() {
|
|
@@ -13518,13 +13503,13 @@ const li = {
|
|
|
13518
13503
|
}
|
|
13519
13504
|
};
|
|
13520
13505
|
var ui = function() {
|
|
13521
|
-
var t = this,
|
|
13522
|
-
return
|
|
13506
|
+
var t = this, f = t._self._c;
|
|
13507
|
+
return f("div", { staticClass: "wrap", style: {
|
|
13523
13508
|
width: t.width
|
|
13524
|
-
} }, [
|
|
13509
|
+
} }, [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
13510
|
finish: !0,
|
|
13526
13511
|
disabled: !t.url
|
|
13527
|
-
}, on: { click: t.handleFinish } }, [t._v("完成")]),
|
|
13512
|
+
}, 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
13513
|
}, ci = [], di = /* @__PURE__ */ jt(
|
|
13529
13514
|
li,
|
|
13530
13515
|
ui,
|
|
@@ -13629,8 +13614,8 @@ const Ia = "KEY_PENDING_NODES", hi = {
|
|
|
13629
13614
|
},
|
|
13630
13615
|
checkModified(s = this.note.title) {
|
|
13631
13616
|
if (!this.note.created_at) {
|
|
13632
|
-
const t = this.isEmptyContent(),
|
|
13633
|
-
this.modified = !
|
|
13617
|
+
const t = this.isEmptyContent(), f = !s;
|
|
13618
|
+
this.modified = !f || !t;
|
|
13634
13619
|
}
|
|
13635
13620
|
},
|
|
13636
13621
|
isEmptyContent() {
|
|
@@ -13717,13 +13702,13 @@ const Ia = "KEY_PENDING_NODES", hi = {
|
|
|
13717
13702
|
this.isMobile ? this.$refs.selectPhoto.click() : this.recordPhotoVisible = !0;
|
|
13718
13703
|
},
|
|
13719
13704
|
async getSize(s, t) {
|
|
13720
|
-
let
|
|
13721
|
-
t === "image" ?
|
|
13722
|
-
const { width: h, height: U } =
|
|
13705
|
+
let f = {};
|
|
13706
|
+
t === "image" ? f = await Ua(s) : t === "video" && (f = await Ha(s));
|
|
13707
|
+
const { width: h, height: U } = f, { width: R, height: Y } = Pa(h, U);
|
|
13723
13708
|
return {
|
|
13724
13709
|
origWidth: h,
|
|
13725
13710
|
origHeight: U,
|
|
13726
|
-
width:
|
|
13711
|
+
width: R,
|
|
13727
13712
|
height: Y
|
|
13728
13713
|
};
|
|
13729
13714
|
},
|
|
@@ -13736,10 +13721,10 @@ const Ia = "KEY_PENDING_NODES", hi = {
|
|
|
13736
13721
|
async handleFileUpload(s, t) {
|
|
13737
13722
|
if (!s.length)
|
|
13738
13723
|
return;
|
|
13739
|
-
const
|
|
13740
|
-
const Y =
|
|
13724
|
+
const f = Array.from(s).map(async (R) => {
|
|
13725
|
+
const Y = Ya(R.type), K = URL.createObjectURL(R);
|
|
13741
13726
|
let ve = {};
|
|
13742
|
-
switch ((Y.mainType === "image" || Y.mainType === "video") && (ve = await this.getSize(
|
|
13727
|
+
switch ((Y.mainType === "image" || Y.mainType === "video") && (ve = await this.getSize(R, Y.mainType)), Y.mainType) {
|
|
13743
13728
|
case "image":
|
|
13744
13729
|
case "audio":
|
|
13745
13730
|
case "video":
|
|
@@ -13755,19 +13740,19 @@ const Ia = "KEY_PENDING_NODES", hi = {
|
|
|
13755
13740
|
return {
|
|
13756
13741
|
uuid: Ct(),
|
|
13757
13742
|
type: "file",
|
|
13758
|
-
name:
|
|
13743
|
+
name: R.name,
|
|
13759
13744
|
content: K,
|
|
13760
|
-
size:
|
|
13745
|
+
size: R.size,
|
|
13761
13746
|
pending: !0,
|
|
13762
13747
|
hash: this.hash
|
|
13763
13748
|
};
|
|
13764
13749
|
}
|
|
13765
|
-
}), h = await Promise.all(
|
|
13766
|
-
t ? t(h) : h.forEach((
|
|
13767
|
-
this.$refs.treeEditor.appendNode(
|
|
13750
|
+
}), h = await Promise.all(f);
|
|
13751
|
+
t ? t(h) : h.forEach((R) => {
|
|
13752
|
+
this.$refs.treeEditor.appendNode(R);
|
|
13768
13753
|
});
|
|
13769
13754
|
const U = this.note.id;
|
|
13770
|
-
|
|
13755
|
+
Qa.uploadFile(s, (R, Y) => {
|
|
13771
13756
|
Y && Y.forEach((K, ve) => {
|
|
13772
13757
|
const be = h[ve], Me = K.data;
|
|
13773
13758
|
if (K.code === 0) {
|
|
@@ -13788,13 +13773,13 @@ const Ia = "KEY_PENDING_NODES", hi = {
|
|
|
13788
13773
|
});
|
|
13789
13774
|
},
|
|
13790
13775
|
savePendingNodes(s, t) {
|
|
13791
|
-
const
|
|
13792
|
-
h.push(t), window.localStorage.setItem(
|
|
13776
|
+
const f = `${Ia}_${s}`, h = JSON.parse(window.localStorage.getItem(f) || "[]");
|
|
13777
|
+
h.push(t), window.localStorage.setItem(f, JSON.stringify(h));
|
|
13793
13778
|
},
|
|
13794
13779
|
restorePendingNodes(s) {
|
|
13795
|
-
const t = `${Ia}_${s}`,
|
|
13796
|
-
|
|
13797
|
-
const h = JSON.parse(
|
|
13780
|
+
const t = `${Ia}_${s}`, f = window.localStorage.getItem(t);
|
|
13781
|
+
f && this.$nextTick(() => {
|
|
13782
|
+
const h = JSON.parse(f);
|
|
13798
13783
|
window.localStorage.removeItem(t), h.forEach((U) => {
|
|
13799
13784
|
this.$refs.treeEditor.updateNode(U);
|
|
13800
13785
|
});
|
|
@@ -13803,19 +13788,19 @@ const Ia = "KEY_PENDING_NODES", hi = {
|
|
|
13803
13788
|
}
|
|
13804
13789
|
};
|
|
13805
13790
|
var vi = function() {
|
|
13806
|
-
var t = this,
|
|
13807
|
-
return
|
|
13791
|
+
var t = this, f = t._self._c;
|
|
13792
|
+
return f("div", { class: {
|
|
13808
13793
|
"record-tree-container": !0,
|
|
13809
13794
|
"record-tree-mobile": t.isMobile
|
|
13810
|
-
} }, [
|
|
13795
|
+
} }, [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
13796
|
return t.$emit("dbEnter");
|
|
13812
|
-
} } })], 1)])], 1), t.bar ?
|
|
13797
|
+
} } })], 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
13798
|
return h.stopPropagation(), t.handleComplete.apply(null, arguments);
|
|
13814
|
-
} } }, [t._v(" " + t._s(t.modified || t.note.created_at ? "完成" : "取消") + " ")])]) : t._e(),
|
|
13799
|
+
} } }, [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
13800
|
t.recordAudioVisible = !1;
|
|
13816
|
-
} } }) : t._e(), t.recordVideoVisible ?
|
|
13801
|
+
} } }) : t._e(), t.recordVideoVisible ? f("RecordVideo", { attrs: { responsive: t.responsive }, on: { finish: t.handleFileUpload, cancel: function(h) {
|
|
13817
13802
|
t.recordVideoVisible = !1;
|
|
13818
|
-
} } }) : t._e(), t.recordPhotoVisible ?
|
|
13803
|
+
} } }) : t._e(), t.recordPhotoVisible ? f("RecordPhoto", { attrs: { responsive: t.responsive }, on: { finish: t.handleFileUpload, cancel: function(h) {
|
|
13819
13804
|
t.recordPhotoVisible = !1;
|
|
13820
13805
|
} } }) : t._e()], 1);
|
|
13821
13806
|
}, _i = [], mi = /* @__PURE__ */ jt(
|
|
@@ -13830,5 +13815,8 @@ var vi = function() {
|
|
|
13830
13815
|
);
|
|
13831
13816
|
const gi = mi.exports;
|
|
13832
13817
|
export {
|
|
13833
|
-
|
|
13818
|
+
ti as RecordAudio,
|
|
13819
|
+
fi as RecordPhoto,
|
|
13820
|
+
gi as RecordTree,
|
|
13821
|
+
oi as RecordVideo
|
|
13834
13822
|
};
|