@codernote/record-tree 1.6.4 → 1.6.5
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 +454 -454
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.node-div[data-v-e4f27408]{display:flex;align-items:center;position:relative}.node-text[data-v-e4f27408]{margin-left:5px;flex:1;border:none;outline:none;word-break:break-all}.node-icon[data-v-e4f27408]{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-e4f27408]:after{content:"";position:absolute;top:5px;left:5px;width:7px;height:7px;border-radius:10px;background-color:#eee}.node-icon[data-v-e4f27408]:hover{background-color:#ccc}.node-complex[data-v-e4f27408]{display:flex;flex-direction:row;align-self:center;justify-self:center;outline:none}.holder[data-v-e4f27408]{width:0px;overflow:hidden;border-width:1px;border-style:solid;border-color:transparent;outline:none}.node-element[data-v-e4f27408]{display:inline-block;position:relative;margin:5px 1px}.node-element:hover .node-del[data-v-e4f27408]{display:block}.node-image img[data-v-e4f27408]{outline:none}.node-audio[data-v-e4f27408]{width:300px}.node-audio audio[data-v-e4f27408]{width:300px;outline:none}.node-video video[data-v-e4f27408]{outline:none}.node-del[data-v-e4f27408]{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-e4f27408]:before,.node-del[data-v-e4f27408]:after{content:"";position:absolute;top:50%;left:50%;width:2px;height:10px;background-color:#595959}.node-del[data-v-e4f27408]:before{transform:translate(-50%,-50%) rotate(45deg)}.node-del[data-v-e4f27408]:after{transform:translate(-50%,-50%) rotate(-45deg)}.node-file-wrap[data-v-e4f27408]{width:260px;padding:10px 16px;display:flex;background:#f2f2f2;border-radius:5px;justify-content:center;align-items:center}.node-file-left[data-v-e4f27408]{flex:1}.node-file-left h6[data-v-e4f27408]{font-size:14px;font-weight:700;margin:0 0 5px;padding:0;white-space:nowrap}.node-file-left p[data-v-e4f27408]{margin:0;padding:0;font-size:12px;color:#999}.node-file-right a[data-v-e4f27408]{color:#52a770;font-size:14px}@keyframes blinkBorder-e4f27408{0%,to{border-color:transparent}50%{border-color:#333}}.node-complex .holder[data-v-e4f27408]:focus{animation:blinkBorder-e4f27408 1s infinite}.fullscreen-handle[data-v-e4f27408]{width:15px;height:15px;position:absolute;bottom:0;right:16px;cursor:pointer;background:rgba(255,255,255,.6)}.resize-handle[data-v-e4f27408]{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}img:-webkit-full-screen{width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;object-fit:contain}img:fullscreen{width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;-o-object-fit:contain;object-fit:contain}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.node-div[data-v-e4f27408]{display:flex;align-items:center;position:relative}.node-text[data-v-e4f27408]{margin-left:5px;flex:1;border:none;outline:none;word-break:break-all}.node-icon[data-v-e4f27408]{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-e4f27408]:after{content:"";position:absolute;top:5px;left:5px;width:7px;height:7px;border-radius:10px;background-color:#eee}.node-icon[data-v-e4f27408]:hover{background-color:#ccc}.node-complex[data-v-e4f27408]{display:flex;flex-direction:row;align-self:center;justify-self:center;outline:none}.holder[data-v-e4f27408]{width:0px;overflow:hidden;border-width:1px;border-style:solid;border-color:transparent;outline:none}.node-element[data-v-e4f27408]{display:inline-block;position:relative;margin:5px 1px}.node-element:hover .node-del[data-v-e4f27408]{display:block}.node-image img[data-v-e4f27408]{outline:none}.node-audio[data-v-e4f27408]{width:300px}.node-audio audio[data-v-e4f27408]{width:300px;outline:none}.node-video video[data-v-e4f27408]{outline:none}.node-del[data-v-e4f27408]{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-e4f27408]:before,.node-del[data-v-e4f27408]:after{content:"";position:absolute;top:50%;left:50%;width:2px;height:10px;background-color:#595959}.node-del[data-v-e4f27408]:before{transform:translate(-50%,-50%) rotate(45deg)}.node-del[data-v-e4f27408]:after{transform:translate(-50%,-50%) rotate(-45deg)}.node-file-wrap[data-v-e4f27408]{width:260px;padding:10px 16px;display:flex;background:#f2f2f2;border-radius:5px;justify-content:center;align-items:center}.node-file-left[data-v-e4f27408]{flex:1}.node-file-left h6[data-v-e4f27408]{font-size:14px;font-weight:700;margin:0 0 5px;padding:0;white-space:nowrap}.node-file-left p[data-v-e4f27408]{margin:0;padding:0;font-size:12px;color:#999}.node-file-right a[data-v-e4f27408]{color:#52a770;font-size:14px}@keyframes blinkBorder-e4f27408{0%,to{border-color:transparent}50%{border-color:#333}}.node-complex .holder[data-v-e4f27408]:focus{animation:blinkBorder-e4f27408 1s infinite}.fullscreen-handle[data-v-e4f27408]{width:15px;height:15px;position:absolute;bottom:0;right:16px;cursor:pointer;background:rgba(255,255,255,.6)}.resize-handle[data-v-e4f27408]{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-98ecf489]{background-color:#fff;margin:0;padding:0;list-style:none}.node-li[data-v-98ecf489]{padding:0;list-style:none;margin:0;line-height:1.5;position:relative;overflow:hidden}[data-v-98ecf489] .sublevel .node-li{margin-left:15px}[data-v-98ecf489] .drag-over-top:before{content:"";width:100%;height:1px;top:0;background-color:#eee;position:absolute}[data-v-98ecf489] .drag-over-center{background-color:#eee}[data-v-98ecf489] .drag-over-bottom:after{content:"";width:100%;height:1px;background-color:#eee;position:absolute;bottom:0}.collapsed>ul[data-v-98ecf489]{display:none}[data-v-98ecf489] .collapsed .node-icon:before{display:none}.tree-title[data-v-98ecf489]{padding-left:25px;font-weight:700;outline:none;font-size:1.125rem;line-height:1.5;width:100%}[data-v-98ecf489] .node-li.has-child.collapsed .node-icon:after{background-color:#aaa}[data-v-98ecf489] .node-li.dragging .node-icon:before{display:none}[data-v-98ecf489] .has-child>.node-div>.node-icon:before{content:"";position:absolute;top:20px;left:50%;height:9999px;width:1px;background-color:#f2f2f2}[data-v-98ecf489] .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}img:-webkit-full-screen{width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;object-fit:contain}img:fullscreen{width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;-o-object-fit:contain;object-fit:contain}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
2
|
import { formatBytes as ka, truncateString as za, uuid as It, detectDeviceType as Ra, byNameFindIcon as Oa, icons as Fa, getImageSize as Ua, getVideoSize as Ha, resizeResource as Ya, parseMimeType as Pa, oss as Qa } from "@codernote/utils";
|
|
3
3
|
import Yt from "vue-inline-svg";
|
|
4
4
|
import Va from "vue-popperjs";
|
|
@@ -41,17 +41,17 @@ function Lt(s, t = 0, f = !1) {
|
|
|
41
41
|
console.error("Element is not contenteditable");
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
const U = window.getSelection(),
|
|
44
|
+
const U = window.getSelection(), E = document.createRange();
|
|
45
45
|
U.removeAllRanges();
|
|
46
46
|
try {
|
|
47
47
|
let P = s;
|
|
48
48
|
if (s.childNodes.length > 0 ? P = s.childNodes[0] : (f || t > 0) && (P = document.createTextNode(""), s.appendChild(P)), f)
|
|
49
|
-
|
|
49
|
+
E.selectNodeContents(P), E.collapse(!1);
|
|
50
50
|
else {
|
|
51
51
|
const K = Math.min(t, P.length || 0);
|
|
52
|
-
|
|
52
|
+
E.setStart(P, K), E.collapse(!0);
|
|
53
53
|
}
|
|
54
|
-
U.addRange(
|
|
54
|
+
U.addRange(E);
|
|
55
55
|
} catch (P) {
|
|
56
56
|
console.error("Error setting focus position:", P);
|
|
57
57
|
}
|
|
@@ -64,8 +64,8 @@ function Ga(s) {
|
|
|
64
64
|
}
|
|
65
65
|
function La(s) {
|
|
66
66
|
var P;
|
|
67
|
-
let f = (((P = s.target) == null ? void 0 : P.querySelector(".node-div")) || s.target).getBoundingClientRect(), h = s.clientY, U = f.top + f.height / 3,
|
|
68
|
-
return h < U ? "top" : h <
|
|
67
|
+
let f = (((P = s.target) == null ? void 0 : P.querySelector(".node-div")) || s.target).getBoundingClientRect(), h = s.clientY, U = f.top + f.height / 3, E = f.top + f.height / 3 * 2;
|
|
68
|
+
return h < U ? "top" : h < E ? "center" : "bottom";
|
|
69
69
|
}
|
|
70
70
|
function ca(s) {
|
|
71
71
|
return /<(img|audio|video)/.test(s.text) || s.type;
|
|
@@ -94,20 +94,20 @@ function $a(s, t) {
|
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
da();
|
|
97
|
-
const U = La(s),
|
|
98
|
-
|
|
97
|
+
const U = La(s), E = (P = f.querySelector(".node-div")) == null ? void 0 : P.classList;
|
|
98
|
+
E && E.add(`drag-over-${U}`);
|
|
99
99
|
}
|
|
100
100
|
function qa(s) {
|
|
101
|
-
const f = new DOMParser().parseFromString(s, "text/html"), h = f.querySelector("img"), U = f.querySelector("video"),
|
|
101
|
+
const f = new DOMParser().parseFromString(s, "text/html"), h = f.querySelector("img"), U = f.querySelector("video"), E = 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
|
+
} : E ? {
|
|
109
109
|
type: "audio",
|
|
110
|
-
content:
|
|
110
|
+
content: E.src
|
|
111
111
|
} : null;
|
|
112
112
|
}
|
|
113
113
|
function fa(s, t) {
|
|
@@ -130,7 +130,7 @@ function Ea(s = !0) {
|
|
|
130
130
|
const f = window.visualViewport.height, h = () => {
|
|
131
131
|
window.visualViewport.height < f && (t.style.display = "none", setTimeout(() => {
|
|
132
132
|
if (t.style.display = "", s) {
|
|
133
|
-
const
|
|
133
|
+
const E = At.get("currentId"), P = Dt({ uuid: E });
|
|
134
134
|
Ka(P) || P.scrollIntoView({
|
|
135
135
|
behavior: "smooth",
|
|
136
136
|
block: "center"
|
|
@@ -156,9 +156,9 @@ const Ja = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPS
|
|
|
156
156
|
resize: ur,
|
|
157
157
|
fullscreen: cr
|
|
158
158
|
};
|
|
159
|
-
function kt(s, t, f, h, U,
|
|
159
|
+
function kt(s, t, f, h, U, E, P, K) {
|
|
160
160
|
var ve = typeof s == "function" ? s.options : s;
|
|
161
|
-
t && (ve.render = t, ve.staticRenderFns = f, ve._compiled = !0), h && (ve.functional = !0),
|
|
161
|
+
t && (ve.render = t, ve.staticRenderFns = f, ve._compiled = !0), h && (ve.functional = !0), E && (ve._scopeId = "data-v-" + E);
|
|
162
162
|
var Me;
|
|
163
163
|
if (P ? (Me = function(Ee) {
|
|
164
164
|
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(P);
|
|
@@ -232,12 +232,12 @@ const dr = {
|
|
|
232
232
|
), U = parseInt(
|
|
233
233
|
document.defaultView.getComputedStyle(this.$refs.resource).height,
|
|
234
234
|
10
|
|
235
|
-
),
|
|
235
|
+
), E = h / U;
|
|
236
236
|
let P = h, K = U;
|
|
237
237
|
const ve = (be) => {
|
|
238
238
|
let Se = h + be.clientX - t, Ee = U + be.clientY - f;
|
|
239
239
|
const { origWidth: Ie, origHeight: te } = this.node.size || {};
|
|
240
|
-
Ie && te && (Se = Math.min(Se, Ie), Ee = Math.min(Ee, te)), Se = Math.max(Se, 50), Ee = Math.max(Ee, 50), Se / Ee >
|
|
240
|
+
Ie && te && (Se = Math.min(Se, Ie), Ee = Math.min(Ee, te)), Se = Math.max(Se, 50), Ee = Math.max(Ee, 50), Se / Ee > E ? (P = Ee * E, K = Ee, this.$refs.resource.style.height = K + "px", this.$refs.resource.style.width = P + "px") : (P = Se, K = Se / E, this.$refs.resource.style.width = Se + "px", this.$refs.resource.style.height = K + "px");
|
|
241
241
|
}, Me = () => {
|
|
242
242
|
document.documentElement.removeEventListener(
|
|
243
243
|
"mousemove",
|
|
@@ -280,10 +280,10 @@ const dr = {
|
|
|
280
280
|
const h = Bt(), U = (s.target.innerHTML || "").replace(
|
|
281
281
|
/<br\s*\/?>/gi,
|
|
282
282
|
""
|
|
283
|
-
),
|
|
283
|
+
), E = t.text !== U;
|
|
284
284
|
t.text = U, this.$nextTick(() => {
|
|
285
285
|
Lt(s.target, h);
|
|
286
|
-
}),
|
|
286
|
+
}), E && this.update();
|
|
287
287
|
} else
|
|
288
288
|
this.disableInput = !1;
|
|
289
289
|
},
|
|
@@ -368,8 +368,8 @@ const dr = {
|
|
|
368
368
|
const t = this.node, f = s.currentTarget, h = Bt();
|
|
369
369
|
if (!f)
|
|
370
370
|
return;
|
|
371
|
-
const U = h + 1,
|
|
372
|
-
!h && t.type ? Lt(f, U, !0) : U >
|
|
371
|
+
const U = h + 1, E = f.innerText.length;
|
|
372
|
+
!h && t.type ? Lt(f, U, !0) : U > E ? this.$emit("toNextFocus", t, !0, !0) : Lt(f, U);
|
|
373
373
|
},
|
|
374
374
|
handleArrowDown() {
|
|
375
375
|
this.$emit("toNextFocus", this.node, !1, !0);
|
|
@@ -507,25 +507,25 @@ const mr = {
|
|
|
507
507
|
fa(t, h) || // 拖拽到自己的父节点
|
|
508
508
|
fa(h, t))
|
|
509
509
|
return;
|
|
510
|
-
let
|
|
511
|
-
if (
|
|
512
|
-
this.update(
|
|
510
|
+
let E = [...this.nodes];
|
|
511
|
+
if (E.find((P) => P.uuid === h.uuid) ? E = E.filter((P) => P.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(() => {
|
|
512
|
+
this.update(E);
|
|
513
513
|
})), U === "top") {
|
|
514
|
-
const P =
|
|
515
|
-
|
|
514
|
+
const P = E.findIndex((K) => K === t);
|
|
515
|
+
E.splice(P, 0, h), this.update(E);
|
|
516
516
|
}
|
|
517
517
|
if (U === "bottom") {
|
|
518
|
-
const P =
|
|
519
|
-
|
|
518
|
+
const P = E.findIndex((K) => K === t);
|
|
519
|
+
E.splice(P + 1, 0, h), this.update(E);
|
|
520
520
|
}
|
|
521
521
|
}
|
|
522
522
|
},
|
|
523
523
|
handlePaste(s, t) {
|
|
524
524
|
const f = s.clipboardData.files, h = s.target;
|
|
525
525
|
if (f.length == 0) {
|
|
526
|
-
const U = [...this.nodes],
|
|
526
|
+
const U = [...this.nodes], E = U.findIndex((P) => P === t);
|
|
527
527
|
setTimeout(() => {
|
|
528
|
-
t.text !== h.innerText && (U[
|
|
528
|
+
t.text !== h.innerText && (U[E] = {
|
|
529
529
|
...t,
|
|
530
530
|
text: h.innerText
|
|
531
531
|
}, this.update(U));
|
|
@@ -535,14 +535,14 @@ const mr = {
|
|
|
535
535
|
this.addFiles(f, t), s.preventDefault();
|
|
536
536
|
},
|
|
537
537
|
handleTab(s, t) {
|
|
538
|
-
var
|
|
538
|
+
var E;
|
|
539
539
|
s.preventDefault();
|
|
540
540
|
const f = [...this.nodes], h = f.findIndex((P) => P === t), U = Bt();
|
|
541
541
|
if (s.shiftKey)
|
|
542
542
|
this.$emit("transfer", t);
|
|
543
543
|
else if (h > 0) {
|
|
544
544
|
const P = this.nodes[h - 1];
|
|
545
|
-
(
|
|
545
|
+
(E = this.status[P.uuid]) != null && E.collapsed && (this.status[P.uuid].collapsed = !1), P.children ? P.children.push(t) : P.children = [t], f.splice(h, 1), this.update(f);
|
|
546
546
|
} else
|
|
547
547
|
s.target.focus();
|
|
548
548
|
this.$nextTick(() => {
|
|
@@ -564,8 +564,8 @@ const mr = {
|
|
|
564
564
|
},
|
|
565
565
|
// 节点跨父级移动
|
|
566
566
|
handleTransfer(s, t) {
|
|
567
|
-
const f = [...this.nodes], h = f.findIndex((
|
|
568
|
-
s.children.
|
|
567
|
+
const f = [...this.nodes], h = f.findIndex((U) => U === s);
|
|
568
|
+
s.children = s.children.filter((U) => U !== t), f.splice(h + 1, 0, t), this.update(f);
|
|
569
569
|
},
|
|
570
570
|
handleEnter(s) {
|
|
571
571
|
this.enableDbEnter ? this.timeout ? (clearTimeout(this.timeout), this.timeout = null, this.handleDbEnter()) : this.timeout = setTimeout(() => {
|
|
@@ -576,15 +576,15 @@ const mr = {
|
|
|
576
576
|
this.$emit("dbEnter");
|
|
577
577
|
},
|
|
578
578
|
keyEnter(s) {
|
|
579
|
-
const t = ca(s), f = this.nodes.findIndex((P) => P.uuid === s.uuid), h = Bt(), U = [...this.nodes],
|
|
579
|
+
const t = ca(s), f = this.nodes.findIndex((P) => P.uuid === s.uuid), h = Bt(), U = [...this.nodes], E = { text: "", uuid: It() };
|
|
580
580
|
if (t)
|
|
581
|
-
U.splice(f + 1, 0,
|
|
581
|
+
U.splice(f + 1, 0, E);
|
|
582
582
|
else {
|
|
583
583
|
let P = s.text.replace(/ ?/g, " ");
|
|
584
|
-
s.text = P.slice(0, h),
|
|
584
|
+
s.text = P.slice(0, h), E.text = P.slice(h, P.length), U.splice(f + 1, 0, E);
|
|
585
585
|
}
|
|
586
586
|
this.update(U), this.$nextTick(() => {
|
|
587
|
-
const P = Dt(
|
|
587
|
+
const P = Dt(E);
|
|
588
588
|
P == null || P.focus();
|
|
589
589
|
});
|
|
590
590
|
},
|
|
@@ -592,11 +592,11 @@ const mr = {
|
|
|
592
592
|
toPrevFocus(s, t = !1) {
|
|
593
593
|
var U;
|
|
594
594
|
let f = Bt();
|
|
595
|
-
const h = this.nodes.findIndex((
|
|
595
|
+
const h = this.nodes.findIndex((E) => E === s);
|
|
596
596
|
if (h === 0)
|
|
597
597
|
this.$emit("focusPrev", t);
|
|
598
598
|
else {
|
|
599
|
-
const
|
|
599
|
+
const E = this.nodes[h - 1], P = ((U = E.children) == null ? void 0 : U.length) && !this.status[E.uuid].collapsed, K = Dt(this.nodes[h - 1], P), ve = t || f === 1 / 0;
|
|
600
600
|
Lt(
|
|
601
601
|
K,
|
|
602
602
|
ve ? K.innerText.length : f,
|
|
@@ -606,9 +606,9 @@ const mr = {
|
|
|
606
606
|
},
|
|
607
607
|
// 聚焦下一节点
|
|
608
608
|
toNextFocus(s, t = !1, f = !1) {
|
|
609
|
-
var
|
|
609
|
+
var E;
|
|
610
610
|
const h = Bt(), U = this.nodes.findIndex((P) => P === s);
|
|
611
|
-
if (f && ((
|
|
611
|
+
if (f && ((E = s.children) != null && E.length) && !this.status[s.uuid].collapsed) {
|
|
612
612
|
const P = Dt(s.children[0]);
|
|
613
613
|
Lt(P, t ? 0 : h);
|
|
614
614
|
} else if (U + 1 >= this.nodes.length)
|
|
@@ -626,10 +626,10 @@ const mr = {
|
|
|
626
626
|
},
|
|
627
627
|
addFiles(s, t) {
|
|
628
628
|
if (s) {
|
|
629
|
-
const h = Array.from(s).slice(0, 5), U = (
|
|
629
|
+
const h = Array.from(s).slice(0, 5), U = (E) => {
|
|
630
630
|
const P = [...this.nodes];
|
|
631
631
|
let K = P.findIndex((ve) => ve === t);
|
|
632
|
-
|
|
632
|
+
E.forEach((ve, Me) => {
|
|
633
633
|
!t.text && !t.content && Me === 0 ? (ve.uuid = t.uuid, P.splice(K, 1, {
|
|
634
634
|
...ve,
|
|
635
635
|
uuid: t.uuid,
|
|
@@ -662,13 +662,13 @@ const mr = {
|
|
|
662
662
|
} : U.push(s), this.update(U);
|
|
663
663
|
return;
|
|
664
664
|
}
|
|
665
|
-
const
|
|
666
|
-
if (
|
|
667
|
-
const P = U[
|
|
668
|
-
!(P != null && P.type) && !P.text ? U[
|
|
665
|
+
const E = U.findIndex((P) => P.uuid === h);
|
|
666
|
+
if (E >= 0) {
|
|
667
|
+
const P = U[E];
|
|
668
|
+
!(P != null && P.type) && !P.text ? U[E] = {
|
|
669
669
|
...P,
|
|
670
670
|
...s
|
|
671
|
-
} : U.splice(
|
|
671
|
+
} : U.splice(E + 1, 0, s);
|
|
672
672
|
} else
|
|
673
673
|
U.forEach((P) => {
|
|
674
674
|
var K;
|
|
@@ -678,10 +678,10 @@ const mr = {
|
|
|
678
678
|
},
|
|
679
679
|
// dfs查找并更新节点
|
|
680
680
|
updateNode(s, t = !1, f = this.nodes) {
|
|
681
|
-
const h = [...f], U = h.findIndex((
|
|
682
|
-
return U >= 0 ? h[U] = s : h.forEach((
|
|
681
|
+
const h = [...f], U = h.findIndex((E) => E.uuid === s.uuid);
|
|
682
|
+
return U >= 0 ? h[U] = s : h.forEach((E) => {
|
|
683
683
|
var P;
|
|
684
|
-
(P =
|
|
684
|
+
(P = E.children) != null && P.length && (E.children = this.updateNode(s, !0, E.children));
|
|
685
685
|
}), t || this.update(h), h;
|
|
686
686
|
},
|
|
687
687
|
filterNodes(s) {
|
|
@@ -759,7 +759,7 @@ var pr = function() {
|
|
|
759
759
|
Mr,
|
|
760
760
|
!1,
|
|
761
761
|
null,
|
|
762
|
-
"
|
|
762
|
+
"98ecf489",
|
|
763
763
|
null,
|
|
764
764
|
null
|
|
765
765
|
);
|
|
@@ -904,8 +904,8 @@ const Nr = {
|
|
|
904
904
|
const h = new RegExp(`^(${f}[::])`), U = new RegExp(`([::]${f})$`);
|
|
905
905
|
if (h.test(t) || U.test(t)) {
|
|
906
906
|
s.target.innerText = t.replace(h, "").replace(U, ""), this.setCursorToPosition(h.test(t) ? "start" : "end");
|
|
907
|
-
const
|
|
908
|
-
this.tagSelect(
|
|
907
|
+
const E = this.tags.find((P) => P.name === f);
|
|
908
|
+
this.tagSelect(E);
|
|
909
909
|
}
|
|
910
910
|
}), this.titleEmpty = !t;
|
|
911
911
|
},
|
|
@@ -932,7 +932,7 @@ var Dr = function() {
|
|
|
932
932
|
var t = this, f = t._self._c;
|
|
933
933
|
return f("div", { staticClass: "record-tree-title-bar" }, [t.tags.length ? f("Picker", { scopedSlots: t._u([t.readOnly ? null : { key: "default", fn: function() {
|
|
934
934
|
return [f("div", { staticClass: "record-tree-popper-content", style: { width: t.tagConfig.popW, height: t.tagConfig.popH } }, t._l(t.tags, function(h, U) {
|
|
935
|
-
return f("span", { key: U, staticClass: "record-tree-popper-content-item", on: { click: function(
|
|
935
|
+
return f("span", { key: U, staticClass: "record-tree-popper-content-item", on: { click: function(E) {
|
|
936
936
|
return t.tagSelect(h);
|
|
937
937
|
} } }, [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: {
|
|
938
938
|
width: t.tagConfig.tagSize + "px",
|
|
@@ -978,8 +978,8 @@ function Lr(s) {
|
|
|
978
978
|
if (this instanceof h) {
|
|
979
979
|
var U = [null];
|
|
980
980
|
U.push.apply(U, arguments);
|
|
981
|
-
var
|
|
982
|
-
return new
|
|
981
|
+
var E = Function.bind.apply(t, U);
|
|
982
|
+
return new E();
|
|
983
983
|
}
|
|
984
984
|
return t.apply(this, arguments);
|
|
985
985
|
};
|
|
@@ -1026,32 +1026,32 @@ function ta() {
|
|
|
1026
1026
|
s.exports = h();
|
|
1027
1027
|
})(st, function() {
|
|
1028
1028
|
var f = f || function(h, U) {
|
|
1029
|
-
var
|
|
1030
|
-
if (typeof window < "u" && window.crypto && (
|
|
1029
|
+
var E;
|
|
1030
|
+
if (typeof window < "u" && window.crypto && (E = window.crypto), typeof self < "u" && self.crypto && (E = self.crypto), typeof globalThis < "u" && globalThis.crypto && (E = globalThis.crypto), !E && typeof window < "u" && window.msCrypto && (E = window.msCrypto), !E && typeof st < "u" && st.crypto && (E = st.crypto), !E && typeof jr == "function")
|
|
1031
1031
|
try {
|
|
1032
|
-
|
|
1032
|
+
E = Or;
|
|
1033
1033
|
} catch {
|
|
1034
1034
|
}
|
|
1035
1035
|
var P = function() {
|
|
1036
|
-
if (
|
|
1037
|
-
if (typeof
|
|
1036
|
+
if (E) {
|
|
1037
|
+
if (typeof E.getRandomValues == "function")
|
|
1038
1038
|
try {
|
|
1039
|
-
return
|
|
1039
|
+
return E.getRandomValues(new Uint32Array(1))[0];
|
|
1040
1040
|
} catch {
|
|
1041
1041
|
}
|
|
1042
|
-
if (typeof
|
|
1042
|
+
if (typeof E.randomBytes == "function")
|
|
1043
1043
|
try {
|
|
1044
|
-
return
|
|
1044
|
+
return E.randomBytes(4).readInt32LE();
|
|
1045
1045
|
} catch {
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
1048
|
throw new Error("Native crypto module could not be used to get secure random number.");
|
|
1049
1049
|
}, K = Object.create || function() {
|
|
1050
|
-
function
|
|
1050
|
+
function L() {
|
|
1051
1051
|
}
|
|
1052
1052
|
return function(he) {
|
|
1053
1053
|
var Te;
|
|
1054
|
-
return
|
|
1054
|
+
return L.prototype = he, Te = new L(), L.prototype = null, Te;
|
|
1055
1055
|
};
|
|
1056
1056
|
}(), ve = {}, Me = ve.lib = {}, be = Me.Base = function() {
|
|
1057
1057
|
return {
|
|
@@ -1073,9 +1073,9 @@ function ta() {
|
|
|
1073
1073
|
* }
|
|
1074
1074
|
* });
|
|
1075
1075
|
*/
|
|
1076
|
-
extend: function(
|
|
1076
|
+
extend: function(L) {
|
|
1077
1077
|
var he = K(this);
|
|
1078
|
-
return
|
|
1078
|
+
return L && he.mixIn(L), (!he.hasOwnProperty("init") || this.init === he.init) && (he.init = function() {
|
|
1079
1079
|
he.$super.init.apply(this, arguments);
|
|
1080
1080
|
}), he.init.prototype = he, he.$super = this, he;
|
|
1081
1081
|
},
|
|
@@ -1092,8 +1092,8 @@ function ta() {
|
|
|
1092
1092
|
* var instance = MyType.create();
|
|
1093
1093
|
*/
|
|
1094
1094
|
create: function() {
|
|
1095
|
-
var
|
|
1096
|
-
return
|
|
1095
|
+
var L = this.extend();
|
|
1096
|
+
return L.init.apply(L, arguments), L;
|
|
1097
1097
|
},
|
|
1098
1098
|
/**
|
|
1099
1099
|
* Initializes a newly created object.
|
|
@@ -1120,10 +1120,10 @@ function ta() {
|
|
|
1120
1120
|
* field: 'value'
|
|
1121
1121
|
* });
|
|
1122
1122
|
*/
|
|
1123
|
-
mixIn: function(
|
|
1124
|
-
for (var he in
|
|
1125
|
-
|
|
1126
|
-
|
|
1123
|
+
mixIn: function(L) {
|
|
1124
|
+
for (var he in L)
|
|
1125
|
+
L.hasOwnProperty(he) && (this[he] = L[he]);
|
|
1126
|
+
L.hasOwnProperty("toString") && (this.toString = L.toString);
|
|
1127
1127
|
},
|
|
1128
1128
|
/**
|
|
1129
1129
|
* Creates a copy of this object.
|
|
@@ -1151,8 +1151,8 @@ function ta() {
|
|
|
1151
1151
|
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
|
|
1152
1152
|
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
|
|
1153
1153
|
*/
|
|
1154
|
-
init: function(
|
|
1155
|
-
|
|
1154
|
+
init: function(L, he) {
|
|
1155
|
+
L = this.words = L || [], he != U ? this.sigBytes = he : this.sigBytes = L.length * 4;
|
|
1156
1156
|
},
|
|
1157
1157
|
/**
|
|
1158
1158
|
* Converts this word array to a string.
|
|
@@ -1167,8 +1167,8 @@ function ta() {
|
|
|
1167
1167
|
* var string = wordArray.toString();
|
|
1168
1168
|
* var string = wordArray.toString(CryptoJS.enc.Utf8);
|
|
1169
1169
|
*/
|
|
1170
|
-
toString: function(
|
|
1171
|
-
return (
|
|
1170
|
+
toString: function(L) {
|
|
1171
|
+
return (L || Ie).stringify(this);
|
|
1172
1172
|
},
|
|
1173
1173
|
/**
|
|
1174
1174
|
* Concatenates a word array to this word array.
|
|
@@ -1181,8 +1181,8 @@ function ta() {
|
|
|
1181
1181
|
*
|
|
1182
1182
|
* wordArray1.concat(wordArray2);
|
|
1183
1183
|
*/
|
|
1184
|
-
concat: function(
|
|
1185
|
-
var he = this.words, Te =
|
|
1184
|
+
concat: function(L) {
|
|
1185
|
+
var he = this.words, Te = L.words, Fe = this.sigBytes, Qe = L.sigBytes;
|
|
1186
1186
|
if (this.clamp(), Fe % 4)
|
|
1187
1187
|
for (var $e = 0; $e < Qe; $e++) {
|
|
1188
1188
|
var Ge = Te[$e >>> 2] >>> 24 - $e % 4 * 8 & 255;
|
|
@@ -1201,8 +1201,8 @@ function ta() {
|
|
|
1201
1201
|
* wordArray.clamp();
|
|
1202
1202
|
*/
|
|
1203
1203
|
clamp: function() {
|
|
1204
|
-
var
|
|
1205
|
-
|
|
1204
|
+
var L = this.words, he = this.sigBytes;
|
|
1205
|
+
L[he >>> 2] &= 4294967295 << 32 - he % 4 * 8, L.length = h.ceil(he / 4);
|
|
1206
1206
|
},
|
|
1207
1207
|
/**
|
|
1208
1208
|
* Creates a copy of this word array.
|
|
@@ -1214,8 +1214,8 @@ function ta() {
|
|
|
1214
1214
|
* var clone = wordArray.clone();
|
|
1215
1215
|
*/
|
|
1216
1216
|
clone: function() {
|
|
1217
|
-
var
|
|
1218
|
-
return
|
|
1217
|
+
var L = be.clone.call(this);
|
|
1218
|
+
return L.words = this.words.slice(0), L;
|
|
1219
1219
|
},
|
|
1220
1220
|
/**
|
|
1221
1221
|
* Creates a word array filled with random bytes.
|
|
@@ -1230,10 +1230,10 @@ function ta() {
|
|
|
1230
1230
|
*
|
|
1231
1231
|
* var wordArray = CryptoJS.lib.WordArray.random(16);
|
|
1232
1232
|
*/
|
|
1233
|
-
random: function(
|
|
1234
|
-
for (var he = [], Te = 0; Te <
|
|
1233
|
+
random: function(L) {
|
|
1234
|
+
for (var he = [], Te = 0; Te < L; Te += 4)
|
|
1235
1235
|
he.push(P());
|
|
1236
|
-
return new Se.init(he,
|
|
1236
|
+
return new Se.init(he, L);
|
|
1237
1237
|
}
|
|
1238
1238
|
}), Ee = ve.enc = {}, Ie = Ee.Hex = {
|
|
1239
1239
|
/**
|
|
@@ -1249,8 +1249,8 @@ function ta() {
|
|
|
1249
1249
|
*
|
|
1250
1250
|
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
|
|
1251
1251
|
*/
|
|
1252
|
-
stringify: function(
|
|
1253
|
-
for (var he =
|
|
1252
|
+
stringify: function(L) {
|
|
1253
|
+
for (var he = L.words, Te = L.sigBytes, Fe = [], Qe = 0; Qe < Te; Qe++) {
|
|
1254
1254
|
var $e = he[Qe >>> 2] >>> 24 - Qe % 4 * 8 & 255;
|
|
1255
1255
|
Fe.push(($e >>> 4).toString(16)), Fe.push(($e & 15).toString(16));
|
|
1256
1256
|
}
|
|
@@ -1269,9 +1269,9 @@ function ta() {
|
|
|
1269
1269
|
*
|
|
1270
1270
|
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
|
|
1271
1271
|
*/
|
|
1272
|
-
parse: function(
|
|
1273
|
-
for (var he =
|
|
1274
|
-
Te[Fe >>> 3] |= parseInt(
|
|
1272
|
+
parse: function(L) {
|
|
1273
|
+
for (var he = L.length, Te = [], Fe = 0; Fe < he; Fe += 2)
|
|
1274
|
+
Te[Fe >>> 3] |= parseInt(L.substr(Fe, 2), 16) << 24 - Fe % 8 * 4;
|
|
1275
1275
|
return new Se.init(Te, he / 2);
|
|
1276
1276
|
}
|
|
1277
1277
|
}, te = Ee.Latin1 = {
|
|
@@ -1288,8 +1288,8 @@ function ta() {
|
|
|
1288
1288
|
*
|
|
1289
1289
|
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
|
|
1290
1290
|
*/
|
|
1291
|
-
stringify: function(
|
|
1292
|
-
for (var he =
|
|
1291
|
+
stringify: function(L) {
|
|
1292
|
+
for (var he = L.words, Te = L.sigBytes, Fe = [], Qe = 0; Qe < Te; Qe++) {
|
|
1293
1293
|
var $e = he[Qe >>> 2] >>> 24 - Qe % 4 * 8 & 255;
|
|
1294
1294
|
Fe.push(String.fromCharCode($e));
|
|
1295
1295
|
}
|
|
@@ -1308,9 +1308,9 @@ function ta() {
|
|
|
1308
1308
|
*
|
|
1309
1309
|
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
|
|
1310
1310
|
*/
|
|
1311
|
-
parse: function(
|
|
1312
|
-
for (var he =
|
|
1313
|
-
Te[Fe >>> 2] |= (
|
|
1311
|
+
parse: function(L) {
|
|
1312
|
+
for (var he = L.length, Te = [], Fe = 0; Fe < he; Fe++)
|
|
1313
|
+
Te[Fe >>> 2] |= (L.charCodeAt(Fe) & 255) << 24 - Fe % 4 * 8;
|
|
1314
1314
|
return new Se.init(Te, he);
|
|
1315
1315
|
}
|
|
1316
1316
|
}, ie = Ee.Utf8 = {
|
|
@@ -1327,9 +1327,9 @@ function ta() {
|
|
|
1327
1327
|
*
|
|
1328
1328
|
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
|
|
1329
1329
|
*/
|
|
1330
|
-
stringify: function(
|
|
1330
|
+
stringify: function(L) {
|
|
1331
1331
|
try {
|
|
1332
|
-
return decodeURIComponent(escape(te.stringify(
|
|
1332
|
+
return decodeURIComponent(escape(te.stringify(L)));
|
|
1333
1333
|
} catch {
|
|
1334
1334
|
throw new Error("Malformed UTF-8 data");
|
|
1335
1335
|
}
|
|
@@ -1347,8 +1347,8 @@ function ta() {
|
|
|
1347
1347
|
*
|
|
1348
1348
|
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
|
|
1349
1349
|
*/
|
|
1350
|
-
parse: function(
|
|
1351
|
-
return te.parse(unescape(encodeURIComponent(
|
|
1350
|
+
parse: function(L) {
|
|
1351
|
+
return te.parse(unescape(encodeURIComponent(L)));
|
|
1352
1352
|
}
|
|
1353
1353
|
}, we = Me.BufferedBlockAlgorithm = be.extend({
|
|
1354
1354
|
/**
|
|
@@ -1371,8 +1371,8 @@ function ta() {
|
|
|
1371
1371
|
* bufferedBlockAlgorithm._append('data');
|
|
1372
1372
|
* bufferedBlockAlgorithm._append(wordArray);
|
|
1373
1373
|
*/
|
|
1374
|
-
_append: function(
|
|
1375
|
-
typeof
|
|
1374
|
+
_append: function(L) {
|
|
1375
|
+
typeof L == "string" && (L = ie.parse(L)), this._data.concat(L), this._nDataBytes += L.sigBytes;
|
|
1376
1376
|
},
|
|
1377
1377
|
/**
|
|
1378
1378
|
* Processes available data blocks.
|
|
@@ -1388,9 +1388,9 @@ function ta() {
|
|
|
1388
1388
|
* var processedData = bufferedBlockAlgorithm._process();
|
|
1389
1389
|
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
|
|
1390
1390
|
*/
|
|
1391
|
-
_process: function(
|
|
1391
|
+
_process: function(L) {
|
|
1392
1392
|
var he, Te = this._data, Fe = Te.words, Qe = Te.sigBytes, $e = this.blockSize, Ge = $e * 4, He = Qe / Ge;
|
|
1393
|
-
|
|
1393
|
+
L ? He = h.ceil(He) : He = h.max((He | 0) - this._minBufferSize, 0);
|
|
1394
1394
|
var Xe = He * $e, Be = h.min(Xe * 4, Qe);
|
|
1395
1395
|
if (Xe) {
|
|
1396
1396
|
for (var W = 0; W < Xe; W += $e)
|
|
@@ -1409,8 +1409,8 @@ function ta() {
|
|
|
1409
1409
|
* var clone = bufferedBlockAlgorithm.clone();
|
|
1410
1410
|
*/
|
|
1411
1411
|
clone: function() {
|
|
1412
|
-
var
|
|
1413
|
-
return
|
|
1412
|
+
var L = be.clone.call(this);
|
|
1413
|
+
return L._data = this._data.clone(), L;
|
|
1414
1414
|
},
|
|
1415
1415
|
_minBufferSize: 0
|
|
1416
1416
|
});
|
|
@@ -1428,8 +1428,8 @@ function ta() {
|
|
|
1428
1428
|
*
|
|
1429
1429
|
* var hasher = CryptoJS.algo.SHA256.create();
|
|
1430
1430
|
*/
|
|
1431
|
-
init: function(
|
|
1432
|
-
this.cfg = this.cfg.extend(
|
|
1431
|
+
init: function(L) {
|
|
1432
|
+
this.cfg = this.cfg.extend(L), this.reset();
|
|
1433
1433
|
},
|
|
1434
1434
|
/**
|
|
1435
1435
|
* Resets this hasher to its initial state.
|
|
@@ -1453,8 +1453,8 @@ function ta() {
|
|
|
1453
1453
|
* hasher.update('message');
|
|
1454
1454
|
* hasher.update(wordArray);
|
|
1455
1455
|
*/
|
|
1456
|
-
update: function(
|
|
1457
|
-
return this._append(
|
|
1456
|
+
update: function(L) {
|
|
1457
|
+
return this._append(L), this._process(), this;
|
|
1458
1458
|
},
|
|
1459
1459
|
/**
|
|
1460
1460
|
* Finalizes the hash computation.
|
|
@@ -1470,8 +1470,8 @@ function ta() {
|
|
|
1470
1470
|
* var hash = hasher.finalize('message');
|
|
1471
1471
|
* var hash = hasher.finalize(wordArray);
|
|
1472
1472
|
*/
|
|
1473
|
-
finalize: function(
|
|
1474
|
-
|
|
1473
|
+
finalize: function(L) {
|
|
1474
|
+
L && this._append(L);
|
|
1475
1475
|
var he = this._doFinalize();
|
|
1476
1476
|
return he;
|
|
1477
1477
|
},
|
|
@@ -1489,9 +1489,9 @@ function ta() {
|
|
|
1489
1489
|
*
|
|
1490
1490
|
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
|
|
1491
1491
|
*/
|
|
1492
|
-
_createHelper: function(
|
|
1492
|
+
_createHelper: function(L) {
|
|
1493
1493
|
return function(he, Te) {
|
|
1494
|
-
return new
|
|
1494
|
+
return new L.init(Te).finalize(he);
|
|
1495
1495
|
};
|
|
1496
1496
|
},
|
|
1497
1497
|
/**
|
|
@@ -1507,9 +1507,9 @@ function ta() {
|
|
|
1507
1507
|
*
|
|
1508
1508
|
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
|
|
1509
1509
|
*/
|
|
1510
|
-
_createHmacHelper: function(
|
|
1510
|
+
_createHmacHelper: function(L) {
|
|
1511
1511
|
return function(he, Te) {
|
|
1512
|
-
return new Ue.HMAC.init(
|
|
1512
|
+
return new Ue.HMAC.init(L, Te).finalize(he);
|
|
1513
1513
|
};
|
|
1514
1514
|
}
|
|
1515
1515
|
});
|
|
@@ -1534,10 +1534,10 @@ function Ur() {
|
|
|
1534
1534
|
s.exports = h(ta());
|
|
1535
1535
|
})(st, function(f) {
|
|
1536
1536
|
return function(h) {
|
|
1537
|
-
var U = f,
|
|
1537
|
+
var U = f, E = U.lib, P = E.WordArray, K = E.Hasher, ve = U.algo, Me = [], be = [];
|
|
1538
1538
|
(function() {
|
|
1539
1539
|
function Ie(Ue) {
|
|
1540
|
-
for (var
|
|
1540
|
+
for (var L = h.sqrt(Ue), he = 2; he <= L; he++)
|
|
1541
1541
|
if (!(Ue % he))
|
|
1542
1542
|
return !1;
|
|
1543
1543
|
return !0;
|
|
@@ -1553,17 +1553,17 @@ function Ur() {
|
|
|
1553
1553
|
this._hash = new P.init(Me.slice(0));
|
|
1554
1554
|
},
|
|
1555
1555
|
_doProcessBlock: function(Ie, te) {
|
|
1556
|
-
for (var ie = this._hash.words, we = ie[0], Ue = ie[1],
|
|
1556
|
+
for (var ie = this._hash.words, we = ie[0], Ue = ie[1], L = ie[2], he = ie[3], Te = ie[4], Fe = ie[5], Qe = ie[6], $e = ie[7], Ge = 0; Ge < 64; Ge++) {
|
|
1557
1557
|
if (Ge < 16)
|
|
1558
1558
|
Se[Ge] = Ie[te + Ge] | 0;
|
|
1559
1559
|
else {
|
|
1560
1560
|
var He = Se[Ge - 15], Xe = (He << 25 | He >>> 7) ^ (He << 14 | He >>> 18) ^ He >>> 3, Be = Se[Ge - 2], W = (Be << 15 | Be >>> 17) ^ (Be << 13 | Be >>> 19) ^ Be >>> 10;
|
|
1561
1561
|
Se[Ge] = Xe + Se[Ge - 7] + W + Se[Ge - 16];
|
|
1562
1562
|
}
|
|
1563
|
-
var pt = Te & Fe ^ ~Te & Qe, at = we & Ue ^ we &
|
|
1564
|
-
$e = Qe, Qe = Fe, Fe = Te, Te = he + _t | 0, he =
|
|
1563
|
+
var pt = Te & Fe ^ ~Te & Qe, at = we & Ue ^ we & L ^ Ue & L, et = (we << 30 | we >>> 2) ^ (we << 19 | we >>> 13) ^ (we << 10 | we >>> 22), vt = (Te << 26 | Te >>> 6) ^ (Te << 21 | Te >>> 11) ^ (Te << 7 | Te >>> 25), _t = $e + vt + pt + be[Ge] + Se[Ge], ct = et + at;
|
|
1564
|
+
$e = Qe, Qe = Fe, Fe = Te, Te = he + _t | 0, he = L, L = Ue, Ue = we, we = _t + ct | 0;
|
|
1565
1565
|
}
|
|
1566
|
-
ie[0] = ie[0] + we | 0, ie[1] = ie[1] + Ue | 0, ie[2] = ie[2] +
|
|
1566
|
+
ie[0] = ie[0] + we | 0, ie[1] = ie[1] + Ue | 0, ie[2] = ie[2] + L | 0, ie[3] = ie[3] + he | 0, ie[4] = ie[4] + Te | 0, ie[5] = ie[5] + Fe | 0, ie[6] = ie[6] + Qe | 0, ie[7] = ie[7] + $e | 0;
|
|
1567
1567
|
},
|
|
1568
1568
|
_doFinalize: function() {
|
|
1569
1569
|
var Ie = this._data, te = Ie.words, ie = this._nDataBytes * 8, we = Ie.sigBytes * 8;
|
|
@@ -1593,8 +1593,8 @@ function Yr() {
|
|
|
1593
1593
|
s.exports = h(ta());
|
|
1594
1594
|
})(st, function(f) {
|
|
1595
1595
|
(function() {
|
|
1596
|
-
var h = f, U = h.lib,
|
|
1597
|
-
ve.HMAC =
|
|
1596
|
+
var h = f, U = h.lib, E = U.Base, P = h.enc, K = P.Utf8, ve = h.algo;
|
|
1597
|
+
ve.HMAC = E.extend({
|
|
1598
1598
|
/**
|
|
1599
1599
|
* Initializes a newly created HMAC.
|
|
1600
1600
|
*
|
|
@@ -1685,7 +1685,7 @@ var va = {}, Qr = {
|
|
|
1685
1685
|
s.exports = h(ta());
|
|
1686
1686
|
})(st, function(f) {
|
|
1687
1687
|
return function() {
|
|
1688
|
-
var h = f, U = h.lib,
|
|
1688
|
+
var h = f, U = h.lib, E = U.WordArray, P = h.enc;
|
|
1689
1689
|
P.Base64 = {
|
|
1690
1690
|
/**
|
|
1691
1691
|
* Converts a word array to a Base64 string.
|
|
@@ -1704,8 +1704,8 @@ var va = {}, Qr = {
|
|
|
1704
1704
|
var Me = ve.words, be = ve.sigBytes, Se = this._map;
|
|
1705
1705
|
ve.clamp();
|
|
1706
1706
|
for (var Ee = [], Ie = 0; Ie < be; Ie += 3)
|
|
1707
|
-
for (var te = Me[Ie >>> 2] >>> 24 - Ie % 4 * 8 & 255, ie = Me[Ie + 1 >>> 2] >>> 24 - (Ie + 1) % 4 * 8 & 255, we = Me[Ie + 2 >>> 2] >>> 24 - (Ie + 2) % 4 * 8 & 255, Ue = te << 16 | ie << 8 | we,
|
|
1708
|
-
Ee.push(Se.charAt(Ue >>> 6 * (3 -
|
|
1707
|
+
for (var te = Me[Ie >>> 2] >>> 24 - Ie % 4 * 8 & 255, ie = Me[Ie + 1 >>> 2] >>> 24 - (Ie + 1) % 4 * 8 & 255, we = Me[Ie + 2 >>> 2] >>> 24 - (Ie + 2) % 4 * 8 & 255, Ue = te << 16 | ie << 8 | we, L = 0; L < 4 && Ie + L * 0.75 < be; L++)
|
|
1708
|
+
Ee.push(Se.charAt(Ue >>> 6 * (3 - L) & 63));
|
|
1709
1709
|
var he = Se.charAt(64);
|
|
1710
1710
|
if (he)
|
|
1711
1711
|
for (; Ee.length % 4; )
|
|
@@ -1747,7 +1747,7 @@ var va = {}, Qr = {
|
|
|
1747
1747
|
var te = be[ve.charCodeAt(Ie - 1)] << Ie % 4 * 2, ie = be[ve.charCodeAt(Ie)] >>> 6 - Ie % 4 * 2, we = te | ie;
|
|
1748
1748
|
Se[Ee >>> 2] |= we << 24 - Ee % 4 * 8, Ee++;
|
|
1749
1749
|
}
|
|
1750
|
-
return
|
|
1750
|
+
return E.create(Se, Ee);
|
|
1751
1751
|
}
|
|
1752
1752
|
}(), f.enc.Base64;
|
|
1753
1753
|
});
|
|
@@ -1755,9 +1755,9 @@ var va = {}, Qr = {
|
|
|
1755
1755
|
const Vr = va;
|
|
1756
1756
|
let Ct, Ht = "", Xt = "", ja = null;
|
|
1757
1757
|
function Wr() {
|
|
1758
|
-
var s = "wss://iat-api.xfyun.cn/v2/iat", t = "iat-api.xfyun.cn", f = "4f2bbe08d7ee54da888cfd009514e89f", h = "NTc3MWNlNDNiZWFmMGM2Yzk0ZjRlZjdi", U = new Date().toGMTString(),
|
|
1758
|
+
var s = "wss://iat-api.xfyun.cn/v2/iat", t = "iat-api.xfyun.cn", f = "4f2bbe08d7ee54da888cfd009514e89f", h = "NTc3MWNlNDNiZWFmMGM2Yzk0ZjRlZjdi", U = new Date().toGMTString(), E = "hmac-sha256", P = "host date request-line", K = `host: ${t}
|
|
1759
1759
|
date: ${U}
|
|
1760
|
-
GET /v2/iat HTTP/1.1`, ve = Pr(K, h), Me = Vr.stringify(ve), be = `api_key="${f}", algorithm="${
|
|
1760
|
+
GET /v2/iat HTTP/1.1`, ve = Pr(K, h), Me = Vr.stringify(ve), be = `api_key="${f}", algorithm="${E}", headers="${P}", signature="${Me}"`, Se = btoa(be);
|
|
1761
1761
|
return s = `${s}?authorization=${Se}&date=${U}&host=${t}`, s;
|
|
1762
1762
|
}
|
|
1763
1763
|
function Gr(s) {
|
|
@@ -1769,8 +1769,8 @@ function Zr(s) {
|
|
|
1769
1769
|
let t = JSON.parse(s);
|
|
1770
1770
|
if (t.data && t.data.result) {
|
|
1771
1771
|
let f = t.data.result, h = "", U = f.ws;
|
|
1772
|
-
for (let
|
|
1773
|
-
h = h + U[
|
|
1772
|
+
for (let E = 0; E < U.length; E++)
|
|
1773
|
+
h = h + U[E].cw[0].w;
|
|
1774
1774
|
f.pgs ? (f.pgs === "apd" && (Ht = Xt), Xt = Ht + h) : Ht = Ht + h, ja(Xt || Ht || "");
|
|
1775
1775
|
}
|
|
1776
1776
|
t.code === 0 && t.data.status === 2 && Ct.close(), t.code !== 0 && (Ct.close(), console.error(t));
|
|
@@ -1808,11 +1808,11 @@ function qr(s, t) {
|
|
|
1808
1808
|
f.readAsArrayBuffer(s), f.onload = (h) => {
|
|
1809
1809
|
console.log(h.target.result);
|
|
1810
1810
|
const U = Gr(h.target.result);
|
|
1811
|
-
let
|
|
1812
|
-
for (;
|
|
1813
|
-
const P = U.substring(
|
|
1814
|
-
|
|
1815
|
-
const K =
|
|
1811
|
+
let E = 0;
|
|
1812
|
+
for (; E < U.length; ) {
|
|
1813
|
+
const P = U.substring(E, E + 1280);
|
|
1814
|
+
E += 1280;
|
|
1815
|
+
const K = E >= U.length;
|
|
1816
1816
|
Ct.send(
|
|
1817
1817
|
JSON.stringify({
|
|
1818
1818
|
data: {
|
|
@@ -1845,15 +1845,15 @@ var _a = {}, Xr = {
|
|
|
1845
1845
|
var h = function() {
|
|
1846
1846
|
}, U = function(e) {
|
|
1847
1847
|
return typeof e == "number";
|
|
1848
|
-
},
|
|
1848
|
+
}, E = function(e) {
|
|
1849
1849
|
return new W(e);
|
|
1850
|
-
}, P =
|
|
1850
|
+
}, P = E.LM = "2023-12-24 18:09", K = "https://github.com/xiangyuecn/Recorder", ve = "Recorder", Me = "getUserMedia", be = "srcSampleRate", Se = "sampleRate", Ee = "bitRate", Ie = "catch", te = t[ve];
|
|
1851
1851
|
if (te && te.LM == P) {
|
|
1852
1852
|
te.CLog(te.i18n.$T("K8zP::重复导入{1}", 0, ve), 3);
|
|
1853
1853
|
return;
|
|
1854
1854
|
}
|
|
1855
|
-
|
|
1856
|
-
var e =
|
|
1855
|
+
E.IsOpen = function() {
|
|
1856
|
+
var e = E.Stream;
|
|
1857
1857
|
if (e) {
|
|
1858
1858
|
var l = e.getTracks && e.getTracks() || e.audioTracks || [], m = l[0];
|
|
1859
1859
|
if (m) {
|
|
@@ -1862,44 +1862,44 @@ var _a = {}, Xr = {
|
|
|
1862
1862
|
}
|
|
1863
1863
|
}
|
|
1864
1864
|
return !1;
|
|
1865
|
-
},
|
|
1865
|
+
}, E.BufferSize = 4096, E.Destroy = function() {
|
|
1866
1866
|
He(ve + " Destroy"), $e();
|
|
1867
1867
|
for (var e in ie)
|
|
1868
1868
|
ie[e]();
|
|
1869
1869
|
};
|
|
1870
1870
|
var ie = {};
|
|
1871
|
-
|
|
1871
|
+
E.BindDestroy = function(e, l) {
|
|
1872
1872
|
ie[e] = l;
|
|
1873
|
-
},
|
|
1873
|
+
}, E.Support = function() {
|
|
1874
1874
|
if (!f)
|
|
1875
1875
|
return !1;
|
|
1876
1876
|
var e = navigator.mediaDevices || {};
|
|
1877
|
-
return e[Me] || (e = navigator, e[Me] || (e[Me] = e.webkitGetUserMedia || e.mozGetUserMedia || e.msGetUserMedia)), !(!e[Me] || (
|
|
1878
|
-
},
|
|
1877
|
+
return e[Me] || (e = navigator, e[Me] || (e[Me] = e.webkitGetUserMedia || e.mozGetUserMedia || e.msGetUserMedia)), !(!e[Me] || (E.Scope = e, !E.GetContext()));
|
|
1878
|
+
}, E.GetContext = function(e) {
|
|
1879
1879
|
if (!f)
|
|
1880
1880
|
return null;
|
|
1881
1881
|
var l = window.AudioContext;
|
|
1882
1882
|
if (l || (l = window.webkitAudioContext), !l)
|
|
1883
1883
|
return null;
|
|
1884
|
-
var m =
|
|
1885
|
-
if ((!m || m.state == "closed") && (m =
|
|
1886
|
-
var M =
|
|
1887
|
-
M && M.close && (M.close(),
|
|
1888
|
-
var S =
|
|
1889
|
-
|
|
1884
|
+
var m = E.Ctx;
|
|
1885
|
+
if ((!m || m.state == "closed") && (m = E.Ctx = new l(), E.NewCtxs = E.NewCtxs || [], E.BindDestroy("Ctx", function() {
|
|
1886
|
+
var M = E.Ctx;
|
|
1887
|
+
M && M.close && (M.close(), E.Ctx = 0);
|
|
1888
|
+
var S = E.NewCtxs;
|
|
1889
|
+
E.NewCtxs = [];
|
|
1890
1890
|
for (var $ = 0; $ < S.length; $++)
|
|
1891
1891
|
S[$].close();
|
|
1892
1892
|
})), e && m.close)
|
|
1893
1893
|
try {
|
|
1894
|
-
m = new l(),
|
|
1894
|
+
m = new l(), E.NewCtxs.push(m);
|
|
1895
1895
|
} catch (M) {
|
|
1896
1896
|
He("GetContext tryNew Error", 1, M);
|
|
1897
1897
|
}
|
|
1898
1898
|
return m;
|
|
1899
|
-
},
|
|
1900
|
-
if (e && e !=
|
|
1899
|
+
}, E.CloseNewCtx = function(e) {
|
|
1900
|
+
if (e && e != E.Ctx) {
|
|
1901
1901
|
e.close && e.close();
|
|
1902
|
-
for (var l =
|
|
1902
|
+
for (var l = E.NewCtxs || [], m = l.length, M = 0; M < l.length; M++)
|
|
1903
1903
|
if (l[M] == e) {
|
|
1904
1904
|
l.splice(M, 1);
|
|
1905
1905
|
break;
|
|
@@ -1911,11 +1911,11 @@ var _a = {}, Xr = {
|
|
|
1911
1911
|
var l = e.state, m = "ctx.state=" + l;
|
|
1912
1912
|
return l == "suspended" && (m += je("nMIy::(注意:ctx不是running状态,rec.open和start至少要有一个在用户操作(触摸、点击等)时进行调用,否则将在rec.start时尝试进行ctx.resume,可能会产生兼容性问题(仅iOS),请参阅文档中runningContext配置)")), m;
|
|
1913
1913
|
}, Ue = "ConnectEnableWebM";
|
|
1914
|
-
|
|
1915
|
-
var
|
|
1916
|
-
|
|
1914
|
+
E[Ue] = !0;
|
|
1915
|
+
var L = "ConnectEnableWorklet";
|
|
1916
|
+
E[L] = !1;
|
|
1917
1917
|
var he = function(e, l) {
|
|
1918
|
-
var m = e.BufferSize ||
|
|
1918
|
+
var m = e.BufferSize || E.BufferSize, M = e.Stream, S = M._RC || M._c || E.GetContext(!0);
|
|
1919
1919
|
M._c = S;
|
|
1920
1920
|
var $ = function(V) {
|
|
1921
1921
|
var T = M._m = S.createMediaStreamSource(M), ce = S.destination, g = "createMediaStreamDestination";
|
|
@@ -1932,8 +1932,8 @@ var _a = {}, Xr = {
|
|
|
1932
1932
|
}
|
|
1933
1933
|
}, le = "ScriptProcessor", fe = "audioWorklet", Ae = ve + " " + fe, ue = "RecProc", X = "MediaRecorder", pe = X + ".WebM.PCM", De = S.createScriptProcessor || S.createJavaScriptNode, Q = je("ZGlf::。由于{1}内部1秒375次回调,在移动端可能会有性能问题导致回调丢失录音变短,PC端无影响,暂不建议开启{1}。", 0, fe), ne = function() {
|
|
1934
1934
|
o = M.isWorklet = !1, Fe(M), He(je("7TU0::Connect采用老的{1},", 0, le) + ct.get(
|
|
1935
|
-
|
|
1936
|
-
[ve + "." +
|
|
1935
|
+
E[L] ? je("JwCL::但已设置{1}尝试启用{2}", 2) : je("VGjB::可设置{1}尝试启用{2}", 2),
|
|
1936
|
+
[ve + "." + L + "=true", fe]
|
|
1937
1937
|
) + se + Q, 3);
|
|
1938
1938
|
var V = M._p = De.call(S, m, 1, 1);
|
|
1939
1939
|
$(V), V.onaudioprocess = function(T) {
|
|
@@ -1941,7 +1941,7 @@ var _a = {}, Xr = {
|
|
|
1941
1941
|
xe(ce);
|
|
1942
1942
|
};
|
|
1943
1943
|
}, d = function() {
|
|
1944
|
-
N = M.isWebM = !1, Qe(M), o = M.isWorklet = !De ||
|
|
1944
|
+
N = M.isWebM = !1, Qe(M), o = M.isWorklet = !De || E[L];
|
|
1945
1945
|
var V = window.AudioWorkletNode;
|
|
1946
1946
|
if (!(o && S[fe] && V)) {
|
|
1947
1947
|
ne();
|
|
@@ -1984,7 +1984,7 @@ var _a = {}, Xr = {
|
|
|
1984
1984
|
});
|
|
1985
1985
|
$(oe), oe.port.onmessage = function(z) {
|
|
1986
1986
|
ee && (clearTimeout(ee), ee = ""), ce() ? xe(z.data.val) : o || He(je("XUap::{1}多余回调", 0, fe), 3);
|
|
1987
|
-
}, He(je("yOta::Connect采用{1},设置{2}可恢复老式{3}", 0, fe, ve + "." +
|
|
1987
|
+
}, He(je("yOta::Connect采用{1},设置{2}可恢复老式{3}", 0, fe, ve + "." + L + "=false", le) + se + Q, 3);
|
|
1988
1988
|
}
|
|
1989
1989
|
};
|
|
1990
1990
|
S.resume()[ye && "finally"](function() {
|
|
@@ -2003,7 +2003,7 @@ var _a = {}, Xr = {
|
|
|
2003
2003
|
});
|
|
2004
2004
|
}, D = function() {
|
|
2005
2005
|
var V = window[X], T = "ondataavailable", ce = "audio/webm; codecs=pcm";
|
|
2006
|
-
N = M.isWebM =
|
|
2006
|
+
N = M.isWebM = E[Ue];
|
|
2007
2007
|
var g = V && T in V.prototype && V.isTypeSupported(ce);
|
|
2008
2008
|
if (se = g ? "" : je("VwPd::(此浏览器不支持{1})", 0, pe), !l || !N || !g) {
|
|
2009
2009
|
d();
|
|
@@ -2017,7 +2017,7 @@ var _a = {}, Xr = {
|
|
|
2017
2017
|
H() && (He(je("vHnb::{1}未返回任何音频,降级使用{2}", 0, X, fe), 3), d());
|
|
2018
2018
|
}, 500));
|
|
2019
2019
|
};
|
|
2020
|
-
var oe = Object.assign({ mimeType: ce },
|
|
2020
|
+
var oe = Object.assign({ mimeType: ce }, E.ConnectWebMOptions), z = M._r = new V(M, oe), re = M._rd = { sampleRate: S[Se] };
|
|
2021
2021
|
z[T] = function(k) {
|
|
2022
2022
|
var _e = new FileReader();
|
|
2023
2023
|
_e.onloadend = function() {
|
|
@@ -2043,23 +2043,23 @@ var _a = {}, Xr = {
|
|
|
2043
2043
|
}, Qe = function(e) {
|
|
2044
2044
|
e._ra = null, e._r && (e._r.stop(), e._r = null);
|
|
2045
2045
|
}, $e = function(e) {
|
|
2046
|
-
e = e ||
|
|
2047
|
-
var l = e ==
|
|
2048
|
-
m && (m._m && (m._m.disconnect(), m._m = null), !m._RC && m._c &&
|
|
2049
|
-
}, Ge =
|
|
2046
|
+
e = e || E;
|
|
2047
|
+
var l = e == E, m = e.Stream;
|
|
2048
|
+
m && (m._m && (m._m.disconnect(), m._m = null), !m._RC && m._c && E.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;
|
|
2049
|
+
}, Ge = E.StopS_ = function(e) {
|
|
2050
2050
|
for (var l = e.getTracks && e.getTracks() || e.audioTracks || [], m = 0; m < l.length; m++) {
|
|
2051
2051
|
var M = l[m];
|
|
2052
2052
|
M.stop && M.stop();
|
|
2053
2053
|
}
|
|
2054
2054
|
e.stop && e.stop();
|
|
2055
2055
|
};
|
|
2056
|
-
|
|
2056
|
+
E.SampleData = function(e, l, m, M, S) {
|
|
2057
2057
|
var $ = "SampleData";
|
|
2058
2058
|
M || (M = {});
|
|
2059
2059
|
var N = M.index || 0, o = M.offset || 0, ee = M.filter;
|
|
2060
2060
|
if (ee && ee.fn && ee.sr != l && (ee = null, He(je("d48C::{1}的filter采样率变了,重设滤波", 0, $), 3)), !ee) {
|
|
2061
2061
|
var se = m > l * 3 / 4 ? 0 : m / 2 * 3 / 4;
|
|
2062
|
-
ee = { fn: se ?
|
|
2062
|
+
ee = { fn: se ? E.IIRFilter(!0, l, se) : 0 };
|
|
2063
2063
|
}
|
|
2064
2064
|
ee.sr = l;
|
|
2065
2065
|
var ye = ee.fn, xe = M.frameNext || [];
|
|
@@ -2103,7 +2103,7 @@ var _a = {}, Xr = {
|
|
|
2103
2103
|
sampleRate: m,
|
|
2104
2104
|
data: pe
|
|
2105
2105
|
};
|
|
2106
|
-
},
|
|
2106
|
+
}, E.IIRFilter = function(e, l, m) {
|
|
2107
2107
|
var M = 2 * Math.PI * m / l, S = Math.sin(M), $ = Math.cos(M), N = S / 2, o = 1 + N, ee = -2 * $ / o, se = (1 - N) / o;
|
|
2108
2108
|
if (e)
|
|
2109
2109
|
var ye = (1 - $) / 2 / o, xe = (1 - $) / o;
|
|
@@ -2113,22 +2113,22 @@ var _a = {}, Xr = {
|
|
|
2113
2113
|
return Ae = ye * De + xe * le + ye * fe - ee * ue - se * X, fe = le, le = De, X = ue, ue = Ae, Ae;
|
|
2114
2114
|
};
|
|
2115
2115
|
return pe.Embed = { x1: 0, x2: 0, y1: 0, y2: 0, b0: ye, b1: xe, a1: ee, a2: se }, pe;
|
|
2116
|
-
},
|
|
2116
|
+
}, E.PowerLevel = function(e, l) {
|
|
2117
2117
|
var m = e / l || 0, M;
|
|
2118
2118
|
return m < 1251 ? M = Math.round(m / 1250 * 10) : M = Math.round(Math.min(100, Math.max(0, (1 + Math.log(m / 1e4) / Math.log(10)) * 100))), M;
|
|
2119
|
-
},
|
|
2119
|
+
}, E.PowerDBFS = function(e) {
|
|
2120
2120
|
var l = Math.max(0.1, e || 0), m = 32767;
|
|
2121
2121
|
return l = Math.min(l, m), l = 20 * Math.log(l / m) / Math.log(10), Math.max(-100, Math.round(l));
|
|
2122
|
-
},
|
|
2122
|
+
}, E.CLog = function(e, l) {
|
|
2123
2123
|
if (typeof console == "object") {
|
|
2124
|
-
var m = new Date(), M = ("0" + m.getMinutes()).substr(-2) + ":" + ("0" + m.getSeconds()).substr(-2) + "." + ("00" + m.getMilliseconds()).substr(-3), S = this && this.envIn && this.envCheck && this.id, $ = ["[" + M + " " + ve + (S ? ":" + S : "") + "]" + e], N = arguments, o =
|
|
2124
|
+
var m = new Date(), M = ("0" + m.getMinutes()).substr(-2) + ":" + ("0" + m.getSeconds()).substr(-2) + "." + ("00" + m.getMilliseconds()).substr(-3), S = this && this.envIn && this.envCheck && this.id, $ = ["[" + M + " " + ve + (S ? ":" + S : "") + "]" + e], N = arguments, o = E.CLog, ee = 2, se = o.log || console.log;
|
|
2125
2125
|
for (U(l) ? se = l == 1 ? o.error || console.error : l == 3 ? o.warn || console.warn : se : ee = 1; ee < N.length; ee++)
|
|
2126
2126
|
$.push(N[ee]);
|
|
2127
2127
|
Xe ? se && se("[IsLoser]" + $[0], $.length > 1 ? $ : "") : se.apply(console, $);
|
|
2128
2128
|
}
|
|
2129
2129
|
};
|
|
2130
2130
|
var He = function() {
|
|
2131
|
-
|
|
2131
|
+
E.CLog.apply(this, arguments);
|
|
2132
2132
|
}, Xe = !0;
|
|
2133
2133
|
try {
|
|
2134
2134
|
Xe = !console.log.apply;
|
|
@@ -2137,7 +2137,7 @@ var _a = {}, Xr = {
|
|
|
2137
2137
|
var Be = 0;
|
|
2138
2138
|
function W(e) {
|
|
2139
2139
|
var l = this;
|
|
2140
|
-
l.id = ++Be,
|
|
2140
|
+
l.id = ++Be, R();
|
|
2141
2141
|
var m = {
|
|
2142
2142
|
type: "mp3",
|
|
2143
2143
|
onProcess: h
|
|
@@ -2166,15 +2166,15 @@ var _a = {}, Xr = {
|
|
|
2166
2166
|
var S = m[Ee], $ = m[Se];
|
|
2167
2167
|
(S && !U(S) || $ && !U($)) && l.CLog(je.G("IllegalArgs-1", [je("VtS4::{1}和{2}必须是数值", 0, Se, Ee)]), 1, e), m[Ee] = +S || 16, m[Se] = +$ || 16e3, l.state = 0, l._S = 9, l.Sync = { O: 9, C: 9 };
|
|
2168
2168
|
}
|
|
2169
|
-
|
|
2169
|
+
E.Sync = {
|
|
2170
2170
|
/*open*/
|
|
2171
2171
|
O: 9,
|
|
2172
2172
|
/*close*/
|
|
2173
2173
|
C: 9
|
|
2174
|
-
},
|
|
2174
|
+
}, E.prototype = W.prototype = {
|
|
2175
2175
|
CLog: He,
|
|
2176
2176
|
_streamStore: function() {
|
|
2177
|
-
return this.set.sourceStream ? this :
|
|
2177
|
+
return this.set.sourceStream ? this : E;
|
|
2178
2178
|
},
|
|
2179
2179
|
_streamCtx: function() {
|
|
2180
2180
|
var e = this._streamStore().Stream;
|
|
@@ -2184,7 +2184,7 @@ var _a = {}, Xr = {
|
|
|
2184
2184
|
var m = this, M = m.set, S = m._streamStore(), $ = 0;
|
|
2185
2185
|
e = e || h;
|
|
2186
2186
|
var N = function(d, D) {
|
|
2187
|
-
D = !!D, m.CLog(je("5tWi::录音open失败:") + d + ",isUserNotAllow:" + D, 1), $ &&
|
|
2187
|
+
D = !!D, m.CLog(je("5tWi::录音open失败:") + d + ",isUserNotAllow:" + D, 1), $ && E.CloseNewCtx($), l && l(d, D);
|
|
2188
2188
|
};
|
|
2189
2189
|
m._streamTag = Me;
|
|
2190
2190
|
var o = function() {
|
|
@@ -2207,7 +2207,7 @@ var _a = {}, Xr = {
|
|
|
2207
2207
|
return;
|
|
2208
2208
|
}
|
|
2209
2209
|
if (M.sourceStream) {
|
|
2210
|
-
if (m._streamTag = "set.sourceStream", !
|
|
2210
|
+
if (m._streamTag = "set.sourceStream", !E.GetContext()) {
|
|
2211
2211
|
N(je("1iU7::不支持此浏览器从流中获取录音"));
|
|
2212
2212
|
return;
|
|
2213
2213
|
}
|
|
@@ -2232,21 +2232,21 @@ var _a = {}, Xr = {
|
|
|
2232
2232
|
}
|
|
2233
2233
|
/Permission|Allow/i.test(d) ? N(je("gyO5::用户拒绝了录音权限"), !0) : window.isSecureContext === !1 ? N(je("oWNo::浏览器禁止不安全页面录音,可开启https解决")) : /Found/i.test(d) ? N(D + je("jBa9::,无可用麦克风")) : N(D);
|
|
2234
2234
|
};
|
|
2235
|
-
if (
|
|
2235
|
+
if (E.IsOpen()) {
|
|
2236
2236
|
o();
|
|
2237
2237
|
return;
|
|
2238
2238
|
}
|
|
2239
|
-
if (!
|
|
2239
|
+
if (!E.Support()) {
|
|
2240
2240
|
Ae("", je("COxc::此浏览器不支持录音"));
|
|
2241
2241
|
return;
|
|
2242
2242
|
}
|
|
2243
2243
|
var ue = M.runningContext;
|
|
2244
|
-
ue || (ue = $ =
|
|
2244
|
+
ue || (ue = $ = E.GetContext(!0));
|
|
2245
2245
|
var X = function(d) {
|
|
2246
2246
|
setTimeout(function() {
|
|
2247
2247
|
d._call = {};
|
|
2248
|
-
var D =
|
|
2249
|
-
D && ($e(), d._call = D._call),
|
|
2248
|
+
var D = E.Stream;
|
|
2249
|
+
D && ($e(), d._call = D._call), E.Stream = d, d._c = ue, d._RC = M.runningContext, !xe() && (E.IsOpen() ? (D && m.CLog(je("upb8::发现同时多次调用open"), 1), he(S, 1), o()) : N(je("Q1GA::录音功能无效:无音频流")));
|
|
2250
2250
|
}, 100);
|
|
2251
2251
|
}, pe = function(d) {
|
|
2252
2252
|
var D = d.name || d.message || d.code + ":" + d;
|
|
@@ -2255,9 +2255,9 @@ var _a = {}, Xr = {
|
|
|
2255
2255
|
De[Se] = ue[Se];
|
|
2256
2256
|
var Q = { audio: De };
|
|
2257
2257
|
try {
|
|
2258
|
-
var ne =
|
|
2258
|
+
var ne = E.Scope[Me](Q, X, pe);
|
|
2259
2259
|
} catch (d) {
|
|
2260
|
-
m.CLog(Me, 3, d), Q = { audio: !0 }, ne =
|
|
2260
|
+
m.CLog(Me, 3, d), Q = { audio: !0 }, ne = E.Scope[Me](Q, X, pe);
|
|
2261
2261
|
}
|
|
2262
2262
|
m.CLog(Me + "(" + JSON.stringify(Q) + ") " + we(ue) + je("RiWe::,未配置noiseSuppression和echoCancellation时浏览器可能会自动打开降噪和回声消除,移动端可能会降低系统播放音量(关闭录音后可恢复),请参阅文档中audioTrackSet配置") + "(" + K + ") LM:" + P + " UA:" + navigator.userAgent), ne && ne.then && ne.then(X)[Ie](pe);
|
|
2263
2263
|
},
|
|
@@ -2282,7 +2282,7 @@ var _a = {}, Xr = {
|
|
|
2282
2282
|
},
|
|
2283
2283
|
envCheck: function(e) {
|
|
2284
2284
|
var l, m = this, M = m.set, S = "CPU_BE";
|
|
2285
|
-
if (!l && !
|
|
2285
|
+
if (!l && !E[S] && typeof Int8Array == "function" && !new Int8Array(new Int32Array([1]).buffer)[0] && (R(S), l = je("Essp::不支持{1}架构", 0, S)), !l) {
|
|
2286
2286
|
var $ = M.type, N = m[$ + "_envCheck"];
|
|
2287
2287
|
M.takeoffEncodeChunk && (N ? e.canProcess || (l = je("7uMV::{1}环境不支持实时处理", 0, e.envName)) : l = je("2XBl::{1}类型不支持设置takeoffEncodeChunk", 0, $) + (m[$] ? "" : je("LG7e::(未加载编码器)"))), !l && N && (l = m[$ + "_envCheck"](e, M));
|
|
2288
2288
|
}
|
|
@@ -2304,7 +2304,7 @@ var _a = {}, Xr = {
|
|
|
2304
2304
|
m.state || m.CLog("envIn at state=0", 3);
|
|
2305
2305
|
return;
|
|
2306
2306
|
}
|
|
2307
|
-
var $ = m[be], N = e.length, o =
|
|
2307
|
+
var $ = m[be], N = e.length, o = E.PowerLevel(l, N), ee = m.buffers, se = ee.length;
|
|
2308
2308
|
ee.push(e);
|
|
2309
2309
|
var ye = ee, xe = se, le = Date.now(), fe = Math.round(N / $ * 1e3);
|
|
2310
2310
|
m.envInLast = le, m.buffers.length == 1 && (m.envInFirst = le - fe);
|
|
@@ -2331,7 +2331,7 @@ var _a = {}, Xr = {
|
|
|
2331
2331
|
}
|
|
2332
2332
|
var ce = m.recSize, g = N, H = ce + g;
|
|
2333
2333
|
if (m.recSize = H, S) {
|
|
2334
|
-
var oe =
|
|
2334
|
+
var oe = E.SampleData(ee, $, M[Se], S.chunkInfo);
|
|
2335
2335
|
S.chunkInfo = oe, ce = S.pcmSize, g = oe.data.length, H = ce + g, S.pcmSize = H, ee = S.pcmDatas, se = ee.length, ee.push(oe.data), $ = oe[Se];
|
|
2336
2336
|
}
|
|
2337
2337
|
var z = Math.round(H / $ * 1e3), re = ee.length, k = ye.length, _e = function() {
|
|
@@ -2361,7 +2361,7 @@ var _a = {}, Xr = {
|
|
|
2361
2361
|
},
|
|
2362
2362
|
start: function() {
|
|
2363
2363
|
var e = this, l = 1;
|
|
2364
|
-
if (e.set.sourceStream ? e.Stream || (l = 0) :
|
|
2364
|
+
if (e.set.sourceStream ? e.Stream || (l = 0) : E.IsOpen() || (l = 0), !l) {
|
|
2365
2365
|
e.CLog(je("6WmN::start失败:未open"), 1);
|
|
2366
2366
|
return;
|
|
2367
2367
|
}
|
|
@@ -2406,7 +2406,7 @@ var _a = {}, Xr = {
|
|
|
2406
2406
|
}, se = function(De) {
|
|
2407
2407
|
M.CLog(je("u8JG::结束录音失败:") + De, 1), l && l(De), ee();
|
|
2408
2408
|
}, ye = function(De, Q, ne) {
|
|
2409
|
-
var d = "blob", D = "arraybuffer", V = "dataType", T = "DefaultDataType", ce = M[V] ||
|
|
2409
|
+
var d = "blob", D = "arraybuffer", V = "dataType", T = "DefaultDataType", ce = M[V] || E[T] || d, g = V + "=" + ce, H = De instanceof ArrayBuffer, oe = 0, z = H ? De.byteLength : De.size;
|
|
2410
2410
|
if (ce == D ? H || (oe = 1) : ce == d ? typeof Blob != "function" ? oe = je.G("NonBrowser-1", [g]) + je("1skY::,请设置{1}", 0, ve + "." + T + '="' + D + '"') : (H && (De = new Blob([De], { type: Q })), De instanceof Blob || (oe = 1), Q = De.type || Q) : oe = je.G("NotSupport-1", [g]), M.CLog(je("Wv7l::结束录音 编码花{1}ms 音频时长{2}ms 文件大小{3}b", 0, Date.now() - $, ne, z) + " " + g + "," + Q), oe) {
|
|
2411
2411
|
se(oe != 1 ? oe : je("Vkbd::{1}编码器返回的不是{2}", 0, S.type, ce) + ", " + g);
|
|
2412
2412
|
return;
|
|
@@ -2455,7 +2455,7 @@ var _a = {}, Xr = {
|
|
|
2455
2455
|
se(je("xkKd::音频buffers被释放"));
|
|
2456
2456
|
return;
|
|
2457
2457
|
}
|
|
2458
|
-
var ue =
|
|
2458
|
+
var ue = E.SampleData(M.buffers, M[be], S[Se]);
|
|
2459
2459
|
S[Se] = ue[Se];
|
|
2460
2460
|
var X = ue.data, pe = Math.round(X.length / S[Se] * 1e3);
|
|
2461
2461
|
M.CLog(je("CxeT::采样:{1} 花:{2}ms", 0, le + "->" + X.length, Date.now() - $)), setTimeout(function() {
|
|
@@ -2585,7 +2585,7 @@ var _a = {}, Xr = {
|
|
|
2585
2585
|
}
|
|
2586
2586
|
return l[0] = S, $;
|
|
2587
2587
|
}
|
|
2588
|
-
}, ct =
|
|
2588
|
+
}, ct = E.i18n = {
|
|
2589
2589
|
lang: "zh-CN",
|
|
2590
2590
|
alias: { "zh-CN": "zh", "en-US": "en" },
|
|
2591
2591
|
locales: {},
|
|
@@ -2651,22 +2651,22 @@ var _a = {}, Xr = {
|
|
|
2651
2651
|
return l ? M > 0 ? l : ct.v_G(l, m) : "";
|
|
2652
2652
|
}
|
|
2653
2653
|
}, je = ct.$T;
|
|
2654
|
-
je.G = ct.get, je("NonBrowser-1::非浏览器环境,不支持{1}", 1), je("IllegalArgs-1::参数错误:{1}", 1), je("NeedImport-2::调用{1}需要先导入{2}", 2), je("NotSupport-1::不支持:{1}", 1),
|
|
2655
|
-
var
|
|
2654
|
+
je.G = ct.get, je("NonBrowser-1::非浏览器环境,不支持{1}", 1), je("IllegalArgs-1::参数错误:{1}", 1), je("NeedImport-2::调用{1}需要先导入{2}", 2), je("NotSupport-1::不支持:{1}", 1), E.TrafficImgUrl = "//ia.51.la/go1?id=20469973&pvFlag=1";
|
|
2655
|
+
var R = E.Traffic = function(e) {
|
|
2656
2656
|
if (f) {
|
|
2657
2657
|
e = e ? "/" + ve + "/Report/" + e : "";
|
|
2658
|
-
var l =
|
|
2658
|
+
var l = E.TrafficImgUrl;
|
|
2659
2659
|
if (l) {
|
|
2660
|
-
var m =
|
|
2660
|
+
var m = E.Traffic, M = /^(https?:..[^\/#]*\/?)[^#]*/i.exec(location.href) || [], S = M[1] || "http://file/", $ = (M[0] || S) + e;
|
|
2661
2661
|
if (l.indexOf("//") == 0 && (/^https:/i.test($) ? l = "https:" + l : l = "http:" + l), e && (l = l + "&cu=" + encodeURIComponent(S + e)), !m[$]) {
|
|
2662
2662
|
m[$] = 1;
|
|
2663
2663
|
var N = new Image();
|
|
2664
|
-
N.src = l, He("Traffic Analysis Image: " + (e || ve + ".TrafficImgUrl=" +
|
|
2664
|
+
N.src = l, He("Traffic Analysis Image: " + (e || ve + ".TrafficImgUrl=" + E.TrafficImgUrl));
|
|
2665
2665
|
}
|
|
2666
2666
|
}
|
|
2667
2667
|
}
|
|
2668
2668
|
};
|
|
2669
|
-
te && (He(je("8HO5::覆盖导入{1}", 0, ve), 1), te.Destroy()), t[ve] =
|
|
2669
|
+
te && (He(je("8HO5::覆盖导入{1}", 0, ve), 1), te.Destroy()), t[ve] = E;
|
|
2670
2670
|
});
|
|
2671
2671
|
})(Xr);
|
|
2672
2672
|
const ua = _a;
|
|
@@ -2674,19 +2674,19 @@ const ua = _a;
|
|
|
2674
2674
|
var t = typeof window == "object" && !!window.document, f = t ? window : Object, h = f.Recorder, U = h.i18n;
|
|
2675
2675
|
s(h, U, U.$T, t);
|
|
2676
2676
|
})(function(s, t, f, h) {
|
|
2677
|
-
var U = "48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000",
|
|
2677
|
+
var U = "48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000", E = "8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 192, 224, 256, 320";
|
|
2678
2678
|
s.prototype.enc_mp3 = {
|
|
2679
2679
|
stable: !0,
|
|
2680
2680
|
takeEC: "full",
|
|
2681
2681
|
getTestMsg: function() {
|
|
2682
|
-
return f("Zm7L::采样率范围:{1};比特率范围:{2}(不同比特率支持的采样率范围不同,小于32kbps时采样率需小于32000)", 0, U,
|
|
2682
|
+
return f("Zm7L::采样率范围:{1};比特率范围:{2}(不同比特率支持的采样率范围不同,小于32kbps时采样率需小于32000)", 0, U, E);
|
|
2683
2683
|
}
|
|
2684
2684
|
};
|
|
2685
2685
|
var P = function(te) {
|
|
2686
2686
|
var ie = te.bitRate, we = te.sampleRate, Ue = we;
|
|
2687
|
-
if ((" " +
|
|
2688
|
-
for (var
|
|
2689
|
-
he.push({ v: +
|
|
2687
|
+
if ((" " + E + ",").indexOf(" " + ie + ",") == -1 && s.CLog(f("eGB9::{1}不在mp3支持的取值范围:{2}", 0, "bitRate=" + ie, E), 3), (" " + U + ",").indexOf(" " + we + ",") == -1) {
|
|
2688
|
+
for (var L = U.split(", "), he = [], Te = 0; Te < L.length; Te++)
|
|
2689
|
+
he.push({ v: +L[Te], s: Math.abs(L[Te] - we) });
|
|
2690
2690
|
he.sort(function(Fe, Qe) {
|
|
2691
2691
|
return Fe.s - Qe.s;
|
|
2692
2692
|
}), Ue = he[0].v, te.sampleRate = Ue, s.CLog(f("zLTa::sampleRate已更新为{1},因为{2}不在mp3支持的取值范围:{3}", 0, Ue, we, U), 3);
|
|
@@ -2695,13 +2695,13 @@ const ua = _a;
|
|
|
2695
2695
|
return f.G("NeedImport-2", ["mp3.js", "src/engine/mp3-engine.js"]);
|
|
2696
2696
|
}, ve = h && typeof Worker == "function";
|
|
2697
2697
|
s.prototype.mp3 = function(te, ie, we) {
|
|
2698
|
-
var Ue = this,
|
|
2698
|
+
var Ue = this, L = Ue.set, he = te.length;
|
|
2699
2699
|
if (!s.lamejs) {
|
|
2700
2700
|
we(K());
|
|
2701
2701
|
return;
|
|
2702
2702
|
}
|
|
2703
2703
|
if (ve) {
|
|
2704
|
-
var Te = Ue.mp3_start(
|
|
2704
|
+
var Te = Ue.mp3_start(L);
|
|
2705
2705
|
if (Te) {
|
|
2706
2706
|
if (Te.isW) {
|
|
2707
2707
|
Ue.mp3_encode(Te, te), Ue.mp3_complete(Te, ie, we, 1);
|
|
@@ -2710,8 +2710,8 @@ const ua = _a;
|
|
|
2710
2710
|
Ue.mp3_stop(Te);
|
|
2711
2711
|
}
|
|
2712
2712
|
}
|
|
2713
|
-
P(
|
|
2714
|
-
var Fe = new s.lamejs.Mp3Encoder(1,
|
|
2713
|
+
P(L);
|
|
2714
|
+
var Fe = new s.lamejs.Mp3Encoder(1, L.sampleRate, L.bitRate), Qe = 57600, $e = new Int8Array(5e5), Ge = 0, He = 0, Xe = function() {
|
|
2715
2715
|
try {
|
|
2716
2716
|
if (He < he)
|
|
2717
2717
|
var Be = Fe.encodeBuffer(te.subarray(He, He + Qe));
|
|
@@ -2732,8 +2732,8 @@ const ua = _a;
|
|
|
2732
2732
|
if (He < he)
|
|
2733
2733
|
He += Qe, setTimeout(Xe);
|
|
2734
2734
|
else {
|
|
2735
|
-
var at = [$e.buffer.slice(0, Ge)], et = Ee.fn(at, Ge, he,
|
|
2736
|
-
Ie(et,
|
|
2735
|
+
var at = [$e.buffer.slice(0, Ge)], et = Ee.fn(at, Ge, he, L.sampleRate);
|
|
2736
|
+
Ie(et, L), ie(at[0] || new ArrayBuffer(0), "audio/mp3");
|
|
2737
2737
|
}
|
|
2738
2738
|
};
|
|
2739
2739
|
Xe();
|
|
@@ -2762,13 +2762,13 @@ const ua = _a;
|
|
|
2762
2762
|
};
|
|
2763
2763
|
else if (!et)
|
|
2764
2764
|
return;
|
|
2765
|
-
var vt = function(
|
|
2766
|
-
var e =
|
|
2765
|
+
var vt = function(R) {
|
|
2766
|
+
var e = R.length;
|
|
2767
2767
|
if (et.mOffset + e > et.memory.length) {
|
|
2768
2768
|
var l = new Int8Array(et.memory.length + Math.max(5e5, e));
|
|
2769
2769
|
l.set(et.memory.subarray(0, et.mOffset)), et.memory = l;
|
|
2770
2770
|
}
|
|
2771
|
-
et.memory.set(
|
|
2771
|
+
et.memory.set(R, et.mOffset), et.mOffset += e;
|
|
2772
2772
|
};
|
|
2773
2773
|
switch (Be.action) {
|
|
2774
2774
|
case "stop":
|
|
@@ -2778,16 +2778,16 @@ const ua = _a;
|
|
|
2778
2778
|
et.pcmSize += Be.pcm.length;
|
|
2779
2779
|
try {
|
|
2780
2780
|
var _t = et.encObj.encodeBuffer(Be.pcm);
|
|
2781
|
-
} catch (
|
|
2782
|
-
et.err =
|
|
2781
|
+
} catch (R) {
|
|
2782
|
+
et.err = R, console.error(R);
|
|
2783
2783
|
}
|
|
2784
2784
|
_t && _t.length > 0 && (et.takeoff ? Te.onmessage({ action: "takeoff", id: Be.id, chunk: _t }) : vt(_t));
|
|
2785
2785
|
break;
|
|
2786
2786
|
case "complete":
|
|
2787
2787
|
try {
|
|
2788
2788
|
var _t = et.encObj.flush();
|
|
2789
|
-
} catch (
|
|
2790
|
-
et.err =
|
|
2789
|
+
} catch (R) {
|
|
2790
|
+
et.err = R, console.error(R);
|
|
2791
2791
|
}
|
|
2792
2792
|
if (_t && _t.length > 0 && (et.takeoff ? Te.onmessage({ action: "takeoff", id: Be.id, chunk: _t }) : vt(_t)), et.err) {
|
|
2793
2793
|
Te.onmessage({
|
|
@@ -2813,7 +2813,7 @@ const ua = _a;
|
|
|
2813
2813
|
var pt = be[W.id];
|
|
2814
2814
|
pt && (W.action == "takeoff" ? pt.set.takeoffEncodeChunk(new Uint8Array(W.chunk.buffer)) : (pt.call && pt.call(W), pt.call = null));
|
|
2815
2815
|
};
|
|
2816
|
-
},
|
|
2816
|
+
}, L = function() {
|
|
2817
2817
|
var Xe = { worker: Te, set: te };
|
|
2818
2818
|
return te ? (Xe.id = ++be.id, be[Xe.id] = Xe, P(te), Te.postMessage({
|
|
2819
2819
|
action: "init",
|
|
@@ -2835,7 +2835,7 @@ const ua = _a;
|
|
|
2835
2835
|
wk_ctxs: {},
|
|
2836
2836
|
wk_lame: s.lamejs,
|
|
2837
2837
|
wk_mp3TrimFix: Ee
|
|
2838
|
-
} }, Ue(),
|
|
2838
|
+
} }, Ue(), L();
|
|
2839
2839
|
try {
|
|
2840
2840
|
if (!Te) {
|
|
2841
2841
|
var Fe = (we + "").replace(/[\w\$]+\.onmessage/g, "self.postMessage");
|
|
@@ -2847,7 +2847,7 @@ const ua = _a;
|
|
|
2847
2847
|
(window.URL || webkitURL).revokeObjectURL(Ge);
|
|
2848
2848
|
}, 1e4), Ue(1);
|
|
2849
2849
|
}
|
|
2850
|
-
var He =
|
|
2850
|
+
var He = L();
|
|
2851
2851
|
return He.isW = 1, Me = Te, He;
|
|
2852
2852
|
} catch (Xe) {
|
|
2853
2853
|
return Te && Te.terminate(), console.error(Xe), Se(te, 1);
|
|
@@ -2871,9 +2871,9 @@ const ua = _a;
|
|
|
2871
2871
|
pcm: ie
|
|
2872
2872
|
});
|
|
2873
2873
|
}, s.prototype.mp3_complete = function(te, ie, we, Ue) {
|
|
2874
|
-
var
|
|
2874
|
+
var L = this;
|
|
2875
2875
|
te && te.worker ? (te.call = function(he) {
|
|
2876
|
-
Ue &&
|
|
2876
|
+
Ue && L.mp3_stop(te), he.err ? we(he.err) : (Ie(he.meta, te.set), ie(he.blob, "audio/mp3"));
|
|
2877
2877
|
}, te.worker.postMessage({
|
|
2878
2878
|
action: "complete",
|
|
2879
2879
|
id: te.id
|
|
@@ -2882,9 +2882,9 @@ const ua = _a;
|
|
|
2882
2882
|
var we = typeof window < "u" && window.parseInt || typeof self < "u" && self.parseInt || parseInt, Ue = new Uint8Array(te[0] || []);
|
|
2883
2883
|
if (Ue.length < 4)
|
|
2884
2884
|
return null;
|
|
2885
|
-
var
|
|
2886
|
-
return ("0000000" + ((e || Ue)[
|
|
2887
|
-
}, he =
|
|
2885
|
+
var L = function(R, e) {
|
|
2886
|
+
return ("0000000" + ((e || Ue)[R] || 0).toString(2)).substr(-8);
|
|
2887
|
+
}, he = L(0) + L(1), Te = L(2) + L(3);
|
|
2888
2888
|
if (!/^1{11}/.test(he))
|
|
2889
2889
|
return null;
|
|
2890
2890
|
var Fe = { "00": 2.5, 10: 2, 11: 1 }[he.substr(11, 2)], Qe = { "01": 3 }[he.substr(13, 2)], $e = {
|
|
@@ -2905,7 +2905,7 @@ const ua = _a;
|
|
|
2905
2905
|
for (var He = Math.round(ie * 8 / Ge), Xe = Qe == 1 ? 384 : Qe == 2 || Fe == 1 ? 1152 : 576, Be = Xe / $e * 1e3, W = Math.floor(Xe * Ge / 8 / $e * 1e3), pt = 0, at = 0, et = 0; et < te.length; et++) {
|
|
2906
2906
|
var vt = te[et];
|
|
2907
2907
|
if (at += vt.byteLength, at >= W + 3) {
|
|
2908
|
-
var _t = new Uint8Array(vt), ct = vt.byteLength - (at - (W + 3) + 1), je =
|
|
2908
|
+
var _t = new Uint8Array(vt), ct = vt.byteLength - (at - (W + 3) + 1), je = L(ct, _t);
|
|
2909
2909
|
pt = je.charAt(6) == "1";
|
|
2910
2910
|
break;
|
|
2911
2911
|
}
|
|
@@ -2927,12 +2927,12 @@ const ua = _a;
|
|
|
2927
2927
|
//minfiy keep name
|
|
2928
2928
|
rm: s.mp3ReadMeta,
|
|
2929
2929
|
fn: function(te, ie, we, Ue) {
|
|
2930
|
-
var
|
|
2931
|
-
if (!
|
|
2930
|
+
var L = this.rm(te, ie);
|
|
2931
|
+
if (!L)
|
|
2932
2932
|
return { err: "mp3 unknown format" };
|
|
2933
|
-
var he = Math.round(we / Ue * 1e3), Te = Math.floor((
|
|
2933
|
+
var he = Math.round(we / Ue * 1e3), Te = Math.floor((L.duration - he) / L.frameDurationFloat);
|
|
2934
2934
|
if (Te > 0) {
|
|
2935
|
-
var Fe = Te *
|
|
2935
|
+
var Fe = Te * L.frameSize - (L.hasPadding ? 1 : 0);
|
|
2936
2936
|
ie -= Fe;
|
|
2937
2937
|
for (var Qe = 0, $e = [], Ge = 0; Ge < te.length; Ge++) {
|
|
2938
2938
|
var He = te[Ge];
|
|
@@ -2945,12 +2945,12 @@ const ua = _a;
|
|
|
2945
2945
|
Qe && (te[0] = Qe);
|
|
2946
2946
|
for (var Ge = 0; Ge < $e.length; Ge++)
|
|
2947
2947
|
te.splice(Ge, 0, $e[Ge]);
|
|
2948
|
-
|
|
2948
|
+
L.err = "mp3 fix error: 已还原,错误原因不明";
|
|
2949
2949
|
}
|
|
2950
|
-
var Be =
|
|
2951
|
-
Be.remove = Te, Be.removeDuration = Math.round(Te *
|
|
2950
|
+
var Be = L.trimFix = {};
|
|
2951
|
+
Be.remove = Te, Be.removeDuration = Math.round(Te * L.frameDurationFloat), Be.duration = Math.round(ie * 8 / L.bitRate);
|
|
2952
2952
|
}
|
|
2953
|
-
return
|
|
2953
|
+
return L;
|
|
2954
2954
|
}
|
|
2955
2955
|
}, Ie = function(te, ie) {
|
|
2956
2956
|
var we = "MP3 Info: ";
|
|
@@ -2972,7 +2972,7 @@ const ua = _a;
|
|
|
2972
2972
|
function U(d) {
|
|
2973
2973
|
return new Int8Array(d);
|
|
2974
2974
|
}
|
|
2975
|
-
function
|
|
2975
|
+
function E(d) {
|
|
2976
2976
|
return new Int16Array(d);
|
|
2977
2977
|
}
|
|
2978
2978
|
function P(d) {
|
|
@@ -3004,7 +3004,7 @@ const ua = _a;
|
|
|
3004
3004
|
}
|
|
3005
3005
|
function Se(d) {
|
|
3006
3006
|
if (d.length == 1)
|
|
3007
|
-
return
|
|
3007
|
+
return E(d[0]);
|
|
3008
3008
|
var D = d[0];
|
|
3009
3009
|
d = d.slice(1);
|
|
3010
3010
|
for (var V = [], T = 0; T < D; T++)
|
|
@@ -3046,10 +3046,10 @@ const ua = _a;
|
|
|
3046
3046
|
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);
|
|
3047
3047
|
var Ue = {};
|
|
3048
3048
|
Ue.MAX_VALUE = 34028235e31;
|
|
3049
|
-
function
|
|
3049
|
+
function L(d) {
|
|
3050
3050
|
this.ordinal = d;
|
|
3051
3051
|
}
|
|
3052
|
-
|
|
3052
|
+
L.vbr_off = new L(0), L.vbr_mt = new L(1), L.vbr_rh = new L(2), L.vbr_abr = new L(3), L.vbr_mtrh = new L(4), L.vbr_default = L.vbr_mtrh;
|
|
3053
3053
|
function he(d) {
|
|
3054
3054
|
var D = d;
|
|
3055
3055
|
this.ordinal = function() {
|
|
@@ -3666,7 +3666,7 @@ const ua = _a;
|
|
|
3666
3666
|
];
|
|
3667
3667
|
function ce(g, H, oe) {
|
|
3668
3668
|
var z = H, re = D.nearestBitrateFullIndex(H);
|
|
3669
|
-
if (g.VBR =
|
|
3669
|
+
if (g.VBR = L.vbr_abr, g.VBR_mean_bitrate_kbps = z, g.VBR_mean_bitrate_kbps = Math.min(g.VBR_mean_bitrate_kbps, 320), g.VBR_mean_bitrate_kbps = Math.max(g.VBR_mean_bitrate_kbps, 8), g.brate = g.VBR_mean_bitrate_kbps, g.VBR_mean_bitrate_kbps > 320 && (g.disable_reservoir = !0), T[re].safejoint > 0 && (g.exp_nspsytune = g.exp_nspsytune | 2), T[re].sfscale > 0 && (g.internal_flags.noise_shaping = 2), Math.abs(T[re].nsbass) > 0) {
|
|
3670
3670
|
var k = int(T[re].nsbass * 4);
|
|
3671
3671
|
k < 0 && (k += 64), g.exp_nspsytune = g.exp_nspsytune | k << 2;
|
|
3672
3672
|
}
|
|
@@ -3675,35 +3675,35 @@ const ua = _a;
|
|
|
3675
3675
|
this.apply_preset = function(g, H, oe) {
|
|
3676
3676
|
switch (H) {
|
|
3677
3677
|
case ue.R3MIX: {
|
|
3678
|
-
H = ue.V3, g.VBR =
|
|
3678
|
+
H = ue.V3, g.VBR = L.vbr_mtrh;
|
|
3679
3679
|
break;
|
|
3680
3680
|
}
|
|
3681
3681
|
case ue.MEDIUM: {
|
|
3682
|
-
H = ue.V4, g.VBR =
|
|
3682
|
+
H = ue.V4, g.VBR = L.vbr_rh;
|
|
3683
3683
|
break;
|
|
3684
3684
|
}
|
|
3685
3685
|
case ue.MEDIUM_FAST: {
|
|
3686
|
-
H = ue.V4, g.VBR =
|
|
3686
|
+
H = ue.V4, g.VBR = L.vbr_mtrh;
|
|
3687
3687
|
break;
|
|
3688
3688
|
}
|
|
3689
3689
|
case ue.STANDARD: {
|
|
3690
|
-
H = ue.V2, g.VBR =
|
|
3690
|
+
H = ue.V2, g.VBR = L.vbr_rh;
|
|
3691
3691
|
break;
|
|
3692
3692
|
}
|
|
3693
3693
|
case ue.STANDARD_FAST: {
|
|
3694
|
-
H = ue.V2, g.VBR =
|
|
3694
|
+
H = ue.V2, g.VBR = L.vbr_mtrh;
|
|
3695
3695
|
break;
|
|
3696
3696
|
}
|
|
3697
3697
|
case ue.EXTREME: {
|
|
3698
|
-
H = ue.V0, g.VBR =
|
|
3698
|
+
H = ue.V0, g.VBR = L.vbr_rh;
|
|
3699
3699
|
break;
|
|
3700
3700
|
}
|
|
3701
3701
|
case ue.EXTREME_FAST: {
|
|
3702
|
-
H = ue.V0, g.VBR =
|
|
3702
|
+
H = ue.V0, g.VBR = L.vbr_mtrh;
|
|
3703
3703
|
break;
|
|
3704
3704
|
}
|
|
3705
3705
|
case ue.INSANE:
|
|
3706
|
-
return H = 320, g.preset = H, ce(g, H, oe), g.VBR =
|
|
3706
|
+
return H = 320, g.preset = H, ce(g, H, oe), g.VBR = L.vbr_off, H;
|
|
3707
3707
|
}
|
|
3708
3708
|
switch (g.preset = H, H) {
|
|
3709
3709
|
case ue.V9:
|
|
@@ -7746,7 +7746,7 @@ const ua = _a;
|
|
|
7746
7746
|
}
|
|
7747
7747
|
function je() {
|
|
7748
7748
|
}
|
|
7749
|
-
function
|
|
7749
|
+
function R(d, D, V, T) {
|
|
7750
7750
|
this.l = P(1 + o.SBMAX_l), this.s = P(1 + o.SBMAX_s), this.psfb21 = P(1 + o.PSFB21), this.psfb12 = P(1 + o.PSFB12);
|
|
7751
7751
|
var ce = this.l, g = this.s;
|
|
7752
7752
|
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)));
|
|
@@ -7798,7 +7798,7 @@ const ua = _a;
|
|
|
7798
7798
|
];
|
|
7799
7799
|
this.pretab = k, this.sfBandIndex = [
|
|
7800
7800
|
// Table B.2.b: 22.05 kHz
|
|
7801
|
-
new
|
|
7801
|
+
new R(
|
|
7802
7802
|
[
|
|
7803
7803
|
0,
|
|
7804
7804
|
6,
|
|
@@ -7831,7 +7831,7 @@ const ua = _a;
|
|
|
7831
7831
|
),
|
|
7832
7832
|
/* Table B.2.c: 24 kHz */
|
|
7833
7833
|
/* docs: 332. mpg123(broken): 330 */
|
|
7834
|
-
new
|
|
7834
|
+
new R(
|
|
7835
7835
|
[
|
|
7836
7836
|
0,
|
|
7837
7837
|
6,
|
|
@@ -7863,7 +7863,7 @@ const ua = _a;
|
|
|
7863
7863
|
/* sfb12 pseudo sub bands */
|
|
7864
7864
|
),
|
|
7865
7865
|
/* Table B.2.a: 16 kHz */
|
|
7866
|
-
new
|
|
7866
|
+
new R(
|
|
7867
7867
|
[
|
|
7868
7868
|
0,
|
|
7869
7869
|
6,
|
|
@@ -7895,7 +7895,7 @@ const ua = _a;
|
|
|
7895
7895
|
/* sfb12 pseudo sub bands */
|
|
7896
7896
|
),
|
|
7897
7897
|
/* Table B.8.b: 44.1 kHz */
|
|
7898
|
-
new
|
|
7898
|
+
new R(
|
|
7899
7899
|
[
|
|
7900
7900
|
0,
|
|
7901
7901
|
4,
|
|
@@ -7927,7 +7927,7 @@ const ua = _a;
|
|
|
7927
7927
|
/* sfb12 pseudo sub bands */
|
|
7928
7928
|
),
|
|
7929
7929
|
/* Table B.8.c: 48 kHz */
|
|
7930
|
-
new
|
|
7930
|
+
new R(
|
|
7931
7931
|
[
|
|
7932
7932
|
0,
|
|
7933
7933
|
4,
|
|
@@ -7959,7 +7959,7 @@ const ua = _a;
|
|
|
7959
7959
|
/* sfb12 pseudo sub bands */
|
|
7960
7960
|
),
|
|
7961
7961
|
/* Table B.8.a: 32 kHz */
|
|
7962
|
-
new
|
|
7962
|
+
new R(
|
|
7963
7963
|
[
|
|
7964
7964
|
0,
|
|
7965
7965
|
4,
|
|
@@ -7991,7 +7991,7 @@ const ua = _a;
|
|
|
7991
7991
|
/* sfb12 pseudo sub bands */
|
|
7992
7992
|
),
|
|
7993
7993
|
/* MPEG-2.5 11.025 kHz */
|
|
7994
|
-
new
|
|
7994
|
+
new R(
|
|
7995
7995
|
[
|
|
7996
7996
|
0,
|
|
7997
7997
|
6,
|
|
@@ -8038,7 +8038,7 @@ const ua = _a;
|
|
|
8038
8038
|
/* sfb12 pseudo sub bands */
|
|
8039
8039
|
),
|
|
8040
8040
|
/* MPEG-2.5 12 kHz */
|
|
8041
|
-
new
|
|
8041
|
+
new R(
|
|
8042
8042
|
[
|
|
8043
8043
|
0,
|
|
8044
8044
|
6,
|
|
@@ -8085,7 +8085,7 @@ const ua = _a;
|
|
|
8085
8085
|
/* sfb12 pseudo sub bands */
|
|
8086
8086
|
),
|
|
8087
8087
|
/* MPEG-2.5 8 kHz */
|
|
8088
|
-
new
|
|
8088
|
+
new R(
|
|
8089
8089
|
[
|
|
8090
8090
|
0,
|
|
8091
8091
|
12,
|
|
@@ -8226,10 +8226,10 @@ const ua = _a;
|
|
|
8226
8226
|
var c = 90.30873362, I = 94.82444863, n = ie.FAST_LOG10_X(_, 10), G = y * y, v = 0;
|
|
8227
8227
|
return n -= w, G > 1e-20 && (v = 1 + ie.FAST_LOG10_X(G, 10 / c)), v < 0 && (v = 0), n *= v, n += w + c - I, Math.pow(10, 0.1 * n);
|
|
8228
8228
|
}, this.calc_xmin = function(y, _, w, c) {
|
|
8229
|
-
var I = 0, n = y.internal_flags, G, v = 0, p = 0, b = n.ATH, x = w.xr, C = y.VBR ==
|
|
8230
|
-
for ((y.VBR ==
|
|
8229
|
+
var I = 0, n = y.internal_flags, G, v = 0, p = 0, b = n.ATH, x = w.xr, C = y.VBR == L.vbr_mtrh ? 1 : 0, r = n.masking_lower;
|
|
8230
|
+
for ((y.VBR == L.vbr_mtrh || y.VBR == L.vbr_mt) && (r = 1), G = 0; G < w.psy_lmax; G++) {
|
|
8231
8231
|
var i, q, j, Z, de, ge;
|
|
8232
|
-
y.VBR ==
|
|
8232
|
+
y.VBR == L.vbr_rh || y.VBR == L.vbr_mtrh ? q = athAdjust(b.adjust, b.l[G], b.floor) : q = b.adjust * b.l[G], de = w.width[G], j = q / de, Z = ce, ge = de >> 1, i = 0;
|
|
8233
8233
|
do {
|
|
8234
8234
|
var Ne, Pe;
|
|
8235
8235
|
Ne = x[v] * x[v], i += Ne, Z += Ne < j ? Ne : j, v++, Pe = x[v] * x[v], i += Pe, Z += Pe < j ? Pe : j, v++;
|
|
@@ -8250,7 +8250,7 @@ const ua = _a;
|
|
|
8250
8250
|
w.max_nonzero_coeff = mt;
|
|
8251
8251
|
for (var lt = w.sfb_smin; G < w.psymax; lt++, G += 3) {
|
|
8252
8252
|
var de, ft, gt;
|
|
8253
|
-
for (y.VBR ==
|
|
8253
|
+
for (y.VBR == L.vbr_rh || y.VBR == L.vbr_mtrh ? gt = athAdjust(b.adjust, b.s[lt], b.floor) : gt = b.adjust * b.s[lt], de = w.width[G], ft = 0; ft < 3; ft++) {
|
|
8254
8254
|
var i = 0, q, j, Z, ge = de >> 1;
|
|
8255
8255
|
j = gt / de, Z = ce;
|
|
8256
8256
|
do {
|
|
@@ -8615,7 +8615,7 @@ const ua = _a;
|
|
|
8615
8615
|
} while (c.global_gain + c.scalefac_scale < 255);
|
|
8616
8616
|
w.noise_shaping_amp == 3 ? h() : x = !0;
|
|
8617
8617
|
}
|
|
8618
|
-
return a.VBR ==
|
|
8618
|
+
return a.VBR == L.vbr_rh || a.VBR == L.vbr_mtrh ? te.arraycopy(I, 0, Y, 0, 576) : w.substep_shaping & 1 && h(), G.over_count;
|
|
8619
8619
|
}, this.iteration_finish_one = function(a, u, A) {
|
|
8620
8620
|
var Y = a.l3_side, y = Y.tt[u][A];
|
|
8621
8621
|
T.best_scalefac_store(a, u, A, Y), a.use_best_huffman == 1 && T.best_huffman_divide(a, y), d.ResvAdjust(a, y);
|
|
@@ -9258,7 +9258,7 @@ const ua = _a;
|
|
|
9258
9258
|
for (p = 0; p < _.mode_gr; p++) {
|
|
9259
9259
|
for (v = 0; v < _.channels_out; v++)
|
|
9260
9260
|
x[v] = y[v], C = 576 + p * 576 - o.FFTOFFSET;
|
|
9261
|
-
if (z.VBR ==
|
|
9261
|
+
if (z.VBR == L.vbr_mtrh || z.VBR == L.vbr_mt ? h() : b = V.L3psycho_anal_ns(
|
|
9262
9262
|
z,
|
|
9263
9263
|
x,
|
|
9264
9264
|
C,
|
|
@@ -9278,7 +9278,7 @@ const ua = _a;
|
|
|
9278
9278
|
}
|
|
9279
9279
|
} else
|
|
9280
9280
|
h();
|
|
9281
|
-
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 ? (Y = A, G = n) : (Y = u, G = I), z.analysis && _.pinfo != null && h(), z.VBR ==
|
|
9281
|
+
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 ? (Y = A, G = n) : (Y = u, G = I), z.analysis && _.pinfo != null && h(), z.VBR == L.vbr_off || z.VBR == L.vbr_abr) {
|
|
9282
9282
|
var q, j;
|
|
9283
9283
|
for (q = 0; q < 18; q++)
|
|
9284
9284
|
_.nsPsy.pefirbuf[q] = _.nsPsy.pefirbuf[q + 1];
|
|
@@ -9323,7 +9323,7 @@ const ua = _a;
|
|
|
9323
9323
|
function D() {
|
|
9324
9324
|
this.write_timing = 0, this.ptr = 0, this.buf = U(d);
|
|
9325
9325
|
}
|
|
9326
|
-
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
|
|
9326
|
+
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 R(), this.minval_l = K(o.CBANDS), this.minval_s = K(o.CBANDS), this.nb_1 = Me([4, o.CBANDS]), this.nb_2 = Me([4, o.CBANDS]), this.nb_s1 = Me([4, o.CBANDS]), this.nb_s2 = Me([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 = Me([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 = P(o.SBMAX_l), this.bo_l = P(o.SBMAX_l), this.bm_s = P(o.SBMAX_s), this.bo_s = P(o.SBMAX_s), this.npart_l = 0, this.npart_s = 0, this.s3ind = be([o.CBANDS, 2]), this.s3ind_s = be([o.CBANDS, 2]), this.numlines_s = P(o.CBANDS), this.numlines_l = P(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 = P(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 = be([16, 4 + 1]), this.bitrate_blockType_Hist = be([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;
|
|
9327
9327
|
for (var V = 0; V < this.en.length; V++)
|
|
9328
9328
|
this.en[V] = new ye();
|
|
9329
9329
|
for (var V = 0; V < this.thm.length; V++)
|
|
@@ -9821,7 +9821,7 @@ const ua = _a;
|
|
|
9821
9821
|
];
|
|
9822
9822
|
this.L3psycho_anal_ns = function(ae, F, J, ke, Ce, me, Re, Le, ze, Ke) {
|
|
9823
9823
|
var Oe = ae.internal_flags, ut = Me([2, o.BLKSIZE]), tt = Me([2, 3, o.BLKSIZE_s]), ot = K(o.CBANDS + 1), ht = K(o.CBANDS + 1), rt = K(o.CBANDS + 2), qe = P(2), nt = P(2), wt, Ye, Je, We, dt, Et, Tt, it, Zt = Me([2, 576]), Nt, zt = P(o.CBANDS + 2), Ut = P(o.CBANDS + 2);
|
|
9824
|
-
for (Ie.fill(Ut, 0), wt = Oe.channels_out, ae.mode == he.JOINT_STEREO && (wt = 4), ae.VBR ==
|
|
9824
|
+
for (Ie.fill(Ut, 0), wt = Oe.channels_out, ae.mode == he.JOINT_STEREO && (wt = 4), ae.VBR == L.vbr_off ? Nt = Oe.ResvMax == 0 ? 0 : Oe.ResvSize / Oe.ResvMax * 0.5 : ae.VBR == L.vbr_rh || ae.VBR == L.vbr_mtrh || ae.VBR == L.vbr_mt ? Nt = 0.6 : Nt = 1, Ye = 0; Ye < Oe.channels_out; Ye++) {
|
|
9825
9825
|
var Qt = F[Ye], Vt = J + 576 - 350 - O + 192;
|
|
9826
9826
|
for (We = 0; We < 576; We++) {
|
|
9827
9827
|
var aa, ra;
|
|
@@ -9993,7 +9993,7 @@ const ua = _a;
|
|
|
9993
9993
|
ke = !0;
|
|
9994
9994
|
break;
|
|
9995
9995
|
case 1:
|
|
9996
|
-
ke = !(ae.VBR ==
|
|
9996
|
+
ke = !(ae.VBR == L.vbr_mtrh || ae.VBR == L.vbr_mt);
|
|
9997
9997
|
break;
|
|
9998
9998
|
case 2:
|
|
9999
9999
|
ke = !1;
|
|
@@ -10167,7 +10167,7 @@ const ua = _a;
|
|
|
10167
10167
|
var a = 4294479419;
|
|
10168
10168
|
function u(r) {
|
|
10169
10169
|
var i;
|
|
10170
|
-
return r.class_id = a, i = r.internal_flags = new le(), r.mode = he.NOT_SET, r.original = 1, r.in_samplerate = 44100, r.num_channels = 2, r.num_samples = -1, r.bWriteVbrTag = !0, r.quality = -1, r.short_blocks = null, i.subblock_gain = -1, r.lowpassfreq = 0, r.highpassfreq = 0, r.lowpasswidth = -1, r.highpasswidth = -1, r.VBR =
|
|
10170
|
+
return r.class_id = a, i = r.internal_flags = new le(), r.mode = he.NOT_SET, r.original = 1, r.in_samplerate = 44100, r.num_channels = 2, r.num_samples = -1, r.bWriteVbrTag = !0, r.quality = -1, r.short_blocks = null, i.subblock_gain = -1, r.lowpassfreq = 0, r.highpassfreq = 0, r.lowpasswidth = -1, r.highpasswidth = -1, r.VBR = L.vbr_off, r.VBR_q = 4, r.ATHcurve = -1, r.VBR_mean_bitrate_kbps = 128, r.VBR_min_bitrate_kbps = 0, r.VBR_max_bitrate_kbps = 0, r.VBR_hard_min = 0, i.VBR_min_bitrate = 1, i.VBR_max_bitrate = 13, r.quant_comp = -1, r.quant_comp_short = -1, r.msfix = -1, i.resample_ratio = 1, i.OldValue[0] = 180, i.OldValue[1] = 180, i.CurrentStep[0] = 4, i.CurrentStep[1] = 4, i.masking_lower = 1, i.nsPsy.attackthre = -1, i.nsPsy.attackthre_s = -1, r.scale = -1, r.athaa_type = -1, r.ATHtype = -1, r.athaa_loudapprox = -1, r.athaa_sensitivity = 0, r.useTemporal = null, r.interChRatio = -1, i.mf_samples_to_encode = o.ENCDELAY + o.POSTDELAY, r.encoder_padding = 0, i.mf_size = o.ENCDELAY - o.MDCTDELAY, r.findReplayGain = !1, r.decode_on_the_fly = !1, i.decode_on_the_fly = !1, i.findReplayGain = !1, i.findPeakSample = !1, i.RadioGain = 0, i.AudiophileGain = 0, i.noclipGainChange = 0, i.noclipScale = -1, r.preset = 0, r.write_id3tag_automatic = !0, 0;
|
|
10171
10171
|
}
|
|
10172
10172
|
this.lame_init = function() {
|
|
10173
10173
|
var r = new _t();
|
|
@@ -10319,7 +10319,7 @@ const ua = _a;
|
|
|
10319
10319
|
}
|
|
10320
10320
|
this.lame_init_params = function(r) {
|
|
10321
10321
|
var i = r.internal_flags;
|
|
10322
|
-
if (i.Class_ID = 0, i.ATH == null && (i.ATH = new vt()), i.PSY == null && (i.PSY = new _e()), i.rgdata == null && (i.rgdata = new je()), i.channels_in = r.num_channels, i.channels_in == 1 && (r.mode = he.MONO), i.channels_out = r.mode == he.MONO ? 1 : 2, i.mode_ext = o.MPG_MD_MS_LR, r.mode == he.MONO && (r.force_ms = !1), r.VBR ==
|
|
10322
|
+
if (i.Class_ID = 0, i.ATH == null && (i.ATH = new vt()), i.PSY == null && (i.PSY = new _e()), i.rgdata == null && (i.rgdata = new je()), i.channels_in = r.num_channels, i.channels_in == 1 && (r.mode = he.MONO), i.channels_out = r.mode == he.MONO ? 1 : 2, i.mode_ext = o.MPG_MD_MS_LR, r.mode == he.MONO && (r.force_ms = !1), r.VBR == L.vbr_off && r.VBR_mean_bitrate_kbps != 128 && r.brate == 0 && (r.brate = r.VBR_mean_bitrate_kbps), r.VBR == L.vbr_off || r.VBR == L.vbr_mtrh || r.VBR == L.vbr_mt || (r.free_format = !1), r.VBR == L.vbr_off && r.brate == 0 && h(), r.VBR == L.vbr_off && r.compression_ratio > 0 && h(), r.out_samplerate != 0 && (r.out_samplerate < 16e3 ? (r.VBR_mean_bitrate_kbps = Math.max(
|
|
10323
10323
|
r.VBR_mean_bitrate_kbps,
|
|
10324
10324
|
8
|
|
10325
10325
|
), r.VBR_mean_bitrate_kbps = Math.min(
|
|
@@ -10340,27 +10340,27 @@ const ua = _a;
|
|
|
10340
10340
|
))), r.lowpassfreq == 0) {
|
|
10341
10341
|
var q = 16e3;
|
|
10342
10342
|
switch (r.VBR) {
|
|
10343
|
-
case
|
|
10343
|
+
case L.vbr_off: {
|
|
10344
10344
|
var j = new B();
|
|
10345
10345
|
w(j, r.brate), q = j.lowerlimit;
|
|
10346
10346
|
break;
|
|
10347
10347
|
}
|
|
10348
|
-
case
|
|
10348
|
+
case L.vbr_abr: {
|
|
10349
10349
|
var j = new B();
|
|
10350
10350
|
w(j, r.VBR_mean_bitrate_kbps), q = j.lowerlimit;
|
|
10351
10351
|
break;
|
|
10352
10352
|
}
|
|
10353
|
-
case
|
|
10353
|
+
case L.vbr_rh:
|
|
10354
10354
|
h();
|
|
10355
10355
|
default:
|
|
10356
10356
|
h();
|
|
10357
10357
|
}
|
|
10358
|
-
r.mode == he.MONO && (r.VBR ==
|
|
10358
|
+
r.mode == he.MONO && (r.VBR == L.vbr_off || r.VBR == L.vbr_abr) && (q *= 1.5), r.lowpassfreq = q | 0;
|
|
10359
10359
|
}
|
|
10360
|
-
switch (r.out_samplerate == 0 && h(), r.lowpassfreq = Math.min(20500, r.lowpassfreq), r.lowpassfreq = Math.min(r.out_samplerate / 2, r.lowpassfreq), r.VBR ==
|
|
10361
|
-
case
|
|
10362
|
-
case
|
|
10363
|
-
case
|
|
10360
|
+
switch (r.out_samplerate == 0 && h(), r.lowpassfreq = Math.min(20500, r.lowpassfreq), r.lowpassfreq = Math.min(r.out_samplerate / 2, r.lowpassfreq), r.VBR == L.vbr_off && (r.compression_ratio = r.out_samplerate * 16 * i.channels_out / (1e3 * r.brate)), r.VBR == L.vbr_abr && h(), r.bWriteVbrTag || (r.findReplayGain = !1, r.decode_on_the_fly = !1, i.findPeakSample = !1), i.findReplayGain = r.findReplayGain, i.decode_on_the_fly = r.decode_on_the_fly, i.decode_on_the_fly && (i.findPeakSample = !0), i.findReplayGain && h(), i.decode_on_the_fly && !r.decode_only && h(), i.mode_gr = r.out_samplerate <= 24e3 ? 1 : 2, r.framesize = 576 * i.mode_gr, r.encoder_delay = o.ENCDELAY, i.resample_ratio = r.in_samplerate / r.out_samplerate, r.VBR) {
|
|
10361
|
+
case L.vbr_mt:
|
|
10362
|
+
case L.vbr_rh:
|
|
10363
|
+
case L.vbr_mtrh:
|
|
10364
10364
|
{
|
|
10365
10365
|
var Z = [
|
|
10366
10366
|
5.7,
|
|
@@ -10377,14 +10377,14 @@ const ua = _a;
|
|
|
10377
10377
|
r.compression_ratio = Z[r.VBR_q];
|
|
10378
10378
|
}
|
|
10379
10379
|
break;
|
|
10380
|
-
case
|
|
10380
|
+
case L.vbr_abr:
|
|
10381
10381
|
r.compression_ratio = r.out_samplerate * 16 * i.channels_out / (1e3 * r.VBR_mean_bitrate_kbps);
|
|
10382
10382
|
break;
|
|
10383
10383
|
default:
|
|
10384
10384
|
r.compression_ratio = r.out_samplerate * 16 * i.channels_out / (1e3 * r.brate);
|
|
10385
10385
|
break;
|
|
10386
10386
|
}
|
|
10387
|
-
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 = Y(r.out_samplerate, r), i.samplerate_index < 0 && h(), r.VBR ==
|
|
10387
|
+
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 = Y(r.out_samplerate, r), i.samplerate_index < 0 && h(), r.VBR == L.vbr_off ? r.free_format ? i.bitrate_index = 0 : (r.brate = y(
|
|
10388
10388
|
r.brate,
|
|
10389
10389
|
r.version,
|
|
10390
10390
|
r.out_samplerate
|
|
@@ -10414,23 +10414,23 @@ const ua = _a;
|
|
|
10414
10414
|
r.ATHtype == -1 && (r.ATHtype = 4);
|
|
10415
10415
|
}
|
|
10416
10416
|
switch (r.VBR) {
|
|
10417
|
-
case
|
|
10418
|
-
r.VBR =
|
|
10419
|
-
case
|
|
10417
|
+
case L.vbr_mt:
|
|
10418
|
+
r.VBR = L.vbr_mtrh;
|
|
10419
|
+
case L.vbr_mtrh: {
|
|
10420
10420
|
r.useTemporal == null && (r.useTemporal = !1), g.apply_preset(r, 500 - r.VBR_q * 10, 0), r.quality < 0 && (r.quality = LAME_DEFAULT_QUALITY), r.quality < 5 && (r.quality = 0), r.quality > 5 && (r.quality = 5), i.PSY.mask_adjust = r.maskingadjust, i.PSY.mask_adjust_short = r.maskingadjust_short, r.experimentalY ? i.sfb21_extra = !1 : i.sfb21_extra = r.out_samplerate > 44e3, i.iteration_loop = new VBRNewIterationLoop(oe);
|
|
10421
10421
|
break;
|
|
10422
10422
|
}
|
|
10423
|
-
case
|
|
10423
|
+
case L.vbr_rh: {
|
|
10424
10424
|
g.apply_preset(r, 500 - r.VBR_q * 10, 0), i.PSY.mask_adjust = r.maskingadjust, i.PSY.mask_adjust_short = r.maskingadjust_short, r.experimentalY ? i.sfb21_extra = !1 : i.sfb21_extra = r.out_samplerate > 44e3, r.quality > 6 && (r.quality = 6), r.quality < 0 && (r.quality = LAME_DEFAULT_QUALITY), i.iteration_loop = new VBROldIterationLoop(oe);
|
|
10425
10425
|
break;
|
|
10426
10426
|
}
|
|
10427
10427
|
default: {
|
|
10428
10428
|
var Ve;
|
|
10429
|
-
i.sfb21_extra = !1, r.quality < 0 && (r.quality = LAME_DEFAULT_QUALITY), Ve = r.VBR, Ve ==
|
|
10429
|
+
i.sfb21_extra = !1, r.quality < 0 && (r.quality = LAME_DEFAULT_QUALITY), Ve = r.VBR, Ve == L.vbr_off && (r.VBR_mean_bitrate_kbps = r.brate), g.apply_preset(r, r.VBR_mean_bitrate_kbps, 0), r.VBR = Ve, i.PSY.mask_adjust = r.maskingadjust, i.PSY.mask_adjust_short = r.maskingadjust_short, Ve == L.vbr_off ? i.iteration_loop = new ct(oe) : h();
|
|
10430
10430
|
break;
|
|
10431
10431
|
}
|
|
10432
10432
|
}
|
|
10433
|
-
return r.VBR !=
|
|
10433
|
+
return r.VBR != L.vbr_off && h(), r.tune && h(), I(r), r.athaa_type < 0 ? i.ATH.useAdjust = 3 : i.ATH.useAdjust = r.athaa_type, i.ATH.aaSensitivityP = Math.pow(10, r.athaa_sensitivity / -10), r.short_blocks == null && (r.short_blocks = we.short_block_allowed), r.short_blocks == we.short_block_allowed && (r.mode == he.JOINT_STEREO || r.mode == he.STEREO) && (r.short_blocks = we.short_block_coupled), r.quant_comp < 0 && (r.quant_comp = 1), r.quant_comp_short < 0 && (r.quant_comp_short = 0), r.msfix < 0 && (r.msfix = 0), r.exp_nspsytune = r.exp_nspsytune | 1, r.internal_flags.nsPsy.attackthre < 0 && (r.internal_flags.nsPsy.attackthre = Ae.NSATTACKTHRE), r.internal_flags.nsPsy.attackthre_s < 0 && (r.internal_flags.nsPsy.attackthre_s = Ae.NSATTACKTHRE_S), r.scale < 0 && (r.scale = 1), r.ATHtype < 0 && (r.ATHtype = 4), r.ATHcurve < 0 && (r.ATHcurve = 4), r.athaa_loudapprox < 0 && (r.athaa_loudapprox = 2), r.interChRatio < 0 && (r.interChRatio = 0), r.useTemporal == null && (r.useTemporal = !0), i.slot_lag = i.frac_SpF = 0, r.VBR == L.vbr_off && (i.slot_lag = i.frac_SpF = (r.version + 1) * 72e3 * r.brate % r.out_samplerate | 0), H.iteration_init(r), z.psymodel_init(r), 0;
|
|
10434
10434
|
};
|
|
10435
10435
|
function G(r, i) {
|
|
10436
10436
|
(r.in_buffer_0 == null || r.in_buffer_nsamples < i) && (r.in_buffer_0 = K(i), r.in_buffer_1 = K(i), r.in_buffer_nsamples = i);
|
|
@@ -10603,7 +10603,7 @@ const ua = _a;
|
|
|
10603
10603
|
})(function(s, t, f, h) {
|
|
10604
10604
|
var U = function(K) {
|
|
10605
10605
|
return new P(K);
|
|
10606
|
-
},
|
|
10606
|
+
}, E = "WaveView", P = function(K) {
|
|
10607
10607
|
var ve = this, Me = {
|
|
10608
10608
|
/*
|
|
10609
10609
|
elem:"css selector" //自动显示到dom,并以此dom大小为显示大小
|
|
@@ -10637,7 +10637,7 @@ const ua = _a;
|
|
|
10637
10637
|
var Ee = ve.canvas = K[Se];
|
|
10638
10638
|
else {
|
|
10639
10639
|
if (!h)
|
|
10640
|
-
throw new Error(f.G("NonBrowser-1", [
|
|
10640
|
+
throw new Error(f.G("NonBrowser-1", [E]));
|
|
10641
10641
|
var Ie = K.elem;
|
|
10642
10642
|
Ie && (typeof Ie == "string" ? Ie = document.querySelector(Ie) : Ie.length && (Ie = Ie[0])), Ie && (K.width = Ie.offsetWidth, K.height = Ie.offsetHeight);
|
|
10643
10643
|
var te = ve.elem = document.createElement("div");
|
|
@@ -10647,10 +10647,10 @@ const ua = _a;
|
|
|
10647
10647
|
}
|
|
10648
10648
|
var ie = K.scale, we = K.width * ie, Ue = K.height * ie;
|
|
10649
10649
|
if (!we || !Ue)
|
|
10650
|
-
throw new Error(f.G("IllegalArgs-1", [
|
|
10650
|
+
throw new Error(f.G("IllegalArgs-1", [E + " width=0 height=0"]));
|
|
10651
10651
|
Ee.width = we, Ee.height = Ue;
|
|
10652
|
-
var
|
|
10653
|
-
ve.linear1 = ve.genLinear(
|
|
10652
|
+
var L = ve.ctx = Ee.getContext("2d");
|
|
10653
|
+
ve.linear1 = ve.genLinear(L, we, K.linear1), ve.linear2 = ve.genLinear(L, we, K.linear2), ve.linearBg = ve.genLinear(L, Ue, K.linearBg, !0), ve._phase = 0;
|
|
10654
10654
|
};
|
|
10655
10655
|
P.prototype = U.prototype = {
|
|
10656
10656
|
genLinear: function(K, ve, Me, be) {
|
|
@@ -10660,8 +10660,8 @@ const ua = _a;
|
|
|
10660
10660
|
},
|
|
10661
10661
|
genPath: function(K, ve, Me) {
|
|
10662
10662
|
for (var be = [], Se = this, Ee = Se.set, Ie = Ee.scale, te = Ee.width * Ie, ie = Ee.height * Ie / 2, we = 0; we <= te; we += Ie) {
|
|
10663
|
-
var Ue = (1 + Math.cos(Math.PI + we / te * 2 * Math.PI)) / 2,
|
|
10664
|
-
be.push(
|
|
10663
|
+
var Ue = (1 + Math.cos(Math.PI + we / te * 2 * Math.PI)) / 2, L = Ue * ie * ve * Math.sin(2 * Math.PI * (we / te) * K + Me) + ie;
|
|
10664
|
+
be.push(L);
|
|
10665
10665
|
}
|
|
10666
10666
|
return be;
|
|
10667
10667
|
},
|
|
@@ -10683,14 +10683,14 @@ const ua = _a;
|
|
|
10683
10683
|
}
|
|
10684
10684
|
},
|
|
10685
10685
|
draw: function(K) {
|
|
10686
|
-
var ve = this, Me = ve.set, be = ve.ctx, Se = Me.scale, Ee = Me.width * Se, Ie = Me.height * Se, te = Me.speed / Me.fps, ie = ve._phase -= te, we = ie + te * Me.phase, Ue = K / 100,
|
|
10686
|
+
var ve = this, Me = ve.set, be = ve.ctx, Se = Me.scale, Ee = Me.width * Se, Ie = Me.height * Se, te = Me.speed / Me.fps, ie = ve._phase -= te, we = ie + te * Me.phase, Ue = K / 100, L = ve.genPath(2, Ue, ie), he = ve.genPath(1.8, Ue, we);
|
|
10687
10687
|
be.clearRect(0, 0, Ee, Ie), be.beginPath();
|
|
10688
10688
|
for (var Te = 0, Fe = 0; Fe <= Ee; Te++, Fe += Se)
|
|
10689
|
-
Fe == 0 ? be.moveTo(Fe,
|
|
10689
|
+
Fe == 0 ? be.moveTo(Fe, L[Te]) : be.lineTo(Fe, L[Te]);
|
|
10690
10690
|
Te--;
|
|
10691
10691
|
for (var Fe = Ee - 1; Fe >= 0; Te--, Fe -= Se)
|
|
10692
10692
|
be.lineTo(Fe, he[Te]);
|
|
10693
|
-
be.closePath(), be.fillStyle = ve.linearBg, be.fill(), ve.drawPath(he, ve.linear2), ve.drawPath(
|
|
10693
|
+
be.closePath(), be.fillStyle = ve.linearBg, be.fill(), ve.drawPath(he, ve.linear2), ve.drawPath(L, ve.linear1);
|
|
10694
10694
|
},
|
|
10695
10695
|
drawPath: function(K, ve) {
|
|
10696
10696
|
var Me = this, be = Me.set, Se = Me.ctx, Ee = be.scale, Ie = be.width * Ee;
|
|
@@ -10699,7 +10699,7 @@ const ua = _a;
|
|
|
10699
10699
|
ie == 0 ? Se.moveTo(ie, K[te]) : Se.lineTo(ie, K[te]);
|
|
10700
10700
|
Se.lineWidth = be.lineWidth * Ee, Se.strokeStyle = ve, Se.stroke();
|
|
10701
10701
|
}
|
|
10702
|
-
}, s[
|
|
10702
|
+
}, s[E] = U;
|
|
10703
10703
|
});
|
|
10704
10704
|
const Kr = {
|
|
10705
10705
|
components: { InlineSvg: Yt },
|
|
@@ -10757,8 +10757,8 @@ const Kr = {
|
|
|
10757
10757
|
},
|
|
10758
10758
|
methods: {
|
|
10759
10759
|
formatMilliseconds(s) {
|
|
10760
|
-
const t = Math.floor(s / 1e3), f = Math.floor(t / 60), h = t % 60, U = f.toString().padStart(2, "0"),
|
|
10761
|
-
return `${U}:${
|
|
10760
|
+
const t = Math.floor(s / 1e3), f = Math.floor(t / 60), h = t % 60, U = f.toString().padStart(2, "0"), E = h.toString().padStart(2, "0");
|
|
10761
|
+
return `${U}:${E}`;
|
|
10762
10762
|
},
|
|
10763
10763
|
start() {
|
|
10764
10764
|
this.ready && (this.pending = !0, this.rec.start());
|
|
@@ -10847,15 +10847,15 @@ var ma = {}, ri = {
|
|
|
10847
10847
|
* @param {MediaStream} mediaStream - Single media-stream object, array of media-streams, html-canvas-element, etc.
|
|
10848
10848
|
* @param {object} config - {type:"video", recorderType: MediaStreamRecorder, disableLogs: true, numberOfAudioChannels: 1, bufferSize: 0, sampleRate: 0, desiredSampRate: 16000, video: HTMLVideoElement, etc.}
|
|
10849
10849
|
*/
|
|
10850
|
-
function t(
|
|
10851
|
-
if (!
|
|
10850
|
+
function t(R, e) {
|
|
10851
|
+
if (!R)
|
|
10852
10852
|
throw "First parameter is required.";
|
|
10853
10853
|
e = e || {
|
|
10854
10854
|
type: "video"
|
|
10855
|
-
}, e = new f(
|
|
10855
|
+
}, e = new f(R, e);
|
|
10856
10856
|
var l = this;
|
|
10857
10857
|
function m(X) {
|
|
10858
|
-
return e.disableLogs || console.log("RecordRTC version: ", l.version), X && (e = new f(
|
|
10858
|
+
return e.disableLogs || console.log("RecordRTC version: ", l.version), X && (e = new f(R, X)), e.disableLogs || console.log("started recording " + e.type + " stream."), fe ? (fe.clearRecordedData(), fe.record(), ye("recording"), l.recordingDuration && se(), l) : (M(function() {
|
|
10859
10859
|
l.recordingDuration && se();
|
|
10860
10860
|
}), l);
|
|
10861
10861
|
}
|
|
@@ -10863,8 +10863,8 @@ var ma = {}, ri = {
|
|
|
10863
10863
|
X && (e.initCallback = function() {
|
|
10864
10864
|
X(), X = e.initCallback = null;
|
|
10865
10865
|
});
|
|
10866
|
-
var pe = new h(
|
|
10867
|
-
fe = new pe(
|
|
10866
|
+
var pe = new h(R, e);
|
|
10867
|
+
fe = new pe(R, e), fe.record(), ye("recording"), e.disableLogs || console.log("Initialized recorderType:", fe.constructor.name, "for output-type:", e.type);
|
|
10868
10868
|
}
|
|
10869
10869
|
function S(X) {
|
|
10870
10870
|
if (X = X || function() {
|
|
@@ -11187,7 +11187,7 @@ var ma = {}, ri = {
|
|
|
11187
11187
|
le();
|
|
11188
11188
|
return;
|
|
11189
11189
|
}
|
|
11190
|
-
|
|
11190
|
+
L(fe.blob, X);
|
|
11191
11191
|
},
|
|
11192
11192
|
/**
|
|
11193
11193
|
* This method gets a blob from indexed-DB storage.
|
|
@@ -11366,16 +11366,16 @@ var ma = {}, ri = {
|
|
|
11366
11366
|
this[ue] = Ae[ue];
|
|
11367
11367
|
return l = this, Ae;
|
|
11368
11368
|
}
|
|
11369
|
-
t.version = "5.6.2", s.exports = t, t.getFromDisk = function(
|
|
11369
|
+
t.version = "5.6.2", s.exports = t, t.getFromDisk = function(R, e) {
|
|
11370
11370
|
if (!e)
|
|
11371
11371
|
throw "callback is mandatory.";
|
|
11372
|
-
console.log("Getting recorded " + (
|
|
11373
|
-
|
|
11372
|
+
console.log("Getting recorded " + (R === "all" ? "blobs" : R + " blob ") + " from disk!"), at.Fetch(function(l, m) {
|
|
11373
|
+
R !== "all" && m === R + "Blob" && e && e(l), R === "all" && e && e(l, m.replace("Blob", ""));
|
|
11374
11374
|
});
|
|
11375
|
-
}, t.writeToDisk = function(
|
|
11376
|
-
console.log("Writing recorded blob(s) to disk!"),
|
|
11377
|
-
|
|
11378
|
-
|
|
11375
|
+
}, t.writeToDisk = function(R) {
|
|
11376
|
+
console.log("Writing recorded blob(s) to disk!"), R = R || {}, R.audio && R.video && R.gif ? R.audio.getDataURL(function(e) {
|
|
11377
|
+
R.video.getDataURL(function(l) {
|
|
11378
|
+
R.gif.getDataURL(function(m) {
|
|
11379
11379
|
at.Store({
|
|
11380
11380
|
audioBlob: e,
|
|
11381
11381
|
videoBlob: l,
|
|
@@ -11383,36 +11383,36 @@ var ma = {}, ri = {
|
|
|
11383
11383
|
});
|
|
11384
11384
|
});
|
|
11385
11385
|
});
|
|
11386
|
-
}) :
|
|
11387
|
-
|
|
11386
|
+
}) : R.audio && R.video ? R.audio.getDataURL(function(e) {
|
|
11387
|
+
R.video.getDataURL(function(l) {
|
|
11388
11388
|
at.Store({
|
|
11389
11389
|
audioBlob: e,
|
|
11390
11390
|
videoBlob: l
|
|
11391
11391
|
});
|
|
11392
11392
|
});
|
|
11393
|
-
}) :
|
|
11394
|
-
|
|
11393
|
+
}) : R.audio && R.gif ? R.audio.getDataURL(function(e) {
|
|
11394
|
+
R.gif.getDataURL(function(l) {
|
|
11395
11395
|
at.Store({
|
|
11396
11396
|
audioBlob: e,
|
|
11397
11397
|
gifBlob: l
|
|
11398
11398
|
});
|
|
11399
11399
|
});
|
|
11400
|
-
}) :
|
|
11401
|
-
|
|
11400
|
+
}) : R.video && R.gif ? R.video.getDataURL(function(e) {
|
|
11401
|
+
R.gif.getDataURL(function(l) {
|
|
11402
11402
|
at.Store({
|
|
11403
11403
|
videoBlob: e,
|
|
11404
11404
|
gifBlob: l
|
|
11405
11405
|
});
|
|
11406
11406
|
});
|
|
11407
|
-
}) :
|
|
11407
|
+
}) : R.audio ? R.audio.getDataURL(function(e) {
|
|
11408
11408
|
at.Store({
|
|
11409
11409
|
audioBlob: e
|
|
11410
11410
|
});
|
|
11411
|
-
}) :
|
|
11411
|
+
}) : R.video ? R.video.getDataURL(function(e) {
|
|
11412
11412
|
at.Store({
|
|
11413
11413
|
videoBlob: e
|
|
11414
11414
|
});
|
|
11415
|
-
}) :
|
|
11415
|
+
}) : R.gif && R.gif.getDataURL(function(e) {
|
|
11416
11416
|
at.Store({
|
|
11417
11417
|
gifBlob: e
|
|
11418
11418
|
});
|
|
@@ -11431,8 +11431,8 @@ var ma = {}, ri = {
|
|
|
11431
11431
|
* @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
|
|
11432
11432
|
* @param {object} config - {type:"video", disableLogs: true, numberOfAudioChannels: 1, bufferSize: 0, sampleRate: 0, video: HTMLVideoElement, getNativeBlob:true, etc.}
|
|
11433
11433
|
*/
|
|
11434
|
-
function f(
|
|
11435
|
-
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 === Be || typeof je < "u" && e.recorderType === je ? e.type = "video" : e.recorderType === et ? e.type = "gif" : e.recorderType === Xe ? e.type = "audio" : e.recorderType === He && (Te(
|
|
11434
|
+
function f(R, e) {
|
|
11435
|
+
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 === Be || typeof je < "u" && e.recorderType === je ? e.type = "video" : e.recorderType === et ? e.type = "gif" : e.recorderType === Xe ? e.type = "audio" : e.recorderType === He && (Te(R, "audio").length && Te(R, "video").length || !Te(R, "audio").length && Te(R, "video").length ? e.type = "video" : Te(R, "audio").length && !Te(R, "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;
|
|
11436
11436
|
}
|
|
11437
11437
|
/**
|
|
11438
11438
|
* {@link GetRecorderType} is an inner/private helper for {@link RecordRTC}.
|
|
@@ -11448,9 +11448,9 @@ var ma = {}, ri = {
|
|
|
11448
11448
|
* @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
|
|
11449
11449
|
* @param {object} config - {type:"video", disableLogs: true, numberOfAudioChannels: 1, bufferSize: 0, sampleRate: 0, video: HTMLVideoElement, etc.}
|
|
11450
11450
|
*/
|
|
11451
|
-
function h(
|
|
11451
|
+
function h(R, e) {
|
|
11452
11452
|
var l;
|
|
11453
|
-
return (te || Se || Ee) && (l = Xe), typeof MediaRecorder < "u" && "requestData" in MediaRecorder.prototype && !te && (l = He), e.type === "video" && (te || Ee) && (l = W, typeof je < "u" && typeof ReadableStream < "u" && (l = je)), e.type === "gif" && (l = et), e.type === "canvas" && (l = Be), Ge() && l !== Be && l !== et && typeof MediaRecorder < "u" && "requestData" in MediaRecorder.prototype && (Te(
|
|
11453
|
+
return (te || Se || Ee) && (l = Xe), typeof MediaRecorder < "u" && "requestData" in MediaRecorder.prototype && !te && (l = He), e.type === "video" && (te || Ee) && (l = W, typeof je < "u" && typeof ReadableStream < "u" && (l = je)), e.type === "gif" && (l = et), e.type === "canvas" && (l = Be), Ge() && l !== Be && l !== et && typeof MediaRecorder < "u" && "requestData" in MediaRecorder.prototype && (Te(R, "video").length || Te(R, "audio").length) && (e.type === "audio" ? typeof MediaRecorder.isTypeSupported == "function" && MediaRecorder.isTypeSupported("audio/webm") && (l = He) : typeof MediaRecorder.isTypeSupported == "function" && MediaRecorder.isTypeSupported("video/webm") && (l = He)), R instanceof Array && R.length && (l = _t), e.recorderType && (l = e.recorderType), !e.disableLogs && l && l.name && console.log("Using recorderType:", l.name || l.constructor.name), !l && ie && (l = He), l;
|
|
11454
11454
|
}
|
|
11455
11455
|
/**
|
|
11456
11456
|
* MRecordRTC runs on top of {@link RecordRTC} to bring multiple recordings in a single place, by providing simple API.
|
|
@@ -11479,9 +11479,9 @@ var ma = {}, ri = {
|
|
|
11479
11479
|
* @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
|
|
11480
11480
|
* @requires {@link RecordRTC}
|
|
11481
11481
|
*/
|
|
11482
|
-
function U(
|
|
11482
|
+
function U(R) {
|
|
11483
11483
|
this.addStream = function(e) {
|
|
11484
|
-
e && (
|
|
11484
|
+
e && (R = e);
|
|
11485
11485
|
}, this.mediaType = {
|
|
11486
11486
|
audio: !0,
|
|
11487
11487
|
video: !0
|
|
@@ -11491,9 +11491,9 @@ var ma = {}, ri = {
|
|
|
11491
11491
|
video: null,
|
|
11492
11492
|
gif: null
|
|
11493
11493
|
};
|
|
11494
|
-
if (typeof e.audio != "function" && Ge() && !Te(
|
|
11494
|
+
if (typeof e.audio != "function" && Ge() && !Te(R, "audio").length && (e.audio = !1), typeof e.video != "function" && Ge() && !Te(R, "video").length && (e.video = !1), typeof e.gif != "function" && Ge() && !Te(R, "video").length && (e.gif = !1), !e.audio && !e.video && !e.gif)
|
|
11495
11495
|
throw "MediaStream must have either audio or video tracks.";
|
|
11496
|
-
if (e.audio && (l = null, typeof e.audio == "function" && (l = e.audio), this.audioRecorder = new t(
|
|
11496
|
+
if (e.audio && (l = null, typeof e.audio == "function" && (l = e.audio), this.audioRecorder = new t(R, {
|
|
11497
11497
|
type: "audio",
|
|
11498
11498
|
bufferSize: this.bufferSize,
|
|
11499
11499
|
sampleRate: this.sampleRate,
|
|
@@ -11505,9 +11505,9 @@ var ma = {}, ri = {
|
|
|
11505
11505
|
onTimeStamp: this.onTimeStamp
|
|
11506
11506
|
}), e.video || this.audioRecorder.startRecording()), e.video) {
|
|
11507
11507
|
l = null, typeof e.video == "function" && (l = e.video);
|
|
11508
|
-
var M =
|
|
11508
|
+
var M = R;
|
|
11509
11509
|
if (Ge() && e.audio && typeof e.audio == "function") {
|
|
11510
|
-
var S = Te(
|
|
11510
|
+
var S = Te(R, "video")[0];
|
|
11511
11511
|
Ie ? (M = new we(), M.addTrack(S), l && l === W && (l = He)) : (M = new we(), M.addTrack(S));
|
|
11512
11512
|
}
|
|
11513
11513
|
this.videoRecorder = new t(M, {
|
|
@@ -11536,7 +11536,7 @@ var ma = {}, ri = {
|
|
|
11536
11536
|
});
|
|
11537
11537
|
});
|
|
11538
11538
|
}
|
|
11539
|
-
e.gif && (l = null, typeof e.gif == "function" && (l = e.gif), this.gifRecorder = new t(
|
|
11539
|
+
e.gif && (l = null, typeof e.gif == "function" && (l = e.gif), this.gifRecorder = new t(R, {
|
|
11540
11540
|
type: "gif",
|
|
11541
11541
|
frameRate: this.frameRate || 200,
|
|
11542
11542
|
quality: this.quality || 10,
|
|
@@ -11626,15 +11626,15 @@ var ma = {}, ri = {
|
|
|
11626
11626
|
};
|
|
11627
11627
|
}
|
|
11628
11628
|
U.getFromDisk = t.getFromDisk, U.writeToDisk = t.writeToDisk, typeof t < "u" && (t.MRecordRTC = U);
|
|
11629
|
-
var
|
|
11630
|
-
(function(
|
|
11631
|
-
|
|
11632
|
-
userAgent:
|
|
11629
|
+
var E = "Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45";
|
|
11630
|
+
(function(R) {
|
|
11631
|
+
R && (typeof window < "u" || typeof st > "u" || (st.navigator = {
|
|
11632
|
+
userAgent: E,
|
|
11633
11633
|
getUserMedia: function() {
|
|
11634
11634
|
}
|
|
11635
11635
|
}, st.console || (st.console = {}), (typeof st.console.log > "u" || typeof st.console.error > "u") && (st.console.error = st.console.log = st.console.log || function() {
|
|
11636
11636
|
console.log(arguments);
|
|
11637
|
-
}), typeof document > "u" && (
|
|
11637
|
+
}), typeof document > "u" && (R.document = {
|
|
11638
11638
|
documentElement: {
|
|
11639
11639
|
appendChild: function() {
|
|
11640
11640
|
return "";
|
|
@@ -11657,22 +11657,22 @@ var ma = {}, ri = {
|
|
|
11657
11657
|
style: {}
|
|
11658
11658
|
};
|
|
11659
11659
|
return e;
|
|
11660
|
-
},
|
|
11661
|
-
}), typeof location > "u" && (
|
|
11660
|
+
}, R.HTMLVideoElement = function() {
|
|
11661
|
+
}), typeof location > "u" && (R.location = {
|
|
11662
11662
|
protocol: "file:",
|
|
11663
11663
|
href: "",
|
|
11664
11664
|
hash: ""
|
|
11665
|
-
}), typeof screen > "u" && (
|
|
11665
|
+
}), typeof screen > "u" && (R.screen = {
|
|
11666
11666
|
width: 0,
|
|
11667
11667
|
height: 0
|
|
11668
|
-
}), typeof be > "u" && (
|
|
11668
|
+
}), typeof be > "u" && (R.URL = {
|
|
11669
11669
|
createObjectURL: function() {
|
|
11670
11670
|
return "";
|
|
11671
11671
|
},
|
|
11672
11672
|
revokeObjectURL: function() {
|
|
11673
11673
|
return "";
|
|
11674
11674
|
}
|
|
11675
|
-
}),
|
|
11675
|
+
}), R.window = st));
|
|
11676
11676
|
})(typeof st < "u" ? st : null);
|
|
11677
11677
|
var P = window.requestAnimationFrame;
|
|
11678
11678
|
if (typeof P > "u") {
|
|
@@ -11684,17 +11684,17 @@ var ma = {}, ri = {
|
|
|
11684
11684
|
P = msRequestAnimationFrame;
|
|
11685
11685
|
else if (typeof P > "u") {
|
|
11686
11686
|
var K = 0;
|
|
11687
|
-
P = function(
|
|
11687
|
+
P = function(R, e) {
|
|
11688
11688
|
var l = new Date().getTime(), m = Math.max(0, 16 - (l - K)), M = setTimeout(function() {
|
|
11689
|
-
|
|
11689
|
+
R(l + m);
|
|
11690
11690
|
}, m);
|
|
11691
11691
|
return K = l + m, M;
|
|
11692
11692
|
};
|
|
11693
11693
|
}
|
|
11694
11694
|
}
|
|
11695
11695
|
var ve = window.cancelAnimationFrame;
|
|
11696
|
-
typeof ve > "u" && (typeof webkitCancelAnimationFrame < "u" ? ve = webkitCancelAnimationFrame : typeof mozCancelAnimationFrame < "u" ? ve = mozCancelAnimationFrame : typeof msCancelAnimationFrame < "u" ? ve = msCancelAnimationFrame : typeof ve > "u" && (ve = function(
|
|
11697
|
-
clearTimeout(
|
|
11696
|
+
typeof ve > "u" && (typeof webkitCancelAnimationFrame < "u" ? ve = webkitCancelAnimationFrame : typeof mozCancelAnimationFrame < "u" ? ve = mozCancelAnimationFrame : typeof msCancelAnimationFrame < "u" ? ve = msCancelAnimationFrame : typeof ve > "u" && (ve = function(R) {
|
|
11697
|
+
clearTimeout(R);
|
|
11698
11698
|
}));
|
|
11699
11699
|
var Me = window.AudioContext;
|
|
11700
11700
|
typeof Me > "u" && (typeof webkitAudioContext < "u" && (Me = webkitAudioContext), typeof mozAudioContext < "u" && (Me = mozAudioContext));
|
|
@@ -11704,37 +11704,37 @@ var ma = {}, ri = {
|
|
|
11704
11704
|
ie && !te && navigator.userAgent.indexOf("CriOS") !== -1 && (ie = !1, te = !0);
|
|
11705
11705
|
var we = window.MediaStream;
|
|
11706
11706
|
typeof we > "u" && typeof webkitMediaStream < "u" && (we = webkitMediaStream), typeof we < "u" && typeof we.prototype.stop > "u" && (we.prototype.stop = function() {
|
|
11707
|
-
this.getTracks().forEach(function(
|
|
11708
|
-
|
|
11707
|
+
this.getTracks().forEach(function(R) {
|
|
11708
|
+
R.stop();
|
|
11709
11709
|
});
|
|
11710
11710
|
});
|
|
11711
|
-
function Ue(
|
|
11711
|
+
function Ue(R) {
|
|
11712
11712
|
var e = 1e3, l = ["Bytes", "KB", "MB", "GB", "TB"];
|
|
11713
|
-
if (
|
|
11713
|
+
if (R === 0)
|
|
11714
11714
|
return "0 Bytes";
|
|
11715
|
-
var m = parseInt(Math.floor(Math.log(
|
|
11716
|
-
return (
|
|
11715
|
+
var m = parseInt(Math.floor(Math.log(R) / Math.log(e)), 10);
|
|
11716
|
+
return (R / Math.pow(e, m)).toPrecision(3) + " " + l[m];
|
|
11717
11717
|
}
|
|
11718
|
-
function
|
|
11719
|
-
if (!
|
|
11718
|
+
function L(R, e) {
|
|
11719
|
+
if (!R)
|
|
11720
11720
|
throw "Blob object is required.";
|
|
11721
|
-
if (!
|
|
11721
|
+
if (!R.type)
|
|
11722
11722
|
try {
|
|
11723
|
-
|
|
11723
|
+
R.type = "video/webm";
|
|
11724
11724
|
} catch {
|
|
11725
11725
|
}
|
|
11726
|
-
var l = (
|
|
11726
|
+
var l = (R.type || "video/webm").split("/")[1];
|
|
11727
11727
|
if (l.indexOf(";") !== -1 && (l = l.split(";")[0]), e && e.indexOf(".") !== -1) {
|
|
11728
11728
|
var m = e.split(".");
|
|
11729
11729
|
e = m[0], l = m[1];
|
|
11730
11730
|
}
|
|
11731
11731
|
var M = (e || Math.round(Math.random() * 9999999999) + 888888888) + "." + l;
|
|
11732
11732
|
if (typeof navigator.msSaveOrOpenBlob < "u")
|
|
11733
|
-
return navigator.msSaveOrOpenBlob(
|
|
11733
|
+
return navigator.msSaveOrOpenBlob(R, M);
|
|
11734
11734
|
if (typeof navigator.msSaveBlob < "u")
|
|
11735
|
-
return navigator.msSaveBlob(
|
|
11735
|
+
return navigator.msSaveBlob(R, M);
|
|
11736
11736
|
var S = document.createElement("a");
|
|
11737
|
-
S.href = be.createObjectURL(
|
|
11737
|
+
S.href = be.createObjectURL(R), S.download = M, S.style = "display:none;opacity:0;color:transparent;", (document.body || document.documentElement).appendChild(S), typeof S.click == "function" ? S.click() : (S.target = "_blank", S.dispatchEvent(new MouseEvent("click", {
|
|
11738
11738
|
view: window,
|
|
11739
11739
|
bubbles: !0,
|
|
11740
11740
|
cancelable: !0
|
|
@@ -11743,15 +11743,15 @@ var ma = {}, ri = {
|
|
|
11743
11743
|
function he() {
|
|
11744
11744
|
return !!(typeof window < "u" && typeof window.process == "object" && window.process.type === "renderer" || typeof process < "u" && typeof process.versions == "object" && process.versions.electron || typeof navigator == "object" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Electron") >= 0);
|
|
11745
11745
|
}
|
|
11746
|
-
function Te(
|
|
11747
|
-
return !
|
|
11746
|
+
function Te(R, e) {
|
|
11747
|
+
return !R || !R.getTracks ? [] : R.getTracks().filter(function(l) {
|
|
11748
11748
|
return l.kind === (e || "audio");
|
|
11749
11749
|
});
|
|
11750
11750
|
}
|
|
11751
|
-
function Fe(
|
|
11752
|
-
"srcObject" in e ? e.srcObject =
|
|
11751
|
+
function Fe(R, e) {
|
|
11752
|
+
"srcObject" in e ? e.srcObject = R : "mozSrcObject" in e ? e.mozSrcObject = R : e.srcObject = R;
|
|
11753
11753
|
}
|
|
11754
|
-
function Qe(
|
|
11754
|
+
function Qe(R, e) {
|
|
11755
11755
|
if (typeof EBML > "u")
|
|
11756
11756
|
throw new Error("Please link: https://www.webrtc-experiment.com/EBML.js");
|
|
11757
11757
|
var l = new EBML.Reader(), m = new EBML.Decoder(), M = EBML.tools, S = new FileReader();
|
|
@@ -11764,9 +11764,9 @@ var ma = {}, ri = {
|
|
|
11764
11764
|
type: "video/webm"
|
|
11765
11765
|
});
|
|
11766
11766
|
e(se);
|
|
11767
|
-
}, S.readAsArrayBuffer(
|
|
11767
|
+
}, S.readAsArrayBuffer(R);
|
|
11768
11768
|
}
|
|
11769
|
-
typeof t < "u" && (t.invokeSaveAsDialog =
|
|
11769
|
+
typeof t < "u" && (t.invokeSaveAsDialog = L, t.getTracks = Te, t.getSeekableBlob = Qe, t.bytesToSize = Ue, t.isElectron = he);
|
|
11770
11770
|
/**
|
|
11771
11771
|
* Storage is a standalone object used by {@link RecordRTC} to store reusable objects e.g. "new AudioContext".
|
|
11772
11772
|
* @license {@link https://github.com/muaz-khan/RecordRTC/blob/master/LICENSE|MIT}
|
|
@@ -11781,8 +11781,8 @@ var ma = {}, ri = {
|
|
|
11781
11781
|
function Ge() {
|
|
11782
11782
|
if (Ie || ie || Se)
|
|
11783
11783
|
return !0;
|
|
11784
|
-
var
|
|
11785
|
-
return (te || Ee) && (m =
|
|
11784
|
+
var R = navigator.userAgent, e = "" + parseFloat(navigator.appVersion), l = parseInt(navigator.appVersion, 10), m, M;
|
|
11785
|
+
return (te || Ee) && (m = R.indexOf("Chrome"), e = R.substring(m + 7)), (M = e.indexOf(";")) !== -1 && (e = e.substring(0, M)), (M = e.indexOf(" ")) !== -1 && (e = e.substring(0, M)), l = parseInt("" + e, 10), isNaN(l) && (e = "" + parseFloat(navigator.appVersion), l = parseInt(navigator.appVersion, 10)), l >= 49;
|
|
11786
11786
|
}
|
|
11787
11787
|
/**
|
|
11788
11788
|
* MediaStreamRecorder is an abstraction layer for {@link https://w3c.github.io/mediacapture-record/MediaRecorder.html|MediaRecorder API}. It is used by {@link RecordRTC} to record MediaStream(s) in both Chrome and Firefox.
|
|
@@ -11814,9 +11814,9 @@ var ma = {}, ri = {
|
|
|
11814
11814
|
* @param {object} config - {disableLogs:true, initCallback: function, mimeType: "video/webm", timeSlice: 1000}
|
|
11815
11815
|
* @throws Will throw an error if first argument "MediaStream" is missing. Also throws error if "MediaRecorder API" are not supported by the browser.
|
|
11816
11816
|
*/
|
|
11817
|
-
function He(
|
|
11817
|
+
function He(R, e) {
|
|
11818
11818
|
var se = this;
|
|
11819
|
-
if (typeof
|
|
11819
|
+
if (typeof R > "u")
|
|
11820
11820
|
throw 'First argument "MediaStream" is required.';
|
|
11821
11821
|
if (typeof MediaRecorder > "u")
|
|
11822
11822
|
throw "Your browser does not support the Media Recorder API. Please try other modules e.g. WhammyRecorder or StereoAudioRecorder.";
|
|
@@ -11824,9 +11824,9 @@ var ma = {}, ri = {
|
|
|
11824
11824
|
// bitsPerSecond: 256 * 8 * 1024,
|
|
11825
11825
|
mimeType: "video/webm"
|
|
11826
11826
|
}, e.type === "audio") {
|
|
11827
|
-
if (Te(
|
|
11827
|
+
if (Te(R, "video").length && Te(R, "audio").length) {
|
|
11828
11828
|
var l;
|
|
11829
|
-
navigator.mozGetUserMedia ? (l = new we(), l.addTrack(Te(
|
|
11829
|
+
navigator.mozGetUserMedia ? (l = new we(), l.addTrack(Te(R, "audio")[0])) : l = new we(Te(R, "audio")), R = l;
|
|
11830
11830
|
}
|
|
11831
11831
|
(!e.mimeType || e.mimeType.toString().toLowerCase().indexOf("audio") === -1) && (e.mimeType = te ? "audio/webm" : "audio/ogg"), e.mimeType && e.mimeType.toString().toLowerCase() !== "audio/ogg" && navigator.mozGetUserMedia && (e.mimeType = "audio/ogg");
|
|
11832
11832
|
}
|
|
@@ -11838,9 +11838,9 @@ var ma = {}, ri = {
|
|
|
11838
11838
|
var ye = e;
|
|
11839
11839
|
e.disableLogs || console.log("Passing following config over MediaRecorder API.", ye), N && (N = null), te && !Ge() && (ye = "video/vp8"), typeof MediaRecorder.isTypeSupported == "function" && ye.mimeType && (MediaRecorder.isTypeSupported(ye.mimeType) || (e.disableLogs || console.warn("MediaRecorder API seems unable to record mimeType:", ye.mimeType), ye.mimeType = e.type === "audio" ? "audio/webm" : "video/webm"));
|
|
11840
11840
|
try {
|
|
11841
|
-
N = new MediaRecorder(
|
|
11841
|
+
N = new MediaRecorder(R, ye), e.mimeType = ye.mimeType;
|
|
11842
11842
|
} catch {
|
|
11843
|
-
N = new MediaRecorder(
|
|
11843
|
+
N = new MediaRecorder(R);
|
|
11844
11844
|
}
|
|
11845
11845
|
ye.mimeType && !MediaRecorder.isTypeSupported && "canRecordMimeType" in N && N.canRecordMimeType(ye.mimeType) === !1 && (e.disableLogs || console.warn("MediaRecorder API seems unable to record mimeType:", ye.mimeType)), N.ondataavailable = function(xe) {
|
|
11846
11846
|
if (xe.data && ee.push("ondataavailable: " + Ue(xe.data.size)), typeof e.timeSlice == "number") {
|
|
@@ -11907,10 +11907,10 @@ var ma = {}, ri = {
|
|
|
11907
11907
|
return N;
|
|
11908
11908
|
};
|
|
11909
11909
|
function o() {
|
|
11910
|
-
if ("active" in
|
|
11911
|
-
if (!
|
|
11910
|
+
if ("active" in R) {
|
|
11911
|
+
if (!R.active)
|
|
11912
11912
|
return !1;
|
|
11913
|
-
} else if ("ended" in
|
|
11913
|
+
} else if ("ended" in R && R.ended)
|
|
11914
11914
|
return !1;
|
|
11915
11915
|
return !0;
|
|
11916
11916
|
}
|
|
@@ -11955,8 +11955,8 @@ var ma = {}, ri = {
|
|
|
11955
11955
|
* @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
|
|
11956
11956
|
* @param {object} config - {sampleRate: 44100, bufferSize: 4096, numberOfAudioChannels: 1, etc.}
|
|
11957
11957
|
*/
|
|
11958
|
-
function Xe(
|
|
11959
|
-
if (!Te(
|
|
11958
|
+
function Xe(R, e) {
|
|
11959
|
+
if (!Te(R, "audio").length)
|
|
11960
11960
|
throw "Your stream has no audio tracks.";
|
|
11961
11961
|
e = e || {};
|
|
11962
11962
|
var l = this, m = [], M = [], S = !1, $ = 0, N, o = 2, ee = e.desiredSampRate;
|
|
@@ -11964,10 +11964,10 @@ var ma = {}, ri = {
|
|
|
11964
11964
|
function se() {
|
|
11965
11965
|
if (e.checkForInactiveTracks === !1)
|
|
11966
11966
|
return !0;
|
|
11967
|
-
if ("active" in
|
|
11968
|
-
if (!
|
|
11967
|
+
if ("active" in R) {
|
|
11968
|
+
if (!R.active)
|
|
11969
11969
|
return !1;
|
|
11970
|
-
} else if ("ended" in
|
|
11970
|
+
} else if ("ended" in R && R.ended)
|
|
11971
11971
|
return !1;
|
|
11972
11972
|
return !0;
|
|
11973
11973
|
}
|
|
@@ -12063,7 +12063,7 @@ var ma = {}, ri = {
|
|
|
12063
12063
|
AudioContextConstructor: null,
|
|
12064
12064
|
AudioContext: window.AudioContext || window.webkitAudioContext
|
|
12065
12065
|
}), (!t.Storage.AudioContextConstructor || t.Storage.AudioContextConstructor.state === "closed") && (t.Storage.AudioContextConstructor = new t.Storage.AudioContext());
|
|
12066
|
-
var le = t.Storage.AudioContextConstructor, fe = le.createMediaStreamSource(
|
|
12066
|
+
var le = t.Storage.AudioContextConstructor, fe = le.createMediaStreamSource(R), Ae = [0, 256, 512, 1024, 2048, 4096, 8192, 16384], ue = typeof e.bufferSize > "u" ? 4096 : e.bufferSize;
|
|
12067
12067
|
if (Ae.indexOf(ue) === -1 && (e.disableLogs || console.log("Legal values for buffer-size are " + JSON.stringify(Ae, null, " "))), le.createJavaScriptNode)
|
|
12068
12068
|
N = le.createJavaScriptNode(ue, o, o);
|
|
12069
12069
|
else if (le.createScriptProcessor)
|
|
@@ -12160,7 +12160,7 @@ var ma = {}, ri = {
|
|
|
12160
12160
|
* @param {HTMLElement} htmlElement - querySelector/getElementById/getElementsByTagName[0]/etc.
|
|
12161
12161
|
* @param {object} config - {disableLogs:true, initCallback: function}
|
|
12162
12162
|
*/
|
|
12163
|
-
function Be(
|
|
12163
|
+
function Be(R, e) {
|
|
12164
12164
|
if (typeof html2canvas > "u")
|
|
12165
12165
|
throw "Please link: https://www.webrtc-experiment.com/screenshot.js";
|
|
12166
12166
|
e = e || {}, e.frameInterval || (e.frameInterval = 10);
|
|
@@ -12172,10 +12172,10 @@ var ma = {}, ri = {
|
|
|
12172
12172
|
m && S && S[2] && (M = parseInt(S[2], 10)), m && M < 52 && (l = !1), e.useWhammyRecorder && (l = !1);
|
|
12173
12173
|
var $, N;
|
|
12174
12174
|
if (l)
|
|
12175
|
-
if (e.disableLogs || console.log("Your browser supports both MediRecorder API and canvas.captureStream!"),
|
|
12176
|
-
$ =
|
|
12177
|
-
else if (
|
|
12178
|
-
$ =
|
|
12175
|
+
if (e.disableLogs || console.log("Your browser supports both MediRecorder API and canvas.captureStream!"), R instanceof HTMLCanvasElement)
|
|
12176
|
+
$ = R;
|
|
12177
|
+
else if (R instanceof CanvasRenderingContext2D)
|
|
12178
|
+
$ = R.canvas;
|
|
12179
12179
|
else
|
|
12180
12180
|
throw "Please pass either HTMLCanvasElement or CanvasRenderingContext2D.";
|
|
12181
12181
|
else
|
|
@@ -12199,7 +12199,7 @@ var ma = {}, ri = {
|
|
|
12199
12199
|
fe.frames = [], le = new Date().getTime(), xe();
|
|
12200
12200
|
e.initCallback && e.initCallback();
|
|
12201
12201
|
}, this.getWebPImages = function(Ae) {
|
|
12202
|
-
if (
|
|
12202
|
+
if (R.nodeName.toLowerCase() !== "canvas") {
|
|
12203
12203
|
Ae();
|
|
12204
12204
|
return;
|
|
12205
12205
|
}
|
|
@@ -12248,12 +12248,12 @@ var ma = {}, ri = {
|
|
|
12248
12248
|
};
|
|
12249
12249
|
function ye() {
|
|
12250
12250
|
var Ae = document.createElement("canvas"), ue = Ae.getContext("2d");
|
|
12251
|
-
return Ae.width =
|
|
12251
|
+
return Ae.width = R.width, Ae.height = R.height, ue.drawImage(R, 0, 0), Ae;
|
|
12252
12252
|
}
|
|
12253
12253
|
function xe() {
|
|
12254
12254
|
if (ee)
|
|
12255
12255
|
return le = new Date().getTime(), setTimeout(xe, 500);
|
|
12256
|
-
if (
|
|
12256
|
+
if (R.nodeName.toLowerCase() === "canvas") {
|
|
12257
12257
|
var Ae = new Date().getTime() - le;
|
|
12258
12258
|
le = new Date().getTime(), fe.frames.push({
|
|
12259
12259
|
image: ye(),
|
|
@@ -12261,7 +12261,7 @@ var ma = {}, ri = {
|
|
|
12261
12261
|
}), o && setTimeout(xe, e.frameInterval);
|
|
12262
12262
|
return;
|
|
12263
12263
|
}
|
|
12264
|
-
html2canvas(
|
|
12264
|
+
html2canvas(R, {
|
|
12265
12265
|
grabMouse: typeof e.showMousePointer > "u" || e.showMousePointer,
|
|
12266
12266
|
onrendered: function(ue) {
|
|
12267
12267
|
var X = new Date().getTime() - le;
|
|
@@ -12294,7 +12294,7 @@ var ma = {}, ri = {
|
|
|
12294
12294
|
* @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
|
|
12295
12295
|
* @param {object} config - {disableLogs: true, initCallback: function, video: HTMLVideoElement, etc.}
|
|
12296
12296
|
*/
|
|
12297
|
-
function W(
|
|
12297
|
+
function W(R, e) {
|
|
12298
12298
|
e = e || {}, e.frameInterval || (e.frameInterval = 10), e.disableLogs || console.log("Using frames-interval:", e.frameInterval), this.record = function() {
|
|
12299
12299
|
e.width || (e.width = 320), e.height || (e.height = 240), e.video || (e.video = {
|
|
12300
12300
|
width: e.width,
|
|
@@ -12302,7 +12302,7 @@ var ma = {}, ri = {
|
|
|
12302
12302
|
}), e.canvas || (e.canvas = {
|
|
12303
12303
|
width: e.width,
|
|
12304
12304
|
height: e.height
|
|
12305
|
-
}), o.width = e.canvas.width || 320, o.height = e.canvas.height || 240, ee = o.getContext("2d"), e.video && e.video instanceof HTMLVideoElement ? (se = e.video.cloneNode(), e.initCallback && e.initCallback()) : (se = document.createElement("video"), Fe(
|
|
12305
|
+
}), o.width = e.canvas.width || 320, o.height = e.canvas.height || 240, ee = o.getContext("2d"), e.video && e.video instanceof HTMLVideoElement ? (se = e.video.cloneNode(), e.initCallback && e.initCallback()) : (se = document.createElement("video"), Fe(R, se), se.onloadedmetadata = function() {
|
|
12306
12306
|
e.initCallback && e.initCallback();
|
|
12307
12307
|
}, se.width = e.video.width, se.height = e.video.height), se.muted = !0, se.play(), ye = new Date().getTime(), xe = new pt.Video(), e.disableLogs || (console.log("canvas resolutions", o.width, "*", o.height), console.log("video width/height", se.width || o.width, "*", se.height || o.height)), l(e.frameInterval);
|
|
12308
12308
|
};
|
|
@@ -12419,10 +12419,10 @@ var ma = {}, ri = {
|
|
|
12419
12419
|
* @see {@link https://github.com/muaz-khan/RecordRTC|RecordRTC Source Code}
|
|
12420
12420
|
*/
|
|
12421
12421
|
var pt = function() {
|
|
12422
|
-
function
|
|
12422
|
+
function R(m) {
|
|
12423
12423
|
this.frames = [], this.duration = m || 1, this.quality = 0.8;
|
|
12424
12424
|
}
|
|
12425
|
-
|
|
12425
|
+
R.prototype.add = function(m, M) {
|
|
12426
12426
|
if ("canvas" in m && (m = m.canvas), "toDataURL" in m && (m = m.toDataURL("image/webp", this.quality)), !/^data:image\/webp;base64,/ig.test(m))
|
|
12427
12427
|
throw "Input must be formatted properly as a base64 encoded DataURI of type image/webp";
|
|
12428
12428
|
this.frames.push({
|
|
@@ -12674,7 +12674,7 @@ var ma = {}, ri = {
|
|
|
12674
12674
|
}));
|
|
12675
12675
|
postMessage(ue);
|
|
12676
12676
|
}
|
|
12677
|
-
return
|
|
12677
|
+
return R.prototype.compile = function(m) {
|
|
12678
12678
|
var M = e(l);
|
|
12679
12679
|
M.onmessage = function(S) {
|
|
12680
12680
|
if (S.data.error) {
|
|
@@ -12693,7 +12693,7 @@ var ma = {}, ri = {
|
|
|
12693
12693
|
* @param {?number} speed - 0.8
|
|
12694
12694
|
* @param {?number} quality - 100
|
|
12695
12695
|
*/
|
|
12696
|
-
Video:
|
|
12696
|
+
Video: R
|
|
12697
12697
|
};
|
|
12698
12698
|
}();
|
|
12699
12699
|
typeof t < "u" && (t.Whammy = pt);
|
|
@@ -12732,27 +12732,27 @@ var ma = {}, ri = {
|
|
|
12732
12732
|
* DiskStorage.init();
|
|
12733
12733
|
*/
|
|
12734
12734
|
init: function() {
|
|
12735
|
-
var
|
|
12735
|
+
var R = this;
|
|
12736
12736
|
if (typeof indexedDB > "u" || typeof indexedDB.open > "u") {
|
|
12737
12737
|
console.error("IndexedDB API are not available in this browser.");
|
|
12738
12738
|
return;
|
|
12739
12739
|
}
|
|
12740
12740
|
var e = 1, l = this.dbName || location.href.replace(/\/|:|#|%|\.|\[|\]/g, ""), m, M = indexedDB.open(l, e);
|
|
12741
12741
|
function S(N) {
|
|
12742
|
-
N.createObjectStore(
|
|
12742
|
+
N.createObjectStore(R.dataStoreName);
|
|
12743
12743
|
}
|
|
12744
12744
|
function $() {
|
|
12745
|
-
var N = m.transaction([
|
|
12746
|
-
|
|
12745
|
+
var N = m.transaction([R.dataStoreName], "readwrite");
|
|
12746
|
+
R.videoBlob && N.objectStore(R.dataStoreName).put(R.videoBlob, "videoBlob"), R.gifBlob && N.objectStore(R.dataStoreName).put(R.gifBlob, "gifBlob"), R.audioBlob && N.objectStore(R.dataStoreName).put(R.audioBlob, "audioBlob");
|
|
12747
12747
|
function o(ee) {
|
|
12748
|
-
N.objectStore(
|
|
12749
|
-
|
|
12748
|
+
N.objectStore(R.dataStoreName).get(ee).onsuccess = function(se) {
|
|
12749
|
+
R.callback && R.callback(se.target.result, ee);
|
|
12750
12750
|
};
|
|
12751
12751
|
}
|
|
12752
12752
|
o("audioBlob"), o("videoBlob"), o("gifBlob");
|
|
12753
12753
|
}
|
|
12754
|
-
M.onerror =
|
|
12755
|
-
if (m = M.result, m.onerror =
|
|
12754
|
+
M.onerror = R.onError, M.onsuccess = function() {
|
|
12755
|
+
if (m = M.result, m.onerror = R.onError, m.setVersion)
|
|
12756
12756
|
if (m.version !== e) {
|
|
12757
12757
|
var N = m.setVersion(e);
|
|
12758
12758
|
N.onsuccess = function() {
|
|
@@ -12778,8 +12778,8 @@ var ma = {}, ri = {
|
|
|
12778
12778
|
* if(type === 'gifBlob') { }
|
|
12779
12779
|
* });
|
|
12780
12780
|
*/
|
|
12781
|
-
Fetch: function(
|
|
12782
|
-
return this.callback =
|
|
12781
|
+
Fetch: function(R) {
|
|
12782
|
+
return this.callback = R, this.init(), this;
|
|
12783
12783
|
},
|
|
12784
12784
|
/**
|
|
12785
12785
|
* This method stores blobs in IndexedDB.
|
|
@@ -12793,8 +12793,8 @@ var ma = {}, ri = {
|
|
|
12793
12793
|
* gifBlob : yourGifBlob
|
|
12794
12794
|
* });
|
|
12795
12795
|
*/
|
|
12796
|
-
Store: function(
|
|
12797
|
-
return this.audioBlob =
|
|
12796
|
+
Store: function(R) {
|
|
12797
|
+
return this.audioBlob = R.audioBlob, this.videoBlob = R.videoBlob, this.gifBlob = R.gifBlob, this.init(), this;
|
|
12798
12798
|
},
|
|
12799
12799
|
/**
|
|
12800
12800
|
* This function is invoked for any known/unknown error.
|
|
@@ -12806,8 +12806,8 @@ var ma = {}, ri = {
|
|
|
12806
12806
|
* alerot( JSON.stringify(error) );
|
|
12807
12807
|
* };
|
|
12808
12808
|
*/
|
|
12809
|
-
onError: function(
|
|
12810
|
-
console.error(JSON.stringify(
|
|
12809
|
+
onError: function(R) {
|
|
12810
|
+
console.error(JSON.stringify(R, null, " "));
|
|
12811
12811
|
},
|
|
12812
12812
|
/**
|
|
12813
12813
|
* @property {string} dataStoreName - Name of the ObjectStore created in IndexedDB storage.
|
|
@@ -12836,13 +12836,13 @@ var ma = {}, ri = {
|
|
|
12836
12836
|
* @param {MediaStream} mediaStream - MediaStream object or HTMLCanvasElement or CanvasRenderingContext2D.
|
|
12837
12837
|
* @param {object} config - {disableLogs:true, initCallback: function, width: 320, height: 240, frameRate: 200, quality: 10}
|
|
12838
12838
|
*/
|
|
12839
|
-
function et(
|
|
12839
|
+
function et(R, e) {
|
|
12840
12840
|
if (typeof GIFEncoder > "u") {
|
|
12841
12841
|
var l = document.createElement("script");
|
|
12842
12842
|
l.src = "https://www.webrtc-experiment.com/gif-recorder.js", (document.body || document.documentElement).appendChild(l);
|
|
12843
12843
|
}
|
|
12844
12844
|
e = e || {};
|
|
12845
|
-
var m =
|
|
12845
|
+
var m = R instanceof CanvasRenderingContext2D || R instanceof HTMLCanvasElement;
|
|
12846
12846
|
this.record = function() {
|
|
12847
12847
|
if (typeof GIFEncoder > "u") {
|
|
12848
12848
|
setTimeout(le.record, 1e3);
|
|
@@ -12890,18 +12890,18 @@ var ma = {}, ri = {
|
|
|
12890
12890
|
return this.name;
|
|
12891
12891
|
};
|
|
12892
12892
|
var $ = document.createElement("canvas"), N = $.getContext("2d");
|
|
12893
|
-
m && (
|
|
12893
|
+
m && (R instanceof CanvasRenderingContext2D ? (N = R, $ = N.canvas) : R instanceof HTMLCanvasElement && (N = R.getContext("2d"), $ = R));
|
|
12894
12894
|
var o = !0;
|
|
12895
12895
|
if (!m) {
|
|
12896
12896
|
var ee = document.createElement("video");
|
|
12897
12897
|
ee.muted = !0, ee.autoplay = !0, ee.playsInline = !0, o = !1, ee.onloadedmetadata = function() {
|
|
12898
12898
|
o = !0;
|
|
12899
|
-
}, Fe(
|
|
12899
|
+
}, Fe(R, ee), ee.play();
|
|
12900
12900
|
}
|
|
12901
12901
|
var se = null, ye, xe, le = this;
|
|
12902
12902
|
}
|
|
12903
12903
|
typeof t < "u" && (t.GifRecorder = et);
|
|
12904
|
-
function vt(
|
|
12904
|
+
function vt(R, e) {
|
|
12905
12905
|
var l = "Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45";
|
|
12906
12906
|
(function(Q) {
|
|
12907
12907
|
typeof t < "u" || Q && (typeof window < "u" || typeof st > "u" || (st.navigator = {
|
|
@@ -13001,7 +13001,7 @@ var ma = {}, ri = {
|
|
|
13001
13001
|
return d.kind === "audio";
|
|
13002
13002
|
}).forEach(function(d) {
|
|
13003
13003
|
Q.addTrack(d);
|
|
13004
|
-
}),
|
|
13004
|
+
}), R.forEach(function(d) {
|
|
13005
13005
|
d.fullcanvas;
|
|
13006
13006
|
}), Q;
|
|
13007
13007
|
}
|
|
@@ -13019,7 +13019,7 @@ var ma = {}, ri = {
|
|
|
13019
13019
|
function X() {
|
|
13020
13020
|
ye.AudioContextConstructor || (ye.AudioContextConstructor = new ye.AudioContext()), N.audioContext = ye.AudioContextConstructor, N.audioSources = [], N.useGainNode === !0 && (N.gainNode = N.audioContext.createGain(), N.gainNode.connect(N.audioContext.destination), N.gainNode.gain.value = 0);
|
|
13021
13021
|
var Q = 0;
|
|
13022
|
-
if (
|
|
13022
|
+
if (R.forEach(function(ne) {
|
|
13023
13023
|
if (ne.getTracks().filter(function(D) {
|
|
13024
13024
|
return D.kind === "audio";
|
|
13025
13025
|
}).length) {
|
|
@@ -13057,7 +13057,7 @@ var ma = {}, ri = {
|
|
|
13057
13057
|
return T.kind === "audio";
|
|
13058
13058
|
})[0]);
|
|
13059
13059
|
}
|
|
13060
|
-
|
|
13060
|
+
R.push(d);
|
|
13061
13061
|
});
|
|
13062
13062
|
}, this.releaseStreams = function() {
|
|
13063
13063
|
m = [], M = !0, N.gainNode && (N.gainNode.disconnect(), N.gainNode = null), N.audioSources.length && (N.audioSources.forEach(function(Q) {
|
|
@@ -13067,7 +13067,7 @@ var ma = {}, ri = {
|
|
|
13067
13067
|
Q && !(Q instanceof Array) && (Q = [Q]), De(Q);
|
|
13068
13068
|
};
|
|
13069
13069
|
function De(Q) {
|
|
13070
|
-
m = [], Q = Q ||
|
|
13070
|
+
m = [], Q = Q || R, Q.forEach(function(ne) {
|
|
13071
13071
|
if (ne.getTracks().filter(function(D) {
|
|
13072
13072
|
return D.kind === "video";
|
|
13073
13073
|
}).length) {
|
|
@@ -13104,8 +13104,8 @@ var ma = {}, ri = {
|
|
|
13104
13104
|
* @param {MediaStreams} mediaStreams - Array of MediaStreams.
|
|
13105
13105
|
* @param {object} config - {disableLogs:true, frameInterval: 1, mimeType: "video/webm"}
|
|
13106
13106
|
*/
|
|
13107
|
-
function _t(
|
|
13108
|
-
|
|
13107
|
+
function _t(R, e) {
|
|
13108
|
+
R = R || [];
|
|
13109
13109
|
var l = this, m, M;
|
|
13110
13110
|
e = e || {
|
|
13111
13111
|
elementClass: "multi-streams-mixer",
|
|
@@ -13115,11 +13115,11 @@ var ma = {}, ri = {
|
|
|
13115
13115
|
height: 240
|
|
13116
13116
|
}
|
|
13117
13117
|
}, e.frameInterval || (e.frameInterval = 10), e.video || (e.video = {}), e.video.width || (e.video.width = 360), e.video.height || (e.video.height = 240), this.record = function() {
|
|
13118
|
-
m = new vt(
|
|
13118
|
+
m = new vt(R, e.elementClass || "multi-streams-mixer"), S().length && (m.frameInterval = e.frameInterval || 10, m.width = e.video.width || 360, m.height = e.video.height || 240, m.startDrawingFrames()), e.previewStream && typeof e.previewStream == "function" && e.previewStream(m.getMixedStream()), M = new He(m.getMixedStream(), e), M.record();
|
|
13119
13119
|
};
|
|
13120
13120
|
function S() {
|
|
13121
13121
|
var $ = [];
|
|
13122
|
-
return
|
|
13122
|
+
return R.forEach(function(N) {
|
|
13123
13123
|
Te(N, "video").forEach(function(o) {
|
|
13124
13124
|
$.push(o);
|
|
13125
13125
|
});
|
|
@@ -13138,7 +13138,7 @@ var ma = {}, ri = {
|
|
|
13138
13138
|
}, this.addStreams = function($) {
|
|
13139
13139
|
if (!$)
|
|
13140
13140
|
throw "First parameter is required.";
|
|
13141
|
-
$ instanceof Array || ($ = [$]),
|
|
13141
|
+
$ instanceof Array || ($ = [$]), R.concat($), !(!M || !m) && (m.appendStreams($), e.previewStream && typeof e.previewStream == "function" && e.previewStream(m.getMixedStream()));
|
|
13142
13142
|
}, this.resetVideoStreams = function($) {
|
|
13143
13143
|
m && ($ && !($ instanceof Array) && ($ = [$]), m.resetVideoStreams($));
|
|
13144
13144
|
}, this.getMixer = function() {
|
|
@@ -13169,13 +13169,13 @@ var ma = {}, ri = {
|
|
|
13169
13169
|
* @throws Will throw an error if "new" keyword is not used to initiate "RecordRTCPromisesHandler". Also throws error if first argument "MediaStream" is missing.
|
|
13170
13170
|
* @requires {@link RecordRTC}
|
|
13171
13171
|
*/
|
|
13172
|
-
function ct(
|
|
13172
|
+
function ct(R, e) {
|
|
13173
13173
|
if (!this)
|
|
13174
13174
|
throw 'Use "new RecordRTCPromisesHandler()"';
|
|
13175
|
-
if (typeof
|
|
13175
|
+
if (typeof R > "u")
|
|
13176
13176
|
throw 'First argument "MediaStream" is required.';
|
|
13177
13177
|
var l = this;
|
|
13178
|
-
l.recordRTC = new t(
|
|
13178
|
+
l.recordRTC = new t(R, e), this.startRecording = function() {
|
|
13179
13179
|
return new Promise(function(m, M) {
|
|
13180
13180
|
try {
|
|
13181
13181
|
l.recordRTC.startRecording(), m();
|
|
@@ -13283,14 +13283,14 @@ var ma = {}, ri = {
|
|
|
13283
13283
|
* @param {MediaStream} mediaStream - MediaStream object fetched using getUserMedia API or generated using captureStreamUntilEnded or WebAudio API.
|
|
13284
13284
|
* @param {object} config - {webAssemblyPath:'webm-wasm.wasm',workerPath: 'webm-worker.js', frameRate: 30, width: 1920, height: 1080, bitrate: 1024, realtime: true}
|
|
13285
13285
|
*/
|
|
13286
|
-
function je(
|
|
13286
|
+
function je(R, e) {
|
|
13287
13287
|
(typeof ReadableStream > "u" || typeof WritableStream > "u") && console.error("Following polyfill is strongly recommended: https://unpkg.com/@mattiasbuelens/web-streams-polyfill/dist/polyfill.min.js"), e = e || {}, e.width = e.width || 640, e.height = e.height || 480, e.frameRate = e.frameRate || 30, e.bitrate = e.bitrate || 1200, e.realtime = e.realtime || !0;
|
|
13288
13288
|
var l;
|
|
13289
13289
|
function m() {
|
|
13290
13290
|
return new ReadableStream({
|
|
13291
13291
|
start: function(ee) {
|
|
13292
13292
|
var se = document.createElement("canvas"), ye = document.createElement("video"), xe = !0;
|
|
13293
|
-
ye.srcObject =
|
|
13293
|
+
ye.srcObject = R, ye.muted = !0, ye.height = e.height, ye.width = e.width, ye.volume = 0, ye.onplaying = function() {
|
|
13294
13294
|
se.width = e.width, se.height = e.height;
|
|
13295
13295
|
var le = se.getContext("2d"), fe = 1e3 / e.frameRate, Ae = setInterval(function() {
|
|
13296
13296
|
if (l && (clearInterval(Ae), ee.close()), xe && (xe = !1, e.onVideoProcessStarted && e.onVideoProcessStarted()), le.drawImage(ye, 0, 0), ee._controlledReadableStream.state !== "closed")
|
|
@@ -13342,7 +13342,7 @@ var ma = {}, ri = {
|
|
|
13342
13342
|
});
|
|
13343
13343
|
}
|
|
13344
13344
|
this.record = function() {
|
|
13345
|
-
o = [], $ = !1, this.blob = null, S(
|
|
13345
|
+
o = [], $ = !1, this.blob = null, S(R), typeof e.initCallback == "function" && e.initCallback();
|
|
13346
13346
|
};
|
|
13347
13347
|
var $;
|
|
13348
13348
|
this.pause = function() {
|
|
@@ -13501,9 +13501,9 @@ const ui = {
|
|
|
13501
13501
|
this.$emit("finish", [f]), this.$emit("cancel");
|
|
13502
13502
|
},
|
|
13503
13503
|
dataURLtoFile(s, t) {
|
|
13504
|
-
let f = s.split(","), h = f[0].match(/:(.*?);/)[1], U = atob(f[1]),
|
|
13505
|
-
for (;
|
|
13506
|
-
P[
|
|
13504
|
+
let f = s.split(","), h = f[0].match(/:(.*?);/)[1], U = atob(f[1]), E = U.length, P = new Uint8Array(E);
|
|
13505
|
+
for (; E--; )
|
|
13506
|
+
P[E] = U.charCodeAt(E);
|
|
13507
13507
|
return new File([P], t, { type: h });
|
|
13508
13508
|
},
|
|
13509
13509
|
handleCancel() {
|
|
@@ -13717,11 +13717,11 @@ const Ca = "KEY_PENDING_NODES", vi = {
|
|
|
13717
13717
|
async getSize(s, t) {
|
|
13718
13718
|
let f = {};
|
|
13719
13719
|
t === "image" ? f = await Ua(s) : t === "video" && (f = await Ha(s));
|
|
13720
|
-
const { width: h, height: U } = f, { width:
|
|
13720
|
+
const { width: h, height: U } = f, { width: E, height: P } = Ya(h, U);
|
|
13721
13721
|
return {
|
|
13722
13722
|
origWidth: h,
|
|
13723
13723
|
origHeight: U,
|
|
13724
|
-
width:
|
|
13724
|
+
width: E,
|
|
13725
13725
|
height: P
|
|
13726
13726
|
};
|
|
13727
13727
|
},
|
|
@@ -13734,10 +13734,10 @@ const Ca = "KEY_PENDING_NODES", vi = {
|
|
|
13734
13734
|
async handleFileUpload(s, t) {
|
|
13735
13735
|
if (!s.length)
|
|
13736
13736
|
return;
|
|
13737
|
-
const f = Array.from(s).map(async (
|
|
13738
|
-
const P = Pa(
|
|
13737
|
+
const f = Array.from(s).map(async (E) => {
|
|
13738
|
+
const P = Pa(E.type), K = URL.createObjectURL(E);
|
|
13739
13739
|
let ve = {};
|
|
13740
|
-
switch ((P.mainType === "image" || P.mainType === "video") && (ve = await this.getSize(
|
|
13740
|
+
switch ((P.mainType === "image" || P.mainType === "video") && (ve = await this.getSize(E, P.mainType)), P.mainType) {
|
|
13741
13741
|
case "image":
|
|
13742
13742
|
case "audio":
|
|
13743
13743
|
case "video":
|
|
@@ -13753,19 +13753,19 @@ const Ca = "KEY_PENDING_NODES", vi = {
|
|
|
13753
13753
|
return {
|
|
13754
13754
|
uuid: It(),
|
|
13755
13755
|
type: "file",
|
|
13756
|
-
name:
|
|
13756
|
+
name: E.name,
|
|
13757
13757
|
content: K,
|
|
13758
|
-
size:
|
|
13758
|
+
size: E.size,
|
|
13759
13759
|
pending: !0,
|
|
13760
13760
|
hash: this.hash
|
|
13761
13761
|
};
|
|
13762
13762
|
}
|
|
13763
13763
|
}), h = await Promise.all(f);
|
|
13764
|
-
t ? t(h) : h.forEach((
|
|
13765
|
-
this.$refs.treeEditor.appendNode(
|
|
13764
|
+
t ? t(h) : h.forEach((E) => {
|
|
13765
|
+
this.$refs.treeEditor.appendNode(E);
|
|
13766
13766
|
});
|
|
13767
13767
|
const U = this.note.id;
|
|
13768
|
-
Qa.uploadFile(s, (
|
|
13768
|
+
Qa.uploadFile(s, (E, P) => {
|
|
13769
13769
|
P && P.forEach((K, ve) => {
|
|
13770
13770
|
const Me = h[ve], be = K.data;
|
|
13771
13771
|
if (K.code === 0) {
|