Commit d7c4d6e8 authored by xinzhedeai's avatar xinzhedeai

add:test icon person label实体添加

parent 8a1ca47b
...@@ -15,6 +15,27 @@ export default { ...@@ -15,6 +15,27 @@ export default {
// Cesium查看器实例 // Cesium查看器实例
viewer: null, viewer: null,
tileset: null, tileset: null,
personnelList: [
{
longitude: 121.70710830038986,
latitude: 36.853636402927986,
height: 100,
name: "张三",
status: "online", // 在线
avatar: "/static/images/avatars/zhangsan.png", // 头像
},
{
longitude: 121.70810830038986,
latitude: 36.854636402927986,
height: 100,
name: "李四",
status: "offline", // 离线
avatar: "/static/images/avatars/lisi.png", // 头像
},
// 其他人员数据...
],
personModelInterval: null,
bgEntities: {}, // 所有的key都对应一个实体对象。而人员的实体对应的key不是数字。
}; };
}, },
mounted() { mounted() {
...@@ -29,6 +50,141 @@ export default { ...@@ -29,6 +50,141 @@ export default {
} }
}, },
methods: { methods: {
createPersonModel() {
// 批次号管理(每次定时器触发时生成一个新的批次号)
// let currentBatch = 0;
// const batchMap = {};
// if (!this.personModelInterval) {
// this.personModelInterval = setInterval(() => {
// currentBatch++; // 每次定时器触发,生成新的批次号
debugger;
if (this.bgEntities) {
for (let key in this.bgEntities) {
if (isNaN(parseFloat(key))) {
// 非数字键名的是人员实体
this.viewer.entities.remove(this.bgEntities[key]);
delete m.bgEntities[key];
}
}
}
// 从API获取最新的人员定位数据
this.personCardList((list) => {
// let perList = list; // 使用全部人员数据
console.log("人员数据", this.personnelList);
// 创建新实体
for (let item of this.personnelList) {
let lng = Number(item.lng);
let lat = Number(item.lat);
let height = Number(item.height);
let position = Cesium.Cartesian3.fromDegrees(lng, lat, height);
console.log(item.name, position);
// 创建人员标记
let entity = this.viewer.entities.add({
position: position,
label: {
text: "高区管委",
font: "16px",
backgroundColor: Cesium.Color.fromCssColorString("#173349"),
showBackground: true,
fillColor: Cesium.Color.YELLOW,
depthTestAgainstTerrain: false, // 禁用地形深度测试
// text: "高区管委",
// font: "16px",
// // scale: 0.5,
// backgroundColor: Cesium.Color.fromCssColorString("#173349"),
// color: Cesium.Color.WHITE,
// showBackground: true,
// horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
// verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(
// 1.0,
// 8000.0
// ),
// pixelOffset: new Cesium.Cartesian2(0, -35),
// fillColor: Cesium.Color.WHITE,
// backgroundColor: new Cesium.Color(0.0, 0.486, 0.65, 0.8),
// disableDepthTestDistance: 5,
// heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
},
// billboard: {
// image: "/static/images/poi-marker-default.png",
// scale: 0.5,
// heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
// disableDepthTestDistance: 5,
// distanceDisplayCondition: new Cesium.DistanceDisplayCondition(
// 1.0,
// 8000.0
// ),
// horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
// verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
// },
// description: `<div><h4>${item.name}</h4></div>`,
// fixedFrame: Cesium.Transforms.eastNorthUpToFixedFrame(position),
});
// entity.info = item; // 添加 info 属性
// // entity.batch = currentBatch; // 标记当前批次
// this.bgEntities[item.perName] = entity; // 存储新实体
}
});
// }, 10000); // 每10秒刷新一次
// }
},
personCardList(fn) {
console.log("人员定位数据", this.personnelList);
// 将笛卡尔坐标转换为经纬度坐标
const cartographic = Cesium.Cartographic.fromCartesian({
x: -2686273.730145489,
y: 4293961.185794622,
z: 3863430.5618300107,
});
const longitude = Cesium.Math.toDegrees(cartographic.longitude);
const latitude = Cesium.Math.toDegrees(cartographic.latitude);
const height = cartographic.height + 10;
// height
// :
// 75909.13761736471
// latitude
// :
// 37.19751259330305
// longitude
// :
// 122.16058393814254
console.log("人员经纬度:", {
longitude: longitude,
latitude: latitude,
height: height,
});
this.personnelList = [];
for (let index = 0; index < 1; index++) {
this.personnelList.push({
lng: longitude,
lat: latitude,
height: height + 10 * index,
perName: "张三" + index,
status: "online", // 在线
avatar: "/static/images/avatars/zhangsan.png", // 头像
});
}
fn(this.personnelList);
},
showPersonInfo(description) {
// 使用 Cesium 的 InfoBox 显示信息
this.viewer.selectedEntity = this.viewer.entities.add({
description: description,
});
this.viewer.infoBox.frame.sandbox =
"allow-same-origin allow-top-navigation allow-pointer-lock allow-popups allow-forms allow-scripts";
this.viewer.infoBox.frame.src = "about:blank";
this.viewer.infoBox.frame.contentDocument.write(description);
this.viewer.infoBox.frame.contentDocument.close();
this.viewer.infoBox.viewModel.showInfo = true;
this.viewer.scene.globe.depthTestAgainstTerrain = true;
},
goTarget(href) { goTarget(href) {
window.open(href, "_blank"); window.open(href, "_blank");
}, },
...@@ -174,6 +330,7 @@ export default { ...@@ -174,6 +330,7 @@ export default {
duration: 2, // 过渡时间2秒 duration: 2, // 过渡时间2秒
complete: () => { complete: () => {
console.log("相机已成功定位到模型上方"); console.log("相机已成功定位到模型上方");
this.createPersonModel(); // 定位后创建人员模型
}, },
}); });
} catch (error) { } catch (error) {
......
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
<title>矿山模型</title>
<meta name="description" content="description">
<meta name="keywords" content="keywords, 梨酒客">
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<style type="text/css">
body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, legend, button, input, textarea, th, td{margin:0px;padding:0px}
html, body{height:100%;width:100%;display:flex;}
body{font-family:"微软雅黑";color:#000;/* display:block;width:100%;height:100%; */}
*{box-sizing:border-box;}
.view{height:100%;}
#kmbBaseLayer_e3d8{width:'100%' !improtant;background-color:transparent !improtant;}
</style>
<script type="text/javascript" src="../js/qf_web.min.js"></script>
<script type="text/javascript">qf.openCalcLayout();</script>
</head>
<body>
<div class="view" id="view"></div>
</body>
<script src="../js/qf_web_ui.min.js"></script>
<script src="./js/md5.js"></script>
<script type="importmap">
{
"imports": {
"three": "./js/three.module.js",
"three/addons/": "./jsm/"
}
}
</script>
<script type="module">
import * as THREE from 'three';
import { OrbitControls } from './js/OrbitControls_module.js';
import { FBXLoader } from './js/FBXLoader_module.js';
qf(function(){
var vm = document.getElementById("view");
var scene = new THREE.Scene();
// 材质组
var ViewGroup = new THREE.Group();
scene.add(ViewGroup);
var loader = new FBXLoader();
window.onMessage = function(filepath){
loaderModel(filepath);
};
// loader
function loaderModel(filepath){
clearModel();
// 进度条
var Progress = new qf.UI.progressBar({top:'1.2rem',width:'19.2rem', display:'flex', justifyContent:'center'});
// 加载模型
loader.load(filepath, function(data) {
vm.modelData = data;
// 创建模型
create(data)
}, function(xhr){ // 加载进度
var progressValue = ~~(xhr.loaded / xhr.total * 10000) / 100;
Progress.setValue(progressValue);
if (progressValue === 100) {
setTimeout(() => {
Progress.remove();
}, 500);
}
});
};
function create(Obj) {
Obj.traverse(function(child) {
if (child instanceof THREE.Mesh) {
// MeshLambertMaterial材质用来渲染看上去暗淡不光亮的表面
//child.material = new THREE.MeshLambertMaterial( { color: child.material.color });
var color = qf.Utils.getRandomColor(md5(child.material.name));
child.material = new THREE.MeshLambertMaterial({color: new THREE.Color(color[0], color[1], color[2])});
// 重新计算顶点法线
var geometry = child.geometry;
if(geometry){
geometry.computeVertexNormals(0);
child.material.shading = THREE.SmoothShading;
};
}
});
var box3 = new THREE.Box3();
box3.expandByObject(Obj);
var v3 = new THREE.Vector3();
box3.getSize(v3);
function num() {
var max;
if (v3.x > v3.y) {
max = v3.x
} else {
max = v3.y
}
if (max > v3.z) {} else {
max = v3.z
}
return max;
}
var S = 100 / num();
Obj.scale.set(S, S, S)
var newBox3 = new THREE.Box3()
newBox3.expandByObject(Obj)
var center = new THREE.Vector3();
newBox3.getCenter(center)
Obj.position.x = Obj.position.x - center.x
Obj.position.y = Obj.position.y - center.y
Obj.position.z = Obj.position.z - center.z
ViewGroup.add(Obj);
render();
}
function clearModel(){
ViewGroup.clear();
render();
};
var directionalLight = new THREE.DirectionalLight(0xffffff, 1);
directionalLight.position.set(100, 350, 200);
scene.add(directionalLight);
var directionalLight2 = new THREE.DirectionalLight(0xffffff, 1);
directionalLight2.position.set(-300, -100, -400);
scene.add(directionalLight2);
var directionalLight3 = new THREE.DirectionalLight(0xffffff, 1);
directionalLight3.position.set(10, 300, 30);
scene.add(directionalLight3);
/* var point = new THREE.PointLight(0xffffff, 0.9);
point.position.set(400, 150, 300);
scene.add(point);
var ambient = new THREE.AmbientLight(0xffffff, 0.3);
scene.add(ambient); */
var width = window.innerWidth;
var height = window.innerHeight;
var k = width / height;
var s = 45;
var camera = new THREE.OrthographicCamera(-s * k, s * k, s, -s, 1, 1000);
camera.position.set(162, 164, 341);
var renderer = new THREE.WebGLRenderer({
antialias: true
});
renderer.setSize(width, height);
renderer.setClearColor(0x000000, .1);
vm.appendChild(renderer.domElement);
function render() {
renderer.render(scene, camera);
};
var controls = new OrbitControls(camera, renderer.domElement);
controls.addEventListener('change', function() {
var worldPosition = new THREE.Vector3();
vm.modelData && vm.modelData.getWorldPosition(worldPosition)
var standardVector = worldPosition.project(camera);
var a = window.innerWidth * qf.envir.dpr / 2;
var b = window.innerHeight * qf.envir.dpr / 2;
vm.left = Math.round(standardVector.x * a + a);
vm.top = Math.round(-standardVector.y * b + b) - 250;
render();
});
window.onresize = function() {
vm.bool = false
vm.width = window.innerWidth * qf.envir.dpr;
vm.height = window.innerHeight * qf.envir.dpr;
renderer.setSize(vm.width, vm.height);
k = (vm.width) / (vm.height);
camera.left = -s * k;
camera.right = s * k;
camera.top = s;
camera.bottom = -s;
camera.updateProjectionMatrix();
render();
};
});
</script>
</html>
import {
AmbientLight,
AnimationClip,
Bone,
BufferGeometry,
ClampToEdgeWrapping,
Color,
DirectionalLight,
EquirectangularReflectionMapping,
Euler,
FileLoader,
Float32BufferAttribute,
Group,
Line,
LineBasicMaterial,
Loader,
LoaderUtils,
MathUtils,
Matrix3,
Matrix4,
Mesh,
MeshLambertMaterial,
MeshPhongMaterial,
NumberKeyframeTrack,
Object3D,
OrthographicCamera,
PerspectiveCamera,
PointLight,
PropertyBinding,
Quaternion,
QuaternionKeyframeTrack,
RepeatWrapping,
Skeleton,
SkinnedMesh,
SpotLight,
Texture,
TextureLoader,
Uint16BufferAttribute,
Vector3,
Vector4,
VectorKeyframeTrack,
SRGBColorSpace
} from 'three';
import * as fflate from './libs/fflate.module.js';
import { NURBSCurve } from './curves/NURBSCurve.js';
/**
* Loader loads FBX file and generates Group representing FBX scene.
* Requires FBX file to be >= 7.0 and in ASCII or >= 6400 in Binary format
* Versions lower than this may load but will probably have errors
*
* Needs Support:
* Morph normals / blend shape normals
*
* FBX format references:
* https://help.autodesk.com/view/FBX/2017/ENU/?guid=__cpp_ref_index_html (C++ SDK reference)
*
* Binary format specification:
* https://code.blender.org/2013/08/fbx-binary-file-format-specification/
*/
let fbxTree;
let connections;
let sceneGraph;
class FBXLoader extends Loader {
constructor( manager ) {
super( manager );
}
load( url, onLoad, onProgress, onError ) {
const scope = this;
const path = ( scope.path === '' ) ? LoaderUtils.extractUrlBase( url ) : scope.path;
const loader = new FileLoader( this.manager );
loader.setPath( scope.path );
loader.setResponseType( 'arraybuffer' );
loader.setRequestHeader( scope.requestHeader );
loader.setWithCredentials( scope.withCredentials );
loader.load( url, function ( buffer ) {
try {
onLoad( scope.parse( buffer, path ) );
} catch ( e ) {
if ( onError ) {
onError( e );
} else {
console.error( e );
}
scope.manager.itemError( url );
}
}, onProgress, onError );
}
parse( FBXBuffer, path ) {
if ( isFbxFormatBinary( FBXBuffer ) ) {
fbxTree = new BinaryParser().parse( FBXBuffer );
} else {
const FBXText = convertArrayBufferToString( FBXBuffer );
if ( ! isFbxFormatASCII( FBXText ) ) {
throw new Error( 'THREE.FBXLoader: Unknown format.' );
}
if ( getFbxVersion( FBXText ) < 7000 ) {
throw new Error( 'THREE.FBXLoader: FBX version not supported, FileVersion: ' + getFbxVersion( FBXText ) );
}
fbxTree = new TextParser().parse( FBXText );
}
// console.log( fbxTree );
const textureLoader = new TextureLoader( this.manager ).setPath( this.resourcePath || path ).setCrossOrigin( this.crossOrigin );
return new FBXTreeParser( textureLoader, this.manager ).parse( fbxTree );
}
}
// Parse the FBXTree object returned by the BinaryParser or TextParser and return a Group
class FBXTreeParser {
constructor( textureLoader, manager ) {
this.textureLoader = textureLoader;
this.manager = manager;
}
parse() {
connections = this.parseConnections();
const images = this.parseImages();
const textures = this.parseTextures( images );
const materials = this.parseMaterials( textures );
const deformers = this.parseDeformers();
const geometryMap = new GeometryParser().parse( deformers );
this.parseScene( deformers, geometryMap, materials );
return sceneGraph;
}
// Parses FBXTree.Connections which holds parent-child connections between objects (e.g. material -> texture, model->geometry )
// and details the connection type
parseConnections() {
const connectionMap = new Map();
if ( 'Connections' in fbxTree ) {
const rawConnections = fbxTree.Connections.connections;
rawConnections.forEach( function ( rawConnection ) {
const fromID = rawConnection[ 0 ];
const toID = rawConnection[ 1 ];
const relationship = rawConnection[ 2 ];
if ( ! connectionMap.has( fromID ) ) {
connectionMap.set( fromID, {
parents: [],
children: []
} );
}
const parentRelationship = { ID: toID, relationship: relationship };
connectionMap.get( fromID ).parents.push( parentRelationship );
if ( ! connectionMap.has( toID ) ) {
connectionMap.set( toID, {
parents: [],
children: []
} );
}
const childRelationship = { ID: fromID, relationship: relationship };
connectionMap.get( toID ).children.push( childRelationship );
} );
}
return connectionMap;
}
// Parse FBXTree.Objects.Video for embedded image data
// These images are connected to textures in FBXTree.Objects.Textures
// via FBXTree.Connections.
parseImages() {
const images = {};
const blobs = {};
if ( 'Video' in fbxTree.Objects ) {
const videoNodes = fbxTree.Objects.Video;
for ( const nodeID in videoNodes ) {
const videoNode = videoNodes[ nodeID ];
const id = parseInt( nodeID );
images[ id ] = videoNode.RelativeFilename || videoNode.Filename;
// raw image data is in videoNode.Content
if ( 'Content' in videoNode ) {
const arrayBufferContent = ( videoNode.Content instanceof ArrayBuffer ) && ( videoNode.Content.byteLength > 0 );
const base64Content = ( typeof videoNode.Content === 'string' ) && ( videoNode.Content !== '' );
if ( arrayBufferContent || base64Content ) {
const image = this.parseImage( videoNodes[ nodeID ] );
blobs[ videoNode.RelativeFilename || videoNode.Filename ] = image;
}
}
}
}
for ( const id in images ) {
const filename = images[ id ];
if ( blobs[ filename ] !== undefined ) images[ id ] = blobs[ filename ];
else images[ id ] = images[ id ].split( '\\' ).pop();
}
return images;
}
// Parse embedded image data in FBXTree.Video.Content
parseImage( videoNode ) {
const content = videoNode.Content;
const fileName = videoNode.RelativeFilename || videoNode.Filename;
const extension = fileName.slice( fileName.lastIndexOf( '.' ) + 1 ).toLowerCase();
let type;
switch ( extension ) {
case 'bmp':
type = 'image/bmp';
break;
case 'jpg':
case 'jpeg':
type = 'image/jpeg';
break;
case 'png':
type = 'image/png';
break;
case 'tif':
type = 'image/tiff';
break;
case 'tga':
if ( this.manager.getHandler( '.tga' ) === null ) {
console.warn( 'FBXLoader: TGA loader not found, skipping ', fileName );
}
type = 'image/tga';
break;
default:
console.warn( 'FBXLoader: Image type "' + extension + '" is not supported.' );
return;
}
if ( typeof content === 'string' ) { // ASCII format
return 'data:' + type + ';base64,' + content;
} else { // Binary Format
const array = new Uint8Array( content );
return window.URL.createObjectURL( new Blob( [ array ], { type: type } ) );
}
}
// Parse nodes in FBXTree.Objects.Texture
// These contain details such as UV scaling, cropping, rotation etc and are connected
// to images in FBXTree.Objects.Video
parseTextures( images ) {
const textureMap = new Map();
if ( 'Texture' in fbxTree.Objects ) {
const textureNodes = fbxTree.Objects.Texture;
for ( const nodeID in textureNodes ) {
const texture = this.parseTexture( textureNodes[ nodeID ], images );
textureMap.set( parseInt( nodeID ), texture );
}
}
return textureMap;
}
// Parse individual node in FBXTree.Objects.Texture
parseTexture( textureNode, images ) {
const texture = this.loadTexture( textureNode, images );
texture.ID = textureNode.id;
texture.name = textureNode.attrName;
const wrapModeU = textureNode.WrapModeU;
const wrapModeV = textureNode.WrapModeV;
const valueU = wrapModeU !== undefined ? wrapModeU.value : 0;
const valueV = wrapModeV !== undefined ? wrapModeV.value : 0;
// http://download.autodesk.com/us/fbx/SDKdocs/FBX_SDK_Help/files/fbxsdkref/class_k_fbx_texture.html#889640e63e2e681259ea81061b85143a
// 0: repeat(default), 1: clamp
texture.wrapS = valueU === 0 ? RepeatWrapping : ClampToEdgeWrapping;
texture.wrapT = valueV === 0 ? RepeatWrapping : ClampToEdgeWrapping;
if ( 'Scaling' in textureNode ) {
const values = textureNode.Scaling.value;
texture.repeat.x = values[ 0 ];
texture.repeat.y = values[ 1 ];
}
if ( 'Translation' in textureNode ) {
const values = textureNode.Translation.value;
texture.offset.x = values[ 0 ];
texture.offset.y = values[ 1 ];
}
return texture;
}
// load a texture specified as a blob or data URI, or via an external URL using TextureLoader
loadTexture( textureNode, images ) {
let fileName;
const currentPath = this.textureLoader.path;
const children = connections.get( textureNode.id ).children;
if ( children !== undefined && children.length > 0 && images[ children[ 0 ].ID ] !== undefined ) {
fileName = images[ children[ 0 ].ID ];
if ( fileName.indexOf( 'blob:' ) === 0 || fileName.indexOf( 'data:' ) === 0 ) {
this.textureLoader.setPath( undefined );
}
}
let texture;
const extension = textureNode.FileName.slice( - 3 ).toLowerCase();
if ( extension === 'tga' ) {
const loader = this.manager.getHandler( '.tga' );
if ( loader === null ) {
console.warn( 'FBXLoader: TGA loader not found, creating placeholder texture for', textureNode.RelativeFilename );
texture = new Texture();
} else {
loader.setPath( this.textureLoader.path );
texture = loader.load( fileName );
}
} else if ( extension === 'psd' ) {
console.warn( 'FBXLoader: PSD textures are not supported, creating placeholder texture for', textureNode.RelativeFilename );
texture = new Texture();
} else {
texture = this.textureLoader.load( fileName );
}
this.textureLoader.setPath( currentPath );
return texture;
}
// Parse nodes in FBXTree.Objects.Material
parseMaterials( textureMap ) {
const materialMap = new Map();
if ( 'Material' in fbxTree.Objects ) {
const materialNodes = fbxTree.Objects.Material;
for ( const nodeID in materialNodes ) {
const material = this.parseMaterial( materialNodes[ nodeID ], textureMap );
if ( material !== null ) materialMap.set( parseInt( nodeID ), material );
}
}
return materialMap;
}
// Parse single node in FBXTree.Objects.Material
// Materials are connected to texture maps in FBXTree.Objects.Textures
// FBX format currently only supports Lambert and Phong shading models
parseMaterial( materialNode, textureMap ) {
const ID = materialNode.id;
const name = materialNode.attrName;
let type = materialNode.ShadingModel;
// Case where FBX wraps shading model in property object.
if ( typeof type === 'object' ) {
type = type.value;
}
// Ignore unused materials which don't have any connections.
if ( ! connections.has( ID ) ) return null;
const parameters = this.parseParameters( materialNode, textureMap, ID );
let material;
switch ( type.toLowerCase() ) {
case 'phong':
material = new MeshPhongMaterial();
break;
case 'lambert':
material = new MeshLambertMaterial();
break;
default:
console.warn( 'THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.', type );
material = new MeshPhongMaterial();
break;
}
material.setValues( parameters );
material.name = name;
return material;
}
// Parse FBX material and return parameters suitable for a three.js material
// Also parse the texture map and return any textures associated with the material
parseParameters( materialNode, textureMap, ID ) {
const parameters = {};
if ( materialNode.BumpFactor ) {
parameters.bumpScale = materialNode.BumpFactor.value;
}
if ( materialNode.Diffuse ) {
parameters.color = new Color().fromArray( materialNode.Diffuse.value ).convertSRGBToLinear();
} else if ( materialNode.DiffuseColor && ( materialNode.DiffuseColor.type === 'Color' || materialNode.DiffuseColor.type === 'ColorRGB' ) ) {
// The blender exporter exports diffuse here instead of in materialNode.Diffuse
parameters.color = new Color().fromArray( materialNode.DiffuseColor.value ).convertSRGBToLinear();
}
if ( materialNode.DisplacementFactor ) {
parameters.displacementScale = materialNode.DisplacementFactor.value;
}
if ( materialNode.Emissive ) {
parameters.emissive = new Color().fromArray( materialNode.Emissive.value ).convertSRGBToLinear();
} else if ( materialNode.EmissiveColor && ( materialNode.EmissiveColor.type === 'Color' || materialNode.EmissiveColor.type === 'ColorRGB' ) ) {
// The blender exporter exports emissive color here instead of in materialNode.Emissive
parameters.emissive = new Color().fromArray( materialNode.EmissiveColor.value ).convertSRGBToLinear();
}
if ( materialNode.EmissiveFactor ) {
parameters.emissiveIntensity = parseFloat( materialNode.EmissiveFactor.value );
}
if ( materialNode.Opacity ) {
parameters.opacity = parseFloat( materialNode.Opacity.value );
}
if ( parameters.opacity < 1.0 ) {
parameters.transparent = true;
}
if ( materialNode.ReflectionFactor ) {
parameters.reflectivity = materialNode.ReflectionFactor.value;
}
if ( materialNode.Shininess ) {
parameters.shininess = materialNode.Shininess.value;
}
if ( materialNode.Specular ) {
parameters.specular = new Color().fromArray( materialNode.Specular.value ).convertSRGBToLinear();
} else if ( materialNode.SpecularColor && materialNode.SpecularColor.type === 'Color' ) {
// The blender exporter exports specular color here instead of in materialNode.Specular
parameters.specular = new Color().fromArray( materialNode.SpecularColor.value ).convertSRGBToLinear();
}
const scope = this;
connections.get( ID ).children.forEach( function ( child ) {
const type = child.relationship;
switch ( type ) {
case 'Bump':
parameters.bumpMap = scope.getTexture( textureMap, child.ID );
break;
case 'Maya|TEX_ao_map':
parameters.aoMap = scope.getTexture( textureMap, child.ID );
break;
case 'DiffuseColor':
case 'Maya|TEX_color_map':
parameters.map = scope.getTexture( textureMap, child.ID );
if ( parameters.map !== undefined ) {
parameters.map.colorSpace = SRGBColorSpace;
}
break;
case 'DisplacementColor':
parameters.displacementMap = scope.getTexture( textureMap, child.ID );
break;
case 'EmissiveColor':
parameters.emissiveMap = scope.getTexture( textureMap, child.ID );
if ( parameters.emissiveMap !== undefined ) {
parameters.emissiveMap.colorSpace = SRGBColorSpace;
}
break;
case 'NormalMap':
case 'Maya|TEX_normal_map':
parameters.normalMap = scope.getTexture( textureMap, child.ID );
break;
case 'ReflectionColor':
parameters.envMap = scope.getTexture( textureMap, child.ID );
if ( parameters.envMap !== undefined ) {
parameters.envMap.mapping = EquirectangularReflectionMapping;
parameters.envMap.colorSpace = SRGBColorSpace;
}
break;
case 'SpecularColor':
parameters.specularMap = scope.getTexture( textureMap, child.ID );
if ( parameters.specularMap !== undefined ) {
parameters.specularMap.colorSpace = SRGBColorSpace;
}
break;
case 'TransparentColor':
case 'TransparencyFactor':
parameters.alphaMap = scope.getTexture( textureMap, child.ID );
parameters.transparent = true;
break;
case 'AmbientColor':
case 'ShininessExponent': // AKA glossiness map
case 'SpecularFactor': // AKA specularLevel
case 'VectorDisplacementColor': // NOTE: Seems to be a copy of DisplacementColor
default:
console.warn( 'THREE.FBXLoader: %s map is not supported in three.js, skipping texture.', type );
break;
}
} );
return parameters;
}
// get a texture from the textureMap for use by a material.
getTexture( textureMap, id ) {
// if the texture is a layered texture, just use the first layer and issue a warning
if ( 'LayeredTexture' in fbxTree.Objects && id in fbxTree.Objects.LayeredTexture ) {
console.warn( 'THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer.' );
id = connections.get( id ).children[ 0 ].ID;
}
return textureMap.get( id );
}
// Parse nodes in FBXTree.Objects.Deformer
// Deformer node can contain skinning or Vertex Cache animation data, however only skinning is supported here
// Generates map of Skeleton-like objects for use later when generating and binding skeletons.
parseDeformers() {
const skeletons = {};
const morphTargets = {};
if ( 'Deformer' in fbxTree.Objects ) {
const DeformerNodes = fbxTree.Objects.Deformer;
for ( const nodeID in DeformerNodes ) {
const deformerNode = DeformerNodes[ nodeID ];
const relationships = connections.get( parseInt( nodeID ) );
if ( deformerNode.attrType === 'Skin' ) {
const skeleton = this.parseSkeleton( relationships, DeformerNodes );
skeleton.ID = nodeID;
if ( relationships.parents.length > 1 ) console.warn( 'THREE.FBXLoader: skeleton attached to more than one geometry is not supported.' );
skeleton.geometryID = relationships.parents[ 0 ].ID;
skeletons[ nodeID ] = skeleton;
} else if ( deformerNode.attrType === 'BlendShape' ) {
const morphTarget = {
id: nodeID,
};
morphTarget.rawTargets = this.parseMorphTargets( relationships, DeformerNodes );
morphTarget.id = nodeID;
if ( relationships.parents.length > 1 ) console.warn( 'THREE.FBXLoader: morph target attached to more than one geometry is not supported.' );
morphTargets[ nodeID ] = morphTarget;
}
}
}
return {
skeletons: skeletons,
morphTargets: morphTargets,
};
}
// Parse single nodes in FBXTree.Objects.Deformer
// The top level skeleton node has type 'Skin' and sub nodes have type 'Cluster'
// Each skin node represents a skeleton and each cluster node represents a bone
parseSkeleton( relationships, deformerNodes ) {
const rawBones = [];
relationships.children.forEach( function ( child ) {
const boneNode = deformerNodes[ child.ID ];
if ( boneNode.attrType !== 'Cluster' ) return;
const rawBone = {
ID: child.ID,
indices: [],
weights: [],
transformLink: new Matrix4().fromArray( boneNode.TransformLink.a ),
// transform: new Matrix4().fromArray( boneNode.Transform.a ),
// linkMode: boneNode.Mode,
};
if ( 'Indexes' in boneNode ) {
rawBone.indices = boneNode.Indexes.a;
rawBone.weights = boneNode.Weights.a;
}
rawBones.push( rawBone );
} );
return {
rawBones: rawBones,
bones: []
};
}
// The top level morph deformer node has type "BlendShape" and sub nodes have type "BlendShapeChannel"
parseMorphTargets( relationships, deformerNodes ) {
const rawMorphTargets = [];
for ( let i = 0; i < relationships.children.length; i ++ ) {
const child = relationships.children[ i ];
const morphTargetNode = deformerNodes[ child.ID ];
const rawMorphTarget = {
name: morphTargetNode.attrName,
initialWeight: morphTargetNode.DeformPercent,
id: morphTargetNode.id,
fullWeights: morphTargetNode.FullWeights.a
};
if ( morphTargetNode.attrType !== 'BlendShapeChannel' ) return;
rawMorphTarget.geoID = connections.get( parseInt( child.ID ) ).children.filter( function ( child ) {
return child.relationship === undefined;
} )[ 0 ].ID;
rawMorphTargets.push( rawMorphTarget );
}
return rawMorphTargets;
}
// create the main Group() to be returned by the loader
parseScene( deformers, geometryMap, materialMap ) {
sceneGraph = new Group();
const modelMap = this.parseModels( deformers.skeletons, geometryMap, materialMap );
const modelNodes = fbxTree.Objects.Model;
const scope = this;
modelMap.forEach( function ( model ) {
const modelNode = modelNodes[ model.ID ];
scope.setLookAtProperties( model, modelNode );
const parentConnections = connections.get( model.ID ).parents;
parentConnections.forEach( function ( connection ) {
const parent = modelMap.get( connection.ID );
if ( parent !== undefined ) parent.add( model );
} );
if ( model.parent === null ) {
sceneGraph.add( model );
}
} );
this.bindSkeleton( deformers.skeletons, geometryMap, modelMap );
this.createAmbientLight();
sceneGraph.traverse( function ( node ) {
if ( node.userData.transformData ) {
if ( node.parent ) {
node.userData.transformData.parentMatrix = node.parent.matrix;
node.userData.transformData.parentMatrixWorld = node.parent.matrixWorld;
}
const transform = generateTransform( node.userData.transformData );
node.applyMatrix4( transform );
node.updateWorldMatrix();
}
} );
const animations = new AnimationParser().parse();
// if all the models where already combined in a single group, just return that
if ( sceneGraph.children.length === 1 && sceneGraph.children[ 0 ].isGroup ) {
sceneGraph.children[ 0 ].animations = animations;
sceneGraph = sceneGraph.children[ 0 ];
}
sceneGraph.animations = animations;
}
// parse nodes in FBXTree.Objects.Model
parseModels( skeletons, geometryMap, materialMap ) {
const modelMap = new Map();
const modelNodes = fbxTree.Objects.Model;
for ( const nodeID in modelNodes ) {
const id = parseInt( nodeID );
const node = modelNodes[ nodeID ];
const relationships = connections.get( id );
let model = this.buildSkeleton( relationships, skeletons, id, node.attrName );
if ( ! model ) {
switch ( node.attrType ) {
case 'Camera':
model = this.createCamera( relationships );
break;
case 'Light':
model = this.createLight( relationships );
break;
case 'Mesh':
model = this.createMesh( relationships, geometryMap, materialMap );
break;
case 'NurbsCurve':
model = this.createCurve( relationships, geometryMap );
break;
case 'LimbNode':
case 'Root':
model = new Bone();
break;
case 'Null':
default:
model = new Group();
break;
}
model.name = node.attrName ? PropertyBinding.sanitizeNodeName( node.attrName ) : '';
model.ID = id;
}
this.getTransformData( model, node );
modelMap.set( id, model );
}
return modelMap;
}
buildSkeleton( relationships, skeletons, id, name ) {
let bone = null;
relationships.parents.forEach( function ( parent ) {
for ( const ID in skeletons ) {
const skeleton = skeletons[ ID ];
skeleton.rawBones.forEach( function ( rawBone, i ) {
if ( rawBone.ID === parent.ID ) {
const subBone = bone;
bone = new Bone();
bone.matrixWorld.copy( rawBone.transformLink );
// set name and id here - otherwise in cases where "subBone" is created it will not have a name / id
bone.name = name ? PropertyBinding.sanitizeNodeName( name ) : '';
bone.ID = id;
skeleton.bones[ i ] = bone;
// In cases where a bone is shared between multiple meshes
// duplicate the bone here and and it as a child of the first bone
if ( subBone !== null ) {
bone.add( subBone );
}
}
} );
}
} );
return bone;
}
// create a PerspectiveCamera or OrthographicCamera
createCamera( relationships ) {
let model;
let cameraAttribute;
relationships.children.forEach( function ( child ) {
const attr = fbxTree.Objects.NodeAttribute[ child.ID ];
if ( attr !== undefined ) {
cameraAttribute = attr;
}
} );
if ( cameraAttribute === undefined ) {
model = new Object3D();
} else {
let type = 0;
if ( cameraAttribute.CameraProjectionType !== undefined && cameraAttribute.CameraProjectionType.value === 1 ) {
type = 1;
}
let nearClippingPlane = 1;
if ( cameraAttribute.NearPlane !== undefined ) {
nearClippingPlane = cameraAttribute.NearPlane.value / 1000;
}
let farClippingPlane = 1000;
if ( cameraAttribute.FarPlane !== undefined ) {
farClippingPlane = cameraAttribute.FarPlane.value / 1000;
}
let width = window.innerWidth;
let height = window.innerHeight;
if ( cameraAttribute.AspectWidth !== undefined && cameraAttribute.AspectHeight !== undefined ) {
width = cameraAttribute.AspectWidth.value;
height = cameraAttribute.AspectHeight.value;
}
const aspect = width / height;
let fov = 45;
if ( cameraAttribute.FieldOfView !== undefined ) {
fov = cameraAttribute.FieldOfView.value;
}
const focalLength = cameraAttribute.FocalLength ? cameraAttribute.FocalLength.value : null;
switch ( type ) {
case 0: // Perspective
model = new PerspectiveCamera( fov, aspect, nearClippingPlane, farClippingPlane );
if ( focalLength !== null ) model.setFocalLength( focalLength );
break;
case 1: // Orthographic
model = new OrthographicCamera( - width / 2, width / 2, height / 2, - height / 2, nearClippingPlane, farClippingPlane );
break;
default:
console.warn( 'THREE.FBXLoader: Unknown camera type ' + type + '.' );
model = new Object3D();
break;
}
}
return model;
}
// Create a DirectionalLight, PointLight or SpotLight
createLight( relationships ) {
let model;
let lightAttribute;
relationships.children.forEach( function ( child ) {
const attr = fbxTree.Objects.NodeAttribute[ child.ID ];
if ( attr !== undefined ) {
lightAttribute = attr;
}
} );
if ( lightAttribute === undefined ) {
model = new Object3D();
} else {
let type;
// LightType can be undefined for Point lights
if ( lightAttribute.LightType === undefined ) {
type = 0;
} else {
type = lightAttribute.LightType.value;
}
let color = 0xffffff;
if ( lightAttribute.Color !== undefined ) {
color = new Color().fromArray( lightAttribute.Color.value ).convertSRGBToLinear();
}
let intensity = ( lightAttribute.Intensity === undefined ) ? 1 : lightAttribute.Intensity.value / 100;
// light disabled
if ( lightAttribute.CastLightOnObject !== undefined && lightAttribute.CastLightOnObject.value === 0 ) {
intensity = 0;
}
let distance = 0;
if ( lightAttribute.FarAttenuationEnd !== undefined ) {
if ( lightAttribute.EnableFarAttenuation !== undefined && lightAttribute.EnableFarAttenuation.value === 0 ) {
distance = 0;
} else {
distance = lightAttribute.FarAttenuationEnd.value;
}
}
// TODO: could this be calculated linearly from FarAttenuationStart to FarAttenuationEnd?
const decay = 1;
switch ( type ) {
case 0: // Point
model = new PointLight( color, intensity, distance, decay );
break;
case 1: // Directional
model = new DirectionalLight( color, intensity );
break;
case 2: // Spot
let angle = Math.PI / 3;
if ( lightAttribute.InnerAngle !== undefined ) {
angle = MathUtils.degToRad( lightAttribute.InnerAngle.value );
}
let penumbra = 0;
if ( lightAttribute.OuterAngle !== undefined ) {
// TODO: this is not correct - FBX calculates outer and inner angle in degrees
// with OuterAngle > InnerAngle && OuterAngle <= Math.PI
// while three.js uses a penumbra between (0, 1) to attenuate the inner angle
penumbra = MathUtils.degToRad( lightAttribute.OuterAngle.value );
penumbra = Math.max( penumbra, 1 );
}
model = new SpotLight( color, intensity, distance, angle, penumbra, decay );
break;
default:
console.warn( 'THREE.FBXLoader: Unknown light type ' + lightAttribute.LightType.value + ', defaulting to a PointLight.' );
model = new PointLight( color, intensity );
break;
}
if ( lightAttribute.CastShadows !== undefined && lightAttribute.CastShadows.value === 1 ) {
model.castShadow = true;
}
}
return model;
}
createMesh( relationships, geometryMap, materialMap ) {
let model;
let geometry = null;
let material = null;
const materials = [];
// get geometry and materials(s) from connections
relationships.children.forEach( function ( child ) {
if ( geometryMap.has( child.ID ) ) {
geometry = geometryMap.get( child.ID );
}
if ( materialMap.has( child.ID ) ) {
materials.push( materialMap.get( child.ID ) );
}
} );
if ( materials.length > 1 ) {
material = materials;
} else if ( materials.length > 0 ) {
material = materials[ 0 ];
} else {
material = new MeshPhongMaterial( {
name: Loader.DEFAULT_MATERIAL_NAME,
color: 0xcccccc
} );
materials.push( material );
}
if ( 'color' in geometry.attributes ) {
materials.forEach( function ( material ) {
material.vertexColors = true;
} );
}
if ( geometry.FBX_Deformer ) {
model = new SkinnedMesh( geometry, material );
model.normalizeSkinWeights();
} else {
model = new Mesh( geometry, material );
}
return model;
}
createCurve( relationships, geometryMap ) {
const geometry = relationships.children.reduce( function ( geo, child ) {
if ( geometryMap.has( child.ID ) ) geo = geometryMap.get( child.ID );
return geo;
}, null );
// FBX does not list materials for Nurbs lines, so we'll just put our own in here.
const material = new LineBasicMaterial( {
name: Loader.DEFAULT_MATERIAL_NAME,
color: 0x3300ff,
linewidth: 1
} );
return new Line( geometry, material );
}
// parse the model node for transform data
getTransformData( model, modelNode ) {
const transformData = {};
if ( 'InheritType' in modelNode ) transformData.inheritType = parseInt( modelNode.InheritType.value );
if ( 'RotationOrder' in modelNode ) transformData.eulerOrder = getEulerOrder( modelNode.RotationOrder.value );
else transformData.eulerOrder = 'ZYX';
if ( 'Lcl_Translation' in modelNode ) transformData.translation = modelNode.Lcl_Translation.value;
if ( 'PreRotation' in modelNode ) transformData.preRotation = modelNode.PreRotation.value;
if ( 'Lcl_Rotation' in modelNode ) transformData.rotation = modelNode.Lcl_Rotation.value;
if ( 'PostRotation' in modelNode ) transformData.postRotation = modelNode.PostRotation.value;
if ( 'Lcl_Scaling' in modelNode ) transformData.scale = modelNode.Lcl_Scaling.value;
if ( 'ScalingOffset' in modelNode ) transformData.scalingOffset = modelNode.ScalingOffset.value;
if ( 'ScalingPivot' in modelNode ) transformData.scalingPivot = modelNode.ScalingPivot.value;
if ( 'RotationOffset' in modelNode ) transformData.rotationOffset = modelNode.RotationOffset.value;
if ( 'RotationPivot' in modelNode ) transformData.rotationPivot = modelNode.RotationPivot.value;
model.userData.transformData = transformData;
}
setLookAtProperties( model, modelNode ) {
if ( 'LookAtProperty' in modelNode ) {
const children = connections.get( model.ID ).children;
children.forEach( function ( child ) {
if ( child.relationship === 'LookAtProperty' ) {
const lookAtTarget = fbxTree.Objects.Model[ child.ID ];
if ( 'Lcl_Translation' in lookAtTarget ) {
const pos = lookAtTarget.Lcl_Translation.value;
// DirectionalLight, SpotLight
if ( model.target !== undefined ) {
model.target.position.fromArray( pos );
sceneGraph.add( model.target );
} else { // Cameras and other Object3Ds
model.lookAt( new Vector3().fromArray( pos ) );
}
}
}
} );
}
}
bindSkeleton( skeletons, geometryMap, modelMap ) {
const bindMatrices = this.parsePoseNodes();
for ( const ID in skeletons ) {
const skeleton = skeletons[ ID ];
const parents = connections.get( parseInt( skeleton.ID ) ).parents;
parents.forEach( function ( parent ) {
if ( geometryMap.has( parent.ID ) ) {
const geoID = parent.ID;
const geoRelationships = connections.get( geoID );
geoRelationships.parents.forEach( function ( geoConnParent ) {
if ( modelMap.has( geoConnParent.ID ) ) {
const model = modelMap.get( geoConnParent.ID );
model.bind( new Skeleton( skeleton.bones ), bindMatrices[ geoConnParent.ID ] );
}
} );
}
} );
}
}
parsePoseNodes() {
const bindMatrices = {};
if ( 'Pose' in fbxTree.Objects ) {
const BindPoseNode = fbxTree.Objects.Pose;
for ( const nodeID in BindPoseNode ) {
if ( BindPoseNode[ nodeID ].attrType === 'BindPose' && BindPoseNode[ nodeID ].NbPoseNodes > 0 ) {
const poseNodes = BindPoseNode[ nodeID ].PoseNode;
if ( Array.isArray( poseNodes ) ) {
poseNodes.forEach( function ( poseNode ) {
bindMatrices[ poseNode.Node ] = new Matrix4().fromArray( poseNode.Matrix.a );
} );
} else {
bindMatrices[ poseNodes.Node ] = new Matrix4().fromArray( poseNodes.Matrix.a );
}
}
}
}
return bindMatrices;
}
// Parse ambient color in FBXTree.GlobalSettings - if it's not set to black (default), create an ambient light
createAmbientLight() {
if ( 'GlobalSettings' in fbxTree && 'AmbientColor' in fbxTree.GlobalSettings ) {
const ambientColor = fbxTree.GlobalSettings.AmbientColor.value;
const r = ambientColor[ 0 ];
const g = ambientColor[ 1 ];
const b = ambientColor[ 2 ];
if ( r !== 0 || g !== 0 || b !== 0 ) {
const color = new Color( r, g, b ).convertSRGBToLinear();
sceneGraph.add( new AmbientLight( color, 1 ) );
}
}
}
}
// parse Geometry data from FBXTree and return map of BufferGeometries
class GeometryParser {
constructor() {
this.negativeMaterialIndices = false;
}
// Parse nodes in FBXTree.Objects.Geometry
parse( deformers ) {
const geometryMap = new Map();
if ( 'Geometry' in fbxTree.Objects ) {
const geoNodes = fbxTree.Objects.Geometry;
for ( const nodeID in geoNodes ) {
const relationships = connections.get( parseInt( nodeID ) );
const geo = this.parseGeometry( relationships, geoNodes[ nodeID ], deformers );
geometryMap.set( parseInt( nodeID ), geo );
}
}
// report warnings
if ( this.negativeMaterialIndices === true ) {
console.warn( 'THREE.FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected.' );
}
return geometryMap;
}
// Parse single node in FBXTree.Objects.Geometry
parseGeometry( relationships, geoNode, deformers ) {
switch ( geoNode.attrType ) {
case 'Mesh':
return this.parseMeshGeometry( relationships, geoNode, deformers );
break;
case 'NurbsCurve':
return this.parseNurbsGeometry( geoNode );
break;
}
}
// Parse single node mesh geometry in FBXTree.Objects.Geometry
parseMeshGeometry( relationships, geoNode, deformers ) {
const skeletons = deformers.skeletons;
const morphTargets = [];
const modelNodes = relationships.parents.map( function ( parent ) {
return fbxTree.Objects.Model[ parent.ID ];
} );
// don't create geometry if it is not associated with any models
if ( modelNodes.length === 0 ) return;
const skeleton = relationships.children.reduce( function ( skeleton, child ) {
if ( skeletons[ child.ID ] !== undefined ) skeleton = skeletons[ child.ID ];
return skeleton;
}, null );
relationships.children.forEach( function ( child ) {
if ( deformers.morphTargets[ child.ID ] !== undefined ) {
morphTargets.push( deformers.morphTargets[ child.ID ] );
}
} );
// Assume one model and get the preRotation from that
// if there is more than one model associated with the geometry this may cause problems
const modelNode = modelNodes[ 0 ];
const transformData = {};
if ( 'RotationOrder' in modelNode ) transformData.eulerOrder = getEulerOrder( modelNode.RotationOrder.value );
if ( 'InheritType' in modelNode ) transformData.inheritType = parseInt( modelNode.InheritType.value );
if ( 'GeometricTranslation' in modelNode ) transformData.translation = modelNode.GeometricTranslation.value;
if ( 'GeometricRotation' in modelNode ) transformData.rotation = modelNode.GeometricRotation.value;
if ( 'GeometricScaling' in modelNode ) transformData.scale = modelNode.GeometricScaling.value;
const transform = generateTransform( transformData );
return this.genGeometry( geoNode, skeleton, morphTargets, transform );
}
// Generate a BufferGeometry from a node in FBXTree.Objects.Geometry
genGeometry( geoNode, skeleton, morphTargets, preTransform ) {
const geo = new BufferGeometry();
if ( geoNode.attrName ) geo.name = geoNode.attrName;
const geoInfo = this.parseGeoNode( geoNode, skeleton );
const buffers = this.genBuffers( geoInfo );
const positionAttribute = new Float32BufferAttribute( buffers.vertex, 3 );
positionAttribute.applyMatrix4( preTransform );
geo.setAttribute( 'position', positionAttribute );
if ( buffers.colors.length > 0 ) {
geo.setAttribute( 'color', new Float32BufferAttribute( buffers.colors, 3 ) );
}
if ( skeleton ) {
geo.setAttribute( 'skinIndex', new Uint16BufferAttribute( buffers.weightsIndices, 4 ) );
geo.setAttribute( 'skinWeight', new Float32BufferAttribute( buffers.vertexWeights, 4 ) );
// used later to bind the skeleton to the model
geo.FBX_Deformer = skeleton;
}
if ( buffers.normal.length > 0 ) {
const normalMatrix = new Matrix3().getNormalMatrix( preTransform );
const normalAttribute = new Float32BufferAttribute( buffers.normal, 3 );
normalAttribute.applyNormalMatrix( normalMatrix );
geo.setAttribute( 'normal', normalAttribute );
}
buffers.uvs.forEach( function ( uvBuffer, i ) {
const name = i === 0 ? 'uv' : `uv${ i }`;
geo.setAttribute( name, new Float32BufferAttribute( buffers.uvs[ i ], 2 ) );
} );
if ( geoInfo.material && geoInfo.material.mappingType !== 'AllSame' ) {
// Convert the material indices of each vertex into rendering groups on the geometry.
let prevMaterialIndex = buffers.materialIndex[ 0 ];
let startIndex = 0;
buffers.materialIndex.forEach( function ( currentIndex, i ) {
if ( currentIndex !== prevMaterialIndex ) {
geo.addGroup( startIndex, i - startIndex, prevMaterialIndex );
prevMaterialIndex = currentIndex;
startIndex = i;
}
} );
// the loop above doesn't add the last group, do that here.
if ( geo.groups.length > 0 ) {
const lastGroup = geo.groups[ geo.groups.length - 1 ];
const lastIndex = lastGroup.start + lastGroup.count;
if ( lastIndex !== buffers.materialIndex.length ) {
geo.addGroup( lastIndex, buffers.materialIndex.length - lastIndex, prevMaterialIndex );
}
}
// case where there are multiple materials but the whole geometry is only
// using one of them
if ( geo.groups.length === 0 ) {
geo.addGroup( 0, buffers.materialIndex.length, buffers.materialIndex[ 0 ] );
}
}
this.addMorphTargets( geo, geoNode, morphTargets, preTransform );
return geo;
}
parseGeoNode( geoNode, skeleton ) {
const geoInfo = {};
geoInfo.vertexPositions = ( geoNode.Vertices !== undefined ) ? geoNode.Vertices.a : [];
geoInfo.vertexIndices = ( geoNode.PolygonVertexIndex !== undefined ) ? geoNode.PolygonVertexIndex.a : [];
if ( geoNode.LayerElementColor ) {
geoInfo.color = this.parseVertexColors( geoNode.LayerElementColor[ 0 ] );
}
if ( geoNode.LayerElementMaterial ) {
geoInfo.material = this.parseMaterialIndices( geoNode.LayerElementMaterial[ 0 ] );
}
if ( geoNode.LayerElementNormal ) {
geoInfo.normal = this.parseNormals( geoNode.LayerElementNormal[ 0 ] );
}
if ( geoNode.LayerElementUV ) {
geoInfo.uv = [];
let i = 0;
while ( geoNode.LayerElementUV[ i ] ) {
if ( geoNode.LayerElementUV[ i ].UV ) {
geoInfo.uv.push( this.parseUVs( geoNode.LayerElementUV[ i ] ) );
}
i ++;
}
}
geoInfo.weightTable = {};
if ( skeleton !== null ) {
geoInfo.skeleton = skeleton;
skeleton.rawBones.forEach( function ( rawBone, i ) {
// loop over the bone's vertex indices and weights
rawBone.indices.forEach( function ( index, j ) {
if ( geoInfo.weightTable[ index ] === undefined ) geoInfo.weightTable[ index ] = [];
geoInfo.weightTable[ index ].push( {
id: i,
weight: rawBone.weights[ j ],
} );
} );
} );
}
return geoInfo;
}
genBuffers( geoInfo ) {
const buffers = {
vertex: [],
normal: [],
colors: [],
uvs: [],
materialIndex: [],
vertexWeights: [],
weightsIndices: [],
};
let polygonIndex = 0;
let faceLength = 0;
let displayedWeightsWarning = false;
// these will hold data for a single face
let facePositionIndexes = [];
let faceNormals = [];
let faceColors = [];
let faceUVs = [];
let faceWeights = [];
let faceWeightIndices = [];
const scope = this;
geoInfo.vertexIndices.forEach( function ( vertexIndex, polygonVertexIndex ) {
let materialIndex;
let endOfFace = false;
// Face index and vertex index arrays are combined in a single array
// A cube with quad faces looks like this:
// PolygonVertexIndex: *24 {
// a: 0, 1, 3, -3, 2, 3, 5, -5, 4, 5, 7, -7, 6, 7, 1, -1, 1, 7, 5, -4, 6, 0, 2, -5
// }
// Negative numbers mark the end of a face - first face here is 0, 1, 3, -3
// to find index of last vertex bit shift the index: ^ - 1
if ( vertexIndex < 0 ) {
vertexIndex = vertexIndex ^ - 1; // equivalent to ( x * -1 ) - 1
endOfFace = true;
}
let weightIndices = [];
let weights = [];
facePositionIndexes.push( vertexIndex * 3, vertexIndex * 3 + 1, vertexIndex * 3 + 2 );
if ( geoInfo.color ) {
const data = getData( polygonVertexIndex, polygonIndex, vertexIndex, geoInfo.color );
faceColors.push( data[ 0 ], data[ 1 ], data[ 2 ] );
}
if ( geoInfo.skeleton ) {
if ( geoInfo.weightTable[ vertexIndex ] !== undefined ) {
geoInfo.weightTable[ vertexIndex ].forEach( function ( wt ) {
weights.push( wt.weight );
weightIndices.push( wt.id );
} );
}
if ( weights.length > 4 ) {
if ( ! displayedWeightsWarning ) {
console.warn( 'THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights.' );
displayedWeightsWarning = true;
}
const wIndex = [ 0, 0, 0, 0 ];
const Weight = [ 0, 0, 0, 0 ];
weights.forEach( function ( weight, weightIndex ) {
let currentWeight = weight;
let currentIndex = weightIndices[ weightIndex ];
Weight.forEach( function ( comparedWeight, comparedWeightIndex, comparedWeightArray ) {
if ( currentWeight > comparedWeight ) {
comparedWeightArray[ comparedWeightIndex ] = currentWeight;
currentWeight = comparedWeight;
const tmp = wIndex[ comparedWeightIndex ];
wIndex[ comparedWeightIndex ] = currentIndex;
currentIndex = tmp;
}
} );
} );
weightIndices = wIndex;
weights = Weight;
}
// if the weight array is shorter than 4 pad with 0s
while ( weights.length < 4 ) {
weights.push( 0 );
weightIndices.push( 0 );
}
for ( let i = 0; i < 4; ++ i ) {
faceWeights.push( weights[ i ] );
faceWeightIndices.push( weightIndices[ i ] );
}
}
if ( geoInfo.normal ) {
const data = getData( polygonVertexIndex, polygonIndex, vertexIndex, geoInfo.normal );
faceNormals.push( data[ 0 ], data[ 1 ], data[ 2 ] );
}
if ( geoInfo.material && geoInfo.material.mappingType !== 'AllSame' ) {
materialIndex = getData( polygonVertexIndex, polygonIndex, vertexIndex, geoInfo.material )[ 0 ];
if ( materialIndex < 0 ) {
scope.negativeMaterialIndices = true;
materialIndex = 0; // fallback
}
}
if ( geoInfo.uv ) {
geoInfo.uv.forEach( function ( uv, i ) {
const data = getData( polygonVertexIndex, polygonIndex, vertexIndex, uv );
if ( faceUVs[ i ] === undefined ) {
faceUVs[ i ] = [];
}
faceUVs[ i ].push( data[ 0 ] );
faceUVs[ i ].push( data[ 1 ] );
} );
}
faceLength ++;
if ( endOfFace ) {
if ( faceLength > 4 ) console.warn( 'THREE.FBXLoader: Polygons with more than four sides are not supported. Make sure to triangulate the geometry during export.' );
scope.genFace( buffers, geoInfo, facePositionIndexes, materialIndex, faceNormals, faceColors, faceUVs, faceWeights, faceWeightIndices, faceLength );
polygonIndex ++;
faceLength = 0;
// reset arrays for the next face
facePositionIndexes = [];
faceNormals = [];
faceColors = [];
faceUVs = [];
faceWeights = [];
faceWeightIndices = [];
}
} );
return buffers;
}
// Generate data for a single face in a geometry. If the face is a quad then split it into 2 tris
genFace( buffers, geoInfo, facePositionIndexes, materialIndex, faceNormals, faceColors, faceUVs, faceWeights, faceWeightIndices, faceLength ) {
for ( let i = 2; i < faceLength; i ++ ) {
buffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ 0 ] ] );
buffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ 1 ] ] );
buffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ 2 ] ] );
buffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ ( i - 1 ) * 3 ] ] );
buffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ ( i - 1 ) * 3 + 1 ] ] );
buffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ ( i - 1 ) * 3 + 2 ] ] );
buffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i * 3 ] ] );
buffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i * 3 + 1 ] ] );
buffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i * 3 + 2 ] ] );
if ( geoInfo.skeleton ) {
buffers.vertexWeights.push( faceWeights[ 0 ] );
buffers.vertexWeights.push( faceWeights[ 1 ] );
buffers.vertexWeights.push( faceWeights[ 2 ] );
buffers.vertexWeights.push( faceWeights[ 3 ] );
buffers.vertexWeights.push( faceWeights[ ( i - 1 ) * 4 ] );
buffers.vertexWeights.push( faceWeights[ ( i - 1 ) * 4 + 1 ] );
buffers.vertexWeights.push( faceWeights[ ( i - 1 ) * 4 + 2 ] );
buffers.vertexWeights.push( faceWeights[ ( i - 1 ) * 4 + 3 ] );
buffers.vertexWeights.push( faceWeights[ i * 4 ] );
buffers.vertexWeights.push( faceWeights[ i * 4 + 1 ] );
buffers.vertexWeights.push( faceWeights[ i * 4 + 2 ] );
buffers.vertexWeights.push( faceWeights[ i * 4 + 3 ] );
buffers.weightsIndices.push( faceWeightIndices[ 0 ] );
buffers.weightsIndices.push( faceWeightIndices[ 1 ] );
buffers.weightsIndices.push( faceWeightIndices[ 2 ] );
buffers.weightsIndices.push( faceWeightIndices[ 3 ] );
buffers.weightsIndices.push( faceWeightIndices[ ( i - 1 ) * 4 ] );
buffers.weightsIndices.push( faceWeightIndices[ ( i - 1 ) * 4 + 1 ] );
buffers.weightsIndices.push( faceWeightIndices[ ( i - 1 ) * 4 + 2 ] );
buffers.weightsIndices.push( faceWeightIndices[ ( i - 1 ) * 4 + 3 ] );
buffers.weightsIndices.push( faceWeightIndices[ i * 4 ] );
buffers.weightsIndices.push( faceWeightIndices[ i * 4 + 1 ] );
buffers.weightsIndices.push( faceWeightIndices[ i * 4 + 2 ] );
buffers.weightsIndices.push( faceWeightIndices[ i * 4 + 3 ] );
}
if ( geoInfo.color ) {
buffers.colors.push( faceColors[ 0 ] );
buffers.colors.push( faceColors[ 1 ] );
buffers.colors.push( faceColors[ 2 ] );
buffers.colors.push( faceColors[ ( i - 1 ) * 3 ] );
buffers.colors.push( faceColors[ ( i - 1 ) * 3 + 1 ] );
buffers.colors.push( faceColors[ ( i - 1 ) * 3 + 2 ] );
buffers.colors.push( faceColors[ i * 3 ] );
buffers.colors.push( faceColors[ i * 3 + 1 ] );
buffers.colors.push( faceColors[ i * 3 + 2 ] );
}
if ( geoInfo.material && geoInfo.material.mappingType !== 'AllSame' ) {
buffers.materialIndex.push( materialIndex );
buffers.materialIndex.push( materialIndex );
buffers.materialIndex.push( materialIndex );
}
if ( geoInfo.normal ) {
buffers.normal.push( faceNormals[ 0 ] );
buffers.normal.push( faceNormals[ 1 ] );
buffers.normal.push( faceNormals[ 2 ] );
buffers.normal.push( faceNormals[ ( i - 1 ) * 3 ] );
buffers.normal.push( faceNormals[ ( i - 1 ) * 3 + 1 ] );
buffers.normal.push( faceNormals[ ( i - 1 ) * 3 + 2 ] );
buffers.normal.push( faceNormals[ i * 3 ] );
buffers.normal.push( faceNormals[ i * 3 + 1 ] );
buffers.normal.push( faceNormals[ i * 3 + 2 ] );
}
if ( geoInfo.uv ) {
geoInfo.uv.forEach( function ( uv, j ) {
if ( buffers.uvs[ j ] === undefined ) buffers.uvs[ j ] = [];
buffers.uvs[ j ].push( faceUVs[ j ][ 0 ] );
buffers.uvs[ j ].push( faceUVs[ j ][ 1 ] );
buffers.uvs[ j ].push( faceUVs[ j ][ ( i - 1 ) * 2 ] );
buffers.uvs[ j ].push( faceUVs[ j ][ ( i - 1 ) * 2 + 1 ] );
buffers.uvs[ j ].push( faceUVs[ j ][ i * 2 ] );
buffers.uvs[ j ].push( faceUVs[ j ][ i * 2 + 1 ] );
} );
}
}
}
addMorphTargets( parentGeo, parentGeoNode, morphTargets, preTransform ) {
if ( morphTargets.length === 0 ) return;
parentGeo.morphTargetsRelative = true;
parentGeo.morphAttributes.position = [];
// parentGeo.morphAttributes.normal = []; // not implemented
const scope = this;
morphTargets.forEach( function ( morphTarget ) {
morphTarget.rawTargets.forEach( function ( rawTarget ) {
const morphGeoNode = fbxTree.Objects.Geometry[ rawTarget.geoID ];
if ( morphGeoNode !== undefined ) {
scope.genMorphGeometry( parentGeo, parentGeoNode, morphGeoNode, preTransform, rawTarget.name );
}
} );
} );
}
// a morph geometry node is similar to a standard node, and the node is also contained
// in FBXTree.Objects.Geometry, however it can only have attributes for position, normal
// and a special attribute Index defining which vertices of the original geometry are affected
// Normal and position attributes only have data for the vertices that are affected by the morph
genMorphGeometry( parentGeo, parentGeoNode, morphGeoNode, preTransform, name ) {
const vertexIndices = ( parentGeoNode.PolygonVertexIndex !== undefined ) ? parentGeoNode.PolygonVertexIndex.a : [];
const morphPositionsSparse = ( morphGeoNode.Vertices !== undefined ) ? morphGeoNode.Vertices.a : [];
const indices = ( morphGeoNode.Indexes !== undefined ) ? morphGeoNode.Indexes.a : [];
const length = parentGeo.attributes.position.count * 3;
const morphPositions = new Float32Array( length );
for ( let i = 0; i < indices.length; i ++ ) {
const morphIndex = indices[ i ] * 3;
morphPositions[ morphIndex ] = morphPositionsSparse[ i * 3 ];
morphPositions[ morphIndex + 1 ] = morphPositionsSparse[ i * 3 + 1 ];
morphPositions[ morphIndex + 2 ] = morphPositionsSparse[ i * 3 + 2 ];
}
// TODO: add morph normal support
const morphGeoInfo = {
vertexIndices: vertexIndices,
vertexPositions: morphPositions,
};
const morphBuffers = this.genBuffers( morphGeoInfo );
const positionAttribute = new Float32BufferAttribute( morphBuffers.vertex, 3 );
positionAttribute.name = name || morphGeoNode.attrName;
positionAttribute.applyMatrix4( preTransform );
parentGeo.morphAttributes.position.push( positionAttribute );
}
// Parse normal from FBXTree.Objects.Geometry.LayerElementNormal if it exists
parseNormals( NormalNode ) {
const mappingType = NormalNode.MappingInformationType;
const referenceType = NormalNode.ReferenceInformationType;
const buffer = NormalNode.Normals.a;
let indexBuffer = [];
if ( referenceType === 'IndexToDirect' ) {
if ( 'NormalIndex' in NormalNode ) {
indexBuffer = NormalNode.NormalIndex.a;
} else if ( 'NormalsIndex' in NormalNode ) {
indexBuffer = NormalNode.NormalsIndex.a;
}
}
return {
dataSize: 3,
buffer: buffer,
indices: indexBuffer,
mappingType: mappingType,
referenceType: referenceType
};
}
// Parse UVs from FBXTree.Objects.Geometry.LayerElementUV if it exists
parseUVs( UVNode ) {
const mappingType = UVNode.MappingInformationType;
const referenceType = UVNode.ReferenceInformationType;
const buffer = UVNode.UV.a;
let indexBuffer = [];
if ( referenceType === 'IndexToDirect' ) {
indexBuffer = UVNode.UVIndex.a;
}
return {
dataSize: 2,
buffer: buffer,
indices: indexBuffer,
mappingType: mappingType,
referenceType: referenceType
};
}
// Parse Vertex Colors from FBXTree.Objects.Geometry.LayerElementColor if it exists
parseVertexColors( ColorNode ) {
const mappingType = ColorNode.MappingInformationType;
const referenceType = ColorNode.ReferenceInformationType;
const buffer = ColorNode.Colors.a;
let indexBuffer = [];
if ( referenceType === 'IndexToDirect' ) {
indexBuffer = ColorNode.ColorIndex.a;
}
for ( let i = 0, c = new Color(); i < buffer.length; i += 4 ) {
c.fromArray( buffer, i ).convertSRGBToLinear().toArray( buffer, i );
}
return {
dataSize: 4,
buffer: buffer,
indices: indexBuffer,
mappingType: mappingType,
referenceType: referenceType
};
}
// Parse mapping and material data in FBXTree.Objects.Geometry.LayerElementMaterial if it exists
parseMaterialIndices( MaterialNode ) {
const mappingType = MaterialNode.MappingInformationType;
const referenceType = MaterialNode.ReferenceInformationType;
if ( mappingType === 'NoMappingInformation' ) {
return {
dataSize: 1,
buffer: [ 0 ],
indices: [ 0 ],
mappingType: 'AllSame',
referenceType: referenceType
};
}
const materialIndexBuffer = MaterialNode.Materials.a;
// Since materials are stored as indices, there's a bit of a mismatch between FBX and what
// we expect.So we create an intermediate buffer that points to the index in the buffer,
// for conforming with the other functions we've written for other data.
const materialIndices = [];
for ( let i = 0; i < materialIndexBuffer.length; ++ i ) {
materialIndices.push( i );
}
return {
dataSize: 1,
buffer: materialIndexBuffer,
indices: materialIndices,
mappingType: mappingType,
referenceType: referenceType
};
}
// Generate a NurbGeometry from a node in FBXTree.Objects.Geometry
parseNurbsGeometry( geoNode ) {
const order = parseInt( geoNode.Order );
if ( isNaN( order ) ) {
console.error( 'THREE.FBXLoader: Invalid Order %s given for geometry ID: %s', geoNode.Order, geoNode.id );
return new BufferGeometry();
}
const degree = order - 1;
const knots = geoNode.KnotVector.a;
const controlPoints = [];
const pointsValues = geoNode.Points.a;
for ( let i = 0, l = pointsValues.length; i < l; i += 4 ) {
controlPoints.push( new Vector4().fromArray( pointsValues, i ) );
}
let startKnot, endKnot;
if ( geoNode.Form === 'Closed' ) {
controlPoints.push( controlPoints[ 0 ] );
} else if ( geoNode.Form === 'Periodic' ) {
startKnot = degree;
endKnot = knots.length - 1 - startKnot;
for ( let i = 0; i < degree; ++ i ) {
controlPoints.push( controlPoints[ i ] );
}
}
const curve = new NURBSCurve( degree, knots, controlPoints, startKnot, endKnot );
const points = curve.getPoints( controlPoints.length * 12 );
return new BufferGeometry().setFromPoints( points );
}
}
// parse animation data from FBXTree
class AnimationParser {
// take raw animation clips and turn them into three.js animation clips
parse() {
const animationClips = [];
const rawClips = this.parseClips();
if ( rawClips !== undefined ) {
for ( const key in rawClips ) {
const rawClip = rawClips[ key ];
const clip = this.addClip( rawClip );
animationClips.push( clip );
}
}
return animationClips;
}
parseClips() {
// since the actual transformation data is stored in FBXTree.Objects.AnimationCurve,
// if this is undefined we can safely assume there are no animations
if ( fbxTree.Objects.AnimationCurve === undefined ) return undefined;
const curveNodesMap = this.parseAnimationCurveNodes();
this.parseAnimationCurves( curveNodesMap );
const layersMap = this.parseAnimationLayers( curveNodesMap );
const rawClips = this.parseAnimStacks( layersMap );
return rawClips;
}
// parse nodes in FBXTree.Objects.AnimationCurveNode
// each AnimationCurveNode holds data for an animation transform for a model (e.g. left arm rotation )
// and is referenced by an AnimationLayer
parseAnimationCurveNodes() {
const rawCurveNodes = fbxTree.Objects.AnimationCurveNode;
const curveNodesMap = new Map();
for ( const nodeID in rawCurveNodes ) {
const rawCurveNode = rawCurveNodes[ nodeID ];
if ( rawCurveNode.attrName.match( /S|R|T|DeformPercent/ ) !== null ) {
const curveNode = {
id: rawCurveNode.id,
attr: rawCurveNode.attrName,
curves: {},
};
curveNodesMap.set( curveNode.id, curveNode );
}
}
return curveNodesMap;
}
// parse nodes in FBXTree.Objects.AnimationCurve and connect them up to
// previously parsed AnimationCurveNodes. Each AnimationCurve holds data for a single animated
// axis ( e.g. times and values of x rotation)
parseAnimationCurves( curveNodesMap ) {
const rawCurves = fbxTree.Objects.AnimationCurve;
// TODO: Many values are identical up to roundoff error, but won't be optimised
// e.g. position times: [0, 0.4, 0. 8]
// position values: [7.23538335023477e-7, 93.67518615722656, -0.9982695579528809, 7.23538335023477e-7, 93.67518615722656, -0.9982695579528809, 7.235384487103147e-7, 93.67520904541016, -0.9982695579528809]
// clearly, this should be optimised to
// times: [0], positions [7.23538335023477e-7, 93.67518615722656, -0.9982695579528809]
// this shows up in nearly every FBX file, and generally time array is length > 100
for ( const nodeID in rawCurves ) {
const animationCurve = {
id: rawCurves[ nodeID ].id,
times: rawCurves[ nodeID ].KeyTime.a.map( convertFBXTimeToSeconds ),
values: rawCurves[ nodeID ].KeyValueFloat.a,
};
const relationships = connections.get( animationCurve.id );
if ( relationships !== undefined ) {
const animationCurveID = relationships.parents[ 0 ].ID;
const animationCurveRelationship = relationships.parents[ 0 ].relationship;
if ( animationCurveRelationship.match( /X/ ) ) {
curveNodesMap.get( animationCurveID ).curves[ 'x' ] = animationCurve;
} else if ( animationCurveRelationship.match( /Y/ ) ) {
curveNodesMap.get( animationCurveID ).curves[ 'y' ] = animationCurve;
} else if ( animationCurveRelationship.match( /Z/ ) ) {
curveNodesMap.get( animationCurveID ).curves[ 'z' ] = animationCurve;
} else if ( animationCurveRelationship.match( /DeformPercent/ ) && curveNodesMap.has( animationCurveID ) ) {
curveNodesMap.get( animationCurveID ).curves[ 'morph' ] = animationCurve;
}
}
}
}
// parse nodes in FBXTree.Objects.AnimationLayer. Each layers holds references
// to various AnimationCurveNodes and is referenced by an AnimationStack node
// note: theoretically a stack can have multiple layers, however in practice there always seems to be one per stack
parseAnimationLayers( curveNodesMap ) {
const rawLayers = fbxTree.Objects.AnimationLayer;
const layersMap = new Map();
for ( const nodeID in rawLayers ) {
const layerCurveNodes = [];
const connection = connections.get( parseInt( nodeID ) );
if ( connection !== undefined ) {
// all the animationCurveNodes used in the layer
const children = connection.children;
children.forEach( function ( child, i ) {
if ( curveNodesMap.has( child.ID ) ) {
const curveNode = curveNodesMap.get( child.ID );
// check that the curves are defined for at least one axis, otherwise ignore the curveNode
if ( curveNode.curves.x !== undefined || curveNode.curves.y !== undefined || curveNode.curves.z !== undefined ) {
if ( layerCurveNodes[ i ] === undefined ) {
const modelID = connections.get( child.ID ).parents.filter( function ( parent ) {
return parent.relationship !== undefined;
} )[ 0 ].ID;
if ( modelID !== undefined ) {
const rawModel = fbxTree.Objects.Model[ modelID.toString() ];
if ( rawModel === undefined ) {
console.warn( 'THREE.FBXLoader: Encountered a unused curve.', child );
return;
}
const node = {
modelName: rawModel.attrName ? PropertyBinding.sanitizeNodeName( rawModel.attrName ) : '',
ID: rawModel.id,
initialPosition: [ 0, 0, 0 ],
initialRotation: [ 0, 0, 0 ],
initialScale: [ 1, 1, 1 ],
};
sceneGraph.traverse( function ( child ) {
if ( child.ID === rawModel.id ) {
node.transform = child.matrix;
if ( child.userData.transformData ) node.eulerOrder = child.userData.transformData.eulerOrder;
}
} );
if ( ! node.transform ) node.transform = new Matrix4();
// if the animated model is pre rotated, we'll have to apply the pre rotations to every
// animation value as well
if ( 'PreRotation' in rawModel ) node.preRotation = rawModel.PreRotation.value;
if ( 'PostRotation' in rawModel ) node.postRotation = rawModel.PostRotation.value;
layerCurveNodes[ i ] = node;
}
}
if ( layerCurveNodes[ i ] ) layerCurveNodes[ i ][ curveNode.attr ] = curveNode;
} else if ( curveNode.curves.morph !== undefined ) {
if ( layerCurveNodes[ i ] === undefined ) {
const deformerID = connections.get( child.ID ).parents.filter( function ( parent ) {
return parent.relationship !== undefined;
} )[ 0 ].ID;
const morpherID = connections.get( deformerID ).parents[ 0 ].ID;
const geoID = connections.get( morpherID ).parents[ 0 ].ID;
// assuming geometry is not used in more than one model
const modelID = connections.get( geoID ).parents[ 0 ].ID;
const rawModel = fbxTree.Objects.Model[ modelID ];
const node = {
modelName: rawModel.attrName ? PropertyBinding.sanitizeNodeName( rawModel.attrName ) : '',
morphName: fbxTree.Objects.Deformer[ deformerID ].attrName,
};
layerCurveNodes[ i ] = node;
}
layerCurveNodes[ i ][ curveNode.attr ] = curveNode;
}
}
} );
layersMap.set( parseInt( nodeID ), layerCurveNodes );
}
}
return layersMap;
}
// parse nodes in FBXTree.Objects.AnimationStack. These are the top level node in the animation
// hierarchy. Each Stack node will be used to create a AnimationClip
parseAnimStacks( layersMap ) {
const rawStacks = fbxTree.Objects.AnimationStack;
// connect the stacks (clips) up to the layers
const rawClips = {};
for ( const nodeID in rawStacks ) {
const children = connections.get( parseInt( nodeID ) ).children;
if ( children.length > 1 ) {
// it seems like stacks will always be associated with a single layer. But just in case there are files
// where there are multiple layers per stack, we'll display a warning
console.warn( 'THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.' );
}
const layer = layersMap.get( children[ 0 ].ID );
rawClips[ nodeID ] = {
name: rawStacks[ nodeID ].attrName,
layer: layer,
};
}
return rawClips;
}
addClip( rawClip ) {
let tracks = [];
const scope = this;
rawClip.layer.forEach( function ( rawTracks ) {
tracks = tracks.concat( scope.generateTracks( rawTracks ) );
} );
return new AnimationClip( rawClip.name, - 1, tracks );
}
generateTracks( rawTracks ) {
const tracks = [];
let initialPosition = new Vector3();
let initialRotation = new Quaternion();
let initialScale = new Vector3();
if ( rawTracks.transform ) rawTracks.transform.decompose( initialPosition, initialRotation, initialScale );
initialPosition = initialPosition.toArray();
initialRotation = new Euler().setFromQuaternion( initialRotation, rawTracks.eulerOrder ).toArray();
initialScale = initialScale.toArray();
if ( rawTracks.T !== undefined && Object.keys( rawTracks.T.curves ).length > 0 ) {
const positionTrack = this.generateVectorTrack( rawTracks.modelName, rawTracks.T.curves, initialPosition, 'position' );
if ( positionTrack !== undefined ) tracks.push( positionTrack );
}
if ( rawTracks.R !== undefined && Object.keys( rawTracks.R.curves ).length > 0 ) {
const rotationTrack = this.generateRotationTrack( rawTracks.modelName, rawTracks.R.curves, initialRotation, rawTracks.preRotation, rawTracks.postRotation, rawTracks.eulerOrder );
if ( rotationTrack !== undefined ) tracks.push( rotationTrack );
}
if ( rawTracks.S !== undefined && Object.keys( rawTracks.S.curves ).length > 0 ) {
const scaleTrack = this.generateVectorTrack( rawTracks.modelName, rawTracks.S.curves, initialScale, 'scale' );
if ( scaleTrack !== undefined ) tracks.push( scaleTrack );
}
if ( rawTracks.DeformPercent !== undefined ) {
const morphTrack = this.generateMorphTrack( rawTracks );
if ( morphTrack !== undefined ) tracks.push( morphTrack );
}
return tracks;
}
generateVectorTrack( modelName, curves, initialValue, type ) {
const times = this.getTimesForAllAxes( curves );
const values = this.getKeyframeTrackValues( times, curves, initialValue );
return new VectorKeyframeTrack( modelName + '.' + type, times, values );
}
generateRotationTrack( modelName, curves, initialValue, preRotation, postRotation, eulerOrder ) {
if ( curves.x !== undefined ) {
this.interpolateRotations( curves.x );
curves.x.values = curves.x.values.map( MathUtils.degToRad );
}
if ( curves.y !== undefined ) {
this.interpolateRotations( curves.y );
curves.y.values = curves.y.values.map( MathUtils.degToRad );
}
if ( curves.z !== undefined ) {
this.interpolateRotations( curves.z );
curves.z.values = curves.z.values.map( MathUtils.degToRad );
}
const times = this.getTimesForAllAxes( curves );
const values = this.getKeyframeTrackValues( times, curves, initialValue );
if ( preRotation !== undefined ) {
preRotation = preRotation.map( MathUtils.degToRad );
preRotation.push( eulerOrder );
preRotation = new Euler().fromArray( preRotation );
preRotation = new Quaternion().setFromEuler( preRotation );
}
if ( postRotation !== undefined ) {
postRotation = postRotation.map( MathUtils.degToRad );
postRotation.push( eulerOrder );
postRotation = new Euler().fromArray( postRotation );
postRotation = new Quaternion().setFromEuler( postRotation ).invert();
}
const quaternion = new Quaternion();
const euler = new Euler();
const quaternionValues = [];
for ( let i = 0; i < values.length; i += 3 ) {
euler.set( values[ i ], values[ i + 1 ], values[ i + 2 ], eulerOrder );
quaternion.setFromEuler( euler );
if ( preRotation !== undefined ) quaternion.premultiply( preRotation );
if ( postRotation !== undefined ) quaternion.multiply( postRotation );
quaternion.toArray( quaternionValues, ( i / 3 ) * 4 );
}
return new QuaternionKeyframeTrack( modelName + '.quaternion', times, quaternionValues );
}
generateMorphTrack( rawTracks ) {
const curves = rawTracks.DeformPercent.curves.morph;
const values = curves.values.map( function ( val ) {
return val / 100;
} );
const morphNum = sceneGraph.getObjectByName( rawTracks.modelName ).morphTargetDictionary[ rawTracks.morphName ];
return new NumberKeyframeTrack( rawTracks.modelName + '.morphTargetInfluences[' + morphNum + ']', curves.times, values );
}
// For all animated objects, times are defined separately for each axis
// Here we'll combine the times into one sorted array without duplicates
getTimesForAllAxes( curves ) {
let times = [];
// first join together the times for each axis, if defined
if ( curves.x !== undefined ) times = times.concat( curves.x.times );
if ( curves.y !== undefined ) times = times.concat( curves.y.times );
if ( curves.z !== undefined ) times = times.concat( curves.z.times );
// then sort them
times = times.sort( function ( a, b ) {
return a - b;
} );
// and remove duplicates
if ( times.length > 1 ) {
let targetIndex = 1;
let lastValue = times[ 0 ];
for ( let i = 1; i < times.length; i ++ ) {
const currentValue = times[ i ];
if ( currentValue !== lastValue ) {
times[ targetIndex ] = currentValue;
lastValue = currentValue;
targetIndex ++;
}
}
times = times.slice( 0, targetIndex );
}
return times;
}
getKeyframeTrackValues( times, curves, initialValue ) {
const prevValue = initialValue;
const values = [];
let xIndex = - 1;
let yIndex = - 1;
let zIndex = - 1;
times.forEach( function ( time ) {
if ( curves.x ) xIndex = curves.x.times.indexOf( time );
if ( curves.y ) yIndex = curves.y.times.indexOf( time );
if ( curves.z ) zIndex = curves.z.times.indexOf( time );
// if there is an x value defined for this frame, use that
if ( xIndex !== - 1 ) {
const xValue = curves.x.values[ xIndex ];
values.push( xValue );
prevValue[ 0 ] = xValue;
} else {
// otherwise use the x value from the previous frame
values.push( prevValue[ 0 ] );
}
if ( yIndex !== - 1 ) {
const yValue = curves.y.values[ yIndex ];
values.push( yValue );
prevValue[ 1 ] = yValue;
} else {
values.push( prevValue[ 1 ] );
}
if ( zIndex !== - 1 ) {
const zValue = curves.z.values[ zIndex ];
values.push( zValue );
prevValue[ 2 ] = zValue;
} else {
values.push( prevValue[ 2 ] );
}
} );
return values;
}
// Rotations are defined as Euler angles which can have values of any size
// These will be converted to quaternions which don't support values greater than
// PI, so we'll interpolate large rotations
interpolateRotations( curve ) {
for ( let i = 1; i < curve.values.length; i ++ ) {
const initialValue = curve.values[ i - 1 ];
const valuesSpan = curve.values[ i ] - initialValue;
const absoluteSpan = Math.abs( valuesSpan );
if ( absoluteSpan >= 180 ) {
const numSubIntervals = absoluteSpan / 180;
const step = valuesSpan / numSubIntervals;
let nextValue = initialValue + step;
const initialTime = curve.times[ i - 1 ];
const timeSpan = curve.times[ i ] - initialTime;
const interval = timeSpan / numSubIntervals;
let nextTime = initialTime + interval;
const interpolatedTimes = [];
const interpolatedValues = [];
while ( nextTime < curve.times[ i ] ) {
interpolatedTimes.push( nextTime );
nextTime += interval;
interpolatedValues.push( nextValue );
nextValue += step;
}
curve.times = inject( curve.times, i, interpolatedTimes );
curve.values = inject( curve.values, i, interpolatedValues );
}
}
}
}
// parse an FBX file in ASCII format
class TextParser {
getPrevNode() {
return this.nodeStack[ this.currentIndent - 2 ];
}
getCurrentNode() {
return this.nodeStack[ this.currentIndent - 1 ];
}
getCurrentProp() {
return this.currentProp;
}
pushStack( node ) {
this.nodeStack.push( node );
this.currentIndent += 1;
}
popStack() {
this.nodeStack.pop();
this.currentIndent -= 1;
}
setCurrentProp( val, name ) {
this.currentProp = val;
this.currentPropName = name;
}
parse( text ) {
this.currentIndent = 0;
this.allNodes = new FBXTree();
this.nodeStack = [];
this.currentProp = [];
this.currentPropName = '';
const scope = this;
const split = text.split( /[\r\n]+/ );
split.forEach( function ( line, i ) {
const matchComment = line.match( /^[\s\t]*;/ );
const matchEmpty = line.match( /^[\s\t]*$/ );
if ( matchComment || matchEmpty ) return;
const matchBeginning = line.match( '^\\t{' + scope.currentIndent + '}(\\w+):(.*){', '' );
const matchProperty = line.match( '^\\t{' + ( scope.currentIndent ) + '}(\\w+):[\\s\\t\\r\\n](.*)' );
const matchEnd = line.match( '^\\t{' + ( scope.currentIndent - 1 ) + '}}' );
if ( matchBeginning ) {
scope.parseNodeBegin( line, matchBeginning );
} else if ( matchProperty ) {
scope.parseNodeProperty( line, matchProperty, split[ ++ i ] );
} else if ( matchEnd ) {
scope.popStack();
} else if ( line.match( /^[^\s\t}]/ ) ) {
// large arrays are split over multiple lines terminated with a ',' character
// if this is encountered the line needs to be joined to the previous line
scope.parseNodePropertyContinued( line );
}
} );
return this.allNodes;
}
parseNodeBegin( line, property ) {
const nodeName = property[ 1 ].trim().replace( /^"/, '' ).replace( /"$/, '' );
const nodeAttrs = property[ 2 ].split( ',' ).map( function ( attr ) {
return attr.trim().replace( /^"/, '' ).replace( /"$/, '' );
} );
const node = { name: nodeName };
const attrs = this.parseNodeAttr( nodeAttrs );
const currentNode = this.getCurrentNode();
// a top node
if ( this.currentIndent === 0 ) {
this.allNodes.add( nodeName, node );
} else { // a subnode
// if the subnode already exists, append it
if ( nodeName in currentNode ) {
// special case Pose needs PoseNodes as an array
if ( nodeName === 'PoseNode' ) {
currentNode.PoseNode.push( node );
} else if ( currentNode[ nodeName ].id !== undefined ) {
currentNode[ nodeName ] = {};
currentNode[ nodeName ][ currentNode[ nodeName ].id ] = currentNode[ nodeName ];
}
if ( attrs.id !== '' ) currentNode[ nodeName ][ attrs.id ] = node;
} else if ( typeof attrs.id === 'number' ) {
currentNode[ nodeName ] = {};
currentNode[ nodeName ][ attrs.id ] = node;
} else if ( nodeName !== 'Properties70' ) {
if ( nodeName === 'PoseNode' ) currentNode[ nodeName ] = [ node ];
else currentNode[ nodeName ] = node;
}
}
if ( typeof attrs.id === 'number' ) node.id = attrs.id;
if ( attrs.name !== '' ) node.attrName = attrs.name;
if ( attrs.type !== '' ) node.attrType = attrs.type;
this.pushStack( node );
}
parseNodeAttr( attrs ) {
let id = attrs[ 0 ];
if ( attrs[ 0 ] !== '' ) {
id = parseInt( attrs[ 0 ] );
if ( isNaN( id ) ) {
id = attrs[ 0 ];
}
}
let name = '', type = '';
if ( attrs.length > 1 ) {
name = attrs[ 1 ].replace( /^(\w+)::/, '' );
type = attrs[ 2 ];
}
return { id: id, name: name, type: type };
}
parseNodeProperty( line, property, contentLine ) {
let propName = property[ 1 ].replace( /^"/, '' ).replace( /"$/, '' ).trim();
let propValue = property[ 2 ].replace( /^"/, '' ).replace( /"$/, '' ).trim();
// for special case: base64 image data follows "Content: ," line
// Content: ,
// "/9j/4RDaRXhpZgAATU0A..."
if ( propName === 'Content' && propValue === ',' ) {
propValue = contentLine.replace( /"/g, '' ).replace( /,$/, '' ).trim();
}
const currentNode = this.getCurrentNode();
const parentName = currentNode.name;
if ( parentName === 'Properties70' ) {
this.parseNodeSpecialProperty( line, propName, propValue );
return;
}
// Connections
if ( propName === 'C' ) {
const connProps = propValue.split( ',' ).slice( 1 );
const from = parseInt( connProps[ 0 ] );
const to = parseInt( connProps[ 1 ] );
let rest = propValue.split( ',' ).slice( 3 );
rest = rest.map( function ( elem ) {
return elem.trim().replace( /^"/, '' );
} );
propName = 'connections';
propValue = [ from, to ];
append( propValue, rest );
if ( currentNode[ propName ] === undefined ) {
currentNode[ propName ] = [];
}
}
// Node
if ( propName === 'Node' ) currentNode.id = propValue;
// connections
if ( propName in currentNode && Array.isArray( currentNode[ propName ] ) ) {
currentNode[ propName ].push( propValue );
} else {
if ( propName !== 'a' ) currentNode[ propName ] = propValue;
else currentNode.a = propValue;
}
this.setCurrentProp( currentNode, propName );
// convert string to array, unless it ends in ',' in which case more will be added to it
if ( propName === 'a' && propValue.slice( - 1 ) !== ',' ) {
currentNode.a = parseNumberArray( propValue );
}
}
parseNodePropertyContinued( line ) {
const currentNode = this.getCurrentNode();
currentNode.a += line;
// if the line doesn't end in ',' we have reached the end of the property value
// so convert the string to an array
if ( line.slice( - 1 ) !== ',' ) {
currentNode.a = parseNumberArray( currentNode.a );
}
}
// parse "Property70"
parseNodeSpecialProperty( line, propName, propValue ) {
// split this
// P: "Lcl Scaling", "Lcl Scaling", "", "A",1,1,1
// into array like below
// ["Lcl Scaling", "Lcl Scaling", "", "A", "1,1,1" ]
const props = propValue.split( '",' ).map( function ( prop ) {
return prop.trim().replace( /^\"/, '' ).replace( /\s/, '_' );
} );
const innerPropName = props[ 0 ];
const innerPropType1 = props[ 1 ];
const innerPropType2 = props[ 2 ];
const innerPropFlag = props[ 3 ];
let innerPropValue = props[ 4 ];
// cast values where needed, otherwise leave as strings
switch ( innerPropType1 ) {
case 'int':
case 'enum':
case 'bool':
case 'ULongLong':
case 'double':
case 'Number':
case 'FieldOfView':
innerPropValue = parseFloat( innerPropValue );
break;
case 'Color':
case 'ColorRGB':
case 'Vector3D':
case 'Lcl_Translation':
case 'Lcl_Rotation':
case 'Lcl_Scaling':
innerPropValue = parseNumberArray( innerPropValue );
break;
}
// CAUTION: these props must append to parent's parent
this.getPrevNode()[ innerPropName ] = {
'type': innerPropType1,
'type2': innerPropType2,
'flag': innerPropFlag,
'value': innerPropValue
};
this.setCurrentProp( this.getPrevNode(), innerPropName );
}
}
// Parse an FBX file in Binary format
class BinaryParser {
parse( buffer ) {
const reader = new BinaryReader( buffer );
reader.skip( 23 ); // skip magic 23 bytes
const version = reader.getUint32();
if ( version < 6400 ) {
throw new Error( 'THREE.FBXLoader: FBX version not supported, FileVersion: ' + version );
}
const allNodes = new FBXTree();
while ( ! this.endOfContent( reader ) ) {
const node = this.parseNode( reader, version );
if ( node !== null ) allNodes.add( node.name, node );
}
return allNodes;
}
// Check if reader has reached the end of content.
endOfContent( reader ) {
// footer size: 160bytes + 16-byte alignment padding
// - 16bytes: magic
// - padding til 16-byte alignment (at least 1byte?)
// (seems like some exporters embed fixed 15 or 16bytes?)
// - 4bytes: magic
// - 4bytes: version
// - 120bytes: zero
// - 16bytes: magic
if ( reader.size() % 16 === 0 ) {
return ( ( reader.getOffset() + 160 + 16 ) & ~ 0xf ) >= reader.size();
} else {
return reader.getOffset() + 160 + 16 >= reader.size();
}
}
// recursively parse nodes until the end of the file is reached
parseNode( reader, version ) {
const node = {};
// The first three data sizes depends on version.
const endOffset = ( version >= 7500 ) ? reader.getUint64() : reader.getUint32();
const numProperties = ( version >= 7500 ) ? reader.getUint64() : reader.getUint32();
( version >= 7500 ) ? reader.getUint64() : reader.getUint32(); // the returned propertyListLen is not used
const nameLen = reader.getUint8();
const name = reader.getString( nameLen );
// Regards this node as NULL-record if endOffset is zero
if ( endOffset === 0 ) return null;
const propertyList = [];
for ( let i = 0; i < numProperties; i ++ ) {
propertyList.push( this.parseProperty( reader ) );
}
// Regards the first three elements in propertyList as id, attrName, and attrType
const id = propertyList.length > 0 ? propertyList[ 0 ] : '';
const attrName = propertyList.length > 1 ? propertyList[ 1 ] : '';
const attrType = propertyList.length > 2 ? propertyList[ 2 ] : '';
// check if this node represents just a single property
// like (name, 0) set or (name2, [0, 1, 2]) set of {name: 0, name2: [0, 1, 2]}
node.singleProperty = ( numProperties === 1 && reader.getOffset() === endOffset ) ? true : false;
while ( endOffset > reader.getOffset() ) {
const subNode = this.parseNode( reader, version );
if ( subNode !== null ) this.parseSubNode( name, node, subNode );
}
node.propertyList = propertyList; // raw property list used by parent
if ( typeof id === 'number' ) node.id = id;
if ( attrName !== '' ) node.attrName = attrName;
if ( attrType !== '' ) node.attrType = attrType;
if ( name !== '' ) node.name = name;
return node;
}
parseSubNode( name, node, subNode ) {
// special case: child node is single property
if ( subNode.singleProperty === true ) {
const value = subNode.propertyList[ 0 ];
if ( Array.isArray( value ) ) {
node[ subNode.name ] = subNode;
subNode.a = value;
} else {
node[ subNode.name ] = value;
}
} else if ( name === 'Connections' && subNode.name === 'C' ) {
const array = [];
subNode.propertyList.forEach( function ( property, i ) {
// first Connection is FBX type (OO, OP, etc.). We'll discard these
if ( i !== 0 ) array.push( property );
} );
if ( node.connections === undefined ) {
node.connections = [];
}
node.connections.push( array );
} else if ( subNode.name === 'Properties70' ) {
const keys = Object.keys( subNode );
keys.forEach( function ( key ) {
node[ key ] = subNode[ key ];
} );
} else if ( name === 'Properties70' && subNode.name === 'P' ) {
let innerPropName = subNode.propertyList[ 0 ];
let innerPropType1 = subNode.propertyList[ 1 ];
const innerPropType2 = subNode.propertyList[ 2 ];
const innerPropFlag = subNode.propertyList[ 3 ];
let innerPropValue;
if ( innerPropName.indexOf( 'Lcl ' ) === 0 ) innerPropName = innerPropName.replace( 'Lcl ', 'Lcl_' );
if ( innerPropType1.indexOf( 'Lcl ' ) === 0 ) innerPropType1 = innerPropType1.replace( 'Lcl ', 'Lcl_' );
if ( innerPropType1 === 'Color' || innerPropType1 === 'ColorRGB' || innerPropType1 === 'Vector' || innerPropType1 === 'Vector3D' || innerPropType1.indexOf( 'Lcl_' ) === 0 ) {
innerPropValue = [
subNode.propertyList[ 4 ],
subNode.propertyList[ 5 ],
subNode.propertyList[ 6 ]
];
} else {
innerPropValue = subNode.propertyList[ 4 ];
}
// this will be copied to parent, see above
node[ innerPropName ] = {
'type': innerPropType1,
'type2': innerPropType2,
'flag': innerPropFlag,
'value': innerPropValue
};
} else if ( node[ subNode.name ] === undefined ) {
if ( typeof subNode.id === 'number' ) {
node[ subNode.name ] = {};
node[ subNode.name ][ subNode.id ] = subNode;
} else {
node[ subNode.name ] = subNode;
}
} else {
if ( subNode.name === 'PoseNode' ) {
if ( ! Array.isArray( node[ subNode.name ] ) ) {
node[ subNode.name ] = [ node[ subNode.name ] ];
}
node[ subNode.name ].push( subNode );
} else if ( node[ subNode.name ][ subNode.id ] === undefined ) {
node[ subNode.name ][ subNode.id ] = subNode;
}
}
}
parseProperty( reader ) {
const type = reader.getString( 1 );
let length;
switch ( type ) {
case 'C':
return reader.getBoolean();
case 'D':
return reader.getFloat64();
case 'F':
return reader.getFloat32();
case 'I':
return reader.getInt32();
case 'L':
return reader.getInt64();
case 'R':
length = reader.getUint32();
return reader.getArrayBuffer( length );
case 'S':
length = reader.getUint32();
return reader.getString( length );
case 'Y':
return reader.getInt16();
case 'b':
case 'c':
case 'd':
case 'f':
case 'i':
case 'l':
const arrayLength = reader.getUint32();
const encoding = reader.getUint32(); // 0: non-compressed, 1: compressed
const compressedLength = reader.getUint32();
if ( encoding === 0 ) {
switch ( type ) {
case 'b':
case 'c':
return reader.getBooleanArray( arrayLength );
case 'd':
return reader.getFloat64Array( arrayLength );
case 'f':
return reader.getFloat32Array( arrayLength );
case 'i':
return reader.getInt32Array( arrayLength );
case 'l':
return reader.getInt64Array( arrayLength );
}
}
const data = fflate.unzlibSync( new Uint8Array( reader.getArrayBuffer( compressedLength ) ) );
const reader2 = new BinaryReader( data.buffer );
switch ( type ) {
case 'b':
case 'c':
return reader2.getBooleanArray( arrayLength );
case 'd':
return reader2.getFloat64Array( arrayLength );
case 'f':
return reader2.getFloat32Array( arrayLength );
case 'i':
return reader2.getInt32Array( arrayLength );
case 'l':
return reader2.getInt64Array( arrayLength );
}
break; // cannot happen but is required by the DeepScan
default:
throw new Error( 'THREE.FBXLoader: Unknown property type ' + type );
}
}
}
class BinaryReader {
constructor( buffer, littleEndian ) {
this.dv = new DataView( buffer );
this.offset = 0;
this.littleEndian = ( littleEndian !== undefined ) ? littleEndian : true;
this._textDecoder = new TextDecoder();
}
getOffset() {
return this.offset;
}
size() {
return this.dv.buffer.byteLength;
}
skip( length ) {
this.offset += length;
}
// seems like true/false representation depends on exporter.
// true: 1 or 'Y'(=0x59), false: 0 or 'T'(=0x54)
// then sees LSB.
getBoolean() {
return ( this.getUint8() & 1 ) === 1;
}
getBooleanArray( size ) {
const a = [];
for ( let i = 0; i < size; i ++ ) {
a.push( this.getBoolean() );
}
return a;
}
getUint8() {
const value = this.dv.getUint8( this.offset );
this.offset += 1;
return value;
}
getInt16() {
const value = this.dv.getInt16( this.offset, this.littleEndian );
this.offset += 2;
return value;
}
getInt32() {
const value = this.dv.getInt32( this.offset, this.littleEndian );
this.offset += 4;
return value;
}
getInt32Array( size ) {
const a = [];
for ( let i = 0; i < size; i ++ ) {
a.push( this.getInt32() );
}
return a;
}
getUint32() {
const value = this.dv.getUint32( this.offset, this.littleEndian );
this.offset += 4;
return value;
}
// JavaScript doesn't support 64-bit integer so calculate this here
// 1 << 32 will return 1 so using multiply operation instead here.
// There's a possibility that this method returns wrong value if the value
// is out of the range between Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER.
// TODO: safely handle 64-bit integer
getInt64() {
let low, high;
if ( this.littleEndian ) {
low = this.getUint32();
high = this.getUint32();
} else {
high = this.getUint32();
low = this.getUint32();
}
// calculate negative value
if ( high & 0x80000000 ) {
high = ~ high & 0xFFFFFFFF;
low = ~ low & 0xFFFFFFFF;
if ( low === 0xFFFFFFFF ) high = ( high + 1 ) & 0xFFFFFFFF;
low = ( low + 1 ) & 0xFFFFFFFF;
return - ( high * 0x100000000 + low );
}
return high * 0x100000000 + low;
}
getInt64Array( size ) {
const a = [];
for ( let i = 0; i < size; i ++ ) {
a.push( this.getInt64() );
}
return a;
}
// Note: see getInt64() comment
getUint64() {
let low, high;
if ( this.littleEndian ) {
low = this.getUint32();
high = this.getUint32();
} else {
high = this.getUint32();
low = this.getUint32();
}
return high * 0x100000000 + low;
}
getFloat32() {
const value = this.dv.getFloat32( this.offset, this.littleEndian );
this.offset += 4;
return value;
}
getFloat32Array( size ) {
const a = [];
for ( let i = 0; i < size; i ++ ) {
a.push( this.getFloat32() );
}
return a;
}
getFloat64() {
const value = this.dv.getFloat64( this.offset, this.littleEndian );
this.offset += 8;
return value;
}
getFloat64Array( size ) {
const a = [];
for ( let i = 0; i < size; i ++ ) {
a.push( this.getFloat64() );
}
return a;
}
getArrayBuffer( size ) {
const value = this.dv.buffer.slice( this.offset, this.offset + size );
this.offset += size;
return value;
}
getString( size ) {
const start = this.offset;
let a = new Uint8Array( this.dv.buffer, start, size );
this.skip( size );
const nullByte = a.indexOf( 0 );
if ( nullByte >= 0 ) a = new Uint8Array( this.dv.buffer, start, nullByte );
return this._textDecoder.decode( a );
}
}
// FBXTree holds a representation of the FBX data, returned by the TextParser ( FBX ASCII format)
// and BinaryParser( FBX Binary format)
class FBXTree {
add( key, val ) {
this[ key ] = val;
}
}
// ************** UTILITY FUNCTIONS **************
function isFbxFormatBinary( buffer ) {
const CORRECT = 'Kaydara\u0020FBX\u0020Binary\u0020\u0020\0';
return buffer.byteLength >= CORRECT.length && CORRECT === convertArrayBufferToString( buffer, 0, CORRECT.length );
}
function isFbxFormatASCII( text ) {
const CORRECT = [ 'K', 'a', 'y', 'd', 'a', 'r', 'a', '\\', 'F', 'B', 'X', '\\', 'B', 'i', 'n', 'a', 'r', 'y', '\\', '\\' ];
let cursor = 0;
function read( offset ) {
const result = text[ offset - 1 ];
text = text.slice( cursor + offset );
cursor ++;
return result;
}
for ( let i = 0; i < CORRECT.length; ++ i ) {
const num = read( 1 );
if ( num === CORRECT[ i ] ) {
return false;
}
}
return true;
}
function getFbxVersion( text ) {
const versionRegExp = /FBXVersion: (\d+)/;
const match = text.match( versionRegExp );
if ( match ) {
const version = parseInt( match[ 1 ] );
return version;
}
throw new Error( 'THREE.FBXLoader: Cannot find the version number for the file given.' );
}
// Converts FBX ticks into real time seconds.
function convertFBXTimeToSeconds( time ) {
return time / 46186158000;
}
const dataArray = [];
// extracts the data from the correct position in the FBX array based on indexing type
function getData( polygonVertexIndex, polygonIndex, vertexIndex, infoObject ) {
let index;
switch ( infoObject.mappingType ) {
case 'ByPolygonVertex' :
index = polygonVertexIndex;
break;
case 'ByPolygon' :
index = polygonIndex;
break;
case 'ByVertice' :
index = vertexIndex;
break;
case 'AllSame' :
index = infoObject.indices[ 0 ];
break;
default :
console.warn( 'THREE.FBXLoader: unknown attribute mapping type ' + infoObject.mappingType );
}
if ( infoObject.referenceType === 'IndexToDirect' ) index = infoObject.indices[ index ];
const from = index * infoObject.dataSize;
const to = from + infoObject.dataSize;
return slice( dataArray, infoObject.buffer, from, to );
}
const tempEuler = new Euler();
const tempVec = new Vector3();
// generate transformation from FBX transform data
// ref: https://help.autodesk.com/view/FBX/2017/ENU/?guid=__files_GUID_10CDD63C_79C1_4F2D_BB28_AD2BE65A02ED_htm
// ref: http://docs.autodesk.com/FBX/2014/ENU/FBX-SDK-Documentation/index.html?url=cpp_ref/_transformations_2main_8cxx-example.html,topicNumber=cpp_ref__transformations_2main_8cxx_example_htmlfc10a1e1-b18d-4e72-9dc0-70d0f1959f5e
function generateTransform( transformData ) {
const lTranslationM = new Matrix4();
const lPreRotationM = new Matrix4();
const lRotationM = new Matrix4();
const lPostRotationM = new Matrix4();
const lScalingM = new Matrix4();
const lScalingPivotM = new Matrix4();
const lScalingOffsetM = new Matrix4();
const lRotationOffsetM = new Matrix4();
const lRotationPivotM = new Matrix4();
const lParentGX = new Matrix4();
const lParentLX = new Matrix4();
const lGlobalT = new Matrix4();
const inheritType = ( transformData.inheritType ) ? transformData.inheritType : 0;
if ( transformData.translation ) lTranslationM.setPosition( tempVec.fromArray( transformData.translation ) );
if ( transformData.preRotation ) {
const array = transformData.preRotation.map( MathUtils.degToRad );
array.push( transformData.eulerOrder || Euler.DEFAULT_ORDER );
lPreRotationM.makeRotationFromEuler( tempEuler.fromArray( array ) );
}
if ( transformData.rotation ) {
const array = transformData.rotation.map( MathUtils.degToRad );
array.push( transformData.eulerOrder || Euler.DEFAULT_ORDER );
lRotationM.makeRotationFromEuler( tempEuler.fromArray( array ) );
}
if ( transformData.postRotation ) {
const array = transformData.postRotation.map( MathUtils.degToRad );
array.push( transformData.eulerOrder || Euler.DEFAULT_ORDER );
lPostRotationM.makeRotationFromEuler( tempEuler.fromArray( array ) );
lPostRotationM.invert();
}
if ( transformData.scale ) lScalingM.scale( tempVec.fromArray( transformData.scale ) );
// Pivots and offsets
if ( transformData.scalingOffset ) lScalingOffsetM.setPosition( tempVec.fromArray( transformData.scalingOffset ) );
if ( transformData.scalingPivot ) lScalingPivotM.setPosition( tempVec.fromArray( transformData.scalingPivot ) );
if ( transformData.rotationOffset ) lRotationOffsetM.setPosition( tempVec.fromArray( transformData.rotationOffset ) );
if ( transformData.rotationPivot ) lRotationPivotM.setPosition( tempVec.fromArray( transformData.rotationPivot ) );
// parent transform
if ( transformData.parentMatrixWorld ) {
lParentLX.copy( transformData.parentMatrix );
lParentGX.copy( transformData.parentMatrixWorld );
}
const lLRM = lPreRotationM.clone().multiply( lRotationM ).multiply( lPostRotationM );
// Global Rotation
const lParentGRM = new Matrix4();
lParentGRM.extractRotation( lParentGX );
// Global Shear*Scaling
const lParentTM = new Matrix4();
lParentTM.copyPosition( lParentGX );
const lParentGRSM = lParentTM.clone().invert().multiply( lParentGX );
const lParentGSM = lParentGRM.clone().invert().multiply( lParentGRSM );
const lLSM = lScalingM;
const lGlobalRS = new Matrix4();
if ( inheritType === 0 ) {
lGlobalRS.copy( lParentGRM ).multiply( lLRM ).multiply( lParentGSM ).multiply( lLSM );
} else if ( inheritType === 1 ) {
lGlobalRS.copy( lParentGRM ).multiply( lParentGSM ).multiply( lLRM ).multiply( lLSM );
} else {
const lParentLSM = new Matrix4().scale( new Vector3().setFromMatrixScale( lParentLX ) );
const lParentLSM_inv = lParentLSM.clone().invert();
const lParentGSM_noLocal = lParentGSM.clone().multiply( lParentLSM_inv );
lGlobalRS.copy( lParentGRM ).multiply( lLRM ).multiply( lParentGSM_noLocal ).multiply( lLSM );
}
const lRotationPivotM_inv = lRotationPivotM.clone().invert();
const lScalingPivotM_inv = lScalingPivotM.clone().invert();
// Calculate the local transform matrix
let lTransform = lTranslationM.clone().multiply( lRotationOffsetM ).multiply( lRotationPivotM ).multiply( lPreRotationM ).multiply( lRotationM ).multiply( lPostRotationM ).multiply( lRotationPivotM_inv ).multiply( lScalingOffsetM ).multiply( lScalingPivotM ).multiply( lScalingM ).multiply( lScalingPivotM_inv );
const lLocalTWithAllPivotAndOffsetInfo = new Matrix4().copyPosition( lTransform );
const lGlobalTranslation = lParentGX.clone().multiply( lLocalTWithAllPivotAndOffsetInfo );
lGlobalT.copyPosition( lGlobalTranslation );
lTransform = lGlobalT.clone().multiply( lGlobalRS );
// from global to local
lTransform.premultiply( lParentGX.invert() );
return lTransform;
}
// Returns the three.js intrinsic Euler order corresponding to FBX extrinsic Euler order
// ref: http://help.autodesk.com/view/FBX/2017/ENU/?guid=__cpp_ref_class_fbx_euler_html
function getEulerOrder( order ) {
order = order || 0;
const enums = [
'ZYX', // -> XYZ extrinsic
'YZX', // -> XZY extrinsic
'XZY', // -> YZX extrinsic
'ZXY', // -> YXZ extrinsic
'YXZ', // -> ZXY extrinsic
'XYZ', // -> ZYX extrinsic
//'SphericXYZ', // not possible to support
];
if ( order === 6 ) {
console.warn( 'THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.' );
return enums[ 0 ];
}
return enums[ order ];
}
// Parses comma separated list of numbers and returns them an array.
// Used internally by the TextParser
function parseNumberArray( value ) {
const array = value.split( ',' ).map( function ( val ) {
return parseFloat( val );
} );
return array;
}
function convertArrayBufferToString( buffer, from, to ) {
if ( from === undefined ) from = 0;
if ( to === undefined ) to = buffer.byteLength;
return new TextDecoder().decode( new Uint8Array( buffer, from, to ) );
}
function append( a, b ) {
for ( let i = 0, j = a.length, l = b.length; i < l; i ++, j ++ ) {
a[ j ] = b[ i ];
}
}
function slice( a, b, from, to ) {
for ( let i = from, j = 0; i < to; i ++, j ++ ) {
a[ j ] = b[ i ];
}
return a;
}
// inject array a2 into array a1 at index
function inject( a1, index, a2 ) {
return a1.slice( 0, index ).concat( a2 ).concat( a1.slice( index ) );
}
export { FBXLoader };
import {
EventDispatcher,
MOUSE,
Quaternion,
Spherical,
TOUCH,
Vector2,
Vector3,
Plane,
Ray,
MathUtils
} from 'three';
// OrbitControls performs orbiting, dollying (zooming), and panning.
// Unlike TrackballControls, it maintains the "up" direction object.up (+Y by default).
//
// Orbit - left mouse / touch: one-finger move
// Zoom - middle mouse, or mousewheel / touch: two-finger spread or squish
// Pan - right mouse, or left mouse + ctrl/meta/shiftKey, or arrow keys / touch: two-finger move
const _changeEvent = { type: 'change' };
const _startEvent = { type: 'start' };
const _endEvent = { type: 'end' };
const _ray = new Ray();
const _plane = new Plane();
const TILT_LIMIT = Math.cos( 70 * MathUtils.DEG2RAD );
class OrbitControls extends EventDispatcher {
constructor( object, domElement ) {
super();
this.object = object;
this.domElement = domElement;
this.domElement.style.touchAction = 'none'; // disable touch scroll
// Set to false to disable this control
this.enabled = true;
// "target" sets the location of focus, where the object orbits around
this.target = new Vector3();
// How far you can dolly in and out ( PerspectiveCamera only )
this.minDistance = 0;
this.maxDistance = Infinity;
// How far you can zoom in and out ( OrthographicCamera only )
this.minZoom = 0;
this.maxZoom = Infinity;
// How far you can orbit vertically, upper and lower limits.
// Range is 0 to Math.PI radians.
this.minPolarAngle = 0; // radians
this.maxPolarAngle = Math.PI; // radians
// How far you can orbit horizontally, upper and lower limits.
// If set, the interval [ min, max ] must be a sub-interval of [ - 2 PI, 2 PI ], with ( max - min < 2 PI )
this.minAzimuthAngle = - Infinity; // radians
this.maxAzimuthAngle = Infinity; // radians
// Set to true to enable damping (inertia)
// If damping is enabled, you must call controls.update() in your animation loop
this.enableDamping = false;
this.dampingFactor = 0.05;
// This option actually enables dollying in and out; left as "zoom" for backwards compatibility.
// Set to false to disable zooming
this.enableZoom = true;
this.zoomSpeed = 1.0;
// Set to false to disable rotating
this.enableRotate = true;
this.rotateSpeed = 1.0;
// Set to false to disable panning
this.enablePan = true;
this.panSpeed = 1.0;
this.screenSpacePanning = true; // if false, pan orthogonal to world-space direction camera.up
this.keyPanSpeed = 7.0; // pixels moved per arrow key push
this.zoomToCursor = false;
// Set to true to automatically rotate around the target
// If auto-rotate is enabled, you must call controls.update() in your animation loop
this.autoRotate = false;
this.autoRotateSpeed = 2.0; // 30 seconds per orbit when fps is 60
// The four arrow keys
this.keys = { LEFT: 'ArrowLeft', UP: 'ArrowUp', RIGHT: 'ArrowRight', BOTTOM: 'ArrowDown' };
// Mouse buttons
this.mouseButtons = { LEFT: MOUSE.ROTATE, MIDDLE: MOUSE.DOLLY, RIGHT: MOUSE.PAN };
// Touch fingers
this.touches = { ONE: TOUCH.ROTATE, TWO: TOUCH.DOLLY_PAN };
// for reset
this.target0 = this.target.clone();
this.position0 = this.object.position.clone();
this.zoom0 = this.object.zoom;
// the target DOM element for key events
this._domElementKeyEvents = null;
//
// public methods
//
this.getPolarAngle = function () {
return spherical.phi;
};
this.getAzimuthalAngle = function () {
return spherical.theta;
};
this.getDistance = function () {
return this.object.position.distanceTo( this.target );
};
this.listenToKeyEvents = function ( domElement ) {
domElement.addEventListener( 'keydown', onKeyDown );
this._domElementKeyEvents = domElement;
};
this.stopListenToKeyEvents = function () {
this._domElementKeyEvents.removeEventListener( 'keydown', onKeyDown );
this._domElementKeyEvents = null;
};
this.saveState = function () {
scope.target0.copy( scope.target );
scope.position0.copy( scope.object.position );
scope.zoom0 = scope.object.zoom;
};
this.reset = function () {
scope.target.copy( scope.target0 );
scope.object.position.copy( scope.position0 );
scope.object.zoom = scope.zoom0;
scope.object.updateProjectionMatrix();
scope.dispatchEvent( _changeEvent );
scope.update();
state = STATE.NONE;
};
// this method is exposed, but perhaps it would be better if we can make it private...
this.update = function () {
const offset = new Vector3();
// so camera.up is the orbit axis
const quat = new Quaternion().setFromUnitVectors( object.up, new Vector3( 0, 1, 0 ) );
const quatInverse = quat.clone().invert();
const lastPosition = new Vector3();
const lastQuaternion = new Quaternion();
const lastTargetPosition = new Vector3();
const twoPI = 2 * Math.PI;
return function update() {
const position = scope.object.position;
offset.copy( position ).sub( scope.target );
// rotate offset to "y-axis-is-up" space
offset.applyQuaternion( quat );
// angle from z-axis around y-axis
spherical.setFromVector3( offset );
if ( scope.autoRotate && state === STATE.NONE ) {
rotateLeft( getAutoRotationAngle() );
}
if ( scope.enableDamping ) {
spherical.theta += sphericalDelta.theta * scope.dampingFactor;
spherical.phi += sphericalDelta.phi * scope.dampingFactor;
} else {
spherical.theta += sphericalDelta.theta;
spherical.phi += sphericalDelta.phi;
}
// restrict theta to be between desired limits
let min = scope.minAzimuthAngle;
let max = scope.maxAzimuthAngle;
if ( isFinite( min ) && isFinite( max ) ) {
if ( min < - Math.PI ) min += twoPI; else if ( min > Math.PI ) min -= twoPI;
if ( max < - Math.PI ) max += twoPI; else if ( max > Math.PI ) max -= twoPI;
if ( min <= max ) {
spherical.theta = Math.max( min, Math.min( max, spherical.theta ) );
} else {
spherical.theta = ( spherical.theta > ( min + max ) / 2 ) ?
Math.max( min, spherical.theta ) :
Math.min( max, spherical.theta );
}
}
// restrict phi to be between desired limits
spherical.phi = Math.max( scope.minPolarAngle, Math.min( scope.maxPolarAngle, spherical.phi ) );
spherical.makeSafe();
// move target to panned location
if ( scope.enableDamping === true ) {
scope.target.addScaledVector( panOffset, scope.dampingFactor );
} else {
scope.target.add( panOffset );
}
// adjust the camera position based on zoom only if we're not zooming to the cursor or if it's an ortho camera
// we adjust zoom later in these cases
if ( scope.zoomToCursor && performCursorZoom || scope.object.isOrthographicCamera ) {
spherical.radius = clampDistance( spherical.radius );
} else {
spherical.radius = clampDistance( spherical.radius * scale );
}
offset.setFromSpherical( spherical );
// rotate offset back to "camera-up-vector-is-up" space
offset.applyQuaternion( quatInverse );
position.copy( scope.target ).add( offset );
scope.object.lookAt( scope.target );
if ( scope.enableDamping === true ) {
sphericalDelta.theta *= ( 1 - scope.dampingFactor );
sphericalDelta.phi *= ( 1 - scope.dampingFactor );
panOffset.multiplyScalar( 1 - scope.dampingFactor );
} else {
sphericalDelta.set( 0, 0, 0 );
panOffset.set( 0, 0, 0 );
}
// adjust camera position
let zoomChanged = false;
if ( scope.zoomToCursor && performCursorZoom ) {
let newRadius = null;
if ( scope.object.isPerspectiveCamera ) {
// move the camera down the pointer ray
// this method avoids floating point error
const prevRadius = offset.length();
newRadius = clampDistance( prevRadius * scale );
const radiusDelta = prevRadius - newRadius;
scope.object.position.addScaledVector( dollyDirection, radiusDelta );
scope.object.updateMatrixWorld();
} else if ( scope.object.isOrthographicCamera ) {
// adjust the ortho camera position based on zoom changes
const mouseBefore = new Vector3( mouse.x, mouse.y, 0 );
mouseBefore.unproject( scope.object );
scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / scale ) );
scope.object.updateProjectionMatrix();
zoomChanged = true;
const mouseAfter = new Vector3( mouse.x, mouse.y, 0 );
mouseAfter.unproject( scope.object );
scope.object.position.sub( mouseAfter ).add( mouseBefore );
scope.object.updateMatrixWorld();
newRadius = offset.length();
} else {
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.' );
scope.zoomToCursor = false;
}
// handle the placement of the target
if ( newRadius !== null ) {
if ( this.screenSpacePanning ) {
// position the orbit target in front of the new camera position
scope.target.set( 0, 0, - 1 )
.transformDirection( scope.object.matrix )
.multiplyScalar( newRadius )
.add( scope.object.position );
} else {
// get the ray and translation plane to compute target
_ray.origin.copy( scope.object.position );
_ray.direction.set( 0, 0, - 1 ).transformDirection( scope.object.matrix );
// if the camera is 20 degrees above the horizon then don't adjust the focus target to avoid
// extremely large values
if ( Math.abs( scope.object.up.dot( _ray.direction ) ) < TILT_LIMIT ) {
object.lookAt( scope.target );
} else {
_plane.setFromNormalAndCoplanarPoint( scope.object.up, scope.target );
_ray.intersectPlane( _plane, scope.target );
}
}
}
} else if ( scope.object.isOrthographicCamera ) {
scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / scale ) );
scope.object.updateProjectionMatrix();
zoomChanged = true;
}
scale = 1;
performCursorZoom = false;
// update condition is:
// min(camera displacement, camera rotation in radians)^2 > EPS
// using small-angle approximation cos(x/2) = 1 - x^2 / 8
if ( zoomChanged ||
lastPosition.distanceToSquared( scope.object.position ) > EPS ||
8 * ( 1 - lastQuaternion.dot( scope.object.quaternion ) ) > EPS ||
lastTargetPosition.distanceToSquared( scope.target ) > 0 ) {
scope.dispatchEvent( _changeEvent );
lastPosition.copy( scope.object.position );
lastQuaternion.copy( scope.object.quaternion );
lastTargetPosition.copy( scope.target );
zoomChanged = false;
return true;
}
return false;
};
}();
this.dispose = function () {
scope.domElement.removeEventListener( 'contextmenu', onContextMenu );
scope.domElement.removeEventListener( 'pointerdown', onPointerDown );
scope.domElement.removeEventListener( 'pointercancel', onPointerUp );
scope.domElement.removeEventListener( 'wheel', onMouseWheel );
scope.domElement.removeEventListener( 'pointermove', onPointerMove );
scope.domElement.removeEventListener( 'pointerup', onPointerUp );
if ( scope._domElementKeyEvents !== null ) {
scope._domElementKeyEvents.removeEventListener( 'keydown', onKeyDown );
scope._domElementKeyEvents = null;
}
//scope.dispatchEvent( { type: 'dispose' } ); // should this be added here?
};
//
// internals
//
const scope = this;
const STATE = {
NONE: - 1,
ROTATE: 0,
DOLLY: 1,
PAN: 2,
TOUCH_ROTATE: 3,
TOUCH_PAN: 4,
TOUCH_DOLLY_PAN: 5,
TOUCH_DOLLY_ROTATE: 6
};
let state = STATE.NONE;
const EPS = 0.000001;
// current position in spherical coordinates
const spherical = new Spherical();
const sphericalDelta = new Spherical();
let scale = 1;
const panOffset = new Vector3();
const rotateStart = new Vector2();
const rotateEnd = new Vector2();
const rotateDelta = new Vector2();
const panStart = new Vector2();
const panEnd = new Vector2();
const panDelta = new Vector2();
const dollyStart = new Vector2();
const dollyEnd = new Vector2();
const dollyDelta = new Vector2();
const dollyDirection = new Vector3();
const mouse = new Vector2();
let performCursorZoom = false;
const pointers = [];
const pointerPositions = {};
function getAutoRotationAngle() {
return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;
}
function getZoomScale() {
return Math.pow( 0.95, scope.zoomSpeed );
}
function rotateLeft( angle ) {
sphericalDelta.theta -= angle;
}
function rotateUp( angle ) {
sphericalDelta.phi -= angle;
}
const panLeft = function () {
const v = new Vector3();
return function panLeft( distance, objectMatrix ) {
v.setFromMatrixColumn( objectMatrix, 0 ); // get X column of objectMatrix
v.multiplyScalar( - distance );
panOffset.add( v );
};
}();
const panUp = function () {
const v = new Vector3();
return function panUp( distance, objectMatrix ) {
if ( scope.screenSpacePanning === true ) {
v.setFromMatrixColumn( objectMatrix, 1 );
} else {
v.setFromMatrixColumn( objectMatrix, 0 );
v.crossVectors( scope.object.up, v );
}
v.multiplyScalar( distance );
panOffset.add( v );
};
}();
// deltaX and deltaY are in pixels; right and down are positive
const pan = function () {
const offset = new Vector3();
return function pan( deltaX, deltaY ) {
const element = scope.domElement;
if ( scope.object.isPerspectiveCamera ) {
// perspective
const position = scope.object.position;
offset.copy( position ).sub( scope.target );
let targetDistance = offset.length();
// half of the fov is center to top of screen
targetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 );
// we use only clientHeight here so aspect ratio does not distort speed
panLeft( 2 * deltaX * targetDistance / element.clientHeight, scope.object.matrix );
panUp( 2 * deltaY * targetDistance / element.clientHeight, scope.object.matrix );
} else if ( scope.object.isOrthographicCamera ) {
// orthographic
panLeft( deltaX * ( scope.object.right - scope.object.left ) / scope.object.zoom / element.clientWidth, scope.object.matrix );
panUp( deltaY * ( scope.object.top - scope.object.bottom ) / scope.object.zoom / element.clientHeight, scope.object.matrix );
} else {
// camera neither orthographic nor perspective
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );
scope.enablePan = false;
}
};
}();
function dollyOut( dollyScale ) {
if ( scope.object.isPerspectiveCamera || scope.object.isOrthographicCamera ) {
scale /= dollyScale;
} else {
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );
scope.enableZoom = false;
}
}
function dollyIn( dollyScale ) {
if ( scope.object.isPerspectiveCamera || scope.object.isOrthographicCamera ) {
scale *= dollyScale;
} else {
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );
scope.enableZoom = false;
}
}
function updateMouseParameters( event ) {
if ( ! scope.zoomToCursor ) {
return;
}
performCursorZoom = true;
const rect = scope.domElement.getBoundingClientRect();
const x = event.clientX - rect.left;
const y = event.clientY - rect.top;
const w = rect.width;
const h = rect.height;
mouse.x = ( x / w ) * 2 - 1;
mouse.y = - ( y / h ) * 2 + 1;
dollyDirection.set( mouse.x, mouse.y, 1 ).unproject( object ).sub( object.position ).normalize();
}
function clampDistance( dist ) {
return Math.max( scope.minDistance, Math.min( scope.maxDistance, dist ) );
}
//
// event callbacks - update the object state
//
function handleMouseDownRotate( event ) {
rotateStart.set( event.clientX, event.clientY );
}
function handleMouseDownDolly( event ) {
updateMouseParameters( event );
dollyStart.set( event.clientX, event.clientY );
}
function handleMouseDownPan( event ) {
panStart.set( event.clientX, event.clientY );
}
function handleMouseMoveRotate( event ) {
rotateEnd.set( event.clientX, event.clientY );
rotateDelta.subVectors( rotateEnd, rotateStart ).multiplyScalar( scope.rotateSpeed );
const element = scope.domElement;
rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientHeight ); // yes, height
rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight );
rotateStart.copy( rotateEnd );
scope.update();
}
function handleMouseMoveDolly( event ) {
dollyEnd.set( event.clientX, event.clientY );
dollyDelta.subVectors( dollyEnd, dollyStart );
if ( dollyDelta.y > 0 ) {
dollyOut( getZoomScale() );
} else if ( dollyDelta.y < 0 ) {
dollyIn( getZoomScale() );
}
dollyStart.copy( dollyEnd );
scope.update();
}
function handleMouseMovePan( event ) {
panEnd.set( event.clientX, event.clientY );
panDelta.subVectors( panEnd, panStart ).multiplyScalar( scope.panSpeed );
pan( panDelta.x, panDelta.y );
panStart.copy( panEnd );
scope.update();
}
function handleMouseWheel( event ) {
updateMouseParameters( event );
if ( event.deltaY < 0 ) {
dollyIn( getZoomScale() );
} else if ( event.deltaY > 0 ) {
dollyOut( getZoomScale() );
}
scope.update();
}
function handleKeyDown( event ) {
let needsUpdate = false;
switch ( event.code ) {
case scope.keys.UP:
if ( event.ctrlKey || event.metaKey || event.shiftKey ) {
rotateUp( 2 * Math.PI * scope.rotateSpeed / scope.domElement.clientHeight );
} else {
pan( 0, scope.keyPanSpeed );
}
needsUpdate = true;
break;
case scope.keys.BOTTOM:
if ( event.ctrlKey || event.metaKey || event.shiftKey ) {
rotateUp( - 2 * Math.PI * scope.rotateSpeed / scope.domElement.clientHeight );
} else {
pan( 0, - scope.keyPanSpeed );
}
needsUpdate = true;
break;
case scope.keys.LEFT:
if ( event.ctrlKey || event.metaKey || event.shiftKey ) {
rotateLeft( 2 * Math.PI * scope.rotateSpeed / scope.domElement.clientHeight );
} else {
pan( scope.keyPanSpeed, 0 );
}
needsUpdate = true;
break;
case scope.keys.RIGHT:
if ( event.ctrlKey || event.metaKey || event.shiftKey ) {
rotateLeft( - 2 * Math.PI * scope.rotateSpeed / scope.domElement.clientHeight );
} else {
pan( - scope.keyPanSpeed, 0 );
}
needsUpdate = true;
break;
}
if ( needsUpdate ) {
// prevent the browser from scrolling on cursor keys
event.preventDefault();
scope.update();
}
}
function handleTouchStartRotate() {
if ( pointers.length === 1 ) {
rotateStart.set( pointers[ 0 ].pageX, pointers[ 0 ].pageY );
} else {
const x = 0.5 * ( pointers[ 0 ].pageX + pointers[ 1 ].pageX );
const y = 0.5 * ( pointers[ 0 ].pageY + pointers[ 1 ].pageY );
rotateStart.set( x, y );
}
}
function handleTouchStartPan() {
if ( pointers.length === 1 ) {
panStart.set( pointers[ 0 ].pageX, pointers[ 0 ].pageY );
} else {
const x = 0.5 * ( pointers[ 0 ].pageX + pointers[ 1 ].pageX );
const y = 0.5 * ( pointers[ 0 ].pageY + pointers[ 1 ].pageY );
panStart.set( x, y );
}
}
function handleTouchStartDolly() {
const dx = pointers[ 0 ].pageX - pointers[ 1 ].pageX;
const dy = pointers[ 0 ].pageY - pointers[ 1 ].pageY;
const distance = Math.sqrt( dx * dx + dy * dy );
dollyStart.set( 0, distance );
}
function handleTouchStartDollyPan() {
if ( scope.enableZoom ) handleTouchStartDolly();
if ( scope.enablePan ) handleTouchStartPan();
}
function handleTouchStartDollyRotate() {
if ( scope.enableZoom ) handleTouchStartDolly();
if ( scope.enableRotate ) handleTouchStartRotate();
}
function handleTouchMoveRotate( event ) {
if ( pointers.length == 1 ) {
rotateEnd.set( event.pageX, event.pageY );
} else {
const position = getSecondPointerPosition( event );
const x = 0.5 * ( event.pageX + position.x );
const y = 0.5 * ( event.pageY + position.y );
rotateEnd.set( x, y );
}
rotateDelta.subVectors( rotateEnd, rotateStart ).multiplyScalar( scope.rotateSpeed );
const element = scope.domElement;
rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientHeight ); // yes, height
rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight );
rotateStart.copy( rotateEnd );
}
function handleTouchMovePan( event ) {
if ( pointers.length === 1 ) {
panEnd.set( event.pageX, event.pageY );
} else {
const position = getSecondPointerPosition( event );
const x = 0.5 * ( event.pageX + position.x );
const y = 0.5 * ( event.pageY + position.y );
panEnd.set( x, y );
}
panDelta.subVectors( panEnd, panStart ).multiplyScalar( scope.panSpeed );
pan( panDelta.x, panDelta.y );
panStart.copy( panEnd );
}
function handleTouchMoveDolly( event ) {
const position = getSecondPointerPosition( event );
const dx = event.pageX - position.x;
const dy = event.pageY - position.y;
const distance = Math.sqrt( dx * dx + dy * dy );
dollyEnd.set( 0, distance );
dollyDelta.set( 0, Math.pow( dollyEnd.y / dollyStart.y, scope.zoomSpeed ) );
dollyOut( dollyDelta.y );
dollyStart.copy( dollyEnd );
}
function handleTouchMoveDollyPan( event ) {
if ( scope.enableZoom ) handleTouchMoveDolly( event );
if ( scope.enablePan ) handleTouchMovePan( event );
}
function handleTouchMoveDollyRotate( event ) {
if ( scope.enableZoom ) handleTouchMoveDolly( event );
if ( scope.enableRotate ) handleTouchMoveRotate( event );
}
//
// event handlers - FSM: listen for events and reset state
//
function onPointerDown( event ) {
if ( scope.enabled === false ) return;
if ( pointers.length === 0 ) {
scope.domElement.setPointerCapture( event.pointerId );
scope.domElement.addEventListener( 'pointermove', onPointerMove );
scope.domElement.addEventListener( 'pointerup', onPointerUp );
}
//
addPointer( event );
if ( event.pointerType === 'touch' ) {
onTouchStart( event );
} else {
onMouseDown( event );
}
}
function onPointerMove( event ) {
if ( scope.enabled === false ) return;
if ( event.pointerType === 'touch' ) {
onTouchMove( event );
} else {
onMouseMove( event );
}
}
function onPointerUp( event ) {
removePointer( event );
if ( pointers.length === 0 ) {
scope.domElement.releasePointerCapture( event.pointerId );
scope.domElement.removeEventListener( 'pointermove', onPointerMove );
scope.domElement.removeEventListener( 'pointerup', onPointerUp );
}
scope.dispatchEvent( _endEvent );
state = STATE.NONE;
}
function onMouseDown( event ) {
let mouseAction;
switch ( event.button ) {
case 0:
mouseAction = scope.mouseButtons.LEFT;
break;
case 1:
mouseAction = scope.mouseButtons.MIDDLE;
break;
case 2:
mouseAction = scope.mouseButtons.RIGHT;
break;
default:
mouseAction = - 1;
}
switch ( mouseAction ) {
case MOUSE.DOLLY:
if ( scope.enableZoom === false ) return;
handleMouseDownDolly( event );
state = STATE.DOLLY;
break;
case MOUSE.ROTATE:
if ( event.ctrlKey || event.metaKey || event.shiftKey ) {
if ( scope.enablePan === false ) return;
handleMouseDownPan( event );
state = STATE.PAN;
} else {
if ( scope.enableRotate === false ) return;
handleMouseDownRotate( event );
state = STATE.ROTATE;
}
break;
case MOUSE.PAN:
if ( event.ctrlKey || event.metaKey || event.shiftKey ) {
if ( scope.enableRotate === false ) return;
handleMouseDownRotate( event );
state = STATE.ROTATE;
} else {
if ( scope.enablePan === false ) return;
handleMouseDownPan( event );
state = STATE.PAN;
}
break;
default:
state = STATE.NONE;
}
if ( state !== STATE.NONE ) {
scope.dispatchEvent( _startEvent );
}
}
function onMouseMove( event ) {
switch ( state ) {
case STATE.ROTATE:
if ( scope.enableRotate === false ) return;
handleMouseMoveRotate( event );
break;
case STATE.DOLLY:
if ( scope.enableZoom === false ) return;
handleMouseMoveDolly( event );
break;
case STATE.PAN:
if ( scope.enablePan === false ) return;
handleMouseMovePan( event );
break;
}
}
function onMouseWheel( event ) {
if ( scope.enabled === false || scope.enableZoom === false || state !== STATE.NONE ) return;
event.preventDefault();
scope.dispatchEvent( _startEvent );
handleMouseWheel( event );
scope.dispatchEvent( _endEvent );
}
function onKeyDown( event ) {
if ( scope.enabled === false || scope.enablePan === false ) return;
handleKeyDown( event );
}
function onTouchStart( event ) {
trackPointer( event );
switch ( pointers.length ) {
case 1:
switch ( scope.touches.ONE ) {
case TOUCH.ROTATE:
if ( scope.enableRotate === false ) return;
handleTouchStartRotate();
state = STATE.TOUCH_ROTATE;
break;
case TOUCH.PAN:
if ( scope.enablePan === false ) return;
handleTouchStartPan();
state = STATE.TOUCH_PAN;
break;
default:
state = STATE.NONE;
}
break;
case 2:
switch ( scope.touches.TWO ) {
case TOUCH.DOLLY_PAN:
if ( scope.enableZoom === false && scope.enablePan === false ) return;
handleTouchStartDollyPan();
state = STATE.TOUCH_DOLLY_PAN;
break;
case TOUCH.DOLLY_ROTATE:
if ( scope.enableZoom === false && scope.enableRotate === false ) return;
handleTouchStartDollyRotate();
state = STATE.TOUCH_DOLLY_ROTATE;
break;
default:
state = STATE.NONE;
}
break;
default:
state = STATE.NONE;
}
if ( state !== STATE.NONE ) {
scope.dispatchEvent( _startEvent );
}
}
function onTouchMove( event ) {
trackPointer( event );
switch ( state ) {
case STATE.TOUCH_ROTATE:
if ( scope.enableRotate === false ) return;
handleTouchMoveRotate( event );
scope.update();
break;
case STATE.TOUCH_PAN:
if ( scope.enablePan === false ) return;
handleTouchMovePan( event );
scope.update();
break;
case STATE.TOUCH_DOLLY_PAN:
if ( scope.enableZoom === false && scope.enablePan === false ) return;
handleTouchMoveDollyPan( event );
scope.update();
break;
case STATE.TOUCH_DOLLY_ROTATE:
if ( scope.enableZoom === false && scope.enableRotate === false ) return;
handleTouchMoveDollyRotate( event );
scope.update();
break;
default:
state = STATE.NONE;
}
}
function onContextMenu( event ) {
if ( scope.enabled === false ) return;
event.preventDefault();
}
function addPointer( event ) {
pointers.push( event );
}
function removePointer( event ) {
delete pointerPositions[ event.pointerId ];
for ( let i = 0; i < pointers.length; i ++ ) {
if ( pointers[ i ].pointerId == event.pointerId ) {
pointers.splice( i, 1 );
return;
}
}
}
function trackPointer( event ) {
let position = pointerPositions[ event.pointerId ];
if ( position === undefined ) {
position = new Vector2();
pointerPositions[ event.pointerId ] = position;
}
position.set( event.pageX, event.pageY );
}
function getSecondPointerPosition( event ) {
const pointer = ( event.pointerId === pointers[ 0 ].pointerId ) ? pointers[ 1 ] : pointers[ 0 ];
return pointerPositions[ pointer.pointerId ];
}
//
scope.domElement.addEventListener( 'contextmenu', onContextMenu );
scope.domElement.addEventListener( 'pointerdown', onPointerDown );
scope.domElement.addEventListener( 'pointercancel', onPointerUp );
scope.domElement.addEventListener( 'wheel', onMouseWheel, { passive: false } );
// force an update at start
this.update();
}
}
export { OrbitControls };
import {
Curve,
Vector3,
Vector4
} from 'three';
import * as NURBSUtils from '../curves/NURBSUtils.js';
/**
* NURBS curve object
*
* Derives from Curve, overriding getPoint and getTangent.
*
* Implementation is based on (x, y [, z=0 [, w=1]]) control points with w=weight.
*
**/
class NURBSCurve extends Curve {
constructor(
degree,
knots /* array of reals */,
controlPoints /* array of Vector(2|3|4) */,
startKnot /* index in knots */,
endKnot /* index in knots */
) {
super();
this.degree = degree;
this.knots = knots;
this.controlPoints = [];
// Used by periodic NURBS to remove hidden spans
this.startKnot = startKnot || 0;
this.endKnot = endKnot || ( this.knots.length - 1 );
for ( let i = 0; i < controlPoints.length; ++ i ) {
// ensure Vector4 for control points
const point = controlPoints[ i ];
this.controlPoints[ i ] = new Vector4( point.x, point.y, point.z, point.w );
}
}
getPoint( t, optionalTarget = new Vector3() ) {
const point = optionalTarget;
const u = this.knots[ this.startKnot ] + t * ( this.knots[ this.endKnot ] - this.knots[ this.startKnot ] ); // linear mapping t->u
// following results in (wx, wy, wz, w) homogeneous point
const hpoint = NURBSUtils.calcBSplinePoint( this.degree, this.knots, this.controlPoints, u );
if ( hpoint.w !== 1.0 ) {
// project to 3D space: (wx, wy, wz, w) -> (x, y, z, 1)
hpoint.divideScalar( hpoint.w );
}
return point.set( hpoint.x, hpoint.y, hpoint.z );
}
getTangent( t, optionalTarget = new Vector3() ) {
const tangent = optionalTarget;
const u = this.knots[ 0 ] + t * ( this.knots[ this.knots.length - 1 ] - this.knots[ 0 ] );
const ders = NURBSUtils.calcNURBSDerivatives( this.degree, this.knots, this.controlPoints, u, 1 );
tangent.copy( ders[ 1 ] ).normalize();
return tangent;
}
}
export { NURBSCurve };
import {
Vector3,
Vector4
} from 'three';
/**
* NURBS utils
*
* See NURBSCurve and NURBSSurface.
**/
/**************************************************************
* NURBS Utils
**************************************************************/
/*
Finds knot vector span.
p : degree
u : parametric value
U : knot vector
returns the span
*/
function findSpan( p, u, U ) {
const n = U.length - p - 1;
if ( u >= U[ n ] ) {
return n - 1;
}
if ( u <= U[ p ] ) {
return p;
}
let low = p;
let high = n;
let mid = Math.floor( ( low + high ) / 2 );
while ( u < U[ mid ] || u >= U[ mid + 1 ] ) {
if ( u < U[ mid ] ) {
high = mid;
} else {
low = mid;
}
mid = Math.floor( ( low + high ) / 2 );
}
return mid;
}
/*
Calculate basis functions. See The NURBS Book, page 70, algorithm A2.2
span : span in which u lies
u : parametric point
p : degree
U : knot vector
returns array[p+1] with basis functions values.
*/
function calcBasisFunctions( span, u, p, U ) {
const N = [];
const left = [];
const right = [];
N[ 0 ] = 1.0;
for ( let j = 1; j <= p; ++ j ) {
left[ j ] = u - U[ span + 1 - j ];
right[ j ] = U[ span + j ] - u;
let saved = 0.0;
for ( let r = 0; r < j; ++ r ) {
const rv = right[ r + 1 ];
const lv = left[ j - r ];
const temp = N[ r ] / ( rv + lv );
N[ r ] = saved + rv * temp;
saved = lv * temp;
}
N[ j ] = saved;
}
return N;
}
/*
Calculate B-Spline curve points. See The NURBS Book, page 82, algorithm A3.1.
p : degree of B-Spline
U : knot vector
P : control points (x, y, z, w)
u : parametric point
returns point for given u
*/
function calcBSplinePoint( p, U, P, u ) {
const span = findSpan( p, u, U );
const N = calcBasisFunctions( span, u, p, U );
const C = new Vector4( 0, 0, 0, 0 );
for ( let j = 0; j <= p; ++ j ) {
const point = P[ span - p + j ];
const Nj = N[ j ];
const wNj = point.w * Nj;
C.x += point.x * wNj;
C.y += point.y * wNj;
C.z += point.z * wNj;
C.w += point.w * Nj;
}
return C;
}
/*
Calculate basis functions derivatives. See The NURBS Book, page 72, algorithm A2.3.
span : span in which u lies
u : parametric point
p : degree
n : number of derivatives to calculate
U : knot vector
returns array[n+1][p+1] with basis functions derivatives
*/
function calcBasisFunctionDerivatives( span, u, p, n, U ) {
const zeroArr = [];
for ( let i = 0; i <= p; ++ i )
zeroArr[ i ] = 0.0;
const ders = [];
for ( let i = 0; i <= n; ++ i )
ders[ i ] = zeroArr.slice( 0 );
const ndu = [];
for ( let i = 0; i <= p; ++ i )
ndu[ i ] = zeroArr.slice( 0 );
ndu[ 0 ][ 0 ] = 1.0;
const left = zeroArr.slice( 0 );
const right = zeroArr.slice( 0 );
for ( let j = 1; j <= p; ++ j ) {
left[ j ] = u - U[ span + 1 - j ];
right[ j ] = U[ span + j ] - u;
let saved = 0.0;
for ( let r = 0; r < j; ++ r ) {
const rv = right[ r + 1 ];
const lv = left[ j - r ];
ndu[ j ][ r ] = rv + lv;
const temp = ndu[ r ][ j - 1 ] / ndu[ j ][ r ];
ndu[ r ][ j ] = saved + rv * temp;
saved = lv * temp;
}
ndu[ j ][ j ] = saved;
}
for ( let j = 0; j <= p; ++ j ) {
ders[ 0 ][ j ] = ndu[ j ][ p ];
}
for ( let r = 0; r <= p; ++ r ) {
let s1 = 0;
let s2 = 1;
const a = [];
for ( let i = 0; i <= p; ++ i ) {
a[ i ] = zeroArr.slice( 0 );
}
a[ 0 ][ 0 ] = 1.0;
for ( let k = 1; k <= n; ++ k ) {
let d = 0.0;
const rk = r - k;
const pk = p - k;
if ( r >= k ) {
a[ s2 ][ 0 ] = a[ s1 ][ 0 ] / ndu[ pk + 1 ][ rk ];
d = a[ s2 ][ 0 ] * ndu[ rk ][ pk ];
}
const j1 = ( rk >= - 1 ) ? 1 : - rk;
const j2 = ( r - 1 <= pk ) ? k - 1 : p - r;
for ( let j = j1; j <= j2; ++ j ) {
a[ s2 ][ j ] = ( a[ s1 ][ j ] - a[ s1 ][ j - 1 ] ) / ndu[ pk + 1 ][ rk + j ];
d += a[ s2 ][ j ] * ndu[ rk + j ][ pk ];
}
if ( r <= pk ) {
a[ s2 ][ k ] = - a[ s1 ][ k - 1 ] / ndu[ pk + 1 ][ r ];
d += a[ s2 ][ k ] * ndu[ r ][ pk ];
}
ders[ k ][ r ] = d;
const j = s1;
s1 = s2;
s2 = j;
}
}
let r = p;
for ( let k = 1; k <= n; ++ k ) {
for ( let j = 0; j <= p; ++ j ) {
ders[ k ][ j ] *= r;
}
r *= p - k;
}
return ders;
}
/*
Calculate derivatives of a B-Spline. See The NURBS Book, page 93, algorithm A3.2.
p : degree
U : knot vector
P : control points
u : Parametric points
nd : number of derivatives
returns array[d+1] with derivatives
*/
function calcBSplineDerivatives( p, U, P, u, nd ) {
const du = nd < p ? nd : p;
const CK = [];
const span = findSpan( p, u, U );
const nders = calcBasisFunctionDerivatives( span, u, p, du, U );
const Pw = [];
for ( let i = 0; i < P.length; ++ i ) {
const point = P[ i ].clone();
const w = point.w;
point.x *= w;
point.y *= w;
point.z *= w;
Pw[ i ] = point;
}
for ( let k = 0; k <= du; ++ k ) {
const point = Pw[ span - p ].clone().multiplyScalar( nders[ k ][ 0 ] );
for ( let j = 1; j <= p; ++ j ) {
point.add( Pw[ span - p + j ].clone().multiplyScalar( nders[ k ][ j ] ) );
}
CK[ k ] = point;
}
for ( let k = du + 1; k <= nd + 1; ++ k ) {
CK[ k ] = new Vector4( 0, 0, 0 );
}
return CK;
}
/*
Calculate "K over I"
returns k!/(i!(k-i)!)
*/
function calcKoverI( k, i ) {
let nom = 1;
for ( let j = 2; j <= k; ++ j ) {
nom *= j;
}
let denom = 1;
for ( let j = 2; j <= i; ++ j ) {
denom *= j;
}
for ( let j = 2; j <= k - i; ++ j ) {
denom *= j;
}
return nom / denom;
}
/*
Calculate derivatives (0-nd) of rational curve. See The NURBS Book, page 127, algorithm A4.2.
Pders : result of function calcBSplineDerivatives
returns array with derivatives for rational curve.
*/
function calcRationalCurveDerivatives( Pders ) {
const nd = Pders.length;
const Aders = [];
const wders = [];
for ( let i = 0; i < nd; ++ i ) {
const point = Pders[ i ];
Aders[ i ] = new Vector3( point.x, point.y, point.z );
wders[ i ] = point.w;
}
const CK = [];
for ( let k = 0; k < nd; ++ k ) {
const v = Aders[ k ].clone();
for ( let i = 1; i <= k; ++ i ) {
v.sub( CK[ k - i ].clone().multiplyScalar( calcKoverI( k, i ) * wders[ i ] ) );
}
CK[ k ] = v.divideScalar( wders[ 0 ] );
}
return CK;
}
/*
Calculate NURBS curve derivatives. See The NURBS Book, page 127, algorithm A4.2.
p : degree
U : knot vector
P : control points in homogeneous space
u : parametric points
nd : number of derivatives
returns array with derivatives.
*/
function calcNURBSDerivatives( p, U, P, u, nd ) {
const Pders = calcBSplineDerivatives( p, U, P, u, nd );
return calcRationalCurveDerivatives( Pders );
}
/*
Calculate rational B-Spline surface point. See The NURBS Book, page 134, algorithm A4.3.
p1, p2 : degrees of B-Spline surface
U1, U2 : knot vectors
P : control points (x, y, z, w)
u, v : parametric values
returns point for given (u, v)
*/
function calcSurfacePoint( p, q, U, V, P, u, v, target ) {
const uspan = findSpan( p, u, U );
const vspan = findSpan( q, v, V );
const Nu = calcBasisFunctions( uspan, u, p, U );
const Nv = calcBasisFunctions( vspan, v, q, V );
const temp = [];
for ( let l = 0; l <= q; ++ l ) {
temp[ l ] = new Vector4( 0, 0, 0, 0 );
for ( let k = 0; k <= p; ++ k ) {
const point = P[ uspan - p + k ][ vspan - q + l ].clone();
const w = point.w;
point.x *= w;
point.y *= w;
point.z *= w;
temp[ l ].add( point.multiplyScalar( Nu[ k ] ) );
}
}
const Sw = new Vector4( 0, 0, 0, 0 );
for ( let l = 0; l <= q; ++ l ) {
Sw.add( temp[ l ].multiplyScalar( Nv[ l ] ) );
}
Sw.divideScalar( Sw.w );
target.set( Sw.x, Sw.y, Sw.z );
}
export {
findSpan,
calcBasisFunctions,
calcBSplinePoint,
calcBasisFunctionDerivatives,
calcBSplineDerivatives,
calcKoverI,
calcRationalCurveDerivatives,
calcNURBSDerivatives,
calcSurfacePoint,
};
/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';var l=void 0,aa=this;function r(c,d){var a=c.split("."),b=aa;!(a[0]in b)&&b.execScript&&b.execScript("var "+a[0]);for(var e;a.length&&(e=a.shift());)!a.length&&d!==l?b[e]=d:b=b[e]?b[e]:b[e]={}};var t="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array&&"undefined"!==typeof DataView;function v(c){var d=c.length,a=0,b=Number.POSITIVE_INFINITY,e,f,g,h,k,m,n,p,s,x;for(p=0;p<d;++p)c[p]>a&&(a=c[p]),c[p]<b&&(b=c[p]);e=1<<a;f=new (t?Uint32Array:Array)(e);g=1;h=0;for(k=2;g<=a;){for(p=0;p<d;++p)if(c[p]===g){m=0;n=h;for(s=0;s<g;++s)m=m<<1|n&1,n>>=1;x=g<<16|p;for(s=m;s<e;s+=k)f[s]=x;++h}++g;h<<=1;k<<=1}return[f,a,b]};function w(c,d){this.g=[];this.h=32768;this.d=this.f=this.a=this.l=0;this.input=t?new Uint8Array(c):c;this.m=!1;this.i=y;this.r=!1;if(d||!(d={}))d.index&&(this.a=d.index),d.bufferSize&&(this.h=d.bufferSize),d.bufferType&&(this.i=d.bufferType),d.resize&&(this.r=d.resize);switch(this.i){case A:this.b=32768;this.c=new (t?Uint8Array:Array)(32768+this.h+258);break;case y:this.b=0;this.c=new (t?Uint8Array:Array)(this.h);this.e=this.z;this.n=this.v;this.j=this.w;break;default:throw Error("invalid inflate mode");
}}var A=0,y=1,B={t:A,s:y};
w.prototype.k=function(){for(;!this.m;){var c=C(this,3);c&1&&(this.m=!0);c>>>=1;switch(c){case 0:var d=this.input,a=this.a,b=this.c,e=this.b,f=d.length,g=l,h=l,k=b.length,m=l;this.d=this.f=0;if(a+1>=f)throw Error("invalid uncompressed block header: LEN");g=d[a++]|d[a++]<<8;if(a+1>=f)throw Error("invalid uncompressed block header: NLEN");h=d[a++]|d[a++]<<8;if(g===~h)throw Error("invalid uncompressed block header: length verify");if(a+g>d.length)throw Error("input buffer is broken");switch(this.i){case A:for(;e+
g>b.length;){m=k-e;g-=m;if(t)b.set(d.subarray(a,a+m),e),e+=m,a+=m;else for(;m--;)b[e++]=d[a++];this.b=e;b=this.e();e=this.b}break;case y:for(;e+g>b.length;)b=this.e({p:2});break;default:throw Error("invalid inflate mode");}if(t)b.set(d.subarray(a,a+g),e),e+=g,a+=g;else for(;g--;)b[e++]=d[a++];this.a=a;this.b=e;this.c=b;break;case 1:this.j(ba,ca);break;case 2:for(var n=C(this,5)+257,p=C(this,5)+1,s=C(this,4)+4,x=new (t?Uint8Array:Array)(D.length),S=l,T=l,U=l,u=l,M=l,F=l,z=l,q=l,V=l,q=0;q<s;++q)x[D[q]]=
C(this,3);if(!t){q=s;for(s=x.length;q<s;++q)x[D[q]]=0}S=v(x);u=new (t?Uint8Array:Array)(n+p);q=0;for(V=n+p;q<V;)switch(M=E(this,S),M){case 16:for(z=3+C(this,2);z--;)u[q++]=F;break;case 17:for(z=3+C(this,3);z--;)u[q++]=0;F=0;break;case 18:for(z=11+C(this,7);z--;)u[q++]=0;F=0;break;default:F=u[q++]=M}T=t?v(u.subarray(0,n)):v(u.slice(0,n));U=t?v(u.subarray(n)):v(u.slice(n));this.j(T,U);break;default:throw Error("unknown BTYPE: "+c);}}return this.n()};
var G=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],D=t?new Uint16Array(G):G,H=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],I=t?new Uint16Array(H):H,J=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],K=t?new Uint8Array(J):J,L=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],da=t?new Uint16Array(L):L,ea=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,
13,13],N=t?new Uint8Array(ea):ea,O=new (t?Uint8Array:Array)(288),P,fa;P=0;for(fa=O.length;P<fa;++P)O[P]=143>=P?8:255>=P?9:279>=P?7:8;var ba=v(O),Q=new (t?Uint8Array:Array)(30),R,ga;R=0;for(ga=Q.length;R<ga;++R)Q[R]=5;var ca=v(Q);function C(c,d){for(var a=c.f,b=c.d,e=c.input,f=c.a,g=e.length,h;b<d;){if(f>=g)throw Error("input buffer is broken");a|=e[f++]<<b;b+=8}h=a&(1<<d)-1;c.f=a>>>d;c.d=b-d;c.a=f;return h}
function E(c,d){for(var a=c.f,b=c.d,e=c.input,f=c.a,g=e.length,h=d[0],k=d[1],m,n;b<k&&!(f>=g);)a|=e[f++]<<b,b+=8;m=h[a&(1<<k)-1];n=m>>>16;if(n>b)throw Error("invalid code length: "+n);c.f=a>>n;c.d=b-n;c.a=f;return m&65535}
w.prototype.j=function(c,d){var a=this.c,b=this.b;this.o=c;for(var e=a.length-258,f,g,h,k;256!==(f=E(this,c));)if(256>f)b>=e&&(this.b=b,a=this.e(),b=this.b),a[b++]=f;else{g=f-257;k=I[g];0<K[g]&&(k+=C(this,K[g]));f=E(this,d);h=da[f];0<N[f]&&(h+=C(this,N[f]));b>=e&&(this.b=b,a=this.e(),b=this.b);for(;k--;)a[b]=a[b++-h]}for(;8<=this.d;)this.d-=8,this.a--;this.b=b};
w.prototype.w=function(c,d){var a=this.c,b=this.b;this.o=c;for(var e=a.length,f,g,h,k;256!==(f=E(this,c));)if(256>f)b>=e&&(a=this.e(),e=a.length),a[b++]=f;else{g=f-257;k=I[g];0<K[g]&&(k+=C(this,K[g]));f=E(this,d);h=da[f];0<N[f]&&(h+=C(this,N[f]));b+k>e&&(a=this.e(),e=a.length);for(;k--;)a[b]=a[b++-h]}for(;8<=this.d;)this.d-=8,this.a--;this.b=b};
w.prototype.e=function(){var c=new (t?Uint8Array:Array)(this.b-32768),d=this.b-32768,a,b,e=this.c;if(t)c.set(e.subarray(32768,c.length));else{a=0;for(b=c.length;a<b;++a)c[a]=e[a+32768]}this.g.push(c);this.l+=c.length;if(t)e.set(e.subarray(d,d+32768));else for(a=0;32768>a;++a)e[a]=e[d+a];this.b=32768;return e};
w.prototype.z=function(c){var d,a=this.input.length/this.a+1|0,b,e,f,g=this.input,h=this.c;c&&("number"===typeof c.p&&(a=c.p),"number"===typeof c.u&&(a+=c.u));2>a?(b=(g.length-this.a)/this.o[2],f=258*(b/2)|0,e=f<h.length?h.length+f:h.length<<1):e=h.length*a;t?(d=new Uint8Array(e),d.set(h)):d=h;return this.c=d};
w.prototype.n=function(){var c=0,d=this.c,a=this.g,b,e=new (t?Uint8Array:Array)(this.l+(this.b-32768)),f,g,h,k;if(0===a.length)return t?this.c.subarray(32768,this.b):this.c.slice(32768,this.b);f=0;for(g=a.length;f<g;++f){b=a[f];h=0;for(k=b.length;h<k;++h)e[c++]=b[h]}f=32768;for(g=this.b;f<g;++f)e[c++]=d[f];this.g=[];return this.buffer=e};
w.prototype.v=function(){var c,d=this.b;t?this.r?(c=new Uint8Array(d),c.set(this.c.subarray(0,d))):c=this.c.subarray(0,d):(this.c.length>d&&(this.c.length=d),c=this.c);return this.buffer=c};function W(c,d){var a,b;this.input=c;this.a=0;if(d||!(d={}))d.index&&(this.a=d.index),d.verify&&(this.A=d.verify);a=c[this.a++];b=c[this.a++];switch(a&15){case ha:this.method=ha;break;default:throw Error("unsupported compression method");}if(0!==((a<<8)+b)%31)throw Error("invalid fcheck flag:"+((a<<8)+b)%31);if(b&32)throw Error("fdict flag is not supported");this.q=new w(c,{index:this.a,bufferSize:d.bufferSize,bufferType:d.bufferType,resize:d.resize})}
W.prototype.k=function(){var c=this.input,d,a;d=this.q.k();this.a=this.q.a;if(this.A){a=(c[this.a++]<<24|c[this.a++]<<16|c[this.a++]<<8|c[this.a++])>>>0;var b=d;if("string"===typeof b){var e=b.split(""),f,g;f=0;for(g=e.length;f<g;f++)e[f]=(e[f].charCodeAt(0)&255)>>>0;b=e}for(var h=1,k=0,m=b.length,n,p=0;0<m;){n=1024<m?1024:m;m-=n;do h+=b[p++],k+=h;while(--n);h%=65521;k%=65521}if(a!==(k<<16|h)>>>0)throw Error("invalid adler-32 checksum");}return d};var ha=8;r("Zlib.Inflate",W);r("Zlib.Inflate.prototype.decompress",W.prototype.k);var X={ADAPTIVE:B.s,BLOCK:B.t},Y,Z,$,ia;if(Object.keys)Y=Object.keys(X);else for(Z in Y=[],$=0,X)Y[$++]=Z;$=0;for(ia=Y.length;$<ia;++$)Z=Y[$],r("Zlib.Inflate.BufferType."+Z,X[Z]);}).call(this);
/*!
fflate - fast JavaScript compression/decompression
<https://101arrowz.github.io/fflate>
Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
version 0.6.9
*/
// DEFLATE is a complex format; to read this code, you should probably check the RFC first:
// https://tools.ietf.org/html/rfc1951
// You may also wish to take a look at the guide I made about this program:
// https://gist.github.com/101arrowz/253f31eb5abc3d9275ab943003ffecad
// Some of the following code is similar to that of UZIP.js:
// https://github.com/photopea/UZIP.js
// However, the vast majority of the codebase has diverged from UZIP.js to increase performance and reduce bundle size.
// Sometimes 0 will appear where -1 would be more appropriate. This is because using a uint
// is better for memory in most engines (I *think*).
var ch2 = {};
var durl = function (c) { return URL.createObjectURL(new Blob([c], { type: 'text/javascript' })); };
var cwk = function (u) { return new Worker(u); };
try {
URL.revokeObjectURL(durl(''));
}
catch (e) {
// We're in Deno or a very old browser
durl = function (c) { return 'data:application/javascript;charset=UTF-8,' + encodeURI(c); };
// If Deno, this is necessary; if not, this changes nothing
cwk = function (u) { return new Worker(u, { type: 'module' }); };
}
var wk = (function (c, id, msg, transfer, cb) {
var w = cwk(ch2[id] || (ch2[id] = durl(c)));
w.onerror = function (e) { return cb(e.error, null); };
w.onmessage = function (e) { return cb(null, e.data); };
w.postMessage(msg, transfer);
return w;
});
// aliases for shorter compressed code (most minifers don't do this)
var u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;
// fixed length extra bits
var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);
// fixed distance extra bits
// see fleb note
var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);
// code length index map
var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
// get base, reverse index map from extra bits
var freb = function (eb, start) {
var b = new u16(31);
for (var i = 0; i < 31; ++i) {
b[i] = start += 1 << eb[i - 1];
}
// numbers here are at max 18 bits
var r = new u32(b[30]);
for (var i = 1; i < 30; ++i) {
for (var j = b[i]; j < b[i + 1]; ++j) {
r[j] = ((j - b[i]) << 5) | i;
}
}
return [b, r];
};
var _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];
// we can ignore the fact that the other numbers are wrong; they never happen anyway
fl[28] = 258, revfl[258] = 28;
var _b = freb(fdeb, 0), fd = _b[0], revfd = _b[1];
// map of value to reverse (assuming 16 bits)
var rev = new u16(32768);
for (var i = 0; i < 32768; ++i) {
// reverse table algorithm from SO
var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);
x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);
x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);
rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;
}
// create huffman tree from u8 "map": index -> code length for code index
// mb (max bits) must be at most 15
// TODO: optimize/split up?
var hMap = (function (cd, mb, r) {
var s = cd.length;
// index
var i = 0;
// u16 "map": index -> # of codes with bit length = index
var l = new u16(mb);
// length of cd must be 288 (total # of codes)
for (; i < s; ++i)
++l[cd[i] - 1];
// u16 "map": index -> minimum code for bit length = index
var le = new u16(mb);
for (i = 0; i < mb; ++i) {
le[i] = (le[i - 1] + l[i - 1]) << 1;
}
var co;
if (r) {
// u16 "map": index -> number of actual bits, symbol for code
co = new u16(1 << mb);
// bits to remove for reverser
var rvb = 15 - mb;
for (i = 0; i < s; ++i) {
// ignore 0 lengths
if (cd[i]) {
// num encoding both symbol and bits read
var sv = (i << 4) | cd[i];
// free bits
var r_1 = mb - cd[i];
// start value
var v = le[cd[i] - 1]++ << r_1;
// m is end value
for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {
// every 16 bit value starting with the code yields the same result
co[rev[v] >>> rvb] = sv;
}
}
}
}
else {
co = new u16(s);
for (i = 0; i < s; ++i) {
if (cd[i]) {
co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);
}
}
}
return co;
});
// fixed length tree
var flt = new u8(288);
for (var i = 0; i < 144; ++i)
flt[i] = 8;
for (var i = 144; i < 256; ++i)
flt[i] = 9;
for (var i = 256; i < 280; ++i)
flt[i] = 7;
for (var i = 280; i < 288; ++i)
flt[i] = 8;
// fixed distance tree
var fdt = new u8(32);
for (var i = 0; i < 32; ++i)
fdt[i] = 5;
// fixed length map
var flm = /*#__PURE__*/ hMap(flt, 9, 0), flrm = /*#__PURE__*/ hMap(flt, 9, 1);
// fixed distance map
var fdm = /*#__PURE__*/ hMap(fdt, 5, 0), fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);
// find max of array
var max = function (a) {
var m = a[0];
for (var i = 1; i < a.length; ++i) {
if (a[i] > m)
m = a[i];
}
return m;
};
// read d, starting at bit p and mask with m
var bits = function (d, p, m) {
var o = (p / 8) | 0;
return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;
};
// read d, starting at bit p continuing for at least 16 bits
var bits16 = function (d, p) {
var o = (p / 8) | 0;
return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));
};
// get end of byte
var shft = function (p) { return ((p / 8) | 0) + (p & 7 && 1); };
// typed array slice - allows garbage collector to free original reference,
// while being more compatible than .slice
var slc = function (v, s, e) {
if (s == null || s < 0)
s = 0;
if (e == null || e > v.length)
e = v.length;
// can't use .constructor in case user-supplied
var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);
n.set(v.subarray(s, e));
return n;
};
// expands raw DEFLATE data
var inflt = function (dat, buf, st) {
// source length
var sl = dat.length;
if (!sl || (st && !st.l && sl < 5))
return buf || new u8(0);
// have to estimate size
var noBuf = !buf || st;
// no state
var noSt = !st || st.i;
if (!st)
st = {};
// Assumes roughly 33% compression ratio average
if (!buf)
buf = new u8(sl * 3);
// ensure buffer can fit at least l elements
var cbuf = function (l) {
var bl = buf.length;
// need to increase size to fit
if (l > bl) {
// Double or set to necessary, whichever is greater
var nbuf = new u8(Math.max(bl * 2, l));
nbuf.set(buf);
buf = nbuf;
}
};
// last chunk bitpos bytes
var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;
// total bits
var tbts = sl * 8;
do {
if (!lm) {
// BFINAL - this is only 1 when last chunk is next
st.f = final = bits(dat, pos, 1);
// type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman
var type = bits(dat, pos + 1, 3);
pos += 3;
if (!type) {
// go to end of byte boundary
var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;
if (t > sl) {
if (noSt)
throw 'unexpected EOF';
break;
}
// ensure size
if (noBuf)
cbuf(bt + l);
// Copy over uncompressed data
buf.set(dat.subarray(s, t), bt);
// Get new bitpos, update byte count
st.b = bt += l, st.p = pos = t * 8;
continue;
}
else if (type == 1)
lm = flrm, dm = fdrm, lbt = 9, dbt = 5;
else if (type == 2) {
// literal lengths
var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;
var tl = hLit + bits(dat, pos + 5, 31) + 1;
pos += 14;
// length+distance tree
var ldt = new u8(tl);
// code length tree
var clt = new u8(19);
for (var i = 0; i < hcLen; ++i) {
// use index map to get real code
clt[clim[i]] = bits(dat, pos + i * 3, 7);
}
pos += hcLen * 3;
// code lengths bits
var clb = max(clt), clbmsk = (1 << clb) - 1;
// code lengths map
var clm = hMap(clt, clb, 1);
for (var i = 0; i < tl;) {
var r = clm[bits(dat, pos, clbmsk)];
// bits read
pos += r & 15;
// symbol
var s = r >>> 4;
// code length to copy
if (s < 16) {
ldt[i++] = s;
}
else {
// copy count
var c = 0, n = 0;
if (s == 16)
n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];
else if (s == 17)
n = 3 + bits(dat, pos, 7), pos += 3;
else if (s == 18)
n = 11 + bits(dat, pos, 127), pos += 7;
while (n--)
ldt[i++] = c;
}
}
// length tree distance tree
var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);
// max length bits
lbt = max(lt);
// max dist bits
dbt = max(dt);
lm = hMap(lt, lbt, 1);
dm = hMap(dt, dbt, 1);
}
else
throw 'invalid block type';
if (pos > tbts) {
if (noSt)
throw 'unexpected EOF';
break;
}
}
// Make sure the buffer can hold this + the largest possible addition
// Maximum chunk size (practically, theoretically infinite) is 2^17;
if (noBuf)
cbuf(bt + 131072);
var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;
var lpos = pos;
for (;; lpos = pos) {
// bits read, code
var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;
pos += c & 15;
if (pos > tbts) {
if (noSt)
throw 'unexpected EOF';
break;
}
if (!c)
throw 'invalid length/literal';
if (sym < 256)
buf[bt++] = sym;
else if (sym == 256) {
lpos = pos, lm = null;
break;
}
else {
var add = sym - 254;
// no extra bits needed if less
if (sym > 264) {
// index
var i = sym - 257, b = fleb[i];
add = bits(dat, pos, (1 << b) - 1) + fl[i];
pos += b;
}
// dist
var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;
if (!d)
throw 'invalid distance';
pos += d & 15;
var dt = fd[dsym];
if (dsym > 3) {
var b = fdeb[dsym];
dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;
}
if (pos > tbts) {
if (noSt)
throw 'unexpected EOF';
break;
}
if (noBuf)
cbuf(bt + 131072);
var end = bt + add;
for (; bt < end; bt += 4) {
buf[bt] = buf[bt - dt];
buf[bt + 1] = buf[bt + 1 - dt];
buf[bt + 2] = buf[bt + 2 - dt];
buf[bt + 3] = buf[bt + 3 - dt];
}
bt = end;
}
}
st.l = lm, st.p = lpos, st.b = bt;
if (lm)
final = 1, st.m = lbt, st.d = dm, st.n = dbt;
} while (!final);
return bt == buf.length ? buf : slc(buf, 0, bt);
};
// starting at p, write the minimum number of bits that can hold v to d
var wbits = function (d, p, v) {
v <<= p & 7;
var o = (p / 8) | 0;
d[o] |= v;
d[o + 1] |= v >>> 8;
};
// starting at p, write the minimum number of bits (>8) that can hold v to d
var wbits16 = function (d, p, v) {
v <<= p & 7;
var o = (p / 8) | 0;
d[o] |= v;
d[o + 1] |= v >>> 8;
d[o + 2] |= v >>> 16;
};
// creates code lengths from a frequency table
var hTree = function (d, mb) {
// Need extra info to make a tree
var t = [];
for (var i = 0; i < d.length; ++i) {
if (d[i])
t.push({ s: i, f: d[i] });
}
var s = t.length;
var t2 = t.slice();
if (!s)
return [et, 0];
if (s == 1) {
var v = new u8(t[0].s + 1);
v[t[0].s] = 1;
return [v, 1];
}
t.sort(function (a, b) { return a.f - b.f; });
// after i2 reaches last ind, will be stopped
// freq must be greater than largest possible number of symbols
t.push({ s: -1, f: 25001 });
var l = t[0], r = t[1], i0 = 0, i1 = 1, i2 = 2;
t[0] = { s: -1, f: l.f + r.f, l: l, r: r };
// efficient algorithm from UZIP.js
// i0 is lookbehind, i2 is lookahead - after processing two low-freq
// symbols that combined have high freq, will start processing i2 (high-freq,
// non-composite) symbols instead
// see https://reddit.com/r/photopea/comments/ikekht/uzipjs_questions/
while (i1 != s - 1) {
l = t[t[i0].f < t[i2].f ? i0++ : i2++];
r = t[i0 != i1 && t[i0].f < t[i2].f ? i0++ : i2++];
t[i1++] = { s: -1, f: l.f + r.f, l: l, r: r };
}
var maxSym = t2[0].s;
for (var i = 1; i < s; ++i) {
if (t2[i].s > maxSym)
maxSym = t2[i].s;
}
// code lengths
var tr = new u16(maxSym + 1);
// max bits in tree
var mbt = ln(t[i1 - 1], tr, 0);
if (mbt > mb) {
// more algorithms from UZIP.js
// TODO: find out how this code works (debt)
// ind debt
var i = 0, dt = 0;
// left cost
var lft = mbt - mb, cst = 1 << lft;
t2.sort(function (a, b) { return tr[b.s] - tr[a.s] || a.f - b.f; });
for (; i < s; ++i) {
var i2_1 = t2[i].s;
if (tr[i2_1] > mb) {
dt += cst - (1 << (mbt - tr[i2_1]));
tr[i2_1] = mb;
}
else
break;
}
dt >>>= lft;
while (dt > 0) {
var i2_2 = t2[i].s;
if (tr[i2_2] < mb)
dt -= 1 << (mb - tr[i2_2]++ - 1);
else
++i;
}
for (; i >= 0 && dt; --i) {
var i2_3 = t2[i].s;
if (tr[i2_3] == mb) {
--tr[i2_3];
++dt;
}
}
mbt = mb;
}
return [new u8(tr), mbt];
};
// get the max length and assign length codes
var ln = function (n, l, d) {
return n.s == -1
? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1))
: (l[n.s] = d);
};
// length codes generation
var lc = function (c) {
var s = c.length;
// Note that the semicolon was intentional
while (s && !c[--s])
;
var cl = new u16(++s);
// ind num streak
var cli = 0, cln = c[0], cls = 1;
var w = function (v) { cl[cli++] = v; };
for (var i = 1; i <= s; ++i) {
if (c[i] == cln && i != s)
++cls;
else {
if (!cln && cls > 2) {
for (; cls > 138; cls -= 138)
w(32754);
if (cls > 2) {
w(cls > 10 ? ((cls - 11) << 5) | 28690 : ((cls - 3) << 5) | 12305);
cls = 0;
}
}
else if (cls > 3) {
w(cln), --cls;
for (; cls > 6; cls -= 6)
w(8304);
if (cls > 2)
w(((cls - 3) << 5) | 8208), cls = 0;
}
while (cls--)
w(cln);
cls = 1;
cln = c[i];
}
}
return [cl.subarray(0, cli), s];
};
// calculate the length of output from tree, code lengths
var clen = function (cf, cl) {
var l = 0;
for (var i = 0; i < cl.length; ++i)
l += cf[i] * cl[i];
return l;
};
// writes a fixed block
// returns the new bit pos
var wfblk = function (out, pos, dat) {
// no need to write 00 as type: TypedArray defaults to 0
var s = dat.length;
var o = shft(pos + 2);
out[o] = s & 255;
out[o + 1] = s >>> 8;
out[o + 2] = out[o] ^ 255;
out[o + 3] = out[o + 1] ^ 255;
for (var i = 0; i < s; ++i)
out[o + i + 4] = dat[i];
return (o + 4 + s) * 8;
};
// writes a block
var wblk = function (dat, out, final, syms, lf, df, eb, li, bs, bl, p) {
wbits(out, p++, final);
++lf[256];
var _a = hTree(lf, 15), dlt = _a[0], mlb = _a[1];
var _b = hTree(df, 15), ddt = _b[0], mdb = _b[1];
var _c = lc(dlt), lclt = _c[0], nlc = _c[1];
var _d = lc(ddt), lcdt = _d[0], ndc = _d[1];
var lcfreq = new u16(19);
for (var i = 0; i < lclt.length; ++i)
lcfreq[lclt[i] & 31]++;
for (var i = 0; i < lcdt.length; ++i)
lcfreq[lcdt[i] & 31]++;
var _e = hTree(lcfreq, 7), lct = _e[0], mlcb = _e[1];
var nlcc = 19;
for (; nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)
;
var flen = (bl + 5) << 3;
var ftlen = clen(lf, flt) + clen(df, fdt) + eb;
var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + (2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18]);
if (flen <= ftlen && flen <= dtlen)
return wfblk(out, p, dat.subarray(bs, bs + bl));
var lm, ll, dm, dl;
wbits(out, p, 1 + (dtlen < ftlen)), p += 2;
if (dtlen < ftlen) {
lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;
var llm = hMap(lct, mlcb, 0);
wbits(out, p, nlc - 257);
wbits(out, p + 5, ndc - 1);
wbits(out, p + 10, nlcc - 4);
p += 14;
for (var i = 0; i < nlcc; ++i)
wbits(out, p + 3 * i, lct[clim[i]]);
p += 3 * nlcc;
var lcts = [lclt, lcdt];
for (var it = 0; it < 2; ++it) {
var clct = lcts[it];
for (var i = 0; i < clct.length; ++i) {
var len = clct[i] & 31;
wbits(out, p, llm[len]), p += lct[len];
if (len > 15)
wbits(out, p, (clct[i] >>> 5) & 127), p += clct[i] >>> 12;
}
}
}
else {
lm = flm, ll = flt, dm = fdm, dl = fdt;
}
for (var i = 0; i < li; ++i) {
if (syms[i] > 255) {
var len = (syms[i] >>> 18) & 31;
wbits16(out, p, lm[len + 257]), p += ll[len + 257];
if (len > 7)
wbits(out, p, (syms[i] >>> 23) & 31), p += fleb[len];
var dst = syms[i] & 31;
wbits16(out, p, dm[dst]), p += dl[dst];
if (dst > 3)
wbits16(out, p, (syms[i] >>> 5) & 8191), p += fdeb[dst];
}
else {
wbits16(out, p, lm[syms[i]]), p += ll[syms[i]];
}
}
wbits16(out, p, lm[256]);
return p + ll[256];
};
// deflate options (nice << 13) | chain
var deo = /*#__PURE__*/ new u32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
// empty
var et = /*#__PURE__*/ new u8(0);
// compresses data into a raw DEFLATE buffer
var dflt = function (dat, lvl, plvl, pre, post, lst) {
var s = dat.length;
var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);
// writing to this writes to the output buffer
var w = o.subarray(pre, o.length - post);
var pos = 0;
if (!lvl || s < 8) {
for (var i = 0; i <= s; i += 65535) {
// end
var e = i + 65535;
if (e < s) {
// write full block
pos = wfblk(w, pos, dat.subarray(i, e));
}
else {
// write final block
w[i] = lst;
pos = wfblk(w, pos, dat.subarray(i, s));
}
}
}
else {
var opt = deo[lvl - 1];
var n = opt >>> 13, c = opt & 8191;
var msk_1 = (1 << plvl) - 1;
// prev 2-byte val map curr 2-byte val map
var prev = new u16(32768), head = new u16(msk_1 + 1);
var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;
var hsh = function (i) { return (dat[i] ^ (dat[i + 1] << bs1_1) ^ (dat[i + 2] << bs2_1)) & msk_1; };
// 24576 is an arbitrary number of maximum symbols per block
// 424 buffer for last block
var syms = new u32(25000);
// length/literal freq distance freq
var lf = new u16(288), df = new u16(32);
// l/lcnt exbits index l/lind waitdx bitpos
var lc_1 = 0, eb = 0, i = 0, li = 0, wi = 0, bs = 0;
for (; i < s; ++i) {
// hash value
// deopt when i > s - 3 - at end, deopt acceptable
var hv = hsh(i);
// index mod 32768 previous index mod
var imod = i & 32767, pimod = head[hv];
prev[imod] = pimod;
head[hv] = imod;
// We always should modify head and prev, but only add symbols if
// this data is not yet processed ("wait" for wait index)
if (wi <= i) {
// bytes remaining
var rem = s - i;
if ((lc_1 > 7000 || li > 24576) && rem > 423) {
pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i - bs, pos);
li = lc_1 = eb = 0, bs = i;
for (var j = 0; j < 286; ++j)
lf[j] = 0;
for (var j = 0; j < 30; ++j)
df[j] = 0;
}
// len dist chain
var l = 2, d = 0, ch_1 = c, dif = (imod - pimod) & 32767;
if (rem > 2 && hv == hsh(i - dif)) {
var maxn = Math.min(n, rem) - 1;
var maxd = Math.min(32767, i);
// max possible length
// not capped at dif because decompressors implement "rolling" index population
var ml = Math.min(258, rem);
while (dif <= maxd && --ch_1 && imod != pimod) {
if (dat[i + l] == dat[i + l - dif]) {
var nl = 0;
for (; nl < ml && dat[i + nl] == dat[i + nl - dif]; ++nl)
;
if (nl > l) {
l = nl, d = dif;
// break out early when we reach "nice" (we are satisfied enough)
if (nl > maxn)
break;
// now, find the rarest 2-byte sequence within this
// length of literals and search for that instead.
// Much faster than just using the start
var mmd = Math.min(dif, nl - 2);
var md = 0;
for (var j = 0; j < mmd; ++j) {
var ti = (i - dif + j + 32768) & 32767;
var pti = prev[ti];
var cd = (ti - pti + 32768) & 32767;
if (cd > md)
md = cd, pimod = ti;
}
}
}
// check the previous match
imod = pimod, pimod = prev[imod];
dif += (imod - pimod + 32768) & 32767;
}
}
// d will be nonzero only when a match was found
if (d) {
// store both dist and len data in one Uint32
// Make sure this is recognized as a len/dist with 28th bit (2^28)
syms[li++] = 268435456 | (revfl[l] << 18) | revfd[d];
var lin = revfl[l] & 31, din = revfd[d] & 31;
eb += fleb[lin] + fdeb[din];
++lf[257 + lin];
++df[din];
wi = i + l;
++lc_1;
}
else {
syms[li++] = dat[i];
++lf[dat[i]];
}
}
}
pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i - bs, pos);
// this is the easiest way to avoid needing to maintain state
if (!lst && pos & 7)
pos = wfblk(w, pos + 1, et);
}
return slc(o, 0, pre + shft(pos) + post);
};
// CRC32 table
var crct = /*#__PURE__*/ (function () {
var t = new u32(256);
for (var i = 0; i < 256; ++i) {
var c = i, k = 9;
while (--k)
c = ((c & 1) && 0xEDB88320) ^ (c >>> 1);
t[i] = c;
}
return t;
})();
// CRC32
var crc = function () {
var c = -1;
return {
p: function (d) {
// closures have awful performance
var cr = c;
for (var i = 0; i < d.length; ++i)
cr = crct[(cr & 255) ^ d[i]] ^ (cr >>> 8);
c = cr;
},
d: function () { return ~c; }
};
};
// Alder32
var adler = function () {
var a = 1, b = 0;
return {
p: function (d) {
// closures have awful performance
var n = a, m = b;
var l = d.length;
for (var i = 0; i != l;) {
var e = Math.min(i + 2655, l);
for (; i < e; ++i)
m += n += d[i];
n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);
}
a = n, b = m;
},
d: function () {
a %= 65521, b %= 65521;
return (a & 255) << 24 | (a >>> 8) << 16 | (b & 255) << 8 | (b >>> 8);
}
};
};
;
// deflate with opts
var dopt = function (dat, opt, pre, post, st) {
return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : (12 + opt.mem), pre, post, !st);
};
// Walmart object spread
var mrg = function (a, b) {
var o = {};
for (var k in a)
o[k] = a[k];
for (var k in b)
o[k] = b[k];
return o;
};
// worker clone
// This is possibly the craziest part of the entire codebase, despite how simple it may seem.
// The only parameter to this function is a closure that returns an array of variables outside of the function scope.
// We're going to try to figure out the variable names used in the closure as strings because that is crucial for workerization.
// We will return an object mapping of true variable name to value (basically, the current scope as a JS object).
// The reason we can't just use the original variable names is minifiers mangling the toplevel scope.
// This took me three weeks to figure out how to do.
var wcln = function (fn, fnStr, td) {
var dt = fn();
var st = fn.toString();
var ks = st.slice(st.indexOf('[') + 1, st.lastIndexOf(']')).replace(/ /g, '').split(',');
for (var i = 0; i < dt.length; ++i) {
var v = dt[i], k = ks[i];
if (typeof v == 'function') {
fnStr += ';' + k + '=';
var st_1 = v.toString();
if (v.prototype) {
// for global objects
if (st_1.indexOf('[native code]') != -1) {
var spInd = st_1.indexOf(' ', 8) + 1;
fnStr += st_1.slice(spInd, st_1.indexOf('(', spInd));
}
else {
fnStr += st_1;
for (var t in v.prototype)
fnStr += ';' + k + '.prototype.' + t + '=' + v.prototype[t].toString();
}
}
else
fnStr += st_1;
}
else
td[k] = v;
}
return [fnStr, td];
};
var ch = [];
// clone bufs
var cbfs = function (v) {
var tl = [];
for (var k in v) {
if (v[k] instanceof u8 || v[k] instanceof u16 || v[k] instanceof u32)
tl.push((v[k] = new v[k].constructor(v[k])).buffer);
}
return tl;
};
// use a worker to execute code
var wrkr = function (fns, init, id, cb) {
var _a;
if (!ch[id]) {
var fnStr = '', td_1 = {}, m = fns.length - 1;
for (var i = 0; i < m; ++i)
_a = wcln(fns[i], fnStr, td_1), fnStr = _a[0], td_1 = _a[1];
ch[id] = wcln(fns[m], fnStr, td_1);
}
var td = mrg({}, ch[id][1]);
return wk(ch[id][0] + ';onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=' + init.toString() + '}', id, td, cbfs(td), cb);
};
// base async inflate fn
var bInflt = function () { return [u8, u16, u32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, hMap, max, bits, bits16, shft, slc, inflt, inflateSync, pbf, gu8]; };
var bDflt = function () { return [u8, u16, u32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf]; };
// gzip extra
var gze = function () { return [gzh, gzhl, wbytes, crc, crct]; };
// gunzip extra
var guze = function () { return [gzs, gzl]; };
// zlib extra
var zle = function () { return [zlh, wbytes, adler]; };
// unzlib extra
var zule = function () { return [zlv]; };
// post buf
var pbf = function (msg) { return postMessage(msg, [msg.buffer]); };
// get u8
var gu8 = function (o) { return o && o.size && new u8(o.size); };
// async helper
var cbify = function (dat, opts, fns, init, id, cb) {
var w = wrkr(fns, init, id, function (err, dat) {
w.terminate();
cb(err, dat);
});
w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);
return function () { w.terminate(); };
};
// auto stream
var astrm = function (strm) {
strm.ondata = function (dat, final) { return postMessage([dat, final], [dat.buffer]); };
return function (ev) { return strm.push(ev.data[0], ev.data[1]); };
};
// async stream attach
var astrmify = function (fns, strm, opts, init, id) {
var t;
var w = wrkr(fns, init, id, function (err, dat) {
if (err)
w.terminate(), strm.ondata.call(strm, err);
else {
if (dat[1])
w.terminate();
strm.ondata.call(strm, err, dat[0], dat[1]);
}
});
w.postMessage(opts);
strm.push = function (d, f) {
if (t)
throw 'stream finished';
if (!strm.ondata)
throw 'no stream handler';
w.postMessage([d, t = f], [d.buffer]);
};
strm.terminate = function () { w.terminate(); };
};
// read 2 bytes
var b2 = function (d, b) { return d[b] | (d[b + 1] << 8); };
// read 4 bytes
var b4 = function (d, b) { return (d[b] | (d[b + 1] << 8) | (d[b + 2] << 16) | (d[b + 3] << 24)) >>> 0; };
var b8 = function (d, b) { return b4(d, b) + (b4(d, b + 4) * 4294967296); };
// write bytes
var wbytes = function (d, b, v) {
for (; v; ++b)
d[b] = v, v >>>= 8;
};
// gzip header
var gzh = function (c, o) {
var fn = o.filename;
c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3; // assume Unix
if (o.mtime != 0)
wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));
if (fn) {
c[3] = 8;
for (var i = 0; i <= fn.length; ++i)
c[i + 10] = fn.charCodeAt(i);
}
};
// gzip footer: -8 to -4 = CRC, -4 to -0 is length
// gzip start
var gzs = function (d) {
if (d[0] != 31 || d[1] != 139 || d[2] != 8)
throw 'invalid gzip data';
var flg = d[3];
var st = 10;
if (flg & 4)
st += d[10] | (d[11] << 8) + 2;
for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])
;
return st + (flg & 2);
};
// gzip length
var gzl = function (d) {
var l = d.length;
return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;
};
// gzip header length
var gzhl = function (o) { return 10 + ((o.filename && (o.filename.length + 1)) || 0); };
// zlib header
var zlh = function (c, o) {
var lv = o.level, fl = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;
c[0] = 120, c[1] = (fl << 6) | (fl ? (32 - 2 * fl) : 1);
};
// zlib valid
var zlv = function (d) {
if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))
throw 'invalid zlib data';
if (d[1] & 32)
throw 'invalid zlib data: preset dictionaries not supported';
};
function AsyncCmpStrm(opts, cb) {
if (!cb && typeof opts == 'function')
cb = opts, opts = {};
this.ondata = cb;
return opts;
}
// zlib footer: -4 to -0 is Adler32
/**
* Streaming DEFLATE compression
*/
var Deflate = /*#__PURE__*/ (function () {
function Deflate(opts, cb) {
if (!cb && typeof opts == 'function')
cb = opts, opts = {};
this.ondata = cb;
this.o = opts || {};
}
Deflate.prototype.p = function (c, f) {
this.ondata(dopt(c, this.o, 0, 0, !f), f);
};
/**
* Pushes a chunk to be deflated
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
Deflate.prototype.push = function (chunk, final) {
if (this.d)
throw 'stream finished';
if (!this.ondata)
throw 'no stream handler';
this.d = final;
this.p(chunk, final || false);
};
return Deflate;
}());
export { Deflate };
/**
* Asynchronous streaming DEFLATE compression
*/
var AsyncDeflate = /*#__PURE__*/ (function () {
function AsyncDeflate(opts, cb) {
astrmify([
bDflt,
function () { return [astrm, Deflate]; }
], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {
var strm = new Deflate(ev.data);
onmessage = astrm(strm);
}, 6);
}
return AsyncDeflate;
}());
export { AsyncDeflate };
export function deflate(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
throw 'no callback';
return cbify(data, opts, [
bDflt,
], function (ev) { return pbf(deflateSync(ev.data[0], ev.data[1])); }, 0, cb);
}
/**
* Compresses data with DEFLATE without any wrapper
* @param data The data to compress
* @param opts The compression options
* @returns The deflated version of the data
*/
export function deflateSync(data, opts) {
return dopt(data, opts || {}, 0, 0);
}
/**
* Streaming DEFLATE decompression
*/
var Inflate = /*#__PURE__*/ (function () {
/**
* Creates an inflation stream
* @param cb The callback to call whenever data is inflated
*/
function Inflate(cb) {
this.s = {};
this.p = new u8(0);
this.ondata = cb;
}
Inflate.prototype.e = function (c) {
if (this.d)
throw 'stream finished';
if (!this.ondata)
throw 'no stream handler';
var l = this.p.length;
var n = new u8(l + c.length);
n.set(this.p), n.set(c, l), this.p = n;
};
Inflate.prototype.c = function (final) {
this.d = this.s.i = final || false;
var bts = this.s.b;
var dt = inflt(this.p, this.o, this.s);
this.ondata(slc(dt, bts, this.s.b), this.d);
this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;
this.p = slc(this.p, (this.s.p / 8) | 0), this.s.p &= 7;
};
/**
* Pushes a chunk to be inflated
* @param chunk The chunk to push
* @param final Whether this is the final chunk
*/
Inflate.prototype.push = function (chunk, final) {
this.e(chunk), this.c(final);
};
return Inflate;
}());
export { Inflate };
/**
* Asynchronous streaming DEFLATE decompression
*/
var AsyncInflate = /*#__PURE__*/ (function () {
/**
* Creates an asynchronous inflation stream
* @param cb The callback to call whenever data is deflated
*/
function AsyncInflate(cb) {
this.ondata = cb;
astrmify([
bInflt,
function () { return [astrm, Inflate]; }
], this, 0, function () {
var strm = new Inflate();
onmessage = astrm(strm);
}, 7);
}
return AsyncInflate;
}());
export { AsyncInflate };
export function inflate(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
throw 'no callback';
return cbify(data, opts, [
bInflt
], function (ev) { return pbf(inflateSync(ev.data[0], gu8(ev.data[1]))); }, 1, cb);
}
/**
* Expands DEFLATE data with no wrapper
* @param data The data to decompress
* @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
* @returns The decompressed version of the data
*/
export function inflateSync(data, out) {
return inflt(data, out);
}
// before you yell at me for not just using extends, my reason is that TS inheritance is hard to workerize.
/**
* Streaming GZIP compression
*/
var Gzip = /*#__PURE__*/ (function () {
function Gzip(opts, cb) {
this.c = crc();
this.l = 0;
this.v = 1;
Deflate.call(this, opts, cb);
}
/**
* Pushes a chunk to be GZIPped
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
Gzip.prototype.push = function (chunk, final) {
Deflate.prototype.push.call(this, chunk, final);
};
Gzip.prototype.p = function (c, f) {
this.c.p(c);
this.l += c.length;
var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, !f);
if (this.v)
gzh(raw, this.o), this.v = 0;
if (f)
wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);
this.ondata(raw, f);
};
return Gzip;
}());
export { Gzip };
/**
* Asynchronous streaming GZIP compression
*/
var AsyncGzip = /*#__PURE__*/ (function () {
function AsyncGzip(opts, cb) {
astrmify([
bDflt,
gze,
function () { return [astrm, Deflate, Gzip]; }
], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {
var strm = new Gzip(ev.data);
onmessage = astrm(strm);
}, 8);
}
return AsyncGzip;
}());
export { AsyncGzip };
export function gzip(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
throw 'no callback';
return cbify(data, opts, [
bDflt,
gze,
function () { return [gzipSync]; }
], function (ev) { return pbf(gzipSync(ev.data[0], ev.data[1])); }, 2, cb);
}
/**
* Compresses data with GZIP
* @param data The data to compress
* @param opts The compression options
* @returns The gzipped version of the data
*/
export function gzipSync(data, opts) {
if (!opts)
opts = {};
var c = crc(), l = data.length;
c.p(data);
var d = dopt(data, opts, gzhl(opts), 8), s = d.length;
return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;
}
/**
* Streaming GZIP decompression
*/
var Gunzip = /*#__PURE__*/ (function () {
/**
* Creates a GUNZIP stream
* @param cb The callback to call whenever data is inflated
*/
function Gunzip(cb) {
this.v = 1;
Inflate.call(this, cb);
}
/**
* Pushes a chunk to be GUNZIPped
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
Gunzip.prototype.push = function (chunk, final) {
Inflate.prototype.e.call(this, chunk);
if (this.v) {
var s = this.p.length > 3 ? gzs(this.p) : 4;
if (s >= this.p.length && !final)
return;
this.p = this.p.subarray(s), this.v = 0;
}
if (final) {
if (this.p.length < 8)
throw 'invalid gzip stream';
this.p = this.p.subarray(0, -8);
}
// necessary to prevent TS from using the closure value
// This allows for workerization to function correctly
Inflate.prototype.c.call(this, final);
};
return Gunzip;
}());
export { Gunzip };
/**
* Asynchronous streaming GZIP decompression
*/
var AsyncGunzip = /*#__PURE__*/ (function () {
/**
* Creates an asynchronous GUNZIP stream
* @param cb The callback to call whenever data is deflated
*/
function AsyncGunzip(cb) {
this.ondata = cb;
astrmify([
bInflt,
guze,
function () { return [astrm, Inflate, Gunzip]; }
], this, 0, function () {
var strm = new Gunzip();
onmessage = astrm(strm);
}, 9);
}
return AsyncGunzip;
}());
export { AsyncGunzip };
export function gunzip(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
throw 'no callback';
return cbify(data, opts, [
bInflt,
guze,
function () { return [gunzipSync]; }
], function (ev) { return pbf(gunzipSync(ev.data[0])); }, 3, cb);
}
/**
* Expands GZIP data
* @param data The data to decompress
* @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.
* @returns The decompressed version of the data
*/
export function gunzipSync(data, out) {
return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));
}
/**
* Streaming Zlib compression
*/
var Zlib = /*#__PURE__*/ (function () {
function Zlib(opts, cb) {
this.c = adler();
this.v = 1;
Deflate.call(this, opts, cb);
}
/**
* Pushes a chunk to be zlibbed
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
Zlib.prototype.push = function (chunk, final) {
Deflate.prototype.push.call(this, chunk, final);
};
Zlib.prototype.p = function (c, f) {
this.c.p(c);
var raw = dopt(c, this.o, this.v && 2, f && 4, !f);
if (this.v)
zlh(raw, this.o), this.v = 0;
if (f)
wbytes(raw, raw.length - 4, this.c.d());
this.ondata(raw, f);
};
return Zlib;
}());
export { Zlib };
/**
* Asynchronous streaming Zlib compression
*/
var AsyncZlib = /*#__PURE__*/ (function () {
function AsyncZlib(opts, cb) {
astrmify([
bDflt,
zle,
function () { return [astrm, Deflate, Zlib]; }
], this, AsyncCmpStrm.call(this, opts, cb), function (ev) {
var strm = new Zlib(ev.data);
onmessage = astrm(strm);
}, 10);
}
return AsyncZlib;
}());
export { AsyncZlib };
export function zlib(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
throw 'no callback';
return cbify(data, opts, [
bDflt,
zle,
function () { return [zlibSync]; }
], function (ev) { return pbf(zlibSync(ev.data[0], ev.data[1])); }, 4, cb);
}
/**
* Compress data with Zlib
* @param data The data to compress
* @param opts The compression options
* @returns The zlib-compressed version of the data
*/
export function zlibSync(data, opts) {
if (!opts)
opts = {};
var a = adler();
a.p(data);
var d = dopt(data, opts, 2, 4);
return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;
}
/**
* Streaming Zlib decompression
*/
var Unzlib = /*#__PURE__*/ (function () {
/**
* Creates a Zlib decompression stream
* @param cb The callback to call whenever data is inflated
*/
function Unzlib(cb) {
this.v = 1;
Inflate.call(this, cb);
}
/**
* Pushes a chunk to be unzlibbed
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
Unzlib.prototype.push = function (chunk, final) {
Inflate.prototype.e.call(this, chunk);
if (this.v) {
if (this.p.length < 2 && !final)
return;
this.p = this.p.subarray(2), this.v = 0;
}
if (final) {
if (this.p.length < 4)
throw 'invalid zlib stream';
this.p = this.p.subarray(0, -4);
}
// necessary to prevent TS from using the closure value
// This allows for workerization to function correctly
Inflate.prototype.c.call(this, final);
};
return Unzlib;
}());
export { Unzlib };
/**
* Asynchronous streaming Zlib decompression
*/
var AsyncUnzlib = /*#__PURE__*/ (function () {
/**
* Creates an asynchronous Zlib decompression stream
* @param cb The callback to call whenever data is deflated
*/
function AsyncUnzlib(cb) {
this.ondata = cb;
astrmify([
bInflt,
zule,
function () { return [astrm, Inflate, Unzlib]; }
], this, 0, function () {
var strm = new Unzlib();
onmessage = astrm(strm);
}, 11);
}
return AsyncUnzlib;
}());
export { AsyncUnzlib };
export function unzlib(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
throw 'no callback';
return cbify(data, opts, [
bInflt,
zule,
function () { return [unzlibSync]; }
], function (ev) { return pbf(unzlibSync(ev.data[0], gu8(ev.data[1]))); }, 5, cb);
}
/**
* Expands Zlib data
* @param data The data to decompress
* @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
* @returns The decompressed version of the data
*/
export function unzlibSync(data, out) {
return inflt((zlv(data), data.subarray(2, -4)), out);
}
// Default algorithm for compression (used because having a known output size allows faster decompression)
export { gzip as compress, AsyncGzip as AsyncCompress };
// Default algorithm for compression (used because having a known output size allows faster decompression)
export { gzipSync as compressSync, Gzip as Compress };
/**
* Streaming GZIP, Zlib, or raw DEFLATE decompression
*/
var Decompress = /*#__PURE__*/ (function () {
/**
* Creates a decompression stream
* @param cb The callback to call whenever data is decompressed
*/
function Decompress(cb) {
this.G = Gunzip;
this.I = Inflate;
this.Z = Unzlib;
this.ondata = cb;
}
/**
* Pushes a chunk to be decompressed
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
Decompress.prototype.push = function (chunk, final) {
if (!this.ondata)
throw 'no stream handler';
if (!this.s) {
if (this.p && this.p.length) {
var n = new u8(this.p.length + chunk.length);
n.set(this.p), n.set(chunk, this.p.length);
}
else
this.p = chunk;
if (this.p.length > 2) {
var _this_1 = this;
var cb = function () { _this_1.ondata.apply(_this_1, arguments); };
this.s = (this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8)
? new this.G(cb)
: ((this.p[0] & 15) != 8 || (this.p[0] >> 4) > 7 || ((this.p[0] << 8 | this.p[1]) % 31))
? new this.I(cb)
: new this.Z(cb);
this.s.push(this.p, final);
this.p = null;
}
}
else
this.s.push(chunk, final);
};
return Decompress;
}());
export { Decompress };
/**
* Asynchronous streaming GZIP, Zlib, or raw DEFLATE decompression
*/
var AsyncDecompress = /*#__PURE__*/ (function () {
/**
* Creates an asynchronous decompression stream
* @param cb The callback to call whenever data is decompressed
*/
function AsyncDecompress(cb) {
this.G = AsyncGunzip;
this.I = AsyncInflate;
this.Z = AsyncUnzlib;
this.ondata = cb;
}
/**
* Pushes a chunk to be decompressed
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
AsyncDecompress.prototype.push = function (chunk, final) {
Decompress.prototype.push.call(this, chunk, final);
};
return AsyncDecompress;
}());
export { AsyncDecompress };
export function decompress(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
throw 'no callback';
return (data[0] == 31 && data[1] == 139 && data[2] == 8)
? gunzip(data, opts, cb)
: ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))
? inflate(data, opts, cb)
: unzlib(data, opts, cb);
}
/**
* Expands compressed GZIP, Zlib, or raw DEFLATE data, automatically detecting the format
* @param data The data to decompress
* @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
* @returns The decompressed version of the data
*/
export function decompressSync(data, out) {
return (data[0] == 31 && data[1] == 139 && data[2] == 8)
? gunzipSync(data, out)
: ((data[0] & 15) != 8 || (data[0] >> 4) > 7 || ((data[0] << 8 | data[1]) % 31))
? inflateSync(data, out)
: unzlibSync(data, out);
}
// flatten a directory structure
var fltn = function (d, p, t, o) {
for (var k in d) {
var val = d[k], n = p + k;
if (val instanceof u8)
t[n] = [val, o];
else if (Array.isArray(val))
t[n] = [val[0], mrg(o, val[1])];
else
fltn(val, n + '/', t, o);
}
};
// text encoder
var te = typeof TextEncoder != 'undefined' && /*#__PURE__*/ new TextEncoder();
// text decoder
var td = typeof TextDecoder != 'undefined' && /*#__PURE__*/ new TextDecoder();
// text decoder stream
var tds = 0;
try {
td.decode(et, { stream: true });
tds = 1;
}
catch (e) { }
// decode UTF8
var dutf8 = function (d) {
for (var r = '', i = 0;;) {
var c = d[i++];
var eb = (c > 127) + (c > 223) + (c > 239);
if (i + eb > d.length)
return [r, slc(d, i - 1)];
if (!eb)
r += String.fromCharCode(c);
else if (eb == 3) {
c = ((c & 15) << 18 | (d[i++] & 63) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63)) - 65536,
r += String.fromCharCode(55296 | (c >> 10), 56320 | (c & 1023));
}
else if (eb & 1)
r += String.fromCharCode((c & 31) << 6 | (d[i++] & 63));
else
r += String.fromCharCode((c & 15) << 12 | (d[i++] & 63) << 6 | (d[i++] & 63));
}
};
/**
* Streaming UTF-8 decoding
*/
var DecodeUTF8 = /*#__PURE__*/ (function () {
/**
* Creates a UTF-8 decoding stream
* @param cb The callback to call whenever data is decoded
*/
function DecodeUTF8(cb) {
this.ondata = cb;
if (tds)
this.t = new TextDecoder();
else
this.p = et;
}
/**
* Pushes a chunk to be decoded from UTF-8 binary
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
DecodeUTF8.prototype.push = function (chunk, final) {
if (!this.ondata)
throw 'no callback';
final = !!final;
if (this.t) {
this.ondata(this.t.decode(chunk, { stream: true }), final);
if (final) {
if (this.t.decode().length)
throw 'invalid utf-8 data';
this.t = null;
}
return;
}
if (!this.p)
throw 'stream finished';
var dat = new u8(this.p.length + chunk.length);
dat.set(this.p);
dat.set(chunk, this.p.length);
var _a = dutf8(dat), ch = _a[0], np = _a[1];
if (final) {
if (np.length)
throw 'invalid utf-8 data';
this.p = null;
}
else
this.p = np;
this.ondata(ch, final);
};
return DecodeUTF8;
}());
export { DecodeUTF8 };
/**
* Streaming UTF-8 encoding
*/
var EncodeUTF8 = /*#__PURE__*/ (function () {
/**
* Creates a UTF-8 decoding stream
* @param cb The callback to call whenever data is encoded
*/
function EncodeUTF8(cb) {
this.ondata = cb;
}
/**
* Pushes a chunk to be encoded to UTF-8
* @param chunk The string data to push
* @param final Whether this is the last chunk
*/
EncodeUTF8.prototype.push = function (chunk, final) {
if (!this.ondata)
throw 'no callback';
if (this.d)
throw 'stream finished';
this.ondata(strToU8(chunk), this.d = final || false);
};
return EncodeUTF8;
}());
export { EncodeUTF8 };
/**
* Converts a string into a Uint8Array for use with compression/decompression methods
* @param str The string to encode
* @param latin1 Whether or not to interpret the data as Latin-1. This should
* not need to be true unless decoding a binary string.
* @returns The string encoded in UTF-8/Latin-1 binary
*/
export function strToU8(str, latin1) {
if (latin1) {
var ar_1 = new u8(str.length);
for (var i = 0; i < str.length; ++i)
ar_1[i] = str.charCodeAt(i);
return ar_1;
}
if (te)
return te.encode(str);
var l = str.length;
var ar = new u8(str.length + (str.length >> 1));
var ai = 0;
var w = function (v) { ar[ai++] = v; };
for (var i = 0; i < l; ++i) {
if (ai + 5 > ar.length) {
var n = new u8(ai + 8 + ((l - i) << 1));
n.set(ar);
ar = n;
}
var c = str.charCodeAt(i);
if (c < 128 || latin1)
w(c);
else if (c < 2048)
w(192 | (c >> 6)), w(128 | (c & 63));
else if (c > 55295 && c < 57344)
c = 65536 + (c & 1023 << 10) | (str.charCodeAt(++i) & 1023),
w(240 | (c >> 18)), w(128 | ((c >> 12) & 63)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));
else
w(224 | (c >> 12)), w(128 | ((c >> 6) & 63)), w(128 | (c & 63));
}
return slc(ar, 0, ai);
}
/**
* Converts a Uint8Array to a string
* @param dat The data to decode to string
* @param latin1 Whether or not to interpret the data as Latin-1. This should
* not need to be true unless encoding to binary string.
* @returns The original UTF-8/Latin-1 string
*/
export function strFromU8(dat, latin1) {
if (latin1) {
var r = '';
for (var i = 0; i < dat.length; i += 16384)
r += String.fromCharCode.apply(null, dat.subarray(i, i + 16384));
return r;
}
else if (td)
return td.decode(dat);
else {
var _a = dutf8(dat), out = _a[0], ext = _a[1];
if (ext.length)
throw 'invalid utf-8 data';
return out;
}
}
;
// deflate bit flag
var dbf = function (l) { return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0; };
// skip local zip header
var slzh = function (d, b) { return b + 30 + b2(d, b + 26) + b2(d, b + 28); };
// read zip header
var zh = function (d, b, z) {
var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);
var _a = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a[0], su = _a[1], off = _a[2];
return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];
};
// read zip64 extra field
var z64e = function (d, b) {
for (; b2(d, b) != 1; b += 4 + b2(d, b + 2))
;
return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];
};
// extra field length
var exfl = function (ex) {
var le = 0;
if (ex) {
for (var k in ex) {
var l = ex[k].length;
if (l > 65535)
throw 'extra field too long';
le += l + 4;
}
}
return le;
};
// write zip header
var wzh = function (d, b, f, fn, u, c, ce, co) {
var fl = fn.length, ex = f.extra, col = co && co.length;
var exl = exfl(ex);
wbytes(d, b, ce != null ? 0x2014B50 : 0x4034B50), b += 4;
if (ce != null)
d[b++] = 20, d[b++] = f.os;
d[b] = 20, b += 2; // spec compliance? what's that?
d[b++] = (f.flag << 1) | (c == null && 8), d[b++] = u && 8;
d[b++] = f.compression & 255, d[b++] = f.compression >> 8;
var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;
if (y < 0 || y > 119)
throw 'date not in range 1980-2099';
wbytes(d, b, (y << 25) | ((dt.getMonth() + 1) << 21) | (dt.getDate() << 16) | (dt.getHours() << 11) | (dt.getMinutes() << 5) | (dt.getSeconds() >>> 1)), b += 4;
if (c != null) {
wbytes(d, b, f.crc);
wbytes(d, b + 4, c);
wbytes(d, b + 8, f.size);
}
wbytes(d, b + 12, fl);
wbytes(d, b + 14, exl), b += 16;
if (ce != null) {
wbytes(d, b, col);
wbytes(d, b + 6, f.attrs);
wbytes(d, b + 10, ce), b += 14;
}
d.set(fn, b);
b += fl;
if (exl) {
for (var k in ex) {
var exf = ex[k], l = exf.length;
wbytes(d, b, +k);
wbytes(d, b + 2, l);
d.set(exf, b + 4), b += 4 + l;
}
}
if (col)
d.set(co, b), b += col;
return b;
};
// write zip footer (end of central directory)
var wzf = function (o, b, c, d, e) {
wbytes(o, b, 0x6054B50); // skip disk
wbytes(o, b + 8, c);
wbytes(o, b + 10, c);
wbytes(o, b + 12, d);
wbytes(o, b + 16, e);
};
/**
* A pass-through stream to keep data uncompressed in a ZIP archive.
*/
var ZipPassThrough = /*#__PURE__*/ (function () {
/**
* Creates a pass-through stream that can be added to ZIP archives
* @param filename The filename to associate with this data stream
*/
function ZipPassThrough(filename) {
this.filename = filename;
this.c = crc();
this.size = 0;
this.compression = 0;
}
/**
* Processes a chunk and pushes to the output stream. You can override this
* method in a subclass for custom behavior, but by default this passes
* the data through. You must call this.ondata(err, chunk, final) at some
* point in this method.
* @param chunk The chunk to process
* @param final Whether this is the last chunk
*/
ZipPassThrough.prototype.process = function (chunk, final) {
this.ondata(null, chunk, final);
};
/**
* Pushes a chunk to be added. If you are subclassing this with a custom
* compression algorithm, note that you must push data from the source
* file only, pre-compression.
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
ZipPassThrough.prototype.push = function (chunk, final) {
if (!this.ondata)
throw 'no callback - add to ZIP archive before pushing';
this.c.p(chunk);
this.size += chunk.length;
if (final)
this.crc = this.c.d();
this.process(chunk, final || false);
};
return ZipPassThrough;
}());
export { ZipPassThrough };
// I don't extend because TypeScript extension adds 1kB of runtime bloat
/**
* Streaming DEFLATE compression for ZIP archives. Prefer using AsyncZipDeflate
* for better performance
*/
var ZipDeflate = /*#__PURE__*/ (function () {
/**
* Creates a DEFLATE stream that can be added to ZIP archives
* @param filename The filename to associate with this data stream
* @param opts The compression options
*/
function ZipDeflate(filename, opts) {
var _this_1 = this;
if (!opts)
opts = {};
ZipPassThrough.call(this, filename);
this.d = new Deflate(opts, function (dat, final) {
_this_1.ondata(null, dat, final);
});
this.compression = 8;
this.flag = dbf(opts.level);
}
ZipDeflate.prototype.process = function (chunk, final) {
try {
this.d.push(chunk, final);
}
catch (e) {
this.ondata(e, null, final);
}
};
/**
* Pushes a chunk to be deflated
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
ZipDeflate.prototype.push = function (chunk, final) {
ZipPassThrough.prototype.push.call(this, chunk, final);
};
return ZipDeflate;
}());
export { ZipDeflate };
/**
* Asynchronous streaming DEFLATE compression for ZIP archives
*/
var AsyncZipDeflate = /*#__PURE__*/ (function () {
/**
* Creates a DEFLATE stream that can be added to ZIP archives
* @param filename The filename to associate with this data stream
* @param opts The compression options
*/
function AsyncZipDeflate(filename, opts) {
var _this_1 = this;
if (!opts)
opts = {};
ZipPassThrough.call(this, filename);
this.d = new AsyncDeflate(opts, function (err, dat, final) {
_this_1.ondata(err, dat, final);
});
this.compression = 8;
this.flag = dbf(opts.level);
this.terminate = this.d.terminate;
}
AsyncZipDeflate.prototype.process = function (chunk, final) {
this.d.push(chunk, final);
};
/**
* Pushes a chunk to be deflated
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
AsyncZipDeflate.prototype.push = function (chunk, final) {
ZipPassThrough.prototype.push.call(this, chunk, final);
};
return AsyncZipDeflate;
}());
export { AsyncZipDeflate };
// TODO: Better tree shaking
/**
* A zippable archive to which files can incrementally be added
*/
var Zip = /*#__PURE__*/ (function () {
/**
* Creates an empty ZIP archive to which files can be added
* @param cb The callback to call whenever data for the generated ZIP archive
* is available
*/
function Zip(cb) {
this.ondata = cb;
this.u = [];
this.d = 1;
}
/**
* Adds a file to the ZIP archive
* @param file The file stream to add
*/
Zip.prototype.add = function (file) {
var _this_1 = this;
if (this.d & 2)
throw 'stream finished';
var f = strToU8(file.filename), fl = f.length;
var com = file.comment, o = com && strToU8(com);
var u = fl != file.filename.length || (o && (com.length != o.length));
var hl = fl + exfl(file.extra) + 30;
if (fl > 65535)
throw 'filename too long';
var header = new u8(hl);
wzh(header, 0, file, f, u);
var chks = [header];
var pAll = function () {
for (var _i = 0, chks_1 = chks; _i < chks_1.length; _i++) {
var chk = chks_1[_i];
_this_1.ondata(null, chk, false);
}
chks = [];
};
var tr = this.d;
this.d = 0;
var ind = this.u.length;
var uf = mrg(file, {
f: f,
u: u,
o: o,
t: function () {
if (file.terminate)
file.terminate();
},
r: function () {
pAll();
if (tr) {
var nxt = _this_1.u[ind + 1];
if (nxt)
nxt.r();
else
_this_1.d = 1;
}
tr = 1;
}
});
var cl = 0;
file.ondata = function (err, dat, final) {
if (err) {
_this_1.ondata(err, dat, final);
_this_1.terminate();
}
else {
cl += dat.length;
chks.push(dat);
if (final) {
var dd = new u8(16);
wbytes(dd, 0, 0x8074B50);
wbytes(dd, 4, file.crc);
wbytes(dd, 8, cl);
wbytes(dd, 12, file.size);
chks.push(dd);
uf.c = cl, uf.b = hl + cl + 16, uf.crc = file.crc, uf.size = file.size;
if (tr)
uf.r();
tr = 1;
}
else if (tr)
pAll();
}
};
this.u.push(uf);
};
/**
* Ends the process of adding files and prepares to emit the final chunks.
* This *must* be called after adding all desired files for the resulting
* ZIP file to work properly.
*/
Zip.prototype.end = function () {
var _this_1 = this;
if (this.d & 2) {
if (this.d & 1)
throw 'stream finishing';
throw 'stream finished';
}
if (this.d)
this.e();
else
this.u.push({
r: function () {
if (!(_this_1.d & 1))
return;
_this_1.u.splice(-1, 1);
_this_1.e();
},
t: function () { }
});
this.d = 3;
};
Zip.prototype.e = function () {
var bt = 0, l = 0, tl = 0;
for (var _i = 0, _a = this.u; _i < _a.length; _i++) {
var f = _a[_i];
tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);
}
var out = new u8(tl + 22);
for (var _b = 0, _c = this.u; _b < _c.length; _b++) {
var f = _c[_b];
wzh(out, bt, f, f.f, f.u, f.c, l, f.o);
bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;
}
wzf(out, bt, this.u.length, tl, l);
this.ondata(null, out, true);
this.d = 2;
};
/**
* A method to terminate any internal workers used by the stream. Subsequent
* calls to add() will fail.
*/
Zip.prototype.terminate = function () {
for (var _i = 0, _a = this.u; _i < _a.length; _i++) {
var f = _a[_i];
f.t();
}
this.d = 2;
};
return Zip;
}());
export { Zip };
export function zip(data, opts, cb) {
if (!cb)
cb = opts, opts = {};
if (typeof cb != 'function')
throw 'no callback';
var r = {};
fltn(data, '', r, opts);
var k = Object.keys(r);
var lft = k.length, o = 0, tot = 0;
var slft = lft, files = new Array(lft);
var term = [];
var tAll = function () {
for (var i = 0; i < term.length; ++i)
term[i]();
};
var cbf = function () {
var out = new u8(tot + 22), oe = o, cdl = tot - o;
tot = 0;
for (var i = 0; i < slft; ++i) {
var f = files[i];
try {
var l = f.c.length;
wzh(out, tot, f, f.f, f.u, l);
var badd = 30 + f.f.length + exfl(f.extra);
var loc = tot + badd;
out.set(f.c, loc);
wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;
}
catch (e) {
return cb(e, null);
}
}
wzf(out, o, files.length, cdl, oe);
cb(null, out);
};
if (!lft)
cbf();
var _loop_1 = function (i) {
var fn = k[i];
var _a = r[fn], file = _a[0], p = _a[1];
var c = crc(), size = file.length;
c.p(file);
var f = strToU8(fn), s = f.length;
var com = p.comment, m = com && strToU8(com), ms = m && m.length;
var exl = exfl(p.extra);
var compression = p.level == 0 ? 0 : 8;
var cbl = function (e, d) {
if (e) {
tAll();
cb(e, null);
}
else {
var l = d.length;
files[i] = mrg(p, {
size: size,
crc: c.d(),
c: d,
f: f,
m: m,
u: s != fn.length || (m && (com.length != ms)),
compression: compression
});
o += 30 + s + exl + l;
tot += 76 + 2 * (s + exl) + (ms || 0) + l;
if (!--lft)
cbf();
}
};
if (s > 65535)
cbl('filename too long', null);
if (!compression)
cbl(null, file);
else if (size < 160000) {
try {
cbl(null, deflateSync(file, p));
}
catch (e) {
cbl(e, null);
}
}
else
term.push(deflate(file, p, cbl));
};
// Cannot use lft because it can decrease
for (var i = 0; i < slft; ++i) {
_loop_1(i);
}
return tAll;
}
/**
* Synchronously creates a ZIP file. Prefer using `zip` for better performance
* with more than one file.
* @param data The directory structure for the ZIP archive
* @param opts The main options, merged with per-file options
* @returns The generated ZIP archive
*/
export function zipSync(data, opts) {
if (!opts)
opts = {};
var r = {};
var files = [];
fltn(data, '', r, opts);
var o = 0;
var tot = 0;
for (var fn in r) {
var _a = r[fn], file = _a[0], p = _a[1];
var compression = p.level == 0 ? 0 : 8;
var f = strToU8(fn), s = f.length;
var com = p.comment, m = com && strToU8(com), ms = m && m.length;
var exl = exfl(p.extra);
if (s > 65535)
throw 'filename too long';
var d = compression ? deflateSync(file, p) : file, l = d.length;
var c = crc();
c.p(file);
files.push(mrg(p, {
size: file.length,
crc: c.d(),
c: d,
f: f,
m: m,
u: s != fn.length || (m && (com.length != ms)),
o: o,
compression: compression
}));
o += 30 + s + exl + l;
tot += 76 + 2 * (s + exl) + (ms || 0) + l;
}
var out = new u8(tot + 22), oe = o, cdl = tot - o;
for (var i = 0; i < files.length; ++i) {
var f = files[i];
wzh(out, f.o, f, f.f, f.u, f.c.length);
var badd = 30 + f.f.length + exfl(f.extra);
out.set(f.c, f.o + badd);
wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);
}
wzf(out, o, files.length, cdl, oe);
return out;
}
/**
* Streaming pass-through decompression for ZIP archives
*/
var UnzipPassThrough = /*#__PURE__*/ (function () {
function UnzipPassThrough() {
}
UnzipPassThrough.prototype.push = function (data, final) {
this.ondata(null, data, final);
};
UnzipPassThrough.compression = 0;
return UnzipPassThrough;
}());
export { UnzipPassThrough };
/**
* Streaming DEFLATE decompression for ZIP archives. Prefer AsyncZipInflate for
* better performance.
*/
var UnzipInflate = /*#__PURE__*/ (function () {
/**
* Creates a DEFLATE decompression that can be used in ZIP archives
*/
function UnzipInflate() {
var _this_1 = this;
this.i = new Inflate(function (dat, final) {
_this_1.ondata(null, dat, final);
});
}
UnzipInflate.prototype.push = function (data, final) {
try {
this.i.push(data, final);
}
catch (e) {
this.ondata(e, data, final);
}
};
UnzipInflate.compression = 8;
return UnzipInflate;
}());
export { UnzipInflate };
/**
* Asynchronous streaming DEFLATE decompression for ZIP archives
*/
var AsyncUnzipInflate = /*#__PURE__*/ (function () {
/**
* Creates a DEFLATE decompression that can be used in ZIP archives
*/
function AsyncUnzipInflate(_, sz) {
var _this_1 = this;
if (sz < 320000) {
this.i = new Inflate(function (dat, final) {
_this_1.ondata(null, dat, final);
});
}
else {
this.i = new AsyncInflate(function (err, dat, final) {
_this_1.ondata(err, dat, final);
});
this.terminate = this.i.terminate;
}
}
AsyncUnzipInflate.prototype.push = function (data, final) {
if (this.i.terminate)
data = slc(data, 0);
this.i.push(data, final);
};
AsyncUnzipInflate.compression = 8;
return AsyncUnzipInflate;
}());
export { AsyncUnzipInflate };
/**
* A ZIP archive decompression stream that emits files as they are discovered
*/
var Unzip = /*#__PURE__*/ (function () {
/**
* Creates a ZIP decompression stream
* @param cb The callback to call whenever a file in the ZIP archive is found
*/
function Unzip(cb) {
this.onfile = cb;
this.k = [];
this.o = {
0: UnzipPassThrough
};
this.p = et;
}
/**
* Pushes a chunk to be unzipped
* @param chunk The chunk to push
* @param final Whether this is the last chunk
*/
Unzip.prototype.push = function (chunk, final) {
var _this_1 = this;
if (!this.onfile)
throw 'no callback';
if (!this.p)
throw 'stream finished';
if (this.c > 0) {
var len = Math.min(this.c, chunk.length);
var toAdd = chunk.subarray(0, len);
this.c -= len;
if (this.d)
this.d.push(toAdd, !this.c);
else
this.k[0].push(toAdd);
chunk = chunk.subarray(len);
if (chunk.length)
return this.push(chunk, final);
}
else {
var f = 0, i = 0, is = void 0, buf = void 0;
if (!this.p.length)
buf = chunk;
else if (!chunk.length)
buf = this.p;
else {
buf = new u8(this.p.length + chunk.length);
buf.set(this.p), buf.set(chunk, this.p.length);
}
var l = buf.length, oc = this.c, add = oc && this.d;
var _loop_2 = function () {
var _a;
var sig = b4(buf, i);
if (sig == 0x4034B50) {
f = 1, is = i;
this_1.d = null;
this_1.c = 0;
var bf = b2(buf, i + 6), cmp_1 = b2(buf, i + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i + 26), es = b2(buf, i + 28);
if (l > i + 30 + fnl + es) {
var chks_2 = [];
this_1.k.unshift(chks_2);
f = 2;
var sc_1 = b4(buf, i + 18), su_1 = b4(buf, i + 22);
var fn_1 = strFromU8(buf.subarray(i + 30, i += 30 + fnl), !u);
if (sc_1 == 4294967295) {
_a = dd ? [-2] : z64e(buf, i), sc_1 = _a[0], su_1 = _a[1];
}
else if (dd)
sc_1 = -1;
i += es;
this_1.c = sc_1;
var d_1;
var file_1 = {
name: fn_1,
compression: cmp_1,
start: function () {
if (!file_1.ondata)
throw 'no callback';
if (!sc_1)
file_1.ondata(null, et, true);
else {
var ctr = _this_1.o[cmp_1];
if (!ctr)
throw 'unknown compression type ' + cmp_1;
d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);
d_1.ondata = function (err, dat, final) { file_1.ondata(err, dat, final); };
for (var _i = 0, chks_3 = chks_2; _i < chks_3.length; _i++) {
var dat = chks_3[_i];
d_1.push(dat, false);
}
if (_this_1.k[0] == chks_2 && _this_1.c)
_this_1.d = d_1;
else
d_1.push(et, true);
}
},
terminate: function () {
if (d_1 && d_1.terminate)
d_1.terminate();
}
};
if (sc_1 >= 0)
file_1.size = sc_1, file_1.originalSize = su_1;
this_1.onfile(file_1);
}
return "break";
}
else if (oc) {
if (sig == 0x8074B50) {
is = i += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;
return "break";
}
else if (sig == 0x2014B50) {
is = i -= 4, f = 3, this_1.c = 0;
return "break";
}
}
};
var this_1 = this;
for (; i < l - 4; ++i) {
var state_1 = _loop_2();
if (state_1 === "break")
break;
}
this.p = et;
if (oc < 0) {
var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 0x8074B50 && 4)) : buf.subarray(0, i);
if (add)
add.push(dat, !!f);
else
this.k[+(f == 2)].push(dat);
}
if (f & 2)
return this.push(buf.subarray(i), final);
this.p = buf.subarray(i);
}
if (final) {
if (this.c)
throw 'invalid zip file';
this.p = null;
}
};
/**
* Registers a decoder with the stream, allowing for files compressed with
* the compression type provided to be expanded correctly
* @param decoder The decoder constructor
*/
Unzip.prototype.register = function (decoder) {
this.o[decoder.compression] = decoder;
};
return Unzip;
}());
export { Unzip };
/**
* Asynchronously decompresses a ZIP archive
* @param data The raw compressed ZIP file
* @param cb The callback to call with the decompressed files
* @returns A function that can be used to immediately terminate the unzipping
*/
export function unzip(data, cb) {
if (typeof cb != 'function')
throw 'no callback';
var term = [];
var tAll = function () {
for (var i = 0; i < term.length; ++i)
term[i]();
};
var files = {};
var e = data.length - 22;
for (; b4(data, e) != 0x6054B50; --e) {
if (!e || data.length - e > 65558) {
cb('invalid zip file', null);
return;
}
}
;
var lft = b2(data, e + 8);
if (!lft)
cb(null, {});
var c = lft;
var o = b4(data, e + 16);
var z = o == 4294967295;
if (z) {
e = b4(data, e - 12);
if (b4(data, e) != 0x6064B50) {
cb('invalid zip file', null);
return;
}
c = lft = b4(data, e + 32);
o = b4(data, e + 48);
}
var _loop_3 = function (i) {
var _a = zh(data, o, z), c_1 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);
o = no;
var cbl = function (e, d) {
if (e) {
tAll();
cb(e, null);
}
else {
files[fn] = d;
if (!--lft)
cb(null, files);
}
};
if (!c_1)
cbl(null, slc(data, b, b + sc));
else if (c_1 == 8) {
var infl = data.subarray(b, b + sc);
if (sc < 320000) {
try {
cbl(null, inflateSync(infl, new u8(su)));
}
catch (e) {
cbl(e, null);
}
}
else
term.push(inflate(infl, { size: su }, cbl));
}
else
cbl('unknown compression type ' + c_1, null);
};
for (var i = 0; i < c; ++i) {
_loop_3(i);
}
return tAll;
}
/**
* Synchronously decompresses a ZIP archive. Prefer using `unzip` for better
* performance with more than one file.
* @param data The raw compressed ZIP file
* @returns The decompressed files
*/
export function unzipSync(data) {
var files = {};
var e = data.length - 22;
for (; b4(data, e) != 0x6054B50; --e) {
if (!e || data.length - e > 65558)
throw 'invalid zip file';
}
;
var c = b2(data, e + 8);
if (!c)
return {};
var o = b4(data, e + 16);
var z = o == 4294967295;
if (z) {
e = b4(data, e - 12);
if (b4(data, e) != 0x6064B50)
throw 'invalid zip file';
c = b4(data, e + 32);
o = b4(data, e + 48);
}
for (var i = 0; i < c; ++i) {
var _a = zh(data, o, z), c_2 = _a[0], sc = _a[1], su = _a[2], fn = _a[3], no = _a[4], off = _a[5], b = slzh(data, off);
o = no;
if (!c_2)
files[fn] = slc(data, b, b + sc);
else if (c_2 == 8)
files[fn] = inflateSync(data.subarray(b, b + sc), new u8(su));
else
throw 'unknown compression type ' + c_2;
}
return files;
}
function md5(string) {
function md5_RotateLeft(lValue, iShiftBits) {
return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
}
function md5_AddUnsigned(lX, lY) {
var lX4, lY4, lX8, lY8, lResult;
lX8 = (lX & 0x80000000);
lY8 = (lY & 0x80000000);
lX4 = (lX & 0x40000000);
lY4 = (lY & 0x40000000);
lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
if (lX4 & lY4) {
return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
}
if (lX4 | lY4) {
if (lResult & 0x40000000) {
return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
} else {
return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
}
} else {
return (lResult ^ lX8 ^ lY8);
}
}
function md5_F(x, y, z) {
return (x & y) | ((~x) & z);
}
function md5_G(x, y, z) {
return (x & z) | (y & (~z));
}
function md5_H(x, y, z) {
return (x ^ y ^ z);
}
function md5_I(x, y, z) {
return (y ^ (x | (~z)));
}
function md5_FF(a, b, c, d, x, s, ac) {
a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_F(b, c, d), x), ac));
return md5_AddUnsigned(md5_RotateLeft(a, s), b);
};
function md5_GG(a, b, c, d, x, s, ac) {
a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_G(b, c, d), x), ac));
return md5_AddUnsigned(md5_RotateLeft(a, s), b);
};
function md5_HH(a, b, c, d, x, s, ac) {
a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_H(b, c, d), x), ac));
return md5_AddUnsigned(md5_RotateLeft(a, s), b);
};
function md5_II(a, b, c, d, x, s, ac) {
a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_I(b, c, d), x), ac));
return md5_AddUnsigned(md5_RotateLeft(a, s), b);
};
function md5_ConvertToWordArray(string) {
var lWordCount;
var lMessageLength = string.length;
var lNumberOfWords_temp1 = lMessageLength + 8;
var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64;
var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
var lWordArray = Array(lNumberOfWords - 1);
var lBytePosition = 0;
var lByteCount = 0;
while (lByteCount < lMessageLength) {
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
lBytePosition = (lByteCount % 4) * 8;
lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
lByteCount++;
}
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
lBytePosition = (lByteCount % 4) * 8;
lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
return lWordArray;
};
function md5_WordToHex(lValue) {
var WordToHexValue = "",
WordToHexValue_temp = "",
lByte, lCount;
for (lCount = 0; lCount <= 3; lCount++) {
lByte = (lValue >>> (lCount * 8)) & 255;
WordToHexValue_temp = "0" + lByte.toString(16);
WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
}
return WordToHexValue;
};
function md5_Utf8Encode(string) {
string = string.replace(/\r\n/g, "\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
} else if ((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
} else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
return utftext;
};
var x = [];
var k, AA, BB, CC, DD, a, b, c, d;
var S11 = 7,
S12 = 12,
S13 = 17,
S14 = 22;
var S21 = 5,
S22 = 9,
S23 = 14,
S24 = 20;
var S31 = 4,
S32 = 11,
S33 = 16,
S34 = 23;
var S41 = 6,
S42 = 10,
S43 = 15,
S44 = 21;
string = md5_Utf8Encode(string);
x = md5_ConvertToWordArray(string);
a = 0x67452301;
b = 0xEFCDAB89;
c = 0x98BADCFE;
d = 0x10325476;
for (k = 0; k < x.length; k += 16) {
AA = a;
BB = b;
CC = c;
DD = d;
a = md5_FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
d = md5_FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
c = md5_FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
b = md5_FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
a = md5_FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
d = md5_FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
c = md5_FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
b = md5_FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
a = md5_FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
d = md5_FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
c = md5_FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
b = md5_FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
a = md5_FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
d = md5_FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
c = md5_FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
b = md5_FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
a = md5_GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
d = md5_GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
c = md5_GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
b = md5_GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
a = md5_GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
d = md5_GG(d, a, b, c, x[k + 10], S22, 0x2441453);
c = md5_GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
b = md5_GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
a = md5_GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
d = md5_GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
c = md5_GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
b = md5_GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
a = md5_GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
d = md5_GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
c = md5_GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
b = md5_GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
a = md5_HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
d = md5_HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
c = md5_HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
b = md5_HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
a = md5_HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
d = md5_HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
c = md5_HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
b = md5_HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
a = md5_HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
d = md5_HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
c = md5_HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
b = md5_HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
a = md5_HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
d = md5_HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
c = md5_HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
b = md5_HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
a = md5_II(a, b, c, d, x[k + 0], S41, 0xF4292244);
d = md5_II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
c = md5_II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
b = md5_II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
a = md5_II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
d = md5_II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
c = md5_II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
b = md5_II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
a = md5_II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
d = md5_II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
c = md5_II(c, d, a, b, x[k + 6], S43, 0xA3014314);
b = md5_II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
a = md5_II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
d = md5_II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
c = md5_II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
b = md5_II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
a = md5_AddUnsigned(a, AA);
b = md5_AddUnsigned(b, BB);
c = md5_AddUnsigned(c, CC);
d = md5_AddUnsigned(d, DD);
}
return (md5_WordToHex(a) + md5_WordToHex(b) + md5_WordToHex(c) + md5_WordToHex(d)).toLowerCase();
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
name: fg3d
version: V1.341
*/
function _0xda21(_0x3e0c3c,_0x4910c7){var _0x204abe=_0x5c23();return _0xda21=function(_0xc8f35c,_0x51b877){_0xc8f35c=_0xc8f35c-0x150;var _0x5c2320=_0x204abe[_0xc8f35c];return _0x5c2320;},_0xda21(_0x3e0c3c,_0x4910c7);}function _0x5c23(){var _0x56c7ab=['document','getMoreCoordinate','setContent','Material','cvs','Color','style1','setChartOption','globe','height','wgs84ToWindowCoordinates','setInputAction','strokeStyle','1032mfJGLo','polygon','viewer','Cesium3DTileStyle','scene','createElement','materials','请先引入\x20Cesium!\x20','),\x201.0)','czm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x0a\x20{\x0a\x20\x20\x20\x20\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20\x20\x20\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20\x20\x20\x20\x20vec4\x20colorImage\x20=\x20texture2D(image,\x20vec2(fract(st.t\x20-\x20time),\x20st.t));\x0a\x20\x20\x20\x20\x20\x20material.alpha\x20=\x20colorImage.a\x20*\x20color.a;\x0a\x20\x20\x20\x20\x20\x20material.diffuse\x20=\x20\x201.5*\x20color.rgb\x20\x20;\x0a\x20\x20\x20\x20\x20\x20return\x20material;\x0a\x20\x20}','search','czm_material\x20czm_getMaterial(czm_materialInput\x20materialInput){czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);vec2\x20st\x20=\x20materialInput.st;vec4\x20colorImage\x20=\x20texture2D(image,\x20vec2(fract(st.t\x20-\x20time),\x20st.t));material.alpha\x20=\x20colorImage.a\x20*\x20color.a;material.diffuse\x20=\x20\x202.5\x20*\x20color.rgb\x20\x20;return\x20material;\x20}','eachSeries',';\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09','entities','getFeature','clusterImage','positions','getOptionsFirstFn','billboard','pointerEvents','cartesianToCanvasCoordinates','1035027HfNkCG','(((.+)+)+)+$','flyTo','_viewer','addMaterial','top','getContext','Math','LinearFlow','image/png','ScreenSpaceEventType','ScrollWall','startSceneEventListeners','/150+.png','values','string','ellipsoid','angleBetween','BoundingRect','positionCartographic','WHITE','shader','raiseEvent','currentTime','defaultValue','/90+.png','1TTHCgq','Array','billboardImg','getLnglatToCartesian3','tileVisible','gradient','__proto__','createGuid','structures',';\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09gl_FragColor.b\x20+=\x20','onload','background:url(','getBase64ByColors','fontY','createPropertyDescriptor','pickPosition','cssText','radius','alpha','getE3CoordinateSystem','isExist','setType','Module','config','LEFT_CLICK','Assists','ctx','78vgKoIg','backgroundColor','log','glowRangeHeight','registerCoordinateSystem','data:image/octet-stream;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAABCAYAAAAo2wu9AAAAOklEQVQoU2P8//+/McMoIDsEfv/+zcLKysrOwMDAAcVg9t+/fzmYmZkxxP/9+8fBxMSEIc7AwAAWAwD/kwzHVTmPqQAAAABJRU5ErkJggg==','chart','tabIndex','handler','请输入正确的经纬度!\x20','Function','setMapOffset','dataToPoint','position:absolute;bottom:0;left:0;transition-property:transform;transform-origin:0px\x200px;','_rendererResources','Type','addDatasource','lat','ScreenSpaceEventHandler','roll','getImage','width','vh_position.z\x20/\x20100.0','dimensions','SCENE3D','resetPositionsHeight','stroke','Ray','pick','left','viewerHeight','coordinateSystem','heading','setLineDash','middle','red','keys','options','colors','position','JulianDate','screenSpaceEventHandler','path','heightReference','toDataURL','removeRender','default','clock','d3Api','clampToHeight','Cesium','utils','EventHelper','fill','src','7644060YYdoas','create','lineTo','text','animation','clustering','fromDegrees','0.0','_time','getValueOrClonedDefault','defined','YELLOW','scaleByDistance','setClusterEvent','render','VerticalOrigin','img','DataLoadedEvent','content','replace','cesium','glConfig','longitude','class','clampToHeightMostDetailed','translate(','label','concat','Cartographic','constructor','fromCartesian','start','devicePixelRatio','clone','name','viewerLat','moveHandler','apply','echartMap','image','orientation','cartographicToCartesian','removeInputAction','enabled','callback','_pinBuilder','_materialCache','getValue','graphic','color:#ff0000;','setAttribute','BOTH','then','Billboard','distanceDisplayCondition','skyBox','restore','exports','drillPickFromRay','Property','call','LineFlowWall','transparent','Object','chartOption','vPosition','none','minimumClusterSize','Viewer','791332oTxgZi','entity','Source','mode','image/octet-stream','beginPath','cesiumWidget','uniform\x20vec4\x20color;uniform\x20float\x20speed;float\x20rand(vec2\x20co){return\x20fract(sin(dot(co.xy\x20,vec2(12.9898,78.233)))\x20*\x2043758.5453);}czm_material\x20czm_getMaterial(czm_materialInput\x20materialInput){czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);vec2\x20st\x20=\x20materialInput.st;vec2\x20pos\x20=\x20st\x20-\x20vec2(0.5);float\x20time\x20=\x20czm_frameNumber\x20*\x20speed\x20/\x201000.0;float\x20r\x20=\x20length(pos);float\x20t\x20=\x20atan(pos.y,\x20pos.x)\x20-\x20time\x20*\x202.5;float\x20a\x20=\x20(atan(sin(t),\x20cos(t))\x20+\x203.14159265)/(','data:image/octet-stream;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAUCAYAAAB7wJiVAAACgklEQVRoQ9WZi27DIAxFIeGX9n53//9FBTy5rSNESDC2U2mVqkQRgc7X1wczDwC/zrmQUgrzPM+3a3DOzeVzvL99L89zzmGapss953k5pnG/rAcAwXuP83rH+AAAeO+Tc27km3POaZqmRNfB9/G9rHmf1osx5hDC8ts9AJzqoHKD1xm3Eos7/iYKSxDnHBTBzKOBbYxXz5FSypjbkt/iz+fzKYSwCh45pifWqFO2xhfOIMdNDIPQkO4fDwAZnaR0htpZJFaMMZXOIPHQIT/czKUyxnXQVvCZ62GScD+arNa8WyaCyTwoyDcGKMYYNE4hsbgiNBxxcWn1XCwIOQIAkoAxS6BrVgiZk1NK6Yro63WrnKEgX0VZWuBaZjG3fDEdtMUWMdgrjnTL1y0YFhltMUcqwU6CjAJ4CZ4VQ+oyJgW7kTPMWMF1RsmQT2ZNb7qnB32la0zB7pyzyOhD50CHfBzAkK6DmAxhg13pDLUjqAzWjOkxo2YJCTJasqzG77mO1hCD3cgRSxMo6StGeyQU5L0sK1sA33o+yhDulnm0Y5eCXdmXmHfsKMibkCGc7FaNkYLdyBmHsmJv2/tqwRArp9yrY6eASPsKrbO2OnZ0CApixYRyni7Ymc5kg13pDAtHYA+0bBAkzEFBXsrAjHbsWmcwd1tisNe7L2nnfq+OHQV53jsOZ2axihWVQ1tzSU5+/13Hju5CQZ72mrvOsUm3LHHPtkiU2jFSsCv7EhJzVX5GmUOs4HbsJIgVQ5pOGRWl4UrTjp3EktT40b6is8aKWyjIo4Yh3L5i4P8grVNfNtiVzjisY+eKj4I8HHwexXEfh0FisCt3X6ujeG5wN8bt7ub+ANZIqbIlvAh5AAAAAElFTkSuQmCC','setOption','type','green','%c\x20%s','closePath','div','gl_FragColor\x20=\x20vec4(','clickHighlight','geoJsonDataSource','prototype','assist','initPositon','removeListener',';\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09float\x20time\x20=\x20abs(fract(czm_frameNumber\x20/\x20360.0)\x20-\x200.5)\x20*\x202.0;\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09float\x20diff\x20=\x20step(0.005,\x20abs(clamp(vh_position.z\x20/\x20glowRange,\x200.0,\x201.0)\x20-\x20time));\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09gl_FragColor.rgb\x20+=\x20gl_FragColor.rgb\x20*\x20(1.0\x20-\x20diff);\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09}','__esModule','withAlpha','box','pixelOffset','getLnglatToTeilPosition','fontSize','cartesian3','pitch','draw','resize','RED','data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAEACAMAAABMC0zQAAAAmVBMVEUAAADg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OCPdUzZAAAAM3RSTlMA9goG7OfdyMG6JPA3PeLY086wqqCShXt1b2lbVU1HMikZFRG0pZuXjoqAZGBRQi0gHA5BoPyiAAAAn0lEQVQ4y+3FRw7CQBQE0TFDBpNzzjnf/3C40N+0NF6z8Wup2mUy/+K9d+z3kOaQ2g+sW0g3kK4hfcP6grWKQFeQPmFdQlqHNk7mYkgfsC4gnUN6h3UG6RTSG6xXWCeQjiEdQTqE9ALrANIzrCdY+5AeYT3A2oN0D2sX0g6kO1grCLSMQEsItA1pC9ImpEUE2oC0gEDzCLQGbZTMRUjrFy5HP6koccQzAAAAAElFTkSuQmCC','\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09varying\x20vec3\x20v_positionEC;\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09void\x20main(void){\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09','lng','fromColor','appendChild',';\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09gl_FragColor.r\x20+=\x20stc_sd+','fromCssColorString','179627EKQoRE','*3.14159265);float\x20ta\x20=\x200.5;float\x20v\x20=\x20smoothstep(ta-0.05,ta+0.05,a)\x20*\x20smoothstep(ta+0.05,ta-0.05,a);vec3\x20flagColor\x20=\x20color.rgb\x20*\x20v;float\x20blink\x20=\x20pow(sin(time*1.5)*0.5+0.5,\x200.8);flagColor\x20=\x20color.rgb\x20*\x20\x20pow(a,\x208.0*(.2+blink))*(sin(r*','/10+.png','_mapOffset',';\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09//\x20动态颜色过度,\x20后面的数字是过度的亮度值\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09//float\x20stc_pl\x20=\x20fract(czm_frameNumber\x20/\x2080.0)\x20*\x203.14159265\x20;\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09//float\x20stc_sd\x20=\x20vh_position.z\x20/\x20100.0\x20+\x20sin(stc_pl)\x20*\x202.5;\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09','cartesianToCartographic','removeRenderEvent','defineProperties',';\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09}','append','color','getviewerRect','toStringTag','textBaseline','round','czm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x0a\x20{\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20\x20\x20vec4\x20colorImage\x20=\x20texture2D(image,\x20vec2(fract(\x20count\x20*\x20st.s\x20-\x20time),fract(st.t)));\x0a\x20\x20\x20\x20\x20material.alpha\x20=\x20\x20colorImage.a\x20*\x20color.a;\x0a\x20\x20\x20\x20\x20material.diffuse\x20=\x20\x20color.rgb\x20*\x203.0\x20;\x0a\x20\x20\x20\x20\x20return\x20material;}','getGLFragColor','getTime','addSample','model',';\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09gl_FragColor.a\x20+=\x20','_model','container','property','finish','loopList','fillColor','roundRect','LEFT_DOUBLE_CLICK','fillText','extend','add','pixelRange',');flagColor\x20=\x20flagColor\x20*\x20pow(r,\x200.4);material.alpha\x20=\x20length(flagColor)\x20*\x201.3;material.diffuse\x20=\x20flagColor\x20*\x203.0;return\x20material;}',';\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09gl_FragColor.g\x20+=\x20','getLnglatToCartesian','canvas','latitude','Async','toDegrees','2.0','BOTTOM','Cartesian3','clusterEvent','show','ConstantPositionProperty','postRender','forEach','0px','rippleWidth','Gradient','Entitys','inRender','fontX','gl_FragColor\x20*=\x20vec4(vec3(','namekey','tileVisibleEventHandler','fillRect','featuresLength','_definitionChanged','dataSources','absolute','Wall','EMPTY_OBJECT','/30+.png','Image','2681400OuMmch','semiMajorAxis','fillStyle','get','style','DistanceDisplayCondition','toRadians','VelocityOrientationProperty','length','.png','0.2,\x200.5,\x201.0,\x201.0','vec4(','addEventListener','px\x20sans-serif','undefined','drawLiner','tile','glowRange','properties','Event','lerp','sourceShaders','defineProperty','PathGraphics','getDimensionsInfo','500.0','createLayer','pathSlice','leftClick','clearRect','vec4\x20vh_position\x20=\x20czm_inverseModelView\x20*\x20vec4(v_positionEC,1)',';\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09','init','toString','createEntitys','duration','hidden','lableOption','_sourcePrograms','_entityCollection','GeoJsonDataSource','_color','camera','remove','LinearGradient','getOrCreateEntity',';\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09float\x20glowRange\x20=\x20','getPickRay','getShader','bind',');\x20background-size:\x20cover;','count','Entity','TransLine','lineWidth','leftDoubleClick','ClassificationType','501460KJLsKS','Cartesian2','object','24327QbhVfV','_value','getScenePosition',';\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09'];_0x5c23=function(){return _0x56c7ab;};return _0x5c23();}(function(_0x500acd,_0x52faf9){var _0x5a5c23={_0x5bc9f3:0x242,_0x38ac19:0x209},_0x34fe83=_0xda21,_0x57f537=_0x500acd();while(!![]){try{var _0x569ebd=parseInt(_0x34fe83(0x286))/0x1*(parseInt(_0x34fe83(_0x5a5c23._0x5bc9f3))/0x2)+-parseInt(_0x34fe83(0x26c))/0x3+parseInt(_0x34fe83(0x19e))/0x4+-parseInt(_0x34fe83(_0x5a5c23._0x38ac19))/0x5+parseInt(_0x34fe83(0x2a1))/0x6*(parseInt(_0x34fe83(0x1c7))/0x7)+-parseInt(_0x34fe83(0x256))/0x8*(parseInt(_0x34fe83(0x245))/0x9)+parseInt(_0x34fe83(0x159))/0xa;if(_0x569ebd===_0x52faf9)break;else _0x57f537['push'](_0x57f537['shift']());}catch(_0x13ce8f){_0x57f537['push'](_0x57f537['shift']());}}}(_0x5c23,0x4d4aa),!function(_0xf98e0f){var _0x421d65={_0x1a8c9f:0x1b0,_0x44d63e:0x195},_0x278d8f={_0x31b875:0x150},_0x4081d4={_0x38f143:0x15a,_0x5dbb2a:0x150,_0xc619af:0x27b},_0x28336b={_0x3d1354:0x1d3,_0x5dc5d0:0x29c,_0x39c392:0x1b5},_0x338b36={_0x2cbf3e:0x195,_0x17cd55:0x192},_0x151742=(function(){var _0x46acaf=!![];return function(_0x513c8b,_0x445b62){var _0x2084a8=_0x46acaf?function(){var _0x26012b=_0xda21;if(_0x445b62){var _0x1e85c1=_0x445b62[_0x26012b(0x17e)](_0x513c8b,arguments);return _0x445b62=null,_0x1e85c1;}}:function(){};return _0x46acaf=![],_0x2084a8;};}()),_0x16b3b1={};function _0x5a85a7(_0x300409){var _0x1e50f6={_0x500626:0x260,_0x15c877:0x176},_0x3e0402=_0xda21,_0x337d0f=_0x151742(this,function(){var _0x1bf6e4=_0xda21;return _0x337d0f[_0x1bf6e4(0x22a)]()[_0x1bf6e4(_0x1e50f6._0x500626)](_0x1bf6e4(0x26d))['toString']()[_0x1bf6e4(_0x1e50f6._0x15c877)](_0x337d0f)[_0x1bf6e4(_0x1e50f6._0x500626)]('(((.+)+)+)+$');});_0x337d0f();if(_0x16b3b1[_0x300409])return _0x16b3b1[_0x300409][_0x3e0402(0x192)];var _0x33ef9e=_0x16b3b1[_0x300409]={'i':_0x300409,'l':!0x1,'exports':{}};return _0xf98e0f[_0x300409][_0x3e0402(_0x338b36._0x2cbf3e)](_0x33ef9e['exports'],_0x33ef9e,_0x33ef9e['exports'],_0x5a85a7),_0x33ef9e['l']=!0x0,_0x33ef9e[_0x3e0402(_0x338b36._0x17cd55)];}_0x5a85a7['m']=_0xf98e0f,_0x5a85a7['c']=_0x16b3b1,_0x5a85a7['d']=function(_0x63dfd5,_0x3755d8,_0x4bc9fb){var _0x16e4a7=_0xda21;_0x5a85a7['o'](_0x63dfd5,_0x3755d8)||Object[_0x16e4a7(0x21f)](_0x63dfd5,_0x3755d8,{'enumerable':!0x0,'get':_0x4bc9fb});},_0x5a85a7['r']=function(_0x505549){var _0x31c133=_0xda21;'undefined'!=typeof Symbol&&Symbol[_0x31c133(_0x28336b._0x3d1354)]&&Object[_0x31c133(0x21f)](_0x505549,Symbol['toStringTag'],{'value':_0x31c133(_0x28336b._0x5dc5d0)}),Object['defineProperty'](_0x505549,_0x31c133(_0x28336b._0x39c392),{'value':!0x0});},_0x5a85a7['t']=function(_0x77e65f,_0x580513){var _0x1728a0=_0xda21;if(0x1&_0x580513&&(_0x77e65f=_0x5a85a7(_0x77e65f)),0x8&_0x580513)return _0x77e65f;if(0x4&_0x580513&&_0x1728a0(0x244)==typeof _0x77e65f&&_0x77e65f&&_0x77e65f['__esModule'])return _0x77e65f;var _0x133ae7=Object[_0x1728a0(_0x4081d4._0x38f143)](null);if(_0x5a85a7['r'](_0x133ae7),Object[_0x1728a0(0x21f)](_0x133ae7,_0x1728a0(_0x4081d4._0x5dbb2a),{'enumerable':!0x0,'value':_0x77e65f}),0x2&_0x580513&&_0x1728a0(_0x4081d4._0xc619af)!=typeof _0x77e65f){for(var _0x6b4c1b in _0x77e65f)_0x5a85a7['d'](_0x133ae7,_0x6b4c1b,function(_0x107497){return _0x77e65f[_0x107497];}[_0x1728a0(0x23a)](null,_0x6b4c1b));}return _0x133ae7;},_0x5a85a7['n']=function(_0x11e863){var _0x17e211=_0xda21,_0x2de835=_0x11e863&&_0x11e863[_0x17e211(0x1b5)]?function(){var _0x102a50=_0x17e211;return _0x11e863[_0x102a50(_0x278d8f._0x31b875)];}:function(){return _0x11e863;};return _0x5a85a7['d'](_0x2de835,'a',_0x2de835),_0x2de835;},_0x5a85a7['o']=function(_0x2b99c9,_0x4e3cb4){var _0xe84179=_0xda21;return Object[_0xe84179(_0x421d65._0x1a8c9f)]['hasOwnProperty'][_0xe84179(_0x421d65._0x44d63e)](_0x2b99c9,_0x4e3cb4);},_0x5a85a7['p']='',_0x5a85a7(_0x5a85a7['s']=0x0);}([function(_0xa1f693,_0x541319,_0x3304a6){_0xa1f693['exports']=_0x3304a6(0x1);},function(_0x573e7b,_0x126dde){var _0x285f7e=_0xda21;!function(_0x104d25,_0x540737){var _0x3818b8={_0x5d7b4b:0x195},_0x4d1e46=_0xda21;if(!_0x104d25[_0x4d1e46(0x249)])throw new Error('Window\x20object\x20not\x20found!');(function(_0x28e2b5,_0xb1c340){var _0x67880e={_0xfb1c98:0x1b0},_0x4e85fc={_0x2af851:0x1de},_0x43bf5a={_0x514e04:0x175,_0x693774:0x273,_0x337702:0x16f,_0x59dfd9:0x273},_0x4e385a={_0x5065ea:0x224},_0x6beecb={_0x5d2aa9:0x1f1,_0xae420b:0x15f},_0x480701={_0xc24983:0x15f,_0x41e97a:0x1bc,_0xa3be78:0x2b4,_0xb192cf:0x22c,_0x1bf034:0x25a,_0x2754b5:0x233,_0x3b473f:0x26e},_0x3fb6da={_0x2456ac:0x258,_0xe498b:0x28c,_0x41b3bf:0x1b0},_0x37d862={_0x580a71:0x198,_0x2461fa:0x176,_0x1404b8:0x2a3,_0x3763ed:0x18a},_0x199695={_0x2282bc:0x29f},_0x2b846b={_0x20bea3:0x176},_0x20a6e8=_0x4d1e46;_0x28e2b5['fg3d']=function(){var _0x14d487={_0x1c1285:0x29e,_0x1dbfe7:0x1e3},_0x2144e3={_0x18d01f:0x152,_0x4a752c:0x258,_0x3acd30:0x183,_0x2b1819:0x240},_0x50ddaa={_0x13cfa9:0x17a,_0x4528fd:0x1de,_0x5e2870:0x181},_0xf84c6c={_0x2610d4:0x29b},_0x533363={_0x4c1584:0x258,_0xd7a701:0x264,_0x29c634:0x264,_0x1d7bbb:0x1e6,_0x5cb772:0x264,_0x3c1ac1:0x2c8},_0x50107d={_0x28ad21:0x152,_0x466314:0x258,_0x4db415:0x1e6,_0x50817a:0x28c},_0x1032e5={_0x4e49c1:0x17b,_0x21d1a2:0x1c6,_0x34fc94:0x24e},_0x44294e={_0x2502d4:0x258,_0x5c6940:0x25a},_0x50931f={_0x132498:0x175},_0x69b78f={_0x3ca9a2:0x1b9},_0x568f53={_0x48d090:0x1ea},_0x4d13ed={_0x39a0a5:0x1b0},_0x5f180e={_0x399c2d:0x199},_0x1b057f={_0x285cc5:0x199},_0x2c4681={_0x333041:0x2a7,_0x12cd74:0x1be,_0xc996a5:0x1eb,_0x9981bc:0x26f,_0x4a17a6:0x1b7},_0x15e700={_0x2295ba:0x26f,_0x961d00:0x215,_0x5e6c46:0x17d},_0x39eb42={_0x40e905:0x26f},_0x108b1b={_0xab4018:0x2c8,_0x1896be:0x176,_0x3720d9:0x23d,_0x262acd:0x24e,_0x14f751:0x264,_0x3619f7:0x1e6},_0x1d8c7f={_0x969a9:0x1b0},_0x385e1a={_0x4140f0:0x267,_0x38d3aa:0x252,_0x291d0f:0x28e,_0x99ab9a:0x1fa,_0x56d54b:0x24e,_0x21ec49:0x205,_0x2acd1e:0x1bf,_0x4ac67d:0x205},_0x213117={_0xba3ebb:0x234},_0x2c6455={_0x318a6a:0x24f},_0x27cebb={_0x9bc7de:0x28e},_0xb1830b={_0x506fc8:0x1ce,_0x564903:0x294,_0x26e7b6:0x1d1},_0xfa35fc={_0xe27c7d:0x202},_0x40670f={_0x31f831:0x24c,_0x89e02f:0x187},_0xa98da6={_0x5a170c:0x232,_0xff50aa:0x23c,_0x28947c:0x23c,_0x246dbb:0x28b,_0x404799:0x284,_0x1e0582:0x28b,_0x32191f:0x28b,_0x354503:0x161},_0x4cf241={_0x509adc:0x1c0,_0x45ab2c:0x261,_0x402972:0x155,_0x438e7c:0x196,_0x2365d9:0x1d6},_0x3f1023={_0x35f49f:0x1f1},_0x7aca3f={_0x4ad78c:0x175,_0x330486:0x1ee,_0x4e5132:0x273,_0x2f8ac6:0x252,_0x511eba:0x27f,_0x242199:0x17c,_0x46d0e3:0x1ec,_0x4fe969:0x1bc,_0x1eae60:0x2c8,_0x3f3036:0x19a},_0x52735c={_0x43e579:0x258},_0x151506={_0x4b977c:0x2c8,_0x58e80d:0x188,_0x1fbb6b:0x283},_0x3d018c={_0x4f4cb3:0x2a3,_0xae0551:0x1aa,_0x217d65:0x2aa,_0x448d03:0x182},_0x2a9d5b={_0x1e2c85:0x289,_0x5b2ebc:0x177},_0x25f3ce={_0x1b8633:0x152},_0x2a4b05={_0x2af3c9:0x155,_0x3093fc:0x185,_0x47fd04:0x195,_0x14ee5a:0x155},_0x21c069={_0x192e11:0x1b0,_0x515f69:0x155,_0x514bca:0x258},_0x1c6799={_0x13b63b:0x15b,_0x596850:0x23f,_0x531b52:0x1d1},_0x4deb4c={_0x4cccb3:0x15a,_0x1c7f13:0x272},_0x4bc132={_0xb666b3:0x24d,_0x3dead8:0x1eb,_0x157441:0x2b6,_0x44c9bb:0x252},_0x18708c={_0x1ae74b:0x252,_0x5b356d:0x158,_0x2ee3d3:0x1ba},_0x33500e={_0x33dcf3:0x25b,_0x396bb0:0x252,_0x227392:0x2b6,_0x291efb:0x287,_0x2a09a5:0x176,_0x436704:0x17b,_0x5f5875:0x20b,_0x4b2402:0x200,_0x1a87d2:0x191,_0xe7e6d6:0x275,_0x2ae4a5:0x16c},_0x3c6737=_0xda21;let _0x51cb81=this;_0x51cb81['utils']={'getOptionsFirstFn':function(_0x1ab171){for(var _0x3d8d57 in _0x1ab171){var _0x5e747d=_0x1ab171[_0x3d8d57];if(_0x5e747d['constructor']['name'])return _0x5e747d;}},'callback':function(_0x1eae6a,_0x2ce7b1){var _0x52427e=_0xda21;return _0x1eae6a&&_0x52427e(0x2ab)===_0x1eae6a[_0x52427e(_0x2b846b._0x20bea3)]['name']&&_0x1eae6a[_0x52427e(0x195)](this,_0x2ce7b1);},'getBase64ByColors':function(_0x3cbec9){var _0x15cfd7=_0xda21;_0x3cbec9=_0x3cbec9||['rgba(226,\x20179,\x2024,\x200.6)','rgba(255,\x202,\x2020,\x200.6)'];var _0x5e5597=document[_0x15cfd7(_0x33500e._0x33dcf3)](_0x15cfd7(0x1eb));_0x5e5597[_0x15cfd7(_0x33500e._0x396bb0)]=0x5,_0x5e5597[_0x15cfd7(_0x33500e._0x227392)]=0x32;for(var _0xc2ac2d=_0x5e5597[_0x15cfd7(0x272)]('2d'),_0x5f062a=_0xc2ac2d['createLinearGradient'](0x32,0x5,0x0,0x5),_0x4f057a=_0x3cbec9[_0x15cfd7(0x211)],_0x535d8a=~~(0x1/_0x4f057a*0x64)/0x64,_0x25d7b2=0x0;_0x25d7b2<_0x4f057a;_0x25d7b2++){var _0x4c3d7a=_0x15cfd7(_0x33500e._0x291efb)===_0x3cbec9[_0x25d7b2][_0x15cfd7(_0x33500e._0x2a09a5)][_0x15cfd7(_0x33500e._0x436704)]&&_0x3cbec9[_0x25d7b2],_0x2832b5=_0x4c3d7a&&_0x4c3d7a[0x0]||_0x3cbec9[_0x25d7b2],_0x52b449=_0x4c3d7a&&_0x4c3d7a[0x1]||_0x25d7b2*_0x535d8a+~~!!_0x25d7b2*_0x535d8a;_0x5f062a['addColorStop'](_0x52b449,_0x2832b5);}return _0xc2ac2d[_0x15cfd7(_0x33500e._0x5f5875)]=_0x5f062a,_0xc2ac2d[_0x15cfd7(_0x33500e._0x4b2402)](0x0,0x0,0x32,0x5),_0xc2ac2d[_0x15cfd7(_0x33500e._0x1a87d2)](),_0x5e5597['toDataURL'](_0x15cfd7(_0x33500e._0xe7e6d6))[_0x15cfd7(_0x33500e._0x2ae4a5)](_0x15cfd7(_0x33500e._0xe7e6d6),_0x15cfd7(0x1a2));},'canvas':function(_0xbaee1b){var _0xbdf66f={_0x1bfa3f:0x2c4,_0x4f276d:0x2b6,_0x59adb2:0x252,_0x5e69f4:0x20b,_0x56a638:0x2bb},_0x28c5d3={_0x34508b:0x15c,_0x29672f:0x18d},_0x1024b3={_0x2af3c1:0x24d,_0x27a2e4:0x24d,_0x5397e1:0x2cd},_0x34a3ec=_0xda21,_0x372b5a=function(_0x3a9d12){var _0x1ec7fd=_0xda21;this['w']=_0x3a9d12[_0x1ec7fd(0x2b6)]||0x64,this['h']=_0x3a9d12[_0x1ec7fd(_0x18708c._0x1ae74b)]||0x1e,this[_0x1ec7fd(0x1fc)]=_0x3a9d12['fontX']||0x8,this['fontY']=_0x3a9d12[_0x1ec7fd(0x293)]||0x11,this[_0x1ec7fd(0x158)]=_0x3a9d12[_0x1ec7fd(_0x18708c._0x5b356d)],this['fontSize']=_0x3a9d12[_0x1ec7fd(_0x18708c._0x2ee3d3)]||0x14,this[_0x1ec7fd(0x1bd)]=_0x3a9d12['draw'],this[_0x1ec7fd(0x1d1)]=_0x3a9d12['color'];};return _0x372b5a[_0x34a3ec(0x1b0)]={'create':function(_0x4b2b60){var _0x1dd92e=_0x34a3ec;return this[_0x1dd92e(_0x4bc132._0xb666b3)]||(_0x4b2b60=this[_0x1dd92e(0x24d)]=document[_0x1dd92e(0x25b)](_0x1dd92e(_0x4bc132._0x3dead8))),_0x4b2b60[_0x1dd92e(_0x4bc132._0x157441)]=this['w'],_0x4b2b60[_0x1dd92e(_0x4bc132._0x44c9bb)]=this['h'],_0x4b2b60;},'getContext':function(){var _0x503eec=_0x34a3ec;return this['ctx']||(this[_0x503eec(0x2a0)]=this[_0x503eec(_0x4deb4c._0x4cccb3)]()[_0x503eec(_0x4deb4c._0x1c7f13)]('2d'));},'getImage':function(){var _0x4599bd=this,_0x35e746=new Image(this['w'],this['h']);return new Promise(function(_0x99603c,_0x27e1eb){var _0x1caa0d=_0xda21;return _0x4599bd[_0x1caa0d(0x158)]&&!_0x4599bd[_0x1caa0d(_0x1024b3._0x2af3c1)]?(_0x35e746[_0x1caa0d(0x158)]=_0x4599bd[_0x1caa0d(0x158)])&&(_0x35e746[_0x1caa0d(0x290)]=function(){return _0x99603c(_0x35e746);}):_0x35e746['src']=_0x4599bd[_0x1caa0d(_0x1024b3._0x27a2e4)]?_0x4599bd['cvs'][_0x1caa0d(_0x1024b3._0x5397e1)](_0x1caa0d(0x275)):'',_0x99603c(_0x35e746);});},'setContent':function(_0x24ee83){var _0x5ef8c4={_0x20189e:0x226,_0x3f6017:0x1bd,_0x4f7128:0x158,_0x10004b:0x1ba,_0x16984d:0x2c3,_0x672f4a:0x1e4,_0xd012f6:0x1ab,_0x43ae79:0x2b5},_0x353112=_0x34a3ec,_0x5c430f=this,_0x4396c4=_0x24ee83[_0x353112(_0x28c5d3._0x34508b)]||'',_0x30d5af=~~(_0x24ee83['x']||_0x5c430f[_0x353112(0x1fc)]),_0x47e057=~~(_0x24ee83['y']||_0x5c430f['fontY']),_0x68a434=function(){var _0x3a5ee4=_0x353112,_0x19dadf=_0x5c430f[_0x3a5ee4(0x272)]();return _0x19dadf[_0x3a5ee4(_0x5ef8c4._0x20189e)](0x0,0x0,_0x5c430f['w'],_0x5c430f['h']),_0x5c430f['draw']&&_0x5c430f[_0x3a5ee4(_0x5ef8c4._0x3f6017)](_0x19dadf),_0x5c430f[_0x3a5ee4(_0x5ef8c4._0x4f7128)]&&_0x19dadf['drawImage'](_0x5c430f[_0x3a5ee4(0x169)],0x0,0x0),_0x4396c4&&(_0x19dadf['fillStyle']=_0x24ee83[_0x3a5ee4(0x1d1)]||_0x5c430f[_0x3a5ee4(0x1d1)]||'rgb(255,\x20255,\x20255)',_0x19dadf['font']=_0x5c430f[_0x3a5ee4(_0x5ef8c4._0x10004b)]+_0x3a5ee4(0x216),_0x19dadf[_0x3a5ee4(0x1d4)]=_0x3a5ee4(_0x5ef8c4._0x16984d),_0x19dadf[_0x3a5ee4(_0x5ef8c4._0x672f4a)](_0x4396c4,_0x30d5af,_0x47e057)),_0x19dadf[_0x3a5ee4(_0x5ef8c4._0xd012f6)](),_0x5c430f[_0x3a5ee4(_0x5ef8c4._0x43ae79)]();};return _0x5c430f[_0x353112(0x169)]?_0x68a434():_0x5c430f[_0x353112(0x2b5)]()[_0x353112(_0x28c5d3._0x29672f)](function(_0x4bfd50){var _0x19ecc4=_0x353112;return _0x5c430f[_0x19ecc4(0x169)]=_0x4bfd50,_0x68a434();});},'drawLiner':function(_0x3fa200){var _0x2e5782=_0x34a3ec,_0x4f47a1=this[_0x2e5782(0x2a0)];_0x4f47a1[_0x2e5782(0x1a3)](),_0x4f47a1['moveTo'](_0x3fa200['sx'],_0x3fa200['sy']),_0x4f47a1[_0x2e5782(_0x1c6799._0x13b63b)](_0x3fa200['ex'],_0x3fa200['ey']),_0x4f47a1[_0x2e5782(_0x1c6799._0x596850)]=_0x3fa200['width'],_0x4f47a1[_0x2e5782(0x255)]=_0x3fa200[_0x2e5782(_0x1c6799._0x531b52)],_0x4f47a1[_0x2e5782(0x2bb)]();},'style1':function(_0x204203){var _0x5256cf=_0x34a3ec,_0x3839bd=this['ctx'],_0x25e390=_0x204203['color']||_0x5256cf(_0xbdf66f._0x1bfa3f);_0x3839bd[_0x5256cf(0x255)]=_0x25e390,_0x3839bd['beginPath'](),_0x3839bd[_0x5256cf(0x1e2)](0x0,0x1,_0x204203[_0x5256cf(_0xbdf66f._0x4f276d)],_0x204203[_0x5256cf(_0xbdf66f._0x59adb2)],_0x204203[_0x5256cf(0x1d5)]),_0x3839bd[_0x5256cf(_0xbdf66f._0x5e69f4)]=_0x204203[_0x5256cf(0x1e1)],_0x3839bd[_0x5256cf(0x157)](),_0x3839bd[_0x5256cf(_0xbdf66f._0x56a638)](),_0x3839bd[_0x5256cf(0x2c2)]([0x5,0x5,0x5]);var _0x54ee04=this['w']/0x2,_0x1c8e91=_0x204203[_0x5256cf(_0xbdf66f._0x59adb2)]+0x4,_0x685bd=this['h'];this[_0x5256cf(0x218)]({'sx':_0x54ee04,'sy':_0x1c8e91,'ex':_0x54ee04,'ey':_0x685bd,'width':0x2,'color':_0x25e390});}},new _0x372b5a(_0xbaee1b);}},_0x51cb81['prototype']={'init':function(_0x3577fc,_0x323be0){var _0x1e1916={_0x143558:0x156,_0x3e4174:0x258},_0x5e50ea={_0x117bbd:0x155,_0x224f12:0x17b},_0x4077cf=_0xda21,_0x452eeb=_0x772e16[_0x4077cf(_0x25f3ce._0x1b8633)]=_0x3577fc,_0x53a233={'createViewer':function(_0xba6eaa){var _0x4fde1d=_0x4077cf,_0x32f908=_0x51cb81[_0x4fde1d(0x155)]['callback'][_0x4fde1d(0x195)](_0x323be0,_0x323be0[this[_0x4fde1d(0x17b)]]);_0x452eeb['viewer']=new Cesium[(_0x4fde1d(0x19d))](_0x32f908['el'],_0x32f908[_0x4fde1d(0x2c6)]),_0xba6eaa();},'mounted':function(_0x160f31){var _0x39093e=_0x4077cf;_0x3577fc[_0x39093e(_0x21c069._0x192e11)](),_0x51cb81[_0x39093e(_0x21c069._0x515f69)]['callback'][_0x39093e(0x195)](_0x323be0,_0x323be0[this[_0x39093e(0x17b)]],_0x452eeb[_0x39093e(_0x21c069._0x514bca)]),_0x160f31();},'onload':function(_0x4e0d35){var _0x4056d7=_0x4077cf,_0x45a4a2=this;const _0x4427ae=new Cesium[(_0x4056d7(_0x1e1916._0x143558))]()['add'](_0x452eeb[_0x4056d7(_0x1e1916._0x3e4174)][_0x4056d7(0x25a)][_0x4056d7(0x251)]['tileLoadProgressEvent'],function(_0x4ecce6){var _0x11ff00=_0x4056d7;0x0===_0x4ecce6&&(_0x4427ae(),_0x51cb81[_0x11ff00(_0x5e50ea._0x117bbd)][_0x11ff00(0x185)][_0x11ff00(0x195)](_0x323be0,_0x323be0[_0x45a4a2[_0x11ff00(_0x5e50ea._0x224f12)]],_0x452eeb[_0x11ff00(0x258)]));});_0x4e0d35();}};qf['Async'][_0x4077cf(0x1e0)]['call'](_0x452eeb,_0x53a233,function(_0x265cd3,_0x5aa35c,_0x30875e){var _0x36d64b=_0x4077cf,_0x86ec9b=_0x323be0[_0x265cd3];_0x86ec9b&&(this[_0x36d64b(0x29a)]=_0x86ec9b)?_0x51cb81[_0x36d64b(0x155)][_0x36d64b(0x185)][_0x36d64b(0x195)](_0x5aa35c,_0x5aa35c,_0x30875e):_0x30875e();},function(){var _0x36248b=_0x4077cf;!this['isExist']&&_0x51cb81[_0x36248b(_0x2a4b05._0x2af3c9)][_0x36248b(_0x2a4b05._0x3093fc)][_0x36248b(_0x2a4b05._0x47fd04)](_0x323be0,_0x51cb81[_0x36248b(_0x2a4b05._0x14ee5a)][_0x36248b(0x268)](_0x323be0));}),this[_0x4077cf(0x1df)](_0x323be0);},'finish':function(_0x20423f){},'Assists':function(){var _0x211e65={_0x58c876:0x1a5,_0x2b3a73:0x1ef,_0x139930:0x1c8,_0x5eda30:0x222,_0xdcf41d:0x1f8},_0x100382={_0x3d0dd9:0x247,_0x7f14bc:0x24a},_0x3c34f8={_0x5c72b1:0x295,_0x3c5813:0x233,_0x581c19:0x25a,_0x4f1f76:0x251,_0x29ced2:0x25a},_0x18f915={_0x1f0878:0x289,_0x3e6943:0x244},_0x5f9090=_0xda21;return{'getLnglatToCartesian':function(_0x5c06de,_0x50a469){var _0x50e8a0=_0xda21,_0x2e251=this[_0x50e8a0(_0x2a9d5b._0x1e2c85)](_0x5c06de,_0x50a469);return Cesium[_0x50e8a0(0x175)][_0x50e8a0(_0x2a9d5b._0x5b2ebc)](_0x2e251);},'getLnglatToCartesian3':function(_0x437823,_0x21d7d){var _0x423b91=_0xda21;if(isNaN(_0x437823)||isNaN(_0x21d7d))return console[_0x423b91(_0x3d018c._0x4f4cb3)](_0x423b91(_0x3d018c._0xae0551),'color:#ff0000;',_0x423b91(_0x3d018c._0x217d65));var _0x587a77=_0x772e16[_0x423b91(0x152)]['viewer'],_0x389f7c=Cesium['Cartographic'][_0x423b91(0x15f)](_0x437823,_0x21d7d),_0x1a4bf0=_0x587a77['scene'][_0x423b91(0x251)][_0x423b91(0x27c)][_0x423b91(_0x3d018c._0x448d03)](_0x389f7c);return _0x587a77['scene'][_0x423b91(0x153)](_0x1a4bf0)||_0x1a4bf0;},'getLnglatToTeilPosition':function(_0x440427,_0x4e65d9){var _0x14d26e=_0xda21;for(var _0x39a202=this[_0x14d26e(_0x18f915._0x1f0878)](_0x440427,_0x4e65d9),_0x597417=new Cesium[(_0x14d26e(0x2bc))](_0x39a202,new Cesium[(_0x14d26e(0x1f1))](0x0,0x0,-0x1)),_0x4dd88b=_0x772e16[_0x14d26e(0x152)][_0x14d26e(0x258)]['scene'][_0x14d26e(0x193)](_0x597417),_0x171b30=0x0,_0xa02fd0=_0x4dd88b['length'];_0x171b30<_0xa02fd0;_0x171b30++){var _0x3a6e50=_0x4dd88b[_0x171b30];if(_0x3a6e50[_0x14d26e(0x244)]['content']&&_0x3a6e50[_0x14d26e(_0x18f915._0x3e6943)]['content'][_0x14d26e(0x219)])return _0x3a6e50['position'];}return _0x39a202;},'getEntityDynamicPosition':function(_0x5e4710){var _0x2deb7c=_0xda21;return _0x5e4710[_0x2deb7c(_0x151506._0x4b977c)][_0x2deb7c(_0x151506._0x58e80d)](_0x772e16[_0x2deb7c(0x152)]['viewer'][_0x2deb7c(0x151)][_0x2deb7c(_0x151506._0x1fbb6b)]);},'addRenderEvent':function(_0x2b1fc6,_0x277741){var _0x557fe2=_0xda21;_0x772e16[_0x557fe2(0x152)][_0x557fe2(_0x52735c._0x43e579)][_0x557fe2(0x25a)][_0x557fe2(0x1f5)][_0x557fe2(0x215)](_0x2b1fc6,_0x277741||this);},'removeRenderEvent':function(_0x570b6d,_0x1a3e77){var _0x2bb5e2=_0xda21;_0x772e16[_0x2bb5e2(0x152)]['viewer']['scene'][_0x2bb5e2(0x1f5)]['removeEventListener'](_0x570b6d,_0x1a3e77||this);},'getMoreCoordinate':function(_0x4e3196){var _0x547ce7=_0xda21,_0x5e2a63=_0x772e16[_0x547ce7(0x152)]['viewer']['camera'],_0x82ad48=Cesium[_0x547ce7(_0x7aca3f._0x4ad78c)][_0x547ce7(0x177)](_0x4e3196);return{[_0x547ce7(0x16f)]:Cesium['Math'][_0x547ce7(_0x7aca3f._0x330486)](_0x82ad48['longitude']),['latitude']:Cesium[_0x547ce7(_0x7aca3f._0x4e5132)][_0x547ce7(_0x7aca3f._0x330486)](_0x82ad48['latitude']),[_0x547ce7(_0x7aca3f._0x2f8ac6)]:_0x82ad48[_0x547ce7(_0x7aca3f._0x2f8ac6)],['viewerLng']:Cesium['Math']['toDegrees'](_0x5e2a63[_0x547ce7(_0x7aca3f._0x511eba)]['longitude']),[_0x547ce7(_0x7aca3f._0x242199)]:Cesium[_0x547ce7(0x273)]['toDegrees'](_0x5e2a63[_0x547ce7(0x27f)][_0x547ce7(_0x7aca3f._0x46d0e3)]),[_0x547ce7(0x2bf)]:_0x5e2a63[_0x547ce7(0x27f)]['height'],[_0x547ce7(0x2c1)]:_0x5e2a63[_0x547ce7(0x2c1)],[_0x547ce7(0x1bc)]:_0x5e2a63[_0x547ce7(_0x7aca3f._0x4fe969)],['roll']:_0x5e2a63[_0x547ce7(0x2b4)],[_0x547ce7(_0x7aca3f._0x1eae60)]:_0x4e3196,[_0x547ce7(_0x7aca3f._0x3f3036)]:_0x5e2a63[_0x547ce7(0x2c8)]};},'getScenePosition':function(_0x4d31fc,_0x444ab5){var _0x239654=_0xda21,_0x37a4d0,_0x50765b=_0x772e16[_0x239654(0x152)][_0x239654(0x258)];switch(~~_0x444ab5){case 0x0:_0x37a4d0=_0x50765b['scene'][_0x239654(_0x3c34f8._0x5c72b1)](_0x4d31fc);break;case 0x1:_0x37a4d0=_0x50765b[_0x239654(0x25a)][_0x239654(_0x3c34f8._0x3c5813)]['pickEllipsoid'](_0x4d31fc);break;case 0x2:_0x37a4d0=_0x50765b[_0x239654(_0x3c34f8._0x581c19)][_0x239654(_0x3c34f8._0x4f1f76)][_0x239654(0x2bd)](_0x50765b[_0x239654(_0x3c34f8._0x3c5813)][_0x239654(0x238)](_0x4d31fc),_0x50765b[_0x239654(_0x3c34f8._0x29ced2)]);}return _0x37a4d0;},'getEventMoreCoordinate':function(_0x16b129,_0x16c33){var _0x1d71ac=_0xda21;_0x772e16[_0x1d71ac(0x152)][_0x1d71ac(0x258)];var _0x48775c=_0x16c33?this[_0x1d71ac(_0x100382._0x3d0dd9)](_0x16b129,_0x16c33):this[_0x1d71ac(0x247)](_0x16b129)||this[_0x1d71ac(_0x100382._0x3d0dd9)](_0x16b129,0x1)||this['getScenePosition'](_0x16b129,0x2);return this[_0x1d71ac(_0x100382._0x7f14bc)](_0x48775c);},'materials':{'Wall':{0x1:{'Type':'Gradient','Image':_0x5f9090(_0x4cf241._0x509adc),'Source':_0x5f9090(_0x4cf241._0x45ab2c)},0x2:{'Type':_0x5f9090(0x235),'getImage':_0x51cb81[_0x5f9090(_0x4cf241._0x402972)][_0x5f9090(0x292)],'Source':'czm_material\x20czm_getMaterial(czm_materialInput\x20materialInput)\x0a{\x0a\x20\x20\x20\x20\x20czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x20\x20\x20\x20\x20vec2\x20st\x20=\x20materialInput.st;\x0a\x20\x20\x20\x20\x20vec4\x20colorImage\x20=\x20texture2D(image,\x20vec2(fract(st.t\x20-\x20time),\x20st.t));\x0a\x20\x20\x20\x20\x20material.alpha\x20=\x20colorImage.a;\x0a\x20\x20\x20\x20\x20material.diffuse\x20=\x20colorImage.rgb\x20*\x201.3\x20;\x0a\x20\x20\x20\x20\x20return\x20material;\x0a\x20}'},0x3:{'Type':_0x5f9090(_0x4cf241._0x438e7c),'Image':_0x5f9090(0x2a6),'Source':_0x5f9090(0x25f)},0x4:{'Type':_0x5f9090(0x277),'Image':_0x5f9090(0x1a6),'Source':'czm_material\x20czm_getMaterial(czm_materialInput\x20materialInput){\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09vec2\x20st\x20=\x20materialInput.st;\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09vec4\x20colorImage\x20=\x20texture2D(image,\x20vec2(fract(count*st.t\x20-\x20time),\x20fract(st.s)));\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09material.alpha\x20=\x20colorImage.a\x20*\x20color.a;\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09material.diffuse\x20=\x20\x201.5*\x20color.rgb;\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09return\x20material;\x0a\x09\x09\x09\x09\x09\x09\x09\x09}'}},'Wave':{0x1:{'Type':'WaveCircle','Source':'czm_material\x20czm_getMaterial(czm_materialInput\x20materialInput){czm_material\x20material\x20=\x20czm_getDefaultMaterial(materialInput);material.diffuse\x20=\x201.5\x20*\x20color.rgb;vec2\x20st\x20=\x20materialInput.st;vec3\x20str\x20=\x20materialInput.str;float\x20dis\x20=\x20distance(st,\x20vec2(0.5,\x200.5));float\x20per\x20=\x20fract(time);if\x20(abs(str.z)\x20>\x200.001)\x20{discard;}if(dis\x20>\x200.5){discard;}\x20else\x20{float\x20perDis\x20=\x200.5\x20/\x20count;float\x20disNum;float\x20bl\x20=\x20.0;for\x20(int\x20i\x20=\x200;\x20i\x20<=\x20999;\x20i++)\x20{if\x20(float(i)\x20<=\x20count)\x20{disNum\x20=\x20perDis\x20*float(i)\x20-\x20dis\x20+\x20per\x20/\x20count;if\x20(disNum\x20>\x200.0)\x20{if\x20(disNum\x20<\x20perDis)\x20{bl\x20=\x201.0\x20-\x20disNum\x20/\x20perDis;}else\x20if(disNum\x20-\x20perDis\x20<\x20perDis)\x20{bl\x20=\x201.0\x20-\x20abs(1.0\x20-\x20disNum\x20/\x20perDis);}material.alpha\x20=\x20pow(bl,\x20gradient);}}}}return\x20material;}'}},'Polyline':{0x0:{'Type':_0x5f9090(0x23e),'Source':_0x5f9090(_0x4cf241._0x2365d9)}},'RadarRipple':function(_0x2e7981){var _0x28f84e=_0x5f9090;return{'Type':'RadarRipple','Source':_0x28f84e(_0x211e65._0x58c876)+(_0x2e7981['trailing']||_0x28f84e(_0x211e65._0x2b3a73))+_0x28f84e(_0x211e65._0x139930)+(_0x2e7981['density']||_0x28f84e(_0x211e65._0x5eda30))+')*.5+'+(_0x2e7981[_0x28f84e(_0x211e65._0xdcf41d)]||'0.5')+_0x28f84e(0x1e8)};}},'pathSlice':function(_0x58d502,_0x4b8bb4,_0x22bbd3){var _0x508be5=_0x5f9090;_0x22bbd3=_0x4b8bb4?_0x22bbd3||0xa:0x0;var _0xb4ca4c=new Array(_0x22bbd3);for(let _0x62cd4d=0x0;_0x62cd4d<_0x22bbd3;++_0x62cd4d){var _0x2578b6=_0x62cd4d/(_0x22bbd3-0x1);_0xb4ca4c[_0x62cd4d]=Cesium[_0x508be5(_0x3f1023._0x35f49f)][_0x508be5(0x21d)](_0x58d502,_0x4b8bb4,_0x2578b6,new Cesium[(_0x508be5(0x1f1))]());}return _0xb4ca4c;}};},'structures':{'Material':function(_0x53583d,_0x8f6a17){var _0x1e8bf2={_0x469185:0x163,_0xd4d5ff:0x194,_0x21c5f7:0x232,_0x43b900:0x280,_0x4ae8a4:0x1d1,_0x5cfc69:0x180,_0x454cec:0x161,_0x23fbfb:0x22c,_0x415b95:0x22c,_0x10f0f5:0x23c,_0x296fad:0x28b},_0x218143=_0xda21,_0x3ae2c8=function(_0x32b7fc,_0x4639e0){var _0x55949b=_0xda21;_0x4639e0=Cesium[_0x55949b(0x284)](_0x4639e0,Cesium['defaultValue'][_0x55949b(0x206)]),this[_0x55949b(0x202)]=new Cesium['Event'](),this[_0x55949b(_0xa98da6._0x5a170c)]=void 0x0,this['_colorSubscription']=void 0x0,this[_0x55949b(0x1d1)]=_0x4639e0['color'],this[_0x55949b(0x22c)]=_0x4639e0['duration'],this[_0x55949b(0x23c)]=Cesium[_0x55949b(0x284)](_0x4639e0[_0x55949b(_0xa98da6._0xff50aa)],0x2),this[_0x55949b(0x23c)]<=0x0&&(this[_0x55949b(_0xa98da6._0x28947c)]=0x1),this[_0x55949b(_0xa98da6._0x246dbb)]=Cesium[_0x55949b(_0xa98da6._0x404799)](_0x4639e0[_0x55949b(_0xa98da6._0x1e0582)],0.1),this['gradient']<0x0?this[_0x55949b(0x28b)]=0x0:0x1<this[_0x55949b(_0xa98da6._0x32191f)]&&(this['gradient']=0x1),this[_0x55949b(_0xa98da6._0x354503)]=new Date()[_0x55949b(0x1d8)](),this[_0x55949b(0x1a8)]=_0x32b7fc;};return _0x3ae2c8[_0x218143(0x1b0)]={'getType':function(){return this['type'];},'getValue':function(_0x1fe513,_0x1050cc){var _0xda446f=_0x218143;return Cesium[_0xda446f(_0x1e8bf2._0x469185)](_0x1050cc)||(_0x1050cc={}),_0x1050cc['color']=Cesium[_0xda446f(_0x1e8bf2._0xd4d5ff)][_0xda446f(0x162)](this[_0xda446f(_0x1e8bf2._0x21c5f7)],_0x1fe513,Cesium['Color'][_0xda446f(_0x1e8bf2._0x43b900)],_0x1050cc[_0xda446f(_0x1e8bf2._0x4ae8a4)]),_0x8f6a17[_0xda446f(_0x1e8bf2._0x5cfc69)]&&(_0x1050cc[_0xda446f(_0x1e8bf2._0x5cfc69)]=_0x8f6a17[_0xda446f(0x180)]),this[_0xda446f(0x22c)]&&(_0x1050cc['time']=(new Date()[_0xda446f(0x1d8)]()-this[_0xda446f(_0x1e8bf2._0x454cec)])%this[_0xda446f(_0x1e8bf2._0x23fbfb)]/this[_0xda446f(_0x1e8bf2._0x415b95)]),_0x1050cc[_0xda446f(0x23c)]=this[_0xda446f(_0x1e8bf2._0x10f0f5)],_0x1050cc[_0xda446f(_0x1e8bf2._0x296fad)]=_0x1050cc[_0xda446f(0x28b)]||0x0,_0x1050cc;},'equals':function(_0xc36ef4){return this===_0xc36ef4||_0xc36ef4 instanceof _0x3ae2c8&&!0x1;},'add':function(_0x4d6ac4){var _0x3a7229=_0x218143;Cesium[_0x3a7229(_0x40670f._0x31f831)][_0x3a7229(_0x40670f._0x89e02f)][_0x3a7229(0x270)](this['type'],_0x4d6ac4);}},Object[_0x218143(_0xb1830b._0x506fc8)](_0x3ae2c8[_0x218143(0x1b0)],{'isConstant':{'get':function(){return!0x1;}},'definitionChanged':{'get':function(){var _0x5122cb=_0x218143;return this[_0x5122cb(_0xfa35fc._0xe27c7d)];}},'color':Cesium[_0x218143(_0xb1830b._0x564903)](_0x218143(_0xb1830b._0x26e7b6))}),new _0x3ae2c8(_0x53583d,_0x8f6a17);},'Entitys':function(){var _0x462f25={_0x645bf1:0x25c,_0x432e9f:0x176,_0x15e31b:0x17b,_0x2a25bf:0x24c,_0x3cf170:0x2b0},_0x42befa=_0xda21,_0x1ee0ad=_0x772e16[_0x42befa(_0x27cebb._0x9bc7de)],_0x1a4f4c=function(){};return _0x1a4f4c['prototype']={'Wall':function(_0x5c0acc,_0x418471){var _0x4b044c=_0x42befa,_0x23fe66=_0x51cb81[_0x4b044c(0x1b1)][_0x4b044c(_0x462f25._0x645bf1)][this[_0x4b044c(_0x462f25._0x432e9f)][_0x4b044c(_0x462f25._0x15e31b)]][_0x5c0acc],_0xa54314=_0x418471[_0x4b044c(0x180)]||_0x23fe66[_0x4b044c(0x208)]||_0x23fe66['getImage'](_0x418471[_0x4b044c(0x2c7)])||void 0x0,_0x1c3f3d=new _0x1ee0ad[(_0x4b044c(_0x462f25._0x2a25bf))](_0x23fe66[_0x4b044c(_0x462f25._0x3cf170)],_0x418471);return _0x1c3f3d['add']({'fabric':{'uniforms':{'color':new Cesium[(_0x4b044c(0x24e))](0x1,0x0,0x0,0.5),'image':_0xa54314,'time':0x0,'count':0x1},'source':_0x23fe66['Source']},'translucent':function(_0x285d5a){return!0x0;}}),_0x1c3f3d;}},new _0x1a4f4c();},'entities':{'Billboard':function(_0x1ddc4f,_0x5763ba){var _0x7b6c57={_0x2aac36:0x1d1},_0x2ea2cf={_0x2f691a:0x18f,_0x5ccf49:0x1b8},_0x5eaa64={_0x185330:0x2cc,_0x51bf82:0x1f0,_0x3c2bfc:0x243,_0x15a659:0x165},_0x1abcec=_0xda21,_0x5adfc1=new _0x51cb81['utils'][(_0x1abcec(0x1eb))](_0x5763ba),_0x1b7ef1=function(_0x45415d,_0x3617b4){var _0x250288=_0x1abcec,_0x176f01=this,_0x300ce3=_0x250288(_0x2ea2cf._0x2f691a),_0x10f2a5=_0x3617b4[_0x250288(_0x2ea2cf._0x5ccf49)]||[0x0,0x0];_0x5adfc1[_0x250288(0x24b)]({'text':_0x3617b4[_0x250288(0x15c)]})[_0x250288(0x18d)](function(_0x1c15f3){var _0x3634ff=_0x250288;_0x176f01[_0x3634ff(0x19f)]=_0x772e16[_0x3634ff(0x152)]['Entity'][_0x3634ff(0x15a)]({'position':_0x1ddc4f,'billboard':{'image':_0x1c15f3,'heightReference':_0x3617b4[_0x3634ff(_0x5eaa64._0x185330)]||0x0,'verticalOrigin':Cesium[_0x3634ff(0x168)][_0x3634ff(_0x5eaa64._0x51bf82)],'pixelOffset':new Cesium[(_0x3634ff(_0x5eaa64._0x3c2bfc))](~~_0x10f2a5[0x0],~~_0x10f2a5[0x1]),'scale':_0x3617b4['scale']||0x1,'scaleByDistance':_0x3617b4[_0x3634ff(_0x5eaa64._0x15a659)],[_0x300ce3]:_0x3617b4[_0x300ce3]||new Cesium[(_0x3634ff(0x20e))](0x0,0xbb8),'disableDepthTestDistance':0x5dc},'show':_0x3617b4[_0x3634ff(0x1f3)]});}),_0x3617b4[_0x250288(0x185)]&&_0x3617b4[_0x250288(0x185)]();};return _0x1b7ef1[_0x1abcec(0x1b0)]={'updateText':function(_0x4ba2ef){var _0x16a181={_0x11cde9:0x19f,_0x36b916:0x180},_0xfb28ac=_0x1abcec,_0x4fc59a=this;_0x5adfc1[_0xfb28ac(0x24b)]({'text':_0x4ba2ef['text'],'color':_0x4ba2ef[_0xfb28ac(_0x7b6c57._0x2aac36)]})['then'](function(_0x5151e2){var _0x44349e=_0xfb28ac;_0x4fc59a[_0x44349e(_0x16a181._0x11cde9)][_0x44349e(0x269)][_0x44349e(_0x16a181._0x36b916)]=_0x5151e2;});},'setStyle1':function(_0x5b2663){var _0x56f078=_0x1abcec;_0x5adfc1[_0x56f078(_0x2c6455._0x318a6a)](_0x5b2663);}},new _0x1b7ef1(_0x1ddc4f,_0x5763ba);}}}};const _0x772e16=new _0x51cb81();var _0x2d9061,_0x4e0b60,_0x2d8930,_0x57c963=function(){var _0x5a8d70=_0xda21;_0x51cb81[_0x5a8d70(0x1b1)]=_0x772e16[_0x5a8d70(_0x199695._0x2282bc)]();};return _0x57c963[_0x3c6737(_0x67880e._0xfb1c98)]={'init':function(_0x234a61){var _0x3614c0=_0x3c6737;_0x234a61=_0x3614c0(_0x37d862._0x580a71)===_0x234a61[_0x3614c0(_0x37d862._0x2461fa)][_0x3614c0(0x17b)]?_0x234a61:{};var _0x914da=_0x914da||_0x28e2b5[_0x3614c0(0x154)];return _0x914da?(_0x772e16[_0x3614c0(0x229)](this,_0x234a61),_0x234a61):console[_0x3614c0(_0x37d862._0x1404b8)]('%c\x20%s',_0x3614c0(_0x37d862._0x3763ed),_0x3614c0(0x25d));},'prototype':function(){var _0x1b2434={_0x21e6ce:0x25a,_0x39c36d:0x2a2,_0xa11387:0x1dd,_0x2ab85c:0x296,_0x3217f6:0x23b},_0x183df4={_0x3012db:0x176,_0x32f3ce:0x1b1,_0x5872a5:0x28e,_0x2f8584:0x24c,_0x3e8858:0x2b0},_0x7ead4d={_0x447caa:0x2c8,_0x483bb9:0x1b1,_0xf5393d:0x25c,_0x323d7c:0x28e,_0x29bcf2:0x2b0,_0x527779:0x23d,_0x418d3a:0x22c,_0x1a285f:0x264,_0x4fd02e:0x2c8},_0x2579db={_0x4af7f9:0x1a8,_0x40b2bb:0x257},_0x26130c={_0x420618:0x23d,_0x3f0603:0x15a,_0x18e08f:0x267,_0xe0ae4c:0x18c},_0x3df1bd={_0x3c2722:0x1b0},_0xc542bc={_0xaa57d7:0x203,_0x3f0670:0x1af},_0x4edb51={_0x4a1993:0x1af,_0x3f06e9:0x16a,_0x588be2:0x1e7,_0x3d767b:0x2c6,_0x24dfcf:0x166},_0x2be250={_0x53442a:0x231,_0x41b56b:0x211,_0x393b22:0x236,_0xafd3b5:0x28d,_0x5c25ec:0x180,_0x5a395c:0x2c8,_0x3385c9:0x1f4,_0x1443af:0x2c8,_0x4978c4:0x1fe,_0x554f9c:0x2c8,_0x23bc7b:0x173,_0x3a2da5:0x21b,_0x3c092f:0x2b1},_0x526166={_0x2549dc:0x288},_0x4b8aef={_0x20d194:0x1b0},_0x2ebfb6={_0x127842:0x281},_0x519b43={_0x404e5d:0x227,_0x2cdbe7:0x1d7,_0x27bb8b:0x248,_0x963402:0x237,_0x4acd0f:0x1b4,_0x160db6:0x1c1},_0x4cbb75={_0x5d4134:0x16b,_0x47e8ca:0x201},_0x2695a2={_0x34d45c:0x24e,_0x11d242:0x28b,_0x1a1d86:0x2a4,_0x337429:0x281,_0x38aa7d:0x28a,_0x26267d:0x259},_0x29a244={_0x447c9d:0x18e},_0x1b9b5e={_0xc919af:0x264},_0x4a3f2d={_0x352657:0x264},_0x53a8b6=_0x3c6737,_0x5b99bf,_0x326518,_0x54293e,_0x16d833,_0x3659d5,_0x16d41d=this,_0x5efa06=this[_0x53a8b6(_0x3fb6da._0x2456ac)],_0x4f473a=this[_0x53a8b6(_0x3fb6da._0xe498b)],_0x2384aa=function(){var _0x3ea2f5=_0x53a8b6;delete _0x4f473a[_0x3ea2f5(0x1b0)];};_0x2384aa[_0x53a8b6(_0x3fb6da._0x41b3bf)]={'Entity':((_0x3659d5=function(){})[_0x53a8b6(0x1b0)]={'create':function(_0x192075){var _0x5849eb=_0x53a8b6;return _0x192075&&_0x5efa06[_0x5849eb(0x264)][_0x5849eb(0x1e6)](_0x192075);},'remove':function(_0x455a8a){var _0x235e37=_0x53a8b6;_0x455a8a&&_0x5efa06[_0x235e37(_0x4a3f2d._0x352657)][_0x235e37(0x234)](_0x455a8a);},'removes':function(_0x1a80f8){var _0x3e049b=_0x53a8b6;for(var _0x59c41e of _0x1a80f8)this[_0x3e049b(_0x213117._0xba3ebb)](_0x59c41e);},'removeAll':function(){var _0x4aedc3=_0x53a8b6;_0x5efa06[_0x4aedc3(_0x1b9b5e._0xc919af)]['removeAll']();}},new _0x3659d5()),'Entities':{'Billboard':function(_0x50edb1,_0x450fa9){var _0x442f2f=_0x53a8b6;return new _0x772e16['structures']['entities'][(_0x442f2f(_0x29a244._0x447c9d))](_0x50edb1,_0x450fa9);},'BuildingShader':function(_0x482bd7,_0x55ff36){var _0x2b869c={_0x35b97b:0x24e,_0x3bcbea:0x28b,_0x28724c:0x2b7,_0x2df2ba:0x160,_0xbd6573:0x1ad,_0x1e295c:0x2c4,_0x36bb9b:0x1e9,_0x31ee11:0x1a9,_0x8e56b9:0x1db,_0x13fb75:0x298,_0x3eaea9:0x197,_0x412a2e:0x25e},_0x850593={_0x4a1970:0x265,_0x527b86:0x2af,_0x3170e1:0x2c5},_0x506605=_0x53a8b6,_0x2a3404=function(_0x56ad0f){var _0x35069f=_0xda21;this[_0x35069f(0x24e)]=_0x56ad0f[_0x35069f(0x1d1)];var _0x31038d=this['colorToString'](this[_0x35069f(_0x2695a2._0x34d45c)]),_0x198787=this['transparent']=_0x56ad0f[_0x35069f(0x197)];this[_0x35069f(0x1ae)]=_0x56ad0f[_0x35069f(0x1ae)],this[_0x35069f(0x21a)]=_0x56ad0f['glowRange'],this[_0x35069f(_0x2695a2._0x11d242)]=_0x56ad0f[_0x35069f(0x28b)],this[_0x35069f(0x2a4)]=_0x56ad0f[_0x35069f(_0x2695a2._0x1a1d86)]||'100.0',this[_0x35069f(_0x2695a2._0x337429)]=_0x56ad0f['shader']||this[_0x35069f(0x239)](_0x31038d||_0x35069f(0x213)),_0x482bd7[_0x35069f(_0x2695a2._0x38aa7d)][_0x35069f(0x215)](this[_0x35069f(0x1ff)],this),_0x198787&&(_0x482bd7[_0x35069f(0x20d)]=new Cesium[(_0x35069f(_0x2695a2._0x26267d))]({'color':_0x35069f(0x214)+_0x31038d+')'}));};return _0x2a3404[_0x506605(_0x4b8aef._0x20d194)]={'colorToString':function(_0x5abceb){var _0x2dd136=_0x506605;return _0x5abceb[_0x2dd136(0x22a)]()[_0x2dd136(0x16c)](/\(|\)/g,'');},'tileVisibleEventHandler':function(_0x4dbaa9){var _0x42fef9={_0x5514d7:0x2af},_0x1d33ea=_0x506605;for(var _0x176a54=this,_0xcfb2d0=_0x4dbaa9[_0x1d33ea(_0x4cbb75._0x5d4134)],_0x3cad98=_0xcfb2d0[_0x1d33ea(_0x4cbb75._0x47e8ca)],_0x57d5ef=0x0;_0x57d5ef<_0x3cad98;_0x57d5ef+=0x2)!(function(){var _0x50feb7=_0x1d33ea,_0x4f336f=_0xcfb2d0[_0x50feb7(_0x850593._0x4a1970)](_0x57d5ef)[_0x50feb7(0x16b)][_0x50feb7(0x1dc)];_0x4f336f&&_0x4f336f['_sourcePrograms']&&_0x4f336f[_0x50feb7(_0x850593._0x527b86)]&&(Object[_0x50feb7(_0x850593._0x3170e1)](_0x4f336f['_sourcePrograms'])['forEach'](function(_0x529054){var _0x336aa4=_0x50feb7,_0x8c1370=_0x4f336f[_0x336aa4(0x22f)][_0x529054];_0x4f336f[_0x336aa4(_0x42fef9._0x5514d7)][_0x336aa4(0x21e)][_0x8c1370['fragmentShader']]=_0x176a54[_0x336aa4(0x281)];}),_0x4f336f['_shouldRegenerateShaders']=!0x0);}());},'getShader':function(_0x240c71){var _0x452829=_0x506605,_0x218d14=_0x452829(_0x519b43._0x404e5d),_0x53a6de=this[_0x452829(_0x519b43._0x2cdbe7)](_0x240c71);return this[_0x452829(0x21a)]?'\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09varying\x20vec3\x20v_positionEC;\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09void\x20main(void){\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09'+_0x218d14+_0x452829(_0x519b43._0x27bb8b)+_0x53a6de+_0x452829(_0x519b43._0x963402)+this['glowRangeHeight']+_0x452829(_0x519b43._0x4acd0f):_0x452829(_0x519b43._0x160db6)+_0x218d14+_0x452829(0x1cb)+_0x53a6de+_0x452829(0x1cf);},'getGLFragColor':function(_0x498d21){var _0x36ae1c=_0x506605,_0x45d632=this[_0x36ae1c(_0x2b869c._0x35b97b)],_0x54cd42=this[_0x36ae1c(_0x2b869c._0x3bcbea)]?_0x36ae1c(_0x2b869c._0x28724c):_0x36ae1c(_0x2b869c._0x2df2ba);return'\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09float\x20stc_sd\x20=\x20'+_0x54cd42+_0x36ae1c(0x263)+(_0x36ae1c(_0x2b869c._0xbd6573)+_0x498d21+');')+_0x36ae1c(0x1c5)+_0x45d632[_0x36ae1c(_0x2b869c._0x1e295c)]+_0x36ae1c(_0x2b869c._0x36bb9b)+_0x45d632[_0x36ae1c(_0x2b869c._0x31ee11)]+_0x36ae1c(0x28f)+_0x45d632['blue']+_0x36ae1c(_0x2b869c._0x8e56b9)+_0x45d632[_0x36ae1c(_0x2b869c._0x13fb75)]+_0x36ae1c(0x228)+(this[_0x36ae1c(_0x2b869c._0x3eaea9)]?'':_0x36ae1c(0x1fd)+_0x54cd42+_0x36ae1c(_0x2b869c._0x412a2e));},'setColor':function(_0x59bc22){var _0x5bb770=_0x506605;_0x59bc22&&(this[_0x5bb770(_0x2ebfb6._0x127842)]=this[_0x5bb770(0x239)](this['colorToString'](this[_0x5bb770(0x24e)]=_0x59bc22)));}},new _0x2a3404(_0x55ff36);},'ClusterPoint':function(_0x66f663,_0x44937b){var _0x2c1d54={_0x437ffc:0x15e,_0xca88c5:0x1f2},_0x56752c={_0x13a6ea:0x169,_0x3b355e:0x22b},_0x338b2c=_0x53a8b6,_0x27c1d0=function(){var _0x146d5e=_0xda21,_0x30ab6e=this;this[_0x146d5e(0x2c6)]=_0x44937b,this['DataLoadedEvent']=new Cesium[(_0x146d5e(0x21c))]();var _0x558237=new Image();_0x558237[_0x146d5e(0x158)]=_0x30ab6e[_0x146d5e(0x2c6)][_0x146d5e(_0x526166._0x2549dc)],_0x558237[_0x146d5e(0x290)]=function(){var _0x1dcdc7=_0x146d5e;_0x30ab6e[_0x1dcdc7(_0x56752c._0x13a6ea)]=_0x558237,_0x30ab6e[_0x1dcdc7(_0x56752c._0x3b355e)](_0x66f663,_0x44937b[_0x1dcdc7(0x22e)]||{});};};return _0x27c1d0[_0x338b2c(_0x3df1bd._0x3c2722)]={'createEntitys':function(_0x5df429,_0x2adcf7){var _0x1e7cb2=_0x338b2c;for(var _0x10d90d=new Cesium[(_0x1e7cb2(_0x2be250._0x53442a))](),_0x267e20=this['options'][_0x1e7cb2(0x24e)],_0x72df43=0x0,_0x116b21=_0x5df429[_0x1e7cb2(_0x2be250._0x41b56b)];_0x72df43<_0x116b21;_0x72df43++){var _0x173b41=_0x5df429[_0x72df43],_0x3cf361=_0x10d90d[_0x1e7cb2(0x230)][_0x1e7cb2(_0x2be250._0x393b22)](Cesium[_0x1e7cb2(_0x2be250._0xafd3b5)]()),_0x36e3d3=new Cesium['BillboardGraphics'](),_0x453423=_0x10d90d[_0x1e7cb2(0x186)][_0x1e7cb2(0x1c3)](_0x267e20,0x30);_0x36e3d3[_0x1e7cb2(_0x2be250._0x5c25ec)]=_0x453423,_0x3cf361[_0x1e7cb2(0x269)]=_0x36e3d3,_0x3cf361[_0x1e7cb2(_0x2be250._0x5a395c)]=new Cesium[(_0x1e7cb2(_0x2be250._0x3385c9))](_0x173b41[_0x1e7cb2(_0x2be250._0x1443af)]);var _0x6dc4bb={'text':_0x173b41[_0x2adcf7[_0x1e7cb2(_0x2be250._0x4978c4)]],'position':_0x173b41[_0x1e7cb2(_0x2be250._0x554f9c)]};_0x3cf361[_0x1e7cb2(_0x2be250._0x23bc7b)]=new Cesium['LabelGraphics'](Object['assign'](_0x2adcf7,_0x6dc4bb)),_0x3cf361[_0x1e7cb2(_0x2be250._0x3a2da5)]=_0x173b41;}this[_0x1e7cb2(_0x2be250._0x3c092f)](_0x10d90d);},'addDatasource':function(_0x33e88b){var _0x16a615={_0x2d0c55:0x169},_0x1e37e9=_0x338b2c,_0x3a8e74=this,_0x98248b=_0x33e88b[_0x1e37e9(0x15e)];_0x3a8e74[_0x1e37e9(_0x4edb51._0x4a1993)]=_0x33e88b,_0x5efa06[_0x1e37e9(0x203)]['add'](_0x33e88b),_0x3a8e74[_0x1e37e9(_0x4edb51._0x3f06e9)][_0x1e37e9(0x282)](_0x33e88b),_0x98248b[_0x1e37e9(0x184)]=!0x0,_0x98248b[_0x1e37e9(_0x4edb51._0x588be2)]=_0x3a8e74['options']['pixelRange'],_0x98248b['minimumClusterSize']=_0x3a8e74[_0x1e37e9(_0x4edb51._0x3d767b)][_0x1e37e9(0x19c)],_0x33e88b['entities'][_0x1e37e9(0x27a)][_0x1e37e9(0x1f6)](function(_0x300ab1){var _0x27a707=_0x1e37e9;_0x300ab1['billboard']['image']=_0x3a8e74[_0x27a707(_0x16a615._0x2d0c55)],_0x300ab1['type']='cluster';}),_0x3a8e74[_0x1e37e9(_0x4edb51._0x24dfcf)](_0x33e88b);},'setClusterEvent':function(_0x2d3006){var _0x16cf2d={_0x1b530a:0x1f3,_0x1387cb:0x211,_0x1eeb85:0x180,_0x2b6f88:0x2c6,_0xe344ec:0x2c6,_0x5960a2:0x285,_0x5337c0:0x2c6,_0x5d99c0:0x212},_0x296cb0=_0x338b2c,_0x6fec5f=this;this[_0x296cb0(0x1b3)]=_0x2d3006[_0x296cb0(_0x2c1d54._0x437ffc)][_0x296cb0(_0x2c1d54._0xca88c5)][_0x296cb0(0x215)](function(_0xaa98dc,_0x3d827c){var _0x5c42c9=_0x296cb0,_0x4bb3bf=_0x3d827c[_0x5c42c9(0x269)];_0x4bb3bf[_0x5c42c9(0x1f3)]=!0x0,_0x3d827c[_0x5c42c9(0x173)][_0x5c42c9(_0x16cf2d._0x1b530a)]=!0x1,0x12c<=_0xaa98dc[_0x5c42c9(_0x16cf2d._0x1387cb)]?_0x4bb3bf[_0x5c42c9(_0x16cf2d._0x1eeb85)]=_0x6fec5f[_0x5c42c9(_0x16cf2d._0x2b6f88)]['clusterImage']+'/300+.png':0x96<=_0xaa98dc['length']?_0x4bb3bf['image']=_0x6fec5f[_0x5c42c9(_0x16cf2d._0xe344ec)]['clusterImage']+_0x5c42c9(0x279):0x5a<=_0xaa98dc['length']?_0x4bb3bf[_0x5c42c9(0x180)]=_0x6fec5f[_0x5c42c9(_0x16cf2d._0x2b6f88)][_0x5c42c9(0x266)]+_0x5c42c9(_0x16cf2d._0x5960a2):0x1e<=_0xaa98dc[_0x5c42c9(_0x16cf2d._0x1387cb)]?_0x4bb3bf[_0x5c42c9(0x180)]=_0x6fec5f[_0x5c42c9(_0x16cf2d._0x5337c0)]['clusterImage']+_0x5c42c9(0x207):0xa<_0xaa98dc[_0x5c42c9(_0x16cf2d._0x1387cb)]?_0x4bb3bf[_0x5c42c9(0x180)]=_0x6fec5f[_0x5c42c9(0x2c6)]['clusterImage']+_0x5c42c9(0x1c9):_0x4bb3bf[_0x5c42c9(0x180)]=_0x6fec5f['options']['clusterImage']+'/'+_0xaa98dc[_0x5c42c9(0x211)]+_0x5c42c9(_0x16cf2d._0x5d99c0);});},'remove':function(_0x2c4b24){var _0x2dbebf=_0x338b2c;_0x5efa06[_0x2dbebf(_0xc542bc._0xaa57d7)][_0x2dbebf(0x1e6)](this[_0x2dbebf(_0xc542bc._0x3f0670)]);}},new _0x27c1d0();}},'Materials':(_0x54293e={'Gradient':0x1,'LinearGradient':0x2,'LinearFlow':0x3,'Scroll':0x4,'Polyline':{'TransLine':0x0}},_0x16d833=function(){},_0x16d833[_0x53a8b6(_0x3fb6da._0x41b3bf)]={'Wall':function(_0x2b2e51,_0x1d8083){var _0x248677={_0x5eed04:0x178},_0x49daf1=_0x53a8b6;_0x2b2e51=_0x2b2e51||0x1;var _0x7983fb=function(_0x38ee83,_0x347ce8,_0x507b0b){var _0x21c2b0=_0xda21;return _0x16d41d[_0x21c2b0(0x23d)][_0x21c2b0(0x15a)]({'wall':{'positions':_0x38ee83,'minimumHeights':_0x347ce8[_0x21c2b0(_0x248677._0x5eed04)],'maximumHeights':_0x347ce8['end'],'material':_0x507b0b}});},_0x20961f=(_0x1d8083=_0x1d8083||{})[_0x49daf1(_0x385e1a._0x4140f0)]||[],_0x4d7cbe=function(_0x1d2f25,_0x2de73e){var _0x14728d={_0x21a178:0x175,_0x306276:0x177,_0x4cc27b:0x252},_0x1ec49b=_0x49daf1,_0x178203=[],_0x21defe=[];return _0x2de73e[_0x1ec49b(0x1f6)](function(_0x272a44){var _0x5d0f2e=_0x1ec49b;_0x272a44=Cesium[_0x5d0f2e(_0x14728d._0x21a178)][_0x5d0f2e(_0x14728d._0x306276)](_0x272a44),_0x178203['push'](_0x272a44[_0x5d0f2e(_0x14728d._0x4cc27b)]),_0x21defe['push'](_0x272a44['height']+_0x1d2f25);}),{'start':_0x178203,'end':_0x21defe};}(_0x1d8083[_0x49daf1(_0x385e1a._0x38d3aa)]||0xc8,_0x20961f),_0x201249=new _0x772e16[(_0x49daf1(_0x385e1a._0x291d0f))][(_0x49daf1(_0x385e1a._0x99ab9a))]();if(_0x2b2e51===_0x54293e[_0x49daf1(0x274)]){let _0x265de0=new _0x201249[(_0x49daf1(0x205))](_0x2b2e51,{'color':_0x1d8083['color']||Cesium[_0x49daf1(_0x385e1a._0x56d54b)]['RED'],'duration':_0x1d8083['duration']||0x3e8});return _0x7983fb(_0x20961f,_0x4d7cbe,_0x265de0),_0x265de0=new _0x201249[(_0x49daf1(_0x385e1a._0x21ec49))](_0x54293e[_0x49daf1(0x1f9)],{'color':_0x1d8083[_0x49daf1(0x1d1)]||Cesium[_0x49daf1(0x24e)][_0x49daf1(_0x385e1a._0x2acd1e)]}),_0x7983fb(_0x20961f,_0x4d7cbe,_0x265de0);}return _0x7983fb(_0x20961f,_0x4d7cbe,new _0x201249[(_0x49daf1(_0x385e1a._0x4ac67d))](_0x2b2e51,_0x1d8083));},'WallType':_0x54293e,'Overlay':function(){var _0x4aa7fa=_0x53a8b6,_0x253758=function(){};return _0x253758[_0x4aa7fa(_0x1d8c7f._0x969a9)]={'polygon':function(_0x78908f){var _0x2b804e=_0x4aa7fa;return _0x16d41d[_0x2b804e(_0x26130c._0x420618)][_0x2b804e(_0x26130c._0x3f0603)]({'polygon':{'hierarchy':new Cesium['PolygonHierarchy'](_0x78908f[_0x2b804e(_0x26130c._0x18e08f)]||[]),'material':_0x78908f['color']||Cesium['Color'][_0x2b804e(0x164)][_0x2b804e(0x1b6)](0.5),'classificationType':Cesium[_0x2b804e(0x241)][_0x2b804e(_0x26130c._0xe0ae4c)],'zIndex':_0x78908f['zIndex']||0x0}});},'create':function(_0x3c63ab){var _0xdcea19=_0x4aa7fa,_0x20be55=_0x3c63ab[_0xdcea19(_0x2579db._0x4af7f9)]||_0xdcea19(_0x2579db._0x40b2bb);return this[_0x20be55]&&this[_0x20be55](_0x3c63ab);}},new _0x253758();},'Circles':((_0x326518=function(){})['prototype']={'Wave':function(_0x57a283,_0x567804){var _0x2aef0a=_0x53a8b6;this[_0x2aef0a(0x2c6)]=_0x567804,this[_0x2aef0a(0x2c8)]=_0x567804[_0x2aef0a(_0x108b1b._0xab4018)],this['radius']=_0x567804['radius']||0xa;var _0x8f31d3=_0x51cb81['assist']['materials'][this[_0x2aef0a(_0x108b1b._0x1896be)]['name']][_0x57a283];this[_0x2aef0a(_0x108b1b._0x3720d9)]=new _0x772e16['structures']['Material'](_0x8f31d3[_0x2aef0a(0x2b0)],_0x567804),this['Entity']['add']({'fabric':{'type':_0x8f31d3[_0x2aef0a(0x2b0)],'uniforms':{'color':new Cesium[(_0x2aef0a(_0x108b1b._0x262acd))](0x1,0x0,0x0,0x1),'time':0x1,'count':0x1,'gradient':_0x567804[_0x2aef0a(0x28b)]||0xa},'source':_0x8f31d3['Source']},'translucent':function(_0x42fa74){return!0x0;}}),_0x5efa06[_0x2aef0a(_0x108b1b._0x14f751)][_0x2aef0a(_0x108b1b._0x3619f7)]({'position':this[_0x2aef0a(_0x108b1b._0xab4018)],'ellipse':{'height':this[_0x2aef0a(0x2c6)][_0x2aef0a(0x252)]||0x0,'semiMinorAxis':this['radius'],'semiMajorAxis':this[_0x2aef0a(0x297)],'material':this['Entity']}});},'RadarRipple':function(_0x162346){var _0x1cee03=_0x53a8b6;this['options']=_0x162346,this['position']=_0x162346[_0x1cee03(_0x7ead4d._0x447caa)];var _0x182051=_0x51cb81[_0x1cee03(_0x7ead4d._0x483bb9)][_0x1cee03(_0x7ead4d._0xf5393d)][this[_0x1cee03(0x176)][_0x1cee03(0x17b)]](_0x162346[_0x1cee03(0x16e)]);this[_0x1cee03(0x23d)]=new _0x772e16[(_0x1cee03(_0x7ead4d._0x323d7c))][(_0x1cee03(0x24c))](_0x182051[_0x1cee03(_0x7ead4d._0x29bcf2)],_0x162346),this[_0x1cee03(_0x7ead4d._0x527779)][_0x1cee03(0x1e6)]({'fabric':{'type':_0x182051['Type'],'uniforms':{'color':_0x162346['color'],'speed':_0x162346[_0x1cee03(_0x7ead4d._0x418d3a)]},'source':_0x182051['Source']},'translucent':function(_0x315aa8){return!0x0;}}),this[_0x1cee03(0x264)]=_0x5efa06[_0x1cee03(_0x7ead4d._0x1a285f)]['add']({'position':_0x162346[_0x1cee03(_0x7ead4d._0x4fd02e)],'ellipse':{'semiMajorAxis':_0x162346[_0x1cee03(0x20a)],'semiMinorAxis':_0x162346['semiMinorAxis'],'material':this['Entity']}});}},new _0x326518()),'Lines':(_0x5b99bf=function(){},_0x5b99bf['prototype']={'Polyline':function(_0x5ade39){var _0x370ea3=_0x53a8b6,_0xcd64b4=this[_0x370ea3(_0x183df4._0x3012db)]['name'],_0x3326f4=_0x51cb81[_0x370ea3(_0x183df4._0x32f3ce)]['materials'][_0xcd64b4][_0x54293e[_0xcd64b4][_0x370ea3(0x23e)]],_0x56dfd0=new _0x772e16[(_0x370ea3(_0x183df4._0x5872a5))][(_0x370ea3(_0x183df4._0x2f8584))](_0x3326f4[_0x370ea3(0x2b0)],_0x5ade39);return _0x56dfd0['add']({'fabric':{'type':_0x3326f4[_0x370ea3(_0x183df4._0x3e8858)],'uniforms':{'color':new Cesium['Color'](0x1,0x0,0x0,0.5),'image':'','time':0x0,'count':0x1},'source':_0x3326f4[_0x370ea3(0x1a0)]},'translucent':function(_0x12dc48){return!0x0;}}),_0x56dfd0;}},new _0x5b99bf())},new _0x16d833()),'Tools':{'Measure':function(_0x3b6f12){}},'View':{'BgImage':function(_0x5a84e6){var _0x14a1f3=_0x53a8b6;_0x5efa06[_0x14a1f3(_0x1b2434._0x21e6ce)][_0x14a1f3(0x190)]['show']=!0x1,_0x5efa06[_0x14a1f3(0x25a)][_0x14a1f3(_0x1b2434._0x39c36d)]=new Cesium['Color'](0x0,0x0,0x0,0x0),_0x5efa06[_0x14a1f3(_0x1b2434._0xa11387)][_0x14a1f3(0x20d)][_0x14a1f3(_0x1b2434._0x2ab85c)]=_0x14a1f3(0x291)+_0x5a84e6+_0x14a1f3(_0x1b2434._0x3217f6);}}},_0x4f473a['__proto__']=new _0x2384aa();},'EchartsLayer':function(_0x285a5b,_0x4302f3){var _0x3110d0={_0x47e228:0x15a,_0x1dc1c1:0x221,_0x5c5282:0x2b8,_0x2b0e51:0x2ac,_0x278822:0x1b0,_0x55dd02:0x1b0},_0x552003={_0x394256:0x1eb,_0x454cef:0x27e},_0xed7423={_0x3cd2a9:0x1eb,_0x45d0c6:0x18b,_0x193597:0x2a8,_0x2e3c17:0x1ac,_0x40a32c:0x204,_0x40ebb8:0x20d,_0x3dae33:0x2be,_0x144944:0x2b6,_0x43e06f:0x252,_0x286334:0x170},_0x1d0164={_0x36cfdf:0x250},_0x2154d1=_0x3c6737,_0x31ca24=function(){var _0x48641b=_0xda21,_0x2fd298=_0x285a5b,_0x5e4870=_0x4302f3;echarts[_0x48641b(0x2a5)](_0x48641b(0x16d),this[_0x48641b(0x299)](_0x285a5b)),this['init'](_0x2fd298,_0x5e4870),this['visible']=!0x0,this[_0x48641b(_0x1d0164._0x36cfdf)](_0x5e4870);};return _0x31ca24[_0x2154d1(_0x4d13ed._0x39a0a5)]={'init':function(_0x2dabb5,_0x4ae9b5){var _0xb6e3cd=_0x2154d1;this['setBaseViewer'](_0x2dabb5),this[_0xb6e3cd(0x223)]();},'setBaseViewer':function(_0x3fad12){var _0x35a440=_0x2154d1;this[_0x35a440(_0x39eb42._0x40e905)]=_0x3fad12;},'createLayer':function(){var _0x7279d6=_0x2154d1,_0x59da14=this['_viewer'][_0x7279d6(0x25a)];_0x59da14[_0x7279d6(_0xed7423._0x3cd2a9)][_0x7279d6(_0xed7423._0x45d0c6)](_0x7279d6(_0xed7423._0x193597),0x0);var _0x241f2d=document['createElement'](_0x7279d6(_0xed7423._0x2e3c17));_0x241f2d['style'][_0x7279d6(0x2c8)]=_0x7279d6(_0xed7423._0x40a32c),_0x241f2d[_0x7279d6(_0xed7423._0x40ebb8)][_0x7279d6(0x271)]=_0x7279d6(0x1f7),_0x241f2d['style'][_0x7279d6(_0xed7423._0x3dae33)]='0px',_0x241f2d['style'][_0x7279d6(0x2b6)]=_0x59da14[_0x7279d6(_0xed7423._0x3cd2a9)][_0x7279d6(_0xed7423._0x144944)]+'px',_0x241f2d['style'][_0x7279d6(_0xed7423._0x43e06f)]=_0x59da14['canvas'][_0x7279d6(0x252)]+'px',_0x241f2d[_0x7279d6(0x20d)][_0x7279d6(0x26a)]=_0x7279d6(0x19b),_0x241f2d[_0x7279d6(0x18b)](_0x7279d6(_0xed7423._0x286334),_0x7279d6(0x17f)),this['box']=_0x241f2d,this[_0x7279d6(0x26f)][_0x7279d6(0x1dd)][_0x7279d6(0x1c4)](_0x241f2d),this[_0x7279d6(0x2a7)]=echarts[_0x7279d6(0x229)](_0x241f2d),this[_0x7279d6(0x278)]();},'startSceneEventListeners':function(){var _0x5254dc=_0x2154d1;this[_0x5254dc(_0x15e700._0x2295ba)]['scene'][_0x5254dc(0x1f5)][_0x5254dc(_0x15e700._0x961d00)](this[_0x5254dc(_0x15e700._0x5e6c46)],this);},'moveHandler':function(){var _0xbbdb90=_0x2154d1;this['visible']&&(this['setCharts'](),this[_0xbbdb90(_0x2c4681._0x333041)][_0xbbdb90(_0x2c4681._0x12cd74)]({'width':this[_0xbbdb90(0x26f)][_0xbbdb90(_0x2c4681._0xc996a5)]['width'],'height':this[_0xbbdb90(_0x2c4681._0x9981bc)][_0xbbdb90(0x1eb)]['height']}),this[_0xbbdb90(_0x2c4681._0x4a17a6)][_0xbbdb90(0x22d)]=!0x1);},'setCharts':function(){var _0x475cdd=_0x2154d1;this['visible']&&null!=this[_0x475cdd(0x199)]&&(this[_0x475cdd(0x2a7)][_0x475cdd(0x1a7)](this[_0x475cdd(0x199)]),this[_0x475cdd(_0x1b057f._0x285cc5)][_0x475cdd(0x15d)]=!0x1);},'setChartOption':function(_0x2c85b4){var _0x1c1a3c=_0x2154d1;this[_0x1c1a3c(_0x5f180e._0x399c2d)]=_0x2c85b4,this['setCharts']();},'getE3CoordinateSystem':function(_0x4f5490){var _0x587a54={_0x28509d:0x15a},_0x1b9c06={_0x4a435c:0x25a,_0x3f4052:0x251,_0xad6116:0x1bb,_0x11cfc4:0x1cc,_0x4cd688:0x1c2,_0x254e52:0x2b2},_0x3f86b7={_0x1a96f7:0x1f1,_0x580e84:0x27d,_0x53e355:0x233,_0x5e4761:0x20f},_0x1e7fd1={_0x233660:0x262},_0x4333a8={_0x43fe62:0x16d,_0x54b303:0x20c},_0xf179b0=_0x2154d1;function _0x17b9b0(_0x4457de){var _0x30cd2d=_0xda21;this[_0x30cd2d(0x26f)]=_0x4457de,this['_mapOffset']=[0x0,0x0];}return _0x17b9b0[_0xf179b0(_0x3110d0._0x47e228)]=function(_0x413d29){var _0x2ea595=_0xf179b0;_0x413d29[_0x2ea595(_0x1e7fd1._0x233660)](function(_0x6e32ff){var _0x377461=_0x2ea595;_0x377461(_0x4333a8._0x43fe62)===_0x6e32ff[_0x377461(_0x4333a8._0x54b303)](_0x377461(0x2c0))&&(_0x6e32ff['coordinateSystem']=new _0x17b9b0(_0x4f5490));});},_0x17b9b0[_0xf179b0(_0x3110d0._0x1dc1c1)]=function(){return['x','y'];},_0x17b9b0['dimensions']=['x','y'],_0x17b9b0['prototype'][_0xf179b0(_0x3110d0._0x5c5282)]=['x','y'],_0x17b9b0[_0xf179b0(0x1b0)][_0xf179b0(_0x3110d0._0x2b0e51)]=function(_0x2a2bb7){this['_mapOffset']=_0x2a2bb7;},_0x17b9b0['prototype'][_0xf179b0(0x2ad)]=function(_0x1379f2){var _0x49487f=_0xf179b0,_0x482163=this['_viewer'][_0x49487f(0x25a)],_0x5c8dda=[0x0,0x0];return(_0x1379f2=Cesium[_0x49487f(0x1f1)][_0x49487f(0x15f)](_0x1379f2[0x0],_0x1379f2[0x1]))?!(_0x482163[_0x49487f(0x1a1)]===Cesium['SceneMode'][_0x49487f(0x2b9)]&&Cesium[_0x49487f(_0x3f86b7._0x1a96f7)][_0x49487f(_0x3f86b7._0x580e84)](_0x482163[_0x49487f(_0x3f86b7._0x53e355)][_0x49487f(0x2c8)],_0x1379f2)>Cesium[_0x49487f(0x273)][_0x49487f(_0x3f86b7._0x5e4761)](0x50))&&((_0x1379f2=_0x482163[_0x49487f(0x26b)](_0x1379f2))?[_0x1379f2['x']-this[_0x49487f(0x1ca)][0x0],_0x1379f2['y']-this[_0x49487f(0x1ca)][0x1]]:_0x5c8dda):_0x5c8dda;},_0x17b9b0[_0xf179b0(0x1b0)]['pointToData']=function(_0x44aef2){var _0x24fe15=_0xf179b0,_0x2c92f5=this['_mapOffset'],_0x1a87c3=_0x4f5490[_0x24fe15(_0x1b9c06._0x4a435c)][_0x24fe15(_0x1b9c06._0x3f4052)][_0x24fe15(0x27c)];return _0x2c92f5=new Cesium[(_0x24fe15(_0x1b9c06._0xad6116))](_0x44aef2[0x1]+_0x2c92f5[0x1],_0x44aef2[0x2]+_0x2c92f5[0x2],0x0),(_0x2c92f5=_0x1a87c3[_0x24fe15(_0x1b9c06._0x11cfc4)](_0x2c92f5))?[_0x2c92f5[_0x24fe15(_0x1b9c06._0x4cd688)],_0x2c92f5[_0x24fe15(_0x1b9c06._0x254e52)]]:[0x0,0x0];},_0x17b9b0[_0xf179b0(_0x3110d0._0x278822)][_0xf179b0(0x1d2)]=function(){var _0x2b3f4a=_0xf179b0,_0x589420=this['_viewer'][_0x2b3f4a(_0x552003._0x394256)];return new echarts[(_0x2b3f4a(0x189))][(_0x2b3f4a(_0x552003._0x454cef))](0x0,0x0,_0x589420[_0x2b3f4a(0x2b6)],_0x589420['height']);},_0x17b9b0[_0xf179b0(_0x3110d0._0x55dd02)]['getRoamTransform']=function(){var _0x370ead=_0xf179b0;return matrix[_0x370ead(_0x587a54._0x28509d)]();},_0x17b9b0;}},new _0x31ca24();},'Assist':(_0x4e0b60=new _0x772e16[(_0x3c6737(0x29f))](),_0x2d8930=function(){},_0x2d8930[_0x3c6737(0x1b0)]={'getLnglatToCartesian':function(_0x180c00,_0x159f37){var _0x3a285f=_0x3c6737;return _0x4e0b60[_0x3a285f(_0x568f53._0x48d090)](_0x180c00,_0x159f37);},'getLnglatToPosition':function(_0x4dcae1,_0x46084f){var _0x1b3dfb=_0x3c6737;return _0x4e0b60[_0x1b3dfb(0x289)](_0x4dcae1,_0x46084f);},'getLnglatToTeilPosition':function(_0x3278ff,_0x170c2b){var _0x5e7ce1=_0x3c6737;return _0x4e0b60[_0x5e7ce1(_0x69b78f._0x3ca9a2)](_0x3278ff,_0x170c2b);},'getEntityDynamicPosition':function(_0x262147){return _0x4e0b60['getEntityDynamicPosition'](_0x262147);},'getEventMoreCoordinate':function(_0x421686,_0x23185e){return _0x4e0b60['getEventMoreCoordinate'](_0x421686,_0x23185e);},'flyToLnglat':function(_0x32b26f){var _0x26fec4=_0x3c6737,_0x54ee7b=_0x772e16[_0x26fec4(0x152)][_0x26fec4(0x258)],_0x43bb86={'destination':Cesium[_0x26fec4(0x1f1)][_0x26fec4(_0x480701._0xc24983)](_0x32b26f['longitude'],_0x32b26f[_0x26fec4(0x1ec)],_0x32b26f[_0x26fec4(0x252)]),'orientation':{'heading':_0x32b26f[_0x26fec4(0x2c1)],'pitch':_0x32b26f[_0x26fec4(_0x480701._0x41e97a)],'roll':_0x32b26f[_0x26fec4(_0x480701._0xa3be78)]},'duration':_0x32b26f[_0x26fec4(_0x480701._0xb192cf)]};_0x54ee7b[_0x26fec4(_0x480701._0x1bf034)][_0x26fec4(_0x480701._0x2754b5)][_0x26fec4(_0x480701._0x3b473f)](_0x43bb86);},'lnglatToPosition':function(_0x1c8569,_0x5d303b,_0x448aa8){var _0x23fd5e=_0x3c6737;return Cesium[_0x23fd5e(_0x6beecb._0x5d2aa9)][_0x23fd5e(_0x6beecb._0xae420b)](_0x1c8569,_0x5d303b,_0x448aa8);},'positionToCartographic':function(_0x8f6039){var _0x5156ac=_0x3c6737;return Cesium[_0x5156ac(_0x50931f._0x132498)]['fromCartesian'](_0x8f6039);},'pathSlice':function(_0x5c9c83,_0x132ae6,_0x32513a){var _0x3372d1=_0x3c6737;return _0x4e0b60[_0x3372d1(_0x4e385a._0x5065ea)](_0x5c9c83,_0x132ae6,_0x32513a);},'pathSlicesAsyncSetHeight':function(_0x3c8b5e,_0x4d3594){var _0x48660d={_0x587f85:0x2ba,_0x433da8:0x18d},_0x23411c=this;return new Promise(function(_0x5efa64,_0x1a94a8){var _0x221b39={_0x3991d8:0x174},_0x527273=_0xda21,_0x5d1ac6=[];qf[_0x527273(0x1ed)][_0x527273(0x1e0)](_0x3c8b5e,function(_0x3826c8,_0x4d05fb,_0x569b86,_0x130351){var _0x295fa5=_0x527273,_0x428924=_0x4d05fb,_0x753305=_0x3c8b5e[_0x130351+0x1],_0x2d0a53=_0x23411c[_0x295fa5(0x224)](_0x428924,_0x753305,_0x4d3594);_0x130351&&_0x2d0a53['shift'](),_0x753305?_0x23411c[_0x295fa5(_0x48660d._0x587f85)](_0x2d0a53)[_0x295fa5(_0x48660d._0x433da8)](function(_0xb69a75){var _0x543ffa=_0x295fa5;_0x5d1ac6=_0x5d1ac6[_0x543ffa(_0x221b39._0x3991d8)]([],_0xb69a75),_0xb69a75=null,_0x569b86();}):_0x569b86();},function(){return _0x5efa64(_0x5d1ac6),_0x5d1ac6=null;});});},'resetPositionsHeight':function(_0x43880a){var _0x432040=_0x3c6737;return _0x772e16[_0x432040(0x152)][_0x432040(_0x44294e._0x2502d4)][_0x432040(_0x44294e._0x5c6940)][_0x432040(0x171)](_0x43880a);},'convertColor':function(_0x10da0b){var _0x313719=_0x3c6737;return'String'===_0x10da0b[_0x313719(0x176)][_0x313719(_0x1032e5._0x4e49c1)]?Cesium[_0x313719(0x24e)][_0x313719(_0x1032e5._0x21d1a2)](_0x10da0b):new Cesium[(_0x313719(_0x1032e5._0x34fc94))]();},'positionToLnglat':function(_0x46dd0b){var _0x21a6c9=_0x3c6737,_0x52d4c9=Cesium[_0x21a6c9(_0x43bf5a._0x514e04)][_0x21a6c9(0x177)](_0x46dd0b);return{'longitude':Cesium[_0x21a6c9(_0x43bf5a._0x693774)]['toDegrees'](_0x52d4c9[_0x21a6c9(_0x43bf5a._0x337702)]),'latitude':Cesium[_0x21a6c9(_0x43bf5a._0x59dfd9)][_0x21a6c9(0x1ee)](_0x52d4c9['latitude']),'height':_0x52d4c9[_0x21a6c9(0x252)]};}},new _0x2d8930()),'Plugins':function(){var _0x2e3d75={_0x113af1:0x1cd},_0x27eab1=_0x3c6737,_0x104e63=new _0x772e16[(_0x27eab1(0x29f))](),_0x231fc5=function(){};return _0x231fc5[_0x27eab1(0x1b0)]={'View':function(_0x5a9a72,_0x27d776,_0x23a64c){var _0x49eb14={_0x4c69bc:0x152,_0x380cff:0x25a,_0x1f5773:0x1d0},_0x596294=_0x27eab1,_0x443da8=function(_0x39f110,_0x1d7346,_0x47c0df){var _0x5cdc8a={_0x132ba8:0x252,_0x225678:0x253,_0x353690:0x20d,_0x1eba03:0x172},_0xf2d421=_0xda21,_0x85952f=this['viewer']=_0x772e16[_0xf2d421(_0x49eb14._0x4c69bc)]['viewer'],_0x140fe1=_0x85952f[_0xf2d421(_0x49eb14._0x380cff)];this['el']=_0x1d7346,_0x47c0df=_0x47c0df||{},_0x1d7346[_0xf2d421(0x20d)]['cssText']=_0xf2d421(0x2ae),_0x85952f[_0xf2d421(0x1a4)]['container'][_0xf2d421(_0x49eb14._0x1f5773)](_0x1d7346),this['inRender']=function(){var _0x76a4bb=_0xf2d421,_0x53a1ba=_0x140fe1[_0x76a4bb(0x1eb)][_0x76a4bb(_0x5cdc8a._0x132ba8)],_0x5be4da=new Cesium['Cartesian2'](),_0x5b4a15=_0x47c0df[_0x76a4bb(0x167)]?_0x47c0df[_0x76a4bb(0x167)]():{'position':_0x39f110};Cesium['SceneTransforms'][_0x76a4bb(_0x5cdc8a._0x225678)](_0x140fe1,_0x5b4a15[_0x76a4bb(0x2c8)],_0x5be4da);var _0x186c91=-(_0x53a1ba-_0x5be4da['y']-~~_0x5b4a15['y'])+'px',_0x5e55dc=_0x5be4da['x']+~~_0x5b4a15['x']+'px';_0x1d7346[_0x76a4bb(_0x5cdc8a._0x353690)]['transform']=_0x76a4bb(_0x5cdc8a._0x1eba03)+_0x5e55dc+',\x20'+_0x186c91+')';},_0x104e63['addRenderEvent'](this['inRender'],this);};return _0x443da8[_0x596294(0x1b0)]={'removeRender':function(){var _0x46cc59=_0x596294;_0x104e63[_0x46cc59(_0x2e3d75._0x113af1)](this[_0x46cc59(0x1fb)],this);},'remove':function(){var _0x44da13=_0x596294;this[_0x44da13(0x2ce)](),this['el']['remove']();}},new _0x443da8(_0x5a9a72,_0x27d776,_0x23a64c);}},new _0x231fc5();}[_0x3c6737(0x195)](this),'Animat':(_0x2d9061=function(){var _0x659b27={_0x218792:0x2cb,_0x518d9b:0x1e6,_0x38783e:0x181,_0x4feb6e:0x1da,_0x1f881a:0x220,_0x42c5d0:0x24e,_0x3d99be:0x1bf},_0xa99d3d={_0x44ac83:0x152,_0x3f5af0:0x1b2,_0x47310e:0x264,_0x8266af:0x28c},_0x4bb710=_0x3c6737,_0x4b16df=this;this[_0x4bb710(0x1da)]=function(_0x379bcf,_0x5b16e2){var _0x243f99=_0x4bb710;this[_0x243f99(0x258)]=this[_0x243f99(0x258)]||_0x772e16[_0x243f99(_0xa99d3d._0x44ac83)]['viewer'],this[_0x243f99(_0xa99d3d._0x3f5af0)]=_0x379bcf,this['entities']=this[_0x243f99(0x258)][_0x243f99(_0xa99d3d._0x47310e)][_0x243f99(0x1e6)]({'position':_0x379bcf,'model':_0x5b16e2}),this[_0x243f99(0x28c)]=_0x4b16df[_0x243f99(_0xa99d3d._0x8266af)];},this[_0x4bb710(_0xf84c6c._0x2610d4)]=function(_0x176105,_0xfe403a){var _0x65c48d=_0x4bb710;this[_0x65c48d(0x258)]=this['viewer']||_0x772e16[_0x65c48d(_0x50107d._0x28ad21)][_0x65c48d(_0x50107d._0x466314)],this['initPositon']=_0x176105,this[_0x65c48d(0x264)]=this[_0x65c48d(_0x50107d._0x466314)]['entities'][_0x65c48d(_0x50107d._0x4db415)]({'position':_0x176105,[_0xfe403a[_0x65c48d(0x1a8)]]:_0xfe403a[_0x65c48d(0x29d)]}),this[_0x65c48d(0x28c)]=_0x4b16df[_0x65c48d(_0x50107d._0x50817a)];},this[_0x4bb710(0x264)]=function(_0xf788d0){var _0x83ba88=_0x4bb710;this[_0x83ba88(_0x533363._0x4c1584)]=this[_0x83ba88(_0x533363._0x4c1584)]||_0x772e16['d3Api']['viewer'],this[_0x83ba88(0x264)]=_0xf788d0[_0x83ba88(_0x533363._0xd7a701)]||this['viewer'][_0x83ba88(_0x533363._0x29c634)][_0x83ba88(_0x533363._0x1d7bbb)](_0xf788d0),this[_0x83ba88(0x1b2)]=this[_0x83ba88(_0x533363._0x5cb772)][_0x83ba88(_0x533363._0x3c1ac1)][_0x83ba88(0x246)],this[_0x83ba88(0x28c)]=_0x4b16df['__proto__'];},this['polyline']=function(_0x3650f8){var _0x12cc04=_0x4bb710;this[_0x12cc04(0x258)]=this[_0x12cc04(0x258)]||_0x772e16[_0x12cc04(0x152)]['viewer'],this[_0x12cc04(_0x659b27._0x218792)]=this['viewer'][_0x12cc04(0x264)][_0x12cc04(_0x659b27._0x518d9b)]({'position':_0x3650f8[_0x12cc04(0x2c8)],'orientation':_0x3650f8[_0x12cc04(_0x659b27._0x38783e)],'model':_0x3650f8[_0x12cc04(_0x659b27._0x4feb6e)],'billboard':_0x3650f8[_0x12cc04(0x269)],'label':_0x3650f8['label'],'path':new Cesium[(_0x12cc04(_0x659b27._0x1f881a))](qf[_0x12cc04(0x1e5)][_0x12cc04(0x195)]({'show':!0x0,'width':0x3,'leadTime':0x0,'trailTime':0xbb8,'material':Cesium[_0x12cc04(_0x659b27._0x42c5d0)][_0x12cc04(_0x659b27._0x3d99be)]},_0x3650f8[_0x12cc04(0x2cb)]))});};},_0x2d9061['prototype']={'addPosition':function(_0x1f8a0d,_0xb750fb){var _0x3223ce=_0x3c6737,_0x3d4aee=this[_0x3223ce(0x258)]['clock'][_0x3223ce(0x283)][_0x3223ce(0x17a)]();this[_0x3223ce(0x1de)]||this['createSampledPosition'](_0x3d4aee);var _0x509b23=new Cesium[(_0x3223ce(0x2c9))]();Cesium['JulianDate']['addSeconds'](_0x3d4aee,_0xb750fb,_0x509b23),this[_0x3223ce(_0x4e85fc._0x2af851)][_0x3223ce(0x1d9)](_0x509b23,_0x1f8a0d);},'createSampledPosition':function(_0x559b69){var _0x3c6abe=_0x3c6737;this[_0x3c6abe(0x1de)]=new Cesium['SampledPositionProperty'](),this[_0x3c6abe(0x1de)]['addSample'](_0x559b69[_0x3c6abe(_0x50ddaa._0x13cfa9)](),this['initPositon']),this[_0x3c6abe(0x264)][_0x3c6abe(0x2c8)]=this[_0x3c6abe(_0x50ddaa._0x4528fd)],this[_0x3c6abe(0x264)][_0x3c6abe(_0x50ddaa._0x5e2870)]=new Cesium[(_0x3c6abe(0x210))](this[_0x3c6abe(0x1de)]);},'removePosition':function(){}},new _0x2d9061()),'Event':function(){var _0x460483={_0x5e8339:0x1b0},_0x3a89a2={_0x245923:0x258,_0x544555:0x2a9,_0x355181:0x2b3,_0x34c569:0x1eb},_0x555578=_0x3c6737,_0x2a42e3={'leftClick':Cesium['ScreenSpaceEventType'][_0x555578(_0x14d487._0x1c1285)],'leftDoubleClick':Cesium[_0x555578(0x276)][_0x555578(_0x14d487._0x1dbfe7)]};return{'leftClick':function(_0x2b9330){var _0x529b75=_0x555578,_0x2d9d7d=function(){var _0x1833b2={_0x32f718:0x179},_0x5c4d8a=_0xda21,_0x43efc9=_0x772e16[_0x5c4d8a(0x152)][_0x5c4d8a(_0x3a89a2._0x245923)];return this[_0x5c4d8a(0x2a9)]=this[_0x5c4d8a(_0x3a89a2._0x544555)]||new Cesium[(_0x5c4d8a(_0x3a89a2._0x355181))](_0x43efc9[_0x5c4d8a(0x25a)][_0x5c4d8a(_0x3a89a2._0x34c569)]),this[_0x5c4d8a(_0x3a89a2._0x544555)][_0x5c4d8a(0x254)](function(_0x30280b){var _0x2c0252=_0x5c4d8a,_0x53d61e=window[_0x2c0252(_0x1833b2._0x32f718)],_0x38fa37=_0x30280b[_0x2c0252(0x2c8)];_0x38fa37['x']=_0x38fa37['x']*_0x53d61e,_0x38fa37['y']=_0x38fa37['y']*_0x53d61e,_0x2b9330&&_0x2b9330(_0x30280b);},_0x2a42e3[_0x5c4d8a(0x225)]),_0x2a42e3[_0x5c4d8a(0x225)];};return _0x2d9d7d[_0x529b75(_0x460483._0x5e8339)]={'remove':function(){var _0x1c2012=_0x529b75;this['handler']&&this[_0x1c2012(0x2a9)][_0x1c2012(0x183)](_0x2a42e3['leftClick']);}},new _0x2d9d7d();},'removeLeftDoubleClick':function(){var _0xed2e55=_0x555578;_0x772e16[_0xed2e55(_0x2144e3._0x18d01f)][_0xed2e55(_0x2144e3._0x4a752c)]['cesiumWidget'][_0xed2e55(0x2ca)][_0xed2e55(_0x2144e3._0x3acd30)](_0x2a42e3[_0xed2e55(_0x2144e3._0x2b1819)]);}};}['call'](_0x57c963)},new _0x57c963();}[_0x20a6e8(_0x3818b8._0x5d7b4b)](function(){});}(_0x104d25));}(_0x285f7e(0x217)!=typeof window?window:this);}]));
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
var JSWebrtc = {
Player: null,
VideoElement: null,
CreateVideoElements: function () {
var elements = document.querySelectorAll(".jswebrtc");
for (var i = 0; i < elements.length; i++) {
new JSWebrtc.VideoElement(elements[i])
}
},
FillQuery: function (query_string, obj) {
obj.user_query = {};
if (query_string.length == 0) return;
if (query_string.indexOf("?") >= 0) query_string = query_string.split("?")[1];
var queries = query_string.split("&");
for (var i = 0; i < queries.length; i++) {
var query = queries[i].split("=");
obj[query[0]] = query[1];
obj.user_query[query[0]] = query[1]
}
if (obj.domain) obj.vhost = obj.domain
},
ParseUrl: function (rtmp_url) {
var a = document.createElement("a");
a.href = rtmp_url.replace("rtmp://", "http://").replace("webrtc://", "http://").replace("rtc://", "http://");
var vhost = a.hostname;
var app = a.pathname.substr(1, a.pathname.lastIndexOf("/") - 1);
var stream = a.pathname.substr(a.pathname.lastIndexOf("/") + 1);
app = app.replace("...vhost...", "?vhost=");
if (app.indexOf("?") >= 0) {
var params = app.substr(app.indexOf("?"));
app = app.substr(0, app.indexOf("?"));
if (params.indexOf("vhost=") > 0) {
vhost = params.substr(params.indexOf("vhost=") + "vhost=".length);
if (vhost.indexOf("&") > 0) {
vhost = vhost.substr(0, vhost.indexOf("&"))
}
}
}
if (a.hostname == vhost) {
var re = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/;
if (re.test(a.hostname)) vhost = "__defaultVhost__"
}
var schema = "rtmp";
if (rtmp_url.indexOf("://") > 0) schema = rtmp_url.substr(0, rtmp_url.indexOf("://"));
var port = a.port;
if (!port) {
if (schema === "http") {
port = 80
} else if (schema === "https") {
port = 443
} else if (schema === "rtmp") {
port = 1935
} else if (schema === "webrtc" || schema === "rtc") {
port = 1985
}
}
var ret = {
url: rtmp_url,
schema: schema,
server: a.hostname,
port: port,
vhost: vhost,
app: app,
stream: stream
};
JSWebrtc.FillQuery(a.search, ret);
return ret
},
HttpPost: function (url, data) {
return new Promise(function (resolve, reject) {
var xhr = new XMLHttpRequest;
xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && (xhr.status >= 200 && xhr.status < 300)) {
var respone = JSON.parse(xhr.responseText);
xhr.onreadystatechange = new Function;
xhr = null;
resolve(respone)
}
};
xhr.open("POST", url, true);
xhr.timeout = 5e3;
xhr.responseType = "text";
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data)
})
}
};
if (document.readyState === "complete") {
JSWebrtc.CreateVideoElements()
} else {
document.addEventListener("DOMContentLoaded", JSWebrtc.CreateVideoElements)
}
JSWebrtc.VideoElement = function () {
"use strict";
var VideoElement = function (element) {
var url = element.dataset.url;
if (!url) {
throw "VideoElement has no `data-url` attribute"
}
var addStyles = function (element, styles) {
for (var name in styles) {
element.style[name] = styles[name]
}
};
this.container = element;
addStyles(this.container, {
display: "inline-block",
position: "relative",
minWidth: "80px",
minHeight: "80px"
});
this.video = document.createElement("video");
this.video.width = 960;
this.video.height = 540;
addStyles(this.video, {
display: "block",
width: "100%"
});
this.container.appendChild(this.video);
this.playButton = document.createElement("div");
this.playButton.innerHTML = VideoElement.PLAY_BUTTON;
addStyles(this.playButton, {
zIndex: 2,
position: "absolute",
top: "0",
bottom: "0",
left: "0",
right: "0",
maxWidth: "75px",
maxHeight: "75px",
margin: "auto",
opacity: "0.7",
cursor: "pointer"
});
this.container.appendChild(this.playButton);
var options = {
video: this.video
};
for (var option in element.dataset) {
try {
options[option] = JSON.parse(element.dataset[option])
} catch (err) {
options[option] = element.dataset[option]
}
}
this.player = new JSWebrtc.Player(url, options);
element.playerInstance = this.player;
if (options.poster && !options.autoplay) {
options.decodeFirstFrame = false;
this.poster = new Image;
this.poster.src = options.poster;
this.poster.addEventListener("load", this.posterLoaded);
addStyles(this.poster, {
display: "block",
zIndex: 1,
position: "absolute",
top: 0,
left: 0,
bottom: 0,
right: 0
});
this.container.appendChild(this.poster)
}
if (!this.player.options.streaming) {
this.container.addEventListener("click", this.onClick.bind(this))
}
if (options.autoplay) {
this.playButton.style.display = "none"
}
if (this.player.audioOut && !this.player.audioOut.unlocked) {
var unlockAudioElement = this.container;
if (options.autoplay) {
this.unmuteButton = document.createElement("div");
this.unmuteButton.innerHTML = VideoElement.UNMUTE_BUTTON;
addStyles(this.unmuteButton, {
zIndex: 2,
position: "absolute",
bottom: "10px",
right: "20px",
width: "75px",
height: "75px",
margin: "auto",
opacity: "0.7",
cursor: "pointer"
});
this.container.appendChild(this.unmuteButton);
unlockAudioElement = this.unmuteButton
}
this.unlockAudioBound = this.onUnlockAudio.bind(this, unlockAudioElement);
unlockAudioElement.addEventListener("touchstart", this.unlockAudioBound, false);
unlockAudioElement.addEventListener("click", this.unlockAudioBound, true)
}
};
VideoElement.prototype.onUnlockAudio = function (element, ev) {
if (this.unmuteButton) {
ev.preventDefault();
ev.stopPropagation()
}
this.player.audioOut.unlock(function () {
if (this.unmuteButton) {
this.unmuteButton.style.display = "none"
}
element.removeEventListener("touchstart", this.unlockAudioBound);
element.removeEventListener("click", this.unlockAudioBound)
}.bind(this))
};
VideoElement.prototype.onClick = function (ev) {
if (this.player.isPlaying) {
this.player.pause();
this.playButton.style.display = "block"
} else {
this.player.play();
this.playButton.style.display = "none";
if (this.poster) {
this.poster.style.display = "none"
}
}
};
VideoElement.PLAY_BUTTON = '<svg style="max-width: 75px; max-height: 75px;" ' + 'viewBox="0 0 200 200" alt="Play video">' + '<circle cx="100" cy="100" r="90" fill="none" ' + 'stroke-width="15" stroke="#fff"/>' + '<polygon points="70, 55 70, 145 145, 100" fill="#fff"/>' + "</svg>";
VideoElement.UNMUTE_BUTTON = '<svg style="max-width: 75px; max-height: 75px;" viewBox="0 0 75 75">' + '<polygon class="audio-speaker" stroke="none" fill="#fff" ' + 'points="39,13 22,28 6,28 6,47 21,47 39,62 39,13"/>' + '<g stroke="#fff" stroke-width="5">' + '<path d="M 49,50 69,26"/>' + '<path d="M 69,50 49,26"/>' + "</g>" + "</svg>";
return VideoElement
}();
JSWebrtc.Player = function () {
"use strict";
var Player = function (openUrl, url, options) {
this.options = options || {};
if (!url.match(/^webrtc?:\/\//)) {
throw "JSWebrtc just work with webrtc"
}
if (!this.options.video) {
throw "VideoElement is null"
}
this.urlParams = JSWebrtc.ParseUrl(url);
this.pc = null;
this.autoplay = !!options.autoplay || false;
this.paused = true;
if (this.autoplay) this.options.video.muted = true;
this.startLoading(openUrl)
};
Player.prototype.startLoading = function (openUrl) {
var _self = this;
if (_self.pc) {
_self.pc.close()
}
_self.pc = new RTCPeerConnection(null);
_self.pc.ontrack = function (event) {
_self.options.video["srcObject"] = event.streams[0]
};
_self.pc.addTransceiver("audio", {
direction: "recvonly"
});
_self.pc.addTransceiver("video", {
direction: "recvonly"
});
_self.pc.createOffer().then(function (offer) {
return _self.pc.setLocalDescription(offer).then(function () {
return offer
})
}).then(function (offer) {
return new Promise(function (resolve, reject) {
var port = _self.urlParams.port || 1985;
var api = _self.urlParams.user_query.play || "/rtc/v1/play/";
if (api.lastIndexOf("/") != api.length - 1) {
api += "/"
}
var url = "http://" + _self.urlParams.server + ":" + port + api;
for (var key in _self.urlParams.user_query) {
if (key != "api" && key != "play") {
url += "&" + key + "=" + _self.urlParams.user_query[key]
}
}
url = openUrl ? openUrl : `https://caps.runde.pro/rtc/v1/play/`;
var data = {
api: url,
streamurl: _self.urlParams.url,
clientip: null,
sdp: offer.sdp
};
JSWebrtc.HttpPost(url, JSON.stringify(data)).then(function (res) {
if (res.code === 400) {
_self.options.onFail()
}
resolve(res.sdp)
}, function (rej) {
reject(rej)
})
})
}).then(function (answer) {
return _self.pc.setRemoteDescription(new RTCSessionDescription({
type: "answer",
sdp: answer
}))
}).catch(function (reason) {
throw reason
});
if (this.autoplay) {
this.play()
}
};
Player.prototype.play = function (ev) {
if (this.animationId) {
return
}
this.animationId = requestAnimationFrame(this.update.bind(this));
this.paused = false
};
Player.prototype.pause = function (ev) {
if (this.paused) {
return
}
cancelAnimationFrame(this.animationId);
this.animationId = null;
this.isPlaying = false;
this.paused = true;
this.options.video.pause();
if (this.options.onPause) {
this.options.onPause(this)
}
};
Player.prototype.stop = function (ev) {
this.pause()
};
Player.prototype.destroy = function () {
this.pause();
this.pc && this.pc.close() && this.pc.destroy();
this.audioOut && this.audioOut.destroy()
};
Player.prototype.update = function () {
this.animationId = requestAnimationFrame(this.update.bind(this));
if (this.options.video.readyState < 4) {
return
}
if (!this.isPlaying) {
this.isPlaying = true;
this.options.video.play();
if (this.options.onPlay) {
this.options.onPlay(this)
}
}
};
return Player
}();
/*
name: qf_web
version: V1.04191
*/
function _0x1169(_0x517944,_0x43e954){var _0x3bf9f5=_0x1ed1();return _0x1169=function(_0xdc0f3c,_0x5d543e){_0xdc0f3c=_0xdc0f3c-0x183;var _0x1ed118=_0x3bf9f5[_0xdc0f3c];return _0x1ed118;},_0x1169(_0x517944,_0x43e954);}(function(_0x387c0a,_0x18eb34){var _0x2e596a={_0x380735:0x1c0,_0x449e62:0x1df,_0x3f215e:0x19d,_0x50d542:0x189},_0x2c0884=_0x1169,_0x25da1b=_0x387c0a();while(!![]){try{var _0x17759b=parseInt(_0x2c0884(_0x2e596a._0x380735))/0x1+-parseInt(_0x2c0884(0x1b6))/0x2*(-parseInt(_0x2c0884(0x1ab))/0x3)+-parseInt(_0x2c0884(0x1c8))/0x4+parseInt(_0x2c0884(_0x2e596a._0x449e62))/0x5*(-parseInt(_0x2c0884(_0x2e596a._0x3f215e))/0x6)+-parseInt(_0x2c0884(_0x2e596a._0x50d542))/0x7+-parseInt(_0x2c0884(0x1c5))/0x8*(parseInt(_0x2c0884(0x1d6))/0x9)+parseInt(_0x2c0884(0x1cc))/0xa;if(_0x17759b===_0x18eb34)break;else _0x25da1b['push'](_0x25da1b['shift']());}catch(_0x4e4cac){_0x25da1b['push'](_0x25da1b['shift']());}}}(_0x1ed1,0xbd48e),!function(_0x1e6827){var _0x46524a={_0x309fb1:0x1e0,_0x575c1d:0x1ed},_0x11420e={_0x1ce560:0x194,_0x8d7889:0x1b1},_0x50fee0={_0x30e938:0x1e7,_0x49e530:0x1ec,_0x40ed76:0x1de},_0x2198a2={_0x3d52dd:0x191,_0x3c84a5:0x1d7},_0x15370c=(function(){var _0x3eea58=!![];return function(_0x11c79d,_0x3c09cd){var _0x24fa46=_0x3eea58?function(){if(_0x3c09cd){var _0x16674f=_0x3c09cd['apply'](_0x11c79d,arguments);return _0x3c09cd=null,_0x16674f;}}:function(){};return _0x3eea58=![],_0x24fa46;};}()),_0x29f889={};function _0x2a0236(_0x37be43){var _0xa00af3={_0xcbc17e:0x18e,_0x22fdee:0x1b0},_0x484766=_0x1169,_0x3901b3=_0x15370c(this,function(){var _0x465008=_0x1169;return _0x3901b3['toString']()[_0x465008(0x1e1)](_0x465008(_0xa00af3._0xcbc17e))[_0x465008(_0xa00af3._0x22fdee)]()['constructor'](_0x3901b3)[_0x465008(0x1e1)]('(((.+)+)+)+$');});_0x3901b3();if(_0x29f889[_0x37be43])return _0x29f889[_0x37be43][_0x484766(0x1d7)];var _0x3d9e5d=_0x29f889[_0x37be43]={'i':_0x37be43,'l':!0x1,'exports':{}};return _0x1e6827[_0x37be43][_0x484766(_0x2198a2._0x3d52dd)](_0x3d9e5d['exports'],_0x3d9e5d,_0x3d9e5d[_0x484766(0x1d7)],_0x2a0236),_0x3d9e5d['l']=!0x0,_0x3d9e5d[_0x484766(_0x2198a2._0x3c84a5)];}_0x2a0236['m']=_0x1e6827,_0x2a0236['c']=_0x29f889,_0x2a0236['d']=function(_0x5c13c6,_0x18ea29,_0xf6b5a1){_0x2a0236['o'](_0x5c13c6,_0x18ea29)||Object['defineProperty'](_0x5c13c6,_0x18ea29,{'enumerable':!0x0,'get':_0xf6b5a1});},_0x2a0236['r']=function(_0xbe2790){var _0x16d669=_0x1169;_0x16d669(0x1e4)!=typeof Symbol&&Symbol[_0x16d669(_0x50fee0._0x30e938)]&&Object[_0x16d669(_0x50fee0._0x49e530)](_0xbe2790,Symbol[_0x16d669(0x1e7)],{'value':_0x16d669(_0x50fee0._0x40ed76)}),Object[_0x16d669(0x1ec)](_0xbe2790,'__esModule',{'value':!0x0});},_0x2a0236['t']=function(_0x4467ba,_0x33d798){var _0x43e77e=_0x1169;if(0x1&_0x33d798&&(_0x4467ba=_0x2a0236(_0x4467ba)),0x8&_0x33d798)return _0x4467ba;if(0x4&_0x33d798&&_0x43e77e(_0x11420e._0x1ce560)==typeof _0x4467ba&&_0x4467ba&&_0x4467ba[_0x43e77e(_0x11420e._0x8d7889)])return _0x4467ba;var _0x44783a=Object['create'](null);if(_0x2a0236['r'](_0x44783a),Object['defineProperty'](_0x44783a,_0x43e77e(0x1ef),{'enumerable':!0x0,'value':_0x4467ba}),0x2&_0x33d798&&'string'!=typeof _0x4467ba){for(var _0x588f01 in _0x4467ba)_0x2a0236['d'](_0x44783a,_0x588f01,function(_0x16c7fa){return _0x4467ba[_0x16c7fa];}['bind'](null,_0x588f01));}return _0x44783a;},_0x2a0236['n']=function(_0xafd9b3){var _0x29d01b=_0x1169,_0x2568c2=_0xafd9b3&&_0xafd9b3[_0x29d01b(0x1b1)]?function(){return _0xafd9b3['default'];}:function(){return _0xafd9b3;};return _0x2a0236['d'](_0x2568c2,'a',_0x2568c2),_0x2568c2;},_0x2a0236['o']=function(_0x459d1d,_0x4b00e0){var _0x2ce366=_0x1169;return Object[_0x2ce366(_0x46524a._0x309fb1)][_0x2ce366(_0x46524a._0x575c1d)][_0x2ce366(0x191)](_0x459d1d,_0x4b00e0);},_0x2a0236['p']='',_0x2a0236(_0x2a0236['s']=0x0);}([function(_0x34b3d9,_0x484a13,_0x7f5704){var _0x32585f=_0x1169;_0x34b3d9[_0x32585f(0x1d7)]=_0x7f5704(0x1);},function(_0x5e5f4d,_0x2f444c,_0x55e7f9){var _0x49a128={_0x2002dd:0x1f8},_0x4aeaea={_0x389c39:0x1d3,_0x5adff9:0x1e3,_0xe7aebb:0x193,_0x18918a:0x1b2,_0xa9b7a7:0x1e2,_0x7a05a2:0x1bd,_0x12ab4a:0x1fb,_0x3654f5:0x198,_0x1977ff:0x1a0,_0x14b1c7:0x1a6,_0x2a22eb:0x1bf,_0x5d8cf5:0x1d2,_0x35fcfc:0x1aa,_0xf68ab:0x1e9,_0x4ae18b:0x18d,_0x5d4627:0x1e0,_0x28178c:0x1dd,_0xbd1ff:0x1dd,_0x2e2717:0x1a3,_0x11cf01:0x1d4,_0x188a08:0x1e0},_0x47ff9f=_0x1169;!function(_0x384570,_0x101257){var _0x2a61ca={_0x50a98e:0x1ee,_0xb9304f:0x1a7,_0xcf33e9:0x1a8},_0x4400d2={_0x353a73:0x1a7},_0x22471d={_0x40d418:0x1dd},_0x4fa5c4={_0x18df13:0x1b9},_0x47b241={_0x5f1317:0x1b9},_0x3d2e81={_0x1f9617:0x1ba},_0x5d1687={_0x10d1e7:0x194},_0x151d77={_0x13ddac:0x1d1},_0x3f9f81=_0x1169;if(!_0x384570[_0x3f9f81(_0x49a128._0x2002dd)])throw new Error(_0x3f9f81(0x1c7));(function(_0xdeb175,_0x47ff1f){var _0x1468da={_0x2b38c4:0x1ec,_0x36642d:0x1d8,_0x4b64af:0x18f},_0x111aab={_0x25a20f:0x1f1},_0x5d1fd9={_0x523df2:0x1f9,_0x54b93f:0x1e8,_0x449767:0x1b2},_0x3726a9={_0xb14635:0x1e8},_0x5bd0b6={_0x53f1f2:0x1b7,_0x560344:0x199,_0x1f3b5c:0x1e6,_0x5ed43f:0x1b2,_0x4fdaa2:0x1ac},_0x2b7666={_0x2603bc:0x1ce},_0x449195={_0x2ccd1e:0x1ae},_0x132e8b={_0x45e7ab:0x1f2,_0x1b44c8:0x1db,_0x54c019:0x1b8,_0x553a30:0x1f3},_0x20045c={_0x27a6be:0x1f3},_0x573de2={_0x136a14:0x196,_0x3a89f0:0x18c},_0x302c06=_0x3f9f81,_0x57be12=document,_0x1c7c71=_0x57be12[_0x302c06(_0x4aeaea._0x389c39)],_0x3115d7=_0x57be12[_0x302c06(_0x4aeaea._0x5adff9)](_0x302c06(_0x4aeaea._0xe7aebb))[_0x302c06(_0x4aeaea._0x18918a)],_0xb961a4=(function(){var _0x2529a3=_0x302c06;for(var _0x4c5f19='t,webkitT,MozT,msT,OT'[_0x2529a3(0x1ad)](','),_0x21030b=0x0,_0x375beb=_0x4c5f19[_0x2529a3(0x1a7)];_0x21030b<_0x375beb;_0x21030b++)if(_0x4c5f19[_0x21030b]+_0x2529a3(_0x151d77._0x13ddac)in _0x3115d7)return _0x4c5f19[_0x21030b][_0x2529a3(0x197)](0x0,_0x4c5f19[_0x21030b][_0x2529a3(0x1a7)]-0x1);return!0x1;}()),_0x4a034c=function(_0x446626){var _0x22443c=_0x302c06;return''===_0xb961a4?_0x446626:_0xb961a4+_0x446626[_0x22443c(_0x573de2._0x136a14)](0x0)[_0x22443c(_0x573de2._0x3a89f0)]()+_0x446626[_0x22443c(0x197)](0x1);},_0x41f617=(navigator[_0x302c06(_0x4aeaea._0xa9b7a7)][_0x302c06(0x187)](),_0x4a034c(_0x302c06(0x199))),_0x1d18c5=(_0x4a034c(_0x302c06(0x1cd)),/hp-tablet/gi[_0x302c06(0x1eb)](navigator[_0x302c06(0x195)])),_0x26bf1d='ontouchstart'in _0xdeb175&&!_0x1d18c5,_0x53d4d1=_0x26bf1d?_0x302c06(_0x4aeaea._0x7a05a2):_0x302c06(_0x4aeaea._0x12ab4a),_0x42d518=_0x26bf1d?'touchmove':_0x302c06(0x1b4),_0x327cc6=_0x26bf1d?_0x302c06(0x1b5):_0x302c06(0x1a0),_0x149cc4=_0x26bf1d?_0x302c06(_0x4aeaea._0x3654f5):_0x302c06(_0x4aeaea._0x1977ff),_0xe614f2=[],_0x514e91=(_0xdeb175[_0x302c06(_0x4aeaea._0x14b1c7)]||_0xdeb175[_0x302c06(0x19a)]||_0xdeb175[_0x302c06(_0x4aeaea._0x2a22eb)]||_0xdeb175[_0x302c06(_0x4aeaea._0x5d8cf5)]||_0xdeb175[_0x302c06(0x19c)],_0xdeb175[_0x302c06(0x1da)]||_0xdeb175[_0x302c06(0x1a9)]||_0xdeb175[_0x302c06(_0x4aeaea._0x35fcfc)]||_0xdeb175['mozCancelRequestAnimationFrame']||_0xdeb175[_0x302c06(_0x4aeaea._0xf68ab)]||_0xdeb175['msCancelRequestAnimationFrame']||clearTimeout,function(_0x56b690,_0x4dbebd){var _0x2cd365=_0x302c06;return new _0x514e91[(_0x2cd365(0x1a3))]['init'](_0x56b690,_0x4dbebd);}),_0x2b7caa=_0x57be12[_0x302c06(0x1cf)],_0x265ad1=(_0x2b7caa['clientWidth']||_0x2b7caa['body']&&_0x2b7caa['body'][_0x302c06(0x1ca)],_0xdeb175[_0x302c06(_0x4aeaea._0x4ae18b)]>=0x2?0x2:_0xdeb175['devicePixelRatio']);_0x514e91['prt']=_0x514e91[_0x302c06(_0x4aeaea._0x5d4627)]={'constructor':_0x514e91,'splice':[][_0x302c06(0x1a5)]},_0x514e91[_0x302c06(_0x4aeaea._0x28178c)]=function(){var _0x2d9c0a,_0x13713f=arguments[0x0];for(_0x2d9c0a in _0x13713f)this[_0x2d9c0a]=_0x13713f[_0x2d9c0a];return this;},_0x514e91[_0x302c06(_0x4aeaea._0xbd1ff)]({'envir':{'dummyStyle':_0x3115d7,'vendor':_0xb961a4,'dpr':_0x265ad1,'hasTouch':_0x26bf1d,'event':{'start':_0x53d4d1,'move':_0x42d518,'end':_0x327cc6,'cancel':_0x149cc4}},'setting':{'w':0x780,'h':0x438,'mw':0x258,'fs':0xc,'stb':0x5a0,'stw':0x780,'dprb':0x64}}),_0x514e91[_0x302c06(0x1dd)]({'iframeLoad':function(_0x1bd5be){var _0x2888d1=_0x302c06,_0x5f1403=this[0x0];_0x5f1403[_0x2888d1(_0x20045c._0x27a6be)]=function(_0x6dbb16){var _0x2c8947=_0x2888d1;_0x1bd5be&&_0x1bd5be(_0x5f1403[_0x2c8947(0x1d9)],_0x6dbb16);};},'ready':function(_0x477a3c,_0x52080a){var _0x33cb6d={_0x558017:0x1d3,_0x25c544:0x1f2},_0x3cf906=_0x302c06,_0x3ddb01=function(){var _0x577d95=_0x1169;_0x52080a&&(_0x1c7c71=_0x57be12[_0x577d95(_0x33cb6d._0x558017)]),_0x514e91[_0x577d95(_0x33cb6d._0x25c544)]=!0x0,_0x477a3c&&_0x477a3c(_0x514e91);};_0x514e91[_0x3cf906(_0x132e8b._0x45e7ab)]?_0x477a3c&&_0x477a3c(_0x514e91):_0xdeb175[_0x3cf906(_0x132e8b._0x1b44c8)]?_0xdeb175[_0x3cf906(0x1db)](_0x3cf906(_0x132e8b._0x54c019),_0x3ddb01,!0x1):_0xdeb175['attachEvent'](_0x3cf906(_0x132e8b._0x553a30),_0x3ddb01);},'isArray':function(_0x2d085e){var _0x4953a9=_0x302c06;return _0x2d085e&&'[object\x20Array]'===Object[_0x4953a9(0x1e0)]['toString']['call'](_0x2d085e);},'trim':function(_0x198c20){var _0x3568aa=_0x302c06;return null==_0x198c20?'':(_0x198c20+'')[_0x3568aa(0x1f7)](/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,'');},'eval':function(_0x1fa04e,_0x1c30ca){var _0x1f149b=_0x302c06,_0x32626d=/\(.*?\)$/g,_0x180537=_0x1fa04e[_0x1f149b(0x19f)](_0x32626d),_0x52da6b='',_0x11b52c=_0x180537&&_0x180537[0x0]?_0x180537[0x0]:_0x1fa04e,_0x497218=this===_0x514e91?_0xdeb175:(_0x52da6b=Object[_0x1f149b(0x1c9)](this)['toString']()[_0x1f149b(0x1f7)](/,/g,'|'),this);return _0x1fa04e=_0x52da6b?(_0x11b52c=_0x11b52c[_0x1f149b(0x1f7)](new RegExp(_0x52da6b,'gm'),_0xbf6b17=>'this.'+_0xbf6b17),_0x1fa04e[_0x1f149b(0x1f7)](_0x180537?_0x32626d:_0x1fa04e,_0x11b52c)):_0x1fa04e,new Function(_0x1f149b(0x1af)+_0x1fa04e+')')['call'](_0x497218);},'dataRender':function(_0x22fb94,_0x268a8f,_0x4c79a5){return _0x22fb94['replace'](/\{{(.+?)\}}/g,function(_0x5d9f80,_0x5c9248){var _0x501577=_0x1169;return _0x4c79a5?_0x4c79a5(_0x5d9f80,_0x5c9248):_0x514e91[_0x501577(_0x449195._0x2ccd1e)][_0x501577(0x191)](_0x268a8f,_0x5c9248);});},'resize':function(_0x4ba7a5){var _0x2f92bc=_0x302c06;_0x4ba7a5&&_0x4ba7a5[_0x2f92bc(_0x2b7666._0x2603bc)]&&_0xe614f2['push'](_0x4ba7a5);},'isElement':function(_0x17439d){var _0x59de56=_0x302c06;return(_0x59de56(_0x5d1687._0x10d1e7)==typeof HTMLElement?function(_0x152c66){return _0x152c66 instanceof HTMLElement;}:function(_0x5c078f){return _0x5c078f&&0x1===_0x5c078f['nodeType'];})(_0x17439d);},'isPhoneNum':function(_0x487eee){return/^[1][3,4,5,6.7,8,9][0-9]{9}$/['test'](_0x487eee);}}),_0x514e91['extend']({'getWindowHeight':function(){var _0x48e812=_0x302c06;return _0xdeb175['innerHeight']||_0x57be12[_0x48e812(_0x3d2e81._0x1f9617)]||_0x2b7caa['clientHeight'];},'parseRem':function(_0x1c514c){var _0x148240=_0x302c06;return _0xdeb175[_0x148240(0x1a4)](_0x1c514c)*this['envir'][_0x148240(_0x47b241._0x5f1317)];},'parsePixel':function(_0x1d00c2){var _0x23029b=_0x302c06;return _0x1d00c2/this[_0x23029b(0x18b)][_0x23029b(_0x4fa5c4._0x18df13)];},'parseRpx':function(_0xaf49c5){var _0x6bc7cf=_0x302c06;return _0xaf49c5*this[_0x6bc7cf(0x18b)]['wpr'];},'parseWpx':function(_0x40c492){var _0xce8265=_0x302c06;return _0x40c492/this['envir'][_0xce8265(0x1dc)];},'rpxToRem':function(_0x5127e3){var _0x38f21e=_0x302c06;return _0x5127e3/this['envir'][_0x38f21e(0x1dc)]*this[_0x38f21e(0x18b)][_0x38f21e(0x1b9)];},'areaVisualNormal':function(_0x290844){var _0x91781b=_0x302c06,_0x2f5da9=this[_0x91781b(0x1e8)]['dpr'],_0x52bb00=this[_0x91781b(0x1e8)][_0x91781b(0x1be)]/_0x2f5da9+'%';_0x290844[_0x91781b(0x1b2)]['transformOrigin']=_0x91781b(_0x5bd0b6._0x53f1f2),_0x290844['style'][_0x91781b(_0x5bd0b6._0x560344)]=_0x91781b(0x192)+_0x2f5da9+')',_0x290844[_0x91781b(0x1b2)][_0x91781b(_0x5bd0b6._0x1f3b5c)]=_0x52bb00,_0x290844[_0x91781b(_0x5bd0b6._0x5ed43f)][_0x91781b(0x19b)]=_0x52bb00,_0x290844[_0x91781b(_0x5bd0b6._0x5ed43f)][_0x91781b(_0x5bd0b6._0x4fdaa2)]=this['setting']['fs']+'px';},'openCalcLayout':function(_0x49bbc4){var _0x4d2a6e={_0x5ed957:0x1ca},_0x34c126=_0x302c06;this[_0x34c126(0x1e8)]['dpr']=_0x49bbc4&&_0x49bbc4[_0x34c126(0x1f9)]||_0x265ad1;var _0x297761=this[_0x34c126(0x1e8)]['h']/this[_0x34c126(0x1e8)]['w'],_0x555b4b=this[_0x34c126(_0x3726a9._0xb14635)]['mw'],_0x5224ad=function(){var _0x34a9c3=_0x34c126,_0x699ede=_0x2b7caa['clientWidth']>_0x555b4b?_0x2b7caa[_0x34a9c3(_0x4d2a6e._0x5ed957)]:_0x555b4b,_0x33beee=_0x699ede*_0x297761;_0x514e91['calcLayout'](_0x33beee,_0x699ede);};_0x5224ad(),this[_0x34c126(0x186)](_0x5224ad);},'calcLayout':function(_0x2ae851,_0x4889f3){var _0x1b46dc={_0x629ca8:0x185,_0x4b88fc:0x1d0,_0xadf496:0x1e5,_0x355f8d:0x1b3},_0x54475c=_0x302c06;if(_0x4889f3){var _0x130ed3=this['setting'][_0x54475c(_0x5d1fd9._0x523df2)],_0x1877a2=this[_0x54475c(_0x5d1fd9._0x54b93f)]['fs']*_0x130ed3,_0x4d003e=this[_0x54475c(_0x5d1fd9._0x54b93f)]['w'],_0x297412=_0x4d003e/this[_0x54475c(_0x5d1fd9._0x54b93f)][_0x54475c(0x1be)],_0x32788d=_0x297412/_0x4d003e,_0x2997c8=0x1/_0x130ed3,_0x4b0cef=_0x4889f3-_0x4d003e,_0x5425ed=_0x4b0cef>0x0?_0x4d003e:!(_0x4b0cef=0x0)&&_0x4889f3;this[_0x54475c(0x18b)]['remBase']=_0x32788d,this[_0x54475c(0x18b)][_0x54475c(0x1dc)]=_0x5425ed/_0x4d003e*_0x130ed3,_0x2b7caa[_0x54475c(_0x5d1fd9._0x449767)][_0x54475c(0x1ac)]=this[_0x54475c(0x1e8)][_0x54475c(0x1be)]*(_0x5425ed/_0x4d003e)*_0x130ed3+'px';var _0x2a144c=function(){var _0x51a370=_0x54475c;(document[_0x51a370(_0x1b46dc._0x629ca8)](_0x51a370(_0x1b46dc._0x4b88fc))||_0x1c7c71)['style'][_0x51a370(0x1f0)]='display:block;width:'+_0x297412+_0x51a370(_0x1b46dc._0xadf496)+0x64*_0x130ed3+'%;'+_0x41f617+':scale('+_0x2997c8+');'+_0x41f617+_0x51a370(_0x1b46dc._0x355f8d)+_0x4b0cef+_0x51a370(0x1c6)+_0x32788d*_0x1877a2+_0x51a370(0x184);};_0x1c7c71?_0x2a144c():_0x514e91[_0x54475c(0x1f1)](_0x2a144c);}}}),_0x514e91[_0x302c06(0x1dd)]({'funchain':function(_0x44d51f,_0x507a63){var _0x2b3fe6={_0x1288b8:0x1d4},_0x4bb7d7={_0xe43e0a:0x191,_0x4604a1:0x1fa},_0x541d2b=_0x302c06;_0x507a63=_0x514e91[_0x541d2b(0x1cb)](_0x507a63)?_0x507a63:[_0x44d51f,[]][_0x514e91[_0x541d2b(0x1cb)](_0x44d51f)?~~(_0x44d51f=void 0x0):0x1],len=_0x507a63[_0x541d2b(0x1a7)],_0x514e91[_0x541d2b(_0x111aab._0x25a20f)](function(){var _0x499b14=_0x541d2b;function _0x44a774(_0x4208a9){var _0x5e9232=_0x1169;if(_0x5e64d7[_0x4208a9])return _0x5e64d7[_0x4208a9][_0x5e9232(0x1d7)];var _0x17ef6c=_0x5e64d7[_0x4208a9]={'exports':{},'id':_0x4208a9,'loaded':!0x1,'prev':function(){return _0x44a774(_0x4208a9&&_0x4208a9-0x1);},'next':function(){return _0x4208a9<len-0x1?_0x44a774(_0x4208a9+0x1):null;},'first':function(){return _0x44a774(0x0);},'last':function(){return _0x44a774(len-0x1);}};return _0x17ef6c[_0x5e9232(0x1fa)]=!0x0,_0x44a774['i']=_0x4208a9,_0x507a63[_0x4208a9]?_0x507a63[_0x4208a9][_0x5e9232(_0x4bb7d7._0xe43e0a)](_0x17ef6c,_0x17ef6c[_0x5e9232(0x1d7)],_0x44a774,_0x4208a9):_0x44d51f[_0x5e9232(0x191)](_0x17ef6c,function(_0x4504fd){_0x44a774(_0x4504fd||0x0);},_0x17ef6c['exports'],_0x44a774),_0x17ef6c[_0x5e9232(_0x4bb7d7._0x4604a1)],_0x17ef6c[_0x5e9232(0x1d7)];}var _0x5e64d7={};return _0x44a774['m']=_0x507a63,_0x44a774['c']=_0x5e64d7,_0x44a774['p']='',_0x44a774(_0x44d51f?_0x499b14(_0x2b3fe6._0x1288b8):0x0);});},'Async':new function(){var _0x11bfb7={_0x157ee0:0x18f},_0x410adc={_0x1dc753:0x1d5},_0x5044bf={_0x11e113:0x1bc},_0x1d4d7a={_0x1e50ce:0x1fc},_0x1bbc0c={_0x282b2f:0x1e0},_0x5529f0={_0x562da1:0x1c3},_0x54582a={_0x1daeb1:0x188,_0x35689f:0x188},_0xfa5cd5=_0x302c06;_0x514e91[_0xfa5cd5(_0x22471d._0x40d418)][_0xfa5cd5(0x191)](this,{'timeoutFilter':function(_0x560df1){var _0x5975d8=0x0;return _0x560df1=_0x560df1||0x3e8,_0x2a55a5=>{_0x5975d8&&clearTimeout(_0x5975d8),_0x5975d8=setTimeout(_0x2a55a5&&_0x2a55a5||function(){},_0x560df1);};},'timerCtrl':function(_0x1a0f0f,_0x10f945){var _0x58faa7={_0x539dcd:0x188},_0x17f8ad={_0x593cf7:0x1a1,_0x30cfb7:0x1c3,_0x4481ec:0x191},_0x3d6e41={_0x516b07:0x1f5,_0x46967f:0x1a1,_0x4692e1:0x1f5},_0x6c4310=_0xfa5cd5,_0x178e46={'timer':_0x1a0f0f||0x1388,'name':_0x10f945,'run':function(_0x5125e2){var _0x52d552=_0x1169;clearInterval(_0x178e46[_0x52d552(0x188)]),_0x178e46[_0x52d552(0x188)]=setInterval(_0x178e46['fn'][_0x52d552(0x1fc)](_0x178e46[_0x52d552(_0x3d6e41._0x516b07)]),_0x178e46[_0x52d552(_0x3d6e41._0x46967f)]),_0x5125e2&&_0x178e46['fn'][_0x52d552(0x1fc)](_0x178e46[_0x52d552(_0x3d6e41._0x4692e1)])();}},_0x17aae9=function(_0x31e8ba){var _0x226b4b=_0x1169;_0x178e46['timer']=_0x31e8ba,_0x178e46['layer']=this;var _0x1e0e1b=function(_0x58d3de,_0x54b7d2,_0xce157e){var _0x4deb7a=_0x1169;'function'==typeof _0x58d3de&&(_0x178e46[_0x4deb7a(0x1c1)]=_0xce157e,_0x54b7d2&&(_0x178e46[_0x4deb7a(_0x17f8ad._0x593cf7)]=_0x54b7d2),_0x178e46['fn']=_0x58d3de,_0x178e46[_0x4deb7a(_0x17f8ad._0x30cfb7)][_0x4deb7a(_0x17f8ad._0x4481ec)](this));};return _0x1e0e1b[_0x226b4b(0x1d8)]=this[_0x226b4b(0x1d8)],_0x1e0e1b;};return _0x17aae9[_0x6c4310(_0x1bbc0c._0x282b2f)]={'stop':function(){var _0xd1a20=_0x6c4310;_0x178e46[_0xd1a20(_0x54582a._0x1daeb1)]&&clearInterval(_0x178e46[_0xd1a20(_0x54582a._0x35689f)]);},'start':function(_0x16de84){var _0x2b47a0=_0x6c4310;_0x178e46['fn']&&_0x178e46[_0x2b47a0(0x1c3)]['call'](this,_0x16de84);},'setTime':function(_0xe770ca){var _0x290b1c=_0x6c4310;_0xe770ca&&(_0x178e46['timer']=_0xe770ca),_0x178e46['fn']&&_0x178e46[_0x290b1c(_0x5529f0._0x562da1)][_0x290b1c(0x191)](this);},'clear':function(){var _0x4c8e85=_0x6c4310;_0x178e46[_0x4c8e85(_0x58faa7._0x539dcd)]&&clearInterval(_0x178e46[_0x4c8e85(_0x58faa7._0x539dcd)]),_0x178e46={'timer':0x1388};}},new _0x17aae9(_0x1a0f0f);},'loopList':function(_0xa90349,_0x12982d,_0x12ed4f){var _0x1995cc={_0x3fd532:0x191},_0x60c6be=_0xfa5cd5,_0x54903a=_0x60c6be(0x194)==typeof _0xa90349?Object[_0x60c6be(0x1c9)](_0xa90349):_0xa90349||[],_0x25bde4=_0x54903a[_0x60c6be(0x1a7)];(function _0x498980(_0x40d3ba){_0x40d3ba<_0x25bde4?((()=>{var _0xf7a7ff=_0x1169,_0x59ec3d=_0x54903a[_0x40d3ba];_0x12982d&&_0x12982d[_0xf7a7ff(0x191)](this,_0x59ec3d,_0xa90349[_0x59ec3d],()=>{var _0x471f46=_0xf7a7ff;_0x498980[_0x471f46(0x191)](this,++_0x40d3ba);},_0x40d3ba);})()):((()=>{var _0x4a8019=_0x1169;_0x12ed4f&&_0x12ed4f[_0x4a8019(_0x1995cc._0x3fd532)](this);})());}[_0x60c6be(_0x1d4d7a._0x1e50ce)](this)(0x0));},'Promise':function(_0x694734){var _0x22196e={_0x2abd26:0x1a2},_0x4da59f={_0xd4682d:0x183},_0x4e90a7=_0xfa5cd5;let _0x3fb3cc=_0x4e90a7(_0x1468da._0x2b38c4),_0x2f5ab1=_0x4e90a7(0x1f4),_0x172665='[[PromiseState]]',_0x2fa19d=new Promise(function(_0x476d43,_0x3d735e){var _0x2e0171=_0x4e90a7;_0x694734[_0x2e0171(_0x5044bf._0x11e113)]=function(){_0x3d735e(arguments[0x0]),Object[_0x3fb3cc](_0x363704,_0x172665,{'value':'rejected','writable':!0x0});},_0x694734(_0x476d43,_0x3d735e);}),_0x363704=new function(){var _0x5545dc=_0x4e90a7;this[_0x5545dc(0x1d8)][_0x5545dc(_0x410adc._0x1dc753)]=_0x2fa19d[_0x5545dc(0x1d5)];}(),_0x406912=_0x363704[_0x4e90a7(_0x1468da._0x36642d)];return Object[_0x3fb3cc](_0x406912,_0x4e90a7(_0x1468da._0x4b64af),{'value':function(){var _0x54709b=_0x4e90a7;let _0x207dd7=arguments[0x0];return _0x2fa19d=_0x2fa19d[_0x54709b(_0x11bfb7._0x157ee0)](async function(){var _0x56bb82=_0x54709b;if(_0x56bb82(0x190)!==_0x363704[_0x172665]){var _0x3d8ee7=await _0x207dd7(_0x363704[_0x2f5ab1]||arguments[0x0]);return Object[_0x3fb3cc](_0x363704,_0x2f5ab1,{'value':_0x3d8ee7||_0x363704[_0x2f5ab1],'writable':!0x0}),_0x3d8ee7;}},function(_0x1a8f59){}),_0x363704;}}),Object[_0x3fb3cc](_0x406912,_0x4e90a7(0x183),{'value':function(){var _0x555f6f=_0x4e90a7;return _0x2fa19d[_0x555f6f(_0x4da59f._0xd4682d)](arguments[0x0]),_0x2fa19d;}}),Object[_0x3fb3cc](_0x406912,'finally',{'value':function(){var _0x14844d=_0x4e90a7;let _0xe016bf=arguments[0x0];return _0x2fa19d[_0x14844d(_0x22196e._0x2abd26)](function(){return _0xe016bf&&_0xe016bf(),_0x363704;}),_0x363704;}}),Object[_0x3fb3cc](_0x406912,_0x4e90a7(0x1bc),{'value':_0x694734[_0x4e90a7(0x1bc)]}),_0x363704;}});}(),'Utils':new function(){var _0x5b8f2d={_0x4e5951:0x1a7,_0x5024ed:0x1c9},_0x197af7={_0x22a6b4:0x1f7},_0x46cded={_0x22b735:0x1c2,_0x49f1bd:0x1b0};return{'UUID':function(){var _0x326bbc=_0x1169;return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'[_0x326bbc(0x1f7)](/[xy]/g,function(_0x2879d3){var _0x2475d2=_0x326bbc,_0x4098c1=0x10*Math[_0x2475d2(_0x46cded._0x22b735)]()|0x0;return('x'==_0x2879d3?_0x4098c1:0x3&_0x4098c1|0x8)[_0x2475d2(_0x46cded._0x49f1bd)](0x10);});},'Guid':function(_0x553b1a,_0x5dad63){var _0x19555b=_0x1169;return(_0x553b1a||'')+(_0x5dad63?new Array(_0x5dad63+0x1)[_0x19555b(0x1ea)]('x'):_0x19555b(0x1bb))[_0x19555b(_0x197af7._0x22a6b4)](/[xy]/g,function(_0x20a539){var _0x8ba012=_0x19555b,_0x5acd68=0x10*Math[_0x8ba012(0x1c2)]()|0x0;return('x'==_0x20a539?_0x5acd68:0x3&_0x5acd68|0x8)[_0x8ba012(0x1b0)](0x10);});},'treeListBuild':function(_0x4c299f){var _0x29d643=_0x1169;for(var _0x34adcb={},_0x236002={},_0x49e627=_0x4c299f[_0x29d643(_0x5b8f2d._0x4e5951)],_0x278856=0x0;_0x278856<_0x49e627;_0x278856++){_0x34adcb[~~(_0x130b01=_0x4c299f[_0x278856])[_0x29d643(0x18a)]]=_0x236002[_0x130b01['id']]=_0x130b01;}for(var _0x130b01 of _0x4c299f){var _0x5dc80a=_0x236002[_0x130b01['pid']];if(_0x5dc80a){var _0x46a1cf=_0x5dc80a[_0x29d643(0x1f6)];_0x5dc80a[_0x29d643(0x1f6)]=_0x46a1cf&&_0x46a1cf[_0x29d643(0x1c4)](_0x130b01)&&_0x46a1cf||[_0x130b01];}}return _0x236002=null,_0x34adcb[Object[_0x29d643(_0x5b8f2d._0x5024ed)](_0x34adcb)[_0x29d643(0x19e)]()[0x0]];}};}()}),_0xdeb175['addEventListener'](_0x302c06(0x186),function(){var _0x3ec176=_0x302c06;for(var _0xddda80=_0xe614f2[_0x3ec176(_0x4400d2._0x353a73)],_0x890bf2=0x0;_0x890bf2<_0xddda80;_0x890bf2++)_0xe614f2[_0x890bf2]['call'](_0x514e91);},!0x1),(_0x514e91[_0x302c06(_0x4aeaea._0x2e2717)][_0x302c06(_0x4aeaea._0x11cf01)]=function(_0x355d83,_0x3c8764){var _0x5a97f6=_0x302c06;return _0x355d83[_0x5a97f6(_0x2a61ca._0x50a98e)]?(this[0x0]=_0x355d83,this[_0x5a97f6(_0x2a61ca._0xb9304f)]=0x1,this):typeof _0x355d83===_0x5a97f6(_0x2a61ca._0xcf33e9)?_0x514e91[_0x5a97f6(0x1f1)](_0x355d83,_0x3c8764):_0x355d83;})[_0x302c06(_0x4aeaea._0x188a08)]=_0x514e91[_0x302c06(_0x4aeaea._0x2e2717)],_0x514e91(function(){},0x1),_0xdeb175['qf']=_0x2f444c['qf']=_0x514e91;}(_0x384570));}(_0x47ff9f(0x1e4)!=typeof window?window:this);}]));function _0x1ed1(){var _0xca68f3=['keys','clientWidth','isArray','22259380Wazumc','transition','apply','documentElement','views','ransform','oRequestAnimationFrame','body','init','constructor','4241637oUGrUm','exports','__proto__','contentWindow','cancelRequestAnimationFrame','addEventListener','wpr','extend','Module','55OHpXzI','prototype','search','userAgent','createElement','undefined','rem;height:','height','toStringTag','setting','oCancelRequestAnimationFrame','join','test','defineProperty','hasOwnProperty','nodeType','default','cssText','ready','readyState','onload','[[PromiseResult]]','layer','children','replace','document','dpr','loaded','mousedown','bind','catch','rem;opacity:1','getElementById','resize','toLowerCase','timerPointer','4544456aAirpD','pid','envir','toUpperCase','devicePixelRatio','(((.+)+)+)+$','then','rejected','call','scale(','div','object','appVersion','charAt','substr','touchcancel','transform','webkitRequestAnimationFrame','width','msRequestAnimationFrame','467778RqNByC','sort','match','mouseup','timer','finally','prt','parseInt','splice','requestAnimationFrame','length','function','webkitCancelAnimationFrame','webkitCancelRequestAnimationFrame','59421hNteKK','fontSize','split','eval','return\x20(','toString','__esModule','style','-origin:','mousemove','touchend','44BjPDOS','0\x200','load','remBase','clientHeight','xxxxxxxx','abort','touchstart','dprb','mozRequestAnimationFrame','805303sOIqzm','name','random','run','push','16vberGU','px\x200;font-size:','Window\x20object\x20not\x20found!','969192KlpLXD'];_0x1ed1=function(){return _0xca68f3;};return _0x1ed1();}
\ No newline at end of file
/*
name: qf_web_ui
version: V1.160
*/
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){!function(e){document;var t=document.body;window;new function(){var i={},o={getRegistStyle:function(e){return{loader:[{i:0,k:"@keyframes loader-a1",v:"0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}"},{i:1,k:"@keyframes loader-a2",v:"0%{transform:rotate(0deg)}100%{transform:rotate(-360deg)}"},{i:2,k:".kim-loader:before,.kim-loader:after",v:'content:"";position:absolute;border-radius:50%;border:4px solid #1276E3;'},{i:3,k:".kim-loader:before",v:"height:60px;width:60px;border-left-color:transparent;border-bottom:0;animation:loader-a1 1s cubic-bezier(.42, .61, .58, .41) infinite;"},{i:4,k:".kim-loader:after",v:"height:40px;width:40px;border-top-color:transparent;border-right:0;animation:loader-a2 1s cubic-bezier(.42, .61, .58, .41) infinite;"}]}[e]},createStyleElement:function(e,t){var n=document.createElement("style");return n.type="text/css",n.id=e||"kmb-popmd-e3d8-style",t?t.appendChild(n):document.head.appendChild(n),n},getStyleSheet:function(e,t){return(document.getElementById(e||"kmb-popmd-e3d8-style")||this.createStyleElement(e,t)).sheet},setStyleSheet:function(e,t,n,i){var o=i||this.getStyleSheet();o&&(o.insertRule?o.insertRule(e+"{"+t+"}",n):o.addRule(e,t,n))},setStyleSheets:function(e){var t=this.getStyleSheet();if(!t.rules[e[0].i])for(var n of e){var i=n.k,o=n.v,r=n.i;t.insertRule?t.insertRule(i+"{"+o+"}",r):t.addRule(i,o,r)}}};let r=function(e){var t=e.zIndex||2023,n=e.className?" "+e.className:"",i=e.backgroundColor||"rgba(0,0,0,.5)",o=document.getElementById(e.id||"kmbBaseLayer_e3d8")||document.createElement("div");o.id=e.id||"kmbBaseLayer_e3d8",o.className="kmb-basepopuplayer"+n;var r=e.coverFull?"width:100%;justify-content:center;":"";return o.style.cssText="position:fixed;top:0;left:0;width:0;height:100%;"+r+"z-index:"+t+";background-color:"+i+";display:flex;align-items:center;",o},a=function(t,n){if("Object"===n.constructor.name&&n.show){var i=e.extend.call({size:12,point:"top",x:0,y:0,borderColor:"#3EB7EA",background:"rgba(0,0,0,.9)"},n||{}),o=i.size||12,r=i.point||"top",a=i.x||0,s=i.y||0,l=i.borderColor||"#3EB7EA",c=i.background||"rgba(0,0,0,.9)",u=0-o/2,d=~~Math.sqrt(o*o*2)-o-1,h="left",m="top",f=d,p=u,v=45;"left"===r||"right"===r?(f=u,p=d,v="right"===r?(h="right")&&135:-45):"bottom"===r&&(m="bottom",v=225);var g=~~(o+2)+"px",b='content:"";position:absolute;'+(m+":"+(p+s)+"px")+";"+(h+":"+(f+a)+"px")+";height:"+o+"px;width:"+o+"px;",y="border-color:"+l+" transparent transparent "+l+";",x=document.createElement("i");x.style.cssText=b+"background-color:"+c+";border-style:solid;border-width:1px;"+y+"transform:rotate("+v+"deg);clip-path:polygon(0% 0, "+g+" 0, 0% "+g+");",t.appendChild(x)}},s=function(e,t){var n=(t="Object"===t.constructor.name?t:{horizontal:"right",vertical:"top"}).vertical||"top",i=t.horizontal||"right",o=document.createElement("i");o.innerText="",o.className="close",o.style.cssText="position:absolute;"+n+":-.13rem;"+i+":-.13rem;height:.26rem;width:.26rem;font-style:normal;font-size:.30rem;font-weight:100;border:1px solid #3EB7EA;display:flex;justify-content:center;align-items:center;border-radius:.20rem;transform:rotate(45deg);background:rgba(0,0,0,.5);cursor:pointer;color:#3EB7EA;user-select:none;",e.appendChild(o)};e.extend.call(this,{popupLayer:function(e){var t=e.title&&(e.title.indexOf("<")>-1?e.title:"<span>"+e.title+"</span>")||"",n=e.closeBtnColor?"color:"+e.closeBtnColor:"",i=t?'<div class="qfui-message-box el-message-box__header"><div class="el-message-box__title">'+t+"</div></div>":"",o=e.confirm,r="[object Function]"===Object.prototype.toString.call(o)?'<div class="el-message-box__btns"><button type="button" aria-label="Confirm" class="el-button el-button--default el-button--small el-button--primary">确定</button></div>':"",a='<div class="kmb-message-box custom-alert">'+i+'<div class="el-message-box__content" style="min-width:300px;width:'+e.width+'"><div class="alert-ctbox">'+(e.html||"")+"</div></div>"+r+'<button class="el-message-box__headerbtn el-icon-close" aria-label="Close" style="'+n+'"></button></div>',s=document.createElement("div");s.id="culayer",s.className="el-message-box__wrapper "+(e.className||""),s.style.cssText="z-index:2001;background-color:rgba(0,0,0,.5);",s.innerHTML=a,document.body.appendChild(s);var l=s.querySelector(".alert-ctbox");e.onload&&e.onload(l),s.onclick=function(t){var n=t.target||t.srcElement;"BUTTON"===n.nodeName&&("Confirm"===n.getAttribute("aria-label")?(document.body.removeChild(s),e.confirm&&e.confirm(l)):"Close"===n.getAttribute("aria-label")&&(document.body.removeChild(s),e.close&&e.close()))}},scrollingPreview:function(t){var n=0,i=(t=t||{}).container,o=t.speed||.3333,r=function(t){var i=this;this.box=t,this.init(),e.resize((function(){this.rTimer&&clearTimeout(this.rTimer),delete this.rTimer;var e=i.boundary.dist,o=e?e/(i.boundary=i.getBoundary()).dist:1;t.scrollTop=n/=o,this.rTimer=setTimeout(()=>{!i.animId&&i.start()},1500)}))};return r.prototype={init:function(){var e=this;this.flag=this.getPointer(),this.box.onmousedown=function(){e.cancel()},this.box.onmouseup=function(t){t.target.className.match("scrolling4")&&(n=t.target.scrollTop),e.start()},e.start()},getBoundary:function(){var e=this.box.scrollHeight-this.box.offsetHeight;return{dist:e,apex:e*((this.flag+1)/2)}},getPointer:function(){return Math.abs(this.box.scrollTop-1)-this.box.scrollTop},getItemHeight:function(e){return(e.children.length>2?e.lastElementChild:{}).offsetHeight||30},start:function(){this.boundary=this.getBoundary(),this.childHeight=this.getItemHeight(this.box),this.boundary.dist>this.childHeight&&this.animloop()},animloop:function(){this.box.scrollTop*this.flag>=this.boundary.apex?(this.flag=this.getPointer(),this.boundary=this.getBoundary(),this.boundary.dist>this.childHeight?this.animloop():this.cancel()):(this.box.scrollTop=n,i.scrollHeight-i.offsetHeight<n&&(this.flag=this.getPointer(),this.boundary=this.getBoundary()),n+=o*this.flag,this.animId=window.requestAnimationFrame(this.animloop.bind(this)))},cancel:function(){this.animId&&cancelAnimationFrame(this.animId),delete this.animId},update:function(){this.cancel(),this.start()}},{update:function(){new r(i).update()}}},Notify:function(n){var i=this,o={close:!0},r=(n=n||{}).duration||2e4,a=n.title||"提示",s=n.type||"warning",l=n.message||"提示内容!",c=n.zIndex||2e3;return position=n.position||"bottom",this.__proto__={open:function(u){u=u||{},o.ctn=o.ctn||document.createElement("div"),o.ctn.className="el-notification right el-notification-fade-enter el-notification-fade-leave-active",o.ctn.style=position+":16px;z-index:"+c+";",o.ctn.innerHTML='<i class="el-notification__icon el-icon-'+s+'"></i><div class="el-notification__group is-with-icon"><h2 class="el-notification__title">'+(u.title||a)+'</h2><div class="el-notification__content">'+(u.content||l)+'</div><div class="el-notification__closeBtn el-icon-close"></div></div>',t.appendChild(o.ctn),setTimeout((function(){o.ctn.classList.remove("el-notification-fade-enter","el-notification-fade-leave-active")}),100),o.timer=e.Async.timeout((function(){i.close()}),r),o.ctn.onclick=function(e){var t=e.target||e.srcElement;t.classList.contains("el-icon-close")?i.close():n.onClick&&n.onClick(t)},o.ctn.addEventListener("mouseenter",(function(){!o.await&&o.timer.pause()}),!1),o.ctn.addEventListener("mouseleave",(function(){!o.await&&o.timer.continued()}),!1)},close:function(e){o.close&&(o.await=!0,o.ctn.classList.add("el-notification-fade-leave-active"),o.timer.clear(),setTimeout((function(){t.removeChild(o.ctn),!e&&n.onClose&&n.onClose()}),200),delete o.close)},pause:function(){o.await=!0,o.timer.pause()},recover:function(){o.timer.continued(),o.await=!1}},n.autoOpen&&this.open(),this},baseLayer:function(e){var t=e.html||'<div class="kmbbase-wrap"></div>',i=e.className?" "+e.className:"",o=e.container||document.body,a=e.name||"",s=e.id||n.Guid("k");return function(){var n,l,c=(n=o,(l=function(){var o,l,c=this,u=this.Wrap=(o=document.createElement("div"),l="k"+s+i,o.className="kmb-popmd-e3d8 "+l,o.style.cssText="position:absolute;display:none;",o.innerHTML=t,o),d=e.cover?this.parent=r(e).appendChild(u).parentNode:u;n.appendChild(d),this.el=this.Wrap.firstElementChild||this.Wrap,this.container=d,this.parent=this.parent||n,this.id=s,this.name=a,d.onclick=function(t){t.target||t.srcElement,e.click&&e.click(t)},Object.defineProperty(this,"show",{set:function(t){(e.show=t)?c.open():c.hide()},get:function(){return e.show}}),c.show=!1!==e.show}).prototype={open:function(){this.Wrap.style.display="block"},hide:function(){this.Wrap.style.display="none"},close:function(){e.close&&e.close()},remove:function(e){this.Wrap.remove(),this.show=!1,n!==this.parent&&!this.parent.firstElementChild&&n.removeChild(this.parent),this.close()},setStyle:function(e,t){Object.assign((e||this.Wrap).style,t)}},new l);return this.prototype={},e.onload&&e.onload(c),c}.call((function(){}))},popWindow:function(e){e=e||{};var t=this.baseLayer(e);e.pointer&&a(t.Wrap,e.pointer),e.closeButton&&(e.closeEvent=!0)&&s(t.Wrap,e.closeButton);var n=e.click;return e.click=function(i){var o=i.target||i.srcElement;n&&n(o),e.closeEvent&&o.classList.contains("close")&&o.parentNode===t.Wrap&&t.remove(i)},t},checkListRender:function(e){var t=(e=e||{}).list||[],i=e.select||[],o=e.type||"radio",r="radio"===o?'name="'+n.Guid("k")+'" ':"",a="",s=(document.createElement("div"),function(e){for(var t of i)return e===t});for(var l of t){var c=l[e.name||"name"],u=l[e.value||"value"];a+='<dd><label style="display:flex;user-select:none;cursor:pointer;"><span style="display:flex;"><input type="'+o+'" '+(s(u)?'checked="true"':"")+' value="'+u+'" '+r+' data-name="'+c+'"></span><span class="el-'+o+'__label"><span>'+c+"</span></span></label></dd>"}return'<div class="kmb-checkbox" style="position:relative;height:100%;"><dl class="scrolling4">'+a+"</dl></div>"},selectRender:function(e,t,n){for(var i=t.length,o="",r=0;r<i;r++){var a=t[r];o+='<option value="'+a[n.value||"value"]+'" data-index="'+r+'">'+a[n.name||"name"]+"</option>"}return n.onchange&&(e.onchange=function(e){var t=(e.target||e.srcElement).selectedOptions[0];n.onchange(t.value,t)}),e.innerHTML=o,n.onload&&n.onload(e.options[0]&&e.options[0].value),e},progressBar:function(t){t=t||{};var n=this;return e.UI.popWindow({name:"div_1",html:'<div class="progress" style="width:7rem;"><div class="progress-bar" style="width:0%">0</div></div>',onload:function(e){var i=o.getStyleSheet("progressStyle",e.Wrap);o.setStyleSheet(".progress","position:relative;height:15px;line-height:14px;border-radius:20px;box-sizing:content-box;color:#fff;font-size:12px;text-align:center;user-select:none;",0,i),o.setStyleSheet(".progress .progress-bar","animation:reverse progress-bar-stripes 0.80s linear infinite,animate-positive 1s;border-radius:20px;background-color:#5bc0de;background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:40px 40px;height:100%;transition:width .3s ease;",1,i),o.setStyleSheet("@keyframes progress-bar-stripes","from{background-position:40px 0}to{background-position:0 0}",2,i),o.setStyleSheet("@keyframes animate-positive","0%{width:0}",3,i),e.setStyle(e.Wrap,t);var r=e.el.firstElementChild;e.setValue=function(e){r.innerText=e+"%",r.style.width=e+"%"},n.model=e}}),n.model},loading:function(t){var r=(t=t||{}).timer||0,a=t.zIndex||1e3,s=t.container||document.body,l=s.dataset.loaderid||n.Guid(),c="loadingUI_"+l+(t.id||""),u=i[c];return u?(u.clearTimer(),r&&u.timeout(r),u.res):(s.dataset.loaderid=l,o.setStyleSheets(o.getRegistStyle("loader")),u=i[c]={id:c,layer:function(){var n='<div class="kim-loader" style="position:absolute;top:50%;left:50%;height:80px;width:80px;margin:-40px 0 0 -40px;display:flex;justify-content:center;align-items:center;"></div>';if("none"!==t.mask){var i=t.maskColor||"rgba(0,0,0, .5)";return e.UI.baseLayer({closeEvent:!0,container:s,html:n,onload:function(e){e.setStyle(e.Wrap,{top:0,left:0,height:"100%",width:"100%",backgroundColor:i,zIndex:a})}})}var o=document.createElement("div");return o.innerHTML=n,s.appendChild(o.firstElementChild)}(),timeout:function(e){this.timerId=setTimeout(()=>{this.layer.remove(),delete i[c]},e)},clearTimer:function(e){delete i[c],this.timerId&&clearTimeout(this.timerId)}},r&&u.timeout(r),u.res={close:function(){u.clearTimer(),u.layer.remove()}})},tabStyleActive:function(e,t,n,i){if(!t.classList.contains(n)){var o=e.querySelector("."+n);o&&o.classList.remove(n),t.classList.add(n),i&&i()}}}),e.UI=this},new function(){var t=e.Async||this;t.__proto__={intervalLoop:function(e,t,n){var i=function(e,t,n){t&&t(),this.timer=setInterval((function(){n?n():t()}),e||3e3)};return i.prototype={clear:function(){clearInterval(this.timer)}},"function"==typeof t?new i(e,t,n):console.log("intervalLoop param must contain function")},timeout:function(e,t){return t=t||3e3,new function(){var n,i,o;return this.__proto__={start:function(t){i=(new Date).getTime(),n=setTimeout((function(){t=i=o=0,e&&e()}),t)},pause:function(){
//!pauseTime && (pauseTime = new Date().getTime());this.clear()
o=(new Date).getTime(),this.clear()},continued:function(e){t-=o-i,o&&t>0&&this.start(e||t)},clear:function(){clearTimeout(n)}},this.start(t),this}},randomRuntimer:function(t,n){if("randomRuntimer"!==this.constructor.name)return Error("Please instance this object first");let i={getDefaultTime:function(){return 1e3*(4+~~(6*Math.random()+1))},nowCallback:!1,firstTimer:null},o=(n=n||i).firstTimer||i.getDefaultTime(),r=e.Async.timeoutFilter(5e3),a=new e.Async.timerCtrl(o,"timerA");return a((function(){a.stop();let e=i.getDefaultTime(),n=t&&t(e);!1!==n&&a.setTime(n||e)})),n.nowCallback&&a.start(!0),this.run=function(){a.stop(),r((function(){a.setTime(getDefaultTime())}))},this}}},new function(){var t=e.Vue||this;t.__proto__={onEventInfos:function(e){var t=this.toString.$state._vm,n=t.$root.constructor;n.config.errorHandler=function(i,o){t.$nextTick(()=>{var t=o.$el._prevClass,n=[];if(t.match("el-select"))if(o.selected[0])for(var i of o.selected)n.push({name:i.label,value:i.value});else n={name:o.selectedLabel,value:o.value};else if(t.match("el-radio-group")){var r=o.$children;for(var a of r)a.$el.ariaChecked&&(n={name:a.$el.innerText,value:o.value})}else if(t.match("el-checkbox-group")){r=o.$children;for(var a of r)a.isChecked&&n.push({name:a.$el.innerText,value:a.label})}e&&e.call(this,o.value,n,o.hoverIndex)}),n.config.errorHandler=null}.bind(this);var i=new Promise((function(e,t){}));return i.catch=function(e,t,n){e(Error)},i},renderTo:function(e){var t=window.__VUE_HOT_MAP__,n=(this.toString.$state||{})._vm||this;return new(t?t[Object.keys(t)[0]].Ctor.super:n.$root.constructor)({el:e.el,data:e.data,render:function(t){var n=this,i=n._self._c,o=e.attrs;o="function"==typeof o?o.call(n._self):Object.assign({},o);var r={style:e.style,attrs:o,on:{change:e.change||""},model:{value:n._self[e.datakey||e.value],callback:function(t){n.$set(n._self,e.value,t)}}};return i(e.name,r)}})}},e.Vue=t},new function(){var t=e.Event||this;t.__proto__={eventRegister:function(e){var t,n,i,o=e.eventEl,r=!e.event,a=function(e,t){o.addEventListener(e,t,!1)},s=function(e,t){o.removeEventListener(e,t,!1)},l=function(){this.eventHandler=function(e){return this.eventTrigger=function(){a("mousemove",e),a("mouseup",e),a("mouseleave",e)},this.eventRemove=function(){s("mousemove",e),s("mouseup",e),s("mouseleave",e)},this.addEvent=function(){a("mousedown",e)},this.removeEvent=function(){s("mousedown",e)},this}.call({},this),this.eventHandler.addEvent(),e.event&&this.eventHandler.eventTrigger()};return l.prototype={handleEvent:function(e){switch(e.type){case"mousedown":this.start(e);break;case"mousemove":this.move(e);break;case"mouseup":this.up(e);break;case"mouseout":case"mouseover":case"mouseleave":this.end(e)}},start:function(o){t=o.pageX,n=o.pageY,o.timeStamp-i<280&&this.sX===t&&this.sY===n?(this.isDb=!this.isDb,clearTimeout(this.timeout),e.dblclick&&e.dblclick(o)):e.start&&e.start(o),this.sX=t,this.sY=n,i=o.timeStamp,!e.event&&this.eventHandler.eventTrigger()||(r=!0)},move:function(t){r&&(e.disc?"y"===e.disc?t.destY=t.pageY-this.sY:t.destX=t.pageX-this.sX:(t.destX=t.pageX-this.sX,t.destY=t.pageY-this.sY)),e.move&&e.move(t)},end:function(t){e.end&&e.end(t),!e.event&&this.eventHandler.eventRemove()||(r=!1)},up:function(t){var n=this;!(e.mouseup&&e.mouseup(t))&&this.end(t),e.click&&"mouseup"===t.type&&t.timeStamp-i<180&&this.sX===t.pageX&&this.sY===t.pageY&&(clearTimeout(this.timeout),this.timeout=setTimeout((function(){n.isDb?n.isDb=!n.isDb:e.click(t)}),150))}},new l}},e.Event=t};const n=new function(){var t=e.Utils||this;return t.__proto__={generateMixed:function(e){for(var t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],n="",i=0;i<e;i++){n+=t[Math.ceil(35*Math.random())]}return n},Dates:function(e){return{format:function(t){var n=e?new Date(e):new Date,i={"M+":n.getMonth()+1,"d+":n.getDate(),"h+":n.getHours()%12==0?12:n.getHours()%12,"H+":n.getHours(),"m+":n.getMinutes(),"s+":n.getSeconds(),"q+":Math.floor((n.getMonth()+3)/3),S:n.getMilliseconds()};for(var o in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(n.getFullYear()+"").substr(4-RegExp.$1.length))),/(E+)/.test(t)&&(t=t.replace(RegExp.$1,(RegExp.$1.length>1?RegExp.$1.length>2?"星期":"":"")+{0:"",1:"",2:"",3:"",4:"",5:"",6:""}[n.getDay()+""])),i)new RegExp("("+o+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[o]:("00"+i[o]).substr((""+i[o]).length)));return t},getDayStamp:function(){return{start:new Date((new Date).toLocaleDateString()).getTime()/1e3,end:~~((new Date).getTime()/1e3)}}}},arrayToJsonDict:function(e,t,n){var i={};if(e[0]&&e.push)for(var o=0,r=e.length;o<r;o++){var a=e[o];i[a[t||"id"]||o]=n?a[n]||n:a}return i},imageToBase64:function(e,t,n){var i=function(e,t){var n=new Image;n.src=e,n.crossOrigin="*",n.onerror=function(){new Error("图片加载失败")},n.onload=function(){var e=n.width,i=n.height;return t(function(e,t,n){var i=document.createElement("canvas");i.width=t,i.height=n;var o=i.getContext("2d");o.fillStyle="transparent",o.fillRect(0,0,t,n),o.drawImage(e,0,0,t,n);var r={};return r.base64=i.toDataURL("image/jpeg",.7),r.base64Len=r.base64.length,i=null,r}(n,e,i),n=null)}},o=e&&e.files[0];return new Promise((n,r)=>{if(!(o.name.indexOf(".jpg")>0||o.name.indexOf(".png")>0))return e.value="",r({type:4,msg:"图片文件类型不正确!"});var a="string"==typeof o?o:URL.createObjectURL(o);i(a,(function(e){return e.base64Len?t&&t(e)||n(e):r(e)}))})},strAverageCut:function(e,t){for(var n=e.length,i=~~(n/(t=(t>n?n:t)||1)),o=n%t,r=[],a=0,s=0;s<t;s++){var l=i+~~(s<o);r[s]=e.substr(a,l),a+=l}return r},getRandomColor:function(e){for(var t=this.strAverageCut(e,3),n=0,i=t.length;n<i;n++)t[n]=(parseInt(t[n],16)>>16&255)/255;return t},recursion:function(e,t,n,i){return function e(o){for(var r of o)n?!t(r)&&r[n]&&e(r[n]):(i=t(r))&&i&&e(r[i])}(e)}},t}}(qf)}]);
\ No newline at end of file
.vjs-svg-icon{display:inline-block;background-repeat:no-repeat;background-position:center;fill:currentColor;height:1.8em;width:1.8em}.vjs-svg-icon:before{content:none!important}.vjs-control:focus .vjs-svg-icon,.vjs-svg-icon:hover{filter:drop-shadow(0 0 .25em #fff)}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.vjs-modal-dialog .vjs-modal-dialog-content{position:absolute;top:0;left:0;width:100%;height:100%}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.vjs-button>.vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABUgAAsAAAAAItAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV33Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADwwAABdk9R/WHmhlYWQAABGcAAAAKwAAADYn8kSnaGhlYQAAEcgAAAAdAAAAJA+RCL1obXR4AAAR6AAAABMAAAC8Q44AAGxvY2EAABH8AAAAYAAAAGB7SIHGbWF4cAAAElwAAAAfAAAAIAFAAI9uYW1lAAASfAAAASUAAAIK1cf1oHBvc3QAABOkAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7xDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADbZCycAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1gUV5auc6urCmxEGrq6VRD6ATQP5dHPKK8GRIyoKApoEBUDAiGzGmdUfKNRM4qLZrUZdGKcGN/GZJKd0SyOWTbfbmZ2NxqzM5IxRtNZd78vwYlJdtREoO7sudVNq6PmmxmKqrqPU+eee173P80Bh39Cu9DOEY4DHZBK3i20D/QRLcfxbE5sEVtwLpZzclw4ibFIkSCJUcZ4MBpMnnzwuKNsGWBL5i3qy6kO2dVpvUpKbkAP9fq62rdeGJ+TM/7C1nbIutfuWrWk5ci4zMxxR1qW/N+9JsmCGXj9VKWhFx/6tr/nz78INDm2C9yPF/fDcxLuyKxLBZ1ZBz2QTi+RSkiH5RrDQJ/GgGQadX9m0YSURs7GpSG905Zsk41uj14yul1OtieZ7QUk5GRG/YiS7PYYPSAZNRed9sq3+bOpz00rKb7pe/ZEZvbALxZAHT3AFoH8GXP3rt67QFn40kt8W13FjLTDb48c+fSi5/7h0P4dL5yz7DPtbmgmYxfQA9RL2+EOfTcvdp+1vmuBpvOll1As1S6ak0IvJzC7sKWJFtJgBd2uWcg+0Zyg7dzQfhcjXRgXGZRf5/a4A58IDU777Nl252AUk4m2ByRRjqTNqIDCEJeAnU3iCFwrkrNwXEzg4yFevBwypzxkcX+AIfk3VEKl3XmWbT8788SzvpvFJaiOezL6QyuSr9VNf97csNu0z3LuhR0wATUxZAfVBwVOy+nQFhxYdWaXlXe4HC4zWGWzzsrLDtmhI9pOWOHv7PTT7XybH1Z0+v2d5Abd3kmG+TsH23CS/KwTxx/JkzEwx6jcQOUc42LLwHJ/J93uZ9ygh3HuZGwqsY9dWDHQ58dxNqyqKRQTYdxwTubiOSs3FiMDkq0WSZQgCT0GBDOg2lxOAd1FlPVGs4AKBAcYHHaP2wPkHaivmLF5zYqnIZrvcHx5gN4k/6tchNW1DtdgNL2KrxEkS/kfnIHoVnp1VjmjpTf5r0lTzLj0mdS28tX+XGorU364eMPmnWVl8J36nlKGw3CZhjEiuMw8h8mKvhGD+4/lElBWjAhLJMg6fTw4zPZ8cOmcGQBm2Qxml1nAm13CpYGq1JKUlJJUzQn1PTAO0mgv6VMMpA/DuRfSWEu4lDIxdbAtdWIKvnn2Vk766CWfz9fpY0sH/UpdP50rfszaVpdVRmvIejEdLMk45s4Bu0EWHjeOySmFyZSiMahvZdNSn29peoI/YexYfKQTLeurTXXwEVLeSfInTWHkkMaeUx7sBvOCSTSj3AlcKjfueyS36tCrXDlgRtF0etFq9jhc1kfKuBT/OwMr0F4UUTTh1AN0g20+H/ScPcsIEsYu9d/zN5PmjprPtNwI1ZZcDK6iC97Mcjp2y2aX36f+QbpGHrgRuHlXJ+Zf6PFRL2uQSp8vxHeF2IoRb8Rd2rhMzsNxSRmEuKK4JFnkojhMcx6jzqHzGMGFcW+MhBj0bhf6cowN+45I4LHvwT6fteu7M42wGRI/pxcg6/MZdEvt1U1XaulHFXuLmqov/MukvRVL35/b3ODM1+4aPjtzeK7zmUkV2h3DN54HaQ9GzJvxHRb6Ks2gB81fwqraT+A7GvZJrRLRofU6G0urNL+zFw3v0FaVDFxsKEZW56F31r6ip6vOL+FCObBPuIMRiXld9RaMdLzRIOGhPey2T9vA/35DmZPK9IWaT9d/WgOGMieYqJ/dzjLIhZU118gbysxrNUGefxD6UO/hyNNllpFTOIbx32kSFQctnweV5PxTMHLjRqiAN+fQE9gL+Xy5WB6MOS4GJJuYbDUHhcKDhHGRbLzOpjsjdM1+iwAZLGeieehACX2hhI7SjK/ZUTNrvVje31TxJiFBGYViWFkCn9PMeX9fS6qVbzfCj4fOCTzDnuWy2c4xA7mdNkA3RS9FH2VeqzdCBlixxbzXjvkHU1I8BOYFb1pZvPIHSSIj4svT8xpzcxtXN+ZKyjdDvbz08niiF3PqV9Tn5NST8vg48MTaY8E5xqSSIsWoWHo+LtAzxdH/GDUyp37CBEYfso04F/NlMTcDJUTpECLY0HFGQHImE8xsEUdgnrQlixIvGhJA1BvxpDHGxEMBYFeNOHcBJlSjwe2JcSfbBEsGOPPBHg/6SBBOCsLLw0SpUxod0Z1bFMfLkbQ3UiZxEyd0Dx8t+SRBu18Q9msFbI4e3p1THEfkSEh7kEJ5orR10qTWDvbgPWn5aWvCYyOAjwgXyjJi34uMjo58L25cmRAeQZWI2PA1QQLsPESAH8WGFwZZ4SPoR73BHPzIPMJj9AreBzKUmrH4todT18ANvi1oc3YGjUT/0j+ExUwq8PI9BLaCQIpvewwYu2evAG/Vo/5avPdY7o+BemLLXw3y+AdkzP9bpIxB1wm5EYq8fesHbPEPtm6HrHvtx4jcGPR8fDDpkZBefIjB46QnlUNRltv4Z/pO/J6dxEjhYAtmoMeq+GozvUVvNYOW3m6GCIhoprcfr97B8AcIQYsfD8ljUvGNjvkrpj0ETA48ZMIxCeqsRIsQALE0gi2GB+glSOfbOjW3GSBM9yPq8/rpJXrJDz0BPxV6xdN4uiCGDQed3WhgFkBUZEFsmeyyBpzXrm7UGTBZG8Lh5aubFufk5eUsbrrFGr7McYdbltxa0nKYqRKbQjvikXYkTGM0f2xuyM3Ly21oXnWfvf6I1BmZwfh7EWWIYsg2nHhsDhOnczhJcmI6eBAmy3jZ3RiJmKQR/JA99FcwsfaVbNDDyi1rL9NPj9hfo61wjM6BjzOLijLpeTgk/pL+ip6tfYWupzeOgPny2tcUu9J/9mhxJlgyi985NFRbvCVewXUNXLJaW0RxZqtRYtnfYdcYomXQWdnJHQA3jiEEkeTQWcWxdDP9IvvVWvo2TK553XEMEq+s69/QDU1Q7p0zxwsm9qS379whr8NI2PJqLUyGyfNeX3eFfnJU2U+uHR9cVV1IqgurqwuV44XVp0h2qN55X5XJwtk59yP0IZuHrqBOBIuIYhkcoT6Kx79Pu2HS/IPZIMOqLWs/pteOOk4NPgEb6QAIdAPsyZk5Mwd+wVaHMexJv719W7xCu2l37UG6lvYdBcvHa08p89741zd63phTRGqL5ggo6SlvdbWXzCqsPq78NnSu7wnKy2HNZbVoRCI7UJEOyRj+sPE002tOOY7Qa5fXboFWkLNeqYUSZRocp9XwSUZxcQZ9Hw6LV2pOoVmvHQEDbGIENEG5i6bLgMSM4n8+FNLTtAds99DaWEvgcf4o5SyYe9x+kF6/tGoTPAdRmS/XQIEy//QxKC2oqioAI3tS5auvxCtzT6y6RK8fhChYcwCJaMJhxc0vqSxQ/qmgsrKAlBZUHlauheTpvd9uj5DnLzJct6qfq5fXbYHVIGcfrIVJihbaVLu1wW7Vbs8zK0A8e9Jvb91S9cVMjPrazD6gpfeZTXzYbCFMcppVRsGMpp55OWgx1/3JeAxW1Y7AORgM/m3rWrsdLkQVmEVSU16cX/e7uvkvpqRiQsG06XJ0t64Tf+l0nG1dt025gyOIZlvq5u9KSU1N2TW/rsWnnMRPyTDkctbhvIcNvYIXWyLzdwYLoYesUbaQG4iK2cWO2gdpeUYLqDD0MUTOPhDIGnZEs58yArR86FznuWEsU4YDi2x26dA4klkn8Qa6vhk2QUfX4Jxm/ngX9r7ogn1dmlmwqZmuhxtdg9XN/DEcUgqb+9hMyNansfaQET2mcROCmGEMVqxm5u+h6kN2MOwgqykV2wH9yQG9DvVFU38Pogaf4FVuE62KI/oJ02RDdWW2w5dqQwU/8+N1q1DlvsL863u61KLE7x/o8w0VJQM/Y/SQ3unIrqxueEa1BqT5VFNsO7p39/UC771a77RowpaKe9nvJQIT1Pog5LGx8XblBKmCNGTf3xMogAQvPnz9PYKX/08sVDTG1OKUlOLUgS/UaZtm1NAaYTsl7i9ZQ+L6O4Rl0OGa577LuWvc+C+x96/vYh0lLBuM+7XwI/dTLtdT7v4d6rRTWDnku0IBrqFnZ5bVIqKP8lasJlithWnaLhTsr8qFJBulF/70p4undou36HeTJ5+jv1fCybeQ8nH3+Xv6aENczmOFlab+hqMDg1rLOt12A+tiUFrYDwQ6c3RUJp601nzegTNX6WlYAI2zSUV945F6zU56ZmZVQaWspWcIADxJ9GmljQUnL2p2Dpr5T8H+5KJFu+vqBq8qvyHRzStLHPEO5SPYCV9nZe0yZT2RcH0oHvegSzNEJ0oGWU8iQWM12dgPEugngVceGIwZgPFp0BiT1a0a3R5Rcot7ihfA1J/20v96jX7zmTX9s583H0kwx6WnLd09cXrR9LGroOa9sHNbdyz8wcKk5lqhaVFJZNwmqtw884MXNdvJujpBa3xzuSaZH9sxa06Z7x+HJSduPbdYHv/DgmEhfbehvlmGN7JUkcG78GDM12CeyFFTPNqVeNxC1gzjz+c2nVo63Xxs8rKJWXoBJM0tmEbfGm4qzpoOH3xpzQfyxLzW1gnE9NHo6tol1eMEic4ZVPrjnVi0kqAe2sQ2bgqupScaq8WGlUWgWHI51SKJl/UYT6zccNsCSkBtiVZLsiefuFSDYT3Fi8Zk7EUnmjTRYtsFeuDDJS05MW79M3mr3mla+d8dzac31KTPmBYfFiYSUef48PhPjm9ryZsSGZZkdNvzq0Y9rdNcwDq5Dg5C3QW+7UN64IKptvS3tvHbvu5c9pv1Exau21rc9LIpwpQwUjTq8576yeVDz5+4WZ1nXT43wV60rPLJbDp/UksNrP3iQ2SA63Pst058gOYDbhRnRUw8l/sRt4HbxPzO4WYpInCpuVgSbVh6JXuwnnJngKTTCwaPWmG5Xbhpm1U0Yt3FyBGpGYemPM77p2TD904JjgJ2QFpFLeYpGx8X15Qx1Zk31p5ki9ZLUuXE0lmuJlcakJMVLeFS1iIvrB8drY0aloilakqCZwzwRORtxlgwxS4IThggJd4TDxoiaAIT80fFPGrCPPru+puFn504P/ybr4ihA/6dKASLshEJic7xE8tmzu3KzA7TABBe8y5fNbWo3ilQn/SuFKM16b2l5bOeayqfGhYmhIulU+fVNDdWVv4NMzX10MBHyPR5uhWUu8D9P1VnIMt4nGNgZGBgAOJ/1bf64vltvjJwszOAwAOlmqvINEc/WJyDgQlEAQA+dgnjAHicY2BkYGBnAAGOPgaG//85+hkYGVCBPgBGJwNkAAAAeJxjYGBgYB/EmKMPtxwAhg4B0gAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAe4CLgKKAtAC/ANiA4wDqAPgBDAEsATaBQgFWgXABggGLgZwBqwG9gdOB4oH0ggqCHAIhgicCMgJJAlWCYgJrAnyCkAKdgrkC7J4nGNgZGBg0GdoZmBnAAEmIOYCQgaG/2A+AwAaqwHQAHicXZBNaoNAGIZfE5PQCKFQ2lUps2oXBfOzzAESyDKBQJdGR2NQR3QSSE/QE/QEPUUPUHqsvsrXjTMw83zPvPMNCuAWP3DQDAejdm1GjzwS7pMmwi75XngAD4/CQ/oX4TFe4Qt7uMMbOzjuDc0EmXCP/C7cJ38Iu+RP4QEe8CU8pP8WHmOPX2EPz87TPo202ey2OjlnQSXV/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkXlT2zAQxf1C4thJAwRajt4HRy8VMwwfSJHXsQZZcnUQ+PYoTtwpM+wf2t9brWZ2n5JBsol58nJcYYAdDDFCijEy5JhgileYYRd72MccBzjEa7zBEY5xglO8xTu8xwd8xCd8xhd8xTec4RwXuMR3/MBP/MJvMPzBFYpk2Cr+OF0fTEgrFI1aHhxN740KDbEmeJpsWZlVj40s+45aLuv9KijlhCXSjLQnu/d/4UH6sWul1mRzFxZeekUuE7z10mg3qMtM1FGQddPSrLQyvJR6OaukItYXDp6pCJrmz0umqkau5pZ2hFmm7m+ImG5W2t0kZoJXUtPhVnYTbbdOBdeCVGqpJe7XKTqSbRK7zbdwXfR0U+SVsStuS3Y76em6+Ic3xYiHUppc04Nn0lMzay3dSxNcp8auDlWlaCi48yetFD7Y9USsx87G45cuop1ZxQUtjLnL4j53FO0a+5X08UXqQ7NQNo92R0XOz7sxWEnxN2TneJI8Acttu4Q=) format("woff");font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:"\f101"}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:"\f102"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:"\f103"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:"\f104"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:"\f105"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:"\f106"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:"\f107"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:"\f108"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:"\f109"}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:"\f10a"}.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:"\f10b"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:"\f10c"}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:"\f10d"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:"\f10e"}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:"\f10f"}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:"\f110"}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:"\f111"}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:"\f112"}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:"\f113"}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:"\f114"}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:"\f115"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:"\f116"}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:"\f117"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:"\f118"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:"\f119"}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:"\f11a"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:"\f11b"}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder,.vjs-icon-replay-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before,.vjs-icon-replay-5:before{content:"\f11c"}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder,.vjs-icon-replay-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before,.vjs-icon-replay-10:before{content:"\f11d"}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder,.vjs-icon-replay-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before,.vjs-icon-replay-30:before{content:"\f11e"}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder,.vjs-icon-forward-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before,.vjs-icon-forward-5:before{content:"\f11f"}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder,.vjs-icon-forward-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before,.vjs-icon-forward-10:before{content:"\f120"}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder,.vjs-icon-forward-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before,.vjs-icon-forward-30:before{content:"\f121"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:"\f122"}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:"\f123"}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:"\f124"}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:"\f125"}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:"\f126"}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-enter:before{content:"\f127"}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-exit:before{content:"\f128"}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:"\f129"}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:"\f12a"}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:"\f12b"}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:"\f12c"}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:"\f12d"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:"\f12e"}.video-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:0}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.video-js.vjs-1-1,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-fluid{width:100%;max-width:100%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-fluid:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,body.vjs-pip-window .video-js{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:rgba(0,0,0,.7);padding:.5em;text-align:center;width:100%}.vjs-layout-small.vjs-pip-container .vjs-pip-text,.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{border-color:#fff;background-color:#73859f;background-color:rgba(115,133,159,.5);transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button{display:block}.video-js button{background:0 0;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:rgba(115,133,159,.5)}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon,.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.js-focus-visible .vjs-menu :not(.vjs-selected):focus:not(.focus-visible),.video-js .vjs-menu :not(.vjs-selected):focus:not(:focus-visible){background:0 0}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em 0;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0;margin-bottom:1.5em;border-top-color:rgba(43,51,63,.7)}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.vjs-audio-only-mode .vjs-control-bar,.vjs-has-started .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js :not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em 0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:rgba(115,133,159,.5)}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-mute-control~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em;z-index:1}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em;z-index:1}.vjs-svg-icons-enabled .vjs-volume-level:before{content:none}.vjs-volume-level .vjs-svg-icon{position:absolute;width:.9em;height:.9em;pointer-events:none;z-index:1}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{line-height:.35em;right:-.5em}.vjs-slider-horizontal .vjs-volume-level .vjs-svg-icon{right:-.3em;transform:translateY(-50%)}.vjs-slider-vertical .vjs-volume-level .vjs-svg-icon{top:-.55em;transform:translateX(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display{display:none;position:absolute;width:100%;height:1px;background-color:#000;z-index:1}.video-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-volume-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.vjs-poster{display:inline-block;vertical-align:middle;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster,.vjs-using-native-controls .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster,.vjs-has-started.vjs-audio-poster-mode .vjs-poster,.vjs-pip-container.vjs-has-started .vjs-poster{display:block}.vjs-poster img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.video-js .vjs-current-time,.video-js .vjs-duration,.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider{display:none}.vjs-time-divider{display:none;line-height:3em}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate .vjs-playback-rate-value,.vjs-playback-rate>.vjs-menu-button{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-error .vjs-error-display:before{color:#fff;content:"X";font-family:Arial,Helvetica,sans-serif;font-size:4em;left:0;line-height:1;margin-top:-.5em;position:absolute;text-shadow:.05em .05em .1em #000;text-align:center;top:50%;vertical-align:middle;width:100%}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:block;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:after,.vjs-loading-spinner:before{content:"";position:absolute;margin:-.6em;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{100%{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"\f10c";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" \f12e";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.video-js.vjs-layout-small .vjs-duration,.video-js.vjs-layout-small .vjs-playback-rate,.video-js.vjs-layout-small .vjs-remaining-time,.video-js.vjs-layout-small .vjs-time-divider,.video-js.vjs-layout-small .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.video-js.vjs-layout-tiny .vjs-duration,.video-js.vjs-layout-tiny .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.video-js.vjs-layout-x-small .vjs-duration,.video-js.vjs-layout-x-small .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover{width:auto;width:initial}.video-js.vjs-layout-tiny .vjs-progress-control,.video-js.vjs-layout-x-small .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:rgba(43,51,63,.75);color:#fff;height:70%}.vjs-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0 24px}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f 100%)}.vjs-track-settings-controls button:hover{color:rgba(43,51,63,.75)}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:rgba(0,0,0,.9);background:linear-gradient(180deg,rgba(0,0,0,.9) 0,rgba(0,0,0,.7) 60%,rgba(0,0,0,0) 100%);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-description,.vjs-title-bar-title{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5{cursor:pointer}.video-js .vjs-skip-forward-10{cursor:pointer}.video-js .vjs-skip-forward-30{cursor:pointer}.video-js .vjs-skip-backward-5{cursor:pointer}.video-js .vjs-skip-backward-10{cursor:pointer}.video-js .vjs-skip-backward-30{cursor:pointer}@media print{.video-js>:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js :focus:not(.focus-visible){outline:0}.video-js :focus:not(:focus-visible){outline:0}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment