Commit fc3819cb authored by Kimber's avatar Kimber

'update'

parent 219b0ded
......@@ -5,7 +5,6 @@ ENV = 'production'
# 如果接口是 http 形式, wss 需要改为 ws
# ------------------------
VUE_APP_BASE_API = 'http://39.164.225.220:5003'
VUE_APP_LOCAL_API = 'http://39.164.225.220:5004'
VUE_APP_D3Tileset = 'http://39.164.225.220:5003/b3dms'
VUE_APP_liveQing = 'http://39.164.225.220:5008'
\ No newline at end of file
VUE_APP_LOCAL_API = 'http://gqyjpt.weihai.cn:8001'
#VUE_APP_weather = 'http://192.168.1.142:9003'
VUE_APP_GIS = 'http://gqyjpt.weihai.cn:8005/Assets'
var ServiceURL = 'http://192.168.3.216:9002';
var ServiceURL = 'http://gqyjpt.weihai.cn:8001';
window.VUE_APP_API = {ServiceURL:ServiceURL}
[.ShellClassInfo]
ConfirmFileOp=0
IconFile=C:\Users\zhr\AppData\Local\SynologyDrive\SynologyDrive.app\bin\cloud-drive-ui.exe
IconIndex=3
InfoTip=Synology Drive Client.
......@@ -17,7 +17,7 @@
<!-- <link rel="stylesheet" href="/Build/Cesium/Widgets/widgets.css"> -->
<script src="/config/settings.js"></script>
<script src="/static/js/qf_web.min.js"></script>
<script type="text/javascript">qf.openCalcLayout();</script>
<script type="text/javascript">qf.openCalcLayout({dpr:1});</script>
<script src="/static/js/Cesium/Cesium.js"></script>
<script src="/static/js/fg3d.min.js"></script>
</head>
......
public/favicon.ico

8.21 KB | W: | H:

public/favicon.ico

66.1 KB | W: | H:

