@guihz/trading-vue-editor-tes 0.1.7 → 0.1.8

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.
@@ -75822,7 +75822,8 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
75822
75822
  }
75823
75823
  _getMapType(e) {
75824
75824
  const t = /\w+<(\w+),\s*([\w\d.]+)>/.exec(e);
75825
- return t?.[1] && t?.[2] && [t?.[1], t?.[2]];
75825
+ if (t)
75826
+ return t?.[1] && t?.[2] ? [t?.[1], t?.[2]] : void 0;
75826
75827
  }
75827
75828
  _isMatrixType(e) {
75828
75829
  return /^matrix<[\w\d.]+>$/.test(e);
@@ -76732,18 +76733,21 @@ ${this._prefixNameVar}.setCacheData("m${O}_" + ${m}, ${q})
76732
76733
  _forInNameHandle(e, t) {
76733
76734
  if (this._pushBlockRanges(t), e.names.length) {
76734
76735
  let [r, i] = e.names;
76735
- const o = e.array.type;
76736
+ const o = e.array.type, c = this._isMapType(o);
76737
+ let b = `${D.SERIES} ${D.INT}`, O;
76738
+ if (c) {
76739
+ const m = this._getMapType(o) || [];
76740
+ b = m[0] ? `${D.SERIES} ${m[0]}` : D.UNDETERMINED, O = m[1] ? `${D.SERIES} ${m[1]}` : D.UNDETERMINED;
76741
+ }
76736
76742
  i ? this._variablesHandle({
76737
- nameList: { name: r, isForVar: !0, type: `${D.SERIES} ${D.INT}` },
76743
+ nameList: { name: r, isForVar: !0, type: b },
76738
76744
  value: {
76739
- type: `${D.SERIES} ${D.INT}`
76745
+ type: b
76740
76746
  }
76741
- }, t) : i = r;
76742
- const c = o === D.UNDETERMINED ? o : this._isMatrixType(o) ? `${this._getArrayType(o)}[]` : this._typeAddSeries(this._getArrayType(o));
76743
- this._variablesHandle({
76744
- nameList: { name: i, isForVar: !0, type: c },
76747
+ }, t) : i = r, O = o === D.UNDETERMINED ? o : c ? O : this._isMatrixType(o) ? `${this._getArrayType(o)}[]` : this._typeAddSeries(this._getArrayType(o)), this._variablesHandle({
76748
+ nameList: { name: i, isForVar: !0, type: O },
76745
76749
  value: {
76746
- type: c
76750
+ type: O
76747
76751
  }
76748
76752
  }, t);
76749
76753
  }
@@ -21,7 +21,7 @@ export declare class ParserUtils extends TccScriptParserVisitor<any> {
21
21
  protected _removePrefix(type?: string): string;
22
22
  protected _getPrefix(type: string): string;
23
23
  protected _getArrayType(name: string): string | undefined;
24
- protected _getMapType(name: string): "" | string[] | undefined;
24
+ protected _getMapType(name: string): string[] | undefined;
25
25
  protected _isMatrixType(type: string): boolean;
26
26
  protected _isArrayType(type: string): boolean;
27
27
  protected _isMapType(type: string): boolean;
@@ -9163,7 +9163,7 @@ Af.onerror = (i) => {
9163
9163
  async function kf(i) {
9164
9164
  return await _o.setInlayHints(i);
9165
9165
  }
9166
- const Lf = pa(Af), Tf = pa(new Worker(new URL("" + new URL("assets/parserTccWorker-DurfrCeu.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser MineScript Server" }));
9166
+ const Lf = pa(Af), Tf = pa(new Worker(new URL("" + new URL("assets/parserTccWorker-CrprNqMy.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser MineScript Server" }));
9167
9167
  async function Oy(i, n = !1, r = Kt) {
9168
9168
  r = Kt;
9169
9169
  const s = await An(r);
@@ -74,7 +74,7 @@ function print() { __p += __j.call(arguments, '') }
74
74
  * @license
75
75
  * Copyright 2019 Google LLC
76
76
  * SPDX-License-Identifier: Apache-2.0
77
- */const ol=Symbol("Comlink.proxy"),Rm=Symbol("Comlink.endpoint"),Pm=Symbol("Comlink.releaseProxy"),ja=Symbol("Comlink.finalizer"),Dn=Symbol("Comlink.thrown"),ll=n=>typeof n=="object"&&n!==null||typeof n=="function",Bm={canHandle:n=>ll(n)&&n[ol],serialize(n){const{port1:s,port2:r}=new MessageChannel;return pl(n,s),[r,[r]]},deserialize(n){return n.start(),Ha(n)}},Km={canHandle:n=>ll(n)&&Dn in n,serialize({value:n}){let s;return n instanceof Error?s={isError:!0,value:{message:n.message,name:n.name,stack:n.stack}}:s={isError:!1,value:n},[s,[]]},deserialize(n){throw n.isError?Object.assign(new Error(n.value.message),n.value):n.value}},cl=new Map([["proxy",Bm],["throw",Km]]);function Um(n,s){for(const r of n)if(s===r||r==="*"||r instanceof RegExp&&r.test(s))return!0;return!1}function pl(n,s=globalThis,r=["*"]){s.addEventListener("message",function a(o){if(!o||!o.data)return;if(!Um(r,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:l,type:p,path:d}=Object.assign({path:[]},o.data),m=(o.data.argumentList||[]).map(Ns);let _;try{const g=d.slice(0,-1).reduce((w,C)=>w[C],n),x=d.reduce((w,C)=>w[C],n);switch(p){case"GET":_=x;break;case"SET":g[d.slice(-1)[0]]=Ns(o.data.value),_=!0;break;case"APPLY":_=x.apply(g,m);break;case"CONSTRUCT":{const w=new x(...m);_=Ga(w)}break;case"ENDPOINT":{const{port1:w,port2:C}=new MessageChannel;pl(n,C),_=Gm(w,[w])}break;case"RELEASE":_=void 0;break;default:return}}catch(g){_={value:g,[Dn]:0}}Promise.resolve(_).catch(g=>({value:g,[Dn]:0})).then(g=>{const[x,w]=Cn(g);s.postMessage(Object.assign(Object.assign({},x),{id:l}),w),p==="RELEASE"&&(s.removeEventListener("message",a),dl(s),ja in n&&typeof n[ja]=="function"&&n[ja]())}).catch(g=>{const[x,w]=Cn({value:new TypeError("Unserializable return value"),[Dn]:0});s.postMessage(Object.assign(Object.assign({},x),{id:l}),w)})}),s.start&&s.start()}function $m(n){return n.constructor.name==="MessagePort"}function dl(n){$m(n)&&n.close()}function Ha(n,s){return Wa(n,[],s)}function In(n){if(n)throw new Error("Proxy has been released and is not useable")}function ul(n){return Ys(n,{type:"RELEASE"}).then(()=>{dl(n)})}const An=new WeakMap,qn="FinalizationRegistry"in globalThis&&new FinalizationRegistry(n=>{const s=(An.get(n)||0)-1;An.set(n,s),s===0&&ul(n)});function jm(n,s){const r=(An.get(s)||0)+1;An.set(s,r),qn&&qn.register(n,s,n)}function Hm(n){qn&&qn.unregister(n)}function Wa(n,s=[],r=function(){}){let a=!1;const o=new Proxy(r,{get(l,p){if(In(a),p===Pm)return()=>{Hm(o),ul(n),a=!0};if(p==="then"){if(s.length===0)return{then:()=>o};const d=Ys(n,{type:"GET",path:s.map(m=>m.toString())}).then(Ns);return d.then.bind(d)}return Wa(n,[...s,p])},set(l,p,d){In(a);const[m,_]=Cn(d);return Ys(n,{type:"SET",path:[...s,p].map(g=>g.toString()),value:m},_).then(Ns)},apply(l,p,d){In(a);const m=s[s.length-1];if(m===Rm)return Ys(n,{type:"ENDPOINT"}).then(Ns);if(m==="bind")return Wa(n,s.slice(0,-1));const[_,g]=ml(d);return Ys(n,{type:"APPLY",path:s.map(x=>x.toString()),argumentList:_},g).then(Ns)},construct(l,p){In(a);const[d,m]=ml(p);return Ys(n,{type:"CONSTRUCT",path:s.map(_=>_.toString()),argumentList:d},m).then(Ns)}});return jm(o,n),o}function Wm(n){return Array.prototype.concat.apply([],n)}function ml(n){const s=n.map(Cn);return[s.map(r=>r[0]),Wm(s.map(r=>r[1]))]}const yl=new WeakMap;function Gm(n,s){return yl.set(n,s),n}function Ga(n){return Object.assign(n,{[ol]:!0})}function Cn(n){for(const[s,r]of cl)if(r.canHandle(n)){const[a,o]=r.serialize(n);return[{type:"HANDLER",name:s,value:a},o]}return[{type:"RAW",value:n},yl.get(n)||[]]}function Ns(n){switch(n.type){case"HANDLER":return cl.get(n.name).deserialize(n.value);case"RAW":return n.value}}function Ys(n,s,r){return new Promise(a=>{const o=Xm();n.addEventListener("message",function l(p){!p.data||!p.data.id||p.data.id!==o||(n.removeEventListener("message",l),a(p.data))}),n.start&&n.start(),n.postMessage(Object.assign({id:o},s),r)})}function Xm(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const _l=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-DwpQi_P7.js").href:new URL("assets/scriptsRunWorker-DwpQi_P7.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:cn&&cn.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Run MineScript Server"});_l.onerror=n=>{console.error(n)};async function fl(n){return await vn.setInlayHints(n)}const gl=Ha(_l),bl=Ha(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-DurfrCeu.js").href:new URL("assets/parserTccWorker-DurfrCeu.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:cn&&cn.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Parser MineScript Server"}));async function xl(n,s=!1,r=Bt){r=Bt;const a=await fs(r);if(!a)return;const{functions:o,types:l,constants:p,variables:d,methods:m}=a.KEY_MAP_LIST;return await bl.parseTcc(n,s,Ga(fl),{functions:Object.fromEntries(o),methods:Object.fromEntries(m),types:Object.fromEntries(l),constants:Object.fromEntries(p),variables:Object.fromEntries(d)},r)}async function Vm(n,s){const r=await fs(5);if(!r)return;const{functions:a,types:o,constants:l,variables:p,methods:d}=r.KEY_MAP_LIST;return await bl.parseLibraryCode(n,s,Ga(fl),{functions:Object.fromEntries(a),methods:Object.fromEntries(d),types:Object.fromEntries(o),constants:Object.fromEntries(l),variables:Object.fromEntries(p)})}async function Ym(n,s,r=!0,a=Bt){return await gl.runScript(n,s,r,Bt)}async function Zm(n){return await gl.removeScript(n)}function Qm(n){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-BxEYBjj-.js").href:new URL("assets/editor.worker-BxEYBjj-.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{type:"module",name:n?.name})}const{slice:Jm,forEach:ey}=[];function ty(n){return ey.call(Jm.call(arguments,1),s=>{if(s)for(const r in s)n[r]===void 0&&(n[r]=s[r])}),n}const hl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,sy=(n,s,r)=>{const a=r||{};a.path=a.path||"/";const o=encodeURIComponent(s);let l=`${n}=${o}`;if(a.maxAge>0){const p=a.maxAge-0;if(Number.isNaN(p))throw new Error("maxAge should be a Number");l+=`; Max-Age=${Math.floor(p)}`}if(a.domain){if(!hl.test(a.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${a.domain}`}if(a.path){if(!hl.test(a.path))throw new TypeError("option path is invalid");l+=`; Path=${a.path}`}if(a.expires){if(typeof a.expires.toUTCString!="function")throw new TypeError("option expires is invalid");l+=`; Expires=${a.expires.toUTCString()}`}if(a.httpOnly&&(l+="; HttpOnly"),a.secure&&(l+="; Secure"),a.sameSite)switch(typeof a.sameSite=="string"?a.sameSite.toLowerCase():a.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return l},wl={create(n,s,r,a){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),a&&(o.domain=a),document.cookie=sy(n,encodeURIComponent(s),o)},read(n){const s=`${n}=`,r=document.cookie.split(";");for(let a=0;a<r.length;a++){let o=r[a];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(s)===0)return o.substring(s.length,o.length)}return null},remove(n){this.create(n,"",-1)}};var ry={name:"cookie",lookup(n){let{lookupCookie:s}=n;if(s&&typeof document<"u")return wl.read(s)||void 0},cacheUserLanguage(n,s){let{lookupCookie:r,cookieMinutes:a,cookieDomain:o,cookieOptions:l}=s;r&&typeof document<"u"&&wl.create(r,n,a,o,l)}},ny={name:"querystring",lookup(n){let{lookupQuerystring:s}=n,r;if(typeof window<"u"){let{search:a}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(a=window.location.hash.substring(window.location.hash.indexOf("?")));const l=a.substring(1).split("&");for(let p=0;p<l.length;p++){const d=l[p].indexOf("=");d>0&&l[p].substring(0,d)===s&&(r=l[p].substring(d+1))}}return r}};let Lr=null;const vl=()=>{if(Lr!==null)return Lr;try{Lr=window!=="undefined"&&window.localStorage!==null;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{Lr=!1}return Lr};var ay={name:"localStorage",lookup(n){let{lookupLocalStorage:s}=n;if(s&&vl())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(n,s){let{lookupLocalStorage:r}=s;r&&vl()&&window.localStorage.setItem(r,n)}};let Mr=null;const Tl=()=>{if(Mr!==null)return Mr;try{Mr=window!=="undefined"&&window.sessionStorage!==null;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{Mr=!1}return Mr};var iy={name:"sessionStorage",lookup(n){let{lookupSessionStorage:s}=n;if(s&&Tl())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(n,s){let{lookupSessionStorage:r}=s;r&&Tl()&&window.sessionStorage.setItem(r,n)}},oy={name:"navigator",lookup(n){const s=[];if(typeof navigator<"u"){const{languages:r,userLanguage:a,language:o}=navigator;if(r)for(let l=0;l<r.length;l++)s.push(r[l]);a&&s.push(a),o&&s.push(o)}return s.length>0?s:void 0}},ly={name:"htmlTag",lookup(n){let{htmlTag:s}=n,r;const a=s||(typeof document<"u"?document.documentElement:null);return a&&typeof a.getAttribute=="function"&&(r=a.getAttribute("lang")),r}},cy={name:"path",lookup(n){let{lookupFromPathIndex:s}=n;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof s=="number"?s:0]?.replace("/",""):void 0}},py={name:"subdomain",lookup(n){let{lookupFromSubdomainIndex:s}=n;const r=typeof s=="number"?s+1:1,a=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(a)return a[r]}};function dy(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n}}class kl{constructor(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(s,r)}init(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=s||{languageUtils:{}},this.options=ty(r,this.options||{},dy()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=a,this.addDetector(ry),this.addDetector(ny),this.addDetector(ay),this.addDetector(iy),this.addDetector(oy),this.addDetector(ly),this.addDetector(cy),this.addDetector(py)}addDetector(s){return this.detectors[s.name]=s,this}detect(s){s||(s=this.options.order);let r=[];return s.forEach(a=>{if(this.detectors[a]){let o=this.detectors[a].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(r=r.concat(o))}}),r=r.map(a=>this.options.convertDetectedLanguage(a)),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(s,r){r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(s)>-1||r.forEach(a=>{this.detectors[a]&&this.detectors[a].cacheUserLanguage(s,this.options)}))}}kl.type="languageDetector";const uy=(...n)=>{console?.warn&&(Ss(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),console.warn(...n))},Dl={},Xa=(...n)=>{Ss(n[0])&&Dl[n[0]]||(Ss(n[0])&&(Dl[n[0]]=new Date),uy(...n))},Il=(n,s)=>()=>{if(n.isInitialized)s();else{const r=()=>{setTimeout(()=>{n.off("initialized",r)},0),s()};n.on("initialized",r)}},Va=(n,s,r)=>{n.loadNamespaces(s,Il(n,r))},Al=(n,s,r,a)=>{if(Ss(r)&&(r=[r]),n.options.preload&&n.options.preload.indexOf(s)>-1)return Va(n,r,a);r.forEach(o=>{n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),n.loadLanguages(s,Il(n,a))},my=(n,s,r={})=>!s.languages||!s.languages.length?(Xa("i18n.languages were undefined or empty",s.languages),!0):s.hasLoadedNamespace(n,{lng:r.lng,precheck:(a,o)=>{if(r.bindI18n?.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!o(a.isLanguageChangingTo,n))return!1}}),Ss=n=>typeof n=="string",yy=n=>typeof n=="object"&&n!==null,_y=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,fy={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},gy=n=>fy[n];let Ya={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:n=>n.replace(_y,gy)};const by=(n={})=>{Ya={...Ya,...n}},xy=()=>Ya;let ql;const hy=n=>{ql=n},wy=()=>ql,vy={type:"3rdParty",init(n){by(n.options.react),hy(n)}},Ty=I.createContext();class ky{constructor(){this.usedNamespaces={}}addUsedNamespaces(s){s.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Dy=(n,s)=>{const r=I.useRef();return I.useEffect(()=>{r.current=s?r.current:n},[n,s]),r.current},Cl=(n,s,r,a)=>n.getFixedT(s,r,a),Iy=(n,s,r,a)=>I.useCallback(Cl(n,s,r,a),[n,s,r,a]),Zs=(n,s={})=>{const{i18n:r}=s,{i18n:a,defaultNS:o}=I.useContext(Ty)||{},l=r||a||wy();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new ky),!l){Xa("You will need to pass in an i18next instance by using initReactI18next");const j=(P,q)=>Ss(q)?q:yy(q)&&Ss(q.defaultValue)?q.defaultValue:Array.isArray(P)?P[P.length-1]:P,W=[j,{},!1];return W.t=j,W.i18n={},W.ready=!1,W}l.options.react?.wait&&Xa("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const p={...xy(),...l.options.react,...s},{useSuspense:d,keyPrefix:m}=p;let _=n||o||l.options?.defaultNS;_=Ss(_)?[_]:_||["translation"],l.reportNamespaces.addUsedNamespaces?.(_);const g=(l.isInitialized||l.initializedStoreOnce)&&_.every(j=>my(j,l,p)),x=Iy(l,s.lng||null,p.nsMode==="fallback"?_:_[0],m),w=()=>x,C=()=>Cl(l,s.lng||null,p.nsMode==="fallback"?_:_[0],m),[L,K]=I.useState(w);let H=_.join();s.lng&&(H=`${s.lng}${H}`);const G=Dy(H),z=I.useRef(!0);I.useEffect(()=>{const{bindI18n:j,bindI18nStore:W}=p;z.current=!0,!g&&!d&&(s.lng?Al(l,s.lng,_,()=>{z.current&&K(C)}):Va(l,_,()=>{z.current&&K(C)})),g&&G&&G!==H&&z.current&&K(C);const P=()=>{z.current&&K(C)};return j&&l?.on(j,P),W&&l?.store.on(W,P),()=>{z.current=!1,l&&j?.split(" ").forEach(q=>l.off(q,P)),W&&l&&W.split(" ").forEach(q=>l.store.off(q,P))}},[l,H]),I.useEffect(()=>{z.current&&g&&K(w)},[l,m,g]);const re=[L,l,g];if(re.t=L,re.i18n=l,re.ready=g,g||!g&&!d)return re;throw new Promise(j=>{s.lng?Al(l,s.lng,_,()=>j()):Va(l,_,()=>j())})},Ay={type:"type",syntax:"syntax",overloads:"overloads",arguments:"arguments",fields:"fields",example:"example",returns:"returns",remarks:"remarks","see also":"see also","Copy code":"Copy code","Copy link":"Copy link",Copied:"Copied","Link copied":"Link copied",variables:"Variables",constants:"Constants",functions:"Functions",keywords:"Keywords",types:"Types",operators:"Operators",annotations:"Annotations",search:"Search","Mine Script® v1 Reference Manual":"Mine Script® v{{version}} Reference Manual","This script is read-only. It cannot be edited.":"This script is read-only. It cannot be edited.","save script":"Save script","open script":"Open script","find/replace":"Find/Replace","toggle console":"Toggle console","open editor in new tab":"Open editor in new tab","open editor in new window":"Open editor in new window",keyword:"keyword","built-in function":"built-in function","built-in variable":"built-in variable","built-in method":"built-in method","built-in type":"built-in type",annotation:"annotation","built-in constant":"built-in constant",namespace:"namespace","user-defined variable":"user-defined variable","user-defined type":"user-defined type",field:"field",enum:"enum","user-defined method":"user-defined method","user-defined function":"user-defined function",parameter:"parameter","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Mine functions, variables, and methods.","to trigger parameters hint":"to trigger parameters hint",library:"library","enum member":"enum member",Returns:"Returns",Syntax:"Syntax",Remarks:"Remarks",Fields:"Fields",Description:"Description",Example:"Example","Enum members":"Enum members",statement:"statement",loop:"loop","`click` on keyword for more help":"`click` on keyword for more help"},qy={type:"类型",syntax:"语法",overloads:"重载",arguments:"参数",fields:"字段",example:"例子",returns:"返回值",remarks:"备注","see also":"另见","Copy code":"复制代码","Copy link":"复制链接",Copied:"已复制","Link copied":"链接已复制",variables:"内置变量",constants:"常量",functions:"函数",keywords:"关键词",types:"类型",operators:"运算符",annotations:"注释",search:"搜索","Mine Script® v1 Reference Manual":"Mine Script™ v{{version}} 参考手册","This script is read-only. It cannot be edited.":"该脚本是只读的。它无法被编辑。","save script":"保存脚本","open script":"打开脚本","find/replace":"寻找/替换","toggle console":"切换控制台","open editor in new tab":"在新标签页中打开","open editor in new window":"在新窗口中打开",keyword:"关键词","built-in function":"内置函数","built-in variable":"内置变量","built-in method":"内置方法","built-in type":"内置类型",annotation:"注释","built-in constant":"内置常量",namespace:"命名空间","user-defined variable":"用户自定义变量","user-defined type":"用户自定义类型",field:"字段",enum:"枚举","user-defined method":"用户自定义方法","user-defined function":"用户自定义函数",parameter:"参数","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"命名空间是不可变的术语,充当标识符组的前缀。在命名Mine函数、变量和方法时,点和另一个术语始终遵循命名空间。","to trigger parameters hint":"触发参数提示",library:"脚本库","enum member":"枚举成员",Returns:"返回值",Syntax:"语法",Remarks:"备注",Fields:"字段",Description:"描述",Example:"例子","Enum members":"枚举成员",statement:"声明",loop:"循环","`click` on keyword for more help":"“点击”关键词以获得更多帮助"};Oe.use(kl).use(vy).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:Ay},zh:{translation:qy}}}),self.MonacoEnvironment={getWorker(){return new Qm({name:"Editor Worker"})}},Sa.config({paths:{vs:"https://www.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const Cy=(n,s)=>{const{height:r,width:a,theme:o,options:l,hasDiff:p,readOnly:d,defaultValue:m,language:_,onChange:g,onLinkOpen:x,onCursorPositionChange:w,onActionTrigger:C,onEditorDidMount:L,onVersionChange:K}=n,{t:H,i18n:G}=Zs(),z=I.useRef(null),re=I.useRef(null),j=I.useRef(!1),W=I.useRef(!1);I.useImperativeHandle(s,()=>({setOriginalScript(ae){z.current?.setOriginalScript(ae)},setScript(ae){z.current?.setValue(ae)},gotoLine(){z.current?.gotoLine()},getEditorLayout(){return z.current?.getEditorLayout()},setPosition(ae,De){z.current?.setPosition({column:ae,lineNumber:De})},setModelMarkers(ae){W.current=!0,z.current?.setModelMarkers(ae),setTimeout(()=>{W.current=!1},2e3)},focus(){z.current?.focus()}})),I.useEffect(()=>{p?z.current?.addDiffDecorations():z.current?.removeDiffDecorations()},[p]),I.useEffect(()=>{o&&Le.editor.setTheme(o)},[o]),I.useEffect(()=>{_&&G.changeLanguage(_)},[_]),I.useEffect(()=>{z.current?.updateActionTrigger(C)},[C]),I.useEffect(()=>{x&&z.current?.addLinkOpenFunc(x)},[x]);function P(ae,De){vn.setEditor(ae),z.current=new Fm(ae,De,C),x&&z.current?.addLinkOpenFunc(x),p&&z.current?.addDiffDecorations(),cm(ae),requestAnimationFrame(se);const X=ae.getValue();z.current.onChangeCursorPosition(w),g&&g(X),!d&&q(X),L&&L()}const q=I.useCallback(async ae=>{j.current=!1;const{errors:De,functions:X,methods:ie,types:Z,variables:le,overloadsFuncs:$,imports:J,enums:be}=await xl(ae,!1,Bt),ze=new Map(Object.entries(X)),_e=new Map(Object.entries(ie)),Be=new Map(Object.entries(Z)),Ge=new Map(Object.entries(le)),ot=new Map(Object.entries(J)),Je=new Map(Object.entries(be));gs.setUserDefined({functions:ze,methods:_e,types:Be,variables:Ge,imports:ot,enums:Je},$),Kt.setUserDefind(ze,Be,Ge,_e,Je);const Ye=De.map(xt=>({...xt,severity:xt.type||Le.MarkerSeverity.Error}));d||!j.current&&!W.current&&Ye.length&&z.current?.setModelMarkers(Ye)},[d]),Q=I.useMemo(()=>um.debounce(q,1500),[q]);function te(ae){if(d){q(ae||"");return}j.current=!0,vn.clearInlayHints(),z.current?.setModelMarkers([]),ae!==void 0&&(g&&g(ae),Q(ae))}const se=I.useCallback(()=>{const ae=re.current?.getBoundingClientRect();z.current?.setEditorLayout(ae?.height||0,ae?.width)},[]);return I.useEffect(()=>{const ae=()=>{window.requestAnimationFrame(se)},De=new ResizeObserver(ae);return re.current&&De.observe(re.current),()=>{re.current&&De.unobserve(re.current),De.disconnect(),z.current?.dispose()}},[]),T.jsx("div",{ref:re,children:T.jsx(Nu,{height:r,width:a||"100%",defaultLanguage:je,defaultValue:m||`indicator("我的脚本")
77
+ */const ol=Symbol("Comlink.proxy"),Rm=Symbol("Comlink.endpoint"),Pm=Symbol("Comlink.releaseProxy"),ja=Symbol("Comlink.finalizer"),Dn=Symbol("Comlink.thrown"),ll=n=>typeof n=="object"&&n!==null||typeof n=="function",Bm={canHandle:n=>ll(n)&&n[ol],serialize(n){const{port1:s,port2:r}=new MessageChannel;return pl(n,s),[r,[r]]},deserialize(n){return n.start(),Ha(n)}},Km={canHandle:n=>ll(n)&&Dn in n,serialize({value:n}){let s;return n instanceof Error?s={isError:!0,value:{message:n.message,name:n.name,stack:n.stack}}:s={isError:!1,value:n},[s,[]]},deserialize(n){throw n.isError?Object.assign(new Error(n.value.message),n.value):n.value}},cl=new Map([["proxy",Bm],["throw",Km]]);function Um(n,s){for(const r of n)if(s===r||r==="*"||r instanceof RegExp&&r.test(s))return!0;return!1}function pl(n,s=globalThis,r=["*"]){s.addEventListener("message",function a(o){if(!o||!o.data)return;if(!Um(r,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:l,type:p,path:d}=Object.assign({path:[]},o.data),m=(o.data.argumentList||[]).map(Ns);let _;try{const g=d.slice(0,-1).reduce((w,C)=>w[C],n),x=d.reduce((w,C)=>w[C],n);switch(p){case"GET":_=x;break;case"SET":g[d.slice(-1)[0]]=Ns(o.data.value),_=!0;break;case"APPLY":_=x.apply(g,m);break;case"CONSTRUCT":{const w=new x(...m);_=Ga(w)}break;case"ENDPOINT":{const{port1:w,port2:C}=new MessageChannel;pl(n,C),_=Gm(w,[w])}break;case"RELEASE":_=void 0;break;default:return}}catch(g){_={value:g,[Dn]:0}}Promise.resolve(_).catch(g=>({value:g,[Dn]:0})).then(g=>{const[x,w]=Cn(g);s.postMessage(Object.assign(Object.assign({},x),{id:l}),w),p==="RELEASE"&&(s.removeEventListener("message",a),dl(s),ja in n&&typeof n[ja]=="function"&&n[ja]())}).catch(g=>{const[x,w]=Cn({value:new TypeError("Unserializable return value"),[Dn]:0});s.postMessage(Object.assign(Object.assign({},x),{id:l}),w)})}),s.start&&s.start()}function $m(n){return n.constructor.name==="MessagePort"}function dl(n){$m(n)&&n.close()}function Ha(n,s){return Wa(n,[],s)}function In(n){if(n)throw new Error("Proxy has been released and is not useable")}function ul(n){return Ys(n,{type:"RELEASE"}).then(()=>{dl(n)})}const An=new WeakMap,qn="FinalizationRegistry"in globalThis&&new FinalizationRegistry(n=>{const s=(An.get(n)||0)-1;An.set(n,s),s===0&&ul(n)});function jm(n,s){const r=(An.get(s)||0)+1;An.set(s,r),qn&&qn.register(n,s,n)}function Hm(n){qn&&qn.unregister(n)}function Wa(n,s=[],r=function(){}){let a=!1;const o=new Proxy(r,{get(l,p){if(In(a),p===Pm)return()=>{Hm(o),ul(n),a=!0};if(p==="then"){if(s.length===0)return{then:()=>o};const d=Ys(n,{type:"GET",path:s.map(m=>m.toString())}).then(Ns);return d.then.bind(d)}return Wa(n,[...s,p])},set(l,p,d){In(a);const[m,_]=Cn(d);return Ys(n,{type:"SET",path:[...s,p].map(g=>g.toString()),value:m},_).then(Ns)},apply(l,p,d){In(a);const m=s[s.length-1];if(m===Rm)return Ys(n,{type:"ENDPOINT"}).then(Ns);if(m==="bind")return Wa(n,s.slice(0,-1));const[_,g]=ml(d);return Ys(n,{type:"APPLY",path:s.map(x=>x.toString()),argumentList:_},g).then(Ns)},construct(l,p){In(a);const[d,m]=ml(p);return Ys(n,{type:"CONSTRUCT",path:s.map(_=>_.toString()),argumentList:d},m).then(Ns)}});return jm(o,n),o}function Wm(n){return Array.prototype.concat.apply([],n)}function ml(n){const s=n.map(Cn);return[s.map(r=>r[0]),Wm(s.map(r=>r[1]))]}const yl=new WeakMap;function Gm(n,s){return yl.set(n,s),n}function Ga(n){return Object.assign(n,{[ol]:!0})}function Cn(n){for(const[s,r]of cl)if(r.canHandle(n)){const[a,o]=r.serialize(n);return[{type:"HANDLER",name:s,value:a},o]}return[{type:"RAW",value:n},yl.get(n)||[]]}function Ns(n){switch(n.type){case"HANDLER":return cl.get(n.name).deserialize(n.value);case"RAW":return n.value}}function Ys(n,s,r){return new Promise(a=>{const o=Xm();n.addEventListener("message",function l(p){!p.data||!p.data.id||p.data.id!==o||(n.removeEventListener("message",l),a(p.data))}),n.start&&n.start(),n.postMessage(Object.assign({id:o},s),r)})}function Xm(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const _l=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-DwpQi_P7.js").href:new URL("assets/scriptsRunWorker-DwpQi_P7.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:cn&&cn.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Run MineScript Server"});_l.onerror=n=>{console.error(n)};async function fl(n){return await vn.setInlayHints(n)}const gl=Ha(_l),bl=Ha(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-CrprNqMy.js").href:new URL("assets/parserTccWorker-CrprNqMy.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:cn&&cn.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Parser MineScript Server"}));async function xl(n,s=!1,r=Bt){r=Bt;const a=await fs(r);if(!a)return;const{functions:o,types:l,constants:p,variables:d,methods:m}=a.KEY_MAP_LIST;return await bl.parseTcc(n,s,Ga(fl),{functions:Object.fromEntries(o),methods:Object.fromEntries(m),types:Object.fromEntries(l),constants:Object.fromEntries(p),variables:Object.fromEntries(d)},r)}async function Vm(n,s){const r=await fs(5);if(!r)return;const{functions:a,types:o,constants:l,variables:p,methods:d}=r.KEY_MAP_LIST;return await bl.parseLibraryCode(n,s,Ga(fl),{functions:Object.fromEntries(a),methods:Object.fromEntries(d),types:Object.fromEntries(o),constants:Object.fromEntries(l),variables:Object.fromEntries(p)})}async function Ym(n,s,r=!0,a=Bt){return await gl.runScript(n,s,r,Bt)}async function Zm(n){return await gl.removeScript(n)}function Qm(n){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-BxEYBjj-.js").href:new URL("assets/editor.worker-BxEYBjj-.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{type:"module",name:n?.name})}const{slice:Jm,forEach:ey}=[];function ty(n){return ey.call(Jm.call(arguments,1),s=>{if(s)for(const r in s)n[r]===void 0&&(n[r]=s[r])}),n}const hl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,sy=(n,s,r)=>{const a=r||{};a.path=a.path||"/";const o=encodeURIComponent(s);let l=`${n}=${o}`;if(a.maxAge>0){const p=a.maxAge-0;if(Number.isNaN(p))throw new Error("maxAge should be a Number");l+=`; Max-Age=${Math.floor(p)}`}if(a.domain){if(!hl.test(a.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${a.domain}`}if(a.path){if(!hl.test(a.path))throw new TypeError("option path is invalid");l+=`; Path=${a.path}`}if(a.expires){if(typeof a.expires.toUTCString!="function")throw new TypeError("option expires is invalid");l+=`; Expires=${a.expires.toUTCString()}`}if(a.httpOnly&&(l+="; HttpOnly"),a.secure&&(l+="; Secure"),a.sameSite)switch(typeof a.sameSite=="string"?a.sameSite.toLowerCase():a.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return l},wl={create(n,s,r,a){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),a&&(o.domain=a),document.cookie=sy(n,encodeURIComponent(s),o)},read(n){const s=`${n}=`,r=document.cookie.split(";");for(let a=0;a<r.length;a++){let o=r[a];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(s)===0)return o.substring(s.length,o.length)}return null},remove(n){this.create(n,"",-1)}};var ry={name:"cookie",lookup(n){let{lookupCookie:s}=n;if(s&&typeof document<"u")return wl.read(s)||void 0},cacheUserLanguage(n,s){let{lookupCookie:r,cookieMinutes:a,cookieDomain:o,cookieOptions:l}=s;r&&typeof document<"u"&&wl.create(r,n,a,o,l)}},ny={name:"querystring",lookup(n){let{lookupQuerystring:s}=n,r;if(typeof window<"u"){let{search:a}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(a=window.location.hash.substring(window.location.hash.indexOf("?")));const l=a.substring(1).split("&");for(let p=0;p<l.length;p++){const d=l[p].indexOf("=");d>0&&l[p].substring(0,d)===s&&(r=l[p].substring(d+1))}}return r}};let Lr=null;const vl=()=>{if(Lr!==null)return Lr;try{Lr=window!=="undefined"&&window.localStorage!==null;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{Lr=!1}return Lr};var ay={name:"localStorage",lookup(n){let{lookupLocalStorage:s}=n;if(s&&vl())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(n,s){let{lookupLocalStorage:r}=s;r&&vl()&&window.localStorage.setItem(r,n)}};let Mr=null;const Tl=()=>{if(Mr!==null)return Mr;try{Mr=window!=="undefined"&&window.sessionStorage!==null;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{Mr=!1}return Mr};var iy={name:"sessionStorage",lookup(n){let{lookupSessionStorage:s}=n;if(s&&Tl())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(n,s){let{lookupSessionStorage:r}=s;r&&Tl()&&window.sessionStorage.setItem(r,n)}},oy={name:"navigator",lookup(n){const s=[];if(typeof navigator<"u"){const{languages:r,userLanguage:a,language:o}=navigator;if(r)for(let l=0;l<r.length;l++)s.push(r[l]);a&&s.push(a),o&&s.push(o)}return s.length>0?s:void 0}},ly={name:"htmlTag",lookup(n){let{htmlTag:s}=n,r;const a=s||(typeof document<"u"?document.documentElement:null);return a&&typeof a.getAttribute=="function"&&(r=a.getAttribute("lang")),r}},cy={name:"path",lookup(n){let{lookupFromPathIndex:s}=n;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof s=="number"?s:0]?.replace("/",""):void 0}},py={name:"subdomain",lookup(n){let{lookupFromSubdomainIndex:s}=n;const r=typeof s=="number"?s+1:1,a=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(a)return a[r]}};function dy(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n}}class kl{constructor(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(s,r)}init(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=s||{languageUtils:{}},this.options=ty(r,this.options||{},dy()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=a,this.addDetector(ry),this.addDetector(ny),this.addDetector(ay),this.addDetector(iy),this.addDetector(oy),this.addDetector(ly),this.addDetector(cy),this.addDetector(py)}addDetector(s){return this.detectors[s.name]=s,this}detect(s){s||(s=this.options.order);let r=[];return s.forEach(a=>{if(this.detectors[a]){let o=this.detectors[a].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(r=r.concat(o))}}),r=r.map(a=>this.options.convertDetectedLanguage(a)),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(s,r){r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(s)>-1||r.forEach(a=>{this.detectors[a]&&this.detectors[a].cacheUserLanguage(s,this.options)}))}}kl.type="languageDetector";const uy=(...n)=>{console?.warn&&(Ss(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),console.warn(...n))},Dl={},Xa=(...n)=>{Ss(n[0])&&Dl[n[0]]||(Ss(n[0])&&(Dl[n[0]]=new Date),uy(...n))},Il=(n,s)=>()=>{if(n.isInitialized)s();else{const r=()=>{setTimeout(()=>{n.off("initialized",r)},0),s()};n.on("initialized",r)}},Va=(n,s,r)=>{n.loadNamespaces(s,Il(n,r))},Al=(n,s,r,a)=>{if(Ss(r)&&(r=[r]),n.options.preload&&n.options.preload.indexOf(s)>-1)return Va(n,r,a);r.forEach(o=>{n.options.ns.indexOf(o)<0&&n.options.ns.push(o)}),n.loadLanguages(s,Il(n,a))},my=(n,s,r={})=>!s.languages||!s.languages.length?(Xa("i18n.languages were undefined or empty",s.languages),!0):s.hasLoadedNamespace(n,{lng:r.lng,precheck:(a,o)=>{if(r.bindI18n?.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!o(a.isLanguageChangingTo,n))return!1}}),Ss=n=>typeof n=="string",yy=n=>typeof n=="object"&&n!==null,_y=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,fy={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},gy=n=>fy[n];let Ya={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:n=>n.replace(_y,gy)};const by=(n={})=>{Ya={...Ya,...n}},xy=()=>Ya;let ql;const hy=n=>{ql=n},wy=()=>ql,vy={type:"3rdParty",init(n){by(n.options.react),hy(n)}},Ty=I.createContext();class ky{constructor(){this.usedNamespaces={}}addUsedNamespaces(s){s.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Dy=(n,s)=>{const r=I.useRef();return I.useEffect(()=>{r.current=s?r.current:n},[n,s]),r.current},Cl=(n,s,r,a)=>n.getFixedT(s,r,a),Iy=(n,s,r,a)=>I.useCallback(Cl(n,s,r,a),[n,s,r,a]),Zs=(n,s={})=>{const{i18n:r}=s,{i18n:a,defaultNS:o}=I.useContext(Ty)||{},l=r||a||wy();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new ky),!l){Xa("You will need to pass in an i18next instance by using initReactI18next");const j=(P,q)=>Ss(q)?q:yy(q)&&Ss(q.defaultValue)?q.defaultValue:Array.isArray(P)?P[P.length-1]:P,W=[j,{},!1];return W.t=j,W.i18n={},W.ready=!1,W}l.options.react?.wait&&Xa("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const p={...xy(),...l.options.react,...s},{useSuspense:d,keyPrefix:m}=p;let _=n||o||l.options?.defaultNS;_=Ss(_)?[_]:_||["translation"],l.reportNamespaces.addUsedNamespaces?.(_);const g=(l.isInitialized||l.initializedStoreOnce)&&_.every(j=>my(j,l,p)),x=Iy(l,s.lng||null,p.nsMode==="fallback"?_:_[0],m),w=()=>x,C=()=>Cl(l,s.lng||null,p.nsMode==="fallback"?_:_[0],m),[L,K]=I.useState(w);let H=_.join();s.lng&&(H=`${s.lng}${H}`);const G=Dy(H),z=I.useRef(!0);I.useEffect(()=>{const{bindI18n:j,bindI18nStore:W}=p;z.current=!0,!g&&!d&&(s.lng?Al(l,s.lng,_,()=>{z.current&&K(C)}):Va(l,_,()=>{z.current&&K(C)})),g&&G&&G!==H&&z.current&&K(C);const P=()=>{z.current&&K(C)};return j&&l?.on(j,P),W&&l?.store.on(W,P),()=>{z.current=!1,l&&j?.split(" ").forEach(q=>l.off(q,P)),W&&l&&W.split(" ").forEach(q=>l.store.off(q,P))}},[l,H]),I.useEffect(()=>{z.current&&g&&K(w)},[l,m,g]);const re=[L,l,g];if(re.t=L,re.i18n=l,re.ready=g,g||!g&&!d)return re;throw new Promise(j=>{s.lng?Al(l,s.lng,_,()=>j()):Va(l,_,()=>j())})},Ay={type:"type",syntax:"syntax",overloads:"overloads",arguments:"arguments",fields:"fields",example:"example",returns:"returns",remarks:"remarks","see also":"see also","Copy code":"Copy code","Copy link":"Copy link",Copied:"Copied","Link copied":"Link copied",variables:"Variables",constants:"Constants",functions:"Functions",keywords:"Keywords",types:"Types",operators:"Operators",annotations:"Annotations",search:"Search","Mine Script® v1 Reference Manual":"Mine Script® v{{version}} Reference Manual","This script is read-only. It cannot be edited.":"This script is read-only. It cannot be edited.","save script":"Save script","open script":"Open script","find/replace":"Find/Replace","toggle console":"Toggle console","open editor in new tab":"Open editor in new tab","open editor in new window":"Open editor in new window",keyword:"keyword","built-in function":"built-in function","built-in variable":"built-in variable","built-in method":"built-in method","built-in type":"built-in type",annotation:"annotation","built-in constant":"built-in constant",namespace:"namespace","user-defined variable":"user-defined variable","user-defined type":"user-defined type",field:"field",enum:"enum","user-defined method":"user-defined method","user-defined function":"user-defined function",parameter:"parameter","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Mine functions, variables, and methods.","to trigger parameters hint":"to trigger parameters hint",library:"library","enum member":"enum member",Returns:"Returns",Syntax:"Syntax",Remarks:"Remarks",Fields:"Fields",Description:"Description",Example:"Example","Enum members":"Enum members",statement:"statement",loop:"loop","`click` on keyword for more help":"`click` on keyword for more help"},qy={type:"类型",syntax:"语法",overloads:"重载",arguments:"参数",fields:"字段",example:"例子",returns:"返回值",remarks:"备注","see also":"另见","Copy code":"复制代码","Copy link":"复制链接",Copied:"已复制","Link copied":"链接已复制",variables:"内置变量",constants:"常量",functions:"函数",keywords:"关键词",types:"类型",operators:"运算符",annotations:"注释",search:"搜索","Mine Script® v1 Reference Manual":"Mine Script™ v{{version}} 参考手册","This script is read-only. It cannot be edited.":"该脚本是只读的。它无法被编辑。","save script":"保存脚本","open script":"打开脚本","find/replace":"寻找/替换","toggle console":"切换控制台","open editor in new tab":"在新标签页中打开","open editor in new window":"在新窗口中打开",keyword:"关键词","built-in function":"内置函数","built-in variable":"内置变量","built-in method":"内置方法","built-in type":"内置类型",annotation:"注释","built-in constant":"内置常量",namespace:"命名空间","user-defined variable":"用户自定义变量","user-defined type":"用户自定义类型",field:"字段",enum:"枚举","user-defined method":"用户自定义方法","user-defined function":"用户自定义函数",parameter:"参数","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"命名空间是不可变的术语,充当标识符组的前缀。在命名Mine函数、变量和方法时,点和另一个术语始终遵循命名空间。","to trigger parameters hint":"触发参数提示",library:"脚本库","enum member":"枚举成员",Returns:"返回值",Syntax:"语法",Remarks:"备注",Fields:"字段",Description:"描述",Example:"例子","Enum members":"枚举成员",statement:"声明",loop:"循环","`click` on keyword for more help":"“点击”关键词以获得更多帮助"};Oe.use(kl).use(vy).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:Ay},zh:{translation:qy}}}),self.MonacoEnvironment={getWorker(){return new Qm({name:"Editor Worker"})}},Sa.config({paths:{vs:"https://www.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const Cy=(n,s)=>{const{height:r,width:a,theme:o,options:l,hasDiff:p,readOnly:d,defaultValue:m,language:_,onChange:g,onLinkOpen:x,onCursorPositionChange:w,onActionTrigger:C,onEditorDidMount:L,onVersionChange:K}=n,{t:H,i18n:G}=Zs(),z=I.useRef(null),re=I.useRef(null),j=I.useRef(!1),W=I.useRef(!1);I.useImperativeHandle(s,()=>({setOriginalScript(ae){z.current?.setOriginalScript(ae)},setScript(ae){z.current?.setValue(ae)},gotoLine(){z.current?.gotoLine()},getEditorLayout(){return z.current?.getEditorLayout()},setPosition(ae,De){z.current?.setPosition({column:ae,lineNumber:De})},setModelMarkers(ae){W.current=!0,z.current?.setModelMarkers(ae),setTimeout(()=>{W.current=!1},2e3)},focus(){z.current?.focus()}})),I.useEffect(()=>{p?z.current?.addDiffDecorations():z.current?.removeDiffDecorations()},[p]),I.useEffect(()=>{o&&Le.editor.setTheme(o)},[o]),I.useEffect(()=>{_&&G.changeLanguage(_)},[_]),I.useEffect(()=>{z.current?.updateActionTrigger(C)},[C]),I.useEffect(()=>{x&&z.current?.addLinkOpenFunc(x)},[x]);function P(ae,De){vn.setEditor(ae),z.current=new Fm(ae,De,C),x&&z.current?.addLinkOpenFunc(x),p&&z.current?.addDiffDecorations(),cm(ae),requestAnimationFrame(se);const X=ae.getValue();z.current.onChangeCursorPosition(w),g&&g(X),!d&&q(X),L&&L()}const q=I.useCallback(async ae=>{j.current=!1;const{errors:De,functions:X,methods:ie,types:Z,variables:le,overloadsFuncs:$,imports:J,enums:be}=await xl(ae,!1,Bt),ze=new Map(Object.entries(X)),_e=new Map(Object.entries(ie)),Be=new Map(Object.entries(Z)),Ge=new Map(Object.entries(le)),ot=new Map(Object.entries(J)),Je=new Map(Object.entries(be));gs.setUserDefined({functions:ze,methods:_e,types:Be,variables:Ge,imports:ot,enums:Je},$),Kt.setUserDefind(ze,Be,Ge,_e,Je);const Ye=De.map(xt=>({...xt,severity:xt.type||Le.MarkerSeverity.Error}));d||!j.current&&!W.current&&Ye.length&&z.current?.setModelMarkers(Ye)},[d]),Q=I.useMemo(()=>um.debounce(q,1500),[q]);function te(ae){if(d){q(ae||"");return}j.current=!0,vn.clearInlayHints(),z.current?.setModelMarkers([]),ae!==void 0&&(g&&g(ae),Q(ae))}const se=I.useCallback(()=>{const ae=re.current?.getBoundingClientRect();z.current?.setEditorLayout(ae?.height||0,ae?.width)},[]);return I.useEffect(()=>{const ae=()=>{window.requestAnimationFrame(se)},De=new ResizeObserver(ae);return re.current&&De.observe(re.current),()=>{re.current&&De.unobserve(re.current),De.disconnect(),z.current?.dispose()}},[]),T.jsx("div",{ref:re,children:T.jsx(Nu,{height:r,width:a||"100%",defaultLanguage:je,defaultValue:m||`indicator("我的脚本")
78
78
  plot(close)
79
79
  `,theme:o||"vs-dark",className:`tvue-script ${o||"vs-dark"}`,options:{colorDecorators:!0,useShadowDOM:!1,matchOnWordStartOnly:!0,automaticLayout:!1,unicodeHighlight:{allowedCharacters:{" ":!0}},suggest:{filterGraceful:!0},fontSize:13,...d?Eu:{},readOnlyMessage:{value:H("This script is read-only. It cannot be edited.")},...l},onMount:P,onChange:te})})},zy=I.forwardRef(Cy),Ny=n=>{const{theme:s,modified:r,original:a,height:o,width:l,renderSideBySide:p=!0,version:d=5}=n,m=I.useCallback(async(_,g)=>{g.languages.register({id:je}),g.editor.defineTheme("vs-dark",Pa),g.editor.defineTheme("vs",Ra);const x=await hn(d);x&&(g.languages.setMonarchTokensProvider(je,x.LANGUAGE_MONARCH_TOKENS),g.languages.setLanguageConfiguration(je,x.CONFIGURATION))},[d]);return T.jsx(Iu,{height:o||"90vh",width:l||"100%",theme:s||"vs-dark",options:{readOnly:!0,renderSideBySide:p,scrollBeyondLastLine:!1},language:je,modified:r,original:a,onMount:m})};O.VMarkerSeverity=void 0,function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"}(O.VMarkerSeverity||(O.VMarkerSeverity={}));var zn={},Sy=function(){var n=document.getSelection();if(!n.rangeCount)return function(){};for(var s=document.activeElement,r=[],a=0;a<n.rangeCount;a++)r.push(n.getRangeAt(a));switch(s.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":s.blur();break;default:s=null;break}return n.removeAllRanges(),function(){n.type==="Caret"&&n.removeAllRanges(),n.rangeCount||r.forEach(function(o){n.addRange(o)}),s&&s.focus()}},Ey=Sy,zl={"text/plain":"Text","text/html":"Url",default:"Text"},Ly="Copy to clipboard: #{key}, Enter";function My(n){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return n.replace(/#{\s*key\s*}/g,s)}function Oy(n,s){var r,a,o,l,p,d,m=!1;s||(s={}),r=s.debug||!1;try{o=Ey(),l=document.createRange(),p=document.getSelection(),d=document.createElement("span"),d.textContent=n,d.ariaHidden="true",d.style.all="unset",d.style.position="fixed",d.style.top=0,d.style.clip="rect(0, 0, 0, 0)",d.style.whiteSpace="pre",d.style.webkitUserSelect="text",d.style.MozUserSelect="text",d.style.msUserSelect="text",d.style.userSelect="text",d.addEventListener("copy",function(g){if(g.stopPropagation(),s.format)if(g.preventDefault(),typeof g.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var x=zl[s.format]||zl.default;window.clipboardData.setData(x,n)}else g.clipboardData.clearData(),g.clipboardData.setData(s.format,n);s.onCopy&&(g.preventDefault(),s.onCopy(g.clipboardData))}),document.body.appendChild(d),l.selectNodeContents(d),p.addRange(l);var _=document.execCommand("copy");if(!_)throw new Error("copy command was unsuccessful");m=!0}catch(g){r&&console.error("unable to copy using execCommand: ",g),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",n),s.onCopy&&s.onCopy(window.clipboardData),m=!0}catch(x){r&&console.error("unable to copy using clipboardData: ",x),r&&console.error("falling back to prompt"),a=My("message"in s?s.message:Ly),window.prompt(a,n)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(l):p.removeAllRanges()),d&&document.body.removeChild(d),o()}return m}var Fy=Oy;function Za(n){"@babel/helpers - typeof";return Za=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},Za(n)}Object.defineProperty(zn,"__esModule",{value:!0}),zn.CopyToClipboard=void 0;var Nn=Nl(I),Ry=Nl(Fy),Py=["text","onCopy","options","children"];function Nl(n){return n&&n.__esModule?n:{default:n}}function Sl(n,s){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);s&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),r.push.apply(r,a)}return r}function El(n){for(var s=1;s<arguments.length;s++){var r=arguments[s]!=null?arguments[s]:{};s%2?Sl(Object(r),!0).forEach(function(a){Ja(n,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):Sl(Object(r)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(r,a))})}return n}function By(n,s){if(n==null)return{};var r=Ky(n,s),a,o;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(n);for(o=0;o<l.length;o++)a=l[o],!(s.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(n,a)&&(r[a]=n[a])}return r}function Ky(n,s){if(n==null)return{};var r={},a=Object.keys(n),o,l;for(l=0;l<a.length;l++)o=a[l],!(s.indexOf(o)>=0)&&(r[o]=n[o]);return r}function Uy(n,s){if(!(n instanceof s))throw new TypeError("Cannot call a class as a function")}function Ll(n,s){for(var r=0;r<s.length;r++){var a=s[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(n,a.key,a)}}function $y(n,s,r){return s&&Ll(n.prototype,s),r&&Ll(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n}function jy(n,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(s&&s.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),s&&Qa(n,s)}function Qa(n,s){return Qa=Object.setPrototypeOf||function(a,o){return a.__proto__=o,a},Qa(n,s)}function Hy(n){var s=Gy();return function(){var a=Sn(n),o;if(s){var l=Sn(this).constructor;o=Reflect.construct(a,arguments,l)}else o=a.apply(this,arguments);return Wy(this,o)}}function Wy(n,s){if(s&&(Za(s)==="object"||typeof s=="function"))return s;if(s!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ml(n)}function Ml(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Gy(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sn(n){return Sn=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Sn(n)}function Ja(n,s,r){return s in n?Object.defineProperty(n,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[s]=r,n}var Ol=function(n){jy(r,n);var s=Hy(r);function r(){var a;Uy(this,r);for(var o=arguments.length,l=new Array(o),p=0;p<o;p++)l[p]=arguments[p];return a=s.call.apply(s,[this].concat(l)),Ja(Ml(a),"onClick",function(d){var m=a.props,_=m.text,g=m.onCopy,x=m.children,w=m.options,C=Nn.default.Children.only(x),L=(0,Ry.default)(_,w);g&&g(_,L),C&&C.props&&typeof C.props.onClick=="function"&&C.props.onClick(d)}),a}return $y(r,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var l=o.children,p=By(o,Py),d=Nn.default.Children.only(l);return Nn.default.cloneElement(d,El(El({},p),{},{onClick:this.onClick}))}}]),r}(Nn.default.PureComponent);zn.CopyToClipboard=Ol,Ja(Ol,"defaultProps",{onCopy:void 0,options:void 0});var Xy=zn,ei=Xy.CopyToClipboard;ei.CopyToClipboard=ei;var Vy=ei;const Qs=Td(Vy);Le.languages.register({id:je}),Le.editor.defineTheme("vs-dark",Pa),Le.editor.defineTheme("vs",Ra);async function ti(n){const s=await hn(n);s&&(Le.languages.setMonarchTokensProvider(je,s.LANGUAGE_MONARCH_TOKENS),Le.languages.setLanguageConfiguration(je,s.CONFIGURATION))}async function Fl(n,s,r){return s&&Le.editor.setTheme(s.includes("dark")?"vs-dark":"light"),r&&await ti(r),await Le.editor.colorize(n,je,{tabSize:4})}async function si(n,s=0){const r=n[s];if(!r)return;const{name:a,args:o,type:l,desc:p,examples:d,remarks:m,seeAlso:_,syntax:g,detailedDesc:x,fields:w,returns:C}=r,L={name:a,orirginalName:a};if(n.length>1&&(L.overloads=`${n.length} ${Oe.t("overloads")}`),l&&(L.type=l),o&&(L.name=`${a}()`,L.args=o.map(K=>{const{name:H,desc:G,displayType:z}=K;return{label:`${H} (${z})`,desc:G&&Es(G)}})),p&&(L.desc=p.map(K=>Es(K))),d&&(L.originalExample=d.join(`
80
80
  `),L.examples=await Le.editor.colorize(L.originalExample,je,{tabSize:4})),x){L.detailedDesc=[];for(const K of x){const{desc:H,examples:G}=K;let z=H.map(W=>Es(W)),re,j;G&&(j=G.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guihz/trading-vue-editor-tes",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "lib"