@wibetter/json-utils 5.2.10 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +2236 -2208
- package/dist/index.esm.min.js +4522 -2
- package/dist/index.js +1600 -1
- package/dist/index.js.LICENSE.txt +2 -2
- package/package.json +1 -1
package/dist/index.esm.min.js
CHANGED
|
@@ -1,4 +1,1113 @@
|
|
|
1
|
-
import{cloneDeep as e,isEqual as t,truncate as r}from"lodash";import n from"qs";var i,o={type:"event",title:"事件",isContainer:!1,properties:{type:{default:"emit",type:"select",options:[{label:"on",value:"on"},{label:"emit",value:"emit"}],title:"事件类型"},trigger:{type:"input",default:"eventName",title:"触发事件",description:"用于输入触发事件的名称",placeholder:"请输入触发事件的名称"},eventData:{title:"事件数据",type:"json",default:"{}",description:"传递给触发事件的数据对象"}},propertyOrder:["type","trigger","eventData"]},a={type:"datasource",title:"数据源",isContainer:!1,properties:{type:{default:"local",type:"select",options:[{label:"本地数据",value:"local"},{label:"接口数据",value:"remote"}],title:"数据源类型"},data:{title:"本地json数据",placeholder:"请输入静态json数据",type:"json",default:"{}",description:"用于设置本地的静态json数据",isRequired:!0},filter:{title:"过滤器",type:"codearea",default:"() => {}",description:"用于定义过滤当前数据的函数",isRequired:!0}},propertyOrder:["type","data","filter"]},s=((i={type:"object"}).type="datasource",i.title="数据源",i.isContainer=!1,i.properties={type:{type:"select",default:"remote",options:[{label:"本地数据",value:"local"},{label:"接口数据",value:"remote"}],title:"数据源类型"},data:{type:"url",title:"远程json数据",placeholder:"请输入远程json数据源地址",default:"http://xxx",isRequired:!0,description:"用于设置获取元素数据的请求地址"},filter:{type:"codearea",title:"过滤器",default:"() => {}",description:"用于定义过滤当前数据的函数",isRequired:!0}},i.propertyOrder=["type","data","filter"],i),l={type:"local",config:{dataName:"",body:{},filter:"return data;"},data:"{}",localFilter:"return data;"},u={jsonschema:{type:"object",title:"jsonSchemaObject",properties:{func:{type:"object",title:"功能设置",properties:{a:{title:"单文本框",type:"input",default:"",description:"",placeholder:"",isRequired:!1}},propertyOrder:["a"]},style:{type:"object",title:"样式设置",properties:{b:{title:"单文本框",type:"input",default:"",description:"",placeholder:""}},propertyOrder:["b"]},data:{type:"data",title:"数据设置",properties:{c:{title:"单文本框",type:"input",default:"",description:"",placeholder:"",isRequired:!1}},propertyOrder:["c"]}},propertyOrder:["func","style","data"]},input:{title:"单文本框",type:"input",default:"",description:"",placeholder:""},boolean:{type:"boolean",title:"布尔值",default:!1,description:""},object:{type:"object",title:"对象Object",description:"",properties:{a:{type:"input",title:"单文本框",default:"",description:"",placeholder:""}},propertyOrder:["a"]},array:{type:"array",title:"数组Array",description:"",items:{type:"object",title:"数组项",description:"",properties:{name:{type:"input",title:"名字",default:"",description:"",placeholder:""}},propertyOrder:["name"]}},"empty-array":{type:"array",title:"数组Array",description:"",default:[],items:{type:"object",title:"数组项",description:"",properties:{}}},"empty-object":{type:"object",title:"对象Object",description:"",properties:{}},url:{type:"url",title:"链接地址url",default:"",description:"",placeholder:""},textarea:{type:"textarea",title:"多行文本框",default:"",description:"",placeholder:""},color:{type:"color",title:"颜色color",default:"#ffffff",description:""},image:{title:"图片",type:"image",default:"",description:"上传图片",imgWidth:200,imgHeight:200,imgRatioReadOnly:!0},number:{type:"number",title:"数量number",default:1,minimum:0,maximum:1e3,description:""},"input-image":{title:"图片地址",type:"input-image",description:"",accept:".jpeg,.jpg,.png",multiple:!0},json:{title:"json数据",type:"json",default:"{}",description:""},codearea:{type:"codearea",title:"函数类型",placeholder:"请输入函数方法",default:'function func() { console.log("hello, world!"); }',description:"用于定义函数方法"},htmlarea:{title:"富文本",type:"htmlarea",placeholder:"请输入html代码片段",default:"<p>hello,world!</p>",description:"用于放置html代码片段"},"text-editor":{type:"text-editor",title:"富文本",default:"",description:"",placeholder:""},date:{type:"date",title:"日期Date",default:"",description:"",placeholder:""},"date-time":{type:"date-time",title:"日期时间",default:"",description:"",placeholder:""},time:{type:"time",title:"时间Time",default:"",description:"",placeholder:""},quantity:{type:"quantity",title:"单位计量",isContainer:!1,properties:{unit:{type:"number",title:"单位数值",default:50,minimum:0,maximum:1e3,description:""},quantity:{type:"select",default:"px",options:[{label:"px",value:"px"},{label:"rem",value:"rem"},{label:"em",value:"em"},{label:"%",value:"%"}],title:"单位类型"}},propertyOrder:["unit","quantity"]},"box-style":{type:"box-style",title:"盒子模型",isContainer:!1,properties:{unit:{title:"单位数值",type:"input",default:"0",description:""},quantity:{type:"select",default:"px",options:[{label:"px",value:"px"},{label:"rem",value:"rem"},{label:"em",value:"em"},{label:"%",value:"%"}],title:"单位类型"}},propertyOrder:["unit","quantity"]},"padding-margin":{type:"padding-margin",title:"边距设置",isContainer:!1,properties:{margin:{title:"外边距",type:"input",default:"0",description:""},padding:{title:"内边距",type:"input",default:"0",description:""},quantity:{type:"select",default:"px",options:[{label:"px",value:"px"},{label:"rem",value:"rem"},{label:"em",value:"em"},{label:"%",value:"%"}],title:"单位类型"}},propertyOrder:["margin","padding","quantity"]},radio:{type:"radio",title:"单选",options:[{label:"选项a",value:"a"},{label:"选项b",value:"b"},{label:"选项c",value:"c"}],description:""},select:{type:"select",title:"下拉选择",options:[{label:"选项a",value:"a"},{label:"选项b",value:"b"},{label:"选项c",value:"c"}],description:""},cascader:{type:"cascader",title:"级联选择",options:[{value:"zhejiang",label:"Zhejiang",children:[{value:"hangzhou",label:"Hangzhou",children:[{value:"xihu",label:"West Lake"}]}]},{value:"jiangsu",label:"Jiangsu",children:[{value:"nanjing",label:"Nanjing",children:[{value:"zhonghuamen",label:"Zhong Hua Men"}]}]}],default:"a",description:"",showSearch:!0,allowClear:!0},checkboxes:{type:"checkboxes",title:"多选",options:[{label:"选项a",value:"a"},{label:"选项b",value:"b"},{label:"选项c",value:"c"}],default:["a"],description:""},"dynamic-data":{type:"dynamic-data",title:"动态数据源",isContainer:!1,properties:{type:{default:"local",type:"select",options:[{label:"本地数据",value:"local"},{label:"接口数据",value:"remote"}],title:"数据类型"},config:{title:"接口配置",type:"object",description:"用于存放接口的配置数据(url、请求参数等)",isRequired:!0,properties:{dataName:{default:"local",type:"select",options:[{label:"本地数据",value:"local"},{label:"接口数据",value:"remote"}],title:"数据类型"},body:{type:"object",title:"请求参数配置",description:"用于配置当前接口的请求参数数值",isRequired:!0},filter:{title:"过滤器函数体",type:"codearea",default:"return data;",description:"用于定义过滤接口数据",isRequired:!0}},propertyOrder:["dataName","body","filter"]},data:{title:"数据内容",type:"json",default:"{}",description:"用于存放DynamicData的数据内容",isRequired:!0},localFilter:{title:"过滤器",type:"codearea",default:"return data;",description:"用于定义过滤本地数据",isRequired:!0}},propertyOrder:["type","config","data","localFilter"]},datasource:a,event:o,"dynamic-config":{type:"dynamic-config",title:"动态配置",description:"",isContainer:!1,properties:{type:{type:"select",title:"数据来源",options:[{label:"模板直接设置",value:"DevDefaults"},{label:"mp后台配置",value:"ContentStaticConfig"},{label:"内容Meta数据",value:"Content"},{label:"全局配置数据",value:"RuntimeConst"},{label:"资源中心配置",value:"ResourceCenter"}],default:"DevDefaults",isConditionProp:!0,description:"目前支持的数据来源包括: 1)模版直接设置:在模版配置直接生效,支持直接输入或图片上传。 2)mp后台配置:选择mp后台配置后,属性会出现在mp后台中,支持属性描述的输入。 3)内容meta数据:支持内容meta数据的获取,页面meta数据。 4)全局配置数据:目前支持的全局配置包括:全局Tab配置及主题包配置。相关属性会挂载至:window.globalConst"},value:{title:"数据值",type:"input",default:"",description:"",placeholder:"",onShow:'type === "DevDefaults" || type === "Content" || type === "RuntimeConst"'},description:{title:"属性名称",type:"input",default:"",description:"",placeholder:"",onShow:'type === "ContentStaticConfig" || type === "ResourceCenter"'},valueType:{type:"radio",title:"配置方式",options:[{label:"填写",value:"string"},{label:"选择",value:"select"}],default:"string",isConditionProp:!0,description:'在MP后台或资源中心配置时的交互方式,推荐使用"选择"',onShow:'type === "ContentStaticConfig" || type === "ResourceCenter"'},range:{type:"select",title:"可选项",multiple:!0,options:[],onShow:'(type === "ContentStaticConfig" || type === "ResourceCenter") && valueType === "select"',description:"这里会使用value中的配置选项作为options"}},propertyOrder:["type","value","description","valueType","range"],showCodeViewBtn:!1},"dynamic-object":{type:"dynamic-object",title:"动态配置",description:"",isContainer:!1,properties:{type:{type:"select",title:"数据来源",options:[{label:"模板直接设置",value:"DevDefaults"},{label:"mp后台配置",value:"ContentStaticConfig"},{label:"内容Meta数据",value:"Content"},{label:"全局配置数据",value:"RuntimeConst"},{label:"资源中心配置",value:"ResourceCenter"}],default:"DevDefaults",isConditionProp:!0,description:"目前支持的数据来源包括: 1)模版直接设置: 在模版配置直接生效,支持直接输入或图片上传。 2)mp后台配置: 选择mp后台配置后,属性会出现在mp后台中,支持属性描述的输入。 3)内容meta数据: 支持内容meta数据的获取,页面meta数据。 4)全局配置数据: 目前支持的全局配置包括:全局Tab配置及主题包配置。相关属性会挂载至:window.globalConst"},value:{title:"数据值",type:"input",default:"",description:"",placeholder:"",onShow:'type === "Content" || type === "RuntimeConst"'},description:{title:"自定义配置名称",type:"input",default:"主题包配置",description:"",placeholder:"",onShow:'type === "ContentStaticConfig" || type === "ResourceCenter"'},attrs:{type:"array",title:"属性列表",description:"Tab需要配置的属性",items:{type:"object",title:"数组项",description:"",properties:{attr:{type:"input",title:"属性Key",default:"",description:"",placeholder:""},description:{title:"描述",type:"input",default:"",description:"",placeholder:""},value:{title:"数值",typeOn:"type === 'image' ? 'input-image' : type === 'number' ? 'number' : 'input'",default:"",description:"",placeholder:""},type:{type:"select",title:"属性类型",options:[{label:"图片类型",value:"image"},{label:"字符串",value:"string"},{label:"数字",value:"number"}],default:"string",description:""}},propertyOrder:["attr","description","type","value"]},"minimum-child":1,showCodeViewBtn:!1,onShow:'type === "DevDefaults" || type === "ContentStaticConfig" || type === "ResourceCenter"'}},propertyOrder:["type","description","attrs","value"],showCodeViewBtn:!1,showKey:!0},"dynamic-array":{type:"dynamic-array",title:"动态数组",description:"",isContainer:!1,properties:{type:{type:"select",title:"数据来源",options:[{label:"模板直接设置",value:"DevDefaults"},{label:"mp后台配置",value:"ContentStaticConfig"},{label:"资源中心配置",value:"ResourceCenter"}],default:"DevDefaults",isConditionProp:!0,description:"目前支持的数据来源包括: 1)模版直接设置:在模版配置直接生效,支持直接输入或图片上传。 2)mp后台配置:选择mp后台配置后,属性会出现在mp后台中,支持属性描述的输入。 3)内容meta数据:支持内容meta数据的获取,页面meta数据。 4)全局配置数据:目前支持的全局配置包括:全局Tab配置及主题包配置。相关属性会挂载至:window.globalConst"},description:{title:"自定义配置名称",type:"input",default:"Tab全局配置",description:"",placeholder:"",onShow:'type === "ContentStaticConfig" || type === "ResourceCenter"'},tabNums:{title:"Tab配置数",type:"number",default:1,description:"需要配置的Tab数量",placeholder:"",onShow:"type === 'ContentStaticConfig' || type === 'ResourceCenter'"},attrs:{type:"array",title:"Tab属性",description:"Tab需要配置的属性",items:{type:"object",title:"数组项",description:"",properties:{attr:{type:"input",title:"属性Key",default:"",description:"",placeholder:""},description:{title:"描述",type:"input",default:"",description:"",placeholder:""},tipText:{title:"提示说明",type:"textarea",default:"",description:"",placeholder:""}},propertyOrder:["attr","description","tipText"]},"minimum-child":1,onShow:"type === 'ContentStaticConfig' || type === 'ResourceCenter'",showCodeViewBtn:!1},value:{type:"array",title:"Tab配置",description:"",items:{type:"object",title:"数组项",description:"",properties:{title:{type:"input",title:"名称",default:"",description:"",placeholder:""},id:{title:"id",type:"input",default:"",description:"",placeholder:""},value:{title:"数值",type:"input",default:"",description:"",placeholder:""}},propertyOrder:["title","value","id"]},"minimum-child":1,onShow:"type === 'DevDefaults'",showCodeViewBtn:!1}},propertyOrder:["type","value","description","tabNums","attrs"],showCodeViewBtn:!1,showKey:!0},"sohu-source":{type:"sohu-source",title:"数据源",description:"",isContainer:!1,properties:{mainConfig:{type:"object",title:"主要配置",description:"",isContainer:!1,properties:{type:{type:"select",title:"数据来源",isConditionProp:!0,options:[{label:"模板自定义数据源",value:"RuntimeDataSelfDefine"},{label:"mp后台配置",value:"ContentStaticConfig"},{label:"请求当前页面数据",value:"RuntimeDataSelfContent"},{label:"资源中心配置",value:"ResourceCenter"}],default:"RuntimeDataSelfDefine",description:""},description:{title:"数据源名称",type:"input",description:"",placeholder:"",onShow:'type === "ContentStaticConfig"'},dataType:{type:"radio",title:"请求方式",default:!1,options:[{label:"批量请求",value:"FROMCIS"},{label:"组件内部请求",value:"FROMCOMPCIS"},{label:"不请求",value:!1}],description:""},CONTENTID:{title:"数据源ID",type:"input",description:"",placeholder:"",onShow:'type === "RuntimeDataSelfDefine"'},CONTENTTYPE:{type:"select",title:"数据源类型",options:[{label:"channel",value:13},{label:"topic",value:15},{label:"block",value:14}],description:"",onShow:'type === "RuntimeDataSelfDefine"'}},propertyOrder:["type","description","dataType","CONTENTID","CONTENTTYPE"],showCodeViewBtn:!1},outConfig:{type:"object",title:"出流配置",description:"",isContainer:!1,properties:{PRO:{type:"select",title:"内容类型",options:[{label:"置顶+加精",value:"4"},{label:"长效置顶",value:"5"}],description:""},FEEDTYPE:{type:"select",title:"排序类型",options:[{label:"综合",value:"XTOPIC_SYNTHETICAL"},{label:"最新",value:"XTOPIC_LATEST"},{label:"相关",value:"XTOPIC_RELATED"}],description:""},VIEW:{type:"select",title:"数据裁剪",options:[{label:"相关推荐模式",value:"articleFeedMode"},{label:"文字链裁剪方式",value:"textMode"},{label:"短内容摘录方式",value:"excerptMode"},{label:"互动(点赞/评论)裁剪方式",value:"interactMode"},{label:"评论文字链裁剪方式",value:"commentTextMode"},{label:"摘录方式(无点赞)",value:"excerptCommentMode"},{label:"无限流卡片模式",value:"dynamicFeedMode"},{label:"时间线模式",value:"timeLineMode"},{label:"复合内容流模式",value:"multiFeedMode"},{label:"搜狐号推荐模式",value:"recommendFeedMode"},{label:"作者页内容流模式",value:"operateFeedMode"},{label:"标签内容流模式",value:"tagsFeedMode"},{label:"评论链裁剪方式",value:"commentMode"},{label:"标签摘录方式",value:"excerptTagsMode"},{label:"内容流模式",value:"feedMode"}],description:""},CONTENTCONTEXT:{type:"select",title:"mKey参数",options:[{label:"作者ID+栏目ID",value:"authorColumnId_${#authorColumnId}"},{label:"账号ID",value:"accountId_${#contentData_account_id}"},{label:"mkeyID",value:"mid_${#mkeyConst_mid}"},{label:"mkey名称",value:"mname_${#mkeyConst_mname}"},{label:"城市Code码",value:"cityCode_${#cityInfo_cityCode}"},{label:"城市名称",value:"cityName_${#cityInfo_cityName}"},{label:"焦点城市Code码",value:"focusCityCode_${#focusCityInfo_cityCode}"}],description:""},CONTENTPARAMS:{title:"动态参数",type:"json",description:"请填写JSON格式的参数",placeholder:""}},propertyOrder:["PRO","FEEDTYPE","VIEW","CONTENTCONTEXT","CONTENTPARAMS"],showCodeViewBtn:!1},otherConfig:{type:"object",title:"选配内容",description:"",isContainer:!1,properties:{SIZE:{type:"number",title:"容量",minimum:0,maximum:1e3,description:"该位置区块需要的内容条数"},TITLE:{title:"标题",type:"input",description:"",placeholder:""},URL:{type:"url",title:"更多跳转链接",description:"该区块下点击“更多或箭头图标”后的跳转链接",placeholder:""},CODE:{title:"Code参数",type:"input",description:"",placeholder:"",onShow:!1}},propertyOrder:["SIZE","TITLE","URL","CODE"],showCodeViewBtn:!1}},propertyOrder:["mainConfig","otherConfig","outConfig"],showCodeViewBtn:!1},"sohu-event":{type:"sohu-event",title:"sohu组件事件",showCodeViewBtn:!1,isContainer:!1,properties:{globalEventMap:{type:"object",title:"全局事件Map",description:"",properties:{eventCode:{type:"input",title:"事件名称",default:"",description:"",placeholder:"",readOnly:!0}},propertyOrder:["eventCode"],showCodeViewBtn:!1},event:{type:"array",title:"监听事件",description:"当前组件监听事件列表",default:[],items:{type:"object",title:"数组项",description:"",properties:{name:{type:"input",title:"事件",default:"",description:"",placeholder:""},code:{title:"事件code",type:"input",default:"",description:"",placeholder:""},listenName:{title:"事件名称",type:"input",default:"",description:"",placeholder:""},desc:{title:"事件描述",type:"input",default:"",description:"",placeholder:""}},propertyOrder:["name","code","listenName","desc"]},showCodeViewBtn:!1}},propertyOrder:["globalEventMap","event"]},"sohu-ad":{type:"object",title:"广告配置",description:"",properties:{type:{type:"select",title:"数据源类型",isConditionProp:!0,options:[{label:"模板直接设置",value:"DevDefaults"},{label:"资源中心配置",value:"ResourceCenter"}],description:""},value:{type:"object",title:"广告规则",description:"",onShow:'type === "DevDefaults"',properties:{id:{title:"广告ID",type:"number",description:"",placeholder:""},rule:{type:"radio",title:"规则类型",isConditionProp:!0,options:[{label:"固定位置",value:1},{label:"隔几出几",value:2},{label:"固定位置隔几出几",value:3}],description:""},fixArray:{type:"select",title:"固定位置",description:"",multiple:!0,onShow:"rule === 1 || rule === 3",options:[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3},{label:"4",value:4},{label:"5",value:5},{label:"6",value:6},{label:"7",value:7},{label:"8",value:8},{label:"9",value:9},{label:"10",value:10},{label:"11",value:11},{label:"12",value:12},{label:"13",value:13},{label:"14",value:14},{label:"15",value:15},{label:"16",value:16},{label:"17",value:17},{label:"18",value:18},{label:"19",value:19},{label:"20",value:20},{label:"21",value:21},{label:"22",value:22},{label:"23",value:23},{label:"24",value:24},{label:"25",value:25},{label:"26",value:26},{label:"27",value:27},{label:"28",value:28},{label:"29",value:29},{label:"30",value:30},{label:"31",value:31},{label:"32",value:32},{label:"33",value:33},{label:"34",value:34},{label:"35",value:35},{label:"36",value:36},{label:"37",value:37},{label:"38",value:38},{label:"39",value:39},{label:"40",value:40},{label:"41",value:41},{label:"42",value:42},{label:"43",value:43},{label:"44",value:44},{label:"45",value:45},{label:"46",value:46},{label:"47",value:47},{label:"48",value:48},{label:"49",value:49},{label:"50",value:50}]},begin:{type:"number",title:"开始位置",minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},turn:{type:"number",title:"间隔/隔",minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},number:{type:"number",title:"间隔/出",minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},mergeType:{type:"radio",title:"插入规则",options:[{label:"覆盖",value:0},{label:"插入",value:1}],description:""}},propertyOrder:["id","rule","fixArray","begin","turn","number","mergeType"]},range:{type:"array",title:"广告规则列表",description:"",onShow:'type === "ResourceCenter"',items:{type:"object",title:"数组项",description:"",properties:{rule:{type:"radio",title:"规则类型",isConditionProp:!0,options:[{label:"固定位置",value:1},{label:"隔几出几",value:2},{label:"固定位置隔几出几",value:3}],description:""},fixArray:{type:"select",title:"固定位置",description:"",onShow:"rule === 1 || rule === 3",multiple:!0,options:[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3},{label:"4",value:4},{label:"5",value:5},{label:"6",value:6},{label:"7",value:7},{label:"8",value:8},{label:"9",value:9},{label:"10",value:10},{label:"11",value:11},{label:"12",value:12},{label:"13",value:13},{label:"14",value:14},{label:"15",value:15},{label:"16",value:16},{label:"17",value:17},{label:"18",value:18},{label:"19",value:19},{label:"20",value:20},{label:"21",value:21},{label:"22",value:22},{label:"23",value:23},{label:"24",value:24},{label:"25",value:25},{label:"26",value:26},{label:"27",value:27},{label:"28",value:28},{label:"29",value:29},{label:"30",value:30},{label:"31",value:31},{label:"32",value:32},{label:"33",value:33},{label:"34",value:34},{label:"35",value:35},{label:"36",value:36},{label:"37",value:37},{label:"38",value:38},{label:"39",value:39},{label:"40",value:40},{label:"41",value:41},{label:"42",value:42},{label:"43",value:43},{label:"44",value:44},{label:"45",value:45},{label:"46",value:46},{label:"47",value:47},{label:"48",value:48},{label:"49",value:49},{label:"50",value:50}]},begin:{type:"number",title:"开始位置",minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},turn:{type:"number",title:"间隔/隔",minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},number:{type:"number",title:"间隔/出",minimum:"1",maximum:"50",description:"",onShow:"rule === 2 || rule === 3"},mergeType:{type:"radio",title:"插入规则",options:[{label:"覆盖",value:0},{label:"插入",value:1}],description:""}},propertyOrder:["rule","fixArray","begin","turn","number","mergeType"]}}},propertyOrder:["type","value","range"]}},p={on:{type:"event",title:"事件",isContainer:!1,properties:{type:{default:"on",type:"select",options:[{label:"on",value:"on"},{label:"emit",value:"emit"}],title:"事件类型"},register:{type:"input",default:"eventName",title:"注册事件",description:"用于输入注册事件的名称",placeholder:"请输入注册事件的名称"},actionFunc:{title:"执行函数",type:"codearea",default:"() => {}",description:""}},propertyOrder:["type","register","actionFunc"]},emit:o},c={local:a,remote:s};function d(e){return/^http[s]?:\/\/.*/.test(e)}function f(e){return"String"===Object.prototype.toString.call(e).slice(8,-1)}function v(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function y(e){return"Boolean"===Object.prototype.toString.call(e).slice(8,-1)}function h(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)}function b(e){return/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/.test(e)||/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$/.test(e)}function m(e){return/^\d{2}:\d{2}:\d{2}$/.test(e)||/^\d{2}:\d{2}$/.test(e)}function g(e){var t=!1;return"Array"===Object.prototype.toString.call(e).slice(8,-1)&&(t=!0),t}function O(e){if(!g(e))return!1;for(var t=0,r=e.length;t<r;t++){if(!f(e[t]))return!1}return!0}function w(e){var t=!1;return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&(t=!0),t}function E(e){var t=!1;return u.quantity.properties.quantity.enum.indexOf(e)>=0&&(t=!0),t}function N(e){return/^#[0-9a-f]{6}$/.test(e)||/^#[0-9a-f]{3}$/.test(e)}function _(e){var t=!1;return"Function"===Object.prototype.toString.call(e).slice(8,-1)&&(t=!0),t}function j(){var e={};return location.search&&(e=n.parse(location.search.substring(1))),e}function S(e){var t="";return url&&(t=n.stringify(e)),t}function x(t){return e(t)}function C(e,r){if(A(e)&&!A(r)||!A(e)&&A(r)||typeof e!=typeof r)return!1;if(w(e)&&(e.id!==r.id||e.lastUpdateTime!==r.lastUpdateTime))return!1;var n=(new Date).getTime();return!!(w(e)&&e.lastUpdateTime&&e.lastUpdateTime===r.lastUpdateTime&&n-e.lastUpdateTime<500)||t(e,r)}function D(e,r){if(A(e)&&!A(r)||!A(e)&&A(r)||typeof e!=typeof r)return!1;if(w(e)&&(e.id!==r.id||e.lastUpdateTime!==r.lastUpdateTime))return!1;var n=(new Date).getTime();return!!(w(e)&&e.lastUpdateTime&&e.lastUpdateTime===r.lastUpdateTime&&n-e.lastUpdateTime<500)||(!(!w(e)||!(A(e.id)&&e.id===r.id||A(e.lastUpdateTime)&&e.lastUpdateTime===r.lastUpdateTime))||t(e,r))}function A(e){var t=!1;return null!=e&&(t=!0),t}function T(e,t){return r(e,t)}function V(e,t){var r=t||{};if(!e)return!1;var n=new Function("data","with(data) { return ("+e+");}"),i="";try{i=n(r)}catch(t){return console.warn("表达式运算出错: "+e+",报错信息:",t),i}return i}function R(e,t,r){var n=t;if(r&&(n=x(t)),e)for(var i=e.split("-"),o=0,a=i.length;o<a;o++){var s=i[o];s&&(n=n&&n[s])}return n}function k(e,t,r){var n=t;if(r&&(n=x(t)),e)for(var i=e.split("-"),o=0,a=i.length;o<a;o++){var s=i[o];if("0"!==s||"array"!==n.type&&"radio"!==n.type&&"select"!==n.type&&"checkboxes"!==n.type||!n.options&&!n.items){if(s){var l="0";if(n.propertyOrder)l=n.propertyOrder[s];else if(n.properties){l=Object.keys(n.properties)[s]}n=n.properties[l]}}else n=n.options||n.items}return n}function P(e,t,r){var n=t;if(r&&(n=x(t)),e&&n)for(var i=e.split("-"),o=0,a=i.length;o<a;o++){var s=i[o];s&&n.properties&&(n=n.properties[s])}return n}function I(e,t){for(var r=t,n="",i=e.split("-"),o=0,a=i.length;o<a;o++){var s=i[o];if("0"===s&&r.items)r=r.items,n=n?n+"-items":"items";else if("0"===s&&r.options)r=r.options,n=n?n+"-options":"options";else if(s){var l="0";if(r.propertyOrder)l=r.propertyOrder[s];else if(r.properties){l=Object.keys(r.properties)[s]}r=r.properties[l],n=n?n+"-"+l:l}}return n}function M(e,t){for(var r=t,n="",i=e.split("-"),o=0,a=i.length;o<a;o++){var s=i[o];if(s){var l=-1;if(r.propertyOrder)l=r.propertyOrder.indexOf(s),r=r.properties[s];else if(r.properties){l=Object.keys(r.properties).indexOf(s),r=r.properties[s]}else r.items?(l=0,r=r.items):r.options&&(l=0,r=r.options);n=n?n+"-"+l:l.toString()}}return n}function B(e){var t={};return t=e&&w(e)?function(e){var t;if(w(e)){var r=Object.keys(e);e.data&&e.filter&&2===r.length?t=g(e.data)||w(e.data)?x(c.local):x(c.remote):e.trigger&&e.eventData&&2===r.length?t=x(p.emit):e.register&&e.actionFunc&&2===r.length?t=x(p.on):e.quantity&&E(e.quantity)&&2===r.length?t=x(u.quantity):(t=x(u["empty-object"]),Object.keys(e).map((function(r){var n=e[r];t.properties[r]=B(n)})))}return t}(e):e&&g(e)?function(e){var t;if(e&&g(e))if(O(e)){(t=x(u.select)).items.enum=e;var r=t.items.enumextra.length,n=e.length;if(n>r)for(var i=r,o=n;i<o;i++)t.items.enumextra.push("选项"+e(i))}else{t=x(u["empty-array"]);var a=B(e[0]);t.items.properties=a.properties}return t}(e):function(e){var t="";if(y(e))t=x(u.boolean);else if(v(e))t=x(u.number);else if(d(e))t=x(u.url);else if(h(e))t=x(u.date);else if(b(e))t=x(u["date-time"]);else if(m(e))t=x(u.time);else if(N(e))t=x(u.color);else try{t=v(JSON.parse(e))?x(u.input):x(u.json)}catch(r){t=e&&e.length>30?x(u.textarea):x(u.input)}return t}(e),t}function L(e,t){var r=t||{};if(w(e)&&"object"===getExpectType(e.type)&&e.properties){(e.propertyOrder?e.propertyOrder:Object.keys(e.properties)).map((function(t){var n=e.properties[t];r=U(n,r)}))}return r}function U(e,t){var r=!t,n=t||{};if(e&&"{}"!==JSON.stringify(e)){var i=e.type;"object"===i||"func"===i||"style"===i||"data"===i?(!r&&n.object?n.object+=1:r||(n.object=1),n=L(e,n)):"array"===i?(!r&&n.array?n.array+=1:r||(n.array=1),n=L(e=e.items,n)):!r&&n[i]?n[i]+=1:r||(n[i]=1)}return n}function q(e){var t=x(e);if(!t.title&&t.description&&(t.title=t.description),t.type||(t.type=t.format),"quantity"!==t.type&&"array"!==t.type&&"datasource"!==t.type&&"event"!==t.type&&"object"!==t.type||!A(t.default)||delete t.default,"radio"===t.type&&(t.type="string",t.enum&&t.enumextra&&(t.items={type:"string",enum:x(t.enum),enumextra:x(t.enumextra)},delete t.enum,delete t.enumextra)),"quantity"===t.type){var r=t.properties,n=x(u.quantity);if(r.quantity&&w(r.quantity)&&r.quantity.default){var i=r.quantity.default;n.properties.quantity.default="percent"===i?"%":i}t=n}if("datasource"===t.type){var o=t.properties,a=o.type&&o.type.default,s=o.data&&o.data.default,l=o.filter&&o.filter.default;"local"===a?(t=x(c.local)).properties.data.default=s?x(s):"{}":(t=x(c.remote)).properties.data.default=s?x(s):"http://xxx",t.properties.filter.default=l?x(l):"() => {}"}if("event"===t.type){var d=t.properties,f=d.type&&d.type.default;if("in"===f||"on"===f){var v=d.filter&&d.filter.default||"() => {}";t=x(p.on),d.actionFunc&&w(d.actionFunc)&&(t.properties.actionFunc.default=d.actionFunc.default||x(v))}else{var y=d.filter&&d.filter.default||"{}";t=x(p.emit),d.eventData&&w(d.eventData)&&(t.properties.eventData.default=d.eventData.default||x(y))}}return t.properties&&(t.propertyOrder||(t.propertyOrder=Object.keys(t.properties)),t.propertyOrder.map((function(e){t.properties[e]=F(t.properties[e])}))),t.items&&(t.items=F(t.items)),t}function F(e){var t=x(e);return t.required||delete t.required,t.type&&t.type&&(t.type=t.type),"quantity"!==t.type&&"array"!==t.type&&"datasource"!==t.type&&"event"!==t.type&&"object"!==t.type||!A(t.default)||delete t.default,"radio"!==t.type&&"checkboxes"!==t.type&&"select"!==t.type||t.items&&t.items.enum&&t.items.enumextra&&(t.options=[],t.items.enum.forEach((function(e,r){t.options.push({label:t.items.enumextra[r]||e,value:e})})),delete t.items),t.properties&&(t.propertyOrder||(t.propertyOrder=Object.keys(t.properties)),t.propertyOrder.map((function(e){t.properties[e]=F(t.properties[e])}))),"array"===t.type&&t.items&&(t.items=F(t.items)),t}var G=[];Object.freeze(G);var K={};function z(){return++ft.mobxGuid}function J(e){throw H(!1,e),"X"}function H(e,t){if(!e)throw new Error("[mobx] "+(t||"An invariant failed, however the error is obfuscated because this is a production build."))}function W(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}Object.freeze(K);var $=function(){};function X(e){return null!==e&&"object"==typeof e}function Y(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function Z(e,t,r){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function Q(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return!r||!1!==r.configurable&&!1!==r.writable}function ee(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(e){return X(e)&&!0===e[r]}}function te(e){return e instanceof Map}function re(e){return e instanceof Set}function ne(e){var t=new Set;for(var r in e)t.add(r);return Object.getOwnPropertySymbols(e).forEach((function(r){Object.getOwnPropertyDescriptor(e,r).enumerable&&t.add(r)})),Array.from(t)}function ie(e){return e&&e.toString?e.toString():new String(e).toString()}function oe(e){return null===e?null:"object"==typeof e?""+e:e}var ae="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,se=Symbol("mobx administration"),le=function(){function e(e){void 0===e&&(e="Atom@"+z()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Be.NOT_TRACKING}return e.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(e){return e()}))},e.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(e){return e()}))},e.prototype.reportObserved=function(){return gt(this)},e.prototype.reportChanged=function(){bt(),function(e){if(e.lowestObserverState===Be.STALE)return;e.lowestObserverState=Be.STALE,e.observers.forEach((function(t){t.dependenciesState===Be.UP_TO_DATE&&(t.isTracing!==Le.NONE&&Ot(t,e),t.onBecomeStale()),t.dependenciesState=Be.STALE}))}(this),mt()},e.prototype.toString=function(){return this.name},e}(),ue=ee("Atom",le);function pe(e,t,r){void 0===t&&(t=$),void 0===r&&(r=$);var n,i=new le(e);return t!==$&&Pt("onBecomeObserved",i,t,n),r!==$&&kt(i,r),i}var ce={identity:function(e,t){return e===t},structural:function(e,t){return _r(e,t)},default:function(e,t){return Object.is(e,t)},shallow:function(e,t){return _r(e,t,1)}},de=function(e,t){return de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},de(e,t)};
|
|
1
|
+
import { cloneDeep as e, isEqual as t, truncate as r } from 'lodash';
|
|
2
|
+
import n from 'qs';
|
|
3
|
+
var o,
|
|
4
|
+
i = {
|
|
5
|
+
type: 'event',
|
|
6
|
+
title: '事件',
|
|
7
|
+
isContainer: !1,
|
|
8
|
+
properties: {
|
|
9
|
+
type: {
|
|
10
|
+
default: 'emit',
|
|
11
|
+
type: 'select',
|
|
12
|
+
options: [
|
|
13
|
+
{ label: 'on', value: 'on' },
|
|
14
|
+
{ label: 'emit', value: 'emit' },
|
|
15
|
+
],
|
|
16
|
+
title: '事件类型',
|
|
17
|
+
},
|
|
18
|
+
trigger: {
|
|
19
|
+
type: 'input',
|
|
20
|
+
default: 'eventName',
|
|
21
|
+
title: '触发事件',
|
|
22
|
+
description: '用于输入触发事件的名称',
|
|
23
|
+
placeholder: '请输入触发事件的名称',
|
|
24
|
+
},
|
|
25
|
+
eventData: {
|
|
26
|
+
title: '事件数据',
|
|
27
|
+
type: 'json',
|
|
28
|
+
default: '{}',
|
|
29
|
+
description: '传递给触发事件的数据对象',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
propertyOrder: ['type', 'trigger', 'eventData'],
|
|
33
|
+
},
|
|
34
|
+
a = {
|
|
35
|
+
type: 'datasource',
|
|
36
|
+
title: '数据源',
|
|
37
|
+
isContainer: !1,
|
|
38
|
+
properties: {
|
|
39
|
+
type: {
|
|
40
|
+
default: 'local',
|
|
41
|
+
type: 'select',
|
|
42
|
+
options: [
|
|
43
|
+
{ label: '本地数据', value: 'local' },
|
|
44
|
+
{ label: '接口数据', value: 'remote' },
|
|
45
|
+
],
|
|
46
|
+
title: '数据源类型',
|
|
47
|
+
},
|
|
48
|
+
data: {
|
|
49
|
+
title: '本地json数据',
|
|
50
|
+
placeholder: '请输入静态json数据',
|
|
51
|
+
type: 'json',
|
|
52
|
+
default: '{}',
|
|
53
|
+
description: '用于设置本地的静态json数据',
|
|
54
|
+
isRequired: !0,
|
|
55
|
+
},
|
|
56
|
+
filter: {
|
|
57
|
+
title: '过滤器',
|
|
58
|
+
type: 'codearea',
|
|
59
|
+
default: '() => {}',
|
|
60
|
+
description: '用于定义过滤当前数据的函数',
|
|
61
|
+
isRequired: !0,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
propertyOrder: ['type', 'data', 'filter'],
|
|
65
|
+
},
|
|
66
|
+
s =
|
|
67
|
+
(((o = { type: 'object' }).type = 'datasource'),
|
|
68
|
+
(o.title = '数据源'),
|
|
69
|
+
(o.isContainer = !1),
|
|
70
|
+
(o.properties = {
|
|
71
|
+
type: {
|
|
72
|
+
type: 'select',
|
|
73
|
+
default: 'remote',
|
|
74
|
+
options: [
|
|
75
|
+
{ label: '本地数据', value: 'local' },
|
|
76
|
+
{ label: '接口数据', value: 'remote' },
|
|
77
|
+
],
|
|
78
|
+
title: '数据源类型',
|
|
79
|
+
},
|
|
80
|
+
data: {
|
|
81
|
+
type: 'url',
|
|
82
|
+
title: '远程json数据',
|
|
83
|
+
placeholder: '请输入远程json数据源地址',
|
|
84
|
+
default: 'http://xxx',
|
|
85
|
+
isRequired: !0,
|
|
86
|
+
description: '用于设置获取元素数据的请求地址',
|
|
87
|
+
},
|
|
88
|
+
filter: {
|
|
89
|
+
type: 'codearea',
|
|
90
|
+
title: '过滤器',
|
|
91
|
+
default: '() => {}',
|
|
92
|
+
description: '用于定义过滤当前数据的函数',
|
|
93
|
+
isRequired: !0,
|
|
94
|
+
},
|
|
95
|
+
}),
|
|
96
|
+
(o.propertyOrder = ['type', 'data', 'filter']),
|
|
97
|
+
o),
|
|
98
|
+
u = {
|
|
99
|
+
type: 'local',
|
|
100
|
+
config: { dataName: '', body: {}, filter: 'return data;' },
|
|
101
|
+
data: '{}',
|
|
102
|
+
localFilter: 'return data;',
|
|
103
|
+
},
|
|
104
|
+
c = {
|
|
105
|
+
jsonschema: {
|
|
106
|
+
type: 'object',
|
|
107
|
+
title: 'jsonSchemaObject',
|
|
108
|
+
properties: {
|
|
109
|
+
func: {
|
|
110
|
+
type: 'object',
|
|
111
|
+
title: '功能设置',
|
|
112
|
+
properties: {
|
|
113
|
+
a: {
|
|
114
|
+
title: '单文本框',
|
|
115
|
+
type: 'input',
|
|
116
|
+
default: '',
|
|
117
|
+
description: '',
|
|
118
|
+
placeholder: '',
|
|
119
|
+
isRequired: !1,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
propertyOrder: ['a'],
|
|
123
|
+
},
|
|
124
|
+
style: {
|
|
125
|
+
type: 'object',
|
|
126
|
+
title: '样式设置',
|
|
127
|
+
properties: {
|
|
128
|
+
b: {
|
|
129
|
+
title: '单文本框',
|
|
130
|
+
type: 'input',
|
|
131
|
+
default: '',
|
|
132
|
+
description: '',
|
|
133
|
+
placeholder: '',
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
propertyOrder: ['b'],
|
|
137
|
+
},
|
|
138
|
+
data: {
|
|
139
|
+
type: 'data',
|
|
140
|
+
title: '数据设置',
|
|
141
|
+
properties: {
|
|
142
|
+
c: {
|
|
143
|
+
title: '单文本框',
|
|
144
|
+
type: 'input',
|
|
145
|
+
default: '',
|
|
146
|
+
description: '',
|
|
147
|
+
placeholder: '',
|
|
148
|
+
isRequired: !1,
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
propertyOrder: ['c'],
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
propertyOrder: ['func', 'style', 'data'],
|
|
155
|
+
},
|
|
156
|
+
input: {
|
|
157
|
+
title: '单文本框',
|
|
158
|
+
type: 'input',
|
|
159
|
+
default: '',
|
|
160
|
+
description: '',
|
|
161
|
+
placeholder: '',
|
|
162
|
+
},
|
|
163
|
+
boolean: { type: 'boolean', title: '布尔值', default: !1, description: '' },
|
|
164
|
+
object: {
|
|
165
|
+
type: 'object',
|
|
166
|
+
title: '对象Object',
|
|
167
|
+
description: '',
|
|
168
|
+
properties: {
|
|
169
|
+
a: {
|
|
170
|
+
type: 'input',
|
|
171
|
+
title: '单文本框',
|
|
172
|
+
default: '',
|
|
173
|
+
description: '',
|
|
174
|
+
placeholder: '',
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
propertyOrder: ['a'],
|
|
178
|
+
},
|
|
179
|
+
array: {
|
|
180
|
+
type: 'array',
|
|
181
|
+
title: '数组Array',
|
|
182
|
+
description: '',
|
|
183
|
+
items: {
|
|
184
|
+
type: 'object',
|
|
185
|
+
title: '数组项',
|
|
186
|
+
description: '',
|
|
187
|
+
properties: {
|
|
188
|
+
name: {
|
|
189
|
+
type: 'input',
|
|
190
|
+
title: '名字',
|
|
191
|
+
default: '',
|
|
192
|
+
description: '',
|
|
193
|
+
placeholder: '',
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
propertyOrder: ['name'],
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
'empty-array': {
|
|
200
|
+
type: 'array',
|
|
201
|
+
title: '数组Array',
|
|
202
|
+
description: '',
|
|
203
|
+
default: [],
|
|
204
|
+
items: {
|
|
205
|
+
type: 'object',
|
|
206
|
+
title: '数组项',
|
|
207
|
+
description: '',
|
|
208
|
+
properties: {},
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
'empty-object': {
|
|
212
|
+
type: 'object',
|
|
213
|
+
title: '对象Object',
|
|
214
|
+
description: '',
|
|
215
|
+
properties: {},
|
|
216
|
+
},
|
|
217
|
+
url: {
|
|
218
|
+
type: 'url',
|
|
219
|
+
title: '链接地址url',
|
|
220
|
+
default: '',
|
|
221
|
+
description: '',
|
|
222
|
+
placeholder: '',
|
|
223
|
+
},
|
|
224
|
+
textarea: {
|
|
225
|
+
type: 'textarea',
|
|
226
|
+
title: '多行文本框',
|
|
227
|
+
default: '',
|
|
228
|
+
description: '',
|
|
229
|
+
placeholder: '',
|
|
230
|
+
},
|
|
231
|
+
color: {
|
|
232
|
+
type: 'color',
|
|
233
|
+
title: '颜色color',
|
|
234
|
+
default: '#ffffff',
|
|
235
|
+
description: '',
|
|
236
|
+
},
|
|
237
|
+
image: {
|
|
238
|
+
title: '图片',
|
|
239
|
+
type: 'image',
|
|
240
|
+
default: '',
|
|
241
|
+
description: '上传图片',
|
|
242
|
+
imgWidth: 200,
|
|
243
|
+
imgHeight: 200,
|
|
244
|
+
imgRatioReadOnly: !0,
|
|
245
|
+
},
|
|
246
|
+
number: {
|
|
247
|
+
type: 'number',
|
|
248
|
+
title: '数量number',
|
|
249
|
+
default: 1,
|
|
250
|
+
minimum: 0,
|
|
251
|
+
maximum: 1e3,
|
|
252
|
+
description: '',
|
|
253
|
+
},
|
|
254
|
+
'input-image': {
|
|
255
|
+
title: '图片地址',
|
|
256
|
+
type: 'input-image',
|
|
257
|
+
description: '',
|
|
258
|
+
accept: '.jpeg,.jpg,.png',
|
|
259
|
+
multiple: !0,
|
|
260
|
+
},
|
|
261
|
+
json: { title: 'json数据', type: 'json', default: '{}', description: '' },
|
|
262
|
+
codearea: {
|
|
263
|
+
type: 'codearea',
|
|
264
|
+
title: '函数类型',
|
|
265
|
+
placeholder: '请输入函数方法',
|
|
266
|
+
default: 'function func() { console.log("hello, world!"); }',
|
|
267
|
+
description: '用于定义函数方法',
|
|
268
|
+
},
|
|
269
|
+
htmlarea: {
|
|
270
|
+
title: '富文本',
|
|
271
|
+
type: 'htmlarea',
|
|
272
|
+
placeholder: '请输入html代码片段',
|
|
273
|
+
default: '<p>hello,world!</p>',
|
|
274
|
+
description: '用于放置html代码片段',
|
|
275
|
+
},
|
|
276
|
+
'text-editor': {
|
|
277
|
+
type: 'text-editor',
|
|
278
|
+
title: '富文本',
|
|
279
|
+
default: '',
|
|
280
|
+
description: '',
|
|
281
|
+
placeholder: '',
|
|
282
|
+
},
|
|
283
|
+
date: {
|
|
284
|
+
type: 'date',
|
|
285
|
+
title: '日期Date',
|
|
286
|
+
default: '',
|
|
287
|
+
description: '',
|
|
288
|
+
placeholder: '',
|
|
289
|
+
},
|
|
290
|
+
'date-time': {
|
|
291
|
+
type: 'date-time',
|
|
292
|
+
title: '日期时间',
|
|
293
|
+
default: '',
|
|
294
|
+
description: '',
|
|
295
|
+
placeholder: '',
|
|
296
|
+
},
|
|
297
|
+
time: {
|
|
298
|
+
type: 'time',
|
|
299
|
+
title: '时间Time',
|
|
300
|
+
default: '',
|
|
301
|
+
description: '',
|
|
302
|
+
placeholder: '',
|
|
303
|
+
},
|
|
304
|
+
quantity: {
|
|
305
|
+
type: 'quantity',
|
|
306
|
+
title: '单位计量',
|
|
307
|
+
isContainer: !1,
|
|
308
|
+
properties: {
|
|
309
|
+
unit: {
|
|
310
|
+
type: 'number',
|
|
311
|
+
title: '单位数值',
|
|
312
|
+
default: 50,
|
|
313
|
+
minimum: 0,
|
|
314
|
+
maximum: 1e3,
|
|
315
|
+
description: '',
|
|
316
|
+
},
|
|
317
|
+
quantity: {
|
|
318
|
+
type: 'select',
|
|
319
|
+
default: 'px',
|
|
320
|
+
options: [
|
|
321
|
+
{ label: 'px', value: 'px' },
|
|
322
|
+
{ label: 'rem', value: 'rem' },
|
|
323
|
+
{ label: 'em', value: 'em' },
|
|
324
|
+
{ label: '%', value: '%' },
|
|
325
|
+
],
|
|
326
|
+
title: '单位类型',
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
propertyOrder: ['unit', 'quantity'],
|
|
330
|
+
},
|
|
331
|
+
'box-style': {
|
|
332
|
+
type: 'box-style',
|
|
333
|
+
title: '盒子模型',
|
|
334
|
+
isContainer: !1,
|
|
335
|
+
properties: {
|
|
336
|
+
unit: {
|
|
337
|
+
title: '单位数值',
|
|
338
|
+
type: 'input',
|
|
339
|
+
default: '0',
|
|
340
|
+
description: '',
|
|
341
|
+
},
|
|
342
|
+
quantity: {
|
|
343
|
+
type: 'select',
|
|
344
|
+
default: 'px',
|
|
345
|
+
options: [
|
|
346
|
+
{ label: 'px', value: 'px' },
|
|
347
|
+
{ label: 'rem', value: 'rem' },
|
|
348
|
+
{ label: 'em', value: 'em' },
|
|
349
|
+
{ label: '%', value: '%' },
|
|
350
|
+
],
|
|
351
|
+
title: '单位类型',
|
|
352
|
+
},
|
|
353
|
+
},
|
|
354
|
+
propertyOrder: ['unit', 'quantity'],
|
|
355
|
+
},
|
|
356
|
+
'padding-margin': {
|
|
357
|
+
type: 'padding-margin',
|
|
358
|
+
title: '边距设置',
|
|
359
|
+
isContainer: !1,
|
|
360
|
+
properties: {
|
|
361
|
+
margin: {
|
|
362
|
+
title: '外边距',
|
|
363
|
+
type: 'input',
|
|
364
|
+
default: '0',
|
|
365
|
+
description: '',
|
|
366
|
+
},
|
|
367
|
+
padding: {
|
|
368
|
+
title: '内边距',
|
|
369
|
+
type: 'input',
|
|
370
|
+
default: '0',
|
|
371
|
+
description: '',
|
|
372
|
+
},
|
|
373
|
+
quantity: {
|
|
374
|
+
type: 'select',
|
|
375
|
+
default: 'px',
|
|
376
|
+
options: [
|
|
377
|
+
{ label: 'px', value: 'px' },
|
|
378
|
+
{ label: 'rem', value: 'rem' },
|
|
379
|
+
{ label: 'em', value: 'em' },
|
|
380
|
+
{ label: '%', value: '%' },
|
|
381
|
+
],
|
|
382
|
+
title: '单位类型',
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
propertyOrder: ['margin', 'padding', 'quantity'],
|
|
386
|
+
},
|
|
387
|
+
radio: {
|
|
388
|
+
type: 'radio',
|
|
389
|
+
title: '单选',
|
|
390
|
+
options: [
|
|
391
|
+
{ label: '选项a', value: 'a' },
|
|
392
|
+
{ label: '选项b', value: 'b' },
|
|
393
|
+
{ label: '选项c', value: 'c' },
|
|
394
|
+
],
|
|
395
|
+
description: '',
|
|
396
|
+
},
|
|
397
|
+
select: {
|
|
398
|
+
type: 'select',
|
|
399
|
+
title: '下拉选择',
|
|
400
|
+
options: [
|
|
401
|
+
{ label: '选项a', value: 'a' },
|
|
402
|
+
{ label: '选项b', value: 'b' },
|
|
403
|
+
{ label: '选项c', value: 'c' },
|
|
404
|
+
],
|
|
405
|
+
description: '',
|
|
406
|
+
},
|
|
407
|
+
cascader: {
|
|
408
|
+
type: 'cascader',
|
|
409
|
+
title: '级联选择',
|
|
410
|
+
options: [
|
|
411
|
+
{
|
|
412
|
+
value: 'zhejiang',
|
|
413
|
+
label: 'Zhejiang',
|
|
414
|
+
children: [
|
|
415
|
+
{
|
|
416
|
+
value: 'hangzhou',
|
|
417
|
+
label: 'Hangzhou',
|
|
418
|
+
children: [{ value: 'xihu', label: 'West Lake' }],
|
|
419
|
+
},
|
|
420
|
+
],
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
value: 'jiangsu',
|
|
424
|
+
label: 'Jiangsu',
|
|
425
|
+
children: [
|
|
426
|
+
{
|
|
427
|
+
value: 'nanjing',
|
|
428
|
+
label: 'Nanjing',
|
|
429
|
+
children: [{ value: 'zhonghuamen', label: 'Zhong Hua Men' }],
|
|
430
|
+
},
|
|
431
|
+
],
|
|
432
|
+
},
|
|
433
|
+
],
|
|
434
|
+
default: 'a',
|
|
435
|
+
description: '',
|
|
436
|
+
showSearch: !0,
|
|
437
|
+
allowClear: !0,
|
|
438
|
+
},
|
|
439
|
+
checkboxes: {
|
|
440
|
+
type: 'checkboxes',
|
|
441
|
+
title: '多选',
|
|
442
|
+
options: [
|
|
443
|
+
{ label: '选项a', value: 'a' },
|
|
444
|
+
{ label: '选项b', value: 'b' },
|
|
445
|
+
{ label: '选项c', value: 'c' },
|
|
446
|
+
],
|
|
447
|
+
default: ['a'],
|
|
448
|
+
description: '',
|
|
449
|
+
},
|
|
450
|
+
'dynamic-data': {
|
|
451
|
+
type: 'dynamic-data',
|
|
452
|
+
title: '动态数据源',
|
|
453
|
+
isContainer: !1,
|
|
454
|
+
properties: {
|
|
455
|
+
type: {
|
|
456
|
+
default: 'local',
|
|
457
|
+
type: 'select',
|
|
458
|
+
options: [
|
|
459
|
+
{ label: '本地数据', value: 'local' },
|
|
460
|
+
{ label: '接口数据', value: 'remote' },
|
|
461
|
+
],
|
|
462
|
+
title: '数据类型',
|
|
463
|
+
},
|
|
464
|
+
config: {
|
|
465
|
+
title: '接口配置',
|
|
466
|
+
type: 'object',
|
|
467
|
+
description: '用于存放接口的配置数据(url、请求参数等)',
|
|
468
|
+
isRequired: !0,
|
|
469
|
+
properties: {
|
|
470
|
+
dataName: {
|
|
471
|
+
default: 'local',
|
|
472
|
+
type: 'select',
|
|
473
|
+
options: [
|
|
474
|
+
{ label: '本地数据', value: 'local' },
|
|
475
|
+
{ label: '接口数据', value: 'remote' },
|
|
476
|
+
],
|
|
477
|
+
title: '数据类型',
|
|
478
|
+
},
|
|
479
|
+
body: {
|
|
480
|
+
type: 'object',
|
|
481
|
+
title: '请求参数配置',
|
|
482
|
+
description: '用于配置当前接口的请求参数数值',
|
|
483
|
+
isRequired: !0,
|
|
484
|
+
},
|
|
485
|
+
filter: {
|
|
486
|
+
title: '过滤器函数体',
|
|
487
|
+
type: 'codearea',
|
|
488
|
+
default: 'return data;',
|
|
489
|
+
description: '用于定义过滤接口数据',
|
|
490
|
+
isRequired: !0,
|
|
491
|
+
},
|
|
492
|
+
},
|
|
493
|
+
propertyOrder: ['dataName', 'body', 'filter'],
|
|
494
|
+
},
|
|
495
|
+
data: {
|
|
496
|
+
title: '数据内容',
|
|
497
|
+
type: 'json',
|
|
498
|
+
default: '{}',
|
|
499
|
+
description: '用于存放DynamicData的数据内容',
|
|
500
|
+
isRequired: !0,
|
|
501
|
+
},
|
|
502
|
+
localFilter: {
|
|
503
|
+
title: '过滤器',
|
|
504
|
+
type: 'codearea',
|
|
505
|
+
default: 'return data;',
|
|
506
|
+
description: '用于定义过滤本地数据',
|
|
507
|
+
isRequired: !0,
|
|
508
|
+
},
|
|
509
|
+
},
|
|
510
|
+
propertyOrder: ['type', 'config', 'data', 'localFilter'],
|
|
511
|
+
},
|
|
512
|
+
datasource: a,
|
|
513
|
+
event: i,
|
|
514
|
+
},
|
|
515
|
+
p = {
|
|
516
|
+
on: {
|
|
517
|
+
type: 'event',
|
|
518
|
+
title: '事件',
|
|
519
|
+
isContainer: !1,
|
|
520
|
+
properties: {
|
|
521
|
+
type: {
|
|
522
|
+
default: 'on',
|
|
523
|
+
type: 'select',
|
|
524
|
+
options: [
|
|
525
|
+
{ label: 'on', value: 'on' },
|
|
526
|
+
{ label: 'emit', value: 'emit' },
|
|
527
|
+
],
|
|
528
|
+
title: '事件类型',
|
|
529
|
+
},
|
|
530
|
+
register: {
|
|
531
|
+
type: 'input',
|
|
532
|
+
default: 'eventName',
|
|
533
|
+
title: '注册事件',
|
|
534
|
+
description: '用于输入注册事件的名称',
|
|
535
|
+
placeholder: '请输入注册事件的名称',
|
|
536
|
+
},
|
|
537
|
+
actionFunc: {
|
|
538
|
+
title: '执行函数',
|
|
539
|
+
type: 'codearea',
|
|
540
|
+
default: '() => {}',
|
|
541
|
+
description: '',
|
|
542
|
+
},
|
|
543
|
+
},
|
|
544
|
+
propertyOrder: ['type', 'register', 'actionFunc'],
|
|
545
|
+
},
|
|
546
|
+
emit: i,
|
|
547
|
+
},
|
|
548
|
+
l = { local: a, remote: s };
|
|
549
|
+
function d(e) {
|
|
550
|
+
return /^http[s]?:\/\/.*/.test(e);
|
|
551
|
+
}
|
|
552
|
+
function f(e) {
|
|
553
|
+
return 'String' === Object.prototype.toString.call(e).slice(8, -1);
|
|
554
|
+
}
|
|
555
|
+
function h(e) {
|
|
556
|
+
return (
|
|
557
|
+
'number' == typeof e ||
|
|
558
|
+
'[object Number]' === Object.prototype.toString.call(e)
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
function v(e) {
|
|
562
|
+
return 'Boolean' === Object.prototype.toString.call(e).slice(8, -1);
|
|
563
|
+
}
|
|
564
|
+
function y(e) {
|
|
565
|
+
return /^\d{4}-\d{2}-\d{2}$/.test(e);
|
|
566
|
+
}
|
|
567
|
+
function b(e) {
|
|
568
|
+
return (
|
|
569
|
+
/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/.test(e) ||
|
|
570
|
+
/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$/.test(e)
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
function m(e) {
|
|
574
|
+
return /^\d{2}:\d{2}:\d{2}$/.test(e) || /^\d{2}:\d{2}$/.test(e);
|
|
575
|
+
}
|
|
576
|
+
function g(e) {
|
|
577
|
+
var t = !1;
|
|
578
|
+
return (
|
|
579
|
+
'Array' === Object.prototype.toString.call(e).slice(8, -1) && (t = !0), t
|
|
580
|
+
);
|
|
581
|
+
}
|
|
582
|
+
function O(e) {
|
|
583
|
+
if (!g(e)) return !1;
|
|
584
|
+
for (var t = 0, r = e.length; t < r; t++) {
|
|
585
|
+
if (!f(e[t])) return !1;
|
|
586
|
+
}
|
|
587
|
+
return !0;
|
|
588
|
+
}
|
|
589
|
+
function E(e) {
|
|
590
|
+
var t = !1;
|
|
591
|
+
return (
|
|
592
|
+
'Object' === Object.prototype.toString.call(e).slice(8, -1) && (t = !0), t
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
function N(e) {
|
|
596
|
+
var t = !1;
|
|
597
|
+
return c.quantity.properties.quantity.enum.indexOf(e) >= 0 && (t = !0), t;
|
|
598
|
+
}
|
|
599
|
+
function w(e) {
|
|
600
|
+
return /^#[0-9a-f]{6}$/.test(e) || /^#[0-9a-f]{3}$/.test(e);
|
|
601
|
+
}
|
|
602
|
+
function _(e) {
|
|
603
|
+
var t = !1;
|
|
604
|
+
return (
|
|
605
|
+
'Function' === Object.prototype.toString.call(e).slice(8, -1) && (t = !0), t
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
function j() {
|
|
609
|
+
var e = {};
|
|
610
|
+
return location.search && (e = n.parse(location.search.substring(1))), e;
|
|
611
|
+
}
|
|
612
|
+
function x(e) {
|
|
613
|
+
var t = '';
|
|
614
|
+
return url && (t = n.stringify(e)), t;
|
|
615
|
+
}
|
|
616
|
+
function S(t) {
|
|
617
|
+
return e(t);
|
|
618
|
+
}
|
|
619
|
+
function D(e, r) {
|
|
620
|
+
if ((V(e) && !V(r)) || (!V(e) && V(r)) || typeof e != typeof r) return !1;
|
|
621
|
+
if (E(e) && (e.id !== r.id || e.lastUpdateTime !== r.lastUpdateTime))
|
|
622
|
+
return !1;
|
|
623
|
+
var n = new Date().getTime();
|
|
624
|
+
return (
|
|
625
|
+
!!(
|
|
626
|
+
E(e) &&
|
|
627
|
+
e.lastUpdateTime &&
|
|
628
|
+
e.lastUpdateTime === r.lastUpdateTime &&
|
|
629
|
+
n - e.lastUpdateTime < 500
|
|
630
|
+
) || t(e, r)
|
|
631
|
+
);
|
|
632
|
+
}
|
|
633
|
+
function A(e, r) {
|
|
634
|
+
if ((V(e) && !V(r)) || (!V(e) && V(r)) || typeof e != typeof r) return !1;
|
|
635
|
+
if (E(e) && (e.id !== r.id || e.lastUpdateTime !== r.lastUpdateTime))
|
|
636
|
+
return !1;
|
|
637
|
+
var n = new Date().getTime();
|
|
638
|
+
return (
|
|
639
|
+
!!(
|
|
640
|
+
E(e) &&
|
|
641
|
+
e.lastUpdateTime &&
|
|
642
|
+
e.lastUpdateTime === r.lastUpdateTime &&
|
|
643
|
+
n - e.lastUpdateTime < 500
|
|
644
|
+
) ||
|
|
645
|
+
!(
|
|
646
|
+
!E(e) ||
|
|
647
|
+
!(
|
|
648
|
+
(V(e.id) && e.id === r.id) ||
|
|
649
|
+
(V(e.lastUpdateTime) && e.lastUpdateTime === r.lastUpdateTime)
|
|
650
|
+
)
|
|
651
|
+
) ||
|
|
652
|
+
t(e, r)
|
|
653
|
+
);
|
|
654
|
+
}
|
|
655
|
+
function V(e) {
|
|
656
|
+
var t = !1;
|
|
657
|
+
return null != e && (t = !0), t;
|
|
658
|
+
}
|
|
659
|
+
function T(e, t) {
|
|
660
|
+
return r(e, t);
|
|
661
|
+
}
|
|
662
|
+
function k(e, t) {
|
|
663
|
+
var r = t || {};
|
|
664
|
+
if (!e) return !1;
|
|
665
|
+
var n = new Function('data', 'with(data) { return (' + e + ');}'),
|
|
666
|
+
o = '';
|
|
667
|
+
try {
|
|
668
|
+
o = n(r);
|
|
669
|
+
} catch (t) {
|
|
670
|
+
return console.warn('表达式运算出错: ' + e + ',报错信息:', t), o;
|
|
671
|
+
}
|
|
672
|
+
return o;
|
|
673
|
+
}
|
|
674
|
+
function C(e, t, r) {
|
|
675
|
+
var n = t;
|
|
676
|
+
if ((r && (n = S(t)), e))
|
|
677
|
+
for (var o = e.split('-'), i = 0, a = o.length; i < a; i++) {
|
|
678
|
+
var s = o[i];
|
|
679
|
+
s && (n = n && n[s]);
|
|
680
|
+
}
|
|
681
|
+
return n;
|
|
682
|
+
}
|
|
683
|
+
function R(e, t, r) {
|
|
684
|
+
var n = t;
|
|
685
|
+
if ((r && (n = S(t)), e))
|
|
686
|
+
for (var o = e.split('-'), i = 0, a = o.length; i < a; i++) {
|
|
687
|
+
var s = o[i];
|
|
688
|
+
if (
|
|
689
|
+
'0' !== s ||
|
|
690
|
+
('array' !== n.type &&
|
|
691
|
+
'radio' !== n.type &&
|
|
692
|
+
'select' !== n.type &&
|
|
693
|
+
'checkboxes' !== n.type) ||
|
|
694
|
+
(!n.options && !n.items)
|
|
695
|
+
) {
|
|
696
|
+
if (s) {
|
|
697
|
+
var u = '0';
|
|
698
|
+
if (n.propertyOrder) u = n.propertyOrder[s];
|
|
699
|
+
else if (n.properties) {
|
|
700
|
+
u = Object.keys(n.properties)[s];
|
|
701
|
+
}
|
|
702
|
+
n = n.properties[u];
|
|
703
|
+
}
|
|
704
|
+
} else n = n.options || n.items;
|
|
705
|
+
}
|
|
706
|
+
return n;
|
|
707
|
+
}
|
|
708
|
+
function P(e, t, r) {
|
|
709
|
+
var n = t;
|
|
710
|
+
if ((r && (n = S(t)), e && n))
|
|
711
|
+
for (var o = e.split('-'), i = 0, a = o.length; i < a; i++) {
|
|
712
|
+
var s = o[i];
|
|
713
|
+
s && n.properties && (n = n.properties[s]);
|
|
714
|
+
}
|
|
715
|
+
return n;
|
|
716
|
+
}
|
|
717
|
+
function U(e, t) {
|
|
718
|
+
for (var r = t, n = '', o = e.split('-'), i = 0, a = o.length; i < a; i++) {
|
|
719
|
+
var s = o[i];
|
|
720
|
+
if ('0' === s && r.items) (r = r.items), (n = n ? n + '-items' : 'items');
|
|
721
|
+
else if ('0' === s && r.options)
|
|
722
|
+
(r = r.options), (n = n ? n + '-options' : 'options');
|
|
723
|
+
else if (s) {
|
|
724
|
+
var u = '0';
|
|
725
|
+
if (r.propertyOrder) u = r.propertyOrder[s];
|
|
726
|
+
else if (r.properties) {
|
|
727
|
+
u = Object.keys(r.properties)[s];
|
|
728
|
+
}
|
|
729
|
+
(r = r.properties[u]), (n = n ? n + '-' + u : u);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
return n;
|
|
733
|
+
}
|
|
734
|
+
function q(e, t) {
|
|
735
|
+
for (var r = t, n = '', o = e.split('-'), i = 0, a = o.length; i < a; i++) {
|
|
736
|
+
var s = o[i];
|
|
737
|
+
if (s) {
|
|
738
|
+
var u = -1;
|
|
739
|
+
if (r.propertyOrder)
|
|
740
|
+
(u = r.propertyOrder.indexOf(s)), (r = r.properties[s]);
|
|
741
|
+
else if (r.properties) {
|
|
742
|
+
(u = Object.keys(r.properties).indexOf(s)), (r = r.properties[s]);
|
|
743
|
+
} else
|
|
744
|
+
r.items
|
|
745
|
+
? ((u = 0), (r = r.items))
|
|
746
|
+
: r.options && ((u = 0), (r = r.options));
|
|
747
|
+
n = n ? n + '-' + u : u.toString();
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
return n;
|
|
751
|
+
}
|
|
752
|
+
function L(e) {
|
|
753
|
+
var t = {};
|
|
754
|
+
return (
|
|
755
|
+
(t =
|
|
756
|
+
e && E(e)
|
|
757
|
+
? (function (e) {
|
|
758
|
+
var t;
|
|
759
|
+
if (E(e)) {
|
|
760
|
+
var r = Object.keys(e);
|
|
761
|
+
e.data && e.filter && 2 === r.length
|
|
762
|
+
? (t = g(e.data) || E(e.data) ? S(l.local) : S(l.remote))
|
|
763
|
+
: e.trigger && e.eventData && 2 === r.length
|
|
764
|
+
? (t = S(p.emit))
|
|
765
|
+
: e.register && e.actionFunc && 2 === r.length
|
|
766
|
+
? (t = S(p.on))
|
|
767
|
+
: e.quantity && N(e.quantity) && 2 === r.length
|
|
768
|
+
? (t = S(c.quantity))
|
|
769
|
+
: ((t = S(c['empty-object'])),
|
|
770
|
+
Object.keys(e).map(function (r) {
|
|
771
|
+
var n = e[r];
|
|
772
|
+
t.properties[r] = L(n);
|
|
773
|
+
}));
|
|
774
|
+
}
|
|
775
|
+
return t;
|
|
776
|
+
})(e)
|
|
777
|
+
: e && g(e)
|
|
778
|
+
? (function (e) {
|
|
779
|
+
var t;
|
|
780
|
+
if (e && g(e))
|
|
781
|
+
if (O(e)) {
|
|
782
|
+
(t = S(c.select)).items.enum = e;
|
|
783
|
+
var r = t.items.enumextra.length,
|
|
784
|
+
n = e.length;
|
|
785
|
+
if (n > r)
|
|
786
|
+
for (var o = r, i = n; o < i; o++)
|
|
787
|
+
t.items.enumextra.push('选项' + e(o));
|
|
788
|
+
} else {
|
|
789
|
+
t = S(c['empty-array']);
|
|
790
|
+
var a = L(e[0]);
|
|
791
|
+
t.items.properties = a.properties;
|
|
792
|
+
}
|
|
793
|
+
return t;
|
|
794
|
+
})(e)
|
|
795
|
+
: (function (e) {
|
|
796
|
+
var t = '';
|
|
797
|
+
if (v(e)) t = S(c.boolean);
|
|
798
|
+
else if (h(e)) t = S(c.number);
|
|
799
|
+
else if (d(e)) t = S(c.url);
|
|
800
|
+
else if (y(e)) t = S(c.date);
|
|
801
|
+
else if (b(e)) t = S(c['date-time']);
|
|
802
|
+
else if (m(e)) t = S(c.time);
|
|
803
|
+
else if (w(e)) t = S(c.color);
|
|
804
|
+
else
|
|
805
|
+
try {
|
|
806
|
+
t = h(JSON.parse(e)) ? S(c.input) : S(c.json);
|
|
807
|
+
} catch (r) {
|
|
808
|
+
t = e && e.length > 30 ? S(c.textarea) : S(c.input);
|
|
809
|
+
}
|
|
810
|
+
return t;
|
|
811
|
+
})(e)),
|
|
812
|
+
t
|
|
813
|
+
);
|
|
814
|
+
}
|
|
815
|
+
function B(e, t) {
|
|
816
|
+
var r = t || {};
|
|
817
|
+
if (E(e) && 'object' === getExpectType(e.type) && e.properties) {
|
|
818
|
+
(e.propertyOrder ? e.propertyOrder : Object.keys(e.properties)).map(
|
|
819
|
+
function (t) {
|
|
820
|
+
var n = e.properties[t];
|
|
821
|
+
r = I(n, r);
|
|
822
|
+
},
|
|
823
|
+
);
|
|
824
|
+
}
|
|
825
|
+
return r;
|
|
826
|
+
}
|
|
827
|
+
function I(e, t) {
|
|
828
|
+
var r = !t,
|
|
829
|
+
n = t || {};
|
|
830
|
+
if (e && '{}' !== JSON.stringify(e)) {
|
|
831
|
+
var o = e.type;
|
|
832
|
+
'object' === o || 'func' === o || 'style' === o || 'data' === o
|
|
833
|
+
? (!r && n.object ? (n.object += 1) : r || (n.object = 1), (n = B(e, n)))
|
|
834
|
+
: 'array' === o
|
|
835
|
+
? (!r && n.array ? (n.array += 1) : r || (n.array = 1),
|
|
836
|
+
(n = B((e = e.items), n)))
|
|
837
|
+
: !r && n[o]
|
|
838
|
+
? (n[o] += 1)
|
|
839
|
+
: r || (n[o] = 1);
|
|
840
|
+
}
|
|
841
|
+
return n;
|
|
842
|
+
}
|
|
843
|
+
function M(e) {
|
|
844
|
+
var t = S(e);
|
|
845
|
+
if (
|
|
846
|
+
(!t.title && t.description && (t.title = t.description),
|
|
847
|
+
t.type || (t.type = t.format),
|
|
848
|
+
('quantity' !== t.type &&
|
|
849
|
+
'array' !== t.type &&
|
|
850
|
+
'datasource' !== t.type &&
|
|
851
|
+
'event' !== t.type &&
|
|
852
|
+
'object' !== t.type) ||
|
|
853
|
+
!V(t.default) ||
|
|
854
|
+
delete t.default,
|
|
855
|
+
'radio' === t.type &&
|
|
856
|
+
((t.type = 'string'),
|
|
857
|
+
t.enum &&
|
|
858
|
+
t.enumextra &&
|
|
859
|
+
((t.items = {
|
|
860
|
+
type: 'string',
|
|
861
|
+
enum: S(t.enum),
|
|
862
|
+
enumextra: S(t.enumextra),
|
|
863
|
+
}),
|
|
864
|
+
delete t.enum,
|
|
865
|
+
delete t.enumextra)),
|
|
866
|
+
'quantity' === t.type)
|
|
867
|
+
) {
|
|
868
|
+
var r = t.properties,
|
|
869
|
+
n = S(c.quantity);
|
|
870
|
+
if (r.quantity && E(r.quantity) && r.quantity.default) {
|
|
871
|
+
var o = r.quantity.default;
|
|
872
|
+
n.properties.quantity.default = 'percent' === o ? '%' : o;
|
|
873
|
+
}
|
|
874
|
+
t = n;
|
|
875
|
+
}
|
|
876
|
+
if ('datasource' === t.type) {
|
|
877
|
+
var i = t.properties,
|
|
878
|
+
a = i.type && i.type.default,
|
|
879
|
+
s = i.data && i.data.default,
|
|
880
|
+
u = i.filter && i.filter.default;
|
|
881
|
+
'local' === a
|
|
882
|
+
? ((t = S(l.local)).properties.data.default = s ? S(s) : '{}')
|
|
883
|
+
: ((t = S(l.remote)).properties.data.default = s ? S(s) : 'http://xxx'),
|
|
884
|
+
(t.properties.filter.default = u ? S(u) : '() => {}');
|
|
885
|
+
}
|
|
886
|
+
if ('event' === t.type) {
|
|
887
|
+
var d = t.properties,
|
|
888
|
+
f = d.type && d.type.default;
|
|
889
|
+
if ('in' === f || 'on' === f) {
|
|
890
|
+
var h = (d.filter && d.filter.default) || '() => {}';
|
|
891
|
+
(t = S(p.on)),
|
|
892
|
+
d.actionFunc &&
|
|
893
|
+
E(d.actionFunc) &&
|
|
894
|
+
(t.properties.actionFunc.default = d.actionFunc.default || S(h));
|
|
895
|
+
} else {
|
|
896
|
+
var v = (d.filter && d.filter.default) || '{}';
|
|
897
|
+
(t = S(p.emit)),
|
|
898
|
+
d.eventData &&
|
|
899
|
+
E(d.eventData) &&
|
|
900
|
+
(t.properties.eventData.default = d.eventData.default || S(v));
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
return (
|
|
904
|
+
t.properties &&
|
|
905
|
+
(t.propertyOrder || (t.propertyOrder = Object.keys(t.properties)),
|
|
906
|
+
t.propertyOrder.map(function (e) {
|
|
907
|
+
t.properties[e] = G(t.properties[e]);
|
|
908
|
+
})),
|
|
909
|
+
t.items && (t.items = G(t.items)),
|
|
910
|
+
t
|
|
911
|
+
);
|
|
912
|
+
}
|
|
913
|
+
function G(e) {
|
|
914
|
+
var t = S(e);
|
|
915
|
+
return (
|
|
916
|
+
t.required || delete t.required,
|
|
917
|
+
t.type && t.type && (t.type = t.type),
|
|
918
|
+
('quantity' !== t.type &&
|
|
919
|
+
'array' !== t.type &&
|
|
920
|
+
'datasource' !== t.type &&
|
|
921
|
+
'event' !== t.type &&
|
|
922
|
+
'object' !== t.type) ||
|
|
923
|
+
!V(t.default) ||
|
|
924
|
+
delete t.default,
|
|
925
|
+
('radio' !== t.type && 'checkboxes' !== t.type && 'select' !== t.type) ||
|
|
926
|
+
(t.items &&
|
|
927
|
+
t.items.enum &&
|
|
928
|
+
t.items.enumextra &&
|
|
929
|
+
((t.options = []),
|
|
930
|
+
t.items.enum.forEach(function (e, r) {
|
|
931
|
+
t.options.push({ label: t.items.enumextra[r] || e, value: e });
|
|
932
|
+
}),
|
|
933
|
+
delete t.items)),
|
|
934
|
+
t.properties &&
|
|
935
|
+
(t.propertyOrder || (t.propertyOrder = Object.keys(t.properties)),
|
|
936
|
+
t.propertyOrder.map(function (e) {
|
|
937
|
+
t.properties[e] = G(t.properties[e]);
|
|
938
|
+
})),
|
|
939
|
+
'array' === t.type && t.items && (t.items = G(t.items)),
|
|
940
|
+
t
|
|
941
|
+
);
|
|
942
|
+
}
|
|
943
|
+
var z = [];
|
|
944
|
+
Object.freeze(z);
|
|
945
|
+
var K = {};
|
|
946
|
+
function F() {
|
|
947
|
+
return ++ft.mobxGuid;
|
|
948
|
+
}
|
|
949
|
+
function J(e) {
|
|
950
|
+
throw (H(!1, e), 'X');
|
|
951
|
+
}
|
|
952
|
+
function H(e, t) {
|
|
953
|
+
if (!e)
|
|
954
|
+
throw new Error(
|
|
955
|
+
'[mobx] ' +
|
|
956
|
+
(t ||
|
|
957
|
+
'An invariant failed, however the error is obfuscated because this is a production build.'),
|
|
958
|
+
);
|
|
959
|
+
}
|
|
960
|
+
function W(e) {
|
|
961
|
+
var t = !1;
|
|
962
|
+
return function () {
|
|
963
|
+
if (!t) return (t = !0), e.apply(this, arguments);
|
|
964
|
+
};
|
|
965
|
+
}
|
|
966
|
+
Object.freeze(K);
|
|
967
|
+
var X = function () {};
|
|
968
|
+
function $(e) {
|
|
969
|
+
return null !== e && 'object' == typeof e;
|
|
970
|
+
}
|
|
971
|
+
function Y(e) {
|
|
972
|
+
if (null === e || 'object' != typeof e) return !1;
|
|
973
|
+
var t = Object.getPrototypeOf(e);
|
|
974
|
+
return t === Object.prototype || null === t;
|
|
975
|
+
}
|
|
976
|
+
function Z(e, t, r) {
|
|
977
|
+
Object.defineProperty(e, t, {
|
|
978
|
+
enumerable: !1,
|
|
979
|
+
writable: !0,
|
|
980
|
+
configurable: !0,
|
|
981
|
+
value: r,
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
function Q(e, t) {
|
|
985
|
+
var r = Object.getOwnPropertyDescriptor(e, t);
|
|
986
|
+
return !r || (!1 !== r.configurable && !1 !== r.writable);
|
|
987
|
+
}
|
|
988
|
+
function ee(e, t) {
|
|
989
|
+
var r = 'isMobX' + e;
|
|
990
|
+
return (
|
|
991
|
+
(t.prototype[r] = !0),
|
|
992
|
+
function (e) {
|
|
993
|
+
return $(e) && !0 === e[r];
|
|
994
|
+
}
|
|
995
|
+
);
|
|
996
|
+
}
|
|
997
|
+
function te(e) {
|
|
998
|
+
return e instanceof Map;
|
|
999
|
+
}
|
|
1000
|
+
function re(e) {
|
|
1001
|
+
return e instanceof Set;
|
|
1002
|
+
}
|
|
1003
|
+
function ne(e) {
|
|
1004
|
+
var t = new Set();
|
|
1005
|
+
for (var r in e) t.add(r);
|
|
1006
|
+
return (
|
|
1007
|
+
Object.getOwnPropertySymbols(e).forEach(function (r) {
|
|
1008
|
+
Object.getOwnPropertyDescriptor(e, r).enumerable && t.add(r);
|
|
1009
|
+
}),
|
|
1010
|
+
Array.from(t)
|
|
1011
|
+
);
|
|
1012
|
+
}
|
|
1013
|
+
function oe(e) {
|
|
1014
|
+
return e && e.toString ? e.toString() : new String(e).toString();
|
|
1015
|
+
}
|
|
1016
|
+
function ie(e) {
|
|
1017
|
+
return null === e ? null : 'object' == typeof e ? '' + e : e;
|
|
1018
|
+
}
|
|
1019
|
+
var ae =
|
|
1020
|
+
'undefined' != typeof Reflect && Reflect.ownKeys
|
|
1021
|
+
? Reflect.ownKeys
|
|
1022
|
+
: Object.getOwnPropertySymbols
|
|
1023
|
+
? function (e) {
|
|
1024
|
+
return Object.getOwnPropertyNames(e).concat(
|
|
1025
|
+
Object.getOwnPropertySymbols(e),
|
|
1026
|
+
);
|
|
1027
|
+
}
|
|
1028
|
+
: Object.getOwnPropertyNames,
|
|
1029
|
+
se = Symbol('mobx administration'),
|
|
1030
|
+
ue = (function () {
|
|
1031
|
+
function e(e) {
|
|
1032
|
+
void 0 === e && (e = 'Atom@' + F()),
|
|
1033
|
+
(this.name = e),
|
|
1034
|
+
(this.isPendingUnobservation = !1),
|
|
1035
|
+
(this.isBeingObserved = !1),
|
|
1036
|
+
(this.observers = new Set()),
|
|
1037
|
+
(this.diffValue = 0),
|
|
1038
|
+
(this.lastAccessedBy = 0),
|
|
1039
|
+
(this.lowestObserverState = Le.NOT_TRACKING);
|
|
1040
|
+
}
|
|
1041
|
+
return (
|
|
1042
|
+
(e.prototype.onBecomeObserved = function () {
|
|
1043
|
+
this.onBecomeObservedListeners &&
|
|
1044
|
+
this.onBecomeObservedListeners.forEach(function (e) {
|
|
1045
|
+
return e();
|
|
1046
|
+
});
|
|
1047
|
+
}),
|
|
1048
|
+
(e.prototype.onBecomeUnobserved = function () {
|
|
1049
|
+
this.onBecomeUnobservedListeners &&
|
|
1050
|
+
this.onBecomeUnobservedListeners.forEach(function (e) {
|
|
1051
|
+
return e();
|
|
1052
|
+
});
|
|
1053
|
+
}),
|
|
1054
|
+
(e.prototype.reportObserved = function () {
|
|
1055
|
+
return gt(this);
|
|
1056
|
+
}),
|
|
1057
|
+
(e.prototype.reportChanged = function () {
|
|
1058
|
+
bt(),
|
|
1059
|
+
(function (e) {
|
|
1060
|
+
if (e.lowestObserverState === Le.STALE) return;
|
|
1061
|
+
(e.lowestObserverState = Le.STALE),
|
|
1062
|
+
e.observers.forEach(function (t) {
|
|
1063
|
+
t.dependenciesState === Le.UP_TO_DATE &&
|
|
1064
|
+
(t.isTracing !== Be.NONE && Ot(t, e), t.onBecomeStale()),
|
|
1065
|
+
(t.dependenciesState = Le.STALE);
|
|
1066
|
+
});
|
|
1067
|
+
})(this),
|
|
1068
|
+
mt();
|
|
1069
|
+
}),
|
|
1070
|
+
(e.prototype.toString = function () {
|
|
1071
|
+
return this.name;
|
|
1072
|
+
}),
|
|
1073
|
+
e
|
|
1074
|
+
);
|
|
1075
|
+
})(),
|
|
1076
|
+
ce = ee('Atom', ue);
|
|
1077
|
+
function pe(e, t, r) {
|
|
1078
|
+
void 0 === t && (t = X), void 0 === r && (r = X);
|
|
1079
|
+
var n,
|
|
1080
|
+
o = new ue(e);
|
|
1081
|
+
return t !== X && Pt('onBecomeObserved', o, t, n), r !== X && Rt(o, r), o;
|
|
1082
|
+
}
|
|
1083
|
+
var le = {
|
|
1084
|
+
identity: function (e, t) {
|
|
1085
|
+
return e === t;
|
|
1086
|
+
},
|
|
1087
|
+
structural: function (e, t) {
|
|
1088
|
+
return _r(e, t);
|
|
1089
|
+
},
|
|
1090
|
+
default: function (e, t) {
|
|
1091
|
+
return Object.is(e, t);
|
|
1092
|
+
},
|
|
1093
|
+
shallow: function (e, t) {
|
|
1094
|
+
return _r(e, t, 1);
|
|
1095
|
+
},
|
|
1096
|
+
},
|
|
1097
|
+
de = function (e, t) {
|
|
1098
|
+
return (
|
|
1099
|
+
(de =
|
|
1100
|
+
Object.setPrototypeOf ||
|
|
1101
|
+
({ __proto__: [] } instanceof Array &&
|
|
1102
|
+
function (e, t) {
|
|
1103
|
+
e.__proto__ = t;
|
|
1104
|
+
}) ||
|
|
1105
|
+
function (e, t) {
|
|
1106
|
+
for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]);
|
|
1107
|
+
}),
|
|
1108
|
+
de(e, t)
|
|
1109
|
+
);
|
|
1110
|
+
};
|
|
2
1111
|
/*! *****************************************************************************
|
|
3
1112
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
1113
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -12,4 +1121,3415 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
12
1121
|
|
|
13
1122
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
1123
|
and limitations under the License.
|
|
15
|
-
***************************************************************************** */var fe=function(){return fe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},fe.apply(this,arguments)};function ve(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function ye(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function he(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ye(arguments[t]));return e}var be=Symbol("mobx did run lazy initializers"),me=Symbol("mobx pending decorators"),ge={},Oe={};function we(e){var t,r;if(!0!==e[be]){var n=e[me];if(n){Z(e,be,!0);var i=he(Object.getOwnPropertySymbols(n),Object.keys(n));try{for(var o=ve(i),a=o.next();!a.done;a=o.next()){var s=n[a.value];s.propertyCreator(e,s.prop,s.descriptor,s.decoratorTarget,s.decoratorArguments)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}}}}function Ee(e,t){return function(){var r,n=function(n,i,o,a){if(!0===a)return t(n,i,o,n,r),null;if("production"===process.env.NODE_ENV||Ne(arguments)||J("This function is a decorator, but it wasn't invoked like a decorator"),!Object.prototype.hasOwnProperty.call(n,me)){var s=n[me];Z(n,me,fe({},s))}return n[me][i]={prop:i,propertyCreator:t,descriptor:o,decoratorTarget:n,decoratorArguments:r},function(e,t){var r=t?ge:Oe;return r[e]||(r[e]={configurable:!0,enumerable:t,get:function(){return we(this),this[e]},set:function(t){we(this),this[e]=t}})}(i,e)};return Ne(arguments)?(r=G,n.apply(null,arguments)):(r=Array.prototype.slice.call(arguments),n)}}function Ne(e){return(2===e.length||3===e.length)&&("string"==typeof e[1]||"symbol"==typeof e[1])||4===e.length&&!0===e[3]}function _e(e,t,r){return qt(e)?e:Array.isArray(e)?Ie.array(e,{name:r}):Y(e)?Ie.object(e,void 0,{name:r}):te(e)?Ie.map(e,{name:r}):re(e)?Ie.set(e,{name:r}):e}function je(e){return e}function Se(e){H(e);var t=Ee(!0,(function(t,r,n,i,o){"production"!==process.env.NODE_ENV&&H(!n||!n.get,'@observable cannot be used on getter (property "'+ie(r)+'"), use @computed instead.');var a=n?n.initializer?n.initializer.call(t):n.value:void 0;fr(t).addObservableProp(r,a,e)})),r="undefined"!=typeof process&&process.env&&"production"!==process.env.NODE_ENV?function(){return arguments.length<2?J("Incorrect decorator invocation. @observable decorator doesn't expect any arguments"):t.apply(null,arguments)}:t;return r.enhancer=e,r}var xe={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function Ce(e){/^(deep|name|equals|defaultDecorator|proxy)$/.test(e)||J("invalid option for (extend)observable: "+e)}function De(e){if(null==e)return xe;if("string"==typeof e)return{name:e,deep:!0,proxy:!0};if("production"!==process.env.NODE_ENV){if("object"!=typeof e)return J("expected options object");Object.keys(e).forEach(Ce)}return e}Object.freeze(xe);var Ae=Se(_e),Te=Se((function(e,t,r){return null==e||mr(e)||ir(e)||lr(e)||cr(e)?e:Array.isArray(e)?Ie.array(e,{name:r,deep:!1}):Y(e)?Ie.object(e,void 0,{name:r,deep:!1}):te(e)?Ie.map(e,{name:r,deep:!1}):re(e)?Ie.set(e,{name:r,deep:!1}):J("production"!==process.env.NODE_ENV&&"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")})),Ve=Se(je),Re=Se((function(e,t,r){if("production"!==process.env.NODE_ENV&&qt(e))throw"observable.struct should not be used with observable values";return _r(e,t)?t:e}));function ke(e){return e.defaultDecorator?e.defaultDecorator.enhancer:!1===e.deep?je:_e}var Pe={box:function(e,t){arguments.length>2&&Me("box");var r=De(t);return new at(e,ke(r),r.name,!0,r.equals)},array:function(e,t){arguments.length>2&&Me("array");var r=De(t);return function(e,t,r,n){void 0===r&&(r="ObservableArray@"+z());void 0===n&&(n=!1);var i=new er(r,t,n);o=i.values,a=se,s=i,Object.defineProperty(o,a,{enumerable:!1,writable:!1,configurable:!0,value:s});var o,a,s;var l=new Proxy(i.values,Qt);if(i.proxy=l,e&&e.length){var u=it(!0);i.spliceWithArray(0,0,e),ot(u)}return l}(e,ke(r),r.name)},map:function(e,t){arguments.length>2&&Me("map");var r=De(t);return new sr(e,ke(r),r.name)},set:function(e,t){arguments.length>2&&Me("set");var r=De(t);return new pr(e,ke(r),r.name)},object:function(e,t,r){"string"==typeof arguments[1]&&Me("object");var n=De(r);if(!1===n.proxy)return It({},e,t,n);var i=Mt(n),o=function(e){var t=new Proxy(e,Jt);return e[se].proxy=t,t}(It({},void 0,void 0,n));return Bt(o,e,t,i),o},ref:Ve,shallow:Te,deep:Ae,struct:Re},Ie=function(e,t,r){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return Ae.apply(null,arguments);if(qt(e))return e;var n=Y(e)?Ie.object(e,t,r):Array.isArray(e)?Ie.array(e,t):te(e)?Ie.map(e,t):re(e)?Ie.set(e,t):e;if(n!==e)return n;J("production"!==process.env.NODE_ENV&&"The provided value could not be converted into an observable. If you want just create an observable reference to the object use 'observable.box(value)'")};function Me(e){J("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(Pe).forEach((function(e){return Ie[e]=Pe[e]}));var Be,Le,Ue=Ee(!1,(function(e,t,r,n,i){"production"!==process.env.NODE_ENV&&H(r&&r.get,"Trying to declare a computed value for unspecified getter '"+ie(t)+"'");var o=r.get,a=r.set,s=i[0]||{};fr(e).addComputedProp(e,t,fe({get:o,set:a,context:e},s))}));Ue({equals:ce.structural}),function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(Be||(Be={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(Le||(Le={}));var qe=function(e){this.cause=e};function Fe(e){return e instanceof qe}function Ge(e){switch(e.dependenciesState){case Be.UP_TO_DATE:return!1;case Be.NOT_TRACKING:case Be.STALE:return!0;case Be.POSSIBLY_STALE:for(var t=Xe(!0),r=We(),n=e.observing,i=n.length,o=0;o<i;o++){var a=n[o];if(lt(a)){if(ft.disableErrorBoundaries)a.get();else try{a.get()}catch(e){return $e(r),Ye(t),!0}if(e.dependenciesState===Be.STALE)return $e(r),Ye(t),!0}}return Ze(e),$e(r),Ye(t),!1}}function Ke(e){var t=e.observers.size>0;ft.computationDepth>0&&t&&J("production"!==process.env.NODE_ENV&&"Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: "+e.name),ft.allowStateChanges||!t&&"strict"!==ft.enforceActions||J("production"!==process.env.NODE_ENV&&(ft.enforceActions?"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ")+e.name)}function ze(e,t,r){var n=Xe(!0);Ze(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++ft.runId;var i,o=ft.trackingDerivation;if(ft.trackingDerivation=e,!0===ft.disableErrorBoundaries)i=t.call(r);else try{i=t.call(r)}catch(e){i=new qe(e)}return ft.trackingDerivation=o,function(e){for(var t=e.observing,r=e.observing=e.newObserving,n=Be.UP_TO_DATE,i=0,o=e.unboundDepsCount,a=0;a<o;a++){0===(s=r[a]).diffValue&&(s.diffValue=1,i!==a&&(r[i]=s),i++),s.dependenciesState>n&&(n=s.dependenciesState)}r.length=i,e.newObserving=null,o=t.length;for(;o--;){0===(s=t[o]).diffValue&&yt(s,e),s.diffValue=0}for(;i--;){var s;1===(s=r[i]).diffValue&&(s.diffValue=0,vt(s,e))}n!==Be.UP_TO_DATE&&(e.dependenciesState=n,e.onBecomeStale())}(e),function(e){if("production"===process.env.NODE_ENV)return;if(0!==e.observing.length)return;(ft.reactionRequiresObservable||e.requiresObservable)&&console.warn("[mobx] Derivation "+e.name+" is created/updated without reading any observable value")}(e),Ye(n),i}function Je(e){var t=e.observing;e.observing=[];for(var r=t.length;r--;)yt(t[r],e);e.dependenciesState=Be.NOT_TRACKING}function He(e){var t=We();try{return e()}finally{$e(t)}}function We(){var e=ft.trackingDerivation;return ft.trackingDerivation=null,e}function $e(e){ft.trackingDerivation=e}function Xe(e){var t=ft.allowStateReads;return ft.allowStateReads=e,t}function Ye(e){ft.allowStateReads=e}function Ze(e){if(e.dependenciesState!==Be.UP_TO_DATE){e.dependenciesState=Be.UP_TO_DATE;for(var t=e.observing,r=t.length;r--;)t[r].lowestObserverState=Be.UP_TO_DATE}}var Qe=0,et=1,tt=Object.getOwnPropertyDescriptor((function(){}),"name"),rt=tt&&tt.configurable;function nt(e,t,r){"production"!==process.env.NODE_ENV&&(H("function"==typeof t,"`action` can only be invoked on functions"),"string"==typeof e&&e||J("actions should have valid names, got: '"+e+"'"));var n=function(){return function(e,t,r,n){var i=function(e,t,r){var n=Ct()&&!!e,i=0;if(n&&"production"!==process.env.NODE_ENV){i=Date.now();var o=r&&r.length||0,a=new Array(o);if(o>0)for(var s=0;s<o;s++)a[s]=r[s];At({type:"action",name:e,object:t,arguments:a})}var l=We();bt();var u=it(!0),p=Xe(!0),c={prevDerivation:l,prevAllowStateChanges:u,prevAllowStateReads:p,notifySpy:n,startTime:i,actionId:et++,parentActionId:Qe};return Qe=c.actionId,c}(e,r,n);try{return t.apply(r,n)}catch(e){throw i.error=e,e}finally{!function(e){Qe!==e.actionId&&J("invalid action stack. did you forget to finish an action?");Qe=e.parentActionId,void 0!==e.error&&(ft.suppressReactionErrors=!0);ot(e.prevAllowStateChanges),Ye(e.prevAllowStateReads),mt(),$e(e.prevDerivation),e.notifySpy&&"production"!==process.env.NODE_ENV&&Vt({time:Date.now()-e.startTime});ft.suppressReactionErrors=!1}(i)}}(e,t,r||this,arguments)};return n.isMobxAction=!0,"production"!==process.env.NODE_ENV&&rt&&Object.defineProperty(n,"name",{value:e}),n}function it(e){var t=ft.allowStateChanges;return ft.allowStateChanges=e,t}function ot(e){ft.allowStateChanges=e}var at=function(e){function t(t,r,n,i,o){void 0===n&&(n="ObservableValue@"+z()),void 0===i&&(i=!0),void 0===o&&(o=ce.default);var a=e.call(this,n)||this;return a.enhancer=r,a.name=n,a.equals=o,a.hasUnreportedChange=!1,a.value=r(t,void 0,n),i&&Ct()&&"production"!==process.env.NODE_ENV&&Dt({type:"create",name:a.name,newValue:""+a.value}),a}return function(e,t){function r(){this.constructor=e}de(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.prototype.set=function(e){var t=this.value;if((e=this.prepareNewValue(e))!==ft.UNCHANGED){var r=Ct();r&&"production"!==process.env.NODE_ENV&&At({type:"update",name:this.name,newValue:e,oldValue:t}),this.setNewValue(e),r&&"production"!==process.env.NODE_ENV&&Vt()}},t.prototype.prepareNewValue=function(e){if(Ke(this),Ht(this)){var t=$t(this,{object:this,type:"update",newValue:e});if(!t)return ft.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?ft.UNCHANGED:e},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),Xt(this)&&Zt(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return Wt(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),Yt(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return oe(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(le);ee("ObservableValue",at);var st=function(){function e(e){this.dependenciesState=Be.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Be.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+z(),this.value=new qe(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Le.NONE,H(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+z(),e.set&&(this.setter=nt(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?ce.structural:ce.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return e.prototype.onBecomeStale=function(){!function(e){if(e.lowestObserverState!==Be.UP_TO_DATE)return;e.lowestObserverState=Be.POSSIBLY_STALE,e.observers.forEach((function(t){t.dependenciesState===Be.UP_TO_DATE&&(t.dependenciesState=Be.POSSIBLY_STALE,t.isTracing!==Le.NONE&&Ot(t,e),t.onBecomeStale())}))}(this)},e.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(e){return e()}))},e.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(e){return e()}))},e.prototype.get=function(){this.isComputing&&J("Cycle detected in computation "+this.name+": "+this.derivation),0!==ft.inBatch||0!==this.observers.size||this.keepAlive?(gt(this),Ge(this)&&this.trackAndCompute()&&function(e){if(e.lowestObserverState===Be.STALE)return;e.lowestObserverState=Be.STALE,e.observers.forEach((function(t){t.dependenciesState===Be.POSSIBLY_STALE?t.dependenciesState=Be.STALE:t.dependenciesState===Be.UP_TO_DATE&&(e.lowestObserverState=Be.UP_TO_DATE)}))}(this)):Ge(this)&&(this.warnAboutUntrackedRead(),bt(),this.value=this.computeValue(!1),mt());var e=this.value;if(Fe(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(Fe(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){H(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else H(!1,"production"!==process.env.NODE_ENV&&"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},e.prototype.trackAndCompute=function(){Ct()&&"production"!==process.env.NODE_ENV&&Dt({object:this.scope,type:"compute",name:this.name});var e=this.value,t=this.dependenciesState===Be.NOT_TRACKING,r=this.computeValue(!0),n=t||Fe(e)||Fe(r)||!this.equals(e,r);return n&&(this.value=r),n},e.prototype.computeValue=function(e){var t;if(this.isComputing=!0,ft.computationDepth++,e)t=ze(this,this.derivation,this.scope);else if(!0===ft.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new qe(e)}return ft.computationDepth--,this.isComputing=!1,t},e.prototype.suspend=function(){this.keepAlive||(Je(this),this.value=void 0)},e.prototype.observe=function(e,t){var r=this,n=!0,i=void 0;return function(e,t){void 0===t&&(t=K);"production"!==process.env.NODE_ENV&&(H("function"==typeof e,"Autorun expects a function as first argument"),H(!1==("function"==typeof(r=e)&&!0===r.isMobxAction),"Autorun does not accept actions since actions are untrackable"));var r;var n,i=t&&t.name||e.name||"Autorun@"+z();if(t.scheduler||t.delay){var o=function(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Rt}(t),a=!1;n=new Et(i,(function(){a||(a=!0,o((function(){a=!1,n.isDisposed||n.track(s)})))}),t.onError,t.requiresObservable)}else n=new Et(i,(function(){this.track(s)}),t.onError,t.requiresObservable);function s(){e(n)}return n.schedule(),n.getDisposer()}((function(){var o=r.get();if(!n||t){var a=We();e({type:"update",object:r,newValue:o,oldValue:i}),$e(a)}n=!1,i=o}))},e.prototype.warnAboutUntrackedRead=function(){"production"!==process.env.NODE_ENV&&(!0===this.requiresReaction&&J("[mobx] Computed value "+this.name+" is read outside a reactive context"),this.isTracing!==Le.NONE&&console.log("[mobx.trace] '"+this.name+"' is being read outside a reactive context. Doing a full recompute"),ft.computedRequiresReaction&&console.warn("[mobx] Computed value "+this.name+" is being read outside a reactive context. Doing a full recompute"))},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return oe(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(),lt=ee("ComputedValue",st),ut=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},pt={};function ct(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:pt}var dt=!0,ft=function(){var e=ct();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(dt=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new ut).version&&(dt=!1),dt?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new ut):(setTimeout((function(){J("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new ut)}();function vt(e,t){e.observers.add(t),e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function yt(e,t){e.observers.delete(t),0===e.observers.size&&ht(e)}function ht(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,ft.pendingUnobservations.push(e))}function bt(){ft.inBatch++}function mt(){if(0==--ft.inBatch){jt();for(var e=ft.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,0===r.observers.size&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBecomeUnobserved()),r instanceof st&&r.suspend())}ft.pendingUnobservations=[]}}function gt(e){!function(e){"production"!==process.env.NODE_ENV&&!ft.allowStateReads&&ft.observableRequiresReaction&&console.warn("[mobx] Observable "+e.name+" being read outside a reactive context")}(e);var t=ft.trackingDerivation;return null!==t?(t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e,e.isBeingObserved||(e.isBeingObserved=!0,e.onBecomeObserved())),!0):(0===e.observers.size&&ft.inBatch>0&&ht(e),!1)}function Ot(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===Le.BREAK){var r=[];wt(Lt(gr(e,n)),r,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof st?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+r.join("\n")+"\n*/\n ")()}var n}function wt(e,t,r){t.length>=1e3?t.push("(and many more)"):(t.push(""+new Array(r).join("\t")+e.name),e.dependencies&&e.dependencies.forEach((function(e){return wt(e,t,r+1)})))}var Et=function(){function e(e,t,r,n){void 0===e&&(e="Reaction@"+z()),void 0===n&&(n=!1),this.name=e,this.onInvalidate=t,this.errorHandler=r,this.requiresObservable=n,this.observing=[],this.newObserving=[],this.dependenciesState=Be.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+z(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Le.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,ft.pendingReactions.push(this),jt())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(bt(),this._isScheduled=!1,Ge(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Ct()&&"production"!==process.env.NODE_ENV&&Dt({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}mt()}},e.prototype.track=function(e){if(!this.isDisposed){bt();var t,r=Ct();r&&"production"!==process.env.NODE_ENV&&(t=Date.now(),At({name:this.name,type:"reaction"})),this._isRunning=!0;var n=ze(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&Je(this),Fe(n)&&this.reportExceptionInDerivation(n.cause),r&&"production"!==process.env.NODE_ENV&&Vt({time:Date.now()-t}),mt()}},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(ft.disableErrorBoundaries)throw e;var r="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";ft.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(r,e),Ct()&&Dt({type:"error",name:this.name,message:r,error:""+e}),ft.globalReactionErrorHandlers.forEach((function(r){return r(e,t)}))}},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(bt(),Je(this),mt()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[se]=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=!1;"boolean"==typeof e[e.length-1]&&(r=e.pop());var n=function(e){switch(e.length){case 0:return ft.trackingDerivation;case 1:return gr(e[0]);case 2:return gr(e[0],e[1])}}(e);if(!n)return J("production"!==process.env.NODE_ENV&&"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");n.isTracing===Le.NONE&&console.log("[mobx.trace] '"+n.name+"' tracing enabled");n.isTracing=r?Le.BREAK:Le.LOG}(this,e)},e}(),Nt=100,_t=function(e){return e()};function jt(){ft.inBatch>0||ft.isRunningReactions||_t(St)}function St(){ft.isRunningReactions=!0;for(var e=ft.pendingReactions,t=0;e.length>0;){++t===Nt&&(console.error("Reaction doesn't converge to a stable state after "+Nt+" iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction()}ft.isRunningReactions=!1}var xt=ee("Reaction",Et);function Ct(){return"production"!==process.env.NODE_ENV&&!!ft.spyListeners.length}function Dt(e){if("production"!==process.env.NODE_ENV&&ft.spyListeners.length)for(var t=ft.spyListeners,r=0,n=t.length;r<n;r++)t[r](e)}function At(e){"production"!==process.env.NODE_ENV&&Dt(fe(fe({},e),{spyReportStart:!0}))}var Tt={spyReportEnd:!0};function Vt(e){"production"!==process.env.NODE_ENV&&Dt(e?fe(fe({},e),{spyReportEnd:!0}):Tt)}var Rt=function(e){return e()};function kt(e,t,r){return Pt("onBecomeUnobserved",e,t,r)}function Pt(e,t,r,n){var i="function"==typeof n?gr(t,r):gr(t),o="function"==typeof n?n:r,a=e+"Listeners";return i[a]?i[a].add(o):i[a]=new Set([o]),"function"!=typeof i[e]?J("production"!==process.env.NODE_ENV&&"Not an atom that can be (un)observed"):function(){var e=i[a];e&&(e.delete(o),0===e.size&&delete i[a])}}function It(e,t,r,n){"production"!==process.env.NODE_ENV&&(H(arguments.length>=2&&arguments.length<=4,"'extendObservable' expected 2-4 arguments"),H("object"==typeof e,"'extendObservable' expects an object as first argument"),H(!lr(e),"'extendObservable' should not be used on maps, use map.merge instead"));var i=Mt(n=De(n));return we(e),fr(e,n.name,i.enhancer),t&&Bt(e,t,r,i),e}function Mt(e){return e.defaultDecorator||(!1===e.deep?Ve:Ae)}function Bt(e,t,r,n){var i,o,a,s;if("production"!==process.env.NODE_ENV&&(H(!qt(t),"Extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540"),r)){var l=ne(r);try{for(var u=ve(l),p=u.next();!p.done;p=u.next()){(f=p.value)in t||J("Trying to declare a decorator for unspecified property '"+ie(f)+"'")}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}bt();try{l=ae(t);try{for(var c=ve(l),d=c.next();!d.done;d=c.next()){var f=d.value,v=Object.getOwnPropertyDescriptor(t,f);"production"!==process.env.NODE_ENV&&(Y(t)||J("'extendObservable' only accepts plain objects as second argument"),Ut(v.value)&&J("Passing a 'computed' as initial property value is no longer supported by extendObservable. Use a getter or decorator instead"));var y=r&&f in r?r[f]:v.get?Ue:n;"production"!==process.env.NODE_ENV&&"function"!=typeof y&&J("Not a valid decorator for '"+ie(f)+"', got: "+y);var h=y(e,f,v,!0);h&&Object.defineProperty(e,f,h)}}catch(e){a={error:e}}finally{try{d&&!d.done&&(s=c.return)&&s.call(c)}finally{if(a)throw a.error}}}finally{mt()}}function Lt(e){var t,r,n={name:e.name};return e.observing&&e.observing.length>0&&(n.dependencies=(t=e.observing,r=[],t.forEach((function(e){-1===r.indexOf(e)&&r.push(e)})),r).map(Lt)),n}function Ut(e){return arguments.length>1?J("production"!==process.env.NODE_ENV&&"isComputed expects only 1 argument. Use isObservableProp to inspect the observability of a property"):function(e,t){if(null==e)return!1;if(void 0!==t){if(!1===mr(e))return!1;if(!e[se].values.has(t))return!1;var r=gr(e,t);return lt(r)}return lt(e)}(e)}function qt(e){return 1!==arguments.length&&J("production"!==process.env.NODE_ENV&&"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),function(e,t){return null!=e&&(void 0!==t?"production"!==process.env.NODE_ENV&&(lr(e)||ir(e))?J("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):!!mr(e)&&e[se].values.has(t):mr(e)||!!e[se]||ue(e)||xt(e)||lt(e))}(e)}function Ft(e,t,r){if(2!==arguments.length||cr(e))if(mr(e)){var n=e[se];n.values.get(t)?n.write(t,r):n.addObservableProp(t,r,n.defaultEnhancer)}else if(lr(e))e.set(t,r);else if(cr(e))e.add(t);else{if(!ir(e))return J("production"!==process.env.NODE_ENV&&"'set()' can only be used on observable objects, arrays and maps");"number"!=typeof t&&(t=parseInt(t,10)),H(t>=0,"Not a valid index: '"+t+"'"),bt(),t>=e.length&&(e.length=t+1),e[t]=r,mt()}else{bt();var i=t;try{for(var o in i)Ft(e,o,i[o])}finally{mt()}}}function Gt(e,t){void 0===t&&(t=void 0),bt();try{return e.apply(t)}finally{mt()}}function Kt(e){return e[se]}function zt(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e}var Jt={has:function(e,t){if(t===se||"constructor"===t||t===be)return!0;var r=Kt(e);return zt(t)?r.has(t):t in e},get:function(e,t){if(t===se||"constructor"===t||t===be)return e[t];var r=Kt(e),n=r.values.get(t);if(n instanceof le){var i=n.get();return void 0===i&&r.has(t),i}return zt(t)&&r.has(t),e[t]},set:function(e,t,r){return!!zt(t)&&(Ft(e,t,r),!0)},deleteProperty:function(e,t){return!!zt(t)&&(Kt(e).remove(t),!0)},ownKeys:function(e){return Kt(e).keysAtom.reportObserved(),Reflect.ownKeys(e)},preventExtensions:function(e){return J("Dynamic observable objects cannot be frozen"),!1}};function Ht(e){return void 0!==e.interceptors&&e.interceptors.length>0}function Wt(e,t){var r=e.interceptors||(e.interceptors=[]);return r.push(t),W((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function $t(e,t){var r=We();try{for(var n=he(e.interceptors||[]),i=0,o=n.length;i<o&&(H(!(t=n[i](t))||t.type,"Intercept handlers should return nothing or a change object"),t);i++);return t}finally{$e(r)}}function Xt(e){return void 0!==e.changeListeners&&e.changeListeners.length>0}function Yt(e,t){var r=e.changeListeners||(e.changeListeners=[]);return r.push(t),W((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function Zt(e,t){var r=We(),n=e.changeListeners;if(n){for(var i=0,o=(n=n.slice()).length;i<o;i++)n[i](t);$e(r)}}var Qt={get:function(e,t){return t===se?e[se]:"length"===t?e[se].getArrayLength():"number"==typeof t?tr.get.call(e,t):"string"!=typeof t||isNaN(t)?tr.hasOwnProperty(t)?tr[t]:e[t]:tr.get.call(e,parseInt(t))},set:function(e,t,r){return"length"===t&&e[se].setArrayLength(r),"number"==typeof t&&tr.set.call(e,t,r),"symbol"==typeof t||isNaN(t)?e[t]=r:tr.set.call(e,parseInt(t),r),!0},preventExtensions:function(e){return J("Observable arrays cannot be frozen"),!1}};var er=function(){function e(e,t,r){this.owned=r,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new le(e||"ObservableArray@"+z()),this.enhancer=function(r,n){return t(r,n,e+"[..]")}}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.dehanceValues=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return Wt(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Yt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var r=new Array(e-t),n=0;n<e-t;n++)r[n]=void 0;this.spliceWithArray(t,0,r)}else this.spliceWithArray(e,t-e)},e.prototype.updateArrayLength=function(e,t){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=t},e.prototype.spliceWithArray=function(e,t,r){var n=this;Ke(this.atom);var i=this.values.length;if(void 0===e?e=0:e>i?e=i:e<0&&(e=Math.max(0,i+e)),t=1===arguments.length?i-e:null==t?0:Math.max(0,Math.min(t,i-e)),void 0===r&&(r=G),Ht(this)){var o=$t(this,{object:this.proxy,type:"splice",index:e,removedCount:t,added:r});if(!o)return G;t=o.removedCount,r=o.added}if(r=0===r.length?r:r.map((function(e){return n.enhancer(e,void 0)})),"production"!==process.env.NODE_ENV){var a=r.length-t;this.updateArrayLength(i,a)}var s=this.spliceItemsIntoValues(e,t,r);return 0===t&&0===r.length||this.notifyArraySplice(e,r,s),this.dehanceValues(s)},e.prototype.spliceItemsIntoValues=function(e,t,r){var n;if(r.length<1e4)return(n=this.values).splice.apply(n,he([e,t],r));var i=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(r,this.values.slice(e+t)),i},e.prototype.notifyArrayChildUpdate=function(e,t,r){var n=!this.owned&&Ct(),i=Xt(this),o=i||n?{object:this.proxy,type:"update",index:e,newValue:t,oldValue:r}:null;n&&"production"!==process.env.NODE_ENV&&At(fe(fe({},o),{name:this.atom.name})),this.atom.reportChanged(),i&&Zt(this,o),n&&"production"!==process.env.NODE_ENV&&Vt()},e.prototype.notifyArraySplice=function(e,t,r){var n=!this.owned&&Ct(),i=Xt(this),o=i||n?{object:this.proxy,type:"splice",index:e,removed:r,added:t,removedCount:r.length,addedCount:t.length}:null;n&&"production"!==process.env.NODE_ENV&&At(fe(fe({},o),{name:this.atom.name})),this.atom.reportChanged(),i&&Zt(this,o),n&&"production"!==process.env.NODE_ENV&&Vt()},e}(),tr={intercept:function(e){return this[se].intercept(e)},observe:function(e,t){return void 0===t&&(t=!1),this[se].observe(e,t)},clear:function(){return this.splice(0)},replace:function(e){var t=this[se];return t.spliceWithArray(0,t.values.length,e)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=this[se];switch(arguments.length){case 0:return[];case 1:return i.spliceWithArray(e);case 2:return i.spliceWithArray(e,t)}return i.spliceWithArray(e,t,r)},spliceWithArray:function(e,t,r){return this[se].spliceWithArray(e,t,r)},push:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this[se];return r.spliceWithArray(r.values.length,0,e),r.values.length},pop:function(){return this.splice(Math.max(this[se].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this[se];return r.spliceWithArray(0,0,e),r.values.length},reverse:function(){"production"!==process.env.NODE_ENV&&console.warn("[mobx] `observableArray.reverse()` will not update the array in place. Use `observableArray.slice().reverse()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().reverse())` to reverse & update in place");var e=this.slice();return e.reverse.apply(e,arguments)},sort:function(e){"production"!==process.env.NODE_ENV&&console.warn("[mobx] `observableArray.sort()` will not update the array in place. Use `observableArray.slice().sort()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().sort())` to sort & update in place");var t=this.slice();return t.sort.apply(t,arguments)},remove:function(e){var t=this[se],r=t.dehanceValues(t.values).indexOf(e);return r>-1&&(this.splice(r,1),!0)},get:function(e){var t=this[se];if(t){if(e<t.values.length)return t.atom.reportObserved(),t.dehanceValue(t.values[e]);console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(e,t){var r=this[se],n=r.values;if(e<n.length){Ke(r.atom);var i=n[e];if(Ht(r)){var o=$t(r,{type:"update",object:r.proxy,index:e,newValue:t});if(!o)return;t=o.newValue}(t=r.enhancer(t,i))!==i&&(n[e]=t,r.notifyArrayChildUpdate(e,t,i))}else{if(e!==n.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+n.length);r.spliceWithArray(e,0,[t])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(e){"function"==typeof Array.prototype[e]&&(tr[e]=function(){var t=this[se];t.atom.reportObserved();var r=t.dehanceValues(t.values);return r[e].apply(r,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(e){"function"==typeof Array.prototype[e]&&(tr[e]=function(t,r){var n=this,i=this[se];return i.atom.reportObserved(),i.dehanceValues(i.values)[e]((function(e,i){return t.call(r,e,i,n)}),r)})})),["reduce","reduceRight"].forEach((function(e){tr[e]=function(){var t=this,r=this[se];r.atom.reportObserved();var n=arguments[0];return arguments[0]=function(e,i,o){return i=r.dehanceValue(i),n(e,i,o,t)},r.values[e].apply(r.values,arguments)}}));var rr,nr=ee("ObservableArrayAdministration",er);function ir(e){return X(e)&&nr(e[se])}var or,ar={},sr=function(){function e(e,t,r){if(void 0===t&&(t=_e),void 0===r&&(r="ObservableMap@"+z()),this.enhancer=t,this.name=r,this[rr]=ar,this._keysAtom=pe(this.name+".keys()"),this[Symbol.toStringTag]="Map","function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return e.prototype._has=function(e){return this._data.has(e)},e.prototype.has=function(e){var t=this;if(!ft.trackingDerivation)return this._has(e);var r=this._hasMap.get(e);if(!r){var n=r=new at(this._has(e),je,this.name+"."+ie(e)+"?",!1);this._hasMap.set(e,n),kt(n,(function(){return t._hasMap.delete(e)}))}return r.get()},e.prototype.set=function(e,t){var r=this._has(e);if(Ht(this)){var n=$t(this,{type:r?"update":"add",object:this,newValue:t,name:e});if(!n)return this;t=n.newValue}return r?this._updateValue(e,t):this._addValue(e,t),this},e.prototype.delete=function(e){var t=this;if((Ke(this._keysAtom),Ht(this))&&!(i=$t(this,{type:"delete",object:this,name:e})))return!1;if(this._has(e)){var r=Ct(),n=Xt(this),i=n||r?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return r&&"production"!==process.env.NODE_ENV&&At(fe(fe({},i),{name:this.name,key:e})),Gt((function(){t._keysAtom.reportChanged(),t._updateHasMapEntry(e,!1),t._data.get(e).setNewValue(void 0),t._data.delete(e)})),n&&Zt(this,i),r&&"production"!==process.env.NODE_ENV&&Vt(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var r=this._hasMap.get(e);r&&r.setNewValue(t)},e.prototype._updateValue=function(e,t){var r=this._data.get(e);if((t=r.prepareNewValue(t))!==ft.UNCHANGED){var n=Ct(),i=Xt(this),o=i||n?{type:"update",object:this,oldValue:r.value,name:e,newValue:t}:null;n&&"production"!==process.env.NODE_ENV&&At(fe(fe({},o),{name:this.name,key:e})),r.setNewValue(t),i&&Zt(this,o),n&&"production"!==process.env.NODE_ENV&&Vt()}},e.prototype._addValue=function(e,t){var r=this;Ke(this._keysAtom),Gt((function(){var n=new at(t,r.enhancer,r.name+"."+ie(e),!1);r._data.set(e,n),t=n.value,r._updateHasMapEntry(e,!0),r._keysAtom.reportChanged()}));var n=Ct(),i=Xt(this),o=i||n?{type:"add",object:this,name:e,newValue:t}:null;n&&"production"!==process.env.NODE_ENV&&At(fe(fe({},o),{name:this.name,key:e})),i&&Zt(this,o),n&&"production"!==process.env.NODE_ENV&&Vt()},e.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},e.prototype.values=function(){var e=this,t=this.keys();return Cr({next:function(){var r=t.next(),n=r.done,i=r.value;return{done:n,value:n?void 0:e.get(i)}}})},e.prototype.entries=function(){var e=this,t=this.keys();return Cr({next:function(){var r=t.next(),n=r.done,i=r.value;return{done:n,value:n?void 0:[i,e.get(i)]}}})},e.prototype[(rr=se,Symbol.iterator)]=function(){return this.entries()},e.prototype.forEach=function(e,t){var r,n;try{for(var i=ve(this),o=i.next();!o.done;o=i.next()){var a=ye(o.value,2),s=a[0],l=a[1];e.call(t,l,s,this)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},e.prototype.merge=function(e){var t=this;return lr(e)&&(e=e.toJS()),Gt((function(){var r=it(!0);try{Y(e)?ne(e).forEach((function(r){return t.set(r,e[r])})):Array.isArray(e)?e.forEach((function(e){var r=ye(e,2),n=r[0],i=r[1];return t.set(n,i)})):te(e)?(e.constructor!==Map&&J("Cannot initialize from classes that inherit from Map: "+e.constructor.name),e.forEach((function(e,r){return t.set(r,e)}))):null!=e&&J("Cannot initialize map from "+e)}finally{ot(r)}})),this},e.prototype.clear=function(){var e=this;Gt((function(){He((function(){var t,r;try{for(var n=ve(e.keys()),i=n.next();!i.done;i=n.next()){var o=i.value;e.delete(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}))}))},e.prototype.replace=function(e){var t=this;return Gt((function(){var r,n,i,o,a=function(e){if(te(e)||lr(e))return e;if(Array.isArray(e))return new Map(e);if(Y(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}return J("Cannot convert to map from '"+e+"'")}(e),s=new Map,l=!1;try{for(var u=ve(t._data.keys()),p=u.next();!p.done;p=u.next()){var c=p.value;if(!a.has(c))if(t.delete(c))l=!0;else{var d=t._data.get(c);s.set(c,d)}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}try{for(var f=ve(a.entries()),v=f.next();!v.done;v=f.next()){var y=ye(v.value,2),h=(c=y[0],d=y[1],t._data.has(c));if(t.set(c,d),t._data.has(c)){var b=t._data.get(c);s.set(c,b),h||(l=!0)}}}catch(e){i={error:e}}finally{try{v&&!v.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}if(!l)if(t._data.size!==s.size)t._keysAtom.reportChanged();else for(var m=t._data.keys(),g=s.keys(),O=m.next(),w=g.next();!O.done;){if(O.value!==w.value){t._keysAtom.reportChanged();break}O=m.next(),w=g.next()}t._data=s})),this},Object.defineProperty(e.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),e.prototype.toPOJO=function(){var e,t,r={};try{for(var n=ve(this),i=n.next();!i.done;i=n.next()){var o=ye(i.value,2),a=o[0],s=o[1];r["symbol"==typeof a?a:ie(a)]=s}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},e.prototype.toJS=function(){return new Map(this)},e.prototype.toJSON=function(){return this.toPOJO()},e.prototype.toString=function(){var e=this;return this.name+"[{ "+Array.from(this.keys()).map((function(t){return ie(t)+": "+e.get(t)})).join(", ")+" }]"},e.prototype.observe=function(e,t){return"production"!==process.env.NODE_ENV&&H(!0!==t,"`observe` doesn't support fireImmediately=true in combination with maps."),Yt(this,e)},e.prototype.intercept=function(e){return Wt(this,e)},e}(),lr=ee("ObservableMap",sr),ur={},pr=function(){function e(e,t,r){if(void 0===t&&(t=_e),void 0===r&&(r="ObservableSet@"+z()),this.name=r,this[or]=ur,this._data=new Set,this._atom=pe(this.name),this[Symbol.toStringTag]="Set","function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(e,n){return t(e,n,r)},e&&this.replace(e)}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.clear=function(){var e=this;Gt((function(){He((function(){var t,r;try{for(var n=ve(e._data.values()),i=n.next();!i.done;i=n.next()){var o=i.value;e.delete(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}))}))},e.prototype.forEach=function(e,t){var r,n;try{for(var i=ve(this),o=i.next();!o.done;o=i.next()){var a=o.value;e.call(t,a,a,this)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}},Object.defineProperty(e.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this;if((Ke(this._atom),Ht(this))&&!(i=$t(this,{type:"add",object:this,newValue:e})))return this;if(!this.has(e)){Gt((function(){t._data.add(t.enhancer(e,void 0)),t._atom.reportChanged()}));var r=Ct(),n=Xt(this),i=n||r?{type:"add",object:this,newValue:e}:null;r&&"production"!==process.env.NODE_ENV&&At(i),n&&Zt(this,i),r&&"production"!==process.env.NODE_ENV&&Vt()}return this},e.prototype.delete=function(e){var t=this;if(Ht(this)&&!(i=$t(this,{type:"delete",object:this,oldValue:e})))return!1;if(this.has(e)){var r=Ct(),n=Xt(this),i=n||r?{type:"delete",object:this,oldValue:e}:null;return r&&"production"!==process.env.NODE_ENV&&At(fe(fe({},i),{name:this.name})),Gt((function(){t._atom.reportChanged(),t._data.delete(e)})),n&&Zt(this,i),r&&"production"!==process.env.NODE_ENV&&Vt(),!0}return!1},e.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},e.prototype.entries=function(){var e=0,t=Array.from(this.keys()),r=Array.from(this.values());return Cr({next:function(){var n=e;return e+=1,n<r.length?{value:[t[n],r[n]],done:!1}:{done:!0}}})},e.prototype.keys=function(){return this.values()},e.prototype.values=function(){this._atom.reportObserved();var e=this,t=0,r=Array.from(this._data.values());return Cr({next:function(){return t<r.length?{value:e.dehanceValue(r[t++]),done:!1}:{done:!0}}})},e.prototype.replace=function(e){var t=this;return cr(e)&&(e=e.toJS()),Gt((function(){var r=it(!0);try{Array.isArray(e)||re(e)?(t.clear(),e.forEach((function(e){return t.add(e)}))):null!=e&&J("Cannot initialize set from "+e)}finally{ot(r)}})),this},e.prototype.observe=function(e,t){return"production"!==process.env.NODE_ENV&&H(!0!==t,"`observe` doesn't support fireImmediately=true in combination with sets."),Yt(this,e)},e.prototype.intercept=function(e){return Wt(this,e)},e.prototype.toJS=function(){return new Set(this)},e.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},e.prototype[(or=se,Symbol.iterator)]=function(){return this.values()},e}(),cr=ee("ObservableSet",pr),dr=function(){function e(e,t,r,n){void 0===t&&(t=new Map),this.target=e,this.values=t,this.name=r,this.defaultEnhancer=n,this.keysAtom=new le(r+".keys")}return e.prototype.read=function(e){return this.values.get(e).get()},e.prototype.write=function(e,t){var r=this.target,n=this.values.get(e);if(n instanceof st)n.set(t);else{if(Ht(this)){if(!(a=$t(this,{type:"update",object:this.proxy||r,name:e,newValue:t})))return;t=a.newValue}if((t=n.prepareNewValue(t))!==ft.UNCHANGED){var i=Xt(this),o=Ct(),a=i||o?{type:"update",object:this.proxy||r,oldValue:n.value,name:e,newValue:t}:null;o&&"production"!==process.env.NODE_ENV&&At(fe(fe({},a),{name:this.name,key:e})),n.setNewValue(t),i&&Zt(this,a),o&&"production"!==process.env.NODE_ENV&&Vt()}}},e.prototype.has=function(e){var t=this.pendingKeys||(this.pendingKeys=new Map),r=t.get(e);if(r)return r.get();var n=!!this.values.get(e);return r=new at(n,je,this.name+"."+ie(e)+"?",!1),t.set(e,r),r.get()},e.prototype.addObservableProp=function(e,t,r){void 0===r&&(r=this.defaultEnhancer);var n,i,o=this.target;if(n=o,i=e,"production"===process.env.NODE_ENV||Q(n,i)||J("Cannot make property '"+i.toString()+"' observable, it is not configurable and writable in the target object"),Ht(this)){var a=$t(this,{object:this.proxy||o,name:e,type:"add",newValue:t});if(!a)return;t=a.newValue}var s=new at(t,r,this.name+"."+ie(e),!1);this.values.set(e,s),t=s.value,Object.defineProperty(o,e,function(e){return vr[e]||(vr[e]={configurable:!0,enumerable:!0,get:function(){return this[se].read(e)},set:function(t){this[se].write(e,t)}})}(e)),this.notifyPropertyAddition(e,t)},e.prototype.addComputedProp=function(e,t,r){var n=this.target;r.name=r.name||this.name+"."+ie(t),this.values.set(t,new st(r)),(e===n||Q(e,t))&&Object.defineProperty(e,t,function(e){return yr[e]||(yr[e]={configurable:ft.computedConfigurable,enumerable:!1,get:function(){return hr(this).read(e)},set:function(t){hr(this).write(e,t)}})}(t))},e.prototype.remove=function(e){if(this.values.has(e)){var t=this.target;if(Ht(this))if(!(s=$t(this,{object:this.proxy||t,name:e,type:"remove"})))return;try{bt();var r=Xt(this),n=Ct(),i=this.values.get(e),o=i&&i.get();if(i&&i.set(void 0),this.keysAtom.reportChanged(),this.values.delete(e),this.pendingKeys){var a=this.pendingKeys.get(e);a&&a.set(!1)}delete this.target[e];var s=r||n?{type:"remove",object:this.proxy||t,oldValue:o,name:e}:null;n&&"production"!==process.env.NODE_ENV&&At(fe(fe({},s),{name:this.name,key:e})),r&&Zt(this,s),n&&"production"!==process.env.NODE_ENV&&Vt()}finally{mt()}}},e.prototype.illegalAccess=function(e,t){console.warn("Property '"+t+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},e.prototype.observe=function(e,t){return"production"!==process.env.NODE_ENV&&H(!0!==t,"`observe` doesn't support the fire immediately property for observable objects."),Yt(this,e)},e.prototype.intercept=function(e){return Wt(this,e)},e.prototype.notifyPropertyAddition=function(e,t){var r=Xt(this),n=Ct(),i=r||n?{type:"add",object:this.proxy||this.target,name:e,newValue:t}:null;if(n&&"production"!==process.env.NODE_ENV&&At(fe(fe({},i),{name:this.name,key:e})),r&&Zt(this,i),n&&"production"!==process.env.NODE_ENV&&Vt(),this.pendingKeys){var o=this.pendingKeys.get(e);o&&o.set(!0)}this.keysAtom.reportChanged()},e.prototype.getKeys=function(){var e,t;this.keysAtom.reportObserved();var r=[];try{for(var n=ve(this.values),i=n.next();!i.done;i=n.next()){var o=ye(i.value,2),a=o[0];o[1]instanceof at&&r.push(a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r},e}();function fr(e,t,r){if(void 0===t&&(t=""),void 0===r&&(r=_e),Object.prototype.hasOwnProperty.call(e,se))return e[se];"production"!==process.env.NODE_ENV&&H(Object.isExtensible(e),"Cannot make the designated object observable; it is not extensible"),Y(e)||(t=(e.constructor.name||"ObservableObject")+"@"+z()),t||(t="ObservableObject@"+z());var n=new dr(e,new Map,ie(t),r);return Z(e,se,n),n}var vr=Object.create(null),yr=Object.create(null);function hr(e){var t=e[se];return t||(we(e),e[se])}var br=ee("ObservableObjectAdministration",dr);function mr(e){return!!X(e)&&(we(e),br(e[se]))}function gr(e,t){if("object"==typeof e&&null!==e){if(ir(e))return void 0!==t&&J("production"!==process.env.NODE_ENV&&"It is not possible to get index atoms from arrays"),e[se].atom;if(cr(e))return e[se];if(lr(e)){var r=e;return void 0===t?r._keysAtom:((n=r._data.get(t)||r._hasMap.get(t))||J("production"!==process.env.NODE_ENV&&"the entry '"+t+"' does not exist in the observable map '"+wr(e)+"'"),n)}var n;if(we(e),t&&!e[se]&&e[t],mr(e))return t?((n=e[se].values.get(t))||J("production"!==process.env.NODE_ENV&&"no observable property '"+t+"' found on the observable object '"+wr(e)+"'"),n):J("production"!==process.env.NODE_ENV&&"please specify a property");if(ue(e)||lt(e)||xt(e))return e}else if("function"==typeof e&&xt(e[se]))return e[se];return J("production"!==process.env.NODE_ENV&&"Cannot obtain atom from "+e)}function Or(e,t){return e||J("Expecting some object"),void 0!==t?Or(gr(e,t)):ue(e)||lt(e)||xt(e)||lr(e)||cr(e)?e:(we(e),e[se]?e[se]:void J("production"!==process.env.NODE_ENV&&"Cannot obtain administration from "+e))}function wr(e,t){return(void 0!==t?gr(e,t):mr(e)||lr(e)||cr(e)?Or(e):gr(e)).name}var Er,Nr=Object.prototype.toString;function _r(e,t,r){return void 0===r&&(r=-1),jr(e,t,r)}function jr(e,t,r,n,i){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var o=typeof e;if("function"!==o&&"object"!==o&&"object"!=typeof t)return!1;var a=Nr.call(e);if(a!==Nr.call(t))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++}e=Sr(e),t=Sr(t);var s="[object Array]"===a;if(!s){if("object"!=typeof e||"object"!=typeof t)return!1;var l=e.constructor,u=t.constructor;if(l!==u&&!("function"==typeof l&&l instanceof l&&"function"==typeof u&&u instanceof u)&&"constructor"in e&&"constructor"in t)return!1}if(0===r)return!1;r<0&&(r=-1),i=i||[];for(var p=(n=n||[]).length;p--;)if(n[p]===e)return i[p]===t;if(n.push(e),i.push(t),s){if((p=e.length)!==t.length)return!1;for(;p--;)if(!jr(e[p],t[p],r-1,n,i))return!1}else{var c=Object.keys(e),d=void 0;if(p=c.length,Object.keys(t).length!==p)return!1;for(;p--;)if(!xr(t,d=c[p])||!jr(e[d],t[d],r-1,n,i))return!1}return n.pop(),i.pop(),!0}function Sr(e){return ir(e)?e.slice():te(e)||lr(e)||re(e)||cr(e)?Array.from(e.entries()):e}function xr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Cr(e){return e[Symbol.iterator]=Dr,e}function Dr(){return this}if("undefined"==typeof Proxy||"undefined"==typeof Symbol)throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");try{process.env.NODE_ENV}catch(e){var Ar=ct();"undefined"==typeof process&&(Ar.process={}),Ar.process.env={}}!function(){if("testCodeMinification"!==function(){}.name&&"production"!==process.env.NODE_ENV&&"undefined"!=typeof process&&"true"!==process.env.IGNORE_MOBX_MINIFY_WARNING){var e=["process","env","NODE_ENV"].join(".");console.warn("[mobx] you are running a minified build, but '"+e+"' was not set to 'production' in your bundler. This results in an unnecessarily large and slow bundle")}}(),"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:function(e){return"production"===process.env.NODE_ENV?(console.warn("[mobx.spy] Is a no-op in production builds"),function(){}):(ft.spyListeners.push(e),W((function(){ft.spyListeners=ft.spyListeners.filter((function(t){return t!==e}))})))},extras:{getDebugName:wr},$mobx:se});var Tr=((Er={array:"array",boolean:"boolean","box-style":"object","padding-margin":"object",codearea:"string",color:"string",datasource:"object",date:"string","date-time":"string","dynamic-data":"object",event:"object","func-body":"string",htmlarea:"string",image:"string",input:"string",json:"string",number:"number","input-image":"string",object:"object",quantity:"object",radio:"string",select:"array"}).select="string",Er.textarea="string",Er["text-editor"]="string",Er.time="string",Er.url="string",Er["dynamic-config"]="object",Er["dynamic-object"]="object",Er["dynamic-array"]="object",Er["sohu-source"]="object",Er["sohu-event"]="object",Er);function Vr(e){return Tr[e]||e}function Rr(e,t){Tr[e]?console.warn("当前已经存在"+e+"("+Tr[e]+"),暂时不支持覆盖。"):Tr[e]=t}function kr(e){var t=!0;if(!e)return t;var r=e.type;return("object"===r&&e.properties&&e.propertyOrder&&e.propertyOrder.length>0||"array"===r&&e.items&&e.items.properties&&e.items.propertyOrder&&e.items.propertyOrder.length>0||e.type&&"array"!==e.type&&"object"!==e.type||e.type)&&(t=!1),t}function Pr(e){var t=!1,r=e.lastUpdateTime,n=new Date("2024-10-05T00:01:00.691Z").getTime();return r&&new Date(r).getTime()>=n&&(t=!0),t}function Ir(e){var t=!1,r=Vr(e.type),n=void 0===e.isContainer||e.isContainer;return"object"===r&&n&&(t=!0),t}function Mr(e){var t=!0;return"object"===e.type&&e.propertyOrder&&e.properties?e.propertyOrder.map((function(r){var n=e.properties[r];"object"===e.type&&n.propertyOrder&&n.properties||(t=!1)})):t=!1,t}function Br(e,t){var r=e.split("-"),n=t.split("-");return r.pop(),n.pop(),r.join("-")===n.join("-")}function Lr(e,t){for(var r=e.split("-"),n=t.split("-"),i="before",o=0,a=(r.length>n.length?n:r).length;o<a;o+=1){Number(r[o])>Number(n[o])&&(i="after")}return i}function Ur(e){var t=e.split("-");return t.pop(),t.join("-")}function qr(e){var t=e.split("-"),r=t.pop(),n=Number(r)+1;return t.push(""+n),t.join("-")}function Fr(e){var t=e.split("-"),r=t.pop();return[t.join("-"),r]}function Gr(e){var t=e.split("-"),r=t.pop();return t.push(Number(r)-1),t.join("-")}function Kr(e){var t=e.split("-"),r=t.pop();return t.push(Number(r)+1),t.join("-")}function zr(e,t){var r="",n=!1;if(!1!==e.defaultActiveFirstOption&&e.defaultActiveFirstOption)return e.options&&e.options[0]&&(r=e.options[0].value,n=!0),(t||e.multiple)&&(r=n?[r]:[]),r}function Jr(e,t){var r,n,i=void 0,o=t;A(o)&&A(e.default)&&(typeof o!=typeof e.default||(r=o,n=e.default,w(r)+"-"+g(r)!=w(n)+"-"+g(n)))&&(o=void 0);var a=A(o)?o:e.default;switch(e.type){case"select":case"radio":i=null!=a?a:zr(e);break;case"checkboxes":i=null!=a?a:zr(e,!0);break;case"color":"#fff"!==a&&"#FFF"!==a||(a="#ffffff"),i=A(a)?a:"#ffffff";break;case"boolean":i=!!A(a)&&a;break;case"number":i=A(a)?a:void 0;break;case"json":var s="";if(w(a)||g(a))s=a;else if(_(a)||""===a)s={};else try{s=JSON.parse(a)}catch(e){s={}}i=s;break;default:i="input"===e.type&&"0"===e.default?a||e.default:A(a)?a:void 0}return i}function Hr(e,t){var r={},n=e.type;if(w(e)&&"object"===Vr(e.type)){var i=e,o=t;A(o)&&(A(i.default)&&typeof o!=typeof e.default||!w(o))&&(o=void 0);var a=A(o)?o:i.default;if("dynamic-data"===n)r=x(l),a&&w(a)&&"{}"!==JSON.stringify(a)&&(r=Object.assign(r,a));else if("datasource"===n)i.properties&&i.properties.type&&i.properties.type.default&&"local"===i.properties.type.default?(r={data:"{}",filter:"() => {}"},a&&a.data&&(r.data=a.data),a&&a.filter&&(r.filter=a.filter),"http://xxx"===r.data&&(r.data="{}")):(r={data:"http://xxx",filter:"() => {}"},a&&a.data&&(r.data=a.data),a&&a.filter&&(r.filter=a.filter),"{}"===r.data&&(r.data="http://xxx"));else if("event"===n)i.properties&&i.properties.type&&i.properties.type.default&&"emit"===i.properties.type.default?a&&"out"===a.type?r={trigger:a&&a.filter||"eventName",eventData:"{}"}:(r={trigger:"eventName",eventData:"{}"},a&&a.trigger&&(r.trigger=a.trigger),a&&a.eventData&&(r.eventData=a.eventData)):a&&"in"===a.type?r={register:"eventName",actionFunc:a&&a.filter||"() => {}"}:(r={register:"eventName",actionFunc:"() => {}"},a&&a.register&&(r.register=a.register),a&&a.actionFunc&&(r.actionFunc=a.actionFunc));else if(!1===e.isContainer&&a&&w(a)&&"{}"!==JSON.stringify(a))r=Object.assign(r,a);else if(void 0===o&&i.default&&w(i.default))r=i.default;else if(e.properties){(e.propertyOrder?e.propertyOrder:Object.keys(e.properties)).map((function(n){var i=e.properties[n],o=t&&t[n];switch(Vr(i.type)){case"array":r[n]=Wr(i,o);break;case"object":r[n]=Hr(i,o);break;default:r[n]=Jr(i,o)}}))}}return r}function Wr(e,t){var r=[];if(e&&"array"===Vr(e.type)){var n=t;A(n)&&(A(e.default)&&typeof n!=typeof e.default||!g(n))&&(n=void 0);var i=A(n)?n:e.default;if("array"===Vr(e.type))if(g(i))i.map((function(t){r.push(Hr(e.items,t))}));else if(i)r=i;else{var o=Hr(e.items,i);r.push(o)}else r=A(i)?i:[]}return r}function $r(e,t){return"object"===Vr(e.type)?Hr(e,t):"array"===Vr(e.type)?Wr(e,t):Jr(e,t)}var Xr=u;function Yr(e,t){var r=t||[];if(e&&"{}"!==JSON.stringify(e))if(w(e))if(e.type&&"remote"===e.type&&e.config&&w(e.config)&&e.config.dataName&&A(e.localFilter)&&A(e.data)){var n=e.config.body;if(n&&!w(n))try{n=JSON.parse(n)}catch(e){n={}}r.push({id:e.config.id,dataName:e.config.dataName,body:n})}else{Object.keys(e).map((function(t){Yr(e[t],r)}))}else g(e)&&e.map((function(e){Yr(e,r)}));return r}function Zr(e,t){var r=t||"data";return e.split("-").map((function(e){r=/^\d+$/.test(e)?r+"["+e+"]":r+"."+e})),r}function Qr(e,t){var r=[];w(e)?Object.keys(e).map((function(n){var i=e[n],o=t?t+"-"+n:n;w(i)||g(i)?r.push({title:n,value:o,key:o,children:Qr(i,o)}):r.push({title:n,value:o,key:o})})):g(e)&&e.map((function(e,n){var i=n.toString(),o=t?t+"-"+n:i;w(e)||g(e)?r.push({title:i,value:o,key:o,children:Qr(e,o)}):r.push({title:i,value:o,key:o})}));return r}function en(e,t){var r="";if("object"===Vr(e.type)&&e.properties){(e.propertyOrder?e.propertyOrder:Object.keys(e.properties)).map((function(n){var i=e.properties[n],o=t[n];"array"===Vr(i.type)&&"object"===Vr(i.type)||o&&i.isConditionProp&&(r.indexOf("-")>0?r+="-"+o:r=o)}))}return r}function tn(e){var t=e.split("-");return t.pop(),t.join("-")}function rn(e){var t=e.split("-"),r=t.pop();return[t.join("-"),r]}var nn=["key","enum","enumextra","items","input","boolean","number","color","url","textarea","text-editor","radio","select","checkboxes","date","date-time","time","json","codearea","htmlarea","quantity","box-style","dynamic-data","datasource","event","array","object"];export{c as DataSourceTypeList,p as EventTypeDataList,nn as KeyWordList,u as TypeDataList,Zr as dataRoute2dataPath,Yr as dynamicDataAnalyzer,V as evalExpression,Lr as getCurPosition,zr as getDefaultOptionVal,Vr as getExpectType,R as getJsonDataByKeyRoute,qr as getNextIndexRoute,Ur as getParentIndexRoute,Fr as getParentIndexRoute_CurIndex,tn as getParentKeyRoute,rn as getParentKeyRoute_CurKey,k as getSchemaByIndexRoute,P as getSchemaByKeyRoute,A as hasProperties,I as indexRoute2keyRoute,g as isArray,y as isBoolean,N as isColor,Ir as isContainerSchema,h as isDateStr,b as isDateTimeStr,kr as isEmptySchema,C as isEqual,D as isEqualByIdT,_ as isFunction,Pr as isNewSchemaData,v as isNumber,w as isObject,E as isQuantity,Br as isSameParent,O as isSelect,f as isString,Mr as isStructuredSchema,m as isTimeStr,d as isURL,B as json2schema,Qr as json2treeData,M as keyRoute2indexRoute,U as metaElemAnalyzer,Kr as moveBackward,Gr as moveForward,x as objClone,F as oldSchemaToNewSchema,q as oldSchemaToNewSchemaV1,Rr as registerExpectType,en as schema2conditionValue,$r as schema2json,Xr as schemaMetaList,T as truncate,j as urlParse,S as urlStringify};
|
|
1124
|
+
***************************************************************************** */ var fe =
|
|
1125
|
+
function () {
|
|
1126
|
+
return (
|
|
1127
|
+
(fe =
|
|
1128
|
+
Object.assign ||
|
|
1129
|
+
function (e) {
|
|
1130
|
+
for (var t, r = 1, n = arguments.length; r < n; r++)
|
|
1131
|
+
for (var o in (t = arguments[r]))
|
|
1132
|
+
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
1133
|
+
return e;
|
|
1134
|
+
}),
|
|
1135
|
+
fe.apply(this, arguments)
|
|
1136
|
+
);
|
|
1137
|
+
};
|
|
1138
|
+
function he(e) {
|
|
1139
|
+
var t = 'function' == typeof Symbol && e[Symbol.iterator],
|
|
1140
|
+
r = 0;
|
|
1141
|
+
return t
|
|
1142
|
+
? t.call(e)
|
|
1143
|
+
: {
|
|
1144
|
+
next: function () {
|
|
1145
|
+
return (
|
|
1146
|
+
e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }
|
|
1147
|
+
);
|
|
1148
|
+
},
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
function ve(e, t) {
|
|
1152
|
+
var r = 'function' == typeof Symbol && e[Symbol.iterator];
|
|
1153
|
+
if (!r) return e;
|
|
1154
|
+
var n,
|
|
1155
|
+
o,
|
|
1156
|
+
i = r.call(e),
|
|
1157
|
+
a = [];
|
|
1158
|
+
try {
|
|
1159
|
+
for (; (void 0 === t || t-- > 0) && !(n = i.next()).done; ) a.push(n.value);
|
|
1160
|
+
} catch (e) {
|
|
1161
|
+
o = { error: e };
|
|
1162
|
+
} finally {
|
|
1163
|
+
try {
|
|
1164
|
+
n && !n.done && (r = i.return) && r.call(i);
|
|
1165
|
+
} finally {
|
|
1166
|
+
if (o) throw o.error;
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
return a;
|
|
1170
|
+
}
|
|
1171
|
+
function ye() {
|
|
1172
|
+
for (var e = [], t = 0; t < arguments.length; t++)
|
|
1173
|
+
e = e.concat(ve(arguments[t]));
|
|
1174
|
+
return e;
|
|
1175
|
+
}
|
|
1176
|
+
var be = Symbol('mobx did run lazy initializers'),
|
|
1177
|
+
me = Symbol('mobx pending decorators'),
|
|
1178
|
+
ge = {},
|
|
1179
|
+
Oe = {};
|
|
1180
|
+
function Ee(e) {
|
|
1181
|
+
var t, r;
|
|
1182
|
+
if (!0 !== e[be]) {
|
|
1183
|
+
var n = e[me];
|
|
1184
|
+
if (n) {
|
|
1185
|
+
Z(e, be, !0);
|
|
1186
|
+
var o = ye(Object.getOwnPropertySymbols(n), Object.keys(n));
|
|
1187
|
+
try {
|
|
1188
|
+
for (var i = he(o), a = i.next(); !a.done; a = i.next()) {
|
|
1189
|
+
var s = n[a.value];
|
|
1190
|
+
s.propertyCreator(
|
|
1191
|
+
e,
|
|
1192
|
+
s.prop,
|
|
1193
|
+
s.descriptor,
|
|
1194
|
+
s.decoratorTarget,
|
|
1195
|
+
s.decoratorArguments,
|
|
1196
|
+
);
|
|
1197
|
+
}
|
|
1198
|
+
} catch (e) {
|
|
1199
|
+
t = { error: e };
|
|
1200
|
+
} finally {
|
|
1201
|
+
try {
|
|
1202
|
+
a && !a.done && (r = i.return) && r.call(i);
|
|
1203
|
+
} finally {
|
|
1204
|
+
if (t) throw t.error;
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
function Ne(e, t) {
|
|
1211
|
+
return function () {
|
|
1212
|
+
var r,
|
|
1213
|
+
n = function (n, o, i, a) {
|
|
1214
|
+
if (!0 === a) return t(n, o, i, n, r), null;
|
|
1215
|
+
if (
|
|
1216
|
+
('production' === process.env.NODE_ENV ||
|
|
1217
|
+
we(arguments) ||
|
|
1218
|
+
J(
|
|
1219
|
+
"This function is a decorator, but it wasn't invoked like a decorator",
|
|
1220
|
+
),
|
|
1221
|
+
!Object.prototype.hasOwnProperty.call(n, me))
|
|
1222
|
+
) {
|
|
1223
|
+
var s = n[me];
|
|
1224
|
+
Z(n, me, fe({}, s));
|
|
1225
|
+
}
|
|
1226
|
+
return (
|
|
1227
|
+
(n[me][o] = {
|
|
1228
|
+
prop: o,
|
|
1229
|
+
propertyCreator: t,
|
|
1230
|
+
descriptor: i,
|
|
1231
|
+
decoratorTarget: n,
|
|
1232
|
+
decoratorArguments: r,
|
|
1233
|
+
}),
|
|
1234
|
+
(function (e, t) {
|
|
1235
|
+
var r = t ? ge : Oe;
|
|
1236
|
+
return (
|
|
1237
|
+
r[e] ||
|
|
1238
|
+
(r[e] = {
|
|
1239
|
+
configurable: !0,
|
|
1240
|
+
enumerable: t,
|
|
1241
|
+
get: function () {
|
|
1242
|
+
return Ee(this), this[e];
|
|
1243
|
+
},
|
|
1244
|
+
set: function (t) {
|
|
1245
|
+
Ee(this), (this[e] = t);
|
|
1246
|
+
},
|
|
1247
|
+
})
|
|
1248
|
+
);
|
|
1249
|
+
})(o, e)
|
|
1250
|
+
);
|
|
1251
|
+
};
|
|
1252
|
+
return we(arguments)
|
|
1253
|
+
? ((r = z), n.apply(null, arguments))
|
|
1254
|
+
: ((r = Array.prototype.slice.call(arguments)), n);
|
|
1255
|
+
};
|
|
1256
|
+
}
|
|
1257
|
+
function we(e) {
|
|
1258
|
+
return (
|
|
1259
|
+
((2 === e.length || 3 === e.length) &&
|
|
1260
|
+
('string' == typeof e[1] || 'symbol' == typeof e[1])) ||
|
|
1261
|
+
(4 === e.length && !0 === e[3])
|
|
1262
|
+
);
|
|
1263
|
+
}
|
|
1264
|
+
function _e(e, t, r) {
|
|
1265
|
+
return Mt(e)
|
|
1266
|
+
? e
|
|
1267
|
+
: Array.isArray(e)
|
|
1268
|
+
? Ue.array(e, { name: r })
|
|
1269
|
+
: Y(e)
|
|
1270
|
+
? Ue.object(e, void 0, { name: r })
|
|
1271
|
+
: te(e)
|
|
1272
|
+
? Ue.map(e, { name: r })
|
|
1273
|
+
: re(e)
|
|
1274
|
+
? Ue.set(e, { name: r })
|
|
1275
|
+
: e;
|
|
1276
|
+
}
|
|
1277
|
+
function je(e) {
|
|
1278
|
+
return e;
|
|
1279
|
+
}
|
|
1280
|
+
function xe(e) {
|
|
1281
|
+
H(e);
|
|
1282
|
+
var t = Ne(!0, function (t, r, n, o, i) {
|
|
1283
|
+
'production' !== process.env.NODE_ENV &&
|
|
1284
|
+
H(
|
|
1285
|
+
!n || !n.get,
|
|
1286
|
+
'@observable cannot be used on getter (property "' +
|
|
1287
|
+
oe(r) +
|
|
1288
|
+
'"), use @computed instead.',
|
|
1289
|
+
);
|
|
1290
|
+
var a = n ? (n.initializer ? n.initializer.call(t) : n.value) : void 0;
|
|
1291
|
+
fr(t).addObservableProp(r, a, e);
|
|
1292
|
+
}),
|
|
1293
|
+
r =
|
|
1294
|
+
'undefined' != typeof process &&
|
|
1295
|
+
process.env &&
|
|
1296
|
+
'production' !== process.env.NODE_ENV
|
|
1297
|
+
? function () {
|
|
1298
|
+
return arguments.length < 2
|
|
1299
|
+
? J(
|
|
1300
|
+
"Incorrect decorator invocation. @observable decorator doesn't expect any arguments",
|
|
1301
|
+
)
|
|
1302
|
+
: t.apply(null, arguments);
|
|
1303
|
+
}
|
|
1304
|
+
: t;
|
|
1305
|
+
return (r.enhancer = e), r;
|
|
1306
|
+
}
|
|
1307
|
+
var Se = { deep: !0, name: void 0, defaultDecorator: void 0, proxy: !0 };
|
|
1308
|
+
function De(e) {
|
|
1309
|
+
/^(deep|name|equals|defaultDecorator|proxy)$/.test(e) ||
|
|
1310
|
+
J('invalid option for (extend)observable: ' + e);
|
|
1311
|
+
}
|
|
1312
|
+
function Ae(e) {
|
|
1313
|
+
if (null == e) return Se;
|
|
1314
|
+
if ('string' == typeof e) return { name: e, deep: !0, proxy: !0 };
|
|
1315
|
+
if ('production' !== process.env.NODE_ENV) {
|
|
1316
|
+
if ('object' != typeof e) return J('expected options object');
|
|
1317
|
+
Object.keys(e).forEach(De);
|
|
1318
|
+
}
|
|
1319
|
+
return e;
|
|
1320
|
+
}
|
|
1321
|
+
Object.freeze(Se);
|
|
1322
|
+
var Ve = xe(_e),
|
|
1323
|
+
Te = xe(function (e, t, r) {
|
|
1324
|
+
return null == e || mr(e) || or(e) || ur(e) || lr(e)
|
|
1325
|
+
? e
|
|
1326
|
+
: Array.isArray(e)
|
|
1327
|
+
? Ue.array(e, { name: r, deep: !1 })
|
|
1328
|
+
: Y(e)
|
|
1329
|
+
? Ue.object(e, void 0, { name: r, deep: !1 })
|
|
1330
|
+
: te(e)
|
|
1331
|
+
? Ue.map(e, { name: r, deep: !1 })
|
|
1332
|
+
: re(e)
|
|
1333
|
+
? Ue.set(e, { name: r, deep: !1 })
|
|
1334
|
+
: J(
|
|
1335
|
+
'production' !== process.env.NODE_ENV &&
|
|
1336
|
+
'The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets',
|
|
1337
|
+
);
|
|
1338
|
+
}),
|
|
1339
|
+
ke = xe(je),
|
|
1340
|
+
Ce = xe(function (e, t, r) {
|
|
1341
|
+
if ('production' !== process.env.NODE_ENV && Mt(e))
|
|
1342
|
+
throw 'observable.struct should not be used with observable values';
|
|
1343
|
+
return _r(e, t) ? t : e;
|
|
1344
|
+
});
|
|
1345
|
+
function Re(e) {
|
|
1346
|
+
return e.defaultDecorator
|
|
1347
|
+
? e.defaultDecorator.enhancer
|
|
1348
|
+
: !1 === e.deep
|
|
1349
|
+
? je
|
|
1350
|
+
: _e;
|
|
1351
|
+
}
|
|
1352
|
+
var Pe = {
|
|
1353
|
+
box: function (e, t) {
|
|
1354
|
+
arguments.length > 2 && qe('box');
|
|
1355
|
+
var r = Ae(t);
|
|
1356
|
+
return new at(e, Re(r), r.name, !0, r.equals);
|
|
1357
|
+
},
|
|
1358
|
+
array: function (e, t) {
|
|
1359
|
+
arguments.length > 2 && qe('array');
|
|
1360
|
+
var r = Ae(t);
|
|
1361
|
+
return (function (e, t, r, n) {
|
|
1362
|
+
void 0 === r && (r = 'ObservableArray@' + F());
|
|
1363
|
+
void 0 === n && (n = !1);
|
|
1364
|
+
var o = new er(r, t, n);
|
|
1365
|
+
(i = o.values),
|
|
1366
|
+
(a = se),
|
|
1367
|
+
(s = o),
|
|
1368
|
+
Object.defineProperty(i, a, {
|
|
1369
|
+
enumerable: !1,
|
|
1370
|
+
writable: !1,
|
|
1371
|
+
configurable: !0,
|
|
1372
|
+
value: s,
|
|
1373
|
+
});
|
|
1374
|
+
var i, a, s;
|
|
1375
|
+
var u = new Proxy(o.values, Qt);
|
|
1376
|
+
if (((o.proxy = u), e && e.length)) {
|
|
1377
|
+
var c = ot(!0);
|
|
1378
|
+
o.spliceWithArray(0, 0, e), it(c);
|
|
1379
|
+
}
|
|
1380
|
+
return u;
|
|
1381
|
+
})(e, Re(r), r.name);
|
|
1382
|
+
},
|
|
1383
|
+
map: function (e, t) {
|
|
1384
|
+
arguments.length > 2 && qe('map');
|
|
1385
|
+
var r = Ae(t);
|
|
1386
|
+
return new sr(e, Re(r), r.name);
|
|
1387
|
+
},
|
|
1388
|
+
set: function (e, t) {
|
|
1389
|
+
arguments.length > 2 && qe('set');
|
|
1390
|
+
var r = Ae(t);
|
|
1391
|
+
return new pr(e, Re(r), r.name);
|
|
1392
|
+
},
|
|
1393
|
+
object: function (e, t, r) {
|
|
1394
|
+
'string' == typeof arguments[1] && qe('object');
|
|
1395
|
+
var n = Ae(r);
|
|
1396
|
+
if (!1 === n.proxy) return Ut({}, e, t, n);
|
|
1397
|
+
var o = qt(n),
|
|
1398
|
+
i = (function (e) {
|
|
1399
|
+
var t = new Proxy(e, Jt);
|
|
1400
|
+
return (e[se].proxy = t), t;
|
|
1401
|
+
})(Ut({}, void 0, void 0, n));
|
|
1402
|
+
return Lt(i, e, t, o), i;
|
|
1403
|
+
},
|
|
1404
|
+
ref: ke,
|
|
1405
|
+
shallow: Te,
|
|
1406
|
+
deep: Ve,
|
|
1407
|
+
struct: Ce,
|
|
1408
|
+
},
|
|
1409
|
+
Ue = function (e, t, r) {
|
|
1410
|
+
if ('string' == typeof arguments[1] || 'symbol' == typeof arguments[1])
|
|
1411
|
+
return Ve.apply(null, arguments);
|
|
1412
|
+
if (Mt(e)) return e;
|
|
1413
|
+
var n = Y(e)
|
|
1414
|
+
? Ue.object(e, t, r)
|
|
1415
|
+
: Array.isArray(e)
|
|
1416
|
+
? Ue.array(e, t)
|
|
1417
|
+
: te(e)
|
|
1418
|
+
? Ue.map(e, t)
|
|
1419
|
+
: re(e)
|
|
1420
|
+
? Ue.set(e, t)
|
|
1421
|
+
: e;
|
|
1422
|
+
if (n !== e) return n;
|
|
1423
|
+
J(
|
|
1424
|
+
'production' !== process.env.NODE_ENV &&
|
|
1425
|
+
"The provided value could not be converted into an observable. If you want just create an observable reference to the object use 'observable.box(value)'",
|
|
1426
|
+
);
|
|
1427
|
+
};
|
|
1428
|
+
function qe(e) {
|
|
1429
|
+
J(
|
|
1430
|
+
'Expected one or two arguments to observable.' +
|
|
1431
|
+
e +
|
|
1432
|
+
'. Did you accidentally try to use observable.' +
|
|
1433
|
+
e +
|
|
1434
|
+
' as decorator?',
|
|
1435
|
+
);
|
|
1436
|
+
}
|
|
1437
|
+
Object.keys(Pe).forEach(function (e) {
|
|
1438
|
+
return (Ue[e] = Pe[e]);
|
|
1439
|
+
});
|
|
1440
|
+
var Le,
|
|
1441
|
+
Be,
|
|
1442
|
+
Ie = Ne(!1, function (e, t, r, n, o) {
|
|
1443
|
+
'production' !== process.env.NODE_ENV &&
|
|
1444
|
+
H(
|
|
1445
|
+
r && r.get,
|
|
1446
|
+
"Trying to declare a computed value for unspecified getter '" +
|
|
1447
|
+
oe(t) +
|
|
1448
|
+
"'",
|
|
1449
|
+
);
|
|
1450
|
+
var i = r.get,
|
|
1451
|
+
a = r.set,
|
|
1452
|
+
s = o[0] || {};
|
|
1453
|
+
fr(e).addComputedProp(e, t, fe({ get: i, set: a, context: e }, s));
|
|
1454
|
+
});
|
|
1455
|
+
Ie({ equals: le.structural }),
|
|
1456
|
+
(function (e) {
|
|
1457
|
+
(e[(e.NOT_TRACKING = -1)] = 'NOT_TRACKING'),
|
|
1458
|
+
(e[(e.UP_TO_DATE = 0)] = 'UP_TO_DATE'),
|
|
1459
|
+
(e[(e.POSSIBLY_STALE = 1)] = 'POSSIBLY_STALE'),
|
|
1460
|
+
(e[(e.STALE = 2)] = 'STALE');
|
|
1461
|
+
})(Le || (Le = {})),
|
|
1462
|
+
(function (e) {
|
|
1463
|
+
(e[(e.NONE = 0)] = 'NONE'),
|
|
1464
|
+
(e[(e.LOG = 1)] = 'LOG'),
|
|
1465
|
+
(e[(e.BREAK = 2)] = 'BREAK');
|
|
1466
|
+
})(Be || (Be = {}));
|
|
1467
|
+
var Me = function (e) {
|
|
1468
|
+
this.cause = e;
|
|
1469
|
+
};
|
|
1470
|
+
function Ge(e) {
|
|
1471
|
+
return e instanceof Me;
|
|
1472
|
+
}
|
|
1473
|
+
function ze(e) {
|
|
1474
|
+
switch (e.dependenciesState) {
|
|
1475
|
+
case Le.UP_TO_DATE:
|
|
1476
|
+
return !1;
|
|
1477
|
+
case Le.NOT_TRACKING:
|
|
1478
|
+
case Le.STALE:
|
|
1479
|
+
return !0;
|
|
1480
|
+
case Le.POSSIBLY_STALE:
|
|
1481
|
+
for (
|
|
1482
|
+
var t = $e(!0), r = We(), n = e.observing, o = n.length, i = 0;
|
|
1483
|
+
i < o;
|
|
1484
|
+
i++
|
|
1485
|
+
) {
|
|
1486
|
+
var a = n[i];
|
|
1487
|
+
if (ut(a)) {
|
|
1488
|
+
if (ft.disableErrorBoundaries) a.get();
|
|
1489
|
+
else
|
|
1490
|
+
try {
|
|
1491
|
+
a.get();
|
|
1492
|
+
} catch (e) {
|
|
1493
|
+
return Xe(r), Ye(t), !0;
|
|
1494
|
+
}
|
|
1495
|
+
if (e.dependenciesState === Le.STALE) return Xe(r), Ye(t), !0;
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
return Ze(e), Xe(r), Ye(t), !1;
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
function Ke(e) {
|
|
1502
|
+
var t = e.observers.size > 0;
|
|
1503
|
+
ft.computationDepth > 0 &&
|
|
1504
|
+
t &&
|
|
1505
|
+
J(
|
|
1506
|
+
'production' !== process.env.NODE_ENV &&
|
|
1507
|
+
'Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: ' +
|
|
1508
|
+
e.name,
|
|
1509
|
+
),
|
|
1510
|
+
ft.allowStateChanges ||
|
|
1511
|
+
(!t && 'strict' !== ft.enforceActions) ||
|
|
1512
|
+
J(
|
|
1513
|
+
'production' !== process.env.NODE_ENV &&
|
|
1514
|
+
(ft.enforceActions
|
|
1515
|
+
? 'Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: '
|
|
1516
|
+
: 'Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ') +
|
|
1517
|
+
e.name,
|
|
1518
|
+
);
|
|
1519
|
+
}
|
|
1520
|
+
function Fe(e, t, r) {
|
|
1521
|
+
var n = $e(!0);
|
|
1522
|
+
Ze(e),
|
|
1523
|
+
(e.newObserving = new Array(e.observing.length + 100)),
|
|
1524
|
+
(e.unboundDepsCount = 0),
|
|
1525
|
+
(e.runId = ++ft.runId);
|
|
1526
|
+
var o,
|
|
1527
|
+
i = ft.trackingDerivation;
|
|
1528
|
+
if (((ft.trackingDerivation = e), !0 === ft.disableErrorBoundaries))
|
|
1529
|
+
o = t.call(r);
|
|
1530
|
+
else
|
|
1531
|
+
try {
|
|
1532
|
+
o = t.call(r);
|
|
1533
|
+
} catch (e) {
|
|
1534
|
+
o = new Me(e);
|
|
1535
|
+
}
|
|
1536
|
+
return (
|
|
1537
|
+
(ft.trackingDerivation = i),
|
|
1538
|
+
(function (e) {
|
|
1539
|
+
for (
|
|
1540
|
+
var t = e.observing,
|
|
1541
|
+
r = (e.observing = e.newObserving),
|
|
1542
|
+
n = Le.UP_TO_DATE,
|
|
1543
|
+
o = 0,
|
|
1544
|
+
i = e.unboundDepsCount,
|
|
1545
|
+
a = 0;
|
|
1546
|
+
a < i;
|
|
1547
|
+
a++
|
|
1548
|
+
) {
|
|
1549
|
+
0 === (s = r[a]).diffValue &&
|
|
1550
|
+
((s.diffValue = 1), o !== a && (r[o] = s), o++),
|
|
1551
|
+
s.dependenciesState > n && (n = s.dependenciesState);
|
|
1552
|
+
}
|
|
1553
|
+
(r.length = o), (e.newObserving = null), (i = t.length);
|
|
1554
|
+
for (; i--; ) {
|
|
1555
|
+
0 === (s = t[i]).diffValue && vt(s, e), (s.diffValue = 0);
|
|
1556
|
+
}
|
|
1557
|
+
for (; o--; ) {
|
|
1558
|
+
var s;
|
|
1559
|
+
1 === (s = r[o]).diffValue && ((s.diffValue = 0), ht(s, e));
|
|
1560
|
+
}
|
|
1561
|
+
n !== Le.UP_TO_DATE && ((e.dependenciesState = n), e.onBecomeStale());
|
|
1562
|
+
})(e),
|
|
1563
|
+
(function (e) {
|
|
1564
|
+
if ('production' === process.env.NODE_ENV) return;
|
|
1565
|
+
if (0 !== e.observing.length) return;
|
|
1566
|
+
(ft.reactionRequiresObservable || e.requiresObservable) &&
|
|
1567
|
+
console.warn(
|
|
1568
|
+
'[mobx] Derivation ' +
|
|
1569
|
+
e.name +
|
|
1570
|
+
' is created/updated without reading any observable value',
|
|
1571
|
+
);
|
|
1572
|
+
})(e),
|
|
1573
|
+
Ye(n),
|
|
1574
|
+
o
|
|
1575
|
+
);
|
|
1576
|
+
}
|
|
1577
|
+
function Je(e) {
|
|
1578
|
+
var t = e.observing;
|
|
1579
|
+
e.observing = [];
|
|
1580
|
+
for (var r = t.length; r--; ) vt(t[r], e);
|
|
1581
|
+
e.dependenciesState = Le.NOT_TRACKING;
|
|
1582
|
+
}
|
|
1583
|
+
function He(e) {
|
|
1584
|
+
var t = We();
|
|
1585
|
+
try {
|
|
1586
|
+
return e();
|
|
1587
|
+
} finally {
|
|
1588
|
+
Xe(t);
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
function We() {
|
|
1592
|
+
var e = ft.trackingDerivation;
|
|
1593
|
+
return (ft.trackingDerivation = null), e;
|
|
1594
|
+
}
|
|
1595
|
+
function Xe(e) {
|
|
1596
|
+
ft.trackingDerivation = e;
|
|
1597
|
+
}
|
|
1598
|
+
function $e(e) {
|
|
1599
|
+
var t = ft.allowStateReads;
|
|
1600
|
+
return (ft.allowStateReads = e), t;
|
|
1601
|
+
}
|
|
1602
|
+
function Ye(e) {
|
|
1603
|
+
ft.allowStateReads = e;
|
|
1604
|
+
}
|
|
1605
|
+
function Ze(e) {
|
|
1606
|
+
if (e.dependenciesState !== Le.UP_TO_DATE) {
|
|
1607
|
+
e.dependenciesState = Le.UP_TO_DATE;
|
|
1608
|
+
for (var t = e.observing, r = t.length; r--; )
|
|
1609
|
+
t[r].lowestObserverState = Le.UP_TO_DATE;
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
var Qe = 0,
|
|
1613
|
+
et = 1,
|
|
1614
|
+
tt = Object.getOwnPropertyDescriptor(function () {}, 'name'),
|
|
1615
|
+
rt = tt && tt.configurable;
|
|
1616
|
+
function nt(e, t, r) {
|
|
1617
|
+
'production' !== process.env.NODE_ENV &&
|
|
1618
|
+
(H('function' == typeof t, '`action` can only be invoked on functions'),
|
|
1619
|
+
('string' == typeof e && e) ||
|
|
1620
|
+
J("actions should have valid names, got: '" + e + "'"));
|
|
1621
|
+
var n = function () {
|
|
1622
|
+
return (function (e, t, r, n) {
|
|
1623
|
+
var o = (function (e, t, r) {
|
|
1624
|
+
var n = Dt() && !!e,
|
|
1625
|
+
o = 0;
|
|
1626
|
+
if (n && 'production' !== process.env.NODE_ENV) {
|
|
1627
|
+
o = Date.now();
|
|
1628
|
+
var i = (r && r.length) || 0,
|
|
1629
|
+
a = new Array(i);
|
|
1630
|
+
if (i > 0) for (var s = 0; s < i; s++) a[s] = r[s];
|
|
1631
|
+
Vt({ type: 'action', name: e, object: t, arguments: a });
|
|
1632
|
+
}
|
|
1633
|
+
var u = We();
|
|
1634
|
+
bt();
|
|
1635
|
+
var c = ot(!0),
|
|
1636
|
+
p = $e(!0),
|
|
1637
|
+
l = {
|
|
1638
|
+
prevDerivation: u,
|
|
1639
|
+
prevAllowStateChanges: c,
|
|
1640
|
+
prevAllowStateReads: p,
|
|
1641
|
+
notifySpy: n,
|
|
1642
|
+
startTime: o,
|
|
1643
|
+
actionId: et++,
|
|
1644
|
+
parentActionId: Qe,
|
|
1645
|
+
};
|
|
1646
|
+
return (Qe = l.actionId), l;
|
|
1647
|
+
})(e, r, n);
|
|
1648
|
+
try {
|
|
1649
|
+
return t.apply(r, n);
|
|
1650
|
+
} catch (e) {
|
|
1651
|
+
throw ((o.error = e), e);
|
|
1652
|
+
} finally {
|
|
1653
|
+
!(function (e) {
|
|
1654
|
+
Qe !== e.actionId &&
|
|
1655
|
+
J('invalid action stack. did you forget to finish an action?');
|
|
1656
|
+
(Qe = e.parentActionId),
|
|
1657
|
+
void 0 !== e.error && (ft.suppressReactionErrors = !0);
|
|
1658
|
+
it(e.prevAllowStateChanges),
|
|
1659
|
+
Ye(e.prevAllowStateReads),
|
|
1660
|
+
mt(),
|
|
1661
|
+
Xe(e.prevDerivation),
|
|
1662
|
+
e.notifySpy &&
|
|
1663
|
+
'production' !== process.env.NODE_ENV &&
|
|
1664
|
+
kt({ time: Date.now() - e.startTime });
|
|
1665
|
+
ft.suppressReactionErrors = !1;
|
|
1666
|
+
})(o);
|
|
1667
|
+
}
|
|
1668
|
+
})(e, t, r || this, arguments);
|
|
1669
|
+
};
|
|
1670
|
+
return (
|
|
1671
|
+
(n.isMobxAction = !0),
|
|
1672
|
+
'production' !== process.env.NODE_ENV &&
|
|
1673
|
+
rt &&
|
|
1674
|
+
Object.defineProperty(n, 'name', { value: e }),
|
|
1675
|
+
n
|
|
1676
|
+
);
|
|
1677
|
+
}
|
|
1678
|
+
function ot(e) {
|
|
1679
|
+
var t = ft.allowStateChanges;
|
|
1680
|
+
return (ft.allowStateChanges = e), t;
|
|
1681
|
+
}
|
|
1682
|
+
function it(e) {
|
|
1683
|
+
ft.allowStateChanges = e;
|
|
1684
|
+
}
|
|
1685
|
+
var at = (function (e) {
|
|
1686
|
+
function t(t, r, n, o, i) {
|
|
1687
|
+
void 0 === n && (n = 'ObservableValue@' + F()),
|
|
1688
|
+
void 0 === o && (o = !0),
|
|
1689
|
+
void 0 === i && (i = le.default);
|
|
1690
|
+
var a = e.call(this, n) || this;
|
|
1691
|
+
return (
|
|
1692
|
+
(a.enhancer = r),
|
|
1693
|
+
(a.name = n),
|
|
1694
|
+
(a.equals = i),
|
|
1695
|
+
(a.hasUnreportedChange = !1),
|
|
1696
|
+
(a.value = r(t, void 0, n)),
|
|
1697
|
+
o &&
|
|
1698
|
+
Dt() &&
|
|
1699
|
+
'production' !== process.env.NODE_ENV &&
|
|
1700
|
+
At({ type: 'create', name: a.name, newValue: '' + a.value }),
|
|
1701
|
+
a
|
|
1702
|
+
);
|
|
1703
|
+
}
|
|
1704
|
+
return (
|
|
1705
|
+
(function (e, t) {
|
|
1706
|
+
function r() {
|
|
1707
|
+
this.constructor = e;
|
|
1708
|
+
}
|
|
1709
|
+
de(e, t),
|
|
1710
|
+
(e.prototype =
|
|
1711
|
+
null === t
|
|
1712
|
+
? Object.create(t)
|
|
1713
|
+
: ((r.prototype = t.prototype), new r()));
|
|
1714
|
+
})(t, e),
|
|
1715
|
+
(t.prototype.dehanceValue = function (e) {
|
|
1716
|
+
return void 0 !== this.dehancer ? this.dehancer(e) : e;
|
|
1717
|
+
}),
|
|
1718
|
+
(t.prototype.set = function (e) {
|
|
1719
|
+
var t = this.value;
|
|
1720
|
+
if ((e = this.prepareNewValue(e)) !== ft.UNCHANGED) {
|
|
1721
|
+
var r = Dt();
|
|
1722
|
+
r &&
|
|
1723
|
+
'production' !== process.env.NODE_ENV &&
|
|
1724
|
+
Vt({ type: 'update', name: this.name, newValue: e, oldValue: t }),
|
|
1725
|
+
this.setNewValue(e),
|
|
1726
|
+
r && 'production' !== process.env.NODE_ENV && kt();
|
|
1727
|
+
}
|
|
1728
|
+
}),
|
|
1729
|
+
(t.prototype.prepareNewValue = function (e) {
|
|
1730
|
+
if ((Ke(this), Ht(this))) {
|
|
1731
|
+
var t = Xt(this, { object: this, type: 'update', newValue: e });
|
|
1732
|
+
if (!t) return ft.UNCHANGED;
|
|
1733
|
+
e = t.newValue;
|
|
1734
|
+
}
|
|
1735
|
+
return (
|
|
1736
|
+
(e = this.enhancer(e, this.value, this.name)),
|
|
1737
|
+
this.equals(this.value, e) ? ft.UNCHANGED : e
|
|
1738
|
+
);
|
|
1739
|
+
}),
|
|
1740
|
+
(t.prototype.setNewValue = function (e) {
|
|
1741
|
+
var t = this.value;
|
|
1742
|
+
(this.value = e),
|
|
1743
|
+
this.reportChanged(),
|
|
1744
|
+
$t(this) &&
|
|
1745
|
+
Zt(this, { type: 'update', object: this, newValue: e, oldValue: t });
|
|
1746
|
+
}),
|
|
1747
|
+
(t.prototype.get = function () {
|
|
1748
|
+
return this.reportObserved(), this.dehanceValue(this.value);
|
|
1749
|
+
}),
|
|
1750
|
+
(t.prototype.intercept = function (e) {
|
|
1751
|
+
return Wt(this, e);
|
|
1752
|
+
}),
|
|
1753
|
+
(t.prototype.observe = function (e, t) {
|
|
1754
|
+
return (
|
|
1755
|
+
t &&
|
|
1756
|
+
e({
|
|
1757
|
+
object: this,
|
|
1758
|
+
type: 'update',
|
|
1759
|
+
newValue: this.value,
|
|
1760
|
+
oldValue: void 0,
|
|
1761
|
+
}),
|
|
1762
|
+
Yt(this, e)
|
|
1763
|
+
);
|
|
1764
|
+
}),
|
|
1765
|
+
(t.prototype.toJSON = function () {
|
|
1766
|
+
return this.get();
|
|
1767
|
+
}),
|
|
1768
|
+
(t.prototype.toString = function () {
|
|
1769
|
+
return this.name + '[' + this.value + ']';
|
|
1770
|
+
}),
|
|
1771
|
+
(t.prototype.valueOf = function () {
|
|
1772
|
+
return ie(this.get());
|
|
1773
|
+
}),
|
|
1774
|
+
(t.prototype[Symbol.toPrimitive] = function () {
|
|
1775
|
+
return this.valueOf();
|
|
1776
|
+
}),
|
|
1777
|
+
t
|
|
1778
|
+
);
|
|
1779
|
+
})(ue);
|
|
1780
|
+
ee('ObservableValue', at);
|
|
1781
|
+
var st = (function () {
|
|
1782
|
+
function e(e) {
|
|
1783
|
+
(this.dependenciesState = Le.NOT_TRACKING),
|
|
1784
|
+
(this.observing = []),
|
|
1785
|
+
(this.newObserving = null),
|
|
1786
|
+
(this.isBeingObserved = !1),
|
|
1787
|
+
(this.isPendingUnobservation = !1),
|
|
1788
|
+
(this.observers = new Set()),
|
|
1789
|
+
(this.diffValue = 0),
|
|
1790
|
+
(this.runId = 0),
|
|
1791
|
+
(this.lastAccessedBy = 0),
|
|
1792
|
+
(this.lowestObserverState = Le.UP_TO_DATE),
|
|
1793
|
+
(this.unboundDepsCount = 0),
|
|
1794
|
+
(this.__mapid = '#' + F()),
|
|
1795
|
+
(this.value = new Me(null)),
|
|
1796
|
+
(this.isComputing = !1),
|
|
1797
|
+
(this.isRunningSetter = !1),
|
|
1798
|
+
(this.isTracing = Be.NONE),
|
|
1799
|
+
H(e.get, 'missing option for computed: get'),
|
|
1800
|
+
(this.derivation = e.get),
|
|
1801
|
+
(this.name = e.name || 'ComputedValue@' + F()),
|
|
1802
|
+
e.set && (this.setter = nt(this.name + '-setter', e.set)),
|
|
1803
|
+
(this.equals =
|
|
1804
|
+
e.equals ||
|
|
1805
|
+
(e.compareStructural || e.struct ? le.structural : le.default)),
|
|
1806
|
+
(this.scope = e.context),
|
|
1807
|
+
(this.requiresReaction = !!e.requiresReaction),
|
|
1808
|
+
(this.keepAlive = !!e.keepAlive);
|
|
1809
|
+
}
|
|
1810
|
+
return (
|
|
1811
|
+
(e.prototype.onBecomeStale = function () {
|
|
1812
|
+
!(function (e) {
|
|
1813
|
+
if (e.lowestObserverState !== Le.UP_TO_DATE) return;
|
|
1814
|
+
(e.lowestObserverState = Le.POSSIBLY_STALE),
|
|
1815
|
+
e.observers.forEach(function (t) {
|
|
1816
|
+
t.dependenciesState === Le.UP_TO_DATE &&
|
|
1817
|
+
((t.dependenciesState = Le.POSSIBLY_STALE),
|
|
1818
|
+
t.isTracing !== Be.NONE && Ot(t, e),
|
|
1819
|
+
t.onBecomeStale());
|
|
1820
|
+
});
|
|
1821
|
+
})(this);
|
|
1822
|
+
}),
|
|
1823
|
+
(e.prototype.onBecomeObserved = function () {
|
|
1824
|
+
this.onBecomeObservedListeners &&
|
|
1825
|
+
this.onBecomeObservedListeners.forEach(function (e) {
|
|
1826
|
+
return e();
|
|
1827
|
+
});
|
|
1828
|
+
}),
|
|
1829
|
+
(e.prototype.onBecomeUnobserved = function () {
|
|
1830
|
+
this.onBecomeUnobservedListeners &&
|
|
1831
|
+
this.onBecomeUnobservedListeners.forEach(function (e) {
|
|
1832
|
+
return e();
|
|
1833
|
+
});
|
|
1834
|
+
}),
|
|
1835
|
+
(e.prototype.get = function () {
|
|
1836
|
+
this.isComputing &&
|
|
1837
|
+
J(
|
|
1838
|
+
'Cycle detected in computation ' +
|
|
1839
|
+
this.name +
|
|
1840
|
+
': ' +
|
|
1841
|
+
this.derivation,
|
|
1842
|
+
),
|
|
1843
|
+
0 !== ft.inBatch || 0 !== this.observers.size || this.keepAlive
|
|
1844
|
+
? (gt(this),
|
|
1845
|
+
ze(this) &&
|
|
1846
|
+
this.trackAndCompute() &&
|
|
1847
|
+
(function (e) {
|
|
1848
|
+
if (e.lowestObserverState === Le.STALE) return;
|
|
1849
|
+
(e.lowestObserverState = Le.STALE),
|
|
1850
|
+
e.observers.forEach(function (t) {
|
|
1851
|
+
t.dependenciesState === Le.POSSIBLY_STALE
|
|
1852
|
+
? (t.dependenciesState = Le.STALE)
|
|
1853
|
+
: t.dependenciesState === Le.UP_TO_DATE &&
|
|
1854
|
+
(e.lowestObserverState = Le.UP_TO_DATE);
|
|
1855
|
+
});
|
|
1856
|
+
})(this))
|
|
1857
|
+
: ze(this) &&
|
|
1858
|
+
(this.warnAboutUntrackedRead(),
|
|
1859
|
+
bt(),
|
|
1860
|
+
(this.value = this.computeValue(!1)),
|
|
1861
|
+
mt());
|
|
1862
|
+
var e = this.value;
|
|
1863
|
+
if (Ge(e)) throw e.cause;
|
|
1864
|
+
return e;
|
|
1865
|
+
}),
|
|
1866
|
+
(e.prototype.peek = function () {
|
|
1867
|
+
var e = this.computeValue(!1);
|
|
1868
|
+
if (Ge(e)) throw e.cause;
|
|
1869
|
+
return e;
|
|
1870
|
+
}),
|
|
1871
|
+
(e.prototype.set = function (e) {
|
|
1872
|
+
if (this.setter) {
|
|
1873
|
+
H(
|
|
1874
|
+
!this.isRunningSetter,
|
|
1875
|
+
"The setter of computed value '" +
|
|
1876
|
+
this.name +
|
|
1877
|
+
"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?",
|
|
1878
|
+
),
|
|
1879
|
+
(this.isRunningSetter = !0);
|
|
1880
|
+
try {
|
|
1881
|
+
this.setter.call(this.scope, e);
|
|
1882
|
+
} finally {
|
|
1883
|
+
this.isRunningSetter = !1;
|
|
1884
|
+
}
|
|
1885
|
+
} else
|
|
1886
|
+
H(
|
|
1887
|
+
!1,
|
|
1888
|
+
'production' !== process.env.NODE_ENV &&
|
|
1889
|
+
"[ComputedValue '" +
|
|
1890
|
+
this.name +
|
|
1891
|
+
"'] It is not possible to assign a new value to a computed value.",
|
|
1892
|
+
);
|
|
1893
|
+
}),
|
|
1894
|
+
(e.prototype.trackAndCompute = function () {
|
|
1895
|
+
Dt() &&
|
|
1896
|
+
'production' !== process.env.NODE_ENV &&
|
|
1897
|
+
At({ object: this.scope, type: 'compute', name: this.name });
|
|
1898
|
+
var e = this.value,
|
|
1899
|
+
t = this.dependenciesState === Le.NOT_TRACKING,
|
|
1900
|
+
r = this.computeValue(!0),
|
|
1901
|
+
n = t || Ge(e) || Ge(r) || !this.equals(e, r);
|
|
1902
|
+
return n && (this.value = r), n;
|
|
1903
|
+
}),
|
|
1904
|
+
(e.prototype.computeValue = function (e) {
|
|
1905
|
+
var t;
|
|
1906
|
+
if (((this.isComputing = !0), ft.computationDepth++, e))
|
|
1907
|
+
t = Fe(this, this.derivation, this.scope);
|
|
1908
|
+
else if (!0 === ft.disableErrorBoundaries)
|
|
1909
|
+
t = this.derivation.call(this.scope);
|
|
1910
|
+
else
|
|
1911
|
+
try {
|
|
1912
|
+
t = this.derivation.call(this.scope);
|
|
1913
|
+
} catch (e) {
|
|
1914
|
+
t = new Me(e);
|
|
1915
|
+
}
|
|
1916
|
+
return ft.computationDepth--, (this.isComputing = !1), t;
|
|
1917
|
+
}),
|
|
1918
|
+
(e.prototype.suspend = function () {
|
|
1919
|
+
this.keepAlive || (Je(this), (this.value = void 0));
|
|
1920
|
+
}),
|
|
1921
|
+
(e.prototype.observe = function (e, t) {
|
|
1922
|
+
var r = this,
|
|
1923
|
+
n = !0,
|
|
1924
|
+
o = void 0;
|
|
1925
|
+
return (function (e, t) {
|
|
1926
|
+
void 0 === t && (t = K);
|
|
1927
|
+
'production' !== process.env.NODE_ENV &&
|
|
1928
|
+
(H(
|
|
1929
|
+
'function' == typeof e,
|
|
1930
|
+
'Autorun expects a function as first argument',
|
|
1931
|
+
),
|
|
1932
|
+
H(
|
|
1933
|
+
!1 == ('function' == typeof (r = e) && !0 === r.isMobxAction),
|
|
1934
|
+
'Autorun does not accept actions since actions are untrackable',
|
|
1935
|
+
));
|
|
1936
|
+
var r;
|
|
1937
|
+
var n,
|
|
1938
|
+
o = (t && t.name) || e.name || 'Autorun@' + F();
|
|
1939
|
+
if (t.scheduler || t.delay) {
|
|
1940
|
+
var i = (function (e) {
|
|
1941
|
+
return e.scheduler
|
|
1942
|
+
? e.scheduler
|
|
1943
|
+
: e.delay
|
|
1944
|
+
? function (t) {
|
|
1945
|
+
return setTimeout(t, e.delay);
|
|
1946
|
+
}
|
|
1947
|
+
: Ct;
|
|
1948
|
+
})(t),
|
|
1949
|
+
a = !1;
|
|
1950
|
+
n = new Nt(
|
|
1951
|
+
o,
|
|
1952
|
+
function () {
|
|
1953
|
+
a ||
|
|
1954
|
+
((a = !0),
|
|
1955
|
+
i(function () {
|
|
1956
|
+
(a = !1), n.isDisposed || n.track(s);
|
|
1957
|
+
}));
|
|
1958
|
+
},
|
|
1959
|
+
t.onError,
|
|
1960
|
+
t.requiresObservable,
|
|
1961
|
+
);
|
|
1962
|
+
} else
|
|
1963
|
+
n = new Nt(
|
|
1964
|
+
o,
|
|
1965
|
+
function () {
|
|
1966
|
+
this.track(s);
|
|
1967
|
+
},
|
|
1968
|
+
t.onError,
|
|
1969
|
+
t.requiresObservable,
|
|
1970
|
+
);
|
|
1971
|
+
function s() {
|
|
1972
|
+
e(n);
|
|
1973
|
+
}
|
|
1974
|
+
return n.schedule(), n.getDisposer();
|
|
1975
|
+
})(function () {
|
|
1976
|
+
var i = r.get();
|
|
1977
|
+
if (!n || t) {
|
|
1978
|
+
var a = We();
|
|
1979
|
+
e({ type: 'update', object: r, newValue: i, oldValue: o }), Xe(a);
|
|
1980
|
+
}
|
|
1981
|
+
(n = !1), (o = i);
|
|
1982
|
+
});
|
|
1983
|
+
}),
|
|
1984
|
+
(e.prototype.warnAboutUntrackedRead = function () {
|
|
1985
|
+
'production' !== process.env.NODE_ENV &&
|
|
1986
|
+
(!0 === this.requiresReaction &&
|
|
1987
|
+
J(
|
|
1988
|
+
'[mobx] Computed value ' +
|
|
1989
|
+
this.name +
|
|
1990
|
+
' is read outside a reactive context',
|
|
1991
|
+
),
|
|
1992
|
+
this.isTracing !== Be.NONE &&
|
|
1993
|
+
console.log(
|
|
1994
|
+
"[mobx.trace] '" +
|
|
1995
|
+
this.name +
|
|
1996
|
+
"' is being read outside a reactive context. Doing a full recompute",
|
|
1997
|
+
),
|
|
1998
|
+
ft.computedRequiresReaction &&
|
|
1999
|
+
console.warn(
|
|
2000
|
+
'[mobx] Computed value ' +
|
|
2001
|
+
this.name +
|
|
2002
|
+
' is being read outside a reactive context. Doing a full recompute',
|
|
2003
|
+
));
|
|
2004
|
+
}),
|
|
2005
|
+
(e.prototype.toJSON = function () {
|
|
2006
|
+
return this.get();
|
|
2007
|
+
}),
|
|
2008
|
+
(e.prototype.toString = function () {
|
|
2009
|
+
return this.name + '[' + this.derivation.toString() + ']';
|
|
2010
|
+
}),
|
|
2011
|
+
(e.prototype.valueOf = function () {
|
|
2012
|
+
return ie(this.get());
|
|
2013
|
+
}),
|
|
2014
|
+
(e.prototype[Symbol.toPrimitive] = function () {
|
|
2015
|
+
return this.valueOf();
|
|
2016
|
+
}),
|
|
2017
|
+
e
|
|
2018
|
+
);
|
|
2019
|
+
})(),
|
|
2020
|
+
ut = ee('ComputedValue', st),
|
|
2021
|
+
ct = function () {
|
|
2022
|
+
(this.version = 5),
|
|
2023
|
+
(this.UNCHANGED = {}),
|
|
2024
|
+
(this.trackingDerivation = null),
|
|
2025
|
+
(this.computationDepth = 0),
|
|
2026
|
+
(this.runId = 0),
|
|
2027
|
+
(this.mobxGuid = 0),
|
|
2028
|
+
(this.inBatch = 0),
|
|
2029
|
+
(this.pendingUnobservations = []),
|
|
2030
|
+
(this.pendingReactions = []),
|
|
2031
|
+
(this.isRunningReactions = !1),
|
|
2032
|
+
(this.allowStateChanges = !0),
|
|
2033
|
+
(this.allowStateReads = !0),
|
|
2034
|
+
(this.enforceActions = !1),
|
|
2035
|
+
(this.spyListeners = []),
|
|
2036
|
+
(this.globalReactionErrorHandlers = []),
|
|
2037
|
+
(this.computedRequiresReaction = !1),
|
|
2038
|
+
(this.reactionRequiresObservable = !1),
|
|
2039
|
+
(this.observableRequiresReaction = !1),
|
|
2040
|
+
(this.computedConfigurable = !1),
|
|
2041
|
+
(this.disableErrorBoundaries = !1),
|
|
2042
|
+
(this.suppressReactionErrors = !1);
|
|
2043
|
+
},
|
|
2044
|
+
pt = {};
|
|
2045
|
+
function lt() {
|
|
2046
|
+
return 'undefined' != typeof window
|
|
2047
|
+
? window
|
|
2048
|
+
: 'undefined' != typeof global
|
|
2049
|
+
? global
|
|
2050
|
+
: 'undefined' != typeof self
|
|
2051
|
+
? self
|
|
2052
|
+
: pt;
|
|
2053
|
+
}
|
|
2054
|
+
var dt = !0,
|
|
2055
|
+
ft = (function () {
|
|
2056
|
+
var e = lt();
|
|
2057
|
+
return (
|
|
2058
|
+
e.__mobxInstanceCount > 0 && !e.__mobxGlobals && (dt = !1),
|
|
2059
|
+
e.__mobxGlobals &&
|
|
2060
|
+
e.__mobxGlobals.version !== new ct().version &&
|
|
2061
|
+
(dt = !1),
|
|
2062
|
+
dt
|
|
2063
|
+
? e.__mobxGlobals
|
|
2064
|
+
? ((e.__mobxInstanceCount += 1),
|
|
2065
|
+
e.__mobxGlobals.UNCHANGED || (e.__mobxGlobals.UNCHANGED = {}),
|
|
2066
|
+
e.__mobxGlobals)
|
|
2067
|
+
: ((e.__mobxInstanceCount = 1), (e.__mobxGlobals = new ct()))
|
|
2068
|
+
: (setTimeout(function () {
|
|
2069
|
+
J(
|
|
2070
|
+
'There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`',
|
|
2071
|
+
);
|
|
2072
|
+
}, 1),
|
|
2073
|
+
new ct())
|
|
2074
|
+
);
|
|
2075
|
+
})();
|
|
2076
|
+
function ht(e, t) {
|
|
2077
|
+
e.observers.add(t),
|
|
2078
|
+
e.lowestObserverState > t.dependenciesState &&
|
|
2079
|
+
(e.lowestObserverState = t.dependenciesState);
|
|
2080
|
+
}
|
|
2081
|
+
function vt(e, t) {
|
|
2082
|
+
e.observers.delete(t), 0 === e.observers.size && yt(e);
|
|
2083
|
+
}
|
|
2084
|
+
function yt(e) {
|
|
2085
|
+
!1 === e.isPendingUnobservation &&
|
|
2086
|
+
((e.isPendingUnobservation = !0), ft.pendingUnobservations.push(e));
|
|
2087
|
+
}
|
|
2088
|
+
function bt() {
|
|
2089
|
+
ft.inBatch++;
|
|
2090
|
+
}
|
|
2091
|
+
function mt() {
|
|
2092
|
+
if (0 === --ft.inBatch) {
|
|
2093
|
+
jt();
|
|
2094
|
+
for (var e = ft.pendingUnobservations, t = 0; t < e.length; t++) {
|
|
2095
|
+
var r = e[t];
|
|
2096
|
+
(r.isPendingUnobservation = !1),
|
|
2097
|
+
0 === r.observers.size &&
|
|
2098
|
+
(r.isBeingObserved &&
|
|
2099
|
+
((r.isBeingObserved = !1), r.onBecomeUnobserved()),
|
|
2100
|
+
r instanceof st && r.suspend());
|
|
2101
|
+
}
|
|
2102
|
+
ft.pendingUnobservations = [];
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
function gt(e) {
|
|
2106
|
+
!(function (e) {
|
|
2107
|
+
'production' !== process.env.NODE_ENV &&
|
|
2108
|
+
!ft.allowStateReads &&
|
|
2109
|
+
ft.observableRequiresReaction &&
|
|
2110
|
+
console.warn(
|
|
2111
|
+
'[mobx] Observable ' +
|
|
2112
|
+
e.name +
|
|
2113
|
+
' being read outside a reactive context',
|
|
2114
|
+
);
|
|
2115
|
+
})(e);
|
|
2116
|
+
var t = ft.trackingDerivation;
|
|
2117
|
+
return null !== t
|
|
2118
|
+
? (t.runId !== e.lastAccessedBy &&
|
|
2119
|
+
((e.lastAccessedBy = t.runId),
|
|
2120
|
+
(t.newObserving[t.unboundDepsCount++] = e),
|
|
2121
|
+
e.isBeingObserved || ((e.isBeingObserved = !0), e.onBecomeObserved())),
|
|
2122
|
+
!0)
|
|
2123
|
+
: (0 === e.observers.size && ft.inBatch > 0 && yt(e), !1);
|
|
2124
|
+
}
|
|
2125
|
+
function Ot(e, t) {
|
|
2126
|
+
if (
|
|
2127
|
+
(console.log(
|
|
2128
|
+
"[mobx.trace] '" +
|
|
2129
|
+
e.name +
|
|
2130
|
+
"' is invalidated due to a change in: '" +
|
|
2131
|
+
t.name +
|
|
2132
|
+
"'",
|
|
2133
|
+
),
|
|
2134
|
+
e.isTracing === Be.BREAK)
|
|
2135
|
+
) {
|
|
2136
|
+
var r = [];
|
|
2137
|
+
Et(Bt(gr(e, n)), r, 1),
|
|
2138
|
+
new Function(
|
|
2139
|
+
"debugger;\n/*\nTracing '" +
|
|
2140
|
+
e.name +
|
|
2141
|
+
"'\n\nYou are entering this break point because derivation '" +
|
|
2142
|
+
e.name +
|
|
2143
|
+
"' is being traced and '" +
|
|
2144
|
+
t.name +
|
|
2145
|
+
"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n" +
|
|
2146
|
+
(e instanceof st
|
|
2147
|
+
? e.derivation.toString().replace(/[*]\//g, '/')
|
|
2148
|
+
: '') +
|
|
2149
|
+
'\n\nThe dependencies for this derivation are:\n\n' +
|
|
2150
|
+
r.join('\n') +
|
|
2151
|
+
'\n*/\n ',
|
|
2152
|
+
)();
|
|
2153
|
+
}
|
|
2154
|
+
var n;
|
|
2155
|
+
}
|
|
2156
|
+
function Et(e, t, r) {
|
|
2157
|
+
t.length >= 1e3
|
|
2158
|
+
? t.push('(and many more)')
|
|
2159
|
+
: (t.push('' + new Array(r).join('\t') + e.name),
|
|
2160
|
+
e.dependencies &&
|
|
2161
|
+
e.dependencies.forEach(function (e) {
|
|
2162
|
+
return Et(e, t, r + 1);
|
|
2163
|
+
}));
|
|
2164
|
+
}
|
|
2165
|
+
var Nt = (function () {
|
|
2166
|
+
function e(e, t, r, n) {
|
|
2167
|
+
void 0 === e && (e = 'Reaction@' + F()),
|
|
2168
|
+
void 0 === n && (n = !1),
|
|
2169
|
+
(this.name = e),
|
|
2170
|
+
(this.onInvalidate = t),
|
|
2171
|
+
(this.errorHandler = r),
|
|
2172
|
+
(this.requiresObservable = n),
|
|
2173
|
+
(this.observing = []),
|
|
2174
|
+
(this.newObserving = []),
|
|
2175
|
+
(this.dependenciesState = Le.NOT_TRACKING),
|
|
2176
|
+
(this.diffValue = 0),
|
|
2177
|
+
(this.runId = 0),
|
|
2178
|
+
(this.unboundDepsCount = 0),
|
|
2179
|
+
(this.__mapid = '#' + F()),
|
|
2180
|
+
(this.isDisposed = !1),
|
|
2181
|
+
(this._isScheduled = !1),
|
|
2182
|
+
(this._isTrackPending = !1),
|
|
2183
|
+
(this._isRunning = !1),
|
|
2184
|
+
(this.isTracing = Be.NONE);
|
|
2185
|
+
}
|
|
2186
|
+
return (
|
|
2187
|
+
(e.prototype.onBecomeStale = function () {
|
|
2188
|
+
this.schedule();
|
|
2189
|
+
}),
|
|
2190
|
+
(e.prototype.schedule = function () {
|
|
2191
|
+
this._isScheduled ||
|
|
2192
|
+
((this._isScheduled = !0), ft.pendingReactions.push(this), jt());
|
|
2193
|
+
}),
|
|
2194
|
+
(e.prototype.isScheduled = function () {
|
|
2195
|
+
return this._isScheduled;
|
|
2196
|
+
}),
|
|
2197
|
+
(e.prototype.runReaction = function () {
|
|
2198
|
+
if (!this.isDisposed) {
|
|
2199
|
+
if ((bt(), (this._isScheduled = !1), ze(this))) {
|
|
2200
|
+
this._isTrackPending = !0;
|
|
2201
|
+
try {
|
|
2202
|
+
this.onInvalidate(),
|
|
2203
|
+
this._isTrackPending &&
|
|
2204
|
+
Dt() &&
|
|
2205
|
+
'production' !== process.env.NODE_ENV &&
|
|
2206
|
+
At({ name: this.name, type: 'scheduled-reaction' });
|
|
2207
|
+
} catch (e) {
|
|
2208
|
+
this.reportExceptionInDerivation(e);
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
mt();
|
|
2212
|
+
}
|
|
2213
|
+
}),
|
|
2214
|
+
(e.prototype.track = function (e) {
|
|
2215
|
+
if (!this.isDisposed) {
|
|
2216
|
+
bt();
|
|
2217
|
+
var t,
|
|
2218
|
+
r = Dt();
|
|
2219
|
+
r &&
|
|
2220
|
+
'production' !== process.env.NODE_ENV &&
|
|
2221
|
+
((t = Date.now()), Vt({ name: this.name, type: 'reaction' })),
|
|
2222
|
+
(this._isRunning = !0);
|
|
2223
|
+
var n = Fe(this, e, void 0);
|
|
2224
|
+
(this._isRunning = !1),
|
|
2225
|
+
(this._isTrackPending = !1),
|
|
2226
|
+
this.isDisposed && Je(this),
|
|
2227
|
+
Ge(n) && this.reportExceptionInDerivation(n.cause),
|
|
2228
|
+
r &&
|
|
2229
|
+
'production' !== process.env.NODE_ENV &&
|
|
2230
|
+
kt({ time: Date.now() - t }),
|
|
2231
|
+
mt();
|
|
2232
|
+
}
|
|
2233
|
+
}),
|
|
2234
|
+
(e.prototype.reportExceptionInDerivation = function (e) {
|
|
2235
|
+
var t = this;
|
|
2236
|
+
if (this.errorHandler) this.errorHandler(e, this);
|
|
2237
|
+
else {
|
|
2238
|
+
if (ft.disableErrorBoundaries) throw e;
|
|
2239
|
+
var r =
|
|
2240
|
+
"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '" +
|
|
2241
|
+
this +
|
|
2242
|
+
"'";
|
|
2243
|
+
ft.suppressReactionErrors
|
|
2244
|
+
? console.warn(
|
|
2245
|
+
"[mobx] (error in reaction '" +
|
|
2246
|
+
this.name +
|
|
2247
|
+
"' suppressed, fix error of causing action below)",
|
|
2248
|
+
)
|
|
2249
|
+
: console.error(r, e),
|
|
2250
|
+
Dt() &&
|
|
2251
|
+
At({ type: 'error', name: this.name, message: r, error: '' + e }),
|
|
2252
|
+
ft.globalReactionErrorHandlers.forEach(function (r) {
|
|
2253
|
+
return r(e, t);
|
|
2254
|
+
});
|
|
2255
|
+
}
|
|
2256
|
+
}),
|
|
2257
|
+
(e.prototype.dispose = function () {
|
|
2258
|
+
this.isDisposed ||
|
|
2259
|
+
((this.isDisposed = !0), this._isRunning || (bt(), Je(this), mt()));
|
|
2260
|
+
}),
|
|
2261
|
+
(e.prototype.getDisposer = function () {
|
|
2262
|
+
var e = this.dispose.bind(this);
|
|
2263
|
+
return (e[se] = this), e;
|
|
2264
|
+
}),
|
|
2265
|
+
(e.prototype.toString = function () {
|
|
2266
|
+
return 'Reaction[' + this.name + ']';
|
|
2267
|
+
}),
|
|
2268
|
+
(e.prototype.trace = function (e) {
|
|
2269
|
+
void 0 === e && (e = !1),
|
|
2270
|
+
(function () {
|
|
2271
|
+
for (var e = [], t = 0; t < arguments.length; t++)
|
|
2272
|
+
e[t] = arguments[t];
|
|
2273
|
+
var r = !1;
|
|
2274
|
+
'boolean' == typeof e[e.length - 1] && (r = e.pop());
|
|
2275
|
+
var n = (function (e) {
|
|
2276
|
+
switch (e.length) {
|
|
2277
|
+
case 0:
|
|
2278
|
+
return ft.trackingDerivation;
|
|
2279
|
+
case 1:
|
|
2280
|
+
return gr(e[0]);
|
|
2281
|
+
case 2:
|
|
2282
|
+
return gr(e[0], e[1]);
|
|
2283
|
+
}
|
|
2284
|
+
})(e);
|
|
2285
|
+
if (!n)
|
|
2286
|
+
return J(
|
|
2287
|
+
'production' !== process.env.NODE_ENV &&
|
|
2288
|
+
"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly",
|
|
2289
|
+
);
|
|
2290
|
+
n.isTracing === Be.NONE &&
|
|
2291
|
+
console.log("[mobx.trace] '" + n.name + "' tracing enabled");
|
|
2292
|
+
n.isTracing = r ? Be.BREAK : Be.LOG;
|
|
2293
|
+
})(this, e);
|
|
2294
|
+
}),
|
|
2295
|
+
e
|
|
2296
|
+
);
|
|
2297
|
+
})(),
|
|
2298
|
+
wt = 100,
|
|
2299
|
+
_t = function (e) {
|
|
2300
|
+
return e();
|
|
2301
|
+
};
|
|
2302
|
+
function jt() {
|
|
2303
|
+
ft.inBatch > 0 || ft.isRunningReactions || _t(xt);
|
|
2304
|
+
}
|
|
2305
|
+
function xt() {
|
|
2306
|
+
ft.isRunningReactions = !0;
|
|
2307
|
+
for (var e = ft.pendingReactions, t = 0; e.length > 0; ) {
|
|
2308
|
+
++t === wt &&
|
|
2309
|
+
(console.error(
|
|
2310
|
+
"Reaction doesn't converge to a stable state after " +
|
|
2311
|
+
wt +
|
|
2312
|
+
' iterations. Probably there is a cycle in the reactive function: ' +
|
|
2313
|
+
e[0],
|
|
2314
|
+
),
|
|
2315
|
+
e.splice(0));
|
|
2316
|
+
for (var r = e.splice(0), n = 0, o = r.length; n < o; n++)
|
|
2317
|
+
r[n].runReaction();
|
|
2318
|
+
}
|
|
2319
|
+
ft.isRunningReactions = !1;
|
|
2320
|
+
}
|
|
2321
|
+
var St = ee('Reaction', Nt);
|
|
2322
|
+
function Dt() {
|
|
2323
|
+
return 'production' !== process.env.NODE_ENV && !!ft.spyListeners.length;
|
|
2324
|
+
}
|
|
2325
|
+
function At(e) {
|
|
2326
|
+
if ('production' !== process.env.NODE_ENV && ft.spyListeners.length)
|
|
2327
|
+
for (var t = ft.spyListeners, r = 0, n = t.length; r < n; r++) t[r](e);
|
|
2328
|
+
}
|
|
2329
|
+
function Vt(e) {
|
|
2330
|
+
'production' !== process.env.NODE_ENV &&
|
|
2331
|
+
At(fe(fe({}, e), { spyReportStart: !0 }));
|
|
2332
|
+
}
|
|
2333
|
+
var Tt = { spyReportEnd: !0 };
|
|
2334
|
+
function kt(e) {
|
|
2335
|
+
'production' !== process.env.NODE_ENV &&
|
|
2336
|
+
At(e ? fe(fe({}, e), { spyReportEnd: !0 }) : Tt);
|
|
2337
|
+
}
|
|
2338
|
+
var Ct = function (e) {
|
|
2339
|
+
return e();
|
|
2340
|
+
};
|
|
2341
|
+
function Rt(e, t, r) {
|
|
2342
|
+
return Pt('onBecomeUnobserved', e, t, r);
|
|
2343
|
+
}
|
|
2344
|
+
function Pt(e, t, r, n) {
|
|
2345
|
+
var o = 'function' == typeof n ? gr(t, r) : gr(t),
|
|
2346
|
+
i = 'function' == typeof n ? n : r,
|
|
2347
|
+
a = e + 'Listeners';
|
|
2348
|
+
return (
|
|
2349
|
+
o[a] ? o[a].add(i) : (o[a] = new Set([i])),
|
|
2350
|
+
'function' != typeof o[e]
|
|
2351
|
+
? J(
|
|
2352
|
+
'production' !== process.env.NODE_ENV &&
|
|
2353
|
+
'Not an atom that can be (un)observed',
|
|
2354
|
+
)
|
|
2355
|
+
: function () {
|
|
2356
|
+
var e = o[a];
|
|
2357
|
+
e && (e.delete(i), 0 === e.size && delete o[a]);
|
|
2358
|
+
}
|
|
2359
|
+
);
|
|
2360
|
+
}
|
|
2361
|
+
function Ut(e, t, r, n) {
|
|
2362
|
+
'production' !== process.env.NODE_ENV &&
|
|
2363
|
+
(H(
|
|
2364
|
+
arguments.length >= 2 && arguments.length <= 4,
|
|
2365
|
+
"'extendObservable' expected 2-4 arguments",
|
|
2366
|
+
),
|
|
2367
|
+
H(
|
|
2368
|
+
'object' == typeof e,
|
|
2369
|
+
"'extendObservable' expects an object as first argument",
|
|
2370
|
+
),
|
|
2371
|
+
H(
|
|
2372
|
+
!ur(e),
|
|
2373
|
+
"'extendObservable' should not be used on maps, use map.merge instead",
|
|
2374
|
+
));
|
|
2375
|
+
var o = qt((n = Ae(n)));
|
|
2376
|
+
return Ee(e), fr(e, n.name, o.enhancer), t && Lt(e, t, r, o), e;
|
|
2377
|
+
}
|
|
2378
|
+
function qt(e) {
|
|
2379
|
+
return e.defaultDecorator || (!1 === e.deep ? ke : Ve);
|
|
2380
|
+
}
|
|
2381
|
+
function Lt(e, t, r, n) {
|
|
2382
|
+
var o, i, a, s;
|
|
2383
|
+
if (
|
|
2384
|
+
'production' !== process.env.NODE_ENV &&
|
|
2385
|
+
(H(
|
|
2386
|
+
!Mt(t),
|
|
2387
|
+
'Extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540',
|
|
2388
|
+
),
|
|
2389
|
+
r)
|
|
2390
|
+
) {
|
|
2391
|
+
var u = ne(r);
|
|
2392
|
+
try {
|
|
2393
|
+
for (var c = he(u), p = c.next(); !p.done; p = c.next()) {
|
|
2394
|
+
(f = p.value) in t ||
|
|
2395
|
+
J(
|
|
2396
|
+
"Trying to declare a decorator for unspecified property '" +
|
|
2397
|
+
oe(f) +
|
|
2398
|
+
"'",
|
|
2399
|
+
);
|
|
2400
|
+
}
|
|
2401
|
+
} catch (e) {
|
|
2402
|
+
o = { error: e };
|
|
2403
|
+
} finally {
|
|
2404
|
+
try {
|
|
2405
|
+
p && !p.done && (i = c.return) && i.call(c);
|
|
2406
|
+
} finally {
|
|
2407
|
+
if (o) throw o.error;
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
bt();
|
|
2412
|
+
try {
|
|
2413
|
+
u = ae(t);
|
|
2414
|
+
try {
|
|
2415
|
+
for (var l = he(u), d = l.next(); !d.done; d = l.next()) {
|
|
2416
|
+
var f = d.value,
|
|
2417
|
+
h = Object.getOwnPropertyDescriptor(t, f);
|
|
2418
|
+
'production' !== process.env.NODE_ENV &&
|
|
2419
|
+
(Y(t) ||
|
|
2420
|
+
J(
|
|
2421
|
+
"'extendObservable' only accepts plain objects as second argument",
|
|
2422
|
+
),
|
|
2423
|
+
It(h.value) &&
|
|
2424
|
+
J(
|
|
2425
|
+
"Passing a 'computed' as initial property value is no longer supported by extendObservable. Use a getter or decorator instead",
|
|
2426
|
+
));
|
|
2427
|
+
var v = r && f in r ? r[f] : h.get ? Ie : n;
|
|
2428
|
+
'production' !== process.env.NODE_ENV &&
|
|
2429
|
+
'function' != typeof v &&
|
|
2430
|
+
J("Not a valid decorator for '" + oe(f) + "', got: " + v);
|
|
2431
|
+
var y = v(e, f, h, !0);
|
|
2432
|
+
y && Object.defineProperty(e, f, y);
|
|
2433
|
+
}
|
|
2434
|
+
} catch (e) {
|
|
2435
|
+
a = { error: e };
|
|
2436
|
+
} finally {
|
|
2437
|
+
try {
|
|
2438
|
+
d && !d.done && (s = l.return) && s.call(l);
|
|
2439
|
+
} finally {
|
|
2440
|
+
if (a) throw a.error;
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
} finally {
|
|
2444
|
+
mt();
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
function Bt(e) {
|
|
2448
|
+
var t,
|
|
2449
|
+
r,
|
|
2450
|
+
n = { name: e.name };
|
|
2451
|
+
return (
|
|
2452
|
+
e.observing &&
|
|
2453
|
+
e.observing.length > 0 &&
|
|
2454
|
+
(n.dependencies = ((t = e.observing),
|
|
2455
|
+
(r = []),
|
|
2456
|
+
t.forEach(function (e) {
|
|
2457
|
+
-1 === r.indexOf(e) && r.push(e);
|
|
2458
|
+
}),
|
|
2459
|
+
r).map(Bt)),
|
|
2460
|
+
n
|
|
2461
|
+
);
|
|
2462
|
+
}
|
|
2463
|
+
function It(e) {
|
|
2464
|
+
return arguments.length > 1
|
|
2465
|
+
? J(
|
|
2466
|
+
'production' !== process.env.NODE_ENV &&
|
|
2467
|
+
'isComputed expects only 1 argument. Use isObservableProp to inspect the observability of a property',
|
|
2468
|
+
)
|
|
2469
|
+
: (function (e, t) {
|
|
2470
|
+
if (null == e) return !1;
|
|
2471
|
+
if (void 0 !== t) {
|
|
2472
|
+
if (!1 === mr(e)) return !1;
|
|
2473
|
+
if (!e[se].values.has(t)) return !1;
|
|
2474
|
+
var r = gr(e, t);
|
|
2475
|
+
return ut(r);
|
|
2476
|
+
}
|
|
2477
|
+
return ut(e);
|
|
2478
|
+
})(e);
|
|
2479
|
+
}
|
|
2480
|
+
function Mt(e) {
|
|
2481
|
+
return (
|
|
2482
|
+
1 !== arguments.length &&
|
|
2483
|
+
J(
|
|
2484
|
+
'production' !== process.env.NODE_ENV &&
|
|
2485
|
+
'isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property',
|
|
2486
|
+
),
|
|
2487
|
+
(function (e, t) {
|
|
2488
|
+
return (
|
|
2489
|
+
null != e &&
|
|
2490
|
+
(void 0 !== t
|
|
2491
|
+
? 'production' !== process.env.NODE_ENV && (ur(e) || or(e))
|
|
2492
|
+
? J(
|
|
2493
|
+
'isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.',
|
|
2494
|
+
)
|
|
2495
|
+
: !!mr(e) && e[se].values.has(t)
|
|
2496
|
+
: mr(e) || !!e[se] || ce(e) || St(e) || ut(e))
|
|
2497
|
+
);
|
|
2498
|
+
})(e)
|
|
2499
|
+
);
|
|
2500
|
+
}
|
|
2501
|
+
function Gt(e, t, r) {
|
|
2502
|
+
if (2 !== arguments.length || lr(e))
|
|
2503
|
+
if (mr(e)) {
|
|
2504
|
+
var n = e[se];
|
|
2505
|
+
n.values.get(t)
|
|
2506
|
+
? n.write(t, r)
|
|
2507
|
+
: n.addObservableProp(t, r, n.defaultEnhancer);
|
|
2508
|
+
} else if (ur(e)) e.set(t, r);
|
|
2509
|
+
else if (lr(e)) e.add(t);
|
|
2510
|
+
else {
|
|
2511
|
+
if (!or(e))
|
|
2512
|
+
return J(
|
|
2513
|
+
'production' !== process.env.NODE_ENV &&
|
|
2514
|
+
"'set()' can only be used on observable objects, arrays and maps",
|
|
2515
|
+
);
|
|
2516
|
+
'number' != typeof t && (t = parseInt(t, 10)),
|
|
2517
|
+
H(t >= 0, "Not a valid index: '" + t + "'"),
|
|
2518
|
+
bt(),
|
|
2519
|
+
t >= e.length && (e.length = t + 1),
|
|
2520
|
+
(e[t] = r),
|
|
2521
|
+
mt();
|
|
2522
|
+
}
|
|
2523
|
+
else {
|
|
2524
|
+
bt();
|
|
2525
|
+
var o = t;
|
|
2526
|
+
try {
|
|
2527
|
+
for (var i in o) Gt(e, i, o[i]);
|
|
2528
|
+
} finally {
|
|
2529
|
+
mt();
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
function zt(e, t) {
|
|
2534
|
+
void 0 === t && (t = void 0), bt();
|
|
2535
|
+
try {
|
|
2536
|
+
return e.apply(t);
|
|
2537
|
+
} finally {
|
|
2538
|
+
mt();
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
function Kt(e) {
|
|
2542
|
+
return e[se];
|
|
2543
|
+
}
|
|
2544
|
+
function Ft(e) {
|
|
2545
|
+
return 'string' == typeof e || 'number' == typeof e || 'symbol' == typeof e;
|
|
2546
|
+
}
|
|
2547
|
+
var Jt = {
|
|
2548
|
+
has: function (e, t) {
|
|
2549
|
+
if (t === se || 'constructor' === t || t === be) return !0;
|
|
2550
|
+
var r = Kt(e);
|
|
2551
|
+
return Ft(t) ? r.has(t) : t in e;
|
|
2552
|
+
},
|
|
2553
|
+
get: function (e, t) {
|
|
2554
|
+
if (t === se || 'constructor' === t || t === be) return e[t];
|
|
2555
|
+
var r = Kt(e),
|
|
2556
|
+
n = r.values.get(t);
|
|
2557
|
+
if (n instanceof ue) {
|
|
2558
|
+
var o = n.get();
|
|
2559
|
+
return void 0 === o && r.has(t), o;
|
|
2560
|
+
}
|
|
2561
|
+
return Ft(t) && r.has(t), e[t];
|
|
2562
|
+
},
|
|
2563
|
+
set: function (e, t, r) {
|
|
2564
|
+
return !!Ft(t) && (Gt(e, t, r), !0);
|
|
2565
|
+
},
|
|
2566
|
+
deleteProperty: function (e, t) {
|
|
2567
|
+
return !!Ft(t) && (Kt(e).remove(t), !0);
|
|
2568
|
+
},
|
|
2569
|
+
ownKeys: function (e) {
|
|
2570
|
+
return Kt(e).keysAtom.reportObserved(), Reflect.ownKeys(e);
|
|
2571
|
+
},
|
|
2572
|
+
preventExtensions: function (e) {
|
|
2573
|
+
return J('Dynamic observable objects cannot be frozen'), !1;
|
|
2574
|
+
},
|
|
2575
|
+
};
|
|
2576
|
+
function Ht(e) {
|
|
2577
|
+
return void 0 !== e.interceptors && e.interceptors.length > 0;
|
|
2578
|
+
}
|
|
2579
|
+
function Wt(e, t) {
|
|
2580
|
+
var r = e.interceptors || (e.interceptors = []);
|
|
2581
|
+
return (
|
|
2582
|
+
r.push(t),
|
|
2583
|
+
W(function () {
|
|
2584
|
+
var e = r.indexOf(t);
|
|
2585
|
+
-1 !== e && r.splice(e, 1);
|
|
2586
|
+
})
|
|
2587
|
+
);
|
|
2588
|
+
}
|
|
2589
|
+
function Xt(e, t) {
|
|
2590
|
+
var r = We();
|
|
2591
|
+
try {
|
|
2592
|
+
for (
|
|
2593
|
+
var n = ye(e.interceptors || []), o = 0, i = n.length;
|
|
2594
|
+
o < i &&
|
|
2595
|
+
(H(
|
|
2596
|
+
!(t = n[o](t)) || t.type,
|
|
2597
|
+
'Intercept handlers should return nothing or a change object',
|
|
2598
|
+
),
|
|
2599
|
+
t);
|
|
2600
|
+
o++
|
|
2601
|
+
);
|
|
2602
|
+
return t;
|
|
2603
|
+
} finally {
|
|
2604
|
+
Xe(r);
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
function $t(e) {
|
|
2608
|
+
return void 0 !== e.changeListeners && e.changeListeners.length > 0;
|
|
2609
|
+
}
|
|
2610
|
+
function Yt(e, t) {
|
|
2611
|
+
var r = e.changeListeners || (e.changeListeners = []);
|
|
2612
|
+
return (
|
|
2613
|
+
r.push(t),
|
|
2614
|
+
W(function () {
|
|
2615
|
+
var e = r.indexOf(t);
|
|
2616
|
+
-1 !== e && r.splice(e, 1);
|
|
2617
|
+
})
|
|
2618
|
+
);
|
|
2619
|
+
}
|
|
2620
|
+
function Zt(e, t) {
|
|
2621
|
+
var r = We(),
|
|
2622
|
+
n = e.changeListeners;
|
|
2623
|
+
if (n) {
|
|
2624
|
+
for (var o = 0, i = (n = n.slice()).length; o < i; o++) n[o](t);
|
|
2625
|
+
Xe(r);
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
var Qt = {
|
|
2629
|
+
get: function (e, t) {
|
|
2630
|
+
return t === se
|
|
2631
|
+
? e[se]
|
|
2632
|
+
: 'length' === t
|
|
2633
|
+
? e[se].getArrayLength()
|
|
2634
|
+
: 'number' == typeof t
|
|
2635
|
+
? tr.get.call(e, t)
|
|
2636
|
+
: 'string' != typeof t || isNaN(t)
|
|
2637
|
+
? tr.hasOwnProperty(t)
|
|
2638
|
+
? tr[t]
|
|
2639
|
+
: e[t]
|
|
2640
|
+
: tr.get.call(e, parseInt(t));
|
|
2641
|
+
},
|
|
2642
|
+
set: function (e, t, r) {
|
|
2643
|
+
return (
|
|
2644
|
+
'length' === t && e[se].setArrayLength(r),
|
|
2645
|
+
'number' == typeof t && tr.set.call(e, t, r),
|
|
2646
|
+
'symbol' == typeof t || isNaN(t)
|
|
2647
|
+
? (e[t] = r)
|
|
2648
|
+
: tr.set.call(e, parseInt(t), r),
|
|
2649
|
+
!0
|
|
2650
|
+
);
|
|
2651
|
+
},
|
|
2652
|
+
preventExtensions: function (e) {
|
|
2653
|
+
return J('Observable arrays cannot be frozen'), !1;
|
|
2654
|
+
},
|
|
2655
|
+
};
|
|
2656
|
+
var er = (function () {
|
|
2657
|
+
function e(e, t, r) {
|
|
2658
|
+
(this.owned = r),
|
|
2659
|
+
(this.values = []),
|
|
2660
|
+
(this.proxy = void 0),
|
|
2661
|
+
(this.lastKnownLength = 0),
|
|
2662
|
+
(this.atom = new ue(e || 'ObservableArray@' + F())),
|
|
2663
|
+
(this.enhancer = function (r, n) {
|
|
2664
|
+
return t(r, n, e + '[..]');
|
|
2665
|
+
});
|
|
2666
|
+
}
|
|
2667
|
+
return (
|
|
2668
|
+
(e.prototype.dehanceValue = function (e) {
|
|
2669
|
+
return void 0 !== this.dehancer ? this.dehancer(e) : e;
|
|
2670
|
+
}),
|
|
2671
|
+
(e.prototype.dehanceValues = function (e) {
|
|
2672
|
+
return void 0 !== this.dehancer && e.length > 0
|
|
2673
|
+
? e.map(this.dehancer)
|
|
2674
|
+
: e;
|
|
2675
|
+
}),
|
|
2676
|
+
(e.prototype.intercept = function (e) {
|
|
2677
|
+
return Wt(this, e);
|
|
2678
|
+
}),
|
|
2679
|
+
(e.prototype.observe = function (e, t) {
|
|
2680
|
+
return (
|
|
2681
|
+
void 0 === t && (t = !1),
|
|
2682
|
+
t &&
|
|
2683
|
+
e({
|
|
2684
|
+
object: this.proxy,
|
|
2685
|
+
type: 'splice',
|
|
2686
|
+
index: 0,
|
|
2687
|
+
added: this.values.slice(),
|
|
2688
|
+
addedCount: this.values.length,
|
|
2689
|
+
removed: [],
|
|
2690
|
+
removedCount: 0,
|
|
2691
|
+
}),
|
|
2692
|
+
Yt(this, e)
|
|
2693
|
+
);
|
|
2694
|
+
}),
|
|
2695
|
+
(e.prototype.getArrayLength = function () {
|
|
2696
|
+
return this.atom.reportObserved(), this.values.length;
|
|
2697
|
+
}),
|
|
2698
|
+
(e.prototype.setArrayLength = function (e) {
|
|
2699
|
+
if ('number' != typeof e || e < 0)
|
|
2700
|
+
throw new Error('[mobx.array] Out of range: ' + e);
|
|
2701
|
+
var t = this.values.length;
|
|
2702
|
+
if (e !== t)
|
|
2703
|
+
if (e > t) {
|
|
2704
|
+
for (var r = new Array(e - t), n = 0; n < e - t; n++) r[n] = void 0;
|
|
2705
|
+
this.spliceWithArray(t, 0, r);
|
|
2706
|
+
} else this.spliceWithArray(e, t - e);
|
|
2707
|
+
}),
|
|
2708
|
+
(e.prototype.updateArrayLength = function (e, t) {
|
|
2709
|
+
if (e !== this.lastKnownLength)
|
|
2710
|
+
throw new Error(
|
|
2711
|
+
'[mobx] Modification exception: the internal structure of an observable array was changed.',
|
|
2712
|
+
);
|
|
2713
|
+
this.lastKnownLength += t;
|
|
2714
|
+
}),
|
|
2715
|
+
(e.prototype.spliceWithArray = function (e, t, r) {
|
|
2716
|
+
var n = this;
|
|
2717
|
+
Ke(this.atom);
|
|
2718
|
+
var o = this.values.length;
|
|
2719
|
+
if (
|
|
2720
|
+
(void 0 === e
|
|
2721
|
+
? (e = 0)
|
|
2722
|
+
: e > o
|
|
2723
|
+
? (e = o)
|
|
2724
|
+
: e < 0 && (e = Math.max(0, o + e)),
|
|
2725
|
+
(t =
|
|
2726
|
+
1 === arguments.length
|
|
2727
|
+
? o - e
|
|
2728
|
+
: null == t
|
|
2729
|
+
? 0
|
|
2730
|
+
: Math.max(0, Math.min(t, o - e))),
|
|
2731
|
+
void 0 === r && (r = z),
|
|
2732
|
+
Ht(this))
|
|
2733
|
+
) {
|
|
2734
|
+
var i = Xt(this, {
|
|
2735
|
+
object: this.proxy,
|
|
2736
|
+
type: 'splice',
|
|
2737
|
+
index: e,
|
|
2738
|
+
removedCount: t,
|
|
2739
|
+
added: r,
|
|
2740
|
+
});
|
|
2741
|
+
if (!i) return z;
|
|
2742
|
+
(t = i.removedCount), (r = i.added);
|
|
2743
|
+
}
|
|
2744
|
+
if (
|
|
2745
|
+
((r =
|
|
2746
|
+
0 === r.length
|
|
2747
|
+
? r
|
|
2748
|
+
: r.map(function (e) {
|
|
2749
|
+
return n.enhancer(e, void 0);
|
|
2750
|
+
})),
|
|
2751
|
+
'production' !== process.env.NODE_ENV)
|
|
2752
|
+
) {
|
|
2753
|
+
var a = r.length - t;
|
|
2754
|
+
this.updateArrayLength(o, a);
|
|
2755
|
+
}
|
|
2756
|
+
var s = this.spliceItemsIntoValues(e, t, r);
|
|
2757
|
+
return (
|
|
2758
|
+
(0 === t && 0 === r.length) || this.notifyArraySplice(e, r, s),
|
|
2759
|
+
this.dehanceValues(s)
|
|
2760
|
+
);
|
|
2761
|
+
}),
|
|
2762
|
+
(e.prototype.spliceItemsIntoValues = function (e, t, r) {
|
|
2763
|
+
var n;
|
|
2764
|
+
if (r.length < 1e4)
|
|
2765
|
+
return (n = this.values).splice.apply(n, ye([e, t], r));
|
|
2766
|
+
var o = this.values.slice(e, e + t);
|
|
2767
|
+
return (
|
|
2768
|
+
(this.values = this.values
|
|
2769
|
+
.slice(0, e)
|
|
2770
|
+
.concat(r, this.values.slice(e + t))),
|
|
2771
|
+
o
|
|
2772
|
+
);
|
|
2773
|
+
}),
|
|
2774
|
+
(e.prototype.notifyArrayChildUpdate = function (e, t, r) {
|
|
2775
|
+
var n = !this.owned && Dt(),
|
|
2776
|
+
o = $t(this),
|
|
2777
|
+
i =
|
|
2778
|
+
o || n
|
|
2779
|
+
? {
|
|
2780
|
+
object: this.proxy,
|
|
2781
|
+
type: 'update',
|
|
2782
|
+
index: e,
|
|
2783
|
+
newValue: t,
|
|
2784
|
+
oldValue: r,
|
|
2785
|
+
}
|
|
2786
|
+
: null;
|
|
2787
|
+
n &&
|
|
2788
|
+
'production' !== process.env.NODE_ENV &&
|
|
2789
|
+
Vt(fe(fe({}, i), { name: this.atom.name })),
|
|
2790
|
+
this.atom.reportChanged(),
|
|
2791
|
+
o && Zt(this, i),
|
|
2792
|
+
n && 'production' !== process.env.NODE_ENV && kt();
|
|
2793
|
+
}),
|
|
2794
|
+
(e.prototype.notifyArraySplice = function (e, t, r) {
|
|
2795
|
+
var n = !this.owned && Dt(),
|
|
2796
|
+
o = $t(this),
|
|
2797
|
+
i =
|
|
2798
|
+
o || n
|
|
2799
|
+
? {
|
|
2800
|
+
object: this.proxy,
|
|
2801
|
+
type: 'splice',
|
|
2802
|
+
index: e,
|
|
2803
|
+
removed: r,
|
|
2804
|
+
added: t,
|
|
2805
|
+
removedCount: r.length,
|
|
2806
|
+
addedCount: t.length,
|
|
2807
|
+
}
|
|
2808
|
+
: null;
|
|
2809
|
+
n &&
|
|
2810
|
+
'production' !== process.env.NODE_ENV &&
|
|
2811
|
+
Vt(fe(fe({}, i), { name: this.atom.name })),
|
|
2812
|
+
this.atom.reportChanged(),
|
|
2813
|
+
o && Zt(this, i),
|
|
2814
|
+
n && 'production' !== process.env.NODE_ENV && kt();
|
|
2815
|
+
}),
|
|
2816
|
+
e
|
|
2817
|
+
);
|
|
2818
|
+
})(),
|
|
2819
|
+
tr = {
|
|
2820
|
+
intercept: function (e) {
|
|
2821
|
+
return this[se].intercept(e);
|
|
2822
|
+
},
|
|
2823
|
+
observe: function (e, t) {
|
|
2824
|
+
return void 0 === t && (t = !1), this[se].observe(e, t);
|
|
2825
|
+
},
|
|
2826
|
+
clear: function () {
|
|
2827
|
+
return this.splice(0);
|
|
2828
|
+
},
|
|
2829
|
+
replace: function (e) {
|
|
2830
|
+
var t = this[se];
|
|
2831
|
+
return t.spliceWithArray(0, t.values.length, e);
|
|
2832
|
+
},
|
|
2833
|
+
toJS: function () {
|
|
2834
|
+
return this.slice();
|
|
2835
|
+
},
|
|
2836
|
+
toJSON: function () {
|
|
2837
|
+
return this.toJS();
|
|
2838
|
+
},
|
|
2839
|
+
splice: function (e, t) {
|
|
2840
|
+
for (var r = [], n = 2; n < arguments.length; n++)
|
|
2841
|
+
r[n - 2] = arguments[n];
|
|
2842
|
+
var o = this[se];
|
|
2843
|
+
switch (arguments.length) {
|
|
2844
|
+
case 0:
|
|
2845
|
+
return [];
|
|
2846
|
+
case 1:
|
|
2847
|
+
return o.spliceWithArray(e);
|
|
2848
|
+
case 2:
|
|
2849
|
+
return o.spliceWithArray(e, t);
|
|
2850
|
+
}
|
|
2851
|
+
return o.spliceWithArray(e, t, r);
|
|
2852
|
+
},
|
|
2853
|
+
spliceWithArray: function (e, t, r) {
|
|
2854
|
+
return this[se].spliceWithArray(e, t, r);
|
|
2855
|
+
},
|
|
2856
|
+
push: function () {
|
|
2857
|
+
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
|
|
2858
|
+
var r = this[se];
|
|
2859
|
+
return r.spliceWithArray(r.values.length, 0, e), r.values.length;
|
|
2860
|
+
},
|
|
2861
|
+
pop: function () {
|
|
2862
|
+
return this.splice(Math.max(this[se].values.length - 1, 0), 1)[0];
|
|
2863
|
+
},
|
|
2864
|
+
shift: function () {
|
|
2865
|
+
return this.splice(0, 1)[0];
|
|
2866
|
+
},
|
|
2867
|
+
unshift: function () {
|
|
2868
|
+
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
|
|
2869
|
+
var r = this[se];
|
|
2870
|
+
return r.spliceWithArray(0, 0, e), r.values.length;
|
|
2871
|
+
},
|
|
2872
|
+
reverse: function () {
|
|
2873
|
+
'production' !== process.env.NODE_ENV &&
|
|
2874
|
+
console.warn(
|
|
2875
|
+
'[mobx] `observableArray.reverse()` will not update the array in place. Use `observableArray.slice().reverse()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().reverse())` to reverse & update in place',
|
|
2876
|
+
);
|
|
2877
|
+
var e = this.slice();
|
|
2878
|
+
return e.reverse.apply(e, arguments);
|
|
2879
|
+
},
|
|
2880
|
+
sort: function (e) {
|
|
2881
|
+
'production' !== process.env.NODE_ENV &&
|
|
2882
|
+
console.warn(
|
|
2883
|
+
'[mobx] `observableArray.sort()` will not update the array in place. Use `observableArray.slice().sort()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().sort())` to sort & update in place',
|
|
2884
|
+
);
|
|
2885
|
+
var t = this.slice();
|
|
2886
|
+
return t.sort.apply(t, arguments);
|
|
2887
|
+
},
|
|
2888
|
+
remove: function (e) {
|
|
2889
|
+
var t = this[se],
|
|
2890
|
+
r = t.dehanceValues(t.values).indexOf(e);
|
|
2891
|
+
return r > -1 && (this.splice(r, 1), !0);
|
|
2892
|
+
},
|
|
2893
|
+
get: function (e) {
|
|
2894
|
+
var t = this[se];
|
|
2895
|
+
if (t) {
|
|
2896
|
+
if (e < t.values.length)
|
|
2897
|
+
return t.atom.reportObserved(), t.dehanceValue(t.values[e]);
|
|
2898
|
+
console.warn(
|
|
2899
|
+
'[mobx.array] Attempt to read an array index (' +
|
|
2900
|
+
e +
|
|
2901
|
+
') that is out of bounds (' +
|
|
2902
|
+
t.values.length +
|
|
2903
|
+
'). Please check length first. Out of bound indices will not be tracked by MobX',
|
|
2904
|
+
);
|
|
2905
|
+
}
|
|
2906
|
+
},
|
|
2907
|
+
set: function (e, t) {
|
|
2908
|
+
var r = this[se],
|
|
2909
|
+
n = r.values;
|
|
2910
|
+
if (e < n.length) {
|
|
2911
|
+
Ke(r.atom);
|
|
2912
|
+
var o = n[e];
|
|
2913
|
+
if (Ht(r)) {
|
|
2914
|
+
var i = Xt(r, {
|
|
2915
|
+
type: 'update',
|
|
2916
|
+
object: r.proxy,
|
|
2917
|
+
index: e,
|
|
2918
|
+
newValue: t,
|
|
2919
|
+
});
|
|
2920
|
+
if (!i) return;
|
|
2921
|
+
t = i.newValue;
|
|
2922
|
+
}
|
|
2923
|
+
(t = r.enhancer(t, o)) !== o &&
|
|
2924
|
+
((n[e] = t), r.notifyArrayChildUpdate(e, t, o));
|
|
2925
|
+
} else {
|
|
2926
|
+
if (e !== n.length)
|
|
2927
|
+
throw new Error(
|
|
2928
|
+
'[mobx.array] Index out of bounds, ' +
|
|
2929
|
+
e +
|
|
2930
|
+
' is larger than ' +
|
|
2931
|
+
n.length,
|
|
2932
|
+
);
|
|
2933
|
+
r.spliceWithArray(e, 0, [t]);
|
|
2934
|
+
}
|
|
2935
|
+
},
|
|
2936
|
+
};
|
|
2937
|
+
[
|
|
2938
|
+
'concat',
|
|
2939
|
+
'flat',
|
|
2940
|
+
'includes',
|
|
2941
|
+
'indexOf',
|
|
2942
|
+
'join',
|
|
2943
|
+
'lastIndexOf',
|
|
2944
|
+
'slice',
|
|
2945
|
+
'toString',
|
|
2946
|
+
'toLocaleString',
|
|
2947
|
+
].forEach(function (e) {
|
|
2948
|
+
'function' == typeof Array.prototype[e] &&
|
|
2949
|
+
(tr[e] = function () {
|
|
2950
|
+
var t = this[se];
|
|
2951
|
+
t.atom.reportObserved();
|
|
2952
|
+
var r = t.dehanceValues(t.values);
|
|
2953
|
+
return r[e].apply(r, arguments);
|
|
2954
|
+
});
|
|
2955
|
+
}),
|
|
2956
|
+
[
|
|
2957
|
+
'every',
|
|
2958
|
+
'filter',
|
|
2959
|
+
'find',
|
|
2960
|
+
'findIndex',
|
|
2961
|
+
'flatMap',
|
|
2962
|
+
'forEach',
|
|
2963
|
+
'map',
|
|
2964
|
+
'some',
|
|
2965
|
+
].forEach(function (e) {
|
|
2966
|
+
'function' == typeof Array.prototype[e] &&
|
|
2967
|
+
(tr[e] = function (t, r) {
|
|
2968
|
+
var n = this,
|
|
2969
|
+
o = this[se];
|
|
2970
|
+
return (
|
|
2971
|
+
o.atom.reportObserved(),
|
|
2972
|
+
o.dehanceValues(o.values)[e](function (e, o) {
|
|
2973
|
+
return t.call(r, e, o, n);
|
|
2974
|
+
}, r)
|
|
2975
|
+
);
|
|
2976
|
+
});
|
|
2977
|
+
}),
|
|
2978
|
+
['reduce', 'reduceRight'].forEach(function (e) {
|
|
2979
|
+
tr[e] = function () {
|
|
2980
|
+
var t = this,
|
|
2981
|
+
r = this[se];
|
|
2982
|
+
r.atom.reportObserved();
|
|
2983
|
+
var n = arguments[0];
|
|
2984
|
+
return (
|
|
2985
|
+
(arguments[0] = function (e, o, i) {
|
|
2986
|
+
return (o = r.dehanceValue(o)), n(e, o, i, t);
|
|
2987
|
+
}),
|
|
2988
|
+
r.values[e].apply(r.values, arguments)
|
|
2989
|
+
);
|
|
2990
|
+
};
|
|
2991
|
+
});
|
|
2992
|
+
var rr,
|
|
2993
|
+
nr = ee('ObservableArrayAdministration', er);
|
|
2994
|
+
function or(e) {
|
|
2995
|
+
return $(e) && nr(e[se]);
|
|
2996
|
+
}
|
|
2997
|
+
var ir,
|
|
2998
|
+
ar = {},
|
|
2999
|
+
sr = (function () {
|
|
3000
|
+
function e(e, t, r) {
|
|
3001
|
+
if (
|
|
3002
|
+
(void 0 === t && (t = _e),
|
|
3003
|
+
void 0 === r && (r = 'ObservableMap@' + F()),
|
|
3004
|
+
(this.enhancer = t),
|
|
3005
|
+
(this.name = r),
|
|
3006
|
+
(this[rr] = ar),
|
|
3007
|
+
(this._keysAtom = pe(this.name + '.keys()')),
|
|
3008
|
+
(this[Symbol.toStringTag] = 'Map'),
|
|
3009
|
+
'function' != typeof Map)
|
|
3010
|
+
)
|
|
3011
|
+
throw new Error(
|
|
3012
|
+
'mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js',
|
|
3013
|
+
);
|
|
3014
|
+
(this._data = new Map()), (this._hasMap = new Map()), this.merge(e);
|
|
3015
|
+
}
|
|
3016
|
+
return (
|
|
3017
|
+
(e.prototype._has = function (e) {
|
|
3018
|
+
return this._data.has(e);
|
|
3019
|
+
}),
|
|
3020
|
+
(e.prototype.has = function (e) {
|
|
3021
|
+
var t = this;
|
|
3022
|
+
if (!ft.trackingDerivation) return this._has(e);
|
|
3023
|
+
var r = this._hasMap.get(e);
|
|
3024
|
+
if (!r) {
|
|
3025
|
+
var n = (r = new at(
|
|
3026
|
+
this._has(e),
|
|
3027
|
+
je,
|
|
3028
|
+
this.name + '.' + oe(e) + '?',
|
|
3029
|
+
!1,
|
|
3030
|
+
));
|
|
3031
|
+
this._hasMap.set(e, n),
|
|
3032
|
+
Rt(n, function () {
|
|
3033
|
+
return t._hasMap.delete(e);
|
|
3034
|
+
});
|
|
3035
|
+
}
|
|
3036
|
+
return r.get();
|
|
3037
|
+
}),
|
|
3038
|
+
(e.prototype.set = function (e, t) {
|
|
3039
|
+
var r = this._has(e);
|
|
3040
|
+
if (Ht(this)) {
|
|
3041
|
+
var n = Xt(this, {
|
|
3042
|
+
type: r ? 'update' : 'add',
|
|
3043
|
+
object: this,
|
|
3044
|
+
newValue: t,
|
|
3045
|
+
name: e,
|
|
3046
|
+
});
|
|
3047
|
+
if (!n) return this;
|
|
3048
|
+
t = n.newValue;
|
|
3049
|
+
}
|
|
3050
|
+
return r ? this._updateValue(e, t) : this._addValue(e, t), this;
|
|
3051
|
+
}),
|
|
3052
|
+
(e.prototype.delete = function (e) {
|
|
3053
|
+
var t = this;
|
|
3054
|
+
if (
|
|
3055
|
+
(Ke(this._keysAtom), Ht(this)) &&
|
|
3056
|
+
!(o = Xt(this, { type: 'delete', object: this, name: e }))
|
|
3057
|
+
)
|
|
3058
|
+
return !1;
|
|
3059
|
+
if (this._has(e)) {
|
|
3060
|
+
var r = Dt(),
|
|
3061
|
+
n = $t(this),
|
|
3062
|
+
o =
|
|
3063
|
+
n || r
|
|
3064
|
+
? {
|
|
3065
|
+
type: 'delete',
|
|
3066
|
+
object: this,
|
|
3067
|
+
oldValue: this._data.get(e).value,
|
|
3068
|
+
name: e,
|
|
3069
|
+
}
|
|
3070
|
+
: null;
|
|
3071
|
+
return (
|
|
3072
|
+
r &&
|
|
3073
|
+
'production' !== process.env.NODE_ENV &&
|
|
3074
|
+
Vt(fe(fe({}, o), { name: this.name, key: e })),
|
|
3075
|
+
zt(function () {
|
|
3076
|
+
t._keysAtom.reportChanged(),
|
|
3077
|
+
t._updateHasMapEntry(e, !1),
|
|
3078
|
+
t._data.get(e).setNewValue(void 0),
|
|
3079
|
+
t._data.delete(e);
|
|
3080
|
+
}),
|
|
3081
|
+
n && Zt(this, o),
|
|
3082
|
+
r && 'production' !== process.env.NODE_ENV && kt(),
|
|
3083
|
+
!0
|
|
3084
|
+
);
|
|
3085
|
+
}
|
|
3086
|
+
return !1;
|
|
3087
|
+
}),
|
|
3088
|
+
(e.prototype._updateHasMapEntry = function (e, t) {
|
|
3089
|
+
var r = this._hasMap.get(e);
|
|
3090
|
+
r && r.setNewValue(t);
|
|
3091
|
+
}),
|
|
3092
|
+
(e.prototype._updateValue = function (e, t) {
|
|
3093
|
+
var r = this._data.get(e);
|
|
3094
|
+
if ((t = r.prepareNewValue(t)) !== ft.UNCHANGED) {
|
|
3095
|
+
var n = Dt(),
|
|
3096
|
+
o = $t(this),
|
|
3097
|
+
i =
|
|
3098
|
+
o || n
|
|
3099
|
+
? {
|
|
3100
|
+
type: 'update',
|
|
3101
|
+
object: this,
|
|
3102
|
+
oldValue: r.value,
|
|
3103
|
+
name: e,
|
|
3104
|
+
newValue: t,
|
|
3105
|
+
}
|
|
3106
|
+
: null;
|
|
3107
|
+
n &&
|
|
3108
|
+
'production' !== process.env.NODE_ENV &&
|
|
3109
|
+
Vt(fe(fe({}, i), { name: this.name, key: e })),
|
|
3110
|
+
r.setNewValue(t),
|
|
3111
|
+
o && Zt(this, i),
|
|
3112
|
+
n && 'production' !== process.env.NODE_ENV && kt();
|
|
3113
|
+
}
|
|
3114
|
+
}),
|
|
3115
|
+
(e.prototype._addValue = function (e, t) {
|
|
3116
|
+
var r = this;
|
|
3117
|
+
Ke(this._keysAtom),
|
|
3118
|
+
zt(function () {
|
|
3119
|
+
var n = new at(t, r.enhancer, r.name + '.' + oe(e), !1);
|
|
3120
|
+
r._data.set(e, n),
|
|
3121
|
+
(t = n.value),
|
|
3122
|
+
r._updateHasMapEntry(e, !0),
|
|
3123
|
+
r._keysAtom.reportChanged();
|
|
3124
|
+
});
|
|
3125
|
+
var n = Dt(),
|
|
3126
|
+
o = $t(this),
|
|
3127
|
+
i =
|
|
3128
|
+
o || n ? { type: 'add', object: this, name: e, newValue: t } : null;
|
|
3129
|
+
n &&
|
|
3130
|
+
'production' !== process.env.NODE_ENV &&
|
|
3131
|
+
Vt(fe(fe({}, i), { name: this.name, key: e })),
|
|
3132
|
+
o && Zt(this, i),
|
|
3133
|
+
n && 'production' !== process.env.NODE_ENV && kt();
|
|
3134
|
+
}),
|
|
3135
|
+
(e.prototype.get = function (e) {
|
|
3136
|
+
return this.has(e)
|
|
3137
|
+
? this.dehanceValue(this._data.get(e).get())
|
|
3138
|
+
: this.dehanceValue(void 0);
|
|
3139
|
+
}),
|
|
3140
|
+
(e.prototype.dehanceValue = function (e) {
|
|
3141
|
+
return void 0 !== this.dehancer ? this.dehancer(e) : e;
|
|
3142
|
+
}),
|
|
3143
|
+
(e.prototype.keys = function () {
|
|
3144
|
+
return this._keysAtom.reportObserved(), this._data.keys();
|
|
3145
|
+
}),
|
|
3146
|
+
(e.prototype.values = function () {
|
|
3147
|
+
var e = this,
|
|
3148
|
+
t = this.keys();
|
|
3149
|
+
return Dr({
|
|
3150
|
+
next: function () {
|
|
3151
|
+
var r = t.next(),
|
|
3152
|
+
n = r.done,
|
|
3153
|
+
o = r.value;
|
|
3154
|
+
return { done: n, value: n ? void 0 : e.get(o) };
|
|
3155
|
+
},
|
|
3156
|
+
});
|
|
3157
|
+
}),
|
|
3158
|
+
(e.prototype.entries = function () {
|
|
3159
|
+
var e = this,
|
|
3160
|
+
t = this.keys();
|
|
3161
|
+
return Dr({
|
|
3162
|
+
next: function () {
|
|
3163
|
+
var r = t.next(),
|
|
3164
|
+
n = r.done,
|
|
3165
|
+
o = r.value;
|
|
3166
|
+
return { done: n, value: n ? void 0 : [o, e.get(o)] };
|
|
3167
|
+
},
|
|
3168
|
+
});
|
|
3169
|
+
}),
|
|
3170
|
+
(e.prototype[((rr = se), Symbol.iterator)] = function () {
|
|
3171
|
+
return this.entries();
|
|
3172
|
+
}),
|
|
3173
|
+
(e.prototype.forEach = function (e, t) {
|
|
3174
|
+
var r, n;
|
|
3175
|
+
try {
|
|
3176
|
+
for (var o = he(this), i = o.next(); !i.done; i = o.next()) {
|
|
3177
|
+
var a = ve(i.value, 2),
|
|
3178
|
+
s = a[0],
|
|
3179
|
+
u = a[1];
|
|
3180
|
+
e.call(t, u, s, this);
|
|
3181
|
+
}
|
|
3182
|
+
} catch (e) {
|
|
3183
|
+
r = { error: e };
|
|
3184
|
+
} finally {
|
|
3185
|
+
try {
|
|
3186
|
+
i && !i.done && (n = o.return) && n.call(o);
|
|
3187
|
+
} finally {
|
|
3188
|
+
if (r) throw r.error;
|
|
3189
|
+
}
|
|
3190
|
+
}
|
|
3191
|
+
}),
|
|
3192
|
+
(e.prototype.merge = function (e) {
|
|
3193
|
+
var t = this;
|
|
3194
|
+
return (
|
|
3195
|
+
ur(e) && (e = e.toJS()),
|
|
3196
|
+
zt(function () {
|
|
3197
|
+
var r = ot(!0);
|
|
3198
|
+
try {
|
|
3199
|
+
Y(e)
|
|
3200
|
+
? ne(e).forEach(function (r) {
|
|
3201
|
+
return t.set(r, e[r]);
|
|
3202
|
+
})
|
|
3203
|
+
: Array.isArray(e)
|
|
3204
|
+
? e.forEach(function (e) {
|
|
3205
|
+
var r = ve(e, 2),
|
|
3206
|
+
n = r[0],
|
|
3207
|
+
o = r[1];
|
|
3208
|
+
return t.set(n, o);
|
|
3209
|
+
})
|
|
3210
|
+
: te(e)
|
|
3211
|
+
? (e.constructor !== Map &&
|
|
3212
|
+
J(
|
|
3213
|
+
'Cannot initialize from classes that inherit from Map: ' +
|
|
3214
|
+
e.constructor.name,
|
|
3215
|
+
),
|
|
3216
|
+
e.forEach(function (e, r) {
|
|
3217
|
+
return t.set(r, e);
|
|
3218
|
+
}))
|
|
3219
|
+
: null != e && J('Cannot initialize map from ' + e);
|
|
3220
|
+
} finally {
|
|
3221
|
+
it(r);
|
|
3222
|
+
}
|
|
3223
|
+
}),
|
|
3224
|
+
this
|
|
3225
|
+
);
|
|
3226
|
+
}),
|
|
3227
|
+
(e.prototype.clear = function () {
|
|
3228
|
+
var e = this;
|
|
3229
|
+
zt(function () {
|
|
3230
|
+
He(function () {
|
|
3231
|
+
var t, r;
|
|
3232
|
+
try {
|
|
3233
|
+
for (var n = he(e.keys()), o = n.next(); !o.done; o = n.next()) {
|
|
3234
|
+
var i = o.value;
|
|
3235
|
+
e.delete(i);
|
|
3236
|
+
}
|
|
3237
|
+
} catch (e) {
|
|
3238
|
+
t = { error: e };
|
|
3239
|
+
} finally {
|
|
3240
|
+
try {
|
|
3241
|
+
o && !o.done && (r = n.return) && r.call(n);
|
|
3242
|
+
} finally {
|
|
3243
|
+
if (t) throw t.error;
|
|
3244
|
+
}
|
|
3245
|
+
}
|
|
3246
|
+
});
|
|
3247
|
+
});
|
|
3248
|
+
}),
|
|
3249
|
+
(e.prototype.replace = function (e) {
|
|
3250
|
+
var t = this;
|
|
3251
|
+
return (
|
|
3252
|
+
zt(function () {
|
|
3253
|
+
var r,
|
|
3254
|
+
n,
|
|
3255
|
+
o,
|
|
3256
|
+
i,
|
|
3257
|
+
a = (function (e) {
|
|
3258
|
+
if (te(e) || ur(e)) return e;
|
|
3259
|
+
if (Array.isArray(e)) return new Map(e);
|
|
3260
|
+
if (Y(e)) {
|
|
3261
|
+
var t = new Map();
|
|
3262
|
+
for (var r in e) t.set(r, e[r]);
|
|
3263
|
+
return t;
|
|
3264
|
+
}
|
|
3265
|
+
return J("Cannot convert to map from '" + e + "'");
|
|
3266
|
+
})(e),
|
|
3267
|
+
s = new Map(),
|
|
3268
|
+
u = !1;
|
|
3269
|
+
try {
|
|
3270
|
+
for (
|
|
3271
|
+
var c = he(t._data.keys()), p = c.next();
|
|
3272
|
+
!p.done;
|
|
3273
|
+
p = c.next()
|
|
3274
|
+
) {
|
|
3275
|
+
var l = p.value;
|
|
3276
|
+
if (!a.has(l))
|
|
3277
|
+
if (t.delete(l)) u = !0;
|
|
3278
|
+
else {
|
|
3279
|
+
var d = t._data.get(l);
|
|
3280
|
+
s.set(l, d);
|
|
3281
|
+
}
|
|
3282
|
+
}
|
|
3283
|
+
} catch (e) {
|
|
3284
|
+
r = { error: e };
|
|
3285
|
+
} finally {
|
|
3286
|
+
try {
|
|
3287
|
+
p && !p.done && (n = c.return) && n.call(c);
|
|
3288
|
+
} finally {
|
|
3289
|
+
if (r) throw r.error;
|
|
3290
|
+
}
|
|
3291
|
+
}
|
|
3292
|
+
try {
|
|
3293
|
+
for (
|
|
3294
|
+
var f = he(a.entries()), h = f.next();
|
|
3295
|
+
!h.done;
|
|
3296
|
+
h = f.next()
|
|
3297
|
+
) {
|
|
3298
|
+
var v = ve(h.value, 2),
|
|
3299
|
+
y = ((l = v[0]), (d = v[1]), t._data.has(l));
|
|
3300
|
+
if ((t.set(l, d), t._data.has(l))) {
|
|
3301
|
+
var b = t._data.get(l);
|
|
3302
|
+
s.set(l, b), y || (u = !0);
|
|
3303
|
+
}
|
|
3304
|
+
}
|
|
3305
|
+
} catch (e) {
|
|
3306
|
+
o = { error: e };
|
|
3307
|
+
} finally {
|
|
3308
|
+
try {
|
|
3309
|
+
h && !h.done && (i = f.return) && i.call(f);
|
|
3310
|
+
} finally {
|
|
3311
|
+
if (o) throw o.error;
|
|
3312
|
+
}
|
|
3313
|
+
}
|
|
3314
|
+
if (!u)
|
|
3315
|
+
if (t._data.size !== s.size) t._keysAtom.reportChanged();
|
|
3316
|
+
else
|
|
3317
|
+
for (
|
|
3318
|
+
var m = t._data.keys(),
|
|
3319
|
+
g = s.keys(),
|
|
3320
|
+
O = m.next(),
|
|
3321
|
+
E = g.next();
|
|
3322
|
+
!O.done;
|
|
3323
|
+
|
|
3324
|
+
) {
|
|
3325
|
+
if (O.value !== E.value) {
|
|
3326
|
+
t._keysAtom.reportChanged();
|
|
3327
|
+
break;
|
|
3328
|
+
}
|
|
3329
|
+
(O = m.next()), (E = g.next());
|
|
3330
|
+
}
|
|
3331
|
+
t._data = s;
|
|
3332
|
+
}),
|
|
3333
|
+
this
|
|
3334
|
+
);
|
|
3335
|
+
}),
|
|
3336
|
+
Object.defineProperty(e.prototype, 'size', {
|
|
3337
|
+
get: function () {
|
|
3338
|
+
return this._keysAtom.reportObserved(), this._data.size;
|
|
3339
|
+
},
|
|
3340
|
+
enumerable: !0,
|
|
3341
|
+
configurable: !0,
|
|
3342
|
+
}),
|
|
3343
|
+
(e.prototype.toPOJO = function () {
|
|
3344
|
+
var e,
|
|
3345
|
+
t,
|
|
3346
|
+
r = {};
|
|
3347
|
+
try {
|
|
3348
|
+
for (var n = he(this), o = n.next(); !o.done; o = n.next()) {
|
|
3349
|
+
var i = ve(o.value, 2),
|
|
3350
|
+
a = i[0],
|
|
3351
|
+
s = i[1];
|
|
3352
|
+
r['symbol' == typeof a ? a : oe(a)] = s;
|
|
3353
|
+
}
|
|
3354
|
+
} catch (t) {
|
|
3355
|
+
e = { error: t };
|
|
3356
|
+
} finally {
|
|
3357
|
+
try {
|
|
3358
|
+
o && !o.done && (t = n.return) && t.call(n);
|
|
3359
|
+
} finally {
|
|
3360
|
+
if (e) throw e.error;
|
|
3361
|
+
}
|
|
3362
|
+
}
|
|
3363
|
+
return r;
|
|
3364
|
+
}),
|
|
3365
|
+
(e.prototype.toJS = function () {
|
|
3366
|
+
return new Map(this);
|
|
3367
|
+
}),
|
|
3368
|
+
(e.prototype.toJSON = function () {
|
|
3369
|
+
return this.toPOJO();
|
|
3370
|
+
}),
|
|
3371
|
+
(e.prototype.toString = function () {
|
|
3372
|
+
var e = this;
|
|
3373
|
+
return (
|
|
3374
|
+
this.name +
|
|
3375
|
+
'[{ ' +
|
|
3376
|
+
Array.from(this.keys())
|
|
3377
|
+
.map(function (t) {
|
|
3378
|
+
return oe(t) + ': ' + e.get(t);
|
|
3379
|
+
})
|
|
3380
|
+
.join(', ') +
|
|
3381
|
+
' }]'
|
|
3382
|
+
);
|
|
3383
|
+
}),
|
|
3384
|
+
(e.prototype.observe = function (e, t) {
|
|
3385
|
+
return (
|
|
3386
|
+
'production' !== process.env.NODE_ENV &&
|
|
3387
|
+
H(
|
|
3388
|
+
!0 !== t,
|
|
3389
|
+
"`observe` doesn't support fireImmediately=true in combination with maps.",
|
|
3390
|
+
),
|
|
3391
|
+
Yt(this, e)
|
|
3392
|
+
);
|
|
3393
|
+
}),
|
|
3394
|
+
(e.prototype.intercept = function (e) {
|
|
3395
|
+
return Wt(this, e);
|
|
3396
|
+
}),
|
|
3397
|
+
e
|
|
3398
|
+
);
|
|
3399
|
+
})(),
|
|
3400
|
+
ur = ee('ObservableMap', sr),
|
|
3401
|
+
cr = {},
|
|
3402
|
+
pr = (function () {
|
|
3403
|
+
function e(e, t, r) {
|
|
3404
|
+
if (
|
|
3405
|
+
(void 0 === t && (t = _e),
|
|
3406
|
+
void 0 === r && (r = 'ObservableSet@' + F()),
|
|
3407
|
+
(this.name = r),
|
|
3408
|
+
(this[ir] = cr),
|
|
3409
|
+
(this._data = new Set()),
|
|
3410
|
+
(this._atom = pe(this.name)),
|
|
3411
|
+
(this[Symbol.toStringTag] = 'Set'),
|
|
3412
|
+
'function' != typeof Set)
|
|
3413
|
+
)
|
|
3414
|
+
throw new Error(
|
|
3415
|
+
'mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js',
|
|
3416
|
+
);
|
|
3417
|
+
(this.enhancer = function (e, n) {
|
|
3418
|
+
return t(e, n, r);
|
|
3419
|
+
}),
|
|
3420
|
+
e && this.replace(e);
|
|
3421
|
+
}
|
|
3422
|
+
return (
|
|
3423
|
+
(e.prototype.dehanceValue = function (e) {
|
|
3424
|
+
return void 0 !== this.dehancer ? this.dehancer(e) : e;
|
|
3425
|
+
}),
|
|
3426
|
+
(e.prototype.clear = function () {
|
|
3427
|
+
var e = this;
|
|
3428
|
+
zt(function () {
|
|
3429
|
+
He(function () {
|
|
3430
|
+
var t, r;
|
|
3431
|
+
try {
|
|
3432
|
+
for (
|
|
3433
|
+
var n = he(e._data.values()), o = n.next();
|
|
3434
|
+
!o.done;
|
|
3435
|
+
o = n.next()
|
|
3436
|
+
) {
|
|
3437
|
+
var i = o.value;
|
|
3438
|
+
e.delete(i);
|
|
3439
|
+
}
|
|
3440
|
+
} catch (e) {
|
|
3441
|
+
t = { error: e };
|
|
3442
|
+
} finally {
|
|
3443
|
+
try {
|
|
3444
|
+
o && !o.done && (r = n.return) && r.call(n);
|
|
3445
|
+
} finally {
|
|
3446
|
+
if (t) throw t.error;
|
|
3447
|
+
}
|
|
3448
|
+
}
|
|
3449
|
+
});
|
|
3450
|
+
});
|
|
3451
|
+
}),
|
|
3452
|
+
(e.prototype.forEach = function (e, t) {
|
|
3453
|
+
var r, n;
|
|
3454
|
+
try {
|
|
3455
|
+
for (var o = he(this), i = o.next(); !i.done; i = o.next()) {
|
|
3456
|
+
var a = i.value;
|
|
3457
|
+
e.call(t, a, a, this);
|
|
3458
|
+
}
|
|
3459
|
+
} catch (e) {
|
|
3460
|
+
r = { error: e };
|
|
3461
|
+
} finally {
|
|
3462
|
+
try {
|
|
3463
|
+
i && !i.done && (n = o.return) && n.call(o);
|
|
3464
|
+
} finally {
|
|
3465
|
+
if (r) throw r.error;
|
|
3466
|
+
}
|
|
3467
|
+
}
|
|
3468
|
+
}),
|
|
3469
|
+
Object.defineProperty(e.prototype, 'size', {
|
|
3470
|
+
get: function () {
|
|
3471
|
+
return this._atom.reportObserved(), this._data.size;
|
|
3472
|
+
},
|
|
3473
|
+
enumerable: !0,
|
|
3474
|
+
configurable: !0,
|
|
3475
|
+
}),
|
|
3476
|
+
(e.prototype.add = function (e) {
|
|
3477
|
+
var t = this;
|
|
3478
|
+
if (
|
|
3479
|
+
(Ke(this._atom), Ht(this)) &&
|
|
3480
|
+
!(o = Xt(this, { type: 'add', object: this, newValue: e }))
|
|
3481
|
+
)
|
|
3482
|
+
return this;
|
|
3483
|
+
if (!this.has(e)) {
|
|
3484
|
+
zt(function () {
|
|
3485
|
+
t._data.add(t.enhancer(e, void 0)), t._atom.reportChanged();
|
|
3486
|
+
});
|
|
3487
|
+
var r = Dt(),
|
|
3488
|
+
n = $t(this),
|
|
3489
|
+
o = n || r ? { type: 'add', object: this, newValue: e } : null;
|
|
3490
|
+
r && 'production' !== process.env.NODE_ENV && Vt(o),
|
|
3491
|
+
n && Zt(this, o),
|
|
3492
|
+
r && 'production' !== process.env.NODE_ENV && kt();
|
|
3493
|
+
}
|
|
3494
|
+
return this;
|
|
3495
|
+
}),
|
|
3496
|
+
(e.prototype.delete = function (e) {
|
|
3497
|
+
var t = this;
|
|
3498
|
+
if (
|
|
3499
|
+
Ht(this) &&
|
|
3500
|
+
!(o = Xt(this, { type: 'delete', object: this, oldValue: e }))
|
|
3501
|
+
)
|
|
3502
|
+
return !1;
|
|
3503
|
+
if (this.has(e)) {
|
|
3504
|
+
var r = Dt(),
|
|
3505
|
+
n = $t(this),
|
|
3506
|
+
o = n || r ? { type: 'delete', object: this, oldValue: e } : null;
|
|
3507
|
+
return (
|
|
3508
|
+
r &&
|
|
3509
|
+
'production' !== process.env.NODE_ENV &&
|
|
3510
|
+
Vt(fe(fe({}, o), { name: this.name })),
|
|
3511
|
+
zt(function () {
|
|
3512
|
+
t._atom.reportChanged(), t._data.delete(e);
|
|
3513
|
+
}),
|
|
3514
|
+
n && Zt(this, o),
|
|
3515
|
+
r && 'production' !== process.env.NODE_ENV && kt(),
|
|
3516
|
+
!0
|
|
3517
|
+
);
|
|
3518
|
+
}
|
|
3519
|
+
return !1;
|
|
3520
|
+
}),
|
|
3521
|
+
(e.prototype.has = function (e) {
|
|
3522
|
+
return (
|
|
3523
|
+
this._atom.reportObserved(), this._data.has(this.dehanceValue(e))
|
|
3524
|
+
);
|
|
3525
|
+
}),
|
|
3526
|
+
(e.prototype.entries = function () {
|
|
3527
|
+
var e = 0,
|
|
3528
|
+
t = Array.from(this.keys()),
|
|
3529
|
+
r = Array.from(this.values());
|
|
3530
|
+
return Dr({
|
|
3531
|
+
next: function () {
|
|
3532
|
+
var n = e;
|
|
3533
|
+
return (
|
|
3534
|
+
(e += 1),
|
|
3535
|
+
n < r.length ? { value: [t[n], r[n]], done: !1 } : { done: !0 }
|
|
3536
|
+
);
|
|
3537
|
+
},
|
|
3538
|
+
});
|
|
3539
|
+
}),
|
|
3540
|
+
(e.prototype.keys = function () {
|
|
3541
|
+
return this.values();
|
|
3542
|
+
}),
|
|
3543
|
+
(e.prototype.values = function () {
|
|
3544
|
+
this._atom.reportObserved();
|
|
3545
|
+
var e = this,
|
|
3546
|
+
t = 0,
|
|
3547
|
+
r = Array.from(this._data.values());
|
|
3548
|
+
return Dr({
|
|
3549
|
+
next: function () {
|
|
3550
|
+
return t < r.length
|
|
3551
|
+
? { value: e.dehanceValue(r[t++]), done: !1 }
|
|
3552
|
+
: { done: !0 };
|
|
3553
|
+
},
|
|
3554
|
+
});
|
|
3555
|
+
}),
|
|
3556
|
+
(e.prototype.replace = function (e) {
|
|
3557
|
+
var t = this;
|
|
3558
|
+
return (
|
|
3559
|
+
lr(e) && (e = e.toJS()),
|
|
3560
|
+
zt(function () {
|
|
3561
|
+
var r = ot(!0);
|
|
3562
|
+
try {
|
|
3563
|
+
Array.isArray(e) || re(e)
|
|
3564
|
+
? (t.clear(),
|
|
3565
|
+
e.forEach(function (e) {
|
|
3566
|
+
return t.add(e);
|
|
3567
|
+
}))
|
|
3568
|
+
: null != e && J('Cannot initialize set from ' + e);
|
|
3569
|
+
} finally {
|
|
3570
|
+
it(r);
|
|
3571
|
+
}
|
|
3572
|
+
}),
|
|
3573
|
+
this
|
|
3574
|
+
);
|
|
3575
|
+
}),
|
|
3576
|
+
(e.prototype.observe = function (e, t) {
|
|
3577
|
+
return (
|
|
3578
|
+
'production' !== process.env.NODE_ENV &&
|
|
3579
|
+
H(
|
|
3580
|
+
!0 !== t,
|
|
3581
|
+
"`observe` doesn't support fireImmediately=true in combination with sets.",
|
|
3582
|
+
),
|
|
3583
|
+
Yt(this, e)
|
|
3584
|
+
);
|
|
3585
|
+
}),
|
|
3586
|
+
(e.prototype.intercept = function (e) {
|
|
3587
|
+
return Wt(this, e);
|
|
3588
|
+
}),
|
|
3589
|
+
(e.prototype.toJS = function () {
|
|
3590
|
+
return new Set(this);
|
|
3591
|
+
}),
|
|
3592
|
+
(e.prototype.toString = function () {
|
|
3593
|
+
return this.name + '[ ' + Array.from(this).join(', ') + ' ]';
|
|
3594
|
+
}),
|
|
3595
|
+
(e.prototype[((ir = se), Symbol.iterator)] = function () {
|
|
3596
|
+
return this.values();
|
|
3597
|
+
}),
|
|
3598
|
+
e
|
|
3599
|
+
);
|
|
3600
|
+
})(),
|
|
3601
|
+
lr = ee('ObservableSet', pr),
|
|
3602
|
+
dr = (function () {
|
|
3603
|
+
function e(e, t, r, n) {
|
|
3604
|
+
void 0 === t && (t = new Map()),
|
|
3605
|
+
(this.target = e),
|
|
3606
|
+
(this.values = t),
|
|
3607
|
+
(this.name = r),
|
|
3608
|
+
(this.defaultEnhancer = n),
|
|
3609
|
+
(this.keysAtom = new ue(r + '.keys'));
|
|
3610
|
+
}
|
|
3611
|
+
return (
|
|
3612
|
+
(e.prototype.read = function (e) {
|
|
3613
|
+
return this.values.get(e).get();
|
|
3614
|
+
}),
|
|
3615
|
+
(e.prototype.write = function (e, t) {
|
|
3616
|
+
var r = this.target,
|
|
3617
|
+
n = this.values.get(e);
|
|
3618
|
+
if (n instanceof st) n.set(t);
|
|
3619
|
+
else {
|
|
3620
|
+
if (Ht(this)) {
|
|
3621
|
+
if (
|
|
3622
|
+
!(a = Xt(this, {
|
|
3623
|
+
type: 'update',
|
|
3624
|
+
object: this.proxy || r,
|
|
3625
|
+
name: e,
|
|
3626
|
+
newValue: t,
|
|
3627
|
+
}))
|
|
3628
|
+
)
|
|
3629
|
+
return;
|
|
3630
|
+
t = a.newValue;
|
|
3631
|
+
}
|
|
3632
|
+
if ((t = n.prepareNewValue(t)) !== ft.UNCHANGED) {
|
|
3633
|
+
var o = $t(this),
|
|
3634
|
+
i = Dt(),
|
|
3635
|
+
a =
|
|
3636
|
+
o || i
|
|
3637
|
+
? {
|
|
3638
|
+
type: 'update',
|
|
3639
|
+
object: this.proxy || r,
|
|
3640
|
+
oldValue: n.value,
|
|
3641
|
+
name: e,
|
|
3642
|
+
newValue: t,
|
|
3643
|
+
}
|
|
3644
|
+
: null;
|
|
3645
|
+
i &&
|
|
3646
|
+
'production' !== process.env.NODE_ENV &&
|
|
3647
|
+
Vt(fe(fe({}, a), { name: this.name, key: e })),
|
|
3648
|
+
n.setNewValue(t),
|
|
3649
|
+
o && Zt(this, a),
|
|
3650
|
+
i && 'production' !== process.env.NODE_ENV && kt();
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3653
|
+
}),
|
|
3654
|
+
(e.prototype.has = function (e) {
|
|
3655
|
+
var t = this.pendingKeys || (this.pendingKeys = new Map()),
|
|
3656
|
+
r = t.get(e);
|
|
3657
|
+
if (r) return r.get();
|
|
3658
|
+
var n = !!this.values.get(e);
|
|
3659
|
+
return (
|
|
3660
|
+
(r = new at(n, je, this.name + '.' + oe(e) + '?', !1)),
|
|
3661
|
+
t.set(e, r),
|
|
3662
|
+
r.get()
|
|
3663
|
+
);
|
|
3664
|
+
}),
|
|
3665
|
+
(e.prototype.addObservableProp = function (e, t, r) {
|
|
3666
|
+
void 0 === r && (r = this.defaultEnhancer);
|
|
3667
|
+
var n,
|
|
3668
|
+
o,
|
|
3669
|
+
i = this.target;
|
|
3670
|
+
if (
|
|
3671
|
+
((n = i),
|
|
3672
|
+
(o = e),
|
|
3673
|
+
'production' === process.env.NODE_ENV ||
|
|
3674
|
+
Q(n, o) ||
|
|
3675
|
+
J(
|
|
3676
|
+
"Cannot make property '" +
|
|
3677
|
+
o.toString() +
|
|
3678
|
+
"' observable, it is not configurable and writable in the target object",
|
|
3679
|
+
),
|
|
3680
|
+
Ht(this))
|
|
3681
|
+
) {
|
|
3682
|
+
var a = Xt(this, {
|
|
3683
|
+
object: this.proxy || i,
|
|
3684
|
+
name: e,
|
|
3685
|
+
type: 'add',
|
|
3686
|
+
newValue: t,
|
|
3687
|
+
});
|
|
3688
|
+
if (!a) return;
|
|
3689
|
+
t = a.newValue;
|
|
3690
|
+
}
|
|
3691
|
+
var s = new at(t, r, this.name + '.' + oe(e), !1);
|
|
3692
|
+
this.values.set(e, s),
|
|
3693
|
+
(t = s.value),
|
|
3694
|
+
Object.defineProperty(
|
|
3695
|
+
i,
|
|
3696
|
+
e,
|
|
3697
|
+
(function (e) {
|
|
3698
|
+
return (
|
|
3699
|
+
hr[e] ||
|
|
3700
|
+
(hr[e] = {
|
|
3701
|
+
configurable: !0,
|
|
3702
|
+
enumerable: !0,
|
|
3703
|
+
get: function () {
|
|
3704
|
+
return this[se].read(e);
|
|
3705
|
+
},
|
|
3706
|
+
set: function (t) {
|
|
3707
|
+
this[se].write(e, t);
|
|
3708
|
+
},
|
|
3709
|
+
})
|
|
3710
|
+
);
|
|
3711
|
+
})(e),
|
|
3712
|
+
),
|
|
3713
|
+
this.notifyPropertyAddition(e, t);
|
|
3714
|
+
}),
|
|
3715
|
+
(e.prototype.addComputedProp = function (e, t, r) {
|
|
3716
|
+
var n = this.target;
|
|
3717
|
+
(r.name = r.name || this.name + '.' + oe(t)),
|
|
3718
|
+
this.values.set(t, new st(r)),
|
|
3719
|
+
(e === n || Q(e, t)) &&
|
|
3720
|
+
Object.defineProperty(
|
|
3721
|
+
e,
|
|
3722
|
+
t,
|
|
3723
|
+
(function (e) {
|
|
3724
|
+
return (
|
|
3725
|
+
vr[e] ||
|
|
3726
|
+
(vr[e] = {
|
|
3727
|
+
configurable: ft.computedConfigurable,
|
|
3728
|
+
enumerable: !1,
|
|
3729
|
+
get: function () {
|
|
3730
|
+
return yr(this).read(e);
|
|
3731
|
+
},
|
|
3732
|
+
set: function (t) {
|
|
3733
|
+
yr(this).write(e, t);
|
|
3734
|
+
},
|
|
3735
|
+
})
|
|
3736
|
+
);
|
|
3737
|
+
})(t),
|
|
3738
|
+
);
|
|
3739
|
+
}),
|
|
3740
|
+
(e.prototype.remove = function (e) {
|
|
3741
|
+
if (this.values.has(e)) {
|
|
3742
|
+
var t = this.target;
|
|
3743
|
+
if (Ht(this))
|
|
3744
|
+
if (
|
|
3745
|
+
!(s = Xt(this, {
|
|
3746
|
+
object: this.proxy || t,
|
|
3747
|
+
name: e,
|
|
3748
|
+
type: 'remove',
|
|
3749
|
+
}))
|
|
3750
|
+
)
|
|
3751
|
+
return;
|
|
3752
|
+
try {
|
|
3753
|
+
bt();
|
|
3754
|
+
var r = $t(this),
|
|
3755
|
+
n = Dt(),
|
|
3756
|
+
o = this.values.get(e),
|
|
3757
|
+
i = o && o.get();
|
|
3758
|
+
if (
|
|
3759
|
+
(o && o.set(void 0),
|
|
3760
|
+
this.keysAtom.reportChanged(),
|
|
3761
|
+
this.values.delete(e),
|
|
3762
|
+
this.pendingKeys)
|
|
3763
|
+
) {
|
|
3764
|
+
var a = this.pendingKeys.get(e);
|
|
3765
|
+
a && a.set(!1);
|
|
3766
|
+
}
|
|
3767
|
+
delete this.target[e];
|
|
3768
|
+
var s =
|
|
3769
|
+
r || n
|
|
3770
|
+
? {
|
|
3771
|
+
type: 'remove',
|
|
3772
|
+
object: this.proxy || t,
|
|
3773
|
+
oldValue: i,
|
|
3774
|
+
name: e,
|
|
3775
|
+
}
|
|
3776
|
+
: null;
|
|
3777
|
+
n &&
|
|
3778
|
+
'production' !== process.env.NODE_ENV &&
|
|
3779
|
+
Vt(fe(fe({}, s), { name: this.name, key: e })),
|
|
3780
|
+
r && Zt(this, s),
|
|
3781
|
+
n && 'production' !== process.env.NODE_ENV && kt();
|
|
3782
|
+
} finally {
|
|
3783
|
+
mt();
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
}),
|
|
3787
|
+
(e.prototype.illegalAccess = function (e, t) {
|
|
3788
|
+
console.warn(
|
|
3789
|
+
"Property '" +
|
|
3790
|
+
t +
|
|
3791
|
+
"' of '" +
|
|
3792
|
+
e +
|
|
3793
|
+
"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner",
|
|
3794
|
+
);
|
|
3795
|
+
}),
|
|
3796
|
+
(e.prototype.observe = function (e, t) {
|
|
3797
|
+
return (
|
|
3798
|
+
'production' !== process.env.NODE_ENV &&
|
|
3799
|
+
H(
|
|
3800
|
+
!0 !== t,
|
|
3801
|
+
"`observe` doesn't support the fire immediately property for observable objects.",
|
|
3802
|
+
),
|
|
3803
|
+
Yt(this, e)
|
|
3804
|
+
);
|
|
3805
|
+
}),
|
|
3806
|
+
(e.prototype.intercept = function (e) {
|
|
3807
|
+
return Wt(this, e);
|
|
3808
|
+
}),
|
|
3809
|
+
(e.prototype.notifyPropertyAddition = function (e, t) {
|
|
3810
|
+
var r = $t(this),
|
|
3811
|
+
n = Dt(),
|
|
3812
|
+
o =
|
|
3813
|
+
r || n
|
|
3814
|
+
? {
|
|
3815
|
+
type: 'add',
|
|
3816
|
+
object: this.proxy || this.target,
|
|
3817
|
+
name: e,
|
|
3818
|
+
newValue: t,
|
|
3819
|
+
}
|
|
3820
|
+
: null;
|
|
3821
|
+
if (
|
|
3822
|
+
(n &&
|
|
3823
|
+
'production' !== process.env.NODE_ENV &&
|
|
3824
|
+
Vt(fe(fe({}, o), { name: this.name, key: e })),
|
|
3825
|
+
r && Zt(this, o),
|
|
3826
|
+
n && 'production' !== process.env.NODE_ENV && kt(),
|
|
3827
|
+
this.pendingKeys)
|
|
3828
|
+
) {
|
|
3829
|
+
var i = this.pendingKeys.get(e);
|
|
3830
|
+
i && i.set(!0);
|
|
3831
|
+
}
|
|
3832
|
+
this.keysAtom.reportChanged();
|
|
3833
|
+
}),
|
|
3834
|
+
(e.prototype.getKeys = function () {
|
|
3835
|
+
var e, t;
|
|
3836
|
+
this.keysAtom.reportObserved();
|
|
3837
|
+
var r = [];
|
|
3838
|
+
try {
|
|
3839
|
+
for (var n = he(this.values), o = n.next(); !o.done; o = n.next()) {
|
|
3840
|
+
var i = ve(o.value, 2),
|
|
3841
|
+
a = i[0];
|
|
3842
|
+
i[1] instanceof at && r.push(a);
|
|
3843
|
+
}
|
|
3844
|
+
} catch (t) {
|
|
3845
|
+
e = { error: t };
|
|
3846
|
+
} finally {
|
|
3847
|
+
try {
|
|
3848
|
+
o && !o.done && (t = n.return) && t.call(n);
|
|
3849
|
+
} finally {
|
|
3850
|
+
if (e) throw e.error;
|
|
3851
|
+
}
|
|
3852
|
+
}
|
|
3853
|
+
return r;
|
|
3854
|
+
}),
|
|
3855
|
+
e
|
|
3856
|
+
);
|
|
3857
|
+
})();
|
|
3858
|
+
function fr(e, t, r) {
|
|
3859
|
+
if (
|
|
3860
|
+
(void 0 === t && (t = ''),
|
|
3861
|
+
void 0 === r && (r = _e),
|
|
3862
|
+
Object.prototype.hasOwnProperty.call(e, se))
|
|
3863
|
+
)
|
|
3864
|
+
return e[se];
|
|
3865
|
+
'production' !== process.env.NODE_ENV &&
|
|
3866
|
+
H(
|
|
3867
|
+
Object.isExtensible(e),
|
|
3868
|
+
'Cannot make the designated object observable; it is not extensible',
|
|
3869
|
+
),
|
|
3870
|
+
Y(e) || (t = (e.constructor.name || 'ObservableObject') + '@' + F()),
|
|
3871
|
+
t || (t = 'ObservableObject@' + F());
|
|
3872
|
+
var n = new dr(e, new Map(), oe(t), r);
|
|
3873
|
+
return Z(e, se, n), n;
|
|
3874
|
+
}
|
|
3875
|
+
var hr = Object.create(null),
|
|
3876
|
+
vr = Object.create(null);
|
|
3877
|
+
function yr(e) {
|
|
3878
|
+
var t = e[se];
|
|
3879
|
+
return t || (Ee(e), e[se]);
|
|
3880
|
+
}
|
|
3881
|
+
var br = ee('ObservableObjectAdministration', dr);
|
|
3882
|
+
function mr(e) {
|
|
3883
|
+
return !!$(e) && (Ee(e), br(e[se]));
|
|
3884
|
+
}
|
|
3885
|
+
function gr(e, t) {
|
|
3886
|
+
if ('object' == typeof e && null !== e) {
|
|
3887
|
+
if (or(e))
|
|
3888
|
+
return (
|
|
3889
|
+
void 0 !== t &&
|
|
3890
|
+
J(
|
|
3891
|
+
'production' !== process.env.NODE_ENV &&
|
|
3892
|
+
'It is not possible to get index atoms from arrays',
|
|
3893
|
+
),
|
|
3894
|
+
e[se].atom
|
|
3895
|
+
);
|
|
3896
|
+
if (lr(e)) return e[se];
|
|
3897
|
+
if (ur(e)) {
|
|
3898
|
+
var r = e;
|
|
3899
|
+
return void 0 === t
|
|
3900
|
+
? r._keysAtom
|
|
3901
|
+
: ((n = r._data.get(t) || r._hasMap.get(t)) ||
|
|
3902
|
+
J(
|
|
3903
|
+
'production' !== process.env.NODE_ENV &&
|
|
3904
|
+
"the entry '" +
|
|
3905
|
+
t +
|
|
3906
|
+
"' does not exist in the observable map '" +
|
|
3907
|
+
Er(e) +
|
|
3908
|
+
"'",
|
|
3909
|
+
),
|
|
3910
|
+
n);
|
|
3911
|
+
}
|
|
3912
|
+
var n;
|
|
3913
|
+
if ((Ee(e), t && !e[se] && e[t], mr(e)))
|
|
3914
|
+
return t
|
|
3915
|
+
? ((n = e[se].values.get(t)) ||
|
|
3916
|
+
J(
|
|
3917
|
+
'production' !== process.env.NODE_ENV &&
|
|
3918
|
+
"no observable property '" +
|
|
3919
|
+
t +
|
|
3920
|
+
"' found on the observable object '" +
|
|
3921
|
+
Er(e) +
|
|
3922
|
+
"'",
|
|
3923
|
+
),
|
|
3924
|
+
n)
|
|
3925
|
+
: J(
|
|
3926
|
+
'production' !== process.env.NODE_ENV &&
|
|
3927
|
+
'please specify a property',
|
|
3928
|
+
);
|
|
3929
|
+
if (ce(e) || ut(e) || St(e)) return e;
|
|
3930
|
+
} else if ('function' == typeof e && St(e[se])) return e[se];
|
|
3931
|
+
return J(
|
|
3932
|
+
'production' !== process.env.NODE_ENV && 'Cannot obtain atom from ' + e,
|
|
3933
|
+
);
|
|
3934
|
+
}
|
|
3935
|
+
function Or(e, t) {
|
|
3936
|
+
return (
|
|
3937
|
+
e || J('Expecting some object'),
|
|
3938
|
+
void 0 !== t
|
|
3939
|
+
? Or(gr(e, t))
|
|
3940
|
+
: ce(e) || ut(e) || St(e) || ur(e) || lr(e)
|
|
3941
|
+
? e
|
|
3942
|
+
: (Ee(e),
|
|
3943
|
+
e[se]
|
|
3944
|
+
? e[se]
|
|
3945
|
+
: void J(
|
|
3946
|
+
'production' !== process.env.NODE_ENV &&
|
|
3947
|
+
'Cannot obtain administration from ' + e,
|
|
3948
|
+
))
|
|
3949
|
+
);
|
|
3950
|
+
}
|
|
3951
|
+
function Er(e, t) {
|
|
3952
|
+
return (void 0 !== t ? gr(e, t) : mr(e) || ur(e) || lr(e) ? Or(e) : gr(e))
|
|
3953
|
+
.name;
|
|
3954
|
+
}
|
|
3955
|
+
var Nr,
|
|
3956
|
+
wr = Object.prototype.toString;
|
|
3957
|
+
function _r(e, t, r) {
|
|
3958
|
+
return void 0 === r && (r = -1), jr(e, t, r);
|
|
3959
|
+
}
|
|
3960
|
+
function jr(e, t, r, n, o) {
|
|
3961
|
+
if (e === t) return 0 !== e || 1 / e == 1 / t;
|
|
3962
|
+
if (null == e || null == t) return !1;
|
|
3963
|
+
if (e != e) return t != t;
|
|
3964
|
+
var i = typeof e;
|
|
3965
|
+
if ('function' !== i && 'object' !== i && 'object' != typeof t) return !1;
|
|
3966
|
+
var a = wr.call(e);
|
|
3967
|
+
if (a !== wr.call(t)) return !1;
|
|
3968
|
+
switch (a) {
|
|
3969
|
+
case '[object RegExp]':
|
|
3970
|
+
case '[object String]':
|
|
3971
|
+
return '' + e == '' + t;
|
|
3972
|
+
case '[object Number]':
|
|
3973
|
+
return +e != +e ? +t != +t : 0 === +e ? 1 / +e == 1 / t : +e === +t;
|
|
3974
|
+
case '[object Date]':
|
|
3975
|
+
case '[object Boolean]':
|
|
3976
|
+
return +e === +t;
|
|
3977
|
+
case '[object Symbol]':
|
|
3978
|
+
return (
|
|
3979
|
+
'undefined' != typeof Symbol &&
|
|
3980
|
+
Symbol.valueOf.call(e) === Symbol.valueOf.call(t)
|
|
3981
|
+
);
|
|
3982
|
+
case '[object Map]':
|
|
3983
|
+
case '[object Set]':
|
|
3984
|
+
r >= 0 && r++;
|
|
3985
|
+
}
|
|
3986
|
+
(e = xr(e)), (t = xr(t));
|
|
3987
|
+
var s = '[object Array]' === a;
|
|
3988
|
+
if (!s) {
|
|
3989
|
+
if ('object' != typeof e || 'object' != typeof t) return !1;
|
|
3990
|
+
var u = e.constructor,
|
|
3991
|
+
c = t.constructor;
|
|
3992
|
+
if (
|
|
3993
|
+
u !== c &&
|
|
3994
|
+
!(
|
|
3995
|
+
'function' == typeof u &&
|
|
3996
|
+
u instanceof u &&
|
|
3997
|
+
'function' == typeof c &&
|
|
3998
|
+
c instanceof c
|
|
3999
|
+
) &&
|
|
4000
|
+
'constructor' in e &&
|
|
4001
|
+
'constructor' in t
|
|
4002
|
+
)
|
|
4003
|
+
return !1;
|
|
4004
|
+
}
|
|
4005
|
+
if (0 === r) return !1;
|
|
4006
|
+
r < 0 && (r = -1), (o = o || []);
|
|
4007
|
+
for (var p = (n = n || []).length; p--; ) if (n[p] === e) return o[p] === t;
|
|
4008
|
+
if ((n.push(e), o.push(t), s)) {
|
|
4009
|
+
if ((p = e.length) !== t.length) return !1;
|
|
4010
|
+
for (; p--; ) if (!jr(e[p], t[p], r - 1, n, o)) return !1;
|
|
4011
|
+
} else {
|
|
4012
|
+
var l = Object.keys(e),
|
|
4013
|
+
d = void 0;
|
|
4014
|
+
if (((p = l.length), Object.keys(t).length !== p)) return !1;
|
|
4015
|
+
for (; p--; )
|
|
4016
|
+
if (!Sr(t, (d = l[p])) || !jr(e[d], t[d], r - 1, n, o)) return !1;
|
|
4017
|
+
}
|
|
4018
|
+
return n.pop(), o.pop(), !0;
|
|
4019
|
+
}
|
|
4020
|
+
function xr(e) {
|
|
4021
|
+
return or(e)
|
|
4022
|
+
? e.slice()
|
|
4023
|
+
: te(e) || ur(e) || re(e) || lr(e)
|
|
4024
|
+
? Array.from(e.entries())
|
|
4025
|
+
: e;
|
|
4026
|
+
}
|
|
4027
|
+
function Sr(e, t) {
|
|
4028
|
+
return Object.prototype.hasOwnProperty.call(e, t);
|
|
4029
|
+
}
|
|
4030
|
+
function Dr(e) {
|
|
4031
|
+
return (e[Symbol.iterator] = Ar), e;
|
|
4032
|
+
}
|
|
4033
|
+
function Ar() {
|
|
4034
|
+
return this;
|
|
4035
|
+
}
|
|
4036
|
+
if ('undefined' == typeof Proxy || 'undefined' == typeof Symbol)
|
|
4037
|
+
throw new Error(
|
|
4038
|
+
"[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.",
|
|
4039
|
+
);
|
|
4040
|
+
try {
|
|
4041
|
+
process.env.NODE_ENV;
|
|
4042
|
+
} catch (e) {
|
|
4043
|
+
var Vr = lt();
|
|
4044
|
+
'undefined' == typeof process && (Vr.process = {}), (Vr.process.env = {});
|
|
4045
|
+
}
|
|
4046
|
+
!(function () {
|
|
4047
|
+
if (
|
|
4048
|
+
'testCodeMinification' !== function () {}.name &&
|
|
4049
|
+
'production' !== process.env.NODE_ENV &&
|
|
4050
|
+
'undefined' != typeof process &&
|
|
4051
|
+
'true' !== process.env.IGNORE_MOBX_MINIFY_WARNING
|
|
4052
|
+
) {
|
|
4053
|
+
var e = ['process', 'env', 'NODE_ENV'].join('.');
|
|
4054
|
+
console.warn(
|
|
4055
|
+
"[mobx] you are running a minified build, but '" +
|
|
4056
|
+
e +
|
|
4057
|
+
"' was not set to 'production' in your bundler. This results in an unnecessarily large and slow bundle",
|
|
4058
|
+
);
|
|
4059
|
+
}
|
|
4060
|
+
})(),
|
|
4061
|
+
'object' == typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
4062
|
+
__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({
|
|
4063
|
+
spy: function (e) {
|
|
4064
|
+
return 'production' === process.env.NODE_ENV
|
|
4065
|
+
? (console.warn('[mobx.spy] Is a no-op in production builds'),
|
|
4066
|
+
function () {})
|
|
4067
|
+
: (ft.spyListeners.push(e),
|
|
4068
|
+
W(function () {
|
|
4069
|
+
ft.spyListeners = ft.spyListeners.filter(function (t) {
|
|
4070
|
+
return t !== e;
|
|
4071
|
+
});
|
|
4072
|
+
}));
|
|
4073
|
+
},
|
|
4074
|
+
extras: { getDebugName: Er },
|
|
4075
|
+
$mobx: se,
|
|
4076
|
+
});
|
|
4077
|
+
var Tr =
|
|
4078
|
+
(((Nr = {
|
|
4079
|
+
array: 'array',
|
|
4080
|
+
boolean: 'boolean',
|
|
4081
|
+
'box-style': 'object',
|
|
4082
|
+
'padding-margin': 'object',
|
|
4083
|
+
codearea: 'string',
|
|
4084
|
+
color: 'string',
|
|
4085
|
+
datasource: 'object',
|
|
4086
|
+
date: 'string',
|
|
4087
|
+
'date-time': 'string',
|
|
4088
|
+
'dynamic-data': 'object',
|
|
4089
|
+
event: 'object',
|
|
4090
|
+
'func-body': 'string',
|
|
4091
|
+
htmlarea: 'string',
|
|
4092
|
+
image: 'string',
|
|
4093
|
+
input: 'string',
|
|
4094
|
+
json: 'string',
|
|
4095
|
+
number: 'number',
|
|
4096
|
+
'input-image': 'string',
|
|
4097
|
+
object: 'object',
|
|
4098
|
+
quantity: 'object',
|
|
4099
|
+
radio: 'string',
|
|
4100
|
+
select: 'array',
|
|
4101
|
+
}).select = 'string'),
|
|
4102
|
+
(Nr.textarea = 'string'),
|
|
4103
|
+
(Nr['text-editor'] = 'string'),
|
|
4104
|
+
(Nr.time = 'string'),
|
|
4105
|
+
(Nr.url = 'string'),
|
|
4106
|
+
Nr);
|
|
4107
|
+
function kr(e) {
|
|
4108
|
+
return Tr[e] || e;
|
|
4109
|
+
}
|
|
4110
|
+
function Cr(e, t) {
|
|
4111
|
+
Tr[e]
|
|
4112
|
+
? console.warn('当前已经存在' + e + '(' + Tr[e] + '),暂时不支持覆盖。')
|
|
4113
|
+
: (Tr[e] = t);
|
|
4114
|
+
}
|
|
4115
|
+
function Rr(e) {
|
|
4116
|
+
var t = !0;
|
|
4117
|
+
if (!e) return t;
|
|
4118
|
+
var r = e.type;
|
|
4119
|
+
return (
|
|
4120
|
+
(('object' === r &&
|
|
4121
|
+
e.properties &&
|
|
4122
|
+
e.propertyOrder &&
|
|
4123
|
+
e.propertyOrder.length > 0) ||
|
|
4124
|
+
('array' === r &&
|
|
4125
|
+
e.items &&
|
|
4126
|
+
e.items.properties &&
|
|
4127
|
+
e.items.propertyOrder &&
|
|
4128
|
+
e.items.propertyOrder.length > 0) ||
|
|
4129
|
+
(e.type && 'array' !== e.type && 'object' !== e.type) ||
|
|
4130
|
+
e.type) &&
|
|
4131
|
+
(t = !1),
|
|
4132
|
+
t
|
|
4133
|
+
);
|
|
4134
|
+
}
|
|
4135
|
+
function Pr(e) {
|
|
4136
|
+
var t = !1,
|
|
4137
|
+
r = e.lastUpdateTime,
|
|
4138
|
+
n = new Date('2024-10-05T00:01:00.691Z').getTime();
|
|
4139
|
+
return r && new Date(r).getTime() >= n && (t = !0), t;
|
|
4140
|
+
}
|
|
4141
|
+
function Ur(e) {
|
|
4142
|
+
var t = !1,
|
|
4143
|
+
r = kr(e.type),
|
|
4144
|
+
n = void 0 === e.isContainer || e.isContainer;
|
|
4145
|
+
return 'object' === r && n && (t = !0), t;
|
|
4146
|
+
}
|
|
4147
|
+
function qr(e) {
|
|
4148
|
+
var t = !0;
|
|
4149
|
+
return (
|
|
4150
|
+
'object' === e.type && e.propertyOrder && e.properties
|
|
4151
|
+
? e.propertyOrder.map(function (r) {
|
|
4152
|
+
var n = e.properties[r];
|
|
4153
|
+
('object' === e.type && n.propertyOrder && n.properties) || (t = !1);
|
|
4154
|
+
})
|
|
4155
|
+
: (t = !1),
|
|
4156
|
+
t
|
|
4157
|
+
);
|
|
4158
|
+
}
|
|
4159
|
+
function Lr(e, t) {
|
|
4160
|
+
var r = e.split('-'),
|
|
4161
|
+
n = t.split('-');
|
|
4162
|
+
return r.pop(), n.pop(), r.join('-') === n.join('-');
|
|
4163
|
+
}
|
|
4164
|
+
function Br(e, t) {
|
|
4165
|
+
for (
|
|
4166
|
+
var r = e.split('-'),
|
|
4167
|
+
n = t.split('-'),
|
|
4168
|
+
o = 'before',
|
|
4169
|
+
i = 0,
|
|
4170
|
+
a = (r.length > n.length ? n : r).length;
|
|
4171
|
+
i < a;
|
|
4172
|
+
i += 1
|
|
4173
|
+
) {
|
|
4174
|
+
Number(r[i]) > Number(n[i]) && (o = 'after');
|
|
4175
|
+
}
|
|
4176
|
+
return o;
|
|
4177
|
+
}
|
|
4178
|
+
function Ir(e) {
|
|
4179
|
+
var t = e.split('-');
|
|
4180
|
+
return t.pop(), t.join('-');
|
|
4181
|
+
}
|
|
4182
|
+
function Mr(e) {
|
|
4183
|
+
var t = e.split('-'),
|
|
4184
|
+
r = t.pop(),
|
|
4185
|
+
n = Number(r) + 1;
|
|
4186
|
+
return t.push('' + n), t.join('-');
|
|
4187
|
+
}
|
|
4188
|
+
function Gr(e) {
|
|
4189
|
+
var t = e.split('-'),
|
|
4190
|
+
r = t.pop();
|
|
4191
|
+
return [t.join('-'), r];
|
|
4192
|
+
}
|
|
4193
|
+
function zr(e) {
|
|
4194
|
+
var t = e.split('-'),
|
|
4195
|
+
r = t.pop();
|
|
4196
|
+
return t.push(Number(r) - 1), t.join('-');
|
|
4197
|
+
}
|
|
4198
|
+
function Kr(e) {
|
|
4199
|
+
var t = e.split('-'),
|
|
4200
|
+
r = t.pop();
|
|
4201
|
+
return t.push(Number(r) + 1), t.join('-');
|
|
4202
|
+
}
|
|
4203
|
+
function Fr(e, t) {
|
|
4204
|
+
var r = '',
|
|
4205
|
+
n = !1;
|
|
4206
|
+
if (!1 !== e.defaultActiveFirstOption && e.defaultActiveFirstOption)
|
|
4207
|
+
return (
|
|
4208
|
+
e.options && e.options[0] && ((r = e.options[0].value), (n = !0)),
|
|
4209
|
+
(t || e.multiple) && (r = n ? [r] : []),
|
|
4210
|
+
r
|
|
4211
|
+
);
|
|
4212
|
+
}
|
|
4213
|
+
function Jr(e, t) {
|
|
4214
|
+
var r,
|
|
4215
|
+
n,
|
|
4216
|
+
o = void 0,
|
|
4217
|
+
i = t;
|
|
4218
|
+
V(i) &&
|
|
4219
|
+
V(e.default) &&
|
|
4220
|
+
(typeof i != typeof e.default ||
|
|
4221
|
+
((r = i), (n = e.default), E(r) + '-' + g(r) != E(n) + '-' + g(n))) &&
|
|
4222
|
+
(i = void 0);
|
|
4223
|
+
var a = V(i) ? i : e.default;
|
|
4224
|
+
switch (e.type) {
|
|
4225
|
+
case 'select':
|
|
4226
|
+
case 'radio':
|
|
4227
|
+
o = null != a ? a : Fr(e);
|
|
4228
|
+
break;
|
|
4229
|
+
case 'checkboxes':
|
|
4230
|
+
o = null != a ? a : Fr(e, !0);
|
|
4231
|
+
break;
|
|
4232
|
+
case 'color':
|
|
4233
|
+
('#fff' !== a && '#FFF' !== a) || (a = '#ffffff'),
|
|
4234
|
+
(o = V(a) ? a : '#ffffff');
|
|
4235
|
+
break;
|
|
4236
|
+
case 'boolean':
|
|
4237
|
+
o = !!V(a) && a;
|
|
4238
|
+
break;
|
|
4239
|
+
case 'number':
|
|
4240
|
+
o = V(a) ? a : void 0;
|
|
4241
|
+
break;
|
|
4242
|
+
case 'json':
|
|
4243
|
+
var s = '';
|
|
4244
|
+
if (E(a) || g(a)) s = a;
|
|
4245
|
+
else if (_(a) || '' === a) s = {};
|
|
4246
|
+
else
|
|
4247
|
+
try {
|
|
4248
|
+
s = JSON.parse(a);
|
|
4249
|
+
} catch (e) {
|
|
4250
|
+
s = {};
|
|
4251
|
+
}
|
|
4252
|
+
o = s;
|
|
4253
|
+
break;
|
|
4254
|
+
default:
|
|
4255
|
+
o =
|
|
4256
|
+
'input' === e.type && '0' === e.default
|
|
4257
|
+
? a || e.default
|
|
4258
|
+
: V(a)
|
|
4259
|
+
? a
|
|
4260
|
+
: void 0;
|
|
4261
|
+
}
|
|
4262
|
+
return o;
|
|
4263
|
+
}
|
|
4264
|
+
function Hr(e, t) {
|
|
4265
|
+
var r = {},
|
|
4266
|
+
n = e.type;
|
|
4267
|
+
if (E(e) && 'object' === kr(e.type)) {
|
|
4268
|
+
var o = e,
|
|
4269
|
+
i = t;
|
|
4270
|
+
V(i) &&
|
|
4271
|
+
((V(o.default) && typeof i != typeof e.default) || !E(i)) &&
|
|
4272
|
+
(i = void 0);
|
|
4273
|
+
var a = V(i) ? i : o.default;
|
|
4274
|
+
if ('dynamic-data' === n)
|
|
4275
|
+
(r = S(u)),
|
|
4276
|
+
a && E(a) && '{}' !== JSON.stringify(a) && (r = Object.assign(r, a));
|
|
4277
|
+
else if ('datasource' === n)
|
|
4278
|
+
o.properties &&
|
|
4279
|
+
o.properties.type &&
|
|
4280
|
+
o.properties.type.default &&
|
|
4281
|
+
'local' === o.properties.type.default
|
|
4282
|
+
? ((r = { data: '{}', filter: '() => {}' }),
|
|
4283
|
+
a && a.data && (r.data = a.data),
|
|
4284
|
+
a && a.filter && (r.filter = a.filter),
|
|
4285
|
+
'http://xxx' === r.data && (r.data = '{}'))
|
|
4286
|
+
: ((r = { data: 'http://xxx', filter: '() => {}' }),
|
|
4287
|
+
a && a.data && (r.data = a.data),
|
|
4288
|
+
a && a.filter && (r.filter = a.filter),
|
|
4289
|
+
'{}' === r.data && (r.data = 'http://xxx'));
|
|
4290
|
+
else if ('event' === n)
|
|
4291
|
+
o.properties &&
|
|
4292
|
+
o.properties.type &&
|
|
4293
|
+
o.properties.type.default &&
|
|
4294
|
+
'emit' === o.properties.type.default
|
|
4295
|
+
? a && 'out' === a.type
|
|
4296
|
+
? (r = { trigger: (a && a.filter) || 'eventName', eventData: '{}' })
|
|
4297
|
+
: ((r = { trigger: 'eventName', eventData: '{}' }),
|
|
4298
|
+
a && a.trigger && (r.trigger = a.trigger),
|
|
4299
|
+
a && a.eventData && (r.eventData = a.eventData))
|
|
4300
|
+
: a && 'in' === a.type
|
|
4301
|
+
? (r = {
|
|
4302
|
+
register: 'eventName',
|
|
4303
|
+
actionFunc: (a && a.filter) || '() => {}',
|
|
4304
|
+
})
|
|
4305
|
+
: ((r = { register: 'eventName', actionFunc: '() => {}' }),
|
|
4306
|
+
a && a.register && (r.register = a.register),
|
|
4307
|
+
a && a.actionFunc && (r.actionFunc = a.actionFunc));
|
|
4308
|
+
else if (!1 === e.isContainer && a && E(a) && '{}' !== JSON.stringify(a))
|
|
4309
|
+
r = Object.assign(r, a);
|
|
4310
|
+
else if (void 0 === i && o.default && E(o.default)) r = o.default;
|
|
4311
|
+
else if (e.properties) {
|
|
4312
|
+
(e.propertyOrder ? e.propertyOrder : Object.keys(e.properties)).map(
|
|
4313
|
+
function (n) {
|
|
4314
|
+
var o = e.properties[n],
|
|
4315
|
+
i = t && t[n];
|
|
4316
|
+
switch (kr(o.type)) {
|
|
4317
|
+
case 'array':
|
|
4318
|
+
r[n] = Wr(o, i);
|
|
4319
|
+
break;
|
|
4320
|
+
case 'object':
|
|
4321
|
+
r[n] = Hr(o, i);
|
|
4322
|
+
break;
|
|
4323
|
+
default:
|
|
4324
|
+
r[n] = Jr(o, i);
|
|
4325
|
+
}
|
|
4326
|
+
},
|
|
4327
|
+
);
|
|
4328
|
+
}
|
|
4329
|
+
}
|
|
4330
|
+
return r;
|
|
4331
|
+
}
|
|
4332
|
+
function Wr(e, t) {
|
|
4333
|
+
var r = [];
|
|
4334
|
+
if (e && 'array' === kr(e.type)) {
|
|
4335
|
+
var n = t;
|
|
4336
|
+
V(n) &&
|
|
4337
|
+
((V(e.default) && typeof n != typeof e.default) || !g(n)) &&
|
|
4338
|
+
(n = void 0);
|
|
4339
|
+
var o = V(n) ? n : e.default;
|
|
4340
|
+
if ('array' === kr(e.type))
|
|
4341
|
+
if (g(o))
|
|
4342
|
+
o.map(function (t) {
|
|
4343
|
+
r.push(Hr(e.items, t));
|
|
4344
|
+
});
|
|
4345
|
+
else if (o) r = o;
|
|
4346
|
+
else {
|
|
4347
|
+
var i = Hr(e.items, o);
|
|
4348
|
+
r.push(i);
|
|
4349
|
+
}
|
|
4350
|
+
else r = V(o) ? o : [];
|
|
4351
|
+
}
|
|
4352
|
+
return r;
|
|
4353
|
+
}
|
|
4354
|
+
function Xr(e, t) {
|
|
4355
|
+
return 'object' === kr(e.type)
|
|
4356
|
+
? Hr(e, t)
|
|
4357
|
+
: 'array' === kr(e.type)
|
|
4358
|
+
? Wr(e, t)
|
|
4359
|
+
: Jr(e, t);
|
|
4360
|
+
}
|
|
4361
|
+
var $r = c;
|
|
4362
|
+
function Yr(e, t) {
|
|
4363
|
+
var r = t || [];
|
|
4364
|
+
if (e && '{}' !== JSON.stringify(e))
|
|
4365
|
+
if (E(e))
|
|
4366
|
+
if (
|
|
4367
|
+
e.type &&
|
|
4368
|
+
'remote' === e.type &&
|
|
4369
|
+
e.config &&
|
|
4370
|
+
E(e.config) &&
|
|
4371
|
+
e.config.dataName &&
|
|
4372
|
+
V(e.localFilter) &&
|
|
4373
|
+
V(e.data)
|
|
4374
|
+
) {
|
|
4375
|
+
var n = e.config.body;
|
|
4376
|
+
if (n && !E(n))
|
|
4377
|
+
try {
|
|
4378
|
+
n = JSON.parse(n);
|
|
4379
|
+
} catch (e) {
|
|
4380
|
+
n = {};
|
|
4381
|
+
}
|
|
4382
|
+
r.push({ id: e.config.id, dataName: e.config.dataName, body: n });
|
|
4383
|
+
} else {
|
|
4384
|
+
Object.keys(e).map(function (t) {
|
|
4385
|
+
Yr(e[t], r);
|
|
4386
|
+
});
|
|
4387
|
+
}
|
|
4388
|
+
else
|
|
4389
|
+
g(e) &&
|
|
4390
|
+
e.map(function (e) {
|
|
4391
|
+
Yr(e, r);
|
|
4392
|
+
});
|
|
4393
|
+
return r;
|
|
4394
|
+
}
|
|
4395
|
+
function Zr(e, t) {
|
|
4396
|
+
var r = t || 'data';
|
|
4397
|
+
return (
|
|
4398
|
+
e.split('-').map(function (e) {
|
|
4399
|
+
r = /^\d+$/.test(e) ? r + '[' + e + ']' : r + '.' + e;
|
|
4400
|
+
}),
|
|
4401
|
+
r
|
|
4402
|
+
);
|
|
4403
|
+
}
|
|
4404
|
+
function Qr(e, t) {
|
|
4405
|
+
var r = [];
|
|
4406
|
+
E(e)
|
|
4407
|
+
? Object.keys(e).map(function (n) {
|
|
4408
|
+
var o = e[n],
|
|
4409
|
+
i = t ? t + '-' + n : n;
|
|
4410
|
+
E(o) || g(o)
|
|
4411
|
+
? r.push({ title: n, value: i, key: i, children: Qr(o, i) })
|
|
4412
|
+
: r.push({ title: n, value: i, key: i });
|
|
4413
|
+
})
|
|
4414
|
+
: g(e) &&
|
|
4415
|
+
e.map(function (e, n) {
|
|
4416
|
+
var o = n.toString(),
|
|
4417
|
+
i = t ? t + '-' + n : o;
|
|
4418
|
+
E(e) || g(e)
|
|
4419
|
+
? r.push({ title: o, value: i, key: i, children: Qr(e, i) })
|
|
4420
|
+
: r.push({ title: o, value: i, key: i });
|
|
4421
|
+
});
|
|
4422
|
+
return r;
|
|
4423
|
+
}
|
|
4424
|
+
function en(e, t) {
|
|
4425
|
+
var r = '';
|
|
4426
|
+
if ('object' === kr(e.type) && e.properties) {
|
|
4427
|
+
(e.propertyOrder ? e.propertyOrder : Object.keys(e.properties)).map(
|
|
4428
|
+
function (n) {
|
|
4429
|
+
var o = e.properties[n],
|
|
4430
|
+
i = t[n];
|
|
4431
|
+
('array' === kr(o.type) && 'object' === kr(o.type)) ||
|
|
4432
|
+
(i &&
|
|
4433
|
+
o.isConditionProp &&
|
|
4434
|
+
(r.indexOf('-') > 0 ? (r += '-' + i) : (r = i)));
|
|
4435
|
+
},
|
|
4436
|
+
);
|
|
4437
|
+
}
|
|
4438
|
+
return r;
|
|
4439
|
+
}
|
|
4440
|
+
function tn(e) {
|
|
4441
|
+
var t = e.split('-');
|
|
4442
|
+
return t.pop(), t.join('-');
|
|
4443
|
+
}
|
|
4444
|
+
function rn(e) {
|
|
4445
|
+
var t = e.split('-'),
|
|
4446
|
+
r = t.pop();
|
|
4447
|
+
return [t.join('-'), r];
|
|
4448
|
+
}
|
|
4449
|
+
var nn = [
|
|
4450
|
+
'key',
|
|
4451
|
+
'enum',
|
|
4452
|
+
'enumextra',
|
|
4453
|
+
'items',
|
|
4454
|
+
'input',
|
|
4455
|
+
'boolean',
|
|
4456
|
+
'number',
|
|
4457
|
+
'color',
|
|
4458
|
+
'url',
|
|
4459
|
+
'textarea',
|
|
4460
|
+
'text-editor',
|
|
4461
|
+
'radio',
|
|
4462
|
+
'select',
|
|
4463
|
+
'checkboxes',
|
|
4464
|
+
'date',
|
|
4465
|
+
'date-time',
|
|
4466
|
+
'time',
|
|
4467
|
+
'json',
|
|
4468
|
+
'codearea',
|
|
4469
|
+
'htmlarea',
|
|
4470
|
+
'quantity',
|
|
4471
|
+
'box-style',
|
|
4472
|
+
'dynamic-data',
|
|
4473
|
+
'datasource',
|
|
4474
|
+
'event',
|
|
4475
|
+
'array',
|
|
4476
|
+
'object',
|
|
4477
|
+
];
|
|
4478
|
+
export {
|
|
4479
|
+
l as DataSourceTypeList,
|
|
4480
|
+
p as EventTypeDataList,
|
|
4481
|
+
nn as KeyWordList,
|
|
4482
|
+
c as TypeDataList,
|
|
4483
|
+
Zr as dataRoute2dataPath,
|
|
4484
|
+
Yr as dynamicDataAnalyzer,
|
|
4485
|
+
k as evalExpression,
|
|
4486
|
+
Br as getCurPosition,
|
|
4487
|
+
Fr as getDefaultOptionVal,
|
|
4488
|
+
kr as getExpectType,
|
|
4489
|
+
C as getJsonDataByKeyRoute,
|
|
4490
|
+
Mr as getNextIndexRoute,
|
|
4491
|
+
Ir as getParentIndexRoute,
|
|
4492
|
+
Gr as getParentIndexRoute_CurIndex,
|
|
4493
|
+
tn as getParentKeyRoute,
|
|
4494
|
+
rn as getParentKeyRoute_CurKey,
|
|
4495
|
+
R as getSchemaByIndexRoute,
|
|
4496
|
+
P as getSchemaByKeyRoute,
|
|
4497
|
+
V as hasProperties,
|
|
4498
|
+
U as indexRoute2keyRoute,
|
|
4499
|
+
g as isArray,
|
|
4500
|
+
v as isBoolean,
|
|
4501
|
+
w as isColor,
|
|
4502
|
+
Ur as isContainerSchema,
|
|
4503
|
+
y as isDateStr,
|
|
4504
|
+
b as isDateTimeStr,
|
|
4505
|
+
Rr as isEmptySchema,
|
|
4506
|
+
D as isEqual,
|
|
4507
|
+
A as isEqualByIdT,
|
|
4508
|
+
_ as isFunction,
|
|
4509
|
+
Pr as isNewSchemaData,
|
|
4510
|
+
h as isNumber,
|
|
4511
|
+
E as isObject,
|
|
4512
|
+
N as isQuantity,
|
|
4513
|
+
Lr as isSameParent,
|
|
4514
|
+
O as isSelect,
|
|
4515
|
+
f as isString,
|
|
4516
|
+
qr as isStructuredSchema,
|
|
4517
|
+
m as isTimeStr,
|
|
4518
|
+
d as isURL,
|
|
4519
|
+
L as json2schema,
|
|
4520
|
+
Qr as json2treeData,
|
|
4521
|
+
q as keyRoute2indexRoute,
|
|
4522
|
+
I as metaElemAnalyzer,
|
|
4523
|
+
Kr as moveBackward,
|
|
4524
|
+
zr as moveForward,
|
|
4525
|
+
S as objClone,
|
|
4526
|
+
G as oldSchemaToNewSchema,
|
|
4527
|
+
M as oldSchemaToNewSchemaV1,
|
|
4528
|
+
Cr as registerExpectType,
|
|
4529
|
+
en as schema2conditionValue,
|
|
4530
|
+
Xr as schema2json,
|
|
4531
|
+
$r as schemaMetaList,
|
|
4532
|
+
T as truncate,
|
|
4533
|
+
j as urlParse,
|
|
4534
|
+
x as urlStringify,
|
|
4535
|
+
};
|