public/favicon.ico
public/favicon.ico
public/favicon.ico
public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
......@@ -2,31 +2,75 @@
import Highcharts from 'highcharts';
import HTreemap from 'highcharts/modules/treemap.js';
import Highcharts3D from 'highcharts/highcharts-3d.js';
import Highstock from 'highcharts/highstock.js';
//import oldie from 'highcharts/oldie.js';
//import cylinder from 'highcharts/cylinder.js';
HTreemap(Highcharts); // treemap 类型
Highcharts3D(Highcharts); // 3D 类型
/* Highcharts.getOptions().colors = Highcharts.map(Highcharts.getOptions().colors, function (color) {
return {
radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
stops: [
[0, color],
[1, new Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
]
};
}); */
var Highchart = function(){
/**
* 图表数据格式化
* @param: {Array} list
* @param: {Object} opts [standOut(突出最大值)]
* @example1: qf.UI.showFloatMenu({top:y,left:x, eventOutClose:}, html);
* @example1:
var chartData = formatSeriesList(data, {value:'num'});
input:
[
{"name":"高区应急行业","num":3},
{"name":"0705行业","num":2},
{"name":"船舶工业行业","num":2},
]
output:
{
"seriesData":[
{"0":"上海","1":24.25,"name":"高区应急行业","y":3},
{"0":"卡拉奇","1":23.5,"name":"0705行业","y":2},
{"0":"北京","1":21.51,"name":"船舶工业行业","y":2},
],
"sum":7
}
* @example2:
input:
var list = [{"name":"高区应急行业","num":16},{"name":"船舶工业行业","num":7}];
var colors = ['#2CAFFE', '#90ED7D', '#8085E9', '#F15C80', '#E4D354'];
var series = Highchart.formatSeriesList(list, {value:'num', colors:colors});
output:{
"seriesData":[{"name":"高区应急行业","y":16,"color":"#2CAFFE"},{"name":"船舶工业行业","y":7,"color":"#90ED7D"},],
"sum":28
}
* @return:
* @author: Kimber
* @updatetime: 2021/12/25
* @createtime: 2021/12/25
*/
var formatChartData = function(list, opts){
var sdata = [], sum = 0, maxVal = 0, mark = 0;
var formatSeriesList = function(list, opts){
var sdata = [], sum = 0, maxVal = 0, mark = 0, colors = opts.colors || [];
var len = list.length;
for(var i=0; i<len; i++){
var item = list[i];
var item = list[i], color = colors[i];
var value = item[opts.value] * 1;
value > maxVal && (maxVal = value, mark = i);
sdata.push({name:item[opts.name], y:value, 'color':item.color || void 0});
var nitem = {name:item[opts.name || 'name'], y:value}
item.color && (nitem['color'] = item.color);
color && (nitem['color'] = color);
sdata.push(nitem);
sum += value;
};
if(opts.standOut){
......@@ -252,7 +296,7 @@ var Highchart = function(){
var template = {
pie: function(el, data, opts){
var chartData = formatChartData(data, opts);
var chartData = formatSeriesList(data, opts);
var seriesData = chartData.seriesData;
return new Highcharts.chart(el, {
chart: {
......@@ -599,12 +643,365 @@ var Highchart = function(){
var options;
if(opts.isSeriesData){
options = reversExtends(option, chartConfig, opts.callback);
options = chartConfig;
}else{
options = reversExtends(option, chartConfig, opts.callback);
};
return new Highcharts.chart(el, options);
},
/**
* 注释标题
* @param: {Dom} el
* @param: {Object} data
* @param: {Object} opts {chartConfig:{}, callback:Function}
* @example1:
var opts = {
chartConfig:{
chart:{
type: 'column',
marginTop:0,
marginLeft:25,
marginBottom:0,
spacingLeft:0,
spacingBottom:-5,
},
series: [{
name: '',
tooltip: {
valueDecimals: 2
},
}]
},
notExtendsOptions:false,
};
Highchart.template.stock(wrap32, data, opts);
* @return:
* @version: V0.1
* @author: Kimber
* @updatetime: 2024/7/12(周五)
* @createtime: 2024/7/12(周五)
*/
stock: function(el, data, opts){
var chartData = formatSeriesList(data, {value:'num'});
var chartConfig = opts.chartConfig || {};
var option = {
chart:{
backgroundColor:'transparent',
},
rangeSelector: { // 关闭选择列表
enabled: false
},
title: {
//text: 'AAPL Stock Price'
},
xAxis: {
type: 'datetime',
max:10,
labels: {
rotation:0, // 设置轴标签旋转角度
style:{
color:'#ffffff'
},
y:2,
enabled:false,
},
lineWidth:0,
gridLineColor:'#aaa',
tickLength:0, // 刻度线
alignTicks:false,
},
yAxis: {
title: {
text: ''
},
labels:{
style:{
color:'#fff'
},
x:-5,
},
gridLineColor:'#00C4FE',
opposite: false,
offset: 0,
lineWidth: 1,
lineColor:'#00C4FE'
},
plotOptions: {
column: {
borderWidth: 0,
//y:50,
//itemMarginTop:50,
},
bar:{
borderWidth: 0,
},
},
navigator : {
enabled : false
},
scrollbar : {
enabled : true,
barBackgroundColor: '#00C4FE',
barBorderRadius: 7,
barBorderWidth: 0,
buttonBackgroundColor: '#00C4FE',
buttonBorderWidth: 0,
buttonBorderRadius: 7,
trackBackgroundColor: 'rgba(0,28,57, .5)',
trackBorderWidth: 1,
trackBorderRadius: 5,
trackBorderColor: '#65D6F7',
height:12,
},
credits: {
enabled: false
},
legend: {
/* enabled: series.length > 1 ? true : false,
// 图例定位
layout: 'horizontal', // 水平布局:“horizontal”, 垂直布局:“vertical”
floating: false, // 图列是否浮动
align: 'right',
// 图例容器
//width:'100%', // number || String
padding:2, // 内边距
margin:2,
borderRadius:5,
//borderWidth:1,
verticalAlign: 'top',
// 图例项
//itemWidth:120, // 宽度
itemDistance:10, // 间距 20
y:-10,
itemMarginTop:2,
itemStyle:{color:'#fff',},
itemHoverStyle:{color:'#fff',}, */
},
tooltip: {
formatter: function (e) {
return this.series.name + ""+ this.key +'<br/>'+ this.y.toFixed(3);
},
//pointFormat: '{point.y} ',
},
series: [{
name: '',
data: chartData.seriesData,
tooltip: {
valueDecimals: 2
},
dataLabels: { // 柱内显示文字内容
enabled: true,
rotation: 90,
color: '#FFFFFF',
align: 'top',
formatter: function(e){
return this.key + ' ' + this.y;
},
y:10,
style:{
fontSize:10,
textShadow:'none',
},
}
}]
};
var options;
if(opts.isSeriesData){
options = reversExtends(option, chartConfig, opts.callback);
}else{
options = reversExtends(option, chartConfig, opts.callback);
};
Highstock.setOptions({
global: {
useUTC: false
},
});
return new Highstock.stockChart(el, options);
},
test: function(el, data, opts){
var list = data.list;
var chartConfig = opts.chartConfig || {};
var chartData, categories = [], series = [], maxVal = null, unit = data.danwei;
if(opts.isSeriesData){
}else{
chartData = seriesDataFormat(data, {datekey:'date'});
categories = chartData.categories;
series = chartData.series;
};
var option = {
chart: {
//type: '',
backgroundColor:'transparent',
//marginTop:30,
//marginBottom:30,
//marginLeft:30,
zoomType: 'x', // xy
},
title: {
text: ''
},
subtitle: {
text: ''
},
tooltip:{
enabled:false,
borderWidth:10,
},
xAxis: {
type: 'datetime',
categories: categories[0] && categories,
lineWidth:0,
//lineColor:'#ff0000',
gridLineColor:'#aaa',
dateTimeLabelFormats: {
millisecond: '%H:%M:%S.%L',
second: '%H:%M:%S',
minute: '%H:%M',
hour: '%H:%M',
day: '%m-%d',
week: '%m-%d',
month: '%Y-%m',
year: '%Y'
}
},
yAxis: {
title: {
text: ''
},
labels:{
x:-6,
},
gridLineColor:'#aaa',
max:null,
},
plotOptions: {
column: {
borderWidth: 0,
//y:50,
//itemMarginTop:50,
},
bar:{
borderWidth: 0,
},
},
tooltip: {
// {point.y:.4f} // 保留4位小数
//headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}:</td>' +
'<td style="padding:0"><b>{point.y}'+unit+'</b> </td></tr>',
footerFormat: '</table>',
shared: true, // hover时是否显示所有线段值
useHTML: true,
dateTimeLabelFormats: {
millisecond: '%H:%M:%S.%L',
second: '%H:%M:%S',
minute: '%H:%M',
hour: '%H:%M',
day: '%m-%d %H时',
week: '%m-%d',
month: '%Y-%m',
year: '%Y'
}
},
legend: {
enabled: series.length > 1 ? true : false,
// 图例定位
layout: 'horizontal', // 水平布局:“horizontal”, 垂直布局:“vertical”
floating: false, // 图列是否浮动
align: 'right',
// 图例容器
//width:'100%', // number || String
padding:2, // 内边距
margin:2,
borderRadius:5,
//borderWidth:1,
verticalAlign: 'top',
// 图例项
//itemWidth:120, // 宽度
itemDistance:10, // 间距 20
y:-10,
itemMarginTop:2,
itemStyle:{},
itemHoverStyle:{},
},
credits: {
enabled: false
},
series: series
};
Highcharts.setOptions({
global: {
useUTC: false
},
lang:{
resetZoom:'重置缩放比例',
},
});
option = {
chart: {
type: 'pie',
//styledMode: true,
marginTop:0,
marginLeft:0,
marginBottom:0,
spacingLeft:0,
backgroundColor:'transparent',
},
title: {
text: ''
},
tooltip: {
pointFormat: '{series.name}: <b>{point.y}</b>'
},
plotOptions: {
pie: {
allowPointSelect: false,
cursor: 'pointer',
depth: 25,
dataLabels: {
enabled: false,
},
}
},
credits: {
enabled: false
},
series: [{
type: 'pie',
allowPointSelect: true,
keys: ['name', 'y', 'selected', 'sliced'],
data: [
['Apples', 29.9, false],
['Pears', 71.5, false],
['Oranges', 106.4, false],
['Plums', 129.2, false],
['Bananas', 144.0, false],
['Peaches', 176.0, false],
['Prunes', 135.6, true, true],
['Avocados', 148.5, false]
],
showInLegend: true
}],
};
return new Highcharts.chart(el, option);
},
};
var getRandomColor = function(random){
......@@ -621,7 +1018,7 @@ var Highchart = function(){
};
return {
template:template, getRandomColor:getRandomColor, seriesDataFormat
template:template, getRandomColor:getRandomColor, seriesDataFormat, formatSeriesList
}
};
......
......@@ -2,177 +2,6 @@
var Tools = function(){
var cuPrint = function(dom, options){
var Print = function () {
if (!(this instanceof Print)) return new Print(dom, options);
this.options = this.extend({
'noPrint': '.no-print'
}, options);
if ((typeof dom) === "string") {
this.dom = document.querySelector(dom);
} else {
this.isDOM(dom)
this.dom = this.isDOM(dom) ? dom : dom.$el;
}
this.init();
};
Print.prototype = {
init: function () {
var content = this.getStyle() + this.getHtml();
this.writeIframe(content);
},
extend: function (obj, obj2) {
for (var k in obj2) {
obj[k] = obj2[k];
}
return obj;
},
getStyle: function () {
var str = "",
styles = document.querySelectorAll('style,link');
for (var i = 0; i < styles.length; i++) {
str += styles[i].outerHTML;
}
str += "<style>" + (this.options.noPrint ? this.options.noPrint : '.no-print') + "{display:none;}</style>";
return str;
},
getHtml: function () {
var inputs = document.querySelectorAll('input');
var textareas = document.querySelectorAll('textarea');
var selects = document.querySelectorAll('select');
for (var k = 0; k < inputs.length; k++) {
if (inputs[k].type == "checkbox" || inputs[k].type == "radio") {
if (inputs[k].checked == true) {
inputs[k].setAttribute('checked', "checked")
} else {
inputs[k].removeAttribute('checked')
}
} else if (inputs[k].type == "text") {
inputs[k].setAttribute('value', inputs[k].value)
} else {
inputs[k].setAttribute('value', inputs[k].value)
}
}
for (var k2 = 0; k2 < textareas.length; k2++) {
if (textareas[k2].type == 'textarea') {
textareas[k2].innerHTML = textareas[k2].value
}
}
for (var k3 = 0; k3 < selects.length; k3++) {
if (selects[k3].type == 'select-one') {
var child = selects[k3].children;
for (var i in child) {
if (child[i].tagName == 'OPTION') {
if (child[i].selected == true) {
child[i].setAttribute('selected', "selected")
} else {
child[i].removeAttribute('selected')
}
}
}
}
}
// 包裹要打印的元素
// fix: https://github.com/xyl66/vuePlugs_printjs/issues/36
let outerHTML = this.wrapperRefDom(this.dom).outerHTML
return outerHTML;
},
// 向父级元素循环,包裹当前需要打印的元素
// 防止根级别开头的 css 选择器不生效
wrapperRefDom: function (refDom) {
let prevDom = null
let currDom = refDom
// 判断当前元素是否在 body 中,不在文档中则直接返回该节点
if (!this.isInBody(currDom)) return currDom
while (currDom) {
if (prevDom) {
let element = currDom.cloneNode(false)
element.appendChild(prevDom)
prevDom = element
} else {
prevDom = currDom.cloneNode(true)
}
currDom = currDom.parentElement
}
return prevDom
},
writeIframe: function (content) {
var w, doc, iframe = document.createElement('iframe'),
f = document.body.appendChild(iframe);
iframe.id = "myIframe";
//iframe.style = "position:absolute;width:0;height:0;top:-10px;left:-10px;";
iframe.setAttribute('style', 'position:absolute;width:0;height:0;top:-10px;left:-10px;');
w = f.contentWindow || f.contentDocument;
doc = f.contentDocument || f.contentWindow.document;
doc.open();
doc.write(content);
doc.close();
var _this = this
iframe.onload = function(){
_this.toPrint(w);
setTimeout(function () {
document.body.removeChild(iframe)
}, 100)
}
},
toPrint: function (frameWindow) {
try {
setTimeout(function () {
frameWindow.focus();
try {
if (!frameWindow.document.execCommand('print', false, null)) {
frameWindow.print();
}
} catch (e) {
frameWindow.print();
}
frameWindow.close();
}, 10);
} catch (err) {
console.log('err', err);
}
},
// 检查一个元素是否是 body 元素的后代元素且非 body 元素本身
isInBody: function (node) {
return (node === document.body) ? false : document.body.contains(node);
},
isDOM: (typeof HTMLElement === 'object') ?
function (obj) {
return obj instanceof HTMLElement;
} :
function (obj) {
return obj && typeof obj === 'object' && obj.nodeType === 1 && typeof obj.nodeName === 'string';
}
};
Print();
};
var downloadFile = function(obj, name, suffix){
var url = window.URL.createObjectURL(new Blob([obj]));
var link = document.createElement('a');
link.style.display = 'none';
link.href = url;
var fileName = name + '.' + suffix;
link.setAttribute('download', fileName);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
// 水波图表
var waveMapChart = function(ctn, val, opts){
opts = opts || {};
......@@ -426,71 +255,11 @@ var Tools = function(){
};
return {
cuPrint, downloadFile, waveMapChart
waveMapChart
}
};
/**
* 文件下载
* @return: Object
* @author: Kimber
* @updatetime: 2021/7/20
* @createtime: 2021/7/20
*/
var FileStream = function(){
function s2ab(s) {
var buf = new ArrayBuffer(s.length);
var view = new Uint8Array(buf);
for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
};
/**
* 字符转换 Blob 对象
* @param: {String} str
* @example1: var aaa = FileStream.toBlob(str);
* @return:
* @author: Kimber
* @updatetime: 2021/7/20
* @createtime: 2021/7/20
*/
var toBlob = function(str){
return new Blob([s2ab(str)], {
type: "application/octet-stream"
});
};
/**
* 利用 A标签 下载文件
* @param: {Blob} url
* @param: {String} saveName // 文件名
* @example1: FileStream.download(blob, 'Test.xlsx');
* @return:
* @author: Kimber
* @updatetime: 2021/7/20
* @createtime: 2021/7/20
*/
var download = function(url, saveName){
if (typeof url == 'object' && url instanceof Blob) {
url = URL.createObjectURL(url); // 创建blob地址
}
var aLink = document.createElement('a');
aLink.href = url;
aLink.download = saveName || ''; // HTML5新增的属性,指定保存文件名,可以不要后缀,注意,file:///模式下不会生效
var event;
if (window.MouseEvent) event = new MouseEvent('click');
else {
event = document.createEvent('MouseEvents');
event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
}
aLink.dispatchEvent(event);
};
return {toBlob:toBlob, download:download}
};
export var Tools = Tools();
export var FileStream = FileStream();
/* exports = {
HttpReq: HttpReq(),
......
import { Notification } from 'element-ui';
import request from '@/utils/request';
import { Tools } from './common';
import { Highchart } from '@/assets/js/chartTemplates.js';
import { initData, download } from '@/api/data';
//var baseAPI = process.env.VUE_APP_LOCAL_API + '/';
var baseAPI = process.env.NODE_ENV
......@@ -19,61 +16,36 @@ var reqPublic = function(url, type, param, opts){
};
reqConfig[paramKey] = param;
opts.responseType && (reqConfig['responseType'] = opts.responseType);
opts.key && (reqConfig['token'] = opts.key);
return request(reqConfig)
};
var reqApis = function(){
return {
//donwloadURl:DownloadUrl,
getWeather: function(param) {
return request({
url: process.env.VUE_APP_BASE_API + '/weather',
method: 'post',
params:param
})
},
getRules:function(baseInfo){
var rules = {};
for(var key in baseInfo){
var item = baseInfo[key];
if(item.must){
var typeStr = item.type ? '请选择' : '请输入';
var rule = {required: true, message:typeStr+item.name, trigger:'blur'};
item.ruleType && (rule.type = item.ruleType)
rules[key] = [rule];
};
};return Object.keys(rules)[0] ? rules : void 0;
},
// 根据设备code获取设备字典列表
sensorListByCode: function(param){
return reqPublic('/tab/drybeachequipinfor/sensorList', 'get', param)
},
// 设备在线状态字典
getDictDeviceStatus: function(){
return reqPublic('/dic/alarm/status', 'get', {})
},
getBaseParams: function(searchItem){
var searchItem = searchItem || reqApi.common.getSearchParam(this.form) || {};
var param = searchItem || {};
param.page = this.table.page - 1;
param.size = this.table.size;
param.sort = 'date,desc';
return param;
},
common:{
requst:function(type, url, param){
var param = param || {};
return reqPublic(url, type, param).then((res)=>{
var opts = this.query || {};
/* return reqPublic(url, type, param, opts).then((res)=>{
return res
}).catch(function(error) {
console.log('requst catch ________________ ', error);
}); */
return qf.Async.Promise((resolve, reject) => {
reqPublic(url, type, param, opts).then((res)=>{
return resolve(res)
}).catch(function(error) {
console.log('requst catch ________________ ', error);
return reject(error);
});
});
},
requstEdge:function(type, url, param){
var param = param || {};
return new Promise((resolve, reject) => {
reqPublic(url, type, param).then((res)=>{
if(res && res.code === 200){
if(res && (res.code === 200 || res.status === 200)){
return resolve(res)
}else{
Notification({
......@@ -89,134 +61,6 @@ var reqApis = function(){
});
});
},
getRequst: function(searchItem){
var param = reqApi.getBaseParams.call(this);
this.table.loading = true;
this.pageApi.request('get', param).then((res) => {
this.table.loading = false;
if(res && res.code){
var body = res.body || {};
var list = body.list || [];
this.table.dataList = list;
this.table.total = body.total * 1;
}else{
this.$notify({
title: res.msg || res.message,
type: 'error',
duration: 2500
})
};
}).catch(function(error) {
this.table.loading = false;
})
},
removeRequst: function(item){
return this.pageApi.request('delete', item).then((res) => {
if(res.code === 200){
this.$notify({
title: '删除成功!',
type: 'success',
duration: 2500
});
this.loadData()
}else{
this.$notify({
title: res.msg || res.message,
type: 'error',
duration: 2500
})
};
});
},
addRequst: function(item){
return this.pageApi.request('post', item).then((res) => {
this.form.visible = false;
if(res.code === 200){
this.$notify({
title: '添加成功!',
type: 'success',
duration: 2500
});
this.loadData()
}else{
this.$notify({
title: res.msg || res.message,
type: 'error',
duration: 2500
})
};
}).catch(function(error) {
this.form.status.cu = 0
});
},
putRequst: function(item){
return this.pageApi.request('put', item).then((res) => {
this.form.visible = false;
if(res.code === 200){
this.$notify({
title: '修改成功!',
type: 'success',
duration: 2500
});
this.loadData()
}else{
this.$notify({
title: res.msg || res.message,
type: 'error',
duration: 2500
})
};
}).catch(function(error) {
this.form.status.cu = 0
});
},
upload:function(e, key){
var tag = e.target || e.srcElement;
var file = tag.files[0];
if(file){
this.fullLoading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
var data = new FormData();
data.append('file', file);
return this.pageApi.upload(data).then((res) => {
this.fullLoading.close();
if(res.code === 200){
tag.value = '';
this.form.item[key] = res.body;
this.$notify({
title: '提示',
message: '文件上传成功',
type: 'success',
duration: 5000
})
};
}).catch(function(error) {
this.form.status.cu = 0
});
};
},
getSearchParam:function(form){
var search = form.config.search, query = form.query, searchItem = {};
if(Object.prototype.toString.call(search) === '[object Array]' && Object.keys(query || [])[0]){
for(var item of search){
var queryVal = query[item.word];
if(queryVal && item.type !== "button"){
var key = item.mode === 0 ? 'vague' : 'exact';
if(item.type === "daterange"){
searchItem[item.type] = queryVal.join(',');
}else{
var groub = searchItem[key] || (searchItem[key] = {});
groub[item.word] = queryVal;
};
};
};
};return searchItem
},
getPermission: function(item){
var list = item.permission || [];
var username = this.$store.state.user.user.username;
......@@ -227,26 +71,8 @@ var reqApis = function(){
};
};
// 配制信息
var Config = function(){
// 获取单元信息
var getModuleInfo = function(that){
var path = that.$route.path || '';
var parts = path.replace('/', '').split('/');
var i = 0;
// 递归遍历
return (function loop(json){
var key = parts[i]; i++;
return json[key] ? loop(json[key]) : json;
})(reqApi);
};
return {getModuleInfo:getModuleInfo}
};
//export var tailingPond = tailingPond();
export var reqApi = reqApis();
export var Config = Config();
// WEBPACK FOOTER //
// ./src/common/js/common.js
\ No newline at end of file
......@@ -131,16 +131,22 @@ body .el-dialog__body{padding:10px 20px;}
/* 滚动条 */
.scrolling{}
.scrolling::-webkit-scrollbar{width:3px;height:5px;cursor:pointer;}
.scrolling4::-webkit-scrollbar{width:4px;cursor:pointer;}
.scrolling, .scrolling4::-webkit-scrollbar-thumb{border-radius: 10px;background:#1674ee;margin-right: 10px;cursor:pointer;}
.scrolling::-webkit-scrollbar{width:6px;height:5px;cursor:pointer;}
.scrolling4::-webkit-scrollbar{width:.06rem;height:.08rem;cursor:pointer;}
.scrolling, .scrolling4::-webkit-scrollbar-thumb{
border-radius:10px;margin-right: 10px;cursor:pointer;
/* background:#1674ee; */
background-color:rgba(23,121,230, .70);
background-image:-webkit-linear-gradient(45deg, rgba(31,181,219, .70) 25%, transparent 0, transparent 50%, rgba(31,181,219, .70) 0, rgba(31,181,219, .70) 75%, transparent 0, transparent);
}
.scrolling, .scrolling4::-webkit-scrollbar-thumb:hover{background-color:#1854e8;}
.scrolling, .scrolling4::-webkit-scrollbar-track{border-radius: 10px;background:rgba(255, 255, 255, 0.1);margin-right: 10px;}
/* 滚动条-火狐 */
.scrolling, .scrolling4{scrollbar-width:thin;scrollbar-color:#1674ee rgba(255, 255, 255, 0.1);}
.scrolling, .scrolling4::-webkit-scrollbar-track{border-radius:10px;background:rgba(255, 255, 255, 0.1);margin-right:10px;}
/* 暂无数据提示 */
/* .home_user .el-table__empty-block, .common-page .el-table__empty-block{background-color:#00344D} */
.no-data{flex:1;display:flex;justify-content:center;align-items:center;height:100%;padding-bottom:10%;}
......
......@@ -9,7 +9,7 @@ import { filterAsyncRouter } from '@/store/modules/permission'
NProgress.configure({ showSpinner: false }) // NProgress Configuration
const whiteList = ['/plus/login', '/register', '/edge/Screen'] // no redirect whitelist
const whiteList = ['/register', '/edge/Screen'] // no redirect whitelist
router.beforeEach((to, from, next) => {
if (to.meta.title) {
......@@ -47,7 +47,7 @@ router.beforeEach((to, from, next) => {
if (whiteList.indexOf(to.path) !== -1) { // 在免登录白名单,直接进入
next()
} else {
window.location.href = `/plus/login?redirect=${to.fullPath}`;
//window.location.href = `/plus/login?redirect=${to.fullPath}`;
NProgress.done()
}
}
......
......@@ -5,14 +5,6 @@ import HomeLayout from "../layout/home";
Vue.use(Router);
export const constantRouterMap = [
{
path: "/plus/login",
meta: { title: "登录login", noCache: true },
component: (resolve) => {
require(["@/views/system/user/login"], resolve)
},
hidden: true
},
{
path: "/404",
redirect: "/edge/Screen",
......@@ -26,31 +18,6 @@ export const constantRouterMap = [
component: resolve => require(["@/views/features/401"], resolve),
hidden: true
},
{
path: "/redirect",
//component: Layout,
component: HomeLayout,
hidden: true,
children: [
{
path: "/redirect/:path*",
component: resolve => require(["@/views/features/redirect"], resolve)
}
]
},
/* {
path: "/dashboard",
component: HomeLayout,
//redirect: "/dashboard",
children: [
{
path: 'dashboard',
component: (resolve) => require(['@/views/home_manage'], resolve),
name: 'Dashboard',
meta: { title: '主页面', icon: 'index', affix: true, noCache: true }
}
]
}, */
{
path: "/user",
//component: Layout,
......@@ -73,13 +40,7 @@ export const constantRouterMap = [
},
hidden: true
},
{
path: "/edge/ScreenTest",
component: (resolve) => {
return require(["@/views/Screen/indexTest"], resolve)
},
hidden: true
},
{
path: "/",
//redirect: "/edge/Screen",
......@@ -90,6 +51,16 @@ export const constantRouterMap = [
},
];
if(process.env.NODE_ENV === 'development'){
constantRouterMap.push({
path: "/edge/ScreenTest",
component: (resolve) => {
return require(["@/views/Screen/indexTest"], resolve)
},
hidden: true
});
};
export default new Router({
// mode: 'hash',
mode:"history",
......
......@@ -2,7 +2,7 @@ module.exports = {
/**
* @description 网站标题
*/
title: '恒源矿业智慧矿山管理平台',
title: '高区应急监测平台',
/**
* @description 是否显示 tagsView
*/
......@@ -26,7 +26,7 @@ module.exports = {
/**
* @description token key
*/
TokenKey: 'V3-TailingPond',
TokenKey: 'GEMHO-GAOQUYINGJI-TOEKN',
/**
* @description 请求超时时间,毫秒(默认2分钟)
*/
......@@ -49,5 +49,5 @@ module.exports = {
*/
caseNumber: '鲁ICP备09100748号-5',
"version": "0.950"
"version": "1.105"
}
......@@ -7,9 +7,9 @@ export function getToken() {
return Cookies.get(TokenKey)
}
export function setToken(token, rememberMe) {
export function setToken(token, rememberMe, date) {
if (rememberMe) {
return Cookies.set(TokenKey, token, { expires: Config.tokenCookieExpires })
return Cookies.set(TokenKey, token, { expires: date || Config.tokenCookieExpires })
} else return Cookies.set(TokenKey, token)
}
......
......@@ -3,7 +3,7 @@ import { Notification } from 'element-ui'
import { getToken } from '@/utils/auth'
import Config from '@/settings'
//const settings = require('@/../static/config/settings')
//const settings = require('@/../static/config/settings');
// 使请求头可以携带cookie
axios.defaults.withCredentials = true;
......@@ -21,8 +21,10 @@ const service = axios.create({
// request拦截器
service.interceptors.request.use(
config => {
if (getToken()) {
config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
var token = getToken();
var Token = token && (token !== typeof(void 0)) && token || config.token;
if (Token) {
config.headers['Authorization'] = Token // 让每个请求携带自定义token 请根据实际情况自行修改
}
config.headers['Content-Type'] = 'application/json'
return config
......@@ -39,8 +41,9 @@ service.interceptors.response.use(
},
error => {
if (error.response.status) {
const responseCode = error.response.status
const responseCode = error.response.status;
/*
switch (responseCode) {
case 400:
// Message.error('操作失败');
......@@ -65,7 +68,7 @@ service.interceptors.response.use(
default:
break
}
}*/
return error.response.data
}
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<template>
<div class="login" :style="'background-image:url('+ Background +');'">
<div class="headder">
<h2>尾矿库数据在线监测系统</h2>
<h4>ONLINE MONITORING SYSTEM FOR TAILINGS POND DATA</h4>
<!-- <h2>边坡数据在线监测系统</h2>
<h4>ONLINE MONITORING SYSTEM FOR SIDE SLOPE DATA</h4> -->
</div>
<div class="logo-place">
<div class="logo-title">登录窗口</div>
<h3 class="subtitle">欢迎登录后台系统</h3>
<div class="ctn-place">
<div class="inbox-range">
<div class="ctn-fix">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form">
<el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="密码" @keyup.enter.native="handleLogin">
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<!--
<el-form-item prop="code">
<el-input v-model="loginForm.code" auto-complete="off" placeholder="验证码" style="width: 63%" @keyup.enter.native="handleLogin">
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode">
</div>
</el-form-item>
-->
<el-form-item style="width:100%;">
<el-button :loading="loading" size="medium" type="primary" style="width:100%;" @click.native.prevent="handleLogin">
<span v-if="!loading">登 录</span>
<span v-else>登 录 中...</span>
</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
</div>
<!-- 底部 -->
<div v-if="$store.state.settings.showFooter" id="el-login-footer">
<span v-html="$store.state.settings.footerTxt" />
<span></span>
<!-- <a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">{{ $store.state.settings.caseNumber }}</a> -->
<span class="">技术支持:威海晶合数字矿山技术有限公司</span>
</div>
</div>
</template>
<script>
import Config from '@/settings'
import { getCodeImg } from '@/api/login'
import Cookies from 'js-cookie'
import qs from 'qs'
//import Background from '@/assets/images/login_bg.png';
import { encrypt } from '@/utils/rsaEncrypt'
import '@/assets/icons' // icon
export default {
name: 'Login',
data() {
return {
//Background: Background,
//Background:'',
codeUrl: '',
cookiePass: '',
loginForm: {
username: '',
password: '',
rememberMe: false,
code: '',
uuid: '',
},
loginRules: {
username: [{ required: true, trigger: 'blur', message: '用户名不能为空' }],
password: [{ required: true, trigger: 'blur', message: '密码不能为空' }],
code: [{ required: true, trigger: 'change', message: '验证码不能为空' }],
},
loading: false,
redirect: undefined
}
},
watch: {
$route: {
handler: function(route) {
const data = route.query
if (data && data.redirect) {
this.redirect = data.redirect
delete data.redirect
if (JSON.stringify(data) !== '{}') {
this.redirect = this.redirect + '&' + qs.stringify(data, { indices: false })
}
}
},
immediate: true
}
},
created() {
// 获取验证码
this.getCode()
// 获取用户名密码等Cookie
this.getCookie()
// token 过期提示
this.point()
},
methods: {
getCode() {
getCodeImg().then(res => {
this.codeUrl = res.img
this.loginForm.uuid = res.uuid
})
},
getCookie() {
const username = Cookies.get('username')
let password = Cookies.get('password')
const rememberMe = Cookies.get('rememberMe')
// 保存cookie里面的加密后的密码
this.cookiePass = password === undefined ? '' : password
password = password === undefined ? this.loginForm.password : password
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password,
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
code: '',
}
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
const user = {
username: this.loginForm.username,
password: this.loginForm.password,
rememberMe: this.loginForm.rememberMe,
code: this.loginForm.code,
uuid: this.loginForm.uuid,
}
if (user.password !== this.cookiePass) {
user.password = encrypt(user.password);
};
if (valid) {
this.loading = true
if (user.rememberMe) {
Cookies.set('username', user.username, { expires: Config.passCookieExpires })
Cookies.set('password', user.password, { expires: Config.passCookieExpires })
Cookies.set('rememberMe', user.rememberMe, { expires: Config.passCookieExpires })
} else {
Cookies.remove('username')
Cookies.remove('password')
Cookies.remove('rememberMe')
}
this.$store.dispatch('Login', user).then((res) => {
this.loading = false
if(/* res.head.code !== '0000' */ res.code){
return this.$notify({
title: '提示',
message: res.msg,
type: 'warning',
duration: 5000
})
};
//this.$router.push({ path: this.redirect || '/' })
window.location.href = this.redirect || '/';
}).catch((err) => {
this.loading = false
this.getCode()
})
} else {
console.log('error submit!!')
return false
}
})
},
point() {
const point = Cookies.get('point') !== undefined
if (point) {
this.$notify({
title: '提示',
message: '当前登录状态已过期,请重新登录!',
type: 'warning',
duration: 5000
})
Cookies.remove('point')
}
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scope>
.login {
display:flex;justify-content:center;align-items:center;flex-direction:column;
height:100%;background-size:cover;position:relative;
.headder{
margin-bottom:.48rem;text-align:center;
h2, h4{
margin:0;padding:0;line-height:1;background-image:-webkit-linear-gradient(top, #fff, #a2deff, #23a5f9);
-webkit-background-clip:text;-webkit-text-fill-color:transparent;
}
h2{font-size:.66rem;letter-spacing:.06rem;}
h4{margin-top:.20rem;font-size:.285rem;}
}
.logo-place{
position:relative;width:9.68rem;height:5.56rem;/* margin:2.01rem auto 0; */
//background:no-repeat top center url('~@/assets/images/login_adorn1.png');background-size:100% 100%;
}
.ctn-place{
position:absolute;top:1.61rem;right:.06rem;height:auto;width:4.79rem;
flex:1;display:flex;
.inbox-range{
flex:1;
.ctn-fix{width:3.8rem;margin:0 auto;}
}
.login-form {
.el-input {
height:.58rem;min-height:38px;
input {
height:.58rem;padding-left:.40rem;
background-color:#1042a1 !important;color:#fff;border-color:#085fa2;
}
}
.input-icon{
height:.58rem;width:.24rem;margin-left:.02rem;
}
.el-form-item__content{
line-height:.58rem;
}
.el-form-item{
margin-bottom:.25rem;
&:last-child{margin-bottom:0}
.el-select{width:100%;}
}
}
}
.logo-title{
position:absolute;top:.15rem;left:0;height:auto;width:100%;text-align:center;cursor:default;font-size:.26rem;line-height:1;letter-spacing:10px;color: rgb(56, 230, 255);text-shadow:0px 0px 2px rgb(56 230 255);
}
.subtitle{
position:absolute;top:.91rem;left:0;height:auto;width:100%;text-align:center;cursor:default;font-size:.34rem;line-height:1;letter-spacing:10px;color:#b1edf8;
}
}
.login-code {
width: 33%;
display: inline-block;
height: 38px;
float: right;
img{
cursor: pointer;
vertical-align:middle
}
}
</style>
<!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(filename){
loaderModel(filename);
};
// loader
function loaderModel(filename){
clearModel();
var dir = window.location.port === '8050' ? '../' : '../../';
filename = filename || 'default.fbx';
// 进度条
var Progress = new qf.UI.progressBar({top:'1.2rem',width:'19.2rem', display:'flex', justifyContent:'center'});
// 加载模型
loader.load(dir + 'oldFbx' + filename, 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.
{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[121.919267463301,37.4724086531978,0],[121.926304947969,37.4753327377588,0],[121.950127472499,37.4842466466235,0],[121.959683380547,37.4882687537968,0],[121.961262907779,37.4889115521214,0],[121.96272972476,37.4890716962061,0],[121.964117732795,37.4889320666797,0],[121.966409069846,37.4881551038013,0],[121.967598555735,37.4876949739329,0],[121.970870568253,37.4875599304414,0],[121.974298798265,37.4875811876528,0],[121.97750147668,37.4878548402375,0],[121.980860380793,37.4887487278694,0],[121.988568227975,37.4916948492441,0],[121.992110024694,37.4931137281511,0],[121.992752755305,37.4938215994741,0],[121.993020793168,37.4942596781662,0],[121.992951981607,37.4946937867091,0],[121.992699786319,37.4952194341252,0],[121.991997022809,37.4967292289558,0],[121.991788635953,37.4976406548105,0],[121.991858344229,37.4981443265904,0],[121.992361575569,37.4986266805168,0],[121.99318567867,37.4994029872679,0],[121.994393414628,37.5006830073938,0],[121.994462130748,37.5011396945051,0],[121.99450587044,37.5021723292358,0],[121.994323342523,37.5035875720033,0],[121.994349131448,37.5047332401478,0],[121.994575289863,37.5053714088063,0],[121.995217116975,37.5058044600615,0],[121.996267514669,37.5059652204511,0],[121.996840571238,37.5058524972271,0],[121.997257194103,37.505440316998,0],[121.998029645415,37.5046421377233,0],[121.998420343427,37.5043640086196,0],[121.998880781459,37.5042986207075,0],[122.002925975134,37.5049152027834,0],[122.005712423726,37.5063774818249,0],[122.008273566482,37.5091212281907,0],[122.010564537167,37.5132405657681,0],[122.010972902211,37.5159358049475,0],[122.010790294947,37.5178579518201,0],[122.010200130505,37.518865490656,0],[122.008749771839,37.5203434943247,0],[122.008471561049,37.5215950739687,0],[122.009325412103,37.5245129676749,0],[122.010139398544,37.5274909880211,0],[122.010953563971,37.5289003202788,0],[122.011886409518,37.5297734154126,0],[122.012344886234,37.5300020297378,0],[122.013768265299,37.5299328921521,0],[122.017518253015,37.5300240965027,0],[122.018543028577,37.5300031981241,0],[122.018959748462,37.5297730664351,0],[122.019437302732,37.529360801498,0],[122.020027517828,37.5289052346256,0],[122.020582830157,37.5286267389415,0],[122.021268736084,37.5284708651416,0],[122.026026448745,37.5284719526202,0],[122.028422519401,37.52837567466,0],[122.031305408258,37.5284712829213,0],[122.034872727135,37.5290403791627,0],[122.037616584096,37.5296837559686,0],[122.040204084527,37.5306436675133,0],[122.042973375573,37.5322452980089,0],[122.043772456884,37.5331134366999,0],[122.044232312394,37.5340982887679,0],[122.044250174991,37.5349880915272,0],[122.044163260024,37.5359950947361,0],[122.043563493485,37.5371151646818,0],[122.043477594059,37.5379831950239,0],[122.043703016677,37.5385776125502,0],[122.044094095572,37.5389207266127,0],[122.045117757062,37.5394504980061,0],[122.046081590652,37.5400194227181,0],[122.048668887672,37.5424458719241,0],[122.049537125643,37.5425151929808,0],[122.050726807568,37.5422639979971,0],[122.051986486479,37.5414608252417,0],[122.05274113782,37.5409365612869,0],[122.053175349131,37.5408668047692,0],[122.05362751213,37.5410279850256,0],[122.0539918142,37.5414402824391,0],[122.054747406347,37.5421258716751,0],[122.05520758876,37.5423080638483,0],[122.055754654459,37.5423081513353,0],[122.056327712008,37.5421262393739,0],[122.057056557371,37.541714129727,0],[122.058341643545,37.5404813139523,0],[122.060174173527,37.5377130238755,0],[122.060442844535,37.5371397303185,0],[122.060999065235,37.5369579559811,0],[122.061728037235,37.5370059107116,0],[122.062682763269,37.5367976238824,0],[122.063672530138,37.5362513896905,0],[122.064289770395,37.5360686136475,0],[122.064863066861,37.5360468814343,0],[122.066876668274,37.5365943128896,0],[122.067788638821,37.5369851830647,0],[122.068769576003,37.5374629989228,0],[122.069637630664,37.5383309091482,0],[122.070168011093,37.5394291619164,0],[122.070280542948,37.542745479798,0],[122.069916240876,37.5485788997645,0],[122.069525368824,37.5507969603458,0],[122.068882869855,37.5519634716597,0],[122.066937536329,37.5553921577452,0],[122.062753125782,37.5599658010886,0],[122.061475716832,37.5613373785182,0],[122.061059168146,37.5625697966247,0],[122.060807326174,37.5644009016037,0],[122.060807178007,37.5657517144774,0],[122.060998794402,37.5667533008597,0],[122.061476058441,37.5673265415432,0],[122.06237078399,37.5677392346416,0],[122.063603143195,37.5679005460732,0],[122.06447206774,37.5677184348822,0],[122.065565849686,37.5667811790971,0],[122.079088047459,37.5568378836533,0],[122.083753067044,37.553077974933,0],[122.087931971666,37.5519617579658,0],[122.095423130361,37.5506394145567,0],[122.100348208962,37.5496065424471,0],[122.102375833419,37.5492762892329,0],[122.103906139214,37.549565879435,0],[122.10500712363,37.5500293226988,0],[122.107660627617,37.5521984275965,0],[122.108390399153,37.5525888133067,0],[122.109214341741,37.5526583314035,0],[122.110013311643,37.5524978941688,0],[122.110769285673,37.5520854897181,0],[122.111594422734,37.5512392267815,0],[122.112366455959,37.5509878553256,0],[122.113078399999,37.5510574073054,0],[122.113721259134,37.5512399030243,0],[122.114241964903,37.5514223102583,0],[122.115414651243,37.5513533385501,0],[122.116465216637,37.5512623061449,0],[122.117237375253,37.5514010099348,0],[122.118062605704,37.5518787336281,0],[122.118357002336,37.5524999274997,0],[122.118410013733,37.5531638774194,0],[122.118270673373,37.5542575713997,0],[122.11516222752,37.5610066649976,0],[122.114406907458,37.5631976988201,0],[122.114294605868,37.56450442027,0],[122.114380659712,37.5651204079065,0],[122.115484122172,37.5662402153459,0],[122.116421457937,37.5667230004288,0],[122.117836616576,37.566814331411,0],[122.119277932734,37.5666317956126,0],[122.120762425296,37.5662893981354,0],[122.122159920608,37.5653520579405,0],[122.12364474,37.5635899987003,0],[122.126614810388,37.5584213385378,0],[122.127214125082,37.5569153196042,0],[122.127491757542,37.5560428049399,0],[122.127830463921,37.5556093059045,0],[122.128498796147,37.5554262028285,0],[122.133751510007,37.5565252950493,0],[122.136295059457,37.5565740553262,0],[122.139377063478,37.5562958623086,0],[122.143908764077,37.5561622464741,0],[122.145462536195,37.5561358629188,0],[122.146192360704,37.5557931556717,0],[122.146582374694,37.5552898985209,0],[122.146721775257,37.5547652170754,0],[122.146695780429,37.5541272698158,0],[122.146565519377,37.5535751312662,0],[122.146287880506,37.5531677191391,0],[122.145896948485,37.552916091466,0],[122.144820349469,37.5526643079021,0],[122.143769819609,37.552572562864,0],[122.143110262088,37.5523425040907,0],[122.14263317333,37.5518827889314,0],[122.142311465487,37.55135734297,0],[122.141894539457,37.5507887507876,0],[122.141208966425,37.5503976991753,0],[122.140063334412,37.5500069214959,0],[122.139125238005,37.5493695365577,0],[122.138855682234,37.5487962044892,0],[122.138829679829,37.5482712479176,0],[122.139377003574,37.547655208664,0],[122.14036633931,37.5472428484998,0],[122.141669428183,37.5469220028636,0],[122.142997599333,37.5467612056981,0],[122.144022090886,37.546465955155,0],[122.144733872768,37.5459142384177,0],[122.145211142064,37.5449122081988,0],[122.145576161823,37.5437230238279,0],[122.145740611559,37.5432843763644,0],[122.146148635999,37.5430591088142,0],[122.146470422174,37.5431026512801,0],[122.146860353067,37.5433802731782,0],[122.147616169711,37.5438794921291,0],[122.148371038506,37.5439707861904,0],[122.148822182956,37.543814598663,0],[122.149508970405,37.543219900798,0],[122.150150686444,37.5423041844081,0],[122.150653993768,37.5419831284537,0],[122.15143599301,37.5418485401231,0],[122.15230420436,37.5418700872033,0],[122.153379926304,37.5421919661451,0],[122.15465620592,37.5422822607647,0],[122.155394143536,37.5420306461852,0],[122.15595866848,37.541479770289,0],[122.156922260967,37.5407026684408,0],[122.15739952623,37.5405205769536,0],[122.157902851773,37.5404295197087,0],[122.158588633068,37.5405647627635,0],[122.159804739523,37.5413668789804,0],[122.161150218928,37.5419612808479,0],[122.162643054393,37.5422829560096,0],[122.163893355077,37.5422832906886,0],[122.164969242388,37.5418703725875,0],[122.165768426292,37.5412069810496,0],[122.166462369169,37.5401994526001,0],[122.166688084057,37.5391020644262,0],[122.166574843777,37.5385549472823,0],[122.166184904466,37.5377083647652,0],[122.165525230143,37.53706624237,0],[122.165333758308,37.5367489398406,0],[122.165333800588,37.5363580089283,0],[122.165794056321,37.5359939349387,0],[122.166340562524,37.5354210599674,0],[122.166687541331,37.5348478120006,0],[122.166774843594,37.5341840944696,0],[122.166731820669,37.5333421656869,0],[122.166227589217,37.5324043916625,0],[122.165247111663,37.5313497489404,0],[122.16417038007,37.5302989282903,0],[122.160767888275,37.5264323589948,0],[122.159890700068,37.5253129416653,0],[122.159691244608,37.5246746939972,0],[122.159760471169,37.524261902063,0],[122.160949755154,37.5228423889646,0],[122.161271712617,37.52183618579,0],[122.161219671437,37.5209462640558,0],[122.161019202407,37.5203949996003,0],[122.160646266532,37.5199613912882,0],[122.160098864931,37.5195964459898,0],[122.15963969459,37.5192536618096,0],[122.159257733471,37.518863031691,0],[122.158684285774,37.5183380754186,0],[122.158111820619,37.5180210815939,0],[122.15717337349,37.5179733625384,0],[122.156375279067,37.5181118699052,0],[122.155454854285,37.518428123755,0],[122.154864327424,37.5184070525545,0],[122.154066304275,37.5180636736762,0],[122.153145989732,37.5175821090738,0],[122.15223466671,37.5174904911672,0],[122.151435617696,37.517608040493,0],[122.150332802684,37.5177900472513,0],[122.149881672072,37.5177202655032,0],[122.14946467505,37.517238629699,0],[122.14932638928,37.5166705023649,0],[122.149421712794,37.5158938278987,0],[122.149534057245,37.515320142599,0],[122.149491053023,37.5143612644088,0],[122.149351762836,37.5138101339559,0],[122.148822500725,37.5132153311019,0],[122.148319268688,37.5129855018486,0],[122.147520279285,37.5130111115474,0],[122.146834568855,37.513145902572,0],[122.146148854496,37.5133976766635,0],[122.14542006862,37.5134234323737,0],[122.144941929443,37.5131936720936,0],[122.144412696388,37.5127328782536,0],[122.143752192302,37.5119129460931,0],[122.143153819384,37.5113400733531,0],[122.142511324519,37.5109970866102,0],[122.141626246751,37.5108366743552,0],[122.1406619898,37.5107931254369,0],[122.139472223371,37.5108582150706,0],[122.136842168425,37.5116389651985,0],[122.13553924648,37.5119549327092,0],[122.133959816618,37.5119116125356,0],[122.13131129508,37.5112949764466,0],[122.127760336128,37.5096925612942,0],[122.126640241327,37.5090982623629,0],[122.125407980426,37.5085248594843,0],[122.124243929606,37.5076786424274,0],[122.124009549239,37.5072664547377,0],[122.123940464086,37.5069014524753,0],[122.128585209224,37.5073581346921,0],[122.12869796525,37.5024663553925,0],[122.126458620728,37.5024444857405,0],[122.126093957252,37.5021930875326,0],[122.126023857705,37.5018930676224,0],[122.126068033216,37.5010473117322,0],[122.126988078898,37.4983470757389,0],[122.128333906558,37.4964072518145,0],[122.130139656401,37.4951139545982,0],[122.131813093528,37.4951562514185,0],[122.133384366584,37.4955253984393,0],[122.13528044001,37.4957571215864,0],[122.137314012072,37.4952023240148,0],[122.144508127939,37.4924385523783,0],[122.145072529241,37.4921425724422,0],[122.147520736691,37.4903371839054,0],[122.148622632109,37.4889184370331,0],[122.148943573165,37.4876383070719,0],[122.148892549236,37.486679451304,0],[122.14857086403,37.4855811587741,0],[122.147937389725,37.4846212939058,0],[122.146105996506,37.4834324388696,0],[122.145054538422,37.4824249059611,0],[122.143908925423,37.4809623505353,0],[122.143952247895,37.4789489326923,0],[122.145011176231,37.4755635793583,0],[122.149213649344,37.465454500875,0],[122.150498347429,37.4611579485626,0],[122.151956339029,37.458458299359,0],[122.155342405081,37.455073378507,0],[122.157495214048,37.4531068906062,0],[122.159230967469,37.4511416694032,0],[122.160742159962,37.4490840814142,0],[122.161522500818,37.4464323236093,0],[122.161522683431,37.4447398317781,0],[122.161470777809,37.4425913851782,0],[122.161427891327,37.4404859484616,0],[122.161704867519,37.4381981710406,0],[122.162252354761,37.4371484641273,0],[122.165038963672,37.4347224306505,0],[122.168788101219,37.4324351747186,0],[122.172955212804,37.4308814481331,0],[122.175836764059,37.4304249289197,0],[122.178805414021,37.4303773803841,0],[122.180929679123,37.4316798058881,0],[122.182193584541,37.4342972393042,0],[122.181020251729,37.4378190360789,0],[122.180930706682,37.4407979557433,0],[122.187248784486,37.4462144305459,0],[122.188963605954,37.4490125182869,0],[122.18860351455,37.4511792718841,0],[122.187700113226,37.4533461034522,0],[122.189596436085,37.4553317435039,0],[122.191491898768,37.4552419199569,0],[122.195102283842,37.4538871280533,0],[122.199106980775,37.4542041772042,0],[122.203178384585,37.4540210962684,0],[122.205373662806,37.4542030353148,0],[122.207612812075,37.4547977836958,0],[122.208758782058,37.4558959094817,0],[122.210728965118,37.4586385195812,0],[122.211865742908,37.4601484221845,0],[122.212829259131,37.4609732864944,0],[122.215753747512,37.4624350303534,0],[122.217307073124,37.4624355948867,0],[122.219780627602,37.4618830794177,0],[122.221056396532,37.4612453806089,0],[122.224435876884,37.4582579308823,0],[122.2265151979,37.4581424354191,0],[122.228305869387,37.4596441568852,0],[122.228248439156,37.4631681390845,0],[122.228248107826,37.466288282786,0],[122.230269781958,37.4683678790537,0],[122.232695889424,37.467559293343,0],[122.236104583339,37.46449644322,0],[122.241408046743,37.4655383408341,0],[122.245103927328,37.4665162708214,0],[122.247830171352,37.4670249456715,0],[122.251158155785,37.4659606253821,0],[122.255536837947,37.4596379398177,0],[122.258643766897,37.457852991121,0],[122.261160483349,37.4571667494206,0],[122.264267391874,37.4572576345866,0],[122.266054983824,37.457348251775,0],[122.267512717304,37.4575310107147,0],[122.269708689686,37.4572561600957,0],[122.271999460924,37.4559323533518,0],[122.274377964117,37.4540564426991,0],[122.277076889508,37.4515391761496,0],[122.281335572941,37.446429506041,0],[122.282143635395,37.4440601761859,0],[122.280756791793,37.4428473231966,0],[122.277464365974,37.4423274793223,0],[122.275566832316,37.4417997952934,0],[122.274967709346,37.4404238742845,0],[122.274786054474,37.4392344380824,0],[122.274968131638,37.4364481074306,0],[122.275427937317,37.4330146866992,0],[122.27611338876,37.4301808296445,0],[122.277259178766,37.4278022907949,0],[122.279585287382,37.4255622447118,0],[122.280869577033,37.4245549735412,0],[122.28401996549,37.423547176582,0],[122.28887109755,37.4227705515928,0],[122.293714490124,37.4219453776174,0],[122.300759651473,37.422109603123,0],[122.305600475347,37.4221660285481,0],[122.307768947782,37.420532632357,0],[122.308050452114,37.4194064939736,0],[122.307233412407,37.4177735389782,0],[122.307523993271,37.4157716879485,0],[122.309589503734,37.4152680593163,0],[122.315300650618,37.4151293818685,0],[122.326689383061,37.4138479589139,0],[122.332088975017,37.4134838324112,0],[122.340318232183,37.4148081203604,0],[122.351664346583,37.4153124989742,0],[122.356873423687,37.4154993896221,0],[122.371146511763,37.4187480736359,0],[122.372570649212,37.4191124895967,0],[122.378969498374,37.4195256823481,0],[122.380524061449,37.4194345668629,0],[122.382355552684,37.4189754912622,0],[122.383588692833,37.4180640448233,0],[122.387435512263,37.4150011282608,0],[122.388347124227,37.4140850670678,0],[122.390361245185,37.413630518276,0],[122.392193626066,37.4132181676862,0],[122.398184741418,37.4126677572177,0],[122.399434682105,37.4044347129174,0],[122.400137892324,37.4030682714087,0],[122.401996550754,37.3996917800264,0],[122.403342144072,37.3972479774472,0],[122.404219525207,37.39619360826,0],[122.405330292501,37.3927952213021,0],[122.405217342512,37.391936501305,0],[122.404983403566,37.3905689323407,0],[122.404904466778,37.3897222233019,0],[122.405113659047,37.3886676895163,0],[122.405043692386,37.3881208719673,0],[122.404965688107,37.3878949311619,0],[122.404514547886,37.387708856045,0],[122.403498267191,37.3873397014935,0],[122.401483857624,37.3867834656403,0],[122.400624745345,37.3865874045836,0],[122.400111770985,37.3857936408143,0],[122.399851795231,37.3853377857129,0],[122.399425794591,37.3850338611625,0],[122.395943949585,37.3844250634854,0],[122.395467042679,37.3841432084784,0],[122.395146121263,37.3838693439075,0],[122.395041191284,37.3833835410215,0],[122.395510167481,37.3829406655598,0],[122.395692181843,37.3825807887997,0],[122.395710210172,37.3822988958257,0],[122.394503401132,37.3823460033943,0],[122.393538602131,37.382446110766,0],[122.390083714168,37.3828528042486,0],[122.389744877673,37.3826969747699,0],[122.38976209125,37.3806657524589,0],[122.389032494124,37.3800402489034,0],[122.38653190199,37.3795234887762,0],[122.387157868279,37.3764544028585,0],[122.386984022316,37.3759596745917,0],[122.385204202521,37.3753347841365,0],[122.382928885138,37.3750211988187,0],[122.38233841337,37.3744747833869,0],[122.381869882239,37.373693395022,0],[122.381305404421,37.3732719380059,0],[122.380653982266,37.3731854216341,0],[122.379117367938,37.3734974228287,0],[122.378813696337,37.3731767830275,0],[122.37855300083,37.37272516522,0],[122.378509116431,37.3720604640577,0],[122.378431240225,37.3716306965636,0],[122.378101632202,37.3710531887849,0],[122.377719109535,37.3702338254444,0],[122.37821485508,37.3679593408057,0],[122.378180040519,37.366574928468,0],[122.377858456888,37.3657325287126,0],[122.374220491054,37.3653888580858,0],[122.373161785335,37.3651849595798,0],[122.372892135882,37.3650112960738,0],[122.372683421644,37.3647636044858,0],[122.372527728134,37.3637311818512,0],[122.372622755657,37.3623856382093,0],[122.372996485926,37.3606060000186,0],[122.374090504097,37.3574812386389,0],[122.374307328952,37.3567393437101,0],[122.374107706404,37.3554320795644,0],[122.373812183463,37.3542778462551,0],[122.373482611621,37.3539872862584,0],[122.372779496833,37.3537700682734,0],[122.372310123818,37.3534006947391,0],[122.371806801587,37.3530493563401,0],[122.371103719381,37.3529881137602,0],[122.369792460286,37.3531054736012,0],[122.368889678492,37.3533783623276,0],[122.368499190164,37.3537296567101,0],[122.367822039058,37.3548239753091,0],[122.36743057472,37.3551183090203,0],[122.366354142873,37.3553315026136,0],[122.364462020759,37.3555647485017,0],[122.363975800761,37.3554484173839,0],[122.363480643781,37.3549622603595,0],[122.362569318452,37.3531432217815,0],[122.361118888269,37.3516797932404,0],[122.359087361797,37.3518925365713,0],[122.352723823883,37.3548608567268,0],[122.351160880539,37.3549783065647,0],[122.350691841247,37.3547261730291,0],[122.350770753816,37.3540793171116,0],[122.35280220212,37.3499608083117,0],[122.350943983569,37.3487672926562,0],[122.348695710693,37.3469917521714,0],[122.348677935194,37.3452515327679,0],[122.348304826277,37.3440796642502,0],[122.347445613218,37.3439441695238,0],[122.347332952353,37.3429677848444,0],[122.348288305473,37.3399604906937,0],[122.347211601022,37.3392965977644,0],[122.347964127791,37.33852166818,0],[122.34778060654,37.337594386668,0],[122.349469378391,37.335504495379,0],[122.350719970853,37.3345198843048,0],[122.35213228417,37.3335480438292,0],[122.352437719397,37.3332506907547,0],[122.359589013696,37.3285620647699,0],[122.361792441946,37.3269337672277,0],[122.363230155477,37.3262931523743,0],[122.364535175553,37.3254178744229,0],[122.365656487789,37.3250006652597,0],[122.365511861009,37.3235954880148,0],[122.365138948369,37.3188511443879,0],[122.365451514147,37.3184219558166,0],[122.365919813452,37.3183044344118,0],[122.367778091748,37.3180533335773,0],[122.368499069744,37.317974539785,0],[122.368698813241,37.3177404218953,0],[122.368698885099,37.3170767317185,0],[122.368464269538,37.31658622796,0],[122.36646733459,37.3151232576526,0],[122.366042197504,37.3130527482454,0],[122.365763778318,37.3115857829115,0],[122.365789768493,37.3113118808772,0],[122.36604140005,37.3111946287198,0],[122.3676999161,37.3114905100316,0],[122.368290067416,37.3115078192227,0],[122.368837311384,37.3113512706605,0],[122.36935862417,37.3109998533137,0],[122.369792088592,37.3104536340027,0],[122.369871015032,37.3101406963095,0],[122.369714323676,37.3092642855972,0],[122.36965353391,37.3080919122611,0],[122.36954020584,37.3033263295126,0],[122.369619273291,37.3017030291242,0],[122.36924591654,37.3005140216682,0],[122.368697889107,37.2985995727568,0],[122.368525168867,37.2982659324067,0],[122.3674307543,37.2981312648846,0],[122.366293484765,37.297678843676,0],[122.364679037874,37.2969192129263,0],[122.363115555636,37.2966073756078,0],[122.361630992328,37.2966283404091,0],[122.360225344177,37.2968801451389,0],[122.359808035581,37.2971356028375,0],[122.359712167719,37.297448583833,0],[122.359730105176,37.2977394159326,0],[122.359947646918,37.2984987387765,0],[122.359851770197,37.2988896817819,0],[122.359382510795,37.2995750078438,0],[122.358350264695,37.3001611968284,0],[122.357602530464,37.3008249596456,0],[122.356057167895,37.3025044345391,0],[122.351508650642,37.3044955519363,0],[122.351169331259,37.3044091408066,0],[122.350422952148,37.3031679530329,0],[122.349511913178,37.3019870211917,0],[122.349416254455,37.3006198440667,0],[122.349078101123,37.2991351287176,0],[122.348435425667,37.2990182567898,0],[122.347271784318,37.2993960317249,0],[122.347611011018,37.3000511379935,0],[122.34766283973,37.3006457606678,0],[122.346646872158,37.3013711320379,0],[122.345682879457,37.3015177144372,0],[122.344103422547,37.2997773066551,0],[122.343296218942,37.2991920111716,0],[122.341004384061,37.2975119166736,0],[122.340700081831,37.2972385986838,0],[122.34040480519,37.2965564667524,0],[122.340301169096,37.2952982738638,0],[122.34029236007,37.2937050773032,0],[122.339407325693,37.2936277209315,0],[122.339241717611,37.2934011347126,0],[122.33906826688,37.2918782069722,0],[122.338765000531,37.2913310329945,0],[122.338182397027,37.2904325477876,0],[122.338104612944,37.2900418855797,0],[122.338607568978,37.2893083305457,0],[122.337896231385,37.2886269762418,0],[122.336342657171,37.2892515326647,0],[122.336117170675,37.2892129705551,0],[122.335917636782,37.2890744107578,0],[122.335735089688,37.2887049354307,0],[122.335838939508,37.2879151382573,0],[122.33583899537,37.2873943996956,0],[122.335734275397,37.2869947954837,0],[122.335448976382,37.2864875822319,0],[122.334762603289,37.2858531837495,0],[122.334120231786,37.2843131653383,0],[122.334814657974,37.2842428999828,0],[122.335708646967,37.2840783151087,0],[122.335795420116,37.284361010501,0],[122.336515814273,37.284156775987,0],[122.336333313424,37.2833445260104,0],[122.335734672061,37.2832966628102,0],[122.334997337431,37.2833620048149,0],[122.334155259206,37.2833146055557,0],[122.333721247344,37.2833364095717,0],[122.333182434539,37.2837532123334,0],[122.3328611522,37.283921732724,0],[122.331507241879,37.2841042014605,0],[122.329892959307,37.2841562444099,0],[122.329398093165,37.2842521396952,0],[122.327348731847,37.2847037822441,0],[122.325517952222,37.2850721167149,0],[122.324302753432,37.2853283273661,0],[122.32200209817,37.2853847305354,0],[122.320674165301,37.2855232163402,0],[122.319067845352,37.2858751249056,0],[122.317063445956,37.2860318838978,0],[122.316568762852,37.2843306875941,0],[122.318781796558,37.283158048175,0],[122.318295987245,37.2825033118871,0],[122.316316523664,37.282620036075,0],[122.314841072429,37.2809406971425,0],[122.314276466564,37.2799072948893,0],[122.314076967581,37.279455903319,0],[122.313973278734,37.2787444637605,0],[122.314129022289,37.277837634328,0],[122.314138063466,37.2772599140688,0],[122.313582444501,37.2761185519428,0],[122.31328714247,37.2758362547571,0],[122.312670561894,37.2755715526184,0],[122.312158740554,37.2753156463003,0],[122.311968195198,37.2750641336104,0],[122.311907347486,37.2749163240504,0],[122.311915398854,37.2742656454684,0],[122.311950494275,37.2726334259017,0],[122.311734146114,37.2710706442972,0],[122.311386964927,37.2706804973253,0],[122.311030814733,37.2701724276976,0],[122.310778419155,37.2697821022863,0],[122.310596242252,37.2658674957319,0],[122.310666289568,37.2639613716034,0],[122.310683320066,37.2633196795556,0],[122.310579579299,37.2630540135127,0],[122.310223392623,37.2628507837504,0],[122.309667640919,37.2626938980436,0],[122.306717102252,37.2626643299312,0],[122.30528417593,37.2627508753988,0],[122.304711369463,37.2630157630263,0],[122.30261963457,37.2643437736393,0],[122.30194298793,37.2648386990328,0],[122.301517819151,37.2652822069392,0],[122.301318138982,37.2661411016947,0],[122.301083518465,37.2671050020259,0],[122.300857936036,37.267525172145,0],[122.300493661061,37.2677037077161,0],[122.300120434036,37.2675734185007,0],[122.298549656862,37.2669704118122,0],[122.29605860886,37.2663239018079,0],[122.295329017513,37.2662371396914,0],[122.294964708591,37.2662587195429,0],[122.293697056509,37.2665975766133,0],[122.292707862799,37.266806031136,0],[122.292369460057,37.2670104537855,0],[122.292160816095,37.2672356610068,0],[122.291779335705,37.2688544047322,0],[122.291875063218,37.2697917660254,0],[122.292048703031,37.2702212719463,0],[122.292083608298,37.2705170632685,0],[122.291909899777,37.2707382179127,0],[122.288299169106,37.2713643434037,0],[122.287769103305,37.2709953092899,0],[122.287144190373,37.2705824275118,0],[122.286206740942,37.2704878126104,0],[122.285305204744,37.2703881275444,0],[122.284314762345,37.2704484585712,0],[122.283239412763,37.2705268668,0],[122.281399193472,37.2701534668374,0],[122.280462548684,37.2700756945649,0],[122.280115035851,37.2701151079512,0],[122.279663623611,37.2705274511725,0],[122.279195165446,37.2715215062995,0],[122.278612835817,37.2726756096285,0],[122.278379129386,37.2728717872103,0],[122.278066548722,37.2728501695971,0],[122.277459395179,37.2724021147741,0],[122.276712401796,37.2719901900295,0],[122.275914414178,37.2719121315091,0],[122.273883844093,37.2719912925776,0],[122.271947982687,37.2722431381021,0],[122.270055969764,37.272009072609,0],[122.268737250981,37.2719612901428,0],[122.267530289769,37.2725520229538,0],[122.266532106688,37.2729776241465,0],[122.266055384962,37.2740924268338,0],[122.266246172727,37.2746140056711,0],[122.266462912447,37.2753694419417,0],[122.266749635545,37.2756990399124,0],[122.266558756846,37.2760809976915,0],[122.265873291169,37.2763893840134,0],[122.264614230029,37.2768361126943,0],[122.263833802231,37.2768626652318,0],[122.262270887177,37.2766978188665,0],[122.261038681717,37.2763897583863,0],[122.260075210843,37.2765552455256,0],[122.259311593492,37.2767415792588,0],[122.258773767942,37.2776184182563,0],[122.258322848937,37.2788730095478,0],[122.257489015684,37.2807914435051,0],[122.256665175716,37.2824239967365,0],[122.255831438578,37.2828061660287,0],[122.253732046975,37.2828759310984,0],[122.245235206194,37.2843227430925,0],[122.239767476957,37.2849829572613,0],[122.23213978801,37.2846066399566,0],[122.223208894765,37.283575531559,0],[122.213653452519,37.2829258243016,0],[122.20513043605,37.2821368027272,0],[122.20049619645,37.2817814927037,0],[122.199073183773,37.2820422620791,0],[122.198048977534,37.2822336259946,0],[122.197163023028,37.2826020888812,0],[122.196278003669,37.2833923224905,0],[122.195314803411,37.2840434877214,0],[122.194680349548,37.2843863125104,0],[122.193144837471,37.2847426745712,0],[122.192276815735,37.2850381158246,0],[122.191721513952,37.2852151173818,0],[122.191243403336,37.2852153300409,0],[122.190583890117,37.2849553686459,0],[122.189933388271,37.2846944153188,0],[122.18940414926,37.2845775861843,0],[122.188978141157,37.2845428854015,0],[122.188795692777,37.284673510843,0],[122.188491926334,37.2850637988211,0],[122.188154081238,37.2854070511961,0],[122.187910481436,37.2855505635214,0],[122.187598727864,37.2855850133115,0],[122.187224828562,37.2855593852032,0],[122.186808824076,37.2855366809465,0],[122.186513103851,37.2855591592806,0],[122.186192309382,37.2856895384988,0],[122.185966742789,37.2858450689394,0],[122.185463493159,37.2860231039151,0],[122.185237936236,37.2860586925174,0],[122.184725686752,37.2859628446169,0],[122.184213445021,37.2857500521599,0],[122.183614009914,37.2852772334351,0],[122.183354376199,37.2851688288378,0],[122.182902248522,37.285182020368,0],[122.182520280591,37.2853122753296,0],[122.182130277773,37.2855594552836,0],[122.181895628683,37.2861277497022,0],[122.181591846332,37.2863061162341,0],[122.181131675814,37.2864142363193,0],[122.180289546759,37.2864147195197,0],[122.178988237853,37.2864143622088,0],[122.178545114915,37.2863315974483,0],[122.178172193328,37.2860240722713,0],[122.177356210439,37.2849821056534,0],[122.177034427985,37.2845567306405,0],[122.176739800355,37.2833238137543,0],[122.176488201881,37.2828515908484,0],[122.175707273983,37.282008580986,0],[122.174334875652,37.2804948149327,0],[122.173519803221,37.2800345380072,0],[122.171939826208,37.2786373126529,0],[122.170855088507,37.277664787145,0],[122.170212462576,37.2771008758689,0],[122.169005399979,37.2760801426859,0],[122.167894527759,37.2756073059528,0],[122.166974129797,37.275368704611,0],[122.165880271266,37.2751557651498,0],[122.165620599664,37.2750393388539,0],[122.165177495533,37.2744488140376,0],[122.164864750208,37.2737146082463,0],[122.164864775675,37.2734767314482,0],[122.165359115698,37.2731208413636,0],[122.165975841237,37.2721744874237,0],[122.166453247874,37.2707771085776,0],[122.16708697767,37.2702075927689,0],[122.168041523489,37.2698995417823,0],[122.169222655104,37.2696658754274,0],[122.169431248682,37.2692404880097,0],[122.169344069993,37.2687675721404,0],[122.169005220036,37.268385138049,0],[122.167963558046,37.2676515716851,0],[122.166566065086,37.2659028720626,0],[122.165550572484,37.2641968692039,0],[122.165056488498,37.262161021548,0],[122.164656528824,37.2612847380589,0],[122.164222424007,37.2609281153386,0],[122.163823393662,37.2607414683053,0],[122.162686428497,37.2605034707923,0],[122.161600685151,37.2601037120161,0],[122.160793627763,37.2595095238284,0],[122.159804103211,37.2588450378949,0],[122.158328314389,37.2581856561163,0],[122.15738187074,37.2579730242496,0],[122.156887616427,37.2576862688095,0],[122.156696169899,37.2572131706371,0],[122.156297182808,37.2567656788723,0],[122.15568062224,37.2564317301076,0],[122.15418781428,37.2560542164139,0],[122.152937651803,37.2556761619691,0],[122.152624879079,37.255437727989,0],[122.152364301034,37.2546346926232,0],[122.152103680976,37.2542314430929,0],[122.151062125837,37.2534280190568,0],[122.150628078184,37.2529764928378,0],[122.149204549463,37.2525512144129,0],[122.147354996484,37.2521692045185,0],[122.145705957403,37.2521254043495,0],[122.144186263196,37.2522637667816,0],[122.14271977361,37.2521254072665,0],[122.141721481632,37.251509106727,0],[122.140209976203,37.2513177730101,0],[122.138317662227,37.2511268913286,0],[122.137084858005,37.2514128332977,0],[122.135617488887,37.2525499976381,0],[122.134384456824,37.2558134124884,0],[122.133204551383,37.2593637993411,0],[122.132067088063,37.2600278278819,0],[122.12969619016,37.260452340013,0],[122.127239305387,37.2609728469575,0],[122.123402238776,37.2605943809868,0],[122.121839581009,37.2598829899313,0],[122.118427235591,37.2572348178056,0],[122.117523830477,37.2571869596863,0],[122.113313441477,37.2597898298334,0],[122.111558976604,37.2612087072858,0],[122.110048859739,37.2634354423485,0],[122.107817341549,37.2629142762131,0],[122.102755333727,37.2635244134482,0],[122.101565219041,37.2648052910587,0],[122.101291783573,37.266846122678,0],[122.093851752743,37.2641212108405,0],[122.089719790869,37.2626063000509,0],[122.084656922356,37.2604228457568,0],[122.081442721544,37.2592309581803,0],[122.075647616758,37.2570819491965,0],[122.071427741065,37.2569837513514,0],[122.070072952924,37.25695214117,0],[122.069703260762,37.2573153353136,0],[122.070819120565,37.2583726143334,0],[122.070604294056,37.2585437409166,0],[122.070647225832,37.2588165513998,0],[122.070303544938,37.2587489399995,0],[122.069318400295,37.2594326144781,0],[122.068589237505,37.2583749765035,0],[122.06816063848,37.2587172730874,0],[122.067689172789,37.2583420105503,0],[122.067473384249,37.2585121685783,0],[122.067131738567,37.2586494936054,0],[122.06786113228,37.257044508313,0],[122.067217834113,37.2569073253657,0],[122.066960059872,37.2574213528832,0],[122.066316785578,37.2573541578518,0],[122.066444707688,37.2567393331167,0],[122.06567361149,37.2565693656707,0],[122.065160174253,37.2569797867326,0],[122.064087566627,37.2562625482327,0],[122.063872826004,37.2563657744156,0],[122.062717357251,37.2560614873358,0],[122.062545556444,37.2563345759691,0],[122.062160090484,37.2561971823081,0],[122.061002570286,37.2573611953266,0],[122.060531270413,37.2571220065951,0],[122.060829912303,37.2564729208584,0],[122.060316670141,37.2563027603004,0],[122.060916921631,37.2552444553865,0],[122.060060137331,37.2554505963856,0],[122.060146037401,37.2552115980552,0],[122.059931352643,37.2552119156669,0],[122.060060203922,37.2548359271202,0],[122.059717724456,37.2546985102541,0],[122.059760686507,37.2544605743259,0],[122.059202540934,37.2542895058505,0],[122.059117643459,37.2545295052976,0],[122.058988857603,37.2543597927525,0],[122.058860102265,37.2539162286068,0],[122.059116737098,37.2536789654172,0],[122.058517677123,37.2534739936482,0],[122.058303025204,37.2533383993164,0],[122.058003472244,37.2535427560828,0],[122.05778783505,37.2533382051434,0],[122.056975073422,37.2539551656029,0],[122.056803364638,37.2538524977779,0],[122.054875422947,37.2555967488852,0],[122.054875408129,37.2557336752857,0],[122.054404189486,37.2561102757949,0],[122.054274465857,37.2556667367879,0],[122.053974996012,37.2556672530037,0],[122.053975040351,37.2552574733551,0],[122.053547870899,37.2546435469173,0],[122.053162674952,37.2536527575371,0],[122.053162722846,37.2532099965931,0],[122.052390164281,37.2530054812621,0],[122.052390193682,37.2527336282057,0],[122.051919084456,37.2526325324633,0],[122.05174735985,37.2530756047337,0],[122.051534765729,37.2530430100366,0],[122.051619634531,37.2527690032089,0],[122.05170551282,37.2523930500777,0],[122.051406073233,37.252462559519,0],[122.051620747086,37.2517105742127,0],[122.05209092517,37.2511290361264,0],[122.050378233096,37.2508243519907,0],[122.050035900756,37.2508599760801,0],[122.050248564266,37.2501089838389,0],[122.050335449728,37.2495960998075,0],[122.049306468356,37.2497689551023,0],[122.04900804648,37.2499734168403,0],[122.048836408197,37.2498388211257,0],[122.049050996628,37.2496335190797,0],[122.049092952761,37.2492576430165,0],[122.048621895784,37.2493604968048,0],[122.048494126715,37.2496345958277,0],[122.048192740721,37.2496691649969,0],[122.047894374998,37.249497843712,0],[122.047081081429,37.2494324921773,0],[122.046009389082,37.2492297655255,0],[122.046053331323,37.2488878622832,0],[122.045794930352,37.2485125943306,0],[122.046138211393,37.2483070063147,0],[122.046117297266,37.2479292550359,0],[122.044916942622,37.2476588707396,0],[122.04500376605,37.2475217653757,0],[122.04037955097,37.2463024061954,0],[122.038924091407,37.2463056957692,0],[122.037982185381,37.2485616300682,0],[122.03609804064,37.2478824221929,0],[122.035671062339,37.2486350290395,0],[122.035077655099,37.2481866972374,0],[122.034698605692,37.2485843952663,0],[122.034548982381,37.2487416718948,0],[122.034386392624,37.2489129730813,0],[122.033707117787,37.2496232432905,0],[122.032081563718,37.2490135963474,0],[122.031225818948,37.2498352964713,0],[122.030455963723,37.2497013190665,0],[122.030026946312,37.2516823366861,0],[122.028998668876,37.2532541276609,0],[122.027374358493,37.2527816134899,0],[122.026263373281,37.2546975116225,0],[122.024549430377,37.2545641674538,0],[122.024378739092,37.2564076359496,0],[122.022153415877,37.256482658992,0],[122.021981782959,37.2579173619454,0],[122.021036734978,37.2572853122877,0],[122.020356873177,37.2568284478504,0],[122.021383810475,37.2560060376315,0],[122.020099871075,37.254918192047,0],[122.018729126339,37.2549230367812,0],[122.018475248991,37.2518524125741,0],[122.013770232775,37.2515930436172,0],[122.0088057839,37.2486012739199,0],[122.008720278362,37.2466216101768,0],[122.012057327111,37.2465437959091,0],[122.013942481747,37.2440806471102,0],[122.014111063166,37.2429177983759,0],[122.011889443979,37.2412182198984,0],[122.013407049402,37.2362405503671,0],[122.009567791142,37.2343428964032,0],[122.00707692452,37.2354736825038,0],[122.00242444893,37.2362422669729,0],[122.001259146649,37.2384965448256,0],[121.99870374207,37.2391229694536,0],[121.997837626,37.2396673068636,0],[121.996682075838,37.2347545699321,0],[121.995355426842,37.2362607757917,0],[121.994243208219,37.2356833902832,0],[121.994243421493,37.2336675187368,0],[121.992747444039,37.2343217230209,0],[121.991677830313,37.2366816685211,0],[121.990295129928,37.2309630921235,0],[121.990150682697,37.2303678679067,0],[121.987187184595,37.2257674775028,0],[121.986888443091,37.2233767455555,0],[121.985990568252,37.2223560438517,0],[121.987230601991,37.2204393928224,0],[121.981713172117,37.2189878114311,0],[121.980172139392,37.2199828145938,0],[121.973755080722,37.2174049979987,0],[121.971505214988,37.2165268990372,0],[121.967354845827,37.2167772841169,0],[121.964787438071,37.2167502412129,0],[121.959181240476,37.2172075598202,0],[121.957040774203,37.2194336167005,0],[121.954257502966,37.2243585350264,0],[121.953247892102,37.2259300254008,0],[121.951922178612,37.2259670876051,0],[121.948025425888,37.2259768072674,0],[121.944856480246,37.2257786267441,0],[121.943443533187,37.2251668482499,0],[121.941088332981,37.2249316057437,0],[121.937104814658,37.2248030128065,0],[121.935059459054,37.223685171605,0],[121.934826267736,37.2196348840404,0],[121.928766489123,37.2186028393292,0],[121.928730779671,37.2259206995955,0],[121.928728744847,37.2262834961247,0],[121.928725680468,37.2269451244823,0],[121.928688933073,37.2346398364217,0],[121.928686902986,37.2349566618889,0],[121.928634895119,37.2453599679625,0],[121.92796178049,37.2453908914736,0],[121.927875607574,37.2481415046459,0],[121.923588742383,37.2474633892298,0],[121.919986709768,37.2523847216966,0],[121.916213259645,37.2554606427605,0],[121.910207131558,37.2558738000365,0],[121.903401221948,37.2631918905729,0],[121.903056005568,37.2650320143349,0],[121.903570799065,37.2673876287057,0],[121.90408571174,37.2684459159598,0],[121.904557627293,37.2693322970528,0],[121.904899547018,37.2700837858825,0],[121.905338446573,37.2709301845536,0],[121.915421242519,37.2701385326029,0],[121.914433182282,37.2762831432732,0],[121.917778945298,37.2769289342895,0],[121.919880032228,37.2791457337216,0],[121.919918788659,37.2811756570234,0],[121.919922766185,37.2813595592266,0],[121.918646318625,37.2862163779827,0],[121.920854309345,37.2874355058349,0],[121.92441160506,37.2884209176887,0],[121.923167752621,37.2902664892335,0],[121.922910967851,37.290754545868,0],[121.921751893699,37.2929617666629,0],[121.919052134857,37.2945008447942,0],[121.918580392405,37.29566173478,0],[121.918366503159,37.296206672992,0],[121.918536335108,37.2965493404843,0],[121.918376428468,37.2968533453726,0],[121.919750097175,37.2989009781941,0],[121.920040814226,37.2992155251054,0],[121.921213625264,37.3004816616259,0],[121.921245549198,37.3009274097981,0],[121.921329350674,37.3020837563184,0],[121.921548829073,37.3051100519179,0],[121.920777378049,37.3067481020902,0],[121.919877156403,37.3069279599526,0],[121.917004337795,37.3075024557515,0],[121.916918221147,37.309207718206,0],[121.914859341439,37.3110525908859,0],[121.915018082316,37.3126597014612,0],[121.916476087515,37.31340911726,0],[121.918105914027,37.3134755976042,0],[121.918277577353,37.3154545027356,0],[121.918277471329,37.3164780230689,0],[121.916389614871,37.3185267940784,0],[121.915532079774,37.3193461448342,0],[121.915017234477,37.320846872414,0],[121.916475310152,37.3209146107327,0],[121.913730675676,37.3234406821884,0],[121.913559981908,37.32132678443,0],[121.911348860819,37.3223098682636,0],[121.911244768575,37.3235803504875,0],[121.911673496687,37.3246016030192,0],[121.911759440816,37.3248074518181,0],[121.912788952207,37.325216556988,0],[121.912445016147,37.3261023939383,0],[121.911673319876,37.3263088226487,0],[121.91158726922,37.3271275062807,0],[121.912273921464,37.327739766574,0],[121.913559367159,37.3272620629942,0],[121.914847668588,37.3272610658414,0],[121.914847626132,37.3276708795265,0],[121.916305687388,37.3280105060081,0],[121.916648563704,37.3269866709301,0],[121.916562819832,37.3250766185051,0],[121.918106682632,37.3253470818684,0],[121.918621240724,37.3257573996848,0],[121.918192524999,37.3262345947691,0],[121.918191441035,37.3270522231761,0],[121.919393465111,37.3271889824163,0],[121.919479322726,37.3278695863269,0],[121.919564138081,37.3289620049217,0],[121.919049557396,37.3290314897969,0],[121.918964718463,37.3281429766035,0],[121.918278289258,37.3278717675149,0],[121.916991214274,37.3280778691485,0],[121.917076048624,37.3291013286747,0],[121.916476404026,37.3296476153134,0],[121.91536216545,37.3291707799177,0],[121.914847385982,37.3299888295982,0],[121.916990010093,37.3300549750834,0],[121.9174207674,37.3294408608825,0],[121.917935366442,37.3296462891126,0],[121.918363982333,37.3301916348543,0],[121.919564003698,37.3302584189517,0],[121.920421246232,37.3303944711813,0],[121.920508069721,37.3313479499959,0],[121.922308211363,37.3328483017847,0],[121.923851545433,37.3334602210192,0],[121.924365876182,37.3344821391214,0],[121.925308756723,37.3349587501418,0],[121.924966016563,37.3362556055854,0],[121.922822260342,37.3370078584139,0],[121.922393375729,37.3400779975649,0],[121.922993736816,37.3403501854343,0],[121.923422331339,37.339939861389,0],[121.924365288766,37.3401436342134,0],[121.924279284668,37.3410993205751,0],[121.922907768787,37.3408960462653,0],[121.922821687208,37.3425324310079,0],[121.922478914591,37.3436923208996,0],[121.923163213789,37.3436915278944,0],[121.922649664175,37.3444427990717,0],[121.921964311216,37.3447844300288,0],[121.921384781748,37.3456157128769,0],[121.920125897862,37.3458979354034,0],[121.919206680782,37.3458758820839,0],[121.918260457055,37.3456638989559,0],[121.916698646309,37.3451435635619,0],[121.914919831298,37.3445753158648,0],[121.913713496216,37.344549267538,0],[121.909244250635,37.3443852501833,0],[121.902665766263,37.3443169269028,0],[121.901901677864,37.3442221496473,0],[121.901667653384,37.344105250793,0],[121.901667700198,37.343653446985,0],[121.901693795242,37.3427768228998,0],[121.901667825201,37.3424469721414,0],[121.901311795575,37.3421391784487,0],[121.900626684401,37.3418784150506,0],[121.899064271979,37.3418786170583,0],[121.896061084968,37.3420446311787,0],[121.89688570533,37.3396307041504,0],[121.896911777512,37.3390409636005,0],[121.896842792146,37.3386151511097,0],[121.896417654218,37.3381383563134,0],[121.896104608029,37.3371917659012,0],[121.895922643995,37.3360112821592,0],[121.895705561175,37.3357943681763,0],[121.895211297029,37.3359382730829,0],[121.893649343999,37.3366977681846,0],[121.892459523951,37.3373362871735,0],[121.890785303645,37.3376447696559,0],[121.889074942229,37.3375972793021,0],[121.886879995526,37.3373155694482,0],[121.885005186664,37.3366040156444,0],[121.883659827587,37.3356317364097,0],[121.883018177932,37.3348767079671,0],[121.88082246854,37.3355150547655,0],[121.877454831185,37.336818017211,0],[121.873341543148,37.3375990999106,0],[121.871778935135,37.3381213552462,0],[121.869531059844,37.3383119472745,0],[121.868228691369,37.3386903574443,0],[121.867282987102,37.3384034162561,0],[121.866380382535,37.3376007251342,0],[121.865339465749,37.3369367816696,0],[121.863829522168,37.3368419704167,0],[121.860547894467,37.3361000415076,0],[121.863637900374,37.3487815321595,0],[121.865581676855,37.3682518263015,0],[121.870755348285,37.3752647997284,0],[121.877775692892,37.3810579129688,0],[121.88661970377,37.3859354486422,0],[121.895740899169,37.3905819318987,0],[121.903759041717,37.4003153439981,0],[121.90988618753,37.4106959587131,0],[121.91406046525,37.420113931224,0],[121.915726542572,37.4292625807292,0],[121.919812588407,37.4380189867043,0],[121.922173022347,37.4416943069176,0],[121.921838993719,37.4451126447005,0],[121.92328899574,37.4501984650841,0],[121.924342711668,37.4515857899218,0],[121.924805937743,37.4540175099091,0],[121.924808932777,37.4540325018399,0],[121.924804935126,37.4540535007536,0],[121.924726383835,37.4601888504505,0],[121.920742477459,37.469551886432,0],[121.919267463301,37.4724086531978,0]]],[[[122.201627700575,37.4779873789425,0],[122.201351126022,37.4780599641049,0],[122.201043491798,37.4780685189892,0],[122.200856089873,37.4782062128118,0],[122.200905165387,37.478450221453,0],[122.201148643711,37.4786775149636,0],[122.201522407218,37.4787180415066,0],[122.201993357977,37.4788156882386,0],[122.202391183471,37.4786362971144,0],[122.202488430812,37.4781575565358,0],[122.202334140805,37.4779543910069,0],[122.201627700575,37.4779873789425,0]]],[[[122.178675769194,37.4986454143883,0],[122.178440248009,37.497876161277,0],[122.1766967237,37.498202897496,0],[122.176765833814,37.4988408788691,0],[122.176730711842,37.4991317482484,0],[122.176418884559,37.499327131083,0],[122.172095489473,37.5004988615936,0],[122.17167939762,37.5004990862539,0],[122.171479891966,37.5003297524705,0],[122.171435942171,37.4987890196721,0],[122.17119332018,37.4986455997643,0],[122.168867177174,37.4988152138176,0],[122.168623513431,37.4990107133234,0],[122.168597423633,37.4992056202039,0],[122.168745801995,37.4993268703865,0],[122.170550577802,37.4991322891818,0],[122.170776155327,37.4992796769517,0],[122.170846318863,37.4994747636854,0],[122.170750986902,37.5002304147591,0],[122.170481253496,37.5004518610784,0],[122.170116276981,37.5005991459781,0],[122.167816209645,37.5006208376467,0],[122.166994015224,37.5008372492485,0],[122.166589877727,37.5014873464974,0],[122.166098449633,37.5026931571474,0],[122.16601116597,37.5031858843251,0],[122.165940930354,37.5036506499391,0],[122.165550860147,37.5040188383544,0],[122.165107668286,37.5042139658009,0],[122.163962612768,37.5045047600043,0],[122.163736990441,37.504752283924,0],[122.163736945924,37.5051641935301,0],[122.163979549401,37.5055075718639,0],[122.165351116851,37.50602002585,0],[122.165811329947,37.5060458817564,0],[122.166549295521,37.5058982957696,0],[122.167113810501,37.5056774011486,0],[122.167425668295,37.5053600545104,0],[122.167669398267,37.5045576868524,0],[122.167842869902,37.5044310395279,0],[122.168650005156,37.5043835609947,0],[122.168962827425,37.5044101405632,0],[122.169214472851,37.5045785743441,0],[122.169430982874,37.5051428555323,0],[122.169743759916,37.5055813445269,0],[122.170142784655,37.5058250372125,0],[122.170724299226,37.5059720914233,0],[122.172485916719,37.5060463592501,0],[122.173094492081,37.5062154540607,0],[122.173500508146,37.5066401157859,0],[122.173579653169,37.5072151381113,0],[122.173500362928,37.5079878242949,0],[122.174195115005,37.5085629889895,0],[122.175008218016,37.5087014635397,0],[122.175404223904,37.508920147867,0],[122.175542529894,37.5094152972276,0],[122.175363991597,37.5101098201069,0],[122.175503272463,37.5108629175575,0],[122.176018583772,37.5111008168557,0],[122.176395489626,37.5117553723878,0],[122.176276099631,37.5125089949507,0],[122.176435482411,37.5127862300642,0],[122.177652586683,37.5131333889421,0],[122.177985425902,37.5132919640529,0],[122.178080638279,37.5135930752707,0],[122.178049479868,37.5143228672754,0],[122.178171758043,37.5146580212157,0],[122.178415379829,37.5146914584438,0],[122.178918660769,37.5147723575876,0],[122.179544257624,37.5147884894076,0],[122.180031513098,37.5146583977366,0],[122.180104718533,37.5144795668617,0],[122.180136858626,37.5139357373448,0],[122.18021010062,37.513415977412,0],[122.180559035671,37.5129607013699,0],[122.18124179781,37.5126519932517,0],[122.181590689143,37.5125546388851,0],[122.182101975018,37.5125705494427,0],[122.182207243885,37.512530745552,0],[122.18232958868,37.5121810368301,0],[122.181858430959,37.5119292488002,0],[122.181793280819,37.5117991596455,0],[122.181793322625,37.5114102415095,0],[122.18193170557,37.51108855664,0],[122.181891633433,37.5108205416433,0],[122.181826485907,37.5106664577894,0],[122.181793412147,37.5105774175024,0],[122.181842543711,37.5105045207732,0],[122.182694719847,37.5101711105288,0],[122.182849122036,37.5100254157857,0],[122.183165986411,37.5093511214029,0],[122.183320383961,37.509237419098,0],[122.183547942484,37.5093188041745,0],[122.183936886564,37.5095374439053,0],[122.184245654542,37.5095209909056,0],[122.18440907329,37.5093913057057,0],[122.184571476844,37.5093755940728,0],[122.184668708635,37.5094557474499,0],[122.184700760842,37.5097077499265,0],[122.184773928494,37.5098298521095,0],[122.185058617245,37.5099563232167,0],[122.185732280227,37.5098905112008,0],[122.186024983957,37.5100129932772,0],[122.186656556248,37.5097221472939,0],[122.186885107923,37.5097605329094,0],[122.186948201429,37.5103185229354,0],[122.187189784754,37.5103439327088,0],[122.187671984918,37.5100268260276,0],[122.187811376884,37.5095061749475,0],[122.188116136449,37.5092647459966,0],[122.188331580636,37.5099499664124,0],[122.188775653692,37.5098617380494,0],[122.189219766135,37.5093665932756,0],[122.189270939486,37.5088847824212,0],[122.189765160339,37.5084407076765,0],[122.190107979202,37.5083642974462,0],[122.190285358343,37.5087315145587,0],[122.190661234641,37.508806123759,0],[122.191325788951,37.5088162208468,0],[122.191747752573,37.5089898775525,0],[122.191960212639,37.5092971600283,0],[122.191995260383,37.5096101506263,0],[122.192251821407,37.5099145049736,0],[122.193112762331,37.5102798248494,0],[122.193599896114,37.5100766524327,0],[122.193690129207,37.5098168524704,0],[122.19414415128,37.5098905629582,0],[122.194639290094,37.5096873934718,0],[122.194850793149,37.5094267838108,0],[122.194728565478,37.5089886840323,0],[122.19426655044,37.5087450025698,0],[122.19416836053,37.50844491046,0],[122.194266610508,37.5081841230455,0],[122.194704621049,37.5079648658413,0],[122.194758784945,37.5075700367091,0],[122.194492246183,37.5069997374725,0],[122.194137484473,37.5066312527611,0],[122.193870914184,37.5063148956104,0],[122.193819848471,37.5058449162537,0],[122.19363047654,37.5052967324601,0],[122.193630516373,37.5049248140412,0],[122.193953289269,37.5045534126835,0],[122.194697059803,37.5036987847516,0],[122.195762553739,37.5026316975433,0],[122.197149692782,37.5018140264478,0],[122.197918439879,37.5010713646178,0],[122.19846362822,37.5009222211535,0],[122.198958687957,37.5008969683706,0],[122.199925694468,37.5012443225672,0],[122.200916748714,37.5013427456303,0],[122.201585150386,37.5010947626955,0],[122.202032098991,37.5007484773816,0],[122.202453001927,37.500277178842,0],[122.202849795227,37.5003267247198,0],[122.203469002055,37.5005995245915,0],[122.204163380884,37.500524495867,0],[122.205327714312,37.4998552193023,0],[122.206566140407,37.4991860039821,0],[122.2067645814,37.4985414085916,0],[122.206913887008,37.4982936584299,0],[122.207211459626,37.4981200814806,0],[122.207607188924,37.4981455816946,0],[122.208128104455,37.4985161565426,0],[122.208797316779,37.4985169924846,0],[122.209515650141,37.4980449837725,0],[122.210630664365,37.4974754562556,0],[122.21134895601,37.4969304269147,0],[122.211424115654,37.4966325831712,0],[122.211299941092,37.4962855185916,0],[122.210854200716,37.4960630466711,0],[122.210432452484,37.496235506157,0],[122.208574099034,37.4967811132256,0],[122.206814886733,37.4965589288303,0],[122.206269864423,37.4965342246488,0],[122.205798933423,37.496881524694,0],[122.204608623772,37.4970298975347,0],[122.203444333512,37.4970303035204,0],[122.202254968808,37.4968316854262,0],[122.20141228364,37.4965225566155,0],[122.198190458421,37.4970186978817,0],[122.196208125904,37.4971426336403,0],[122.193754635276,37.4970937731988,0],[122.191822129391,37.4977254951993,0],[122.190111103143,37.4979236187798,0],[122.188426096777,37.4978987874155,0],[122.186840293818,37.4976641296248,0],[122.182181760049,37.4977879296201,0],[122.180793216606,37.4981593571142,0],[122.179530958144,37.4986199730037,0],[122.178675769194,37.4986454143883,0]]],[[[122.079325050868,37.5740803529091,0],[122.079641930455,37.5740021666821,0],[122.080276730427,37.5736248353504,0],[122.080772568265,37.5735265642666,0],[122.081427367451,37.5734672143139,0],[122.082042216411,37.5732689215345,0],[122.082478172132,37.5726737826086,0],[122.082438218816,37.5723368453707,0],[122.082101323123,37.572158034628,0],[122.081645465212,37.5719992881552,0],[122.081308599735,37.571681507561,0],[122.080931744798,37.5714437439015,0],[122.080851801508,37.5711668244064,0],[122.080990784496,37.5709087811328,0],[122.082458475716,37.5699571462773,0],[122.082537480858,37.5697391369608,0],[122.082418535526,37.5695012260559,0],[122.082418563895,37.5692432603283,0],[122.082636538353,37.5690061869337,0],[122.08293448959,37.5688470681397,0],[122.083410389657,37.5688868474527,0],[122.083906325329,37.5686886603562,0],[122.083886352507,37.5684706979393,0],[122.083410444198,37.5683909138193,0],[122.082934557214,37.5682321505093,0],[122.081982797223,37.5681326252421,0],[122.081565909082,37.5681728347783,0],[122.081288009468,37.5680140037959,0],[122.081010088005,37.568093144276,0],[122.080931080815,37.5683911478243,0],[122.080772113776,37.5685692125292,0],[122.07839292754,37.5698575030919,0],[122.078075044311,37.5701746759004,0],[122.077103471012,37.5708282744667,0],[122.077023462063,37.5713042705142,0],[122.07710339032,37.5715621787212,0],[122.077480177624,37.5716808927852,0],[122.077836980528,37.5718206243946,0],[122.077817966052,37.5720386093411,0],[122.077500108328,37.5722168092276,0],[122.07668751305,37.572533359033,0],[122.075773985872,37.5731279822357,0],[122.075695004012,37.573406008944,0],[122.075853886781,37.5735838613283,0],[122.076726325336,37.5740411374553,0],[122.078492405721,37.5741798772966,0],[122.079047162016,37.5741405210232,0],[122.079325050868,37.5740803529091,0]]],[[[122.006212382753,37.5282845350765,0],[122.006302078509,37.5283172599641,0],[122.007960631198,37.5274304683023,0],[122.008154989153,37.527381898242,0],[122.009114805364,37.5273330530661,0],[122.009416825618,37.5271381940096,0],[122.009529508788,37.5266179588521,0],[122.009472718803,37.5264141659944,0],[122.008562708559,37.5266818173311,0],[122.008090273187,37.5267472115226,0],[122.007724495534,37.5267153083315,0],[122.007570036307,37.5264788143833,0],[122.007447448961,37.5264461866708,0],[122.00712251845,37.526593129727,0],[122.006691958592,37.5265934180292,0],[122.006097957794,37.5265122138587,0],[122.005692358768,37.5261455013789,0],[122.005147197462,37.5260891509471,0],[122.004959722301,37.5270725278202,0],[122.004521128615,37.5277317239559,0],[122.004472237329,37.5282517732493,0],[122.004943624725,37.5284793106284,0],[122.005317402151,37.5281542472445,0],[122.005342361167,37.5277562472545,0],[122.00570815209,37.527569183344,0],[122.005944350323,37.5276504587942,0],[122.006212382753,37.5282845350765,0]]],[[[122.215406890038,37.4937156589714,0],[122.214990210083,37.4940281484907,0],[122.214634598089,37.4945406511672,0],[122.213601884397,37.4951613882798,0],[122.212517064236,37.4955740827052,0],[122.212134386929,37.4959475608867,0],[122.21288160624,37.4961383623114,0],[122.213758048513,37.4959863678418,0],[122.215762287932,37.4951087017676,0],[122.215918586928,37.4945399952832,0],[122.215814499234,37.4938720446564,0],[122.215406890038,37.4937156589714,0]]],[[[122.195343839396,37.5099594472906,0],[122.195119324017,37.5100890665807,0],[122.194886743048,37.5106505805776,0],[122.19497391807,37.5108416778168,0],[122.195190388259,37.5109749908156,0],[122.195427926039,37.5109033792136,0],[122.195639462504,37.5102888407663,0],[122.195622446895,37.5100808582954,0],[122.195343839396,37.5099594472906,0]]],[[[122.162802447809,37.5240055635845,0],[122.162762363975,37.5238025280893,0],[122.162615993669,37.5236562833531,0],[122.162404438397,37.5236318935193,0],[122.162274085133,37.523720633277,0],[122.162185836649,37.5238674403385,0],[122.162291072838,37.5242495626244,0],[122.162112571678,37.5245331751966,0],[122.162128564733,37.5249881174699,0],[122.162461430063,37.5251017162149,0],[122.163720799843,37.5246711500778,0],[122.163956450113,37.5244116405063,0],[122.163842162345,37.5242814520131,0],[122.163200469171,37.5242732548239,0],[122.16296486669,37.5240948494413,0],[122.162802447809,37.5240055635845,0]]],[[[122.167051590671,37.524759366331,0],[122.166807959089,37.5246469317282,0],[122.166533226527,37.5247084054115,0],[122.166299580711,37.5249719172137,0],[122.166127026246,37.5258854191585,0],[122.166147000243,37.5266163173921,0],[122.166249254065,37.5267684799778,0],[122.166635266399,37.5268401892181,0],[122.167000229692,37.5268498708394,0],[122.167253913002,37.5267283689503,0],[122.167457486817,37.5263938137276,0],[122.167558796084,37.5260070770997,0],[122.167517742273,37.5255000970991,0],[122.167274150257,37.5250227324804,0],[122.167051590671,37.524759366331,0]]],[[[121.993941094973,37.527384849537,0],[121.992908612632,37.5274849844323,0],[121.992083309169,37.5286182901794,0],[121.991163326028,37.529750884508,0],[121.990235399049,37.5305745588185,0],[121.990338946842,37.5315040720158,0],[121.990954782809,37.5321200827827,0],[121.991979299606,37.5320159774362,0],[121.992708874718,37.5313998636742,0],[121.993012880534,37.5309870114558,0],[121.993732443377,37.5307828512217,0],[121.99651997551,37.5308834288758,0],[121.997335226142,37.5305749998454,0],[121.997648224411,37.5299591599238,0],[121.998064847688,37.5295459671289,0],[121.999401281354,37.5296498779755,0],[121.99898480015,37.5287213192682,0],[121.998577255424,37.5281056760514,0],[121.997856734911,37.5278969106781,0],[121.996102687951,37.5282052011457,0],[121.995070167898,37.5280012825768,0],[121.993941094973,37.527384849537,0]]]]},"properties":{"adcode":371002,"name":"环翠区","center":[122.116189,37.510754],"centroid":[122.114066,37.377303],"childrenNum":0,"level":"district","subFeatureIndex":0,"acroutes":[100000,370000,371000],"site":"https://geojson.hxkj.vip"},"id":"______.1"}]}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
0.0,
0.0
]
},
"properties": {
"title": "Unnamed",
"marker-color": "#B9EB14"
}
}
]
}
\ No newline at end of file
[{"x":-2122115.5994971977,"y":4732958.028550964,"z":3699473.2847229154},{"x":-2122120.0523018655,"y":4732956.886053033,"z":3699472.133988942},{"x":-2122124.487396078,"y":4732955.704055345,"z":3699470.95217227},{"x":-2122128.9374617827,"y":4732954.555448268,"z":3699469.796630946},{"x":-2122133.4038662505,"y":4732953.443280963,"z":3699468.669764379},{"x":-2122137.844791976,"y":4732952.274288615,"z":3699467.498181704},{"x":-2122142.268538864,"y":4732951.0669826595,"z":3699466.2964497306},{"x":-2122146.6779417126,"y":4732949.827685709,"z":3699465.06954378},{"x":-2122151.1080573928,"y":4732948.634583926,"z":3699463.8789891885},{"x":-2122155.418958896,"y":4732947.175604117,"z":3699462.4792130277},{"x":-2122155.6835985845,"y":4732940.741978125,"z":3699471.2867983845},{"x":-2122155.8336103787,"y":4732934.0527022295,"z":3699479.89321176},{"x":-2122155.951019813,"y":4732927.290714585,"z":3699488.4424080243},{"x":-2122156.0535636134,"y":4732920.495572707,"z":3699496.965515129},{"x":-2122156.3040541583,"y":4732914.03038712,"z":3699505.7482727324},{"x":-2122156.4819965637,"y":4732907.40340097,"z":3699514.4037076193},{"x":-2122156.5861125947,"y":4732900.611764228,"z":3699522.9295755937},{"x":-2122156.6706934166,"y":4732893.776559315,"z":3699531.421158788},{"x":-2122156.117263186,"y":4732885.518446164,"z":3699538.7930064336},{"x":-2122158.9760788498,"y":4732874.562825948,"z":3699550.95784894},{"x":-2122161.793722165,"y":4732863.515381911,"z":3699563.0504323686},{"x":-2122164.6032007737,"y":4732852.449728727,"z":3699575.128686413},{"x":-2122167.39604537,"y":4732841.346978414,"z":3699587.1777468873},{"x":-2122170.231642691,"y":4732830.339574733,"z":3699599.3018408013},{"x":-2122172.994522331,"y":4732819.169997319,"z":3699611.298310923},{"x":-2122175.785342484,"y":4732808.062732616,"z":3699623.3438181793},{"x":-2122178.699888612,"y":4732797.2313968055,"z":3699635.6064728834},{"x":-2122181.3586085257,"y":4732785.829527992,"z":3699647.4201349756},{"x":-2122182.174003833,"y":4732779.972802263,"z":3699653.402533584},{"x":-2122182.8924552193,"y":4732773.899878054,"z":3699659.2147879666},{"x":-2122183.560568533,"y":4732767.714694005,"z":3699664.9386944},{"x":-2122184.2483785236,"y":4732761.57343776,"z":3699670.697169186},{"x":-2122185.1883362858,"y":4732755.994506046,"z":3699676.8981833183},{"x":-2122186.154475535,"y":4732750.473961987,"z":3699683.145148448},{"x":-2122187.123461684,"y":4732744.959766233,"z":3699689.3971105237},{"x":-2122188.1866216217,"y":4732739.655588894,"z":3699695.814356379},{"x":-2122189.250515541,"y":4732734.353047082,"z":3699702.232891251},{"x":-2122184.72797033,"y":4732724.405273948,"z":3699720.2420216748},{"x":-2122179.721831675,"y":4732713.379029938,"z":3699737.402402581},{"x":-2122174.66889986,"y":4732702.248431614,"z":3699754.48065661},{"x":-2122169.6755185183,"y":4732691.250637943,"z":3699771.6634300384},{"x":-2122164.5924361795,"y":4732680.052800363,"z":3699788.6887659505},{"x":-2122159.5271303225,"y":4732668.8946064515,"z":3699805.7453017365},{"x":-2122154.472487547,"y":4732657.760192482,"z":3699822.820552777},{"x":-2122149.3983360096,"y":4732646.582271643,"z":3699839.861562162},{"x":-2122143.8069302253,"y":4732634.250812029,"z":3699855.994685413},{"x":-2122129.676996514,"y":4732639.5955445655,"z":3699858.0073515815},{"x":-2122115.486112367,"y":4732644.804349861,"z":3699859.9130370845},{"x":-2122101.3596108267,"y":4732650.1567389285,"z":3699861.9317291356},{"x":-2122087.1709364993,"y":4732655.370472687,"z":3699863.8412935347},{"x":-2122073.0157971177,"y":4732660.658995884,"z":3699865.809720351},{"x":-2122058.805098896,"y":4732665.823611197,"z":3699867.6806265307},{"x":-2122044.576876279,"y":4732670.94914171,"z":3699869.520771455},{"x":-2122030.3919558316,"y":4732676.171245468,"z":3699871.4369235053},{"x":-2122016.2130419104,"y":4732681.406745161,"z":3699873.363618704},{"x":-2122016.241597465,"y":4732677.291654238,"z":3699878.4671707484},{"x":-2122016.657362242,"y":4732674.040146123,"z":3699884.250397832},{"x":-2122017.4427451994,"y":4732671.612985754,"z":3699890.682424788},{"x":-2122017.6215433693,"y":4732667.832976786,"z":3699896.049700658},{"x":-2122017.6050606756,"y":4732663.617439941,"z":3699901.0741941878},{"x":-2122017.693468122,"y":4732659.635836946,"z":3699906.282803114},{"x":-2122018.0053348676,"y":4732656.1526074745,"z":3699911.883656477},{"x":-2122017.951540434,"y":4732651.853858346,"z":3699916.842652246},{"x":-2122018.666371344,"y":4732649.269343393,"z":3699923.150843038},{"x":-2122017.426224179,"y":4732649.100651393,"z":3699930.830147555},{"x":-2122015.388618287,"y":4732647.153421461,"z":3699937.10964634},{"x":-2122012.919436748,"y":4732644.243665707,"z":3699942.631581512},{"x":-2122010.5621072375,"y":4732641.583369163,"z":3699948.34985594},{"x":-2122007.9132012296,"y":4732638.272780054,"z":3699953.5563087226},{"x":-2122005.135246291,"y":4732634.674376918,"z":3699958.5362309967},{"x":-2122002.350820345,"y":4732631.061540728,"z":3699963.5047905324},{"x":-2121999.802964853,"y":4732627.976319032,"z":3699968.8886160166},{"x":-2121997.293382669,"y":4732624.97645669,"z":3699974.3396240813},{"x":-2121983.952093892,"y":4732627.621961536,"z":3699978.459376851},{"x":-2121970.475410361,"y":4732629.965484862,"z":3699982.341447922},{"x":-2121957.3793992028,"y":4732633.158012667,"z":3699986.8917455706},{"x":-2121944.505029058,"y":4732636.844869951,"z":3699991.8311160486},{"x":-2121931.423254714,"y":4732640.069147833,"z":3699996.4064031322},{"x":-2121918.056527326,"y":4732642.657874923,"z":3700000.4814650714},{"x":-2121905.8916298333,"y":4732647.927123105,"z":3700006.6662936434},{"x":-2121893.1115082162,"y":4732651.82420607,"z":3700011.771128227},{"x":-2121880.354192486,"y":4732655.772161914,"z":3700016.916003966},{"x":-2121881.0969218416,"y":4732659.940712596,"z":3700011.443523322},{"x":-2121881.940345289,"y":4732664.333852315,"z":3700006.1478100126},{"x":-2121883.3965143757,"y":4732670.093666349,"z":3700001.927762579},{"x":-2121884.198838462,"y":4732674.395138859,"z":3699996.559896574},{"x":-2121884.350105987,"y":4732677.244486895,"z":3699990.0491133444},{"x":-2121884.3245342877,"y":4732679.699408954,"z":3699983.2278966703},{"x":-2121885.2757804007,"y":4732684.333038138,"z":3699978.121462652},{"x":-2121886.086645297,"y":4732688.653559344,"z":3699972.768592133},{"x":-2121886.888668233,"y":4732692.954359486,"z":3699967.400199311},{"x":-2121884.497970041,"y":4732697.991045951,"z":3699962.727198229},{"x":-2121882.0536306603,"y":4732702.908090334,"z":3699957.9600317986},{"x":-2121879.8433052422,"y":4732708.347087044,"z":3699953.6036690045},{"x":-2121876.7866155338,"y":4732711.898324189,"z":3699947.7615422276},{"x":-2121874.2025269563,"y":4732716.503664718,"z":3699942.749050911},{"x":-2121871.50483208,"y":4732720.8556112535,"z":3699937.5371276992},{"x":-2121869.027677013,"y":4732725.699458772,"z":3699932.712354612},{"x":-2121866.6850370984,"y":4732730.843336278,"z":3699928.123718203},{"x":-2121864.7452406837,"y":4732736.885741697,"z":3699924.242259387},{"x":-2121865.434151534,"y":4732742.875725267,"z":3699915.454568757},{"x":-2121866.2185499324,"y":4732749.078690018,"z":3699906.834503389},{"x":-2121866.9813028793,"y":4732755.233375194,"z":3699898.1764407055},{"x":-2121867.778956169,"y":4732761.46590434,"z":3699889.579644108},{"x":-2121868.599657193,"y":4732767.7498407625,"z":3699881.0233065393},{"x":-2121869.4104636805,"y":4732774.011707742,"z":3699872.449599609},{"x":-2121870.2427218817,"y":4732780.321422264,"z":3699863.9135496607},{"x":-2121871.0635233214,"y":4732786.605582844,"z":3699855.3573879623},{"x":-2121872.0165246846,"y":4732793.184612768,"z":3699847.033292826},{"x":-2121865.0511615956,"y":4732798.706513812,"z":3699844.5835691523},{"x":-2121858.0755355684,"y":4732804.205519558,"z":3699842.115827826},{"x":-2121851.0348664396,"y":4732809.559442015,"z":3699839.5339056323},{"x":-2121844.0592951127,"y":4732815.058561093,"z":3699837.066256307},{"x":-2121837.1719836155,"y":4732820.754542322,"z":3699834.7535404256},{"x":-2121831.223433759,"y":4732828.544466292,"z":3699834.088772527},{"x":-2121823.9095514864,"y":4732833.288965075,"z":3699831.027233274},{"x":-2121817.454282203,"y":4732839.948640433,"z":3699829.4729490387},{"x":-2121811.0471992763,"y":4732846.715805113,"z":3699828.003257127},{"x":-2121802.172226483,"y":4732850.749813675,"z":3699830.309969071},{"x":-2121793.1244848175,"y":4732854.39844523,"z":3699832.3133884836},{"x":-2121784.2826151187,"y":4732858.506291365,"z":3699834.678210825},{"x":-2121775.2849571016,"y":4732862.266634419,"z":3699836.769547596},{"x":-2121766.584427969,"y":4732866.689757813,"z":3699839.3824936706},{"x":-2121757.721318322,"y":4732870.750226878,"z":3699841.710030134},{"x":-2121748.9264338263,"y":4732874.962882334,"z":3699844.1573374737},{"x":-2121740.0271110185,"y":4732878.94257313,"z":3699846.421301319},{"x":-2121731.2628855268,"y":4732883.223620791,"z":3699848.92243331},{"x":-2121723.284583899,"y":4732884.93798762,"z":3699853.870685546},{"x":-2121715.0427970933,"y":4732886.064603966,"z":3699858.3563772785},{"x":-2121706.4646752044,"y":4732886.440956415,"z":3699862.2516085845},{"x":-2121698.243286768,"y":4732887.613068686,"z":3699866.773104517},{"x":-2121690.1293826457,"y":4732889.024946472,"z":3699871.4832967566},{"x":-2121681.903498587,"y":4732890.187028216,"z":3699875.9968982292},{"x":-2121673.8137972723,"y":4732891.652895951,"z":3699880.7495808816},{"x":-2121665.8935281984,"y":4732893.496724558,"z":3699885.79972156},{"x":-2121657.9808604056,"y":4732895.357513774,"z":3699890.8632111205},{"x":-2121656.576776263,"y":4732890.264304541,"z":3699899.1639949977},{"x":-2121655.2563685216,"y":4732885.357757317,"z":3699907.611679517},{"x":-2121653.5569627956,"y":4732879.605760775,"z":3699915.39397841},{"x":-2121652.4617149914,"y":4732875.201490527,"z":3699924.2369542397},{"x":-2121651.811651297,"y":4732871.7903143,"z":3699933.8615145753},{"x":-2121651.2736661187,"y":4732868.629156321,"z":3699943.6828491413},{"x":-2121650.7467192723,"y":4732865.492621221,"z":3699953.5235678647},{"x":-2121650.0300859627,"y":4732861.932942977,"z":3699963.0312662334},{"x":-2121649.0928909816,"y":4732857.881247398,"z":3699972.1517347917},{"x":-2121642.1356126885,"y":4732859.652251405,"z":3699976.2954594083},{"x":-2121634.995811232,"y":4732861.016089364,"z":3699980.118731057},{"x":-2121628.064240711,"y":4732862.844439069,"z":3699984.307588244},{"x":-2121620.969573507,"y":4732864.3089563195,"z":3699988.21009705},{"x":-2121613.9328810023,"y":4732865.902799991,"z":3699992.21438974},{"x":-2121607.0444069137,"y":4732867.82728663,"z":3699996.4789096713},{"x":-2121600.2536807638,"y":4732869.969830212,"z":3700000.9150482425},{"x":-2121593.4138417975,"y":4732872.002814685,"z":3700005.264960209},{"x":-2121586.7231056676,"y":4732874.368421934,"z":3700009.876658697},{"x":-2121583.76398069,"y":4732869.394680635,"z":3700019.9911059057},{"x":-2121580.445498239,"y":4732863.619277959,"z":3700029.4746148894},{"x":-2121576.996137325,"y":4732857.551908763,"z":3700038.728331529},{"x":-2121573.557393552,"y":4732851.508224146,"z":3700048.00068593},{"x":-2121570.3982992717,"y":4732846.088387445,"z":3700057.7640377316},{"x":-2121567.0171319335,"y":4732840.173145171,"z":3700067.137479091},{"x":-2121563.919723568,"y":4732834.890918859,"z":3700077.0091381078},{"x":-2121560.8329666182,"y":4732829.63245416,"z":3700086.8995004743},{"x":-2121557.828831264,"y":4732824.558303988,"z":3700096.9349317243},{"x":-2121551.7112177224,"y":4732819.764514708,"z":3700108.542116296},{"x":-2121546.205655396,"y":4732816.33611169,"z":3700121.2239586185},{"x":-2121540.387702142,"y":4732812.210822239,"z":3700133.3573125848},{"x":-2121534.3121092864,"y":4732807.510783997,"z":3700145.0383030316},{"x":-2121528.1215271465,"y":4732802.554224632,"z":3700156.5173948547},{"x":-2121521.6742235348,"y":4732797.024959422,"z":3700167.5457219444},{"x":-2121514.9930910566,"y":4732790.974055226,"z":3700178.163472706},{"x":-2121507.8583144434,"y":4732783.911132342,"z":3700187.9846693277},{"x":-2121500.764921831,"y":4732776.940524905,"z":3700197.878515278},{"x":-2121496.5664637997,"y":4732765.987511468,"z":3700207.478039875},{"x":-2121492.783527828,"y":4732755.961473051,"z":3700217.8071526685},{"x":-2121489.699316271,"y":4732747.4941936545,"z":3700229.363144348},{"x":-2121488.077909627,"y":4732742.290228117,"z":3700243.4877021126},{"x":-2121487.0479247584,"y":4732738.4056402715,"z":3700258.6507681725},{"x":-2121485.638852334,"y":4732733.675360067,"z":3700273.148196663},{"x":-2121484.3116969424,"y":4732729.127823886,"z":3700287.7894804347},{"x":-2121482.7154617314,"y":4732723.98000786,"z":3700301.9582849713},{"x":-2121480.7890730244,"y":4732718.095666014,"z":3700315.5473603527},{"x":-2121480.4978582985,"y":4732711.801734257,"z":3700328.3966055834},{"x":-2121480.136620023,"y":4732705.35158615,"z":3700341.122900971},{"x":-2121479.208850543,"y":4732697.63758914,"z":3700352.854384092},{"x":-2121477.967728569,"y":4732689.2245503,"z":3700364.0356243686},{"x":-2121476.6143299183,"y":4732680.561040637,"z":3700375.019704946},{"x":-2121474.989798422,"y":4732671.292678361,"z":3700385.5276712826},{"x":-2121473.338311647,"y":4732661.964186065,"z":3700395.9882970895},{"x":-2121472.169487713,"y":4732653.712437743,"z":3700407.2964808876},{"x":-2121470.971806615,"y":4732645.396314336,"z":3700418.553989828},{"x":-2121471.2690495844,"y":4732635.661598662,"z":3700427.587559663},{"x":-2121471.522099897,"y":4732625.828292083,"z":3700436.543529801},{"x":-2121471.6884016264,"y":4732615.801460746,"z":3700445.347169914},{"x":-2121471.4877876528,"y":4732604.9561056355,"z":3700453.5064938916},{"x":-2121471.50291747,"y":4732594.592033329,"z":3700462.0446738205},{"x":-2121471.4109621067,"y":4732583.989072941,"z":3700470.394808675},{"x":-2121470.449692834,"y":4732571.446847938,"z":3700477.218382726},{"x":-2121469.8036867483,"y":4732559.607917174,"z":3700484.595570973},{"x":-2121469.048370935,"y":4732547.525143891,"z":3700491.7808010634},{"x":-2121469.3311285246,"y":4732537.834254341,"z":3700497.028858917},{"x":-2121469.4214624614,"y":4732527.71411723,"z":3700501.9390048888},{"x":-2121469.3362894678,"y":4732517.202472737,"z":3700506.540944594},{"x":-2121469.8258907944,"y":4732507.973027176,"z":3700512.152223729},{"x":-2121471.6042270907,"y":4732501.618449578,"z":3700520.0266131554},{"x":-2121473.289056597,"y":4732495.055273264,"z":3700527.7368011787},{"x":-2121475.1182433977,"y":4732488.814115829,"z":3700535.70049492},{"x":-2121476.9331881315,"y":4732482.541179786,"z":3700543.639182229},{"x":-2121478.015522648,"y":4732474.633969824,"z":3700550.2913496615},{"x":-2121484.0268478724,"y":4732466.068734973,"z":3700554.800084934},{"x":-2121489.9916844075,"y":4732457.399786726,"z":3700559.227179789},{"x":-2121495.8686024053,"y":4732448.534708422,"z":3700563.4998807637},{"x":-2121501.6861635256,"y":4732439.537215372,"z":3700567.668344897},{"x":-2121507.251379103,"y":4732429.976811077,"z":3700571.393671512},{"x":-2121512.367462664,"y":4732419.414535342,"z":3700574.330292924},{"x":-2121517.27702602,"y":4732408.391589403,"z":3700576.9042543625},{"x":-2121522.282575982,"y":4732397.582769901,"z":3700579.64677748},{"x":-2121527.7816926516,"y":4732387.874936272,"z":3700583.2560345796},{"x":-2121534.440390561,"y":4732383.113125626,"z":3700584.7665057057},{"x":-2121540.5496128825,"y":4732377.125628589,"z":3700585.312067616},{"x":-2121545.8667705925,"y":4732369.371335713,"z":3700584.466731679},{"x":-2121551.2737197313,"y":4732361.817349328,"z":3700583.779081385},{"x":-2121557.139883656,"y":4732355.287704416,"z":3700583.897834868},{"x":-2121563.7503985777,"y":4732350.418411763,"z":3700585.3236926086},{"x":-2121570.0261598867,"y":4732344.802414889,"z":3700586.1617114777},{"x":-2121576.667606952,"y":4732340.002106988,"z":3700587.6418805183},{"x":-2121583.6389450794,"y":4732335.937635429,"z":3700589.7013385063},{"x":-2121589.645075656,"y":4732330.265340166,"z":3700596.621083612},{"x":-2121594.9244116787,"y":4732322.971879579,"z":3700602.2645676276},{"x":-2121600.011981543,"y":4732315.250675904,"z":3700607.571308523},{"x":-2121605.1650777943,"y":4732307.675633494,"z":3700612.9931146665},{"x":-2121610.4300856367,"y":4732300.350213842,"z":3700618.6114383787},{"x":-2121615.6412609257,"y":4732292.9047193285,"z":3700624.135231837},{"x":-2121620.597408153,"y":4732284.890383869,"z":3700629.211195711},{"x":-2121625.600337782,"y":4732276.980401303,"z":3700634.3693103986},{"x":-2121630.7511730543,"y":4732269.400324431,"z":3700639.7871478926},{"x":-2121627.0849846224,"y":4732264.466604493,"z":3700648.215293579},{"x":-2121623.4401103063,"y":4732259.580425003,"z":3700656.680864969},{"x":-2121619.7390603214,"y":4732254.56894577,"z":3700665.0477889595},{"x":-2121616.0451645344,"y":4732249.573423351,"z":3700673.4272732753},{"x":-2121612.4552338272,"y":4732244.809793918,"z":3700681.9893211997},{"x":-2121608.738836824,"y":4732239.764081685,"z":3700690.329288137},{"x":-2121605.999608103,"y":4732236.89794025,"z":3700700.3852059944},{"x":-2121602.5142662893,"y":4732232.367596651,"z":3700709.1309195817},{"x":-2121599.103381068,"y":4732228.00332861,"z":3700718.007383918},{"x":-2121590.3996530175,"y":4732227.7596813105,"z":3700727.7685091766},{"x":-2121581.7931979955,"y":4732227.732989055,"z":3700737.700435482},{"x":-2121573.914962165,"y":4732229.330597363,"z":3700748.9111688915},{"x":-2121565.80761144,"y":4732230.417157147,"z":3700759.719552497},{"x":-2121557.8444828275,"y":4732231.82540747,"z":3700770.7812029645},{"x":-2121550.1703154906,"y":4732233.878200876,"z":3700782.3503065477},{"x":-2121542.621162525,"y":4732236.209851163,"z":3700794.138959093},{"x":-2121535.3691038247,"y":4732239.204198467,"z":3700806.449364192},{"x":-2121527.853869208,"y":4732241.611522307,"z":3700818.2976038707},{"x":-2121514.839276718,"y":4732245.255991199,"z":3700831.9334987197},{"x":-2121500.971051524,"y":4732246.996391825,"z":3700844.070304097},{"x":-2121485.6129862056,"y":4732245.4135426,"z":3700853.5906559355},{"x":-2121470.694337156,"y":4732244.810857919,"z":3700863.8827083423},{"x":-2121456.3921700004,"y":4732245.583331088,"z":3700875.25745626},{"x":-2121440.984568118,"y":4732243.8899554415,"z":3700884.6907788217},{"x":-2121424.712484559,"y":4732240.268171386,"z":3700892.605801956},{"x":-2121408.6508934577,"y":4732237.115889269,"z":3700900.890464236},{"x":-2121394.5082136085,"y":4732238.244123663,"z":3700912.545311759},{"x":-2121392.6686722906,"y":4732235.547951041,"z":3700927.0101064635},{"x":-2121390.967022364,"y":4732233.1593769835,"z":3700941.717100825},{"x":-2121388.380644338,"y":4732228.797221458,"z":3700954.8702224856},{"x":-2121385.329377397,"y":4732223.398027702,"z":3700967.2068364946},{"x":-2121382.422982986,"y":4732218.322004172,"z":3700979.7978947526},{"x":-2121379.662924996,"y":4732213.572416697,"z":3700992.645972047},{"x":-2121376.8615685557,"y":4732208.730703733,"z":3701005.421513605},{"x":-2121373.8601750177,"y":4732203.442762807,"z":3701017.845711419},{"x":-2121369.5765034584,"y":4732195.2944100285,"z":3701028.0177142466},{"x":-2121365.294811946,"y":4732180.873269752,"z":3701044.300087763},{"x":-2121360.2353787674,"y":4732164.717207927,"z":3701059.2164008324},{"x":-2121355.0287454906,"y":4732148.2327913325,"z":3701073.874130655},{"x":-2121350.7606379245,"y":4732133.841968338,"z":3701090.180288297},{"x":-2121347.2411690974,"y":4732121.121148751,"z":3701107.801377625},{"x":-2121345.274001605,"y":4732111.863067786,"z":3701128.149030035},{"x":-2121344.1286797556,"y":4732104.438279641,"z":3701149.9402691857},{"x":-2121342.4208263755,"y":4732095.7586372495,"z":3701170.7434801445},{"x":-2121338.6016366454,"y":4732082.3692165585,"z":3701187.8381683948},{"x":-2121321.109891214,"y":4732087.271390537,"z":3701200.427406505},{"x":-2121302.034909999,"y":4732088.641785276,"z":3701210.2356457505},{"x":-2121280.6734517063,"y":4732084.911534306,"z":3701216.027502621},{"x":-2121260.712474502,"y":4732084.305319991,"z":3701224.2792800055},{"x":-2121245.8624475673,"y":4732095.100578667,"z":3701241.5088818884},{"x":-2121230.4214266445,"y":4732104.577559198,"z":3701257.7004577997},{"x":-2121210.0362400725,"y":4732103.024948551,"z":3701265.207002813},{"x":-2121191.073446397,"y":4732104.645413417,"z":3701275.2121145045},{"x":-2121176.9642484644,"y":4732117.09368573,"z":3701293.743419049},{"x":-2121156.5694009494,"y":4732128.332998294,"z":3701305.033776336},{"x":-2121132.469248242,"y":4732131.306040185,"z":3701309.8149718847},{"x":-2121108.175832413,"y":4732133.847783064,"z":3701314.2565406747},{"x":-2121087.1945328326,"y":4732143.778709899,"z":3701324.5166251957},{"x":-2121062.564835928,"y":4732145.57000026,"z":3701328.3672501952},{"x":-2121045.7098435024,"y":4732164.706903193,"z":3701345.87647566},{"x":-2121027.4732595235,"y":4732180.76161895,"z":3701360.958676961},{"x":-2121004.9934485084,"y":4732187.349424043,"z":3701368.5862638173},{"x":-2120982.6610245584,"y":4732194.2660216335,"z":3701376.4727530633},{"x":-2120957.2246975983,"y":4732217.212020473,"z":3701400.5086863283},{"x":-2120931.499827156,"y":4732239.514597462,"z":3701424.0379903386},{"x":-2120900.1210786,"y":4732249.202340454,"z":3701437.6338440445},{"x":-2120868.1518374984,"y":4732257.572459433,"z":3701450.1921355864},{"x":-2120836.1696264176,"y":4732265.913525949,"z":3701462.727541355},{"x":-2120801.489509551,"y":4732268.234484451,"z":3701470.522416586},{"x":-2120772.7539048796,"y":4732283.81968758,"z":3701488.762187564},{"x":-2120740.3489784384,"y":4732291.21717369,"z":3701500.554546242},{"x":-2120708.248883331,"y":4732299.294737087,"z":3701512.8824220262},{"x":-2120677.5627219537,"y":4732298.145412502,"z":3701535.5143843694},{"x":-2120645.138716705,"y":4732293.118267914,"z":3701555.0927954894},{"x":-2120608.821938857,"y":4732279.404271247,"z":3701567.830643915},{"x":-2120572.507488134,"y":4732265.695349083,"z":3701580.5724466187},{"x":-2120539.798764612,"y":4732260.032957006,"z":3701599.650663704},{"x":-2120504.7886727923,"y":4732249.234799945,"z":3701614.684597939},{"x":-2120468.3322765734,"y":4732235.208899144,"z":3701627.176713862},{"x":-2120431.7455404224,"y":4732220.891987842,"z":3701639.4396165097},{"x":-2120398.3161541107,"y":4732213.621378019,"z":3701657.2514116387},{"x":-2120364.742039006,"y":4732230.2456224365,"z":3701641.375320923},{"x":-2120331.4314769097,"y":4732247.457851996,"z":3701625.962330461},{"x":-2120299.063732476,"y":4732266.774142414,"z":3701612.206306365},{"x":-2120268.357504712,"y":4732289.798701443,"z":3701601.3704790766},{"x":-2120239.632924934,"y":4732317.246268719,"z":3701594.0176136154},{"x":-2120211.040262366,"y":4732344.988472267,"z":3701586.8967006067},{"x":-2120181.495073039,"y":4732370.604786052,"z":3701578.1016819673},{"x":-2120152.044155887,"y":4732396.431649075,"z":3701569.472420496},{"x":-2120119.414410632,"y":4732415.163037253,"z":3701555.255844857},{"x":-2120112.6998421303,"y":4732432.095085297,"z":3701517.215084125},{"x":-2120106.2350587077,"y":4732449.584638257,"z":3701479.6134095816},{"x":-2120105.8759910096,"y":4732480.703261575,"z":3701452.7434702828},{"x":-2120100.22246832,"y":4732500.003703891,"z":3701416.567705112},{"x":-2120094.6687504603,"y":4732519.526905317,"z":3701380.5673817378},{"x":-2120090.842954139,"y":4732542.9072109405,"z":3701347.6040897863},{"x":-2120087.449281781,"y":4732567.252153418,"z":3701315.4002746437},{"x":-2120082.881236344,"y":4732588.975623516,"z":3701281.13236579},{"x":-2120076.7968622544,"y":4732607.314227229,"z":3701244.199395614},{"x":-2120110.8292766884,"y":4732632.665601814,"z":3701212.822282062},{"x":-2120145.6457235147,"y":4732659.766961331,"z":3701182.822808305},{"x":-2120176.3287125137,"y":4732677.641381492,"z":3701145.5586658306},{"x":-2120205.694520057,"y":4732692.575609835,"z":3701105.979712243},{"x":-2120237.6547123934,"y":4732713.300989094,"z":3701070.960133949},{"x":-2120269.6038034973,"y":4732734.001529531,"z":3701035.920940105},{"x":-2120296.7672737646,"y":4732744.019960065,"z":3700992.4720113967},{"x":-2120322.367369537,"y":4732750.548967552,"z":3700946.2761853156},{"x":-2120353.2615127363,"y":4732768.894883763,"z":3700909.3834154475},{"x":-2120368.4915144537,"y":4732769.849138196,"z":3700891.236514121},{"x":-2120383.3400045754,"y":4732769.951823684,"z":3700872.419213415},{"x":-2120395.037457958,"y":4732763.021324,"z":3700848.0651490246},{"x":-2120403.7314726505,"y":4732749.387225865,"z":3700818.4338660035},{"x":-2120417.3937216224,"y":4732746.842350571,"z":3700797.5324048502},{"x":-2120433.620191499,"y":4732750.020773585,"z":3700781.1364617897},{"x":-2120450.0798377246,"y":4732753.7195834825,"z":3700765.150145961},{"x":-2120466.7459985814,"y":4732757.87926196,"z":3700749.5265974924},{"x":-2120483.958065865,"y":4732763.257296747,"z":3700734.8621122036},{"x":-2120495.974098394,"y":4732761.962003455,"z":3700728.721001686},{"x":-2120512.5531632123,"y":4732770.851009508,"z":3700730.597056746},{"x":-2120529.83933773,"y":4732781.318152928,"z":3700733.715421656},{"x":-2120546.147447278,"y":4732789.60230983,"z":3700735.115316038},{"x":-2120561.2403122936,"y":4732795.1741676,"z":3700734.3800701196},{"x":-2120575.109486973,"y":4732798.014924839,"z":3700731.494892258},{"x":-2120589.0911628106,"y":4732801.10678673,"z":3700728.807388217},{"x":-2120602.7771149785,"y":4732803.538664501,"z":3700725.600347586},{"x":-2120615.8342254725,"y":4732804.567114915,"z":3700721.28853441},{"x":-2120629.232537842,"y":4732799.147480897,"z":3700719.879611641},{"x":-2120641.2866098774,"y":4732790.727733103,"z":3700716.1090032705},{"x":-2120652.4564839085,"y":4732780.334641261,"z":3700710.7849783143},{"x":-2120663.0794542325,"y":4732768.721002738,"z":3700704.500136705},{"x":-2120673.452520839,"y":4732756.5496666925,"z":3700697.7762727397},{"x":-2120684.0965264025,"y":4732744.983013716,"z":3700691.5284149833},{"x":-2120694.6336504593,"y":4732733.177852077,"z":3700685.092800906},{"x":-2120705.036668135,"y":4732721.073430101,"z":3700678.421606087},{"x":-2120716.4825959117,"y":4732711.296451287,"z":3700673.582583812},{"x":-2120728.147736014,"y":4732710.208377456,"z":3700675.0796345216},{"x":-2120740.7899663816,"y":4732711.30082737,"z":3700678.2932047234},{"x":-2120754.144974824,"y":4732713.983919599,"z":3700682.758939243},{"x":-2120767.930464346,"y":4732717.627651237,"z":3700687.9808978317},{"x":-2120781.544415205,"y":4732720.888542829,"z":3700692.9014849984},{"x":-2120793.9740456236,"y":4732721.506497351,"z":3700695.7415340305},{"x":-2120806.040347619,"y":4732721.313659144,"z":3700697.943320331},{"x":-2120817.4044258003,"y":4732719.553778613,"z":3700698.9115163176},{"x":-2120827.979572652,"y":4732716.033391273,"z":3700698.493822603},{"x":-2120842.3384397295,"y":4732715.008558439,"z":3700692.2342442246},{"x":-2120856.89431396,"y":4732714.423350499,"z":3700686.3207418774},{"x":-2120871.372463748,"y":4732713.664696084,"z":3700680.2707006526},{"x":-2120885.751934314,"y":4732712.685838669,"z":3700674.047314199},{"x":-2120900.1683274773,"y":4732711.789373408,"z":3700667.8887872635},{"x":-2120914.6504417467,"y":4732711.039560961,"z":3700661.8457056973},{"x":-2120929.056527275,"y":4732710.120093025,"z":3700655.669070714},{"x":-2120943.606546351,"y":4732709.521800737,"z":3700649.7452651993},{"x":-2120957.570951789,"y":4732707.616764785,"z":3700642.7927917517},{"x":-2120961.551751122,"y":4732715.733649635,"z":3700625.5969924815},{"x":-2120964.8303132216,"y":4732722.283562074,"z":3700607.1676962776},{"x":-2120968.0864011366,"y":4732728.783326325,"z":3700588.6989462483},{"x":-2120971.106403497,"y":4732734.756290016,"z":3700569.815532468},{"x":-2120976.715287883,"y":4732746.506084819,"z":3700555.4795169737},{"x":-2120981.9157584524,"y":4732757.344544381,"z":3700540.4260967197},{"x":-2120988.4038948803,"y":4732771.056299372,"z":3700527.6344098607},{"x":-2120992.9969423893,"y":4732780.5393542275,"z":3700511.5140145826},{"x":-2120995.9242168013,"y":4732786.305405902,"z":3700492.467758607},{"x":-2121007.0473109167,"y":4732786.850922588,"z":3700471.0411158516},{"x":-2121020.1550478577,"y":4732791.824975121,"z":3700453.100418977},{"x":-2121037.584189509,"y":4732806.441661187,"z":3700442.749830772},{"x":-2121052.340526535,"y":4732815.094287086,"z":3700427.7046377487},{"x":-2121066.33230693,"y":4732822.040896361,"z":3700411.3165594875},{"x":-2121080.460525763,"y":4732829.291932087,"z":3700395.168091754},{"x":-2121091.5313667655,"y":4732829.720969849,"z":3700373.649869464},{"x":-2121103.2863185797,"y":4732831.676522757,"z":3700353.333241814},{"x":-2121116.9268937986,"y":4732837.839496507,"z":3700336.3283607867},{"x":-2121119.3904245934,"y":4732846.028726753,"z":3700329.4412970906},{"x":-2121122.1847567274,"y":4732854.956075149,"z":3700323.1352014574},{"x":-2121123.6725908164,"y":4732860.968238613,"z":3700314.534539671},{"x":-2121125.277983919,"y":4732867.242710948,"z":3700306.1403442444},{"x":-2121127.2444692673,"y":4732874.322888668,"z":3700298.380319223},{"x":-2121128.7272760724,"y":4732880.323833769,"z":3700289.7708323086},{"x":-2121130.4927607174,"y":4732886.955518486,"z":3700281.657798582},{"x":-2121131.791407668,"y":4732892.5455459235,"z":3700272.724886757},{"x":-2121132.282482174,"y":4732896.333630632,"z":3700262.3736951794},{"x":-2121133.2395158955,"y":4732898.175628473,"z":3700255.664850086},{"x":-2121134.2169645573,"y":4732900.063178305,"z":3700248.9918584046},{"x":-2121135.22026176,"y":4732902.008404147,"z":3700242.364262489},{"x":-2121136.523024901,"y":4732904.621830123,"z":3700236.262593174},{"x":-2121137.8457915564,"y":4732907.279889968,"z":3700230.1960517294},{"x":-2121138.3607545695,"y":4732908.135492841,"z":3700222.710836645},{"x":-2121138.7942918083,"y":4732908.809410062,"z":3700215.0826250413},{"x":-2121139.551541762,"y":4732910.205629374,"z":3700208.02292199},{"x":-2121141.188650978,"y":4732913.565083379,"z":3700202.50842583},{"x":-2121146.747482431,"y":4732915.344017929,"z":3700196.7679494796},{"x":-2121152.940606591,"y":4732918.538258204,"z":3700192.1414226675},{"x":-2121159.918830364,"y":4732923.484288659,"z":3700188.893674591},{"x":-2121167.2473110813,"y":4732929.211839459,"z":3700186.261031891},{"x":-2121175.3747571553,"y":4732936.7220995575,"z":3700185.0314902365},{"x":-2121182.606611137,"y":4732942.234032867,"z":3700182.2291319706},{"x":-2121189.1385990623,"y":4732946.1843705205,"z":3700178.197699978},{"x":-2121195.6327951457,"y":4732950.050386209,"z":3700174.0999027467},{"x":-2121201.4458400593,"y":4732952.3965784265,"z":3700168.805918621},{"x":-2121205.6700395453,"y":4732959.151288831,"z":3700158.4743417753},{"x":-2121209.9094378217,"y":4732965.939909826,"z":3700148.1694435836},{"x":-2121213.667299602,"y":4732971.6540975645,"z":3700137.018904542},{"x":-2121217.528427857,"y":4732977.59869851,"z":3700126.049707061},{"x":-2121218.130797693,"y":4732976.272181053,"z":3700109.357837638},{"x":-2121221.9736718056,"y":4732982.176054689,"z":3700098.356599739},{"x":-2121226.060650963,"y":4732988.624587192,"z":3700087.784021902},{"x":-2121229.894361057,"y":4732994.508011586,"z":3700076.7666779},{"x":-2121232.9979473343,"y":4732998.7623471925,"z":3700064.467191333},{"x":-2121245.863926111,"y":4732998.144789427,"z":3700053.7114915513},{"x":-2121258.768566215,"y":4732997.613501495,"z":3700043.0236908966},{"x":-2121271.8895549835,"y":4732997.564939099,"z":3700032.7158077364},{"x":-2121284.8702605115,"y":4732997.2033784455,"z":3700022.161589363},{"x":-2121297.976976366,"y":4732997.122974174,"z":3700011.8286473737},{"x":-2121311.125545643,"y":4732997.135953035,"z":3700001.569199675},{"x":-2121324.4794934667,"y":4732997.6071627205,"z":3699991.6703852485},{"x":-2121337.860792688,"y":4732998.139391531,"z":3699981.819591497},{"x":-2121351.3335289657,"y":4732998.875621408,"z":3699972.129345935},{"x":-2121352.339143888,"y":4733000.948535282,"z":3699961.5515134074},{"x":-2121353.056257194,"y":4733002.377766331,"z":3699950.467111382},{"x":-2121355.411393072,"y":4733007.461629429,"z":3699942.2589189406},{"x":-2121357.2810792965,"y":4733011.462394011,"z":3699933.1983256955},{"x":-2121360.093620596,"y":4733017.566785249,"z":3699925.793276464},{"x":-2121362.1781299487,"y":4733022.046846811,"z":3699917.1098819994},{"x":-2121364.4371228437,"y":4733026.9162027445,"z":3699908.732856316},{"x":-2121366.746947022,"y":4733031.89896951,"z":3699900.445079598},{"x":-2121368.6420362494,"y":4733035.956411216,"z":3699891.4290818973},{"x":-2121383.8750004475,"y":4733039.524181368,"z":3699881.456015659},{"x":-2121398.21816145,"y":4733041.106694295,"z":3699869.920584335},{"x":-2121412.43580119,"y":4733042.409162974,"z":3699858.164766422},{"x":-2121426.7170134904,"y":4733043.853473676,"z":3699846.5205775816},{"x":-2121441.1259853523,"y":4733045.582828211,"z":3699835.100712316},{"x":-2121455.6102818814,"y":4733047.480236846,"z":3699823.813101106},{"x":-2121469.8763417504,"y":4733048.890754171,"z":3699812.142323135},{"x":-2121484.4487323496,"y":4733050.984704153,"z":3699801.00938378},{"x":-2121498.911528271,"y":4733052.834146237,"z":3699789.68402531},{"x":-2121504.285339136,"y":4733043.575396521,"z":3699782.0274235737},{"x":-2121511.3220610125,"y":4733038.026605913,"z":3699777.2904117666},{"x":-2121519.728108934,"y":4733035.532746764,"z":3699774.9575085426},{"x":-2121527.6346586826,"y":4733031.924515876,"z":3699771.7476393627},{"x":-2121536.2773812027,"y":4733029.95864171,"z":3699769.8302386063},{"x":-2121544.5271425126,"y":4733027.116078056,"z":3699767.2229183195},{"x":-2121553.2051121704,"y":4733025.228804097,"z":3699765.367372139},{"x":-2121560.028813651,"y":4733019.2047967985,"z":3699760.2563843285},{"x":-2121568.276987497,"y":4733016.358669128,"z":3699757.646258895},{"x":-2121574.760778562,"y":4733017.409706003,"z":3699752.649854457},{"x":-2121581.1566062113,"y":4733018.2645046795,"z":3699747.499018444},{"x":-2121587.5044411886,"y":4733019.012236987,"z":3699742.26392586},{"x":-2121594.029610115,"y":4733020.1555803185,"z":3699737.3401612802},{"x":-2121600.3889101925,"y":4733020.92888948,"z":3699732.1251963386},{"x":-2121606.8196901204,"y":4733021.861660905,"z":3699727.035720639},{"x":-2121612.81427615,"y":4733021.821344025,"z":3699721.180472152},{"x":-2121619.270003311,"y":4733022.809770534,"z":3699716.134794825},{"x":-2121625.6708096648,"y":4733023.675676125,"z":3699710.9926994587},{"x":-2121627.3207075647,"y":4733021.99432878,"z":3699707.739055825},{"x":-2121629.993052411,"y":4733022.59390339,"z":3699706.2803791123},{"x":-2121632.363624265,"y":4733022.520269292,"z":3699704.2919223285},{"x":-2121634.8086026753,"y":4733022.612624236,"z":3699702.4340900886},{"x":-2121637.28214101,"y":4733022.768691386,"z":3699700.626395822},{"x":-2121639.7646444873,"y":4733022.944757847,"z":3699698.834439777},{"x":-2121642.2658593324,"y":4733023.162565727,"z":3699697.075331779},{"x":-2121644.7373921094,"y":4733023.314157473,"z":3699695.264115128},{"x":-2121647.2123540808,"y":4733023.473398741,"z":3699693.45891808},{"x":-2121653.2311701598,"y":4733024.255791685,"z":3699688.47609816},{"x":-2121659.3055392033,"y":4733025.162113402,"z":3699683.590803242},{"x":-2121665.366216071,"y":4733026.037890368,"z":3699678.681471337},{"x":-2121671.3119638693,"y":4733026.657283446,"z":3699673.5703807645},{"x":-2121677.3951779134,"y":4733027.583336936,"z":3699668.7006137124},{"x":-2121683.4834795943,"y":4733028.520739615,"z":3699663.83977764},{"x":-2121689.5564251235,"y":4733029.423885725,"z":3699658.951983695},{"x":-2121695.642575028,"y":4733030.3564877175,"z":3699654.087369553},{"x":-2121701.742404813,"y":4733031.319606099,"z":3699649.2467696574},{"x":-2121704.480842904,"y":4733030.275541916,"z":3699644.7898775325},{"x":-2121707.784760778,"y":4733030.492934089,"z":3699641.3256682088},{"x":-2121711.281540179,"y":4733031.140554563,"z":3699638.2000192297},{"x":-2121714.6253931336,"y":4733031.447032166,"z":3699634.805913936},{"x":-2121718.07143255,"y":4733031.981462697,"z":3699631.5911916383},{"x":-2121721.2914281334,"y":4733032.011645041,"z":3699627.9796613953},{"x":-2121724.8279358475,"y":4733032.747886954,"z":3699624.923749913},{"x":-2121728.3674981357,"y":4733033.490941564,"z":3699621.8731988817},{"x":-2121731.8701099637,"y":4733034.151567978,"z":3699618.757782228},{"x":-2121736.5595956948,"y":4733032.082752959,"z":3699618.4889755743},{"x":-2121741.23111338,"y":4733029.973856879,"z":3699618.188627948},{"x":-2121745.921408446,"y":4733027.906848933,"z":3699617.921243149},{"x":-2121750.718031595,"y":4733026.077029651,"z":3699617.8405086664},{"x":-2121755.548442968,"y":4733024.322581664,"z":3699617.8190860418},{"x":-2121760.3911117865,"y":4733022.595475542,"z":3699617.819179608},{"x":-2121765.079323778,"y":4733020.52382161,"z":3699617.548138669},{"x":-2121769.808795506,"y":4733018.544206308,"z":3699617.349525524},{"x":-2121774.666500947,"y":4733016.850640689,"z":3699617.3760132603},{"x":-2121781.3065972743,"y":4733015.347679847,"z":3699615.249064961},{"x":-2121788.048572193,"y":4733014.071975741,"z":3699613.300951526},{"x":-2121794.613910971,"y":4733012.402253042,"z":3699611.0427733515},{"x":-2121801.2548421933,"y":4733010.9011512855,"z":3699608.9172878293},{"x":-2121807.9513633233,"y":4733009.52405009,"z":3699606.889381812},{"x":-2121814.6412914046,"y":4733008.132240276,"z":3699604.849901055},{"x":-2121821.030420328,"y":4733006.069455858,"z":3699602.2824114775},{"x":-2121827.421208098,"y":4733004.010374539,"z":3699599.7178361425},{"x":-2121833.835491965,"y":4733002.003706868,"z":3699597.194506719},{"x":-2121842.547915952,"y":4732999.30433949,"z":3699594.2120290133},{"x":-2121851.242842198,"y":4732996.565942194,"z":3699591.1988376225},{"x":-2121859.969820673,"y":4732993.899041047,"z":3699588.2419085195},{"x":-2121868.5700476463,"y":4732990.949411127,"z":3699585.062492556},{"x":-2121877.291848926,"y":4732988.270963609,"z":3699582.096477372},{"x":-2121885.886423171,"y":4732985.3087293655,"z":3699578.907142905},{"x":-2121894.7385190083,"y":4732982.920911724,"z":3699576.1698320964},{"x":-2121903.9270628956,"y":4732981.283550864,"z":3699574.02307525},{"x":-2121912.461808734,"y":4732978.187867863,"z":3699570.7287264904},{"x":-2121918.1486574817,"y":4732978.534737146,"z":3699566.9910603045},{"x":-2121923.823749324,"y":4732978.855385831,"z":3699563.2327615833},{"x":-2121929.582686224,"y":4732979.363054994,"z":3699559.621634789},{"x":-2121935.0459103887,"y":4732979.211138968,"z":3699555.4914663583},{"x":-2121940.8324116194,"y":4732979.780296957,"z":3699551.928728646},{"x":-2121946.7678318294,"y":4732980.681619393,"z":3699548.6273787683},{"x":-2121953.4411483607,"y":4732983.22880822,"z":3699546.621194181},{"x":-2121960.3786273277,"y":4732986.365197457,"z":3699545.078660007},{"x":-2121966.2261461765,"y":4732987.070449541,"z":3699541.623015912},{"x":-2121976.362450236,"y":4732984.847681599,"z":3699537.4095101464},{"x":-2121986.4193726056,"y":4732982.447856608,"z":3699533.0566751165},{"x":-2121996.3824447123,"y":4732979.8387060985,"z":3699528.539118505},{"x":-2122006.094011134,"y":4732976.668594692,"z":3699523.5801330726},{"x":-2122016.321698808,"y":4732974.649656985,"z":3699519.5270252074},{"x":-2122026.0712470068,"y":4732971.56427357,"z":3699514.6347148498},{"x":-2122036.7065348867,"y":4732970.454444304,"z":3699511.2969977665},{"x":-2122047.123023721,"y":4732968.856598375,"z":3699507.5752523085},{"x":-2122057.37362722,"y":4732966.888760455,"z":3699503.562354464},{"x":-2122063.396953527,"y":4732964.909073043,"z":3699499.415021856},{"x":-2122070.021962099,"y":4732964.271355715,"z":3699496.323703302},{"x":-2122076.615312667,"y":4732963.56302788,"z":3699493.1768201245},{"x":-2122082.6166843157,"y":4732961.534385192,"z":3699488.990965926},{"x":-2122089.348051031,"y":4732961.133879789,"z":3699486.0863116677},{"x":-2122095.9159834078,"y":4732960.36885917,"z":3699482.8948160196},{"x":-2122102.440778192,"y":4732959.507626679,"z":3699479.6276100827},{"x":-2122109.0280602956,"y":4732958.785759452,"z":3699476.4700718117},{"x":-2122115.599409304,"y":4732958.028354934,"z":3699473.2845686586}]
\ No newline at end of file
{
"type" : "Topology",
"transform" : {
"scale" : [0.0035892802775563276, 0.0005250691027211737],
"translate" : [-179.14350338367416, 18.906117143691233]
},
"objects" : {
"states" : {
"type" : "GeometryCollection",
"geometries" : []
}
},
"arcs" : []
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
name: qf_web
version: V1.04184
version: V1.04190
*/
function _0x5ee9(_0x23f0d6,_0x1cb5bb){var _0x33cd72=_0x3bec();return _0x5ee9=function(_0x5be1ae,_0x1353da){_0x5be1ae=_0x5be1ae-0x1a2;var _0x3bec95=_0x33cd72[_0x5be1ae];return _0x3bec95;},_0x5ee9(_0x23f0d6,_0x1cb5bb);}function _0x3bec(){var _0x590e19=['create','mozCancelRequestAnimationFrame','string','timer','onload','style','setting','display:block;width:','transition','substr','touchend','transformOrigin','split','readyState','toString','attachEvent','__proto__','getDefaultTime','8397XVPsDQ','6IKENVs','cancelRequestAnimationFrame','start','div','msRequestAnimationFrame','charAt','timerA','default','documentElement','envir','isArray','devicePixelRatio','13576820ZOAXIJ','wpr','touchmove','6957734qfxsCY','711610hkVqKL','createElement','4228640ATxOlB','layer','dprb','extend','width','getElementById','name','search','prt','transform','test','undefined','toUpperCase','rem;opacity:1','random','replace','timerPointer','t,webkitT,MozT,msT,OT','document','innerHeight','ransform','scale(','remBase','msCancelRequestAnimationFrame','nodeType','oCancelRequestAnimationFrame','userAgent','__esModule','oRequestAnimationFrame','ontouchstart','timeoutFilter','xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx','webkitCancelAnimationFrame','xxxxxxxx','mouseup','defineProperty','contentWindow','webkitRequestAnimationFrame','hasOwnProperty','length','[object\x20Array]','Async','11272DVOZhC','appVersion','124692DewtgD','fontSize','return\x20(this.','bind','height',':scale(','px\x200;font-size:','clientWidth','firstTimer','keys','body','join','ceil','apply','init','randomRuntimer','object','function','call','touchstart','toLowerCase','constructor','loaded','run','timerCtrl','exports','(((.+)+)+)+$','resize','45bYgqkm','prototype','cssText','toStringTag','touchcancel','splice','4383330BrBHLM','addEventListener','setTime','push','parseInt','getTime'];_0x3bec=function(){return _0x590e19;};return _0x3bec();}(function(_0x131371,_0x42f559){var _0x50433f={_0x5a866a:0x1c0,_0x37b6e6:0x1dc,_0x250bbd:0x20d,_0x3c72b0:0x1fb},_0x2d5325=_0x5ee9,_0x39dd99=_0x131371();while(!![]){try{var _0x5c0144=parseInt(_0x2d5325(0x20b))/0x1+-parseInt(_0x2d5325(_0x50433f._0x5a866a))/0x2*(parseInt(_0x2d5325(_0x50433f._0x37b6e6))/0x3)+parseInt(_0x2d5325(_0x50433f._0x250bbd))/0x4+-parseInt(_0x2d5325(0x1e2))/0x5*(-parseInt(_0x2d5325(_0x50433f._0x3c72b0))/0x6)+-parseInt(_0x2d5325(0x20a))/0x7+-parseInt(_0x2d5325(0x1be))/0x8*(-parseInt(_0x2d5325(0x1fa))/0x9)+-parseInt(_0x2d5325(0x207))/0xa;if(_0x5c0144===_0x42f559)break;else _0x39dd99['push'](_0x39dd99['shift']());}catch(_0x289f90){_0x39dd99['push'](_0x39dd99['shift']());}}}(_0x3bec,0xa45af),!function(_0x2a4829){var _0x1cc105={_0x1c65b8:0x1af},_0x282c76={_0x11172f:0x1d0,_0x2e22d0:0x1af},_0x103adb={_0x75e55f:0x1df,_0x48cff1:0x1b7,_0xb55c22:0x1af},_0x46e787={_0x16d12c:0x1d9,_0x180f63:0x1d9},_0x5e5e78={_0xd6e539:0x1da},_0x100c37=(function(){var _0x5e7473={_0x4785bf:0x1cd},_0x4d0bec=!![];return function(_0x2c1055,_0x348531){var _0x48ecb4=_0x4d0bec?function(){var _0x3ea004=_0x5ee9;if(_0x348531){var _0x11bd18=_0x348531[_0x3ea004(_0x5e7473._0x4785bf)](_0x2c1055,arguments);return _0x348531=null,_0x11bd18;}}:function(){};return _0x4d0bec=![],_0x48ecb4;};}()),_0x205a1f={};function _0x464a10(_0x5e6e53){var _0x351333=_0x5ee9,_0x317025=_0x100c37(this,function(){var _0x1de885=_0x5ee9;return _0x317025['toString']()[_0x1de885(0x214)](_0x1de885(0x1da))['toString']()[_0x1de885(0x1d5)](_0x317025)['search'](_0x1de885(_0x5e5e78._0xd6e539));});_0x317025();if(_0x205a1f[_0x5e6e53])return _0x205a1f[_0x5e6e53][_0x351333(0x1d9)];var _0xe6c08c=_0x205a1f[_0x5e6e53]={'i':_0x5e6e53,'l':!0x1,'exports':{}};return _0x2a4829[_0x5e6e53]['call'](_0xe6c08c[_0x351333(0x1d9)],_0xe6c08c,_0xe6c08c[_0x351333(_0x46e787._0x16d12c)],_0x464a10),_0xe6c08c['l']=!0x0,_0xe6c08c[_0x351333(_0x46e787._0x180f63)];}_0x464a10['m']=_0x2a4829,_0x464a10['c']=_0x205a1f,_0x464a10['d']=function(_0x1d2047,_0x5c4341,_0x20d3a0){var _0x4c799a=_0x5ee9;_0x464a10['o'](_0x1d2047,_0x5c4341)||Object[_0x4c799a(0x1b7)](_0x1d2047,_0x5c4341,{'enumerable':!0x0,'get':_0x20d3a0});},_0x464a10['r']=function(_0x5ddbf4){var _0x311929=_0x5ee9;_0x311929(0x218)!=typeof Symbol&&Symbol[_0x311929(_0x103adb._0x75e55f)]&&Object['defineProperty'](_0x5ddbf4,Symbol['toStringTag'],{'value':'Module'}),Object[_0x311929(_0x103adb._0x48cff1)](_0x5ddbf4,_0x311929(_0x103adb._0xb55c22),{'value':!0x0});},_0x464a10['t']=function(_0x295262,_0x33bf00){var _0x478a6f=_0x5ee9;if(0x1&_0x33bf00&&(_0x295262=_0x464a10(_0x295262)),0x8&_0x33bf00)return _0x295262;if(0x4&_0x33bf00&&_0x478a6f(_0x282c76._0x11172f)==typeof _0x295262&&_0x295262&&_0x295262[_0x478a6f(_0x282c76._0x2e22d0)])return _0x295262;var _0x1e8437=Object[_0x478a6f(0x1e8)](null);if(_0x464a10['r'](_0x1e8437),Object[_0x478a6f(0x1b7)](_0x1e8437,'default',{'enumerable':!0x0,'value':_0x295262}),0x2&_0x33bf00&&_0x478a6f(0x1ea)!=typeof _0x295262){for(var _0x469651 in _0x295262)_0x464a10['d'](_0x1e8437,_0x469651,function(_0x435a04){return _0x295262[_0x435a04];}['bind'](null,_0x469651));}return _0x1e8437;},_0x464a10['n']=function(_0x463563){var _0x2a294e=_0x5ee9,_0x230c06=_0x463563&&_0x463563[_0x2a294e(_0x1cc105._0x1c65b8)]?function(){var _0x29a59d=_0x2a294e;return _0x463563[_0x29a59d(0x202)];}:function(){return _0x463563;};return _0x464a10['d'](_0x230c06,'a',_0x230c06),_0x230c06;},_0x464a10['o']=function(_0x351950,_0x55156f){var _0x315045=_0x5ee9;return Object[_0x315045(0x1dd)][_0x315045(0x1ba)][_0x315045(0x1d2)](_0x351950,_0x55156f);},_0x464a10['p']='',_0x464a10(_0x464a10['s']=0x0);}([function(_0x578ce8,_0x54bd74,_0x5a55f9){var _0x22611e={_0x4f8243:0x1d9},_0x36187b=_0x5ee9;_0x578ce8[_0x36187b(_0x22611e._0x4f8243)]=_0x5a55f9(0x1);},function(_0x336667,_0x1d36aa,_0x134261){var _0x5e4369={_0x3ba4c3:0x1a6},_0x5d185f=_0x5ee9;!function(_0x5c718b,_0x4084b9){var _0x4f7182={_0x70e8d3:0x1fe,_0x108887:0x1f0,_0x24b05f:0x217,_0x35ad74:0x209,_0x4c439a:0x1f2,_0x41974e:0x1b6,_0x100560:0x1b9,_0x4f811a:0x1b4,_0x58cddd:0x1e9,_0x618c88:0x1ad,_0x4ab114:0x1ca,_0x292bd1:0x1dd,_0x40ae97:0x210,_0x303b24:0x210,_0x4bc07f:0x215},_0x25c4cd={_0x18740c:0x1bb,_0x17f0e2:0x1d2},_0x5b30c2={_0x303e33:0x1ee},_0x148f0b={_0x305a0f:0x208,_0x4585e2:0x204},_0x3feab9={_0x264a57:0x1bb,_0x34af9e:0x1e1},_0x129b40={_0x2c8017:0x1c2},_0x23a6de={_0x68fd10:0x1f5,_0x36e30d:0x1e3,_0x3d2471:0x1e3,_0x39ac3e:0x1ec},_0x361510={_0x53f5b4:0x200,_0x28163d:0x219},_0x27a21b=_0x5ee9;if(!_0x5c718b[_0x27a21b(_0x5e4369._0x3ba4c3)])throw new Error('Window\x20object\x20not\x20found!');(function(_0x3cb080,_0xec2fe4){var _0x5672f0={_0x4fc737:0x210},_0x4eb680={_0x52454d:0x1cb,_0xd24846:0x1b5},_0x3f760e={_0x4ce841:0x20f,_0x5bfd38:0x204,_0x3a8297:0x1aa,_0x5619f9:0x1ed,_0x395663:0x1c1},_0x1444bd={_0x55584d:0x1c7},_0x290eb6={_0x44fbfc:0x1f3,_0x45f1df:0x1ed,_0x549bf2:0x216,_0x4a0358:0x1c4,_0x538359:0x211,_0x12bccd:0x1ee},_0x53adf1={_0x57e5f6:0x208},_0x268a5c={_0x36631f:0x1e6},_0x2d42cc={_0x30401d:0x217},_0x544e61={_0x18578c:0x1d2},_0x4eeea5={_0xfbb190:0x1ec},_0x88ce97={_0x40c821:0x1b8},_0xeae2bc={_0x44110e:0x1ce},_0x2a7aef={_0x57ade0:0x1a5,_0x4935c8:0x1f4,_0x327e91:0x1bb,_0x22afdd:0x1f1,_0x6ea506:0x1bb},_0x1e8a9a=_0x27a21b,_0xd62957=document,_0xe35588=_0xd62957[_0x1e8a9a(0x1ca)],_0x474f95=_0xd62957[_0x1e8a9a(0x20c)](_0x1e8a9a(_0x4f7182._0x70e8d3))[_0x1e8a9a(0x1ed)],_0x574c87=(function(){var _0x5af242=_0x1e8a9a;for(var _0xdc0fa6=_0x5af242(_0x2a7aef._0x57ade0)[_0x5af242(_0x2a7aef._0x4935c8)](','),_0x37e924=0x0,_0x59d4fb=_0xdc0fa6[_0x5af242(_0x2a7aef._0x327e91)];_0x37e924<_0x59d4fb;_0x37e924++)if(_0xdc0fa6[_0x37e924]+_0x5af242(0x1a8)in _0x474f95)return _0xdc0fa6[_0x37e924][_0x5af242(_0x2a7aef._0x22afdd)](0x0,_0xdc0fa6[_0x37e924][_0x5af242(_0x2a7aef._0x6ea506)]-0x1);return!0x1;}()),_0x1b8198=function(_0x4eb228){var _0x4ea988=_0x1e8a9a;return''===_0x574c87?_0x4eb228:_0x574c87+_0x4eb228[_0x4ea988(_0x361510._0x53f5b4)](0x0)[_0x4ea988(_0x361510._0x28163d)]()+_0x4eb228[_0x4ea988(0x1f1)](0x1);},_0x3c1c29=(navigator[_0x1e8a9a(0x1ae)][_0x1e8a9a(0x1d4)](),_0x1b8198('transform')),_0x4ff060=(_0x1b8198(_0x1e8a9a(_0x4f7182._0x108887)),/hp-tablet/gi[_0x1e8a9a(_0x4f7182._0x24b05f)](navigator[_0x1e8a9a(0x1bf)])),_0x5c5bd7=_0x1e8a9a(0x1b1)in _0x3cb080&&!_0x4ff060,_0x20768f=_0x5c5bd7?_0x1e8a9a(0x1d3):'mousedown',_0x3b3324=_0x5c5bd7?_0x1e8a9a(_0x4f7182._0x35ad74):'mousemove',_0x19e59c=_0x5c5bd7?_0x1e8a9a(_0x4f7182._0x4c439a):_0x1e8a9a(0x1b6),_0x118700=_0x5c5bd7?_0x1e8a9a(0x1e0):_0x1e8a9a(_0x4f7182._0x41974e),_0x4a6848=[],_0x254677=(_0x3cb080['requestAnimationFrame']||_0x3cb080[_0x1e8a9a(_0x4f7182._0x100560)]||_0x3cb080['mozRequestAnimationFrame']||_0x3cb080[_0x1e8a9a(0x1b0)]||_0x3cb080[_0x1e8a9a(0x1ff)],_0x3cb080[_0x1e8a9a(0x1fc)]||_0x3cb080[_0x1e8a9a(_0x4f7182._0x4f811a)]||_0x3cb080['webkitCancelRequestAnimationFrame']||_0x3cb080[_0x1e8a9a(_0x4f7182._0x58cddd)]||_0x3cb080[_0x1e8a9a(_0x4f7182._0x618c88)]||_0x3cb080[_0x1e8a9a(0x1ab)]||clearTimeout,function(_0x11b0bf,_0x17b0b9){var _0x2d541b=_0x1e8a9a;return new _0x254677['prt'][(_0x2d541b(_0xeae2bc._0x44110e))](_0x11b0bf,_0x17b0b9);}),_0x38c641=_0xd62957[_0x1e8a9a(0x203)],_0x160f0f=(_0x38c641[_0x1e8a9a(0x1c7)]||_0x38c641[_0x1e8a9a(_0x4f7182._0x4ab114)]&&_0x38c641['body'][_0x1e8a9a(0x1c7)],_0x3cb080[_0x1e8a9a(0x206)]>=0x2?0x2:_0x3cb080['devicePixelRatio']);_0x254677['prt']=_0x254677[_0x1e8a9a(_0x4f7182._0x292bd1)]={'constructor':_0x254677,'splice':[]['splice']},_0x254677[_0x1e8a9a(_0x4f7182._0x40ae97)]=function(){var _0x5ece5b,_0x18f9db=arguments[0x0];for(_0x5ece5b in _0x18f9db)this[_0x5ece5b]=_0x18f9db[_0x5ece5b];return this;},_0x254677[_0x1e8a9a(0x210)]({'envir':{'dummyStyle':_0x474f95,'vendor':_0x574c87,'dpr':_0x160f0f,'hasTouch':_0x5c5bd7,'event':{'start':_0x20768f,'move':_0x3b3324,'end':_0x19e59c,'cancel':_0x118700}},'setting':{'w':0x780,'h':0x438,'mw':0x258,'fs':0xc,'stb':0x5a0,'stw':0x780,'dprb':0x64}}),_0x254677[_0x1e8a9a(_0x4f7182._0x303b24)]({'iframeLoad':function(_0x4ad087){var _0xe7da67=_0x1e8a9a,_0x4b4b36=this[0x0];_0x4b4b36[_0xe7da67(_0x4eeea5._0xfbb190)]=function(_0x41dfb1){var _0x1b641d=_0xe7da67;_0x4ad087&&_0x4ad087(_0x4b4b36[_0x1b641d(_0x88ce97._0x40c821)],_0x41dfb1);};},'ready':function(_0x13cb8b,_0x599864){var _0x144bd9=_0x1e8a9a,_0x41c4ca=function(){_0x599864&&(_0xe35588=_0xd62957['body']),_0x254677['readyState']=!0x0,_0x13cb8b&&_0x13cb8b(_0x254677);};_0x254677[_0x144bd9(_0x23a6de._0x68fd10)]?_0x13cb8b&&_0x13cb8b(_0x254677):_0x3cb080[_0x144bd9(_0x23a6de._0x36e30d)]?_0x3cb080[_0x144bd9(_0x23a6de._0x3d2471)]('load',_0x41c4ca,!0x1):_0x3cb080[_0x144bd9(0x1f7)](_0x144bd9(_0x23a6de._0x39ac3e),_0x41c4ca);},'isArray':function(_0x4a5e26){var _0x268a0a=_0x1e8a9a;return _0x4a5e26&&_0x268a0a(0x1bc)===Object['prototype'][_0x268a0a(0x1f6)][_0x268a0a(_0x544e61._0x18578c)](_0x4a5e26);},'trim':function(_0x262020){var _0x2e5a6d=_0x1e8a9a;return null==_0x262020?'':(_0x262020+'')[_0x2e5a6d(0x1a3)](/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,'');},'eval':function(_0x426eef){var _0x2a574b=_0x1e8a9a;return new Function(_0x2a574b(_0x129b40._0x2c8017)+_0x426eef+')')['call'](this);},'dataRender':function(_0x1555ba,_0x3a8051,_0x19f84d){return _0x1555ba['replace'](/\{{(.+?)\}}/g,function(_0x18a6fa,_0x26f581){var _0x1a3b50=_0x5ee9;return _0x19f84d?_0x19f84d(_0x18a6fa,_0x26f581):_0x254677['eval'][_0x1a3b50(0x1d2)](_0x3a8051,_0x26f581);});},'removeItem':function(_0x2d4cdb,_0x193023){var _0x4a851d=_0x1e8a9a;for(var _0x3526c1=_0x2d4cdb[_0x4a851d(_0x3feab9._0x264a57)],_0x822bc8=0x0;_0x822bc8<_0x3526c1;_0x822bc8++)if(_0x2d4cdb[_0x822bc8]['id']===_0x193023)return _0x2d4cdb[_0x4a851d(_0x3feab9._0x34af9e)](_0x822bc8,0x1),_0x2d4cdb;},'resize':function(_0xea3ef5){var _0xc9b854=_0x1e8a9a;_0xea3ef5&&_0xea3ef5['apply']&&_0x4a6848[_0xc9b854(0x1e5)](_0xea3ef5);},'isElement':function(_0x5e8cc4){var _0x38fb86=_0x1e8a9a;return(_0x38fb86(0x1d0)==typeof HTMLElement?function(_0x1888b3){return _0x1888b3 instanceof HTMLElement;}:function(_0x5cf9b8){return _0x5cf9b8&&0x1===_0x5cf9b8['nodeType'];})(_0x5e8cc4);},'isPhoneNum':function(_0x543796){var _0x2703c8=_0x1e8a9a;return/^[1][3,4,5,6.7,8,9][0-9]{9}$/[_0x2703c8(_0x2d42cc._0x30401d)](_0x543796);}}),_0x254677[_0x1e8a9a(0x210)]({'getWindowHeight':function(){var _0x10c10b=_0x1e8a9a;return _0x3cb080[_0x10c10b(0x1a7)]||_0xd62957['clientHeight']||_0x38c641['clientHeight'];},'parseRem':function(_0x102536){var _0x26c431=_0x1e8a9a;return _0x3cb080[_0x26c431(_0x268a5c._0x36631f)](_0x102536)*this['envir']['remBase'];},'parsePixel':function(_0x3143d1){var _0x133a31=_0x1e8a9a;return _0x3143d1/this[_0x133a31(0x204)]['remBase'];},'parseRpx':function(_0x51f1eb){return _0x51f1eb*this['envir']['wpr'];},'parseWpx':function(_0x3bd879){var _0x4af8e4=_0x1e8a9a;return _0x3bd879/this[_0x4af8e4(0x204)][_0x4af8e4(_0x53adf1._0x57e5f6)];},'rpxToRem':function(_0x1fa8ac){var _0x83d85d=_0x1e8a9a;return _0x1fa8ac/this[_0x83d85d(0x204)][_0x83d85d(_0x148f0b._0x305a0f)]*this[_0x83d85d(_0x148f0b._0x4585e2)][_0x83d85d(0x1aa)];},'areaVisualNormal':function(_0x480588){var _0x43ef2c=_0x1e8a9a,_0x3742af=this['setting']['dprb']/_0x160f0f+'%';_0x480588[_0x43ef2c(0x1ed)][_0x43ef2c(_0x290eb6._0x44fbfc)]='0\x200',_0x480588[_0x43ef2c(_0x290eb6._0x45f1df)][_0x43ef2c(_0x290eb6._0x549bf2)]=_0x43ef2c(0x1a9)+_0x160f0f+')',_0x480588['style'][_0x43ef2c(_0x290eb6._0x4a0358)]=_0x3742af,_0x480588[_0x43ef2c(_0x290eb6._0x45f1df)][_0x43ef2c(_0x290eb6._0x538359)]=_0x3742af,_0x480588['style'][_0x43ef2c(0x1c1)]=this[_0x43ef2c(_0x290eb6._0x12bccd)]['fs']+'px';},'openCalcLayout':function(_0x3e9651){var _0x595cda=_0x1e8a9a,_0x45e56b=this[_0x595cda(_0x5b30c2._0x303e33)]['h']/this[_0x595cda(_0x5b30c2._0x303e33)]['w'],_0xd36031=this[_0x595cda(_0x5b30c2._0x303e33)]['mw'],_0x276803=function(){var _0x5b1aca=_0x595cda,_0x318f9b=_0x38c641[_0x5b1aca(_0x1444bd._0x55584d)]>_0xd36031?_0x38c641['clientWidth']:_0xd36031,_0x4f275e=_0x318f9b*_0x45e56b;_0x254677['calcLayout'](_0x4f275e,_0x318f9b);};_0x276803(),this[_0x595cda(0x1db)](_0x276803);},'calcLayout':function(_0x49c4b4,_0x9ebb3e){var _0x307e51={_0x22224a:0x212,_0xd73665:0x1c5,_0x38f8c9:0x1c6,_0x63ec15:0x21a},_0xebc1fa=_0x1e8a9a;if(_0x9ebb3e){var _0x562bbc=this[_0xebc1fa(0x1ee)]['fs']*_0x160f0f,_0x3452b7=this['setting']['w'],_0xae7ff2=_0x3452b7/this['setting'][_0xebc1fa(_0x3f760e._0x4ce841)],_0x3eee36=_0xae7ff2/_0x3452b7,_0x26db11=0x1/_0x160f0f,_0x2f582a=_0x9ebb3e-_0x3452b7,_0xfcac87=_0x2f582a>0x0?_0x3452b7:!(_0x2f582a=0x0)&&_0x9ebb3e;this[_0xebc1fa(_0x3f760e._0x5bfd38)][_0xebc1fa(_0x3f760e._0x3a8297)]=_0x3eee36,this[_0xebc1fa(0x204)]['wpr']=_0xfcac87/_0x3452b7*_0x160f0f,_0x38c641[_0xebc1fa(_0x3f760e._0x5619f9)][_0xebc1fa(_0x3f760e._0x395663)]=this['setting'][_0xebc1fa(0x20f)]*(_0xfcac87/_0x3452b7)*_0x160f0f+'px';var _0x504cfe=function(){var _0x36ae9f=_0xebc1fa;(document[_0x36ae9f(_0x307e51._0x22224a)]('views')||_0xe35588)[_0x36ae9f(0x1ed)][_0x36ae9f(0x1de)]=_0x36ae9f(0x1ef)+_0xae7ff2+'rem;height:'+0x64*_0x160f0f+'%;'+_0x3c1c29+_0x36ae9f(_0x307e51._0xd73665)+_0x26db11+');'+_0x3c1c29+'-origin:'+_0x2f582a+_0x36ae9f(_0x307e51._0x38f8c9)+_0x3eee36*_0x562bbc+_0x36ae9f(_0x307e51._0x63ec15);};_0xe35588?_0x504cfe():_0x254677['ready'](_0x504cfe);}}}),_0x254677[_0x1e8a9a(0x210)]({'getGuid':function(_0x213065,_0x2ae848){var _0x5abf14=_0x1e8a9a;return(_0x213065||'')+(_0x2ae848?new Array(_0x2ae848+0x1)[_0x5abf14(_0x4eb680._0x52454d)]('x'):_0x5abf14(_0x4eb680._0xd24846))[_0x5abf14(0x1a3)](/[xy]/g,function(_0x28cb65){var _0x7b2bee=0x10*Math['random']()|0x0;return('x'==_0x28cb65?_0x7b2bee:0x3&_0x7b2bee|0x8)['toString'](0x10);});},'funchain':function(_0x47c16a,_0x54c50a){var _0x5c6ff8={_0xbc7bb3:0x1ce},_0x4b162a=_0x1e8a9a;_0x54c50a=_0x254677[_0x4b162a(0x205)](_0x54c50a)?_0x54c50a:[_0x47c16a,[]][_0x254677['isArray'](_0x47c16a)?~~(_0x47c16a=void 0x0):0x1],len=_0x54c50a['length'],_0x254677['ready'](function(){var _0x5c2996={_0x547241:0x1d9,_0x5b008c:0x1d6,_0x27d697:0x1d2,_0x4a5944:0x1d9},_0x6fb610=_0x4b162a;function _0x3c8dfc(_0x3f84b0){var _0x473711=_0x5ee9;if(_0x532be7[_0x3f84b0])return _0x532be7[_0x3f84b0][_0x473711(_0x5c2996._0x547241)];var _0x20ac55=_0x532be7[_0x3f84b0]={'exports':{},'id':_0x3f84b0,'loaded':!0x1,'prev':function(){return _0x3c8dfc(_0x3f84b0&&_0x3f84b0-0x1);},'next':function(){return _0x3f84b0<len-0x1?_0x3c8dfc(_0x3f84b0+0x1):null;},'first':function(){return _0x3c8dfc(0x0);},'last':function(){return _0x3c8dfc(len-0x1);}};return _0x20ac55[_0x473711(_0x5c2996._0x5b008c)]=!0x0,_0x3c8dfc['i']=_0x3f84b0,_0x54c50a[_0x3f84b0]?_0x54c50a[_0x3f84b0][_0x473711(_0x5c2996._0x27d697)](_0x20ac55,_0x20ac55[_0x473711(_0x5c2996._0x547241)],_0x3c8dfc,_0x3f84b0):_0x47c16a[_0x473711(0x1d2)](_0x20ac55,function(_0x203129){_0x3c8dfc(_0x203129||0x0);},_0x20ac55[_0x473711(0x1d9)],_0x3c8dfc),_0x20ac55['loaded'],_0x20ac55[_0x473711(_0x5c2996._0x4a5944)];}var _0x532be7={};return _0x3c8dfc['m']=_0x54c50a,_0x3c8dfc['c']=_0x532be7,_0x3c8dfc['p']='',_0x3c8dfc(_0x47c16a?_0x6fb610(_0x5c6ff8._0xbc7bb3):0x0);});},'Async':new function(){var _0x3cef44={_0x3443e6:0x1c9,_0x3487ce:0x1c3},_0x6d3272={_0x13b2d7:0x1d5,_0x330d5a:0x201,_0x3fba38:0x1fd},_0x2d35bc={_0xf006a6:0x1f9},_0x2f2b54={_0x54b76a:0x20e,_0x4b7cd1:0x1f8},_0x440fb0=_0x1e8a9a;_0x254677[_0x440fb0(_0x5672f0._0x4fc737)]['call'](this,{'timeoutFilter':function(_0x10933e){var _0x2b89ae=0x0;return _0x10933e=_0x10933e||0x3e8,_0x3eb00f=>{_0x2b89ae&&clearTimeout(_0x2b89ae),_0x2b89ae=setTimeout(_0x3eb00f&&_0x3eb00f||function(){},_0x10933e);};},'timerCtrl':function(_0x507184,_0x4f126b){var _0x484057={_0x17b50a:0x1d2},_0x6952d2={_0x4c5164:0x1d2},_0x3d053c={_0x3b82c2:0x1a4},_0x2b81aa={_0x115fa0:0x1a4,_0x445738:0x1c3,_0x4467b9:0x20e},_0x10dd84=_0x440fb0,_0x134f0a={'timer':_0x507184||0x1388,'name':_0x4f126b,'run':function(_0x1ab9fa){var _0x490615=_0x5ee9;clearTimeout(_0x134f0a[_0x490615(_0x2b81aa._0x115fa0)]),_0x134f0a[_0x490615(0x1a4)]=setInterval(_0x134f0a['fn'][_0x490615(0x1c3)](_0x134f0a[_0x490615(0x20e)]),_0x134f0a['timer']),_0x1ab9fa&&_0x134f0a['fn'][_0x490615(_0x2b81aa._0x445738)](_0x134f0a[_0x490615(_0x2b81aa._0x4467b9)])();}},_0x3b65a7=function(_0x324163){var _0x11cebd={_0x41597c:0x1d1,_0x5cccee:0x213,_0x468080:0x1eb,_0x5c8afc:0x1d7,_0x4fcf35:0x1d2},_0x307028=_0x5ee9;_0x134f0a[_0x307028(0x1eb)]=_0x324163,_0x134f0a[_0x307028(_0x2f2b54._0x54b76a)]=this;var _0x22551d=function(_0xd3dbd,_0x46b80c,_0x559858){var _0x5ac43c=_0x307028;_0x5ac43c(_0x11cebd._0x41597c)==typeof _0xd3dbd&&(_0x134f0a[_0x5ac43c(_0x11cebd._0x5cccee)]=_0x559858,_0x46b80c&&(_0x134f0a[_0x5ac43c(_0x11cebd._0x468080)]=_0x46b80c),_0x134f0a['fn']=_0xd3dbd,_0x134f0a[_0x5ac43c(_0x11cebd._0x5c8afc)][_0x5ac43c(_0x11cebd._0x4fcf35)](this));};return _0x22551d[_0x307028(_0x2f2b54._0x4b7cd1)]=this['__proto__'],_0x22551d;};return _0x3b65a7[_0x10dd84(0x1dd)]={'stop':function(){var _0x1ffa8f=_0x10dd84;_0x134f0a[_0x1ffa8f(_0x3d053c._0x3b82c2)]&&clearInterval(_0x134f0a[_0x1ffa8f(0x1a4)]);},'start':function(_0x379cc8){var _0x24e8e1=_0x10dd84;_0x134f0a['fn']&&_0x134f0a[_0x24e8e1(0x1d7)][_0x24e8e1(_0x6952d2._0x4c5164)](this,_0x379cc8);},'setTime':function(_0x18523a){var _0x953dbf=_0x10dd84;_0x18523a&&(_0x134f0a['timer']=_0x18523a),_0x134f0a['fn']&&_0x134f0a['run'][_0x953dbf(_0x484057._0x17b50a)](this);},'clear':function(){var _0x5e7567=_0x10dd84;_0x134f0a['timerPointer']&&clearInterval(_0x134f0a[_0x5e7567(0x1a4)]),_0x134f0a={'timer':0x1388};}},new _0x3b65a7(_0x507184);},'randomRuntimer':function(_0x49b7e0,_0x4858d4){var _0x3ebd69=_0x440fb0;if(_0x3ebd69(0x1cf)!==this[_0x3ebd69(_0x6d3272._0x13b2d7)]['name'])return Error('Please\x20instance\x20this\x20object\x20first');let _0x271a65={'getDefaultTime':function(){var _0x156b11=_0x3ebd69;return 0x3e8*(0x4+~~(0x6*Math[_0x156b11(0x1a2)]()+0x1));},'nowCallback':!0x1,'firstTimer':null},_0x3916cb=(_0x4858d4=_0x4858d4||_0x271a65)[_0x3ebd69(0x1c8)]||_0x271a65['getDefaultTime'](),_0xba760d=_0x254677['Async'][_0x3ebd69(0x1b2)](0x1388),_0x34badc=new _0x254677[(_0x3ebd69(0x1bd))][(_0x3ebd69(0x1d8))](_0x3916cb,_0x3ebd69(_0x6d3272._0x330d5a));return _0x34badc(function(){var _0x36992b=_0x3ebd69;_0x34badc['stop']();let _0x132755=_0x271a65[_0x36992b(_0x2d35bc._0xf006a6)](),_0x3f0fe2=_0x49b7e0&&_0x49b7e0(_0x132755);!0x1!==_0x3f0fe2&&_0x34badc[_0x36992b(0x1e4)](_0x3f0fe2||_0x132755);}),_0x4858d4['nowCallback']&&_0x34badc[_0x3ebd69(_0x6d3272._0x3fba38)](!0x0),this['run']=function(){_0x34badc['stop'](),_0xba760d(function(){_0x34badc['setTime'](getDefaultTime());});},this;},'timeout':function(_0x3776a3,_0x1151e2){var _0x63411d={_0x5ad406:0x1e7},_0x288153={_0x3e91ba:0x1e7};return _0x1151e2=_0x1151e2||0xbb8,new function(){var _0xcf9ad2=_0x5ee9,_0x4a83c3,_0x40d0ad,_0x515b16;return this[_0xcf9ad2(0x1f8)]={'start':function(_0x1f6925){var _0xad45df=_0xcf9ad2;_0x40d0ad=new Date()[_0xad45df(_0x288153._0x3e91ba)](),_0x4a83c3=setTimeout(function(){_0x1f6925=_0x40d0ad=_0x515b16=0x0,_0x3776a3&&_0x3776a3();},_0x1f6925);},'pause':function(){var _0x287a30=_0xcf9ad2;_0x515b16=new Date()[_0x287a30(_0x63411d._0x5ad406)](),this['clear']();},'continued':function(_0x1ec84d){var _0x418368=_0xcf9ad2;_0x1151e2-=_0x515b16-_0x40d0ad,_0x515b16&&_0x1151e2>0x0&&this[_0x418368(0x1fd)](_0x1ec84d||_0x1151e2);},'clear':function(){clearTimeout(_0x4a83c3);}},this['start'](_0x1151e2),this;}();},'loopList':function(_0x233f45,_0x5540e7,_0x4c286d){var _0x1d1b49={_0x36c349:0x1d2},_0x3018b7=_0x440fb0,_0x217cf2=_0x3018b7(0x1d0)==typeof _0x233f45?Object[_0x3018b7(_0x3cef44._0x3443e6)](_0x233f45):_0x233f45||[],_0xff8bd0=_0x217cf2[_0x3018b7(0x1bb)];(function _0x377dc6(_0x3d7367){_0x3d7367<_0xff8bd0?((()=>{var _0x16376b=_0x217cf2[_0x3d7367];_0x5540e7&&_0x5540e7['call'](this,_0x16376b,_0x233f45[_0x16376b],()=>{var _0x2af5af=_0x5ee9;_0x377dc6[_0x2af5af(0x1d2)](this,++_0x3d7367);},_0x3d7367);})()):((()=>{var _0x290bf0=_0x5ee9;_0x4c286d&&_0x4c286d[_0x290bf0(_0x1d1b49._0x36c349)](this);})());}[_0x3018b7(_0x3cef44._0x3487ce)](this)(0x0));}});}(),'Utils':new function(){return{'generateMixed':function(_0x127c26){var _0x22fc0d=_0x5ee9;for(var _0x12d997=['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'],_0x4a65c3='',_0x5f02e0=0x0;_0x5f02e0<_0x127c26;_0x5f02e0++){_0x4a65c3+=_0x12d997[Math[_0x22fc0d(0x1cc)](0x23*Math[_0x22fc0d(0x1a2)]())];}return _0x4a65c3;},'sessionId':function(){var _0x2684fb=_0x5ee9;return _0x2684fb(0x1b3)[_0x2684fb(0x1a3)](/[xy]/g,function(_0x3d4dc0){var _0x536647=_0x2684fb,_0x37bb18=0x10*Math['random']()|0x0;return('x'==_0x3d4dc0?_0x37bb18:0x3&_0x37bb18|0x8)[_0x536647(0x1f6)](0x10);});}};}()}),_0x3cb080[_0x1e8a9a(0x1e3)](_0x1e8a9a(0x1db),function(){var _0x1ce3dc=_0x1e8a9a;for(var _0x254885=_0x4a6848[_0x1ce3dc(_0x25c4cd._0x18740c)],_0x435be5=0x0;_0x435be5<_0x254885;_0x435be5++)_0x4a6848[_0x435be5][_0x1ce3dc(_0x25c4cd._0x17f0e2)](_0x254677);},!0x1),(_0x254677[_0x1e8a9a(_0x4f7182._0x4bc07f)]['init']=function(_0x44b88a,_0x56ed2a){var _0x1a697b=_0x1e8a9a;return _0x44b88a[_0x1a697b(0x1ac)]?(this[0x0]=_0x44b88a,this[_0x1a697b(0x1bb)]=0x1,this):typeof _0x44b88a==='function'?_0x254677['ready'](_0x44b88a,_0x56ed2a):_0x44b88a;})[_0x1e8a9a(0x1dd)]=_0x254677[_0x1e8a9a(_0x4f7182._0x4bc07f)],_0x254677(function(){},0x1),_0x3cb080['qf']=_0x1d36aa['qf']=_0x254677;}(_0x5c718b));}(_0x5d185f(0x218)!=typeof window?window:this);}]));
\ No newline at end of file
function _0x496d(_0x54e0ae,_0x1c5d36){var _0x2389fc=_0x587d();return _0x496d=function(_0x476bbf,_0x2c9267){_0x476bbf=_0x476bbf-0x11b;var _0x587dca=_0x2389fc[_0x476bbf];return _0x587dca;},_0x496d(_0x54e0ae,_0x1c5d36);}function _0x587d(){var _0x94a737=['attachEvent','exports','3544974YRBFSP','createElement','pid','body','1517761YnAuYx','webkitCancelAnimationFrame','wpr','touchstart','innerHeight','apply','children','parseInt','extend','contentWindow','848338JYHmzx','86280dvHwQT','requestAnimationFrame','constructor','__esModule','140eCYjsQ','clientHeight','286ZMIKgp','catch','mousedown','timerPointer','prototype','webkitRequestAnimationFrame','[[PromiseResult]]','Window\x20object\x20not\x20found!','run','rem;height:','transform','finally','prt','defineProperty','oCancelRequestAnimationFrame','rem;opacity:1','253466sLPkKt','layer','search','px\x200;font-size:','split','3YqHYTe','addEventListener','toStringTag','test','8qeXabM','nodeType','loaded','name','t,webkitT,MozT,msT,OT','charAt','devicePixelRatio','oRequestAnimationFrame','undefined','bind','touchend','appVersion','style','replace','Module','views','706320mFKflM','fontSize','scale(','ontouchstart','call','then','abort','resize','(((.+)+)+)+$','sort','ready','length','dpr','push','height','touchcancel','display:block;width:','object','0\x200','__proto__','timer','isArray','setting','random','document','function','remBase','msCancelRequestAnimationFrame','calcLayout','xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx','touchmove','default','transition','xxxxxxxx','mozRequestAnimationFrame','userAgent','msRequestAnimationFrame','toString','mousemove','toUpperCase','toLowerCase','init','keys','[object\x20Array]','clientWidth','mouseup','readyState','26625PScSAS','[[PromiseState]]','hasOwnProperty','mozCancelRequestAnimationFrame','getElementById','cssText','eval','rejected','join','dprb','envir','transformOrigin'];_0x587d=function(){return _0x94a737;};return _0x587d();}(function(_0x5301ce,_0x374081){var _0x539bdc={_0x56a371:0x15b,_0x2a14c5:0x149,_0x3ffbac:0x174,_0x5ab9a2:0x136,_0x28af6f:0x14b},_0x2a435f=_0x496d,_0x5f0305=_0x5301ce();while(!![]){try{var _0x5b3058=parseInt(_0x2a435f(_0x539bdc._0x56a371))/0x1+-parseInt(_0x2a435f(0x144))/0x2*(-parseInt(_0x2a435f(0x160))/0x3)+parseInt(_0x2a435f(_0x539bdc._0x2a14c5))/0x4*(-parseInt(_0x2a435f(0x128))/0x5)+parseInt(_0x2a435f(_0x539bdc._0x3ffbac))/0x6+-parseInt(_0x2a435f(0x13a))/0x7*(parseInt(_0x2a435f(0x164))/0x8)+-parseInt(_0x2a435f(_0x539bdc._0x5ab9a2))/0x9+parseInt(_0x2a435f(0x145))/0xa*(parseInt(_0x2a435f(_0x539bdc._0x28af6f))/0xb);if(_0x5b3058===_0x374081)break;else _0x5f0305['push'](_0x5f0305['shift']());}catch(_0xbe639){_0x5f0305['push'](_0x5f0305['shift']());}}}(_0x587d,0x36587),!function(_0x22a1e5){var _0x3f7d95={_0x12fa7a:0x12a,_0x10f4fb:0x178},_0xe9910b={_0x336e9e:0x185,_0x4e90a0:0x148},_0x4a870a={_0x9d6463:0x16c,_0x90584b:0x162,_0x48bd19:0x172},_0x347868={_0x13980b:0x178,_0x3b7641:0x135},_0x571734={_0x2b97d2:0x15d,_0x26c35a:0x17c},_0x222da9=(function(){var _0x43bf06=!![];return function(_0x4edeed,_0x410783){var _0x562fe0=_0x43bf06?function(){var _0x375242=_0x496d;if(_0x410783){var _0x4965b5=_0x410783[_0x375242(0x13f)](_0x4edeed,arguments);return _0x410783=null,_0x4965b5;}}:function(){};return _0x43bf06=![],_0x562fe0;};}()),_0x35d817={};function _0x2380d2(_0x3f7612){var _0x3906a1=_0x496d,_0x4b7144=_0x222da9(this,function(){var _0x26bd10=_0x496d;return _0x4b7144[_0x26bd10(0x11e)]()[_0x26bd10(_0x571734._0x2b97d2)](_0x26bd10(0x17c))[_0x26bd10(0x11e)]()['constructor'](_0x4b7144)['search'](_0x26bd10(_0x571734._0x26c35a));});_0x4b7144();if(_0x35d817[_0x3f7612])return _0x35d817[_0x3f7612][_0x3906a1(0x135)];var _0x4c7263=_0x35d817[_0x3f7612]={'i':_0x3f7612,'l':!0x1,'exports':{}};return _0x22a1e5[_0x3f7612][_0x3906a1(_0x347868._0x13980b)](_0x4c7263[_0x3906a1(_0x347868._0x3b7641)],_0x4c7263,_0x4c7263[_0x3906a1(0x135)],_0x2380d2),_0x4c7263['l']=!0x0,_0x4c7263[_0x3906a1(0x135)];}_0x2380d2['m']=_0x22a1e5,_0x2380d2['c']=_0x35d817,_0x2380d2['d']=function(_0x1d8de1,_0x5737f2,_0x4515f3){var _0x31e119=_0x496d;_0x2380d2['o'](_0x1d8de1,_0x5737f2)||Object[_0x31e119(0x158)](_0x1d8de1,_0x5737f2,{'enumerable':!0x0,'get':_0x4515f3});},_0x2380d2['r']=function(_0x25a4ab){var _0x136f1a=_0x496d;_0x136f1a(_0x4a870a._0x9d6463)!=typeof Symbol&&Symbol[_0x136f1a(_0x4a870a._0x90584b)]&&Object['defineProperty'](_0x25a4ab,Symbol[_0x136f1a(0x162)],{'value':_0x136f1a(_0x4a870a._0x48bd19)}),Object['defineProperty'](_0x25a4ab,'__esModule',{'value':!0x0});},_0x2380d2['t']=function(_0x2ca310,_0x21ea12){var _0x5cc6af=_0x496d;if(0x1&_0x21ea12&&(_0x2ca310=_0x2380d2(_0x2ca310)),0x8&_0x21ea12)return _0x2ca310;if(0x4&_0x21ea12&&_0x5cc6af(_0xe9910b._0x336e9e)==typeof _0x2ca310&&_0x2ca310&&_0x2ca310[_0x5cc6af(_0xe9910b._0x4e90a0)])return _0x2ca310;var _0x239fc9=Object['create'](null);if(_0x2380d2['r'](_0x239fc9),Object[_0x5cc6af(0x158)](_0x239fc9,_0x5cc6af(0x193),{'enumerable':!0x0,'value':_0x2ca310}),0x2&_0x21ea12&&'string'!=typeof _0x2ca310){for(var _0x24da86 in _0x2ca310)_0x2380d2['d'](_0x239fc9,_0x24da86,function(_0x31a804){return _0x2ca310[_0x31a804];}[_0x5cc6af(0x16d)](null,_0x24da86));}return _0x239fc9;},_0x2380d2['n']=function(_0x66708b){var _0x3f07c2=_0x66708b&&_0x66708b['__esModule']?function(){return _0x66708b['default'];}:function(){return _0x66708b;};return _0x2380d2['d'](_0x3f07c2,'a',_0x3f07c2),_0x3f07c2;},_0x2380d2['o']=function(_0x12304f,_0x13b72b){var _0x1d29d6=_0x496d;return Object[_0x1d29d6(0x14f)][_0x1d29d6(_0x3f7d95._0x12fa7a)][_0x1d29d6(_0x3f7d95._0x10f4fb)](_0x12304f,_0x13b72b);},_0x2380d2['p']='',_0x2380d2(_0x2380d2['s']=0x0);}([function(_0x25b95c,_0x4d8f91,_0x34b70d){var _0x302764=_0x496d;_0x25b95c[_0x302764(0x135)]=_0x34b70d(0x1);},function(_0x1fb5b6,_0x135f46,_0x4506ee){var _0x5b64b4={_0x3b584:0x18c};!function(_0x46b135,_0x387766){var _0x3bfc2c={_0x1498b4:0x11c,_0x3101a7:0x121,_0x4619ef:0x163,_0x4bd8be:0x177,_0x323c23:0x14d,_0x463f12:0x192,_0x2ac216:0x16e,_0x1cfd32:0x183,_0x1e0ae9:0x126,_0x4db927:0x146,_0x9acceb:0x11b,_0x2495c3:0x16b,_0x3676c3:0x11d,_0x2b8650:0x13b,_0x15e6ce:0x125,_0x257fac:0x139,_0x1d821b:0x16a,_0xab6140:0x14f,_0x1f56c7:0x142,_0x2d73c0:0x142,_0x1476aa:0x161},_0x422219={_0x280db7:0x17f,_0x3580ac:0x178},_0x25bda4={_0x3e6f9e:0x189,_0x488eb4:0x17e},_0x12227f={_0x2e8e8e:0x180,_0x287f3b:0x18a,_0x3b82bf:0x18a,_0x4ea94b:0x18e,_0x3a653a:0x13c,_0x34dcdc:0x17e},_0x2b727c={_0x47483d:0x18a},_0xd0d28c={_0x3bec70:0x18a,_0x10b617:0x131,_0x106789:0x155,_0x39f47e:0x182,_0x5bcb27:0x170},_0x931070={_0x5d06d2:0x132},_0x5a2475={_0x461145:0x141},_0x14c8f0={_0x333b56:0x13e},_0x4613fe={_0x439979:0x13f},_0x3fb04b={_0x35e98f:0x171},_0xd0db21={_0x2c7103:0x124,_0x4f4fa8:0x11e,_0x1c8214:0x178},_0x5b5f76={_0xf6ddc3:0x169},_0x1a957e=_0x496d;if(!_0x46b135[_0x1a957e(_0x5b64b4._0x3b584)])throw new Error(_0x1a957e(0x152));(function(_0x55739d,_0x1494b9){var _0x5a7f26={_0x1f7904:0x17e},_0x1400e3={_0x1ee0a7:0x142},_0x1368d8={_0x5a51a7:0x12c,_0x11ddee:0x173,_0x40ab92:0x184,_0x55273e:0x15a},_0x1cc747={_0x37f63c:0x125,_0x473ff8:0x190},_0x1ed2c0={_0x82a5d4:0x132,_0x3ee92f:0x13c},_0x5ef2d6={_0x493dea:0x163},_0x2e3962={_0x2b7813:0x185},_0x2a41d1={_0x1ca0ff:0x165},_0x1aa684={_0x107578:0x12e,_0x33cf4f:0x178},_0x21eb9a={_0x39851e:0x127},_0x143a5e={_0x26da0f:0x143},_0x1ad6e8={_0x27f314:0x157,_0x449105:0x122},_0x1f140b={_0x33fe3d:0x15f},_0x114188=_0x1a957e,_0x5bc215=document,_0xfff213=_0x5bc215['body'],_0x192bf5=_0x5bc215[_0x114188(0x137)]('div')[_0x114188(0x170)],_0x456b72=(function(){var _0x1b0989=_0x114188;for(var _0x46ffad=_0x1b0989(0x168)[_0x1b0989(_0x1f140b._0x33fe3d)](','),_0x3bab21=0x0,_0x324b46=_0x46ffad[_0x1b0989(0x17f)];_0x3bab21<_0x324b46;_0x3bab21++)if(_0x46ffad[_0x3bab21]+'ransform'in _0x192bf5)return _0x46ffad[_0x3bab21]['substr'](0x0,_0x46ffad[_0x3bab21][_0x1b0989(0x17f)]-0x1);return!0x1;}()),_0x487d4e=function(_0x1d2be1){var _0xfe9dd=_0x114188;return''===_0x456b72?_0x1d2be1:_0x456b72+_0x1d2be1[_0xfe9dd(_0x5b5f76._0xf6ddc3)](0x0)[_0xfe9dd(0x120)]()+_0x1d2be1['substr'](0x1);},_0x59d2a7=(navigator[_0x114188(_0x3bfc2c._0x1498b4)][_0x114188(_0x3bfc2c._0x3101a7)](),_0x487d4e('transform')),_0xb28ccc=(_0x487d4e(_0x114188(0x194)),/hp-tablet/gi[_0x114188(_0x3bfc2c._0x4619ef)](navigator[_0x114188(0x16f)])),_0x1f05f4=_0x114188(_0x3bfc2c._0x4bd8be)in _0x55739d&&!_0xb28ccc,_0x4262c4=_0x1f05f4?_0x114188(0x13d):_0x114188(_0x3bfc2c._0x323c23),_0x442d34=_0x1f05f4?_0x114188(_0x3bfc2c._0x463f12):_0x114188(0x11f),_0x2efc4a=_0x1f05f4?_0x114188(_0x3bfc2c._0x2ac216):_0x114188(0x126),_0xe6eb18=_0x1f05f4?_0x114188(_0x3bfc2c._0x1cfd32):_0x114188(_0x3bfc2c._0x1e0ae9),_0x38f2ff=[],_0x438790=(_0x55739d[_0x114188(_0x3bfc2c._0x4db927)]||_0x55739d[_0x114188(0x150)]||_0x55739d[_0x114188(_0x3bfc2c._0x9acceb)]||_0x55739d[_0x114188(_0x3bfc2c._0x2495c3)]||_0x55739d[_0x114188(_0x3bfc2c._0x3676c3)],_0x55739d['cancelRequestAnimationFrame']||_0x55739d[_0x114188(_0x3bfc2c._0x2b8650)]||_0x55739d['webkitCancelRequestAnimationFrame']||_0x55739d[_0x114188(0x12b)]||_0x55739d[_0x114188(0x159)]||_0x55739d[_0x114188(0x18f)]||clearTimeout,function(_0x49ac0a,_0x5a0e1d){var _0x54c39c=_0x114188;return new _0x438790[(_0x54c39c(_0x1ad6e8._0x27f314))][(_0x54c39c(_0x1ad6e8._0x449105))](_0x49ac0a,_0x5a0e1d);}),_0x148572=_0x5bc215['documentElement'],_0x239734=(_0x148572[_0x114188(_0x3bfc2c._0x15e6ce)]||_0x148572[_0x114188(0x139)]&&_0x148572[_0x114188(_0x3bfc2c._0x257fac)]['clientWidth'],_0x55739d['devicePixelRatio']>=0x2?0x2:_0x55739d[_0x114188(_0x3bfc2c._0x1d821b)]);_0x438790['prt']=_0x438790[_0x114188(_0x3bfc2c._0xab6140)]={'constructor':_0x438790,'splice':[]['splice']},_0x438790[_0x114188(_0x3bfc2c._0x1f56c7)]=function(){var _0x229dd1,_0x4a8e12=arguments[0x0];for(_0x229dd1 in _0x4a8e12)this[_0x229dd1]=_0x4a8e12[_0x229dd1];return this;},_0x438790[_0x114188(0x142)]({'envir':{'dummyStyle':_0x192bf5,'vendor':_0x456b72,'dpr':_0x239734,'hasTouch':_0x1f05f4,'event':{'start':_0x4262c4,'move':_0x442d34,'end':_0x2efc4a,'cancel':_0xe6eb18}},'setting':{'w':0x780,'h':0x438,'mw':0x258,'fs':0xc,'stb':0x5a0,'stw':0x780,'dprb':0x64}}),_0x438790[_0x114188(_0x3bfc2c._0x2d73c0)]({'iframeLoad':function(_0x461c10){var _0xafb1fd=this[0x0];_0xafb1fd['onload']=function(_0x4946d5){var _0x8cb6f0=_0x496d;_0x461c10&&_0x461c10(_0xafb1fd[_0x8cb6f0(_0x143a5e._0x26da0f)],_0x4946d5);};},'ready':function(_0x2c526d,_0x5a29f1){var _0x5e8bde=_0x114188,_0x56e68a=function(){var _0xf52273=_0x496d;_0x5a29f1&&(_0xfff213=_0x5bc215[_0xf52273(0x139)]),_0x438790[_0xf52273(0x127)]=!0x0,_0x2c526d&&_0x2c526d(_0x438790);};_0x438790[_0x5e8bde(_0x21eb9a._0x39851e)]?_0x2c526d&&_0x2c526d(_0x438790):_0x55739d['addEventListener']?_0x55739d['addEventListener']('load',_0x56e68a,!0x1):_0x55739d[_0x5e8bde(0x134)]('onload',_0x56e68a);},'isArray':function(_0x428e7d){var _0xc5214e=_0x114188;return _0x428e7d&&_0xc5214e(_0xd0db21._0x2c7103)===Object[_0xc5214e(0x14f)][_0xc5214e(_0xd0db21._0x4f4fa8)][_0xc5214e(_0xd0db21._0x1c8214)](_0x428e7d);},'trim':function(_0xe39185){var _0x526659=_0x114188;return null==_0xe39185?'':(_0xe39185+'')[_0x526659(_0x3fb04b._0x35e98f)](/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,'');},'eval':function(_0x4c265d){var _0x470303=_0x114188;return new Function('return\x20('+_0x4c265d+')')[_0x470303(0x178)](this);},'dataRender':function(_0x27d539,_0x12815f,_0x120790){var _0x5bc739=_0x114188;return _0x27d539[_0x5bc739(0x171)](/\{{(.+?)\}}/g,function(_0x14b5c8,_0x19bdef){var _0x1d9b05=_0x5bc739;return _0x120790?_0x120790(_0x14b5c8,_0x19bdef):_0x438790[_0x1d9b05(_0x1aa684._0x107578)][_0x1d9b05(_0x1aa684._0x33cf4f)](_0x12815f,_0x19bdef);});},'resize':function(_0x104311){var _0x4f669d=_0x114188;_0x104311&&_0x104311[_0x4f669d(_0x4613fe._0x439979)]&&_0x38f2ff[_0x4f669d(0x181)](_0x104311);},'isElement':function(_0x5bc82d){var _0x37854d=_0x114188;return(_0x37854d(_0x2e3962._0x2b7813)==typeof HTMLElement?function(_0x50e117){return _0x50e117 instanceof HTMLElement;}:function(_0x624520){var _0x58ff8f=_0x37854d;return _0x624520&&0x1===_0x624520[_0x58ff8f(_0x2a41d1._0x1ca0ff)];})(_0x5bc82d);},'isPhoneNum':function(_0x343233){var _0x22fc94=_0x114188;return/^[1][3,4,5,6.7,8,9][0-9]{9}$/[_0x22fc94(_0x5ef2d6._0x493dea)](_0x343233);}}),_0x438790[_0x114188(_0x3bfc2c._0x1f56c7)]({'getWindowHeight':function(){var _0x363b50=_0x114188;return _0x55739d[_0x363b50(_0x14c8f0._0x333b56)]||_0x5bc215[_0x363b50(0x14a)]||_0x148572['clientHeight'];},'parseRem':function(_0x383a95){var _0x58c1b4=_0x114188;return _0x55739d[_0x58c1b4(_0x5a2475._0x461145)](_0x383a95)*this['envir']['remBase'];},'parsePixel':function(_0x31509b){var _0x42dd99=_0x114188;return _0x31509b/this[_0x42dd99(_0x931070._0x5d06d2)][_0x42dd99(0x18e)];},'parseRpx':function(_0x44c7e){var _0x4847ef=_0x114188;return _0x44c7e*this[_0x4847ef(_0x1ed2c0._0x82a5d4)][_0x4847ef(_0x1ed2c0._0x3ee92f)];},'parseWpx':function(_0x20e7f1){var _0x57a36c=_0x114188;return _0x20e7f1/this['envir'][_0x57a36c(0x13c)];},'rpxToRem':function(_0x1d1e38){var _0x30b145=_0x114188;return _0x1d1e38/this[_0x30b145(0x132)]['wpr']*this['envir']['remBase'];},'areaVisualNormal':function(_0x916b24){var _0xd73720=_0x114188,_0x541d8b=this[_0xd73720(_0xd0d28c._0x3bec70)]['dpr'],_0x19d379=this[_0xd73720(0x18a)][_0xd73720(_0xd0d28c._0x10b617)]/_0x541d8b+'%';_0x916b24['style'][_0xd73720(0x133)]=_0xd73720(0x186),_0x916b24['style'][_0xd73720(_0xd0d28c._0x106789)]=_0xd73720(0x176)+_0x541d8b+')',_0x916b24[_0xd73720(0x170)][_0xd73720(_0xd0d28c._0x39f47e)]=_0x19d379,_0x916b24[_0xd73720(0x170)]['width']=_0x19d379,_0x916b24[_0xd73720(_0xd0d28c._0x5bcb27)][_0xd73720(0x175)]=this[_0xd73720(_0xd0d28c._0x3bec70)]['fs']+'px';},'openCalcLayout':function(_0x54cdc4){var _0x19b46a=_0x114188;this[_0x19b46a(0x18a)]['dpr']=_0x54cdc4&&_0x54cdc4['dpr']||_0x239734;var _0x16064f=this[_0x19b46a(_0x2b727c._0x47483d)]['h']/this[_0x19b46a(0x18a)]['w'],_0x30f336=this['setting']['mw'],_0x4dc8be=function(){var _0x5cf930=_0x19b46a,_0x5e2e2c=_0x148572[_0x5cf930(_0x1cc747._0x37f63c)]>_0x30f336?_0x148572['clientWidth']:_0x30f336,_0x59a6d1=_0x5e2e2c*_0x16064f;_0x438790[_0x5cf930(_0x1cc747._0x473ff8)](_0x59a6d1,_0x5e2e2c);};_0x4dc8be(),this['resize'](_0x4dc8be);},'calcLayout':function(_0x1c299d,_0x28abe5){var _0x4a63e6=_0x114188;if(_0x28abe5){var _0x1173ed=this['setting'][_0x4a63e6(_0x12227f._0x2e8e8e)],_0x94f8=this['setting']['fs']*_0x1173ed,_0x55317c=this[_0x4a63e6(_0x12227f._0x287f3b)]['w'],_0x2c2d4b=_0x55317c/this[_0x4a63e6(_0x12227f._0x3b82bf)]['dprb'],_0x3b5090=_0x2c2d4b/_0x55317c,_0xd58388=0x1/_0x1173ed,_0x46ff90=_0x28abe5-_0x55317c,_0x3642e6=_0x46ff90>0x0?_0x55317c:!(_0x46ff90=0x0)&&_0x28abe5;this[_0x4a63e6(0x132)][_0x4a63e6(_0x12227f._0x4ea94b)]=_0x3b5090,this[_0x4a63e6(0x132)][_0x4a63e6(_0x12227f._0x3a653a)]=_0x3642e6/_0x55317c*_0x1173ed,_0x148572['style']['fontSize']=this['setting']['dprb']*(_0x3642e6/_0x55317c)*_0x1173ed+'px';var _0x137054=function(){var _0x4e8920=_0x4a63e6;(document[_0x4e8920(_0x1368d8._0x5a51a7)](_0x4e8920(_0x1368d8._0x11ddee))||_0xfff213)[_0x4e8920(0x170)][_0x4e8920(0x12d)]=_0x4e8920(_0x1368d8._0x40ab92)+_0x2c2d4b+_0x4e8920(0x154)+0x64*_0x1173ed+'%;'+_0x59d2a7+':scale('+_0xd58388+');'+_0x59d2a7+'-origin:'+_0x46ff90+_0x4e8920(0x15e)+_0x3b5090*_0x94f8+_0x4e8920(_0x1368d8._0x55273e);};_0xfff213?_0x137054():_0x438790[_0x4a63e6(_0x12227f._0x34dcdc)](_0x137054);}}}),_0x438790[_0x114188(_0x3bfc2c._0x2d73c0)]({'funchain':function(_0x5f0825,_0x45e075){var _0x427ff5={_0x5b32f5:0x122},_0x52d917={_0x4f1bc3:0x178,_0x5a1c3b:0x135,_0x3ed3b0:0x166,_0x2cfca4:0x135},_0x1b95a5=_0x114188;_0x45e075=_0x438790[_0x1b95a5(_0x25bda4._0x3e6f9e)](_0x45e075)?_0x45e075:[_0x5f0825,[]][_0x438790[_0x1b95a5(0x189)](_0x5f0825)?~~(_0x5f0825=void 0x0):0x1],len=_0x45e075['length'],_0x438790[_0x1b95a5(_0x25bda4._0x488eb4)](function(){var _0x3ae403=_0x1b95a5;function _0x4244ca(_0x144ad4){var _0x36b364=_0x496d;if(_0x2d9c49[_0x144ad4])return _0x2d9c49[_0x144ad4][_0x36b364(0x135)];var _0x5f4f21=_0x2d9c49[_0x144ad4]={'exports':{},'id':_0x144ad4,'loaded':!0x1,'prev':function(){return _0x4244ca(_0x144ad4&&_0x144ad4-0x1);},'next':function(){return _0x144ad4<len-0x1?_0x4244ca(_0x144ad4+0x1):null;},'first':function(){return _0x4244ca(0x0);},'last':function(){return _0x4244ca(len-0x1);}};return _0x5f4f21['loaded']=!0x0,_0x4244ca['i']=_0x144ad4,_0x45e075[_0x144ad4]?_0x45e075[_0x144ad4][_0x36b364(_0x52d917._0x4f1bc3)](_0x5f4f21,_0x5f4f21['exports'],_0x4244ca,_0x144ad4):_0x5f0825[_0x36b364(0x178)](_0x5f4f21,function(_0x2b2ea8){_0x4244ca(_0x2b2ea8||0x0);},_0x5f4f21[_0x36b364(_0x52d917._0x5a1c3b)],_0x4244ca),_0x5f4f21[_0x36b364(_0x52d917._0x3ed3b0)],_0x5f4f21[_0x36b364(_0x52d917._0x2cfca4)];}var _0x2d9c49={};return _0x4244ca['m']=_0x45e075,_0x4244ca['c']=_0x2d9c49,_0x4244ca['p']='',_0x4244ca(_0x5f0825?_0x3ae403(_0x427ff5._0x5b32f5):0x0);});},'Async':new function(){var _0x19d9c3={_0x34e401:0x129,_0x2b0834:0x187,_0x4cfe19:0x179,_0xc432ed:0x156,_0x2d7e80:0x17a},_0x29e129={_0x4e1960:0x14c},_0x2ddd2a={_0x4cfea2:0x17f,_0x588cce:0x16d},_0x3c1b82={_0x501b8c:0x153,_0x205bd7:0x178},_0x4f4375={_0x4ef553:0x14e},_0x370992=_0x114188;_0x438790[_0x370992(_0x1400e3._0x1ee0a7)]['call'](this,{'timeoutFilter':function(_0x26e911){var _0x2eed15=0x0;return _0x26e911=_0x26e911||0x3e8,_0x3490cf=>{_0x2eed15&&clearTimeout(_0x2eed15),_0x2eed15=setTimeout(_0x3490cf&&_0x3490cf||function(){},_0x26e911);};},'timerCtrl':function(_0x36f54d,_0x29e09d){var _0x23a567={_0x25b110:0x14e},_0x1dd5c0={_0x24009a:0x153},_0x179991={_0x167ef0:0x188,_0x594acb:0x15c},_0x549a11={_0x38d39d:0x14e,_0x393c06:0x15c,_0x48e5db:0x16d},_0x536e16={'timer':_0x36f54d||0x1388,'name':_0x29e09d,'run':function(_0x3a0603){var _0x24b206=_0x496d;clearInterval(_0x536e16['timerPointer']),_0x536e16[_0x24b206(_0x549a11._0x38d39d)]=setInterval(_0x536e16['fn'][_0x24b206(0x16d)](_0x536e16[_0x24b206(_0x549a11._0x393c06)]),_0x536e16[_0x24b206(0x188)]),_0x3a0603&&_0x536e16['fn'][_0x24b206(_0x549a11._0x48e5db)](_0x536e16[_0x24b206(0x15c)])();}},_0x15a99c=function(_0x468e4f){var _0x5b4374={_0x4a594a:0x167,_0x3bd9af:0x188},_0x21d996=_0x496d;_0x536e16[_0x21d996(_0x179991._0x167ef0)]=_0x468e4f,_0x536e16[_0x21d996(_0x179991._0x594acb)]=this;var _0x5d1107=function(_0x419c93,_0x30ca81,_0x4a39b5){var _0x217b25=_0x21d996;_0x217b25(0x18d)==typeof _0x419c93&&(_0x536e16[_0x217b25(_0x5b4374._0x4a594a)]=_0x4a39b5,_0x30ca81&&(_0x536e16[_0x217b25(_0x5b4374._0x3bd9af)]=_0x30ca81),_0x536e16['fn']=_0x419c93,_0x536e16[_0x217b25(0x153)][_0x217b25(0x178)](this));};return _0x5d1107['__proto__']=this['__proto__'],_0x5d1107;};return _0x15a99c['prototype']={'stop':function(){var _0xec4047=_0x496d;_0x536e16[_0xec4047(_0x4f4375._0x4ef553)]&&clearInterval(_0x536e16['timerPointer']);},'start':function(_0x5cab29){var _0x2c22d4=_0x496d;_0x536e16['fn']&&_0x536e16[_0x2c22d4(_0x1dd5c0._0x24009a)][_0x2c22d4(0x178)](this,_0x5cab29);},'setTime':function(_0x2d96e9){var _0xcbf590=_0x496d;_0x2d96e9&&(_0x536e16['timer']=_0x2d96e9),_0x536e16['fn']&&_0x536e16[_0xcbf590(_0x3c1b82._0x501b8c)][_0xcbf590(_0x3c1b82._0x205bd7)](this);},'clear':function(){var _0x4a66b5=_0x496d;_0x536e16[_0x4a66b5(0x14e)]&&clearInterval(_0x536e16[_0x4a66b5(_0x23a567._0x25b110)]),_0x536e16={'timer':0x1388};}},new _0x15a99c(_0x36f54d);},'loopList':function(_0x2233b0,_0x4850e9,_0x5b46df){var _0x560e64={_0xe4efec:0x178},_0x133930={_0x3dd7f3:0x178},_0x25d29f=_0x370992,_0x19eddb='object'==typeof _0x2233b0?Object[_0x25d29f(0x123)](_0x2233b0):_0x2233b0||[],_0x7d0ae2=_0x19eddb[_0x25d29f(_0x2ddd2a._0x4cfea2)];(function _0x14af2d(_0x5caec2){var _0xec87e4={_0xf351ee:0x178};_0x5caec2<_0x7d0ae2?((()=>{var _0x24ec9a=_0x496d,_0x1d687d=_0x19eddb[_0x5caec2];_0x4850e9&&_0x4850e9[_0x24ec9a(_0x133930._0x3dd7f3)](this,_0x1d687d,_0x2233b0[_0x1d687d],()=>{var _0x3b195d=_0x24ec9a;_0x14af2d[_0x3b195d(_0xec87e4._0xf351ee)](this,++_0x5caec2);},_0x5caec2);})()):((()=>{var _0x43ebf4=_0x496d;_0x5b46df&&_0x5b46df[_0x43ebf4(_0x560e64._0xe4efec)](this);})());}[_0x25d29f(_0x2ddd2a._0x588cce)](this)(0x0));},'Promise':function(_0x2c7f26){var _0x5205f2={_0x3c09f2:0x12f},_0x2eec8c={_0x581754:0x147},_0x4ca635={_0x2c686c:0x12f},_0x58b083=_0x370992;let _0x13a97a=_0x58b083(0x158),_0x28e54a=_0x58b083(0x151),_0x455bf4=_0x58b083(_0x19d9c3._0x34e401),_0x5c4694=new Promise(function(_0xf67463,_0x1e7fd5){_0x2c7f26['abort']=function(){var _0x10097c=_0x496d;_0x1e7fd5(arguments[0x0]),Object[_0x13a97a](_0x3a7775,_0x455bf4,{'value':_0x10097c(_0x4ca635._0x2c686c),'writable':!0x0});},_0x2c7f26(_0xf67463,_0x1e7fd5);}),_0x3a7775=new function(){var _0x40829a=_0x58b083;this[_0x40829a(0x187)]['constructor']=_0x5c4694[_0x40829a(_0x2eec8c._0x581754)];}(),_0x1c1a7b=_0x3a7775[_0x58b083(_0x19d9c3._0x2b0834)];return Object[_0x13a97a](_0x1c1a7b,_0x58b083(_0x19d9c3._0x4cfe19),{'value':function(){let _0x2b3511=arguments[0x0];return _0x5c4694=_0x5c4694['then'](async function(){var _0x353397=_0x496d;if(_0x353397(_0x5205f2._0x3c09f2)!==_0x3a7775[_0x455bf4]){var _0x17dbe3=await _0x2b3511(_0x3a7775[_0x28e54a]||arguments[0x0]);return Object[_0x13a97a](_0x3a7775,_0x28e54a,{'value':_0x17dbe3||_0x3a7775[_0x28e54a],'writable':!0x0}),_0x17dbe3;}},function(_0x20022a){}),_0x3a7775;}}),Object[_0x13a97a](_0x1c1a7b,_0x58b083(0x14c),{'value':function(){var _0x122086=_0x58b083;return _0x5c4694[_0x122086(_0x29e129._0x4e1960)](arguments[0x0]),_0x3a7775;}}),Object[_0x13a97a](_0x1c1a7b,_0x58b083(_0x19d9c3._0xc432ed),{'value':function(){let _0x4a2722=arguments[0x0];return _0x5c4694['finally'](function(){return _0x4a2722&&_0x4a2722(),_0x3a7775;}),_0x3a7775;}}),Object[_0x13a97a](_0x1c1a7b,_0x58b083(_0x19d9c3._0x2d7e80),{'value':_0x2c7f26[_0x58b083(_0x19d9c3._0x2d7e80)]}),_0x3a7775;}});}(),'Utils':new function(){var _0x5daabd={_0x3dbfcb:0x123,_0x224e3e:0x17d};return{'UUID':function(){var _0x36db59={_0x310484:0x11e},_0x5adc2e=_0x496d;return _0x5adc2e(0x191)[_0x5adc2e(0x171)](/[xy]/g,function(_0xcf846a){var _0x2f23ab=_0x5adc2e,_0x117881=0x10*Math[_0x2f23ab(0x18b)]()|0x0;return('x'==_0xcf846a?_0x117881:0x3&_0x117881|0x8)[_0x2f23ab(_0x36db59._0x310484)](0x10);});},'Guid':function(_0x2d8672,_0x282269){var _0x35a260={_0x3fc61b:0x18b},_0x3b7ca7=_0x496d;return(_0x2d8672||'')+(_0x282269?new Array(_0x282269+0x1)[_0x3b7ca7(0x130)]('x'):_0x3b7ca7(0x195))['replace'](/[xy]/g,function(_0x41625a){var _0x20ae91=_0x3b7ca7,_0x910dac=0x10*Math[_0x20ae91(_0x35a260._0x3fc61b)]()|0x0;return('x'==_0x41625a?_0x910dac:0x3&_0x910dac|0x8)[_0x20ae91(0x11e)](0x10);});},'treeListBuild':function(_0x421983){var _0x2b65e5=_0x496d;for(var _0x385a23={},_0x53c2c5={},_0x12aaed=_0x421983[_0x2b65e5(0x17f)],_0x4e5d0b=0x0;_0x4e5d0b<_0x12aaed;_0x4e5d0b++){_0x385a23[~~(_0x151852=_0x421983[_0x4e5d0b])['pid']]=_0x53c2c5[_0x151852['id']]=_0x151852;}for(var _0x151852 of _0x421983){var _0x21e8d2=_0x53c2c5[_0x151852[_0x2b65e5(0x138)]];if(_0x21e8d2){var _0x1ed75d=_0x21e8d2['children'];_0x21e8d2[_0x2b65e5(0x140)]=_0x1ed75d&&_0x1ed75d[_0x2b65e5(0x181)](_0x151852)&&_0x1ed75d||[_0x151852];}}return _0x53c2c5=null,_0x385a23[Object[_0x2b65e5(_0x5daabd._0x3dbfcb)](_0x385a23)[_0x2b65e5(_0x5daabd._0x224e3e)]()[0x0]];}};}()}),_0x55739d[_0x114188(_0x3bfc2c._0x1476aa)](_0x114188(0x17b),function(){var _0x15755c=_0x114188;for(var _0x5ac4e7=_0x38f2ff[_0x15755c(_0x422219._0x280db7)],_0x22595d=0x0;_0x22595d<_0x5ac4e7;_0x22595d++)_0x38f2ff[_0x22595d][_0x15755c(_0x422219._0x3580ac)](_0x438790);},!0x1),(_0x438790['prt']['init']=function(_0x4be45c,_0x10dd02){var _0xc7d12=_0x114188;return _0x4be45c[_0xc7d12(0x165)]?(this[0x0]=_0x4be45c,this['length']=0x1,this):typeof _0x4be45c==='function'?_0x438790[_0xc7d12(_0x5a7f26._0x1f7904)](_0x4be45c,_0x10dd02):_0x4be45c;})[_0x114188(0x14f)]=_0x438790[_0x114188(0x157)],_0x438790(function(){},0x1),_0x55739d['qf']=_0x135f46['qf']=_0x438790;}(_0x46b135));}('undefined'!=typeof window?window:this);}]));
\ No newline at end of file
/*
name: qf_web_ui
version: V1.106
version: V1.157
*/
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},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,n=window;new function(){var n={createStyle:function(e,t){var n=document.createElement("style");return n.type="text/css",n.id=e||"kmb-popmd-e3d8-css",t?t.appendChild(n):document.head.appendChild(n),n},getSheets:function(e,t){return(document.getElementById(e||"kmb-popmd-e3d8-css")||this.createStyle(e,t)).sheet},setSheets:function(e,t,n,o){var i=o||this.getSheets();i&&(i.insertRule?i.insertRule(e+"{"+t+"}",n):i.addRule(e,t,n))}};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:"",o=t?'<div class="qfui-message-box el-message-box__header"><div class="el-message-box__title">'+t+"</div></div>":"",i=e.confirm,r="[object Function]"===Object.prototype.toString.call(i)?'<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">'+o+'<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,o=function(){var e=t.scrollHeight-t.offsetHeight;return{dist:e,apex:e*((a+1)/2)}},i=function(){return Math.abs(t.scrollTop-1)-t.scrollTop},r=0,a=i(),s=o();function l(){t.scrollTop*a>=s.apex?(cancelAnimationFrame(n),a=i(),s=o(),l()):(t.scrollTop=r,r+=.3333*a,n=window.requestAnimationFrame(l))}t.scrollHeight>t.offsetHeight&&l(),t.onmousedown=function(){cancelAnimationFrame(n)},t.onmouseup=function(e){e.target.className.match("scrolling4")&&(r=e.target.scrollTop),l()},e.resize((function(){var e=s.dist/(s=o()).dist;t.scrollTop=r/=e}))},Notify:function(n){var o=this,i={close:!0},r=(n=n||{}).duration||2e4,a=n.title||"提示",s=n.type||"warning",l=n.message||"提示内容!",c=n.position||"bottom";return this.__proto__={open:function(u){u=u||{},i.ctn=i.ctn||document.createElement("div"),i.ctn.className="el-notification right el-notification-fade-enter el-notification-fade-leave-active",i.ctn.style=c+":16px;z-index:2000;",i.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(i.ctn),setTimeout((function(){i.ctn.classList.remove("el-notification-fade-enter","el-notification-fade-leave-active")}),100),i.timer=e.Async.timeout((function(){o.close()}),r),i.ctn.onclick=function(e){var t=e.target||e.srcElement;t.classList.contains("el-icon-close")?o.close():n.onClick&&n.onClick(t)},i.ctn.addEventListener("mouseenter",(function(){!i.await&&i.timer.pause()}),!1),i.ctn.addEventListener("mouseleave",(function(){!i.await&&i.timer.continued()}),!1)},close:function(e){i.close&&(i.await=!0,i.ctn.classList.add("el-notification-fade-leave-active"),i.timer.clear(),setTimeout((function(){t.removeChild(i.ctn),!e&&n.onClose&&n.onClose()}),200),delete i.close)},pause:function(){i.await=!0,i.timer.pause()},recover:function(){i.timer.continued(),i.await=!1}},n.autoOpen&&this.open(),this},popWindow:function(t){var n=t.zIndex||2023,o=t.backgroundColor||"rgba(0,0,0,.5)",i=t.html||'<div class="kmbbase-wrap"></div>',r=t.baselayerClass?" "+t.baselayerClass:"",a=t.moudelClass?" "+t.moudelClass:"",s=(t.coverTarget,t.container||document.body),l=t.name||"",c=t.id||e.getGuid();return function(){var u=this;u.utils={createPoint:function(t,n){if("Object"===n.constructor.name&&n.show){var o=e.extend.call({size:12,point:"top",x:0,y:0,borderColor:"#3EB7EA",background:"rgba(0,0,0,.9)"},n||{}),i=o.size||12,r=o.point||"top",a=o.x||0,s=o.y||0,l=o.borderColor||"#3EB7EA",c=o.background||"rgba(0,0,0,.9)",u=0-i/2,d=~~Math.sqrt(i*i*2)-i-1,p="left",m="top",f=d,h=u,v=45;"left"===r||"right"===r?(f=u,h=d,v="right"===r?(p="right")&&135:-45):"bottom"===r&&(m="bottom",v=225);var g=~~(i+2)+"px",b='content:"";position:absolute;'+(m+":"+(h+s)+"px")+";"+(p+":"+(f+a)+"px")+";height:"+i+"px;width:"+i+"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)}},appendClose:function(e){var n=t.closeButton,o="Object"===n.constructor.name?n:{horizontal:"right",vertical:"top"},i=o.vertical||"top",r=o.horizontal||"right",a=document.createElement("i");a.innerText="",a.className="close",a.style.cssText="position:absolute;"+i+":-.13rem;"+r+":-.13rem;height:.26rem;width:.26rem;font-style:normal;font-size:.30rem;font-weight:100;border:1px solid #3EB7EA;line-height:1;display:flex;justify-content:center;align-items:center;border-radius:.20rem;transform:rotate(45deg);background:rgba(0,0,0,.5);cursor:pointer;color:#3EB7EA;",e.appendChild(a)}};var d,p,m=(d=s,(p=function(){var s,p,m=this,f=this.Wrap=(s=document.createElement("div"),p=e.getGuid("k")+a,s.className="kmb-popmd-e3d8 "+p,s.style.cssText="position:absolute;display:none;",s.innerHTML=i,s),h=t.cover?this.parent=function(){var e=document.getElementById(t.id||"kmbBaseLayer_e3d8")||document.createElement("div");e.id=t.id||"kmbBaseLayer_e3d8",e.className="kmb-basepopuplayer"+r;var i=t.coverFull?"width:100%;":"";return e.style.cssText="position:fixed;top:0;left:0;width:0;height:100%;"+i+"z-index:"+n+";background-color:"+o+";display:flex;align-items:center;",e}().appendChild(f).parentNode:f;d.appendChild(h),this.el=this.Wrap.firstElementChild||this.Wrap,this.container=h,this.parent=this.parent||d,this.id=c,this.name=l,h.onclick=function(e){var n=e.target||e.srcElement;t.onclick&&t.onclick(e),t.closeEvent&&n.classList.contains("close")&&m.remove(e)},t.pointer&&u.utils.createPoint(this.Wrap,t.pointer),t.closeButton&&(t.closeEvent=!0)&&u.utils.appendClose(this.Wrap),this.open()}).prototype={open:function(){this.Wrap.style.display="block",this.show=!0},close:function(){this.Wrap.style.display="none",this.show=!1,t.close&&t.close()},remove:function(e){this.Wrap.remove(),this.show=!1,d!==this.parent&&!this.parent.firstElementChild&&d.removeChild(this.parent),t.close&&t.close(e)},setStyle:function(e,t){Object.assign((e||this.Wrap).style,t)}},new p);this.prototype={};var f=new this;return f.el=m.container,f.id=c,f.name=l,t.onload&&t.onload(m),m.container===m.Wrap?m:f}.call((function(){}))},checkListRender:function(t){var n=(t=t||{}).list||[],o=t.select||[],i=t.type||"radio",r="radio"===i?'name="'+e.getGuid("k")+'" ':"",a="",s=(document.createElement("div"),function(e){for(var t of o)return e===t});for(var l of n){var c=l[t.name||"name"],u=l[t.value||"value"];a+='<dd><label style="display:flex;user-select:none;cursor:pointer;"><span style="display:flex;"><input type="'+i+'" '+(s(u)?'checked="true"':"")+' value="'+u+'" '+r+' data-name="'+c+'"></span><span class="el-'+i+'__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 o=t.length,i="",r=0;r<o;r++){var a=t[r];i+='<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=i,n.onload&&n.onload(e.options[0]&&e.options[0].value),e},progressBar:function(t){t=t||{};var o=this;return e.UI.popWindow({name:"div_1",cover:!0,html:'<div class="progress" style="width:7rem;"><div class="progress-bar" style="width:0%">0</div></div>',onload:function(e){var i=n.getSheets("progressStyle",e.Wrap);n.setSheets(".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),n.setSheets(".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),n.setSheets("@keyframes progress-bar-stripes","from{background-position:40px 0}to{background-position:0 0}",2,i),n.setSheets("@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+"%"},o.model=e}}),o.model}}),e.UI=this},new function(){(e.Async||this).__proto__={intervalLoop:function(e,t,n){var o=function(e,t,n){t&&t(),this.timer=setInterval((function(){n?n():t()}),e||3e3)};return o.prototype={clear:function(){clearInterval(this.timer)}},"function"==typeof t?new o(e,t,n):console.log("intervalLoop param must contain function")},timeout:function(e,t){return t=t||3e3,new function(){var n,o,i;return this.__proto__={start:function(t){o=(new Date).getTime(),n=setTimeout((function(){t=o=i=0,e&&e()}),t)},pause:function(){
!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=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 i.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,t.scrollHeight-t.offsetHeight<n&&(this.flag=this.getPointer(),this.boundary=this.getBoundary()),n+=.3333*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 i(t).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.moudelClass?" "+e.moudelClass:"",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.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),u=e.cover?this.parent=r(e).appendChild(c).parentNode:c;n.appendChild(u),this.el=this.Wrap.firstElementChild||this.Wrap,this.container=u,this.parent=this.parent||n,this.id=s,this.name=a,u.onclick=function(t){t.target||t.srcElement,e.click&&e.click(t)},this.open()}).prototype={open:function(){this.Wrap.style.display="block",this.show=!0},close:function(){this.Wrap.style.display="none",this.show=!1,e.close&&e.close()},remove:function(t){this.Wrap.remove(),this.show=!1,n!==this.parent&&!this.parent.firstElementChild&&n.removeChild(this.parent),e.close&&e.close(t)},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()
i=(new Date).getTime(),this.clear()},continued:function(e){t-=i-o,i&&t>0&&this.start(e||t)},clear:function(){clearTimeout(n)}},this.start(t),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(o,i){t.$nextTick(()=>{var t=i.$el._prevClass,n=[];if(t.match("el-select"))if(i.selected[0])for(var o of i.selected)n.push({name:o.label,value:o.value});else n={name:i.selectedLabel,value:i.value};else if(t.match("el-radio-group")){var r=i.$children;for(var a of r)a.$el.ariaChecked&&(n={name:a.$el.innerText,value:i.value})}else if(t.match("el-checkbox-group")){r=i.$children;for(var a of r)a.isChecked&&n.push({name:a.$el.innerText,value:a.label})}e&&e.call(this,i.value,n,i.hoverIndex)}),n.config.errorHandler=null}.bind(this);var o=new Promise((function(e,t){}));return o.catch=function(e,t,n){e(Error)},o},render:function(e){var t=n.__VUE_HOT_MAP__,o=(this.toString.$state||{})._vm||this;return new(t?t[Object.keys(t)[0]].Ctor.super:o.$root.constructor)({el:e.el,data:{[e.datakey]:e.dataType||void 0},render:function(t){var n=this,o=n._self._c,i=JSON.stringify(e.attrs),r={style:e.style,attrs:JSON.parse(i),on:{change:e.change||""},model:{value:n._self[e.datakey],callback:function(t){n.$set(n._self,e.datakey,t)}}};return o(e.name,r)}})}},e.Vue=t},new function(){var t=e.Event||this;t.__proto__={eventRegister:function(e){var t,n,o,i=e.eventEl,r=!e.event,a=function(e,t){i.addEventListener(e,t,!1)},s=function(e,t){i.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(i){t=i.pageX,n=i.pageY,i.timeStamp-o<280&&this.sX===t&&this.sY===n?(this.isDb=!this.isDb,clearTimeout(this.timeout),e.dblclick&&e.dblclick(i)):e.start&&e.start(i),this.sX=t,this.sY=n,o=i.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-o<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},new function(){var t=e.Utils||this;t.__proto__={Dates:function(e){return{format:function(t){var n=e?new Date(e):new Date,o={"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 i 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()+""])),o)new RegExp("("+i+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?o[i]:("00"+o[i]).substr((""+o[i]).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 o={};if(e[0]&&e.push)for(var i of e)o[i[t||"id"]]=n&&i[n]||i;return o},imageToBase64:function(e,t,n){var o=function(e,t){var n=new Image;n.src=e,n.crossOrigin="*",n.onerror=function(){new Error("图片加载失败")},n.onload=function(){var e=n.width,o=n.height;return t(function(e,t,n){var o=document.createElement("canvas");o.width=t,o.height=n;var i=o.getContext("2d");i.fillStyle="transparent",i.fillRect(0,0,t,n),i.drawImage(e,0,0,t,n);var r={};return r.base64=o.toDataURL("image/jpeg",.7),r.base64Len=r.base64.length,o=null,r}(n,e,o),n=null)}},i=e&&e.files[0];return new Promise((n,r)=>{if(!(i.name.indexOf(".jpg")>0||i.name.indexOf(".png")>0))return e.value="",r({type:4,msg:"图片文件类型不正确!"});var a="string"==typeof i?i:URL.createObjectURL(i);o(a,(function(e){return e.base64Len?t&&t(e)||n(e):r(e)}))})},strAverageCut:function(e,t){for(var n=e.length,o=~~(n/(t=(t>n?n:t)||1)),i=n%t,r=[],a=0,s=0;s<t;s++){var l=o+~~(s<i);r[s]=e.substr(a,l),a+=l}return r},getRandomColor:function(e){for(var t=this.strAverageCut(e,3),n=0,o=t.length;n<o;n++)t[n]=(parseInt(t[n],16)>>16&255)/255;return t}},e.Utils=t}}(qf)}]);
\ No newline at end of file
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
......@@ -76,6 +76,7 @@ module.exports = {
'^/weather': '/'
}
},
// 青柿
'/liveQing': {
target: 'http://39.164.225.220:5008/', // 真实请求URl
changeOrigin: true, // 允许跨域
......@@ -83,6 +84,14 @@ module.exports = {
'^/liveQing': '/'
}
},
// 安全帽
/* '/hat': {
target: 'https://caps.runde.pro/', // 真实请求URl
changeOrigin: true, // 允许跨域
pathRewrite: { // 替换,通配/api的替换成/
'^/hat': '/'
}
}, */
}
},
configureWebpack: {
......
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