diff --git a/.gitignore b/.gitignore
index 63b99dd..5042cf5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,4 +2,12 @@
*.xcarchive
**/xcuserdata/**
-Pods/
\ No newline at end of file
+Pods/
+
+.DS_Store
+/.build
+/Packages
+/*.xcodeproj
+xcuserdata/
+DerivedData/
+.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
diff --git a/Example/LightweightCharts.xcodeproj/project.pbxproj b/Example/LightweightCharts.xcodeproj/project.pbxproj
index 8d9af53..dd581c9 100644
--- a/Example/LightweightCharts.xcodeproj/project.pbxproj
+++ b/Example/LightweightCharts.xcodeproj/project.pbxproj
@@ -417,7 +417,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"error: SwiftLint does not exist, install it using brew install swiftlint\"\n exit 1\nfi\n";
+ shellScript = "#if which swiftlint >/dev/null; then\n # swiftlint\n#else\n # echo \"error: SwiftLint does not exist, install it using brew #install swiftlint\"\n #exit 1\n#fi\n";
};
DA29DE437F7165F7E6B7BF21 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
diff --git a/Example/LightweightCharts.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/LightweightCharts.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/Example/LightweightCharts.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/Example/Podfile.lock b/Example/Podfile.lock
index 1af15a2..5478ecf 100644
--- a/Example/Podfile.lock
+++ b/Example/Podfile.lock
@@ -9,7 +9,7 @@ EXTERNAL SOURCES:
:path: "../"
SPEC CHECKSUMS:
- LightweightCharts: f4f71d444412003d793ba5dee4c38dc7aea66097
+ LightweightCharts: 1a6c10a3eccb065f3a270dd0c26515ca714f786a
PODFILE CHECKSUM: 10aa45b030d82b96cfc0e4e3b143c5488576107b
diff --git a/LightweightCharts.podspec b/LightweightCharts.podspec
index 2e9128b..a8b8dcb 100644
--- a/LightweightCharts.podspec
+++ b/LightweightCharts.podspec
@@ -9,22 +9,8 @@ Pod::Spec.new do |s|
s.author = { 'TradingView, Inc.' => 'noreply@tradingview.com' }
s.source = { :git => 'https://github.com/tradingview/LightweightChartsIOS.git', :tag => s.version }
s.ios.deployment_target = '10.0'
- s.source_files = 'LightweightCharts/**/*.swift'
- s.resources = 'LightweightCharts/Assets/*'
+ s.source_files = 'Sources/LightweightCharts/**/*.swift'
+ s.resources = 'Sources/LightweightCharts/Assets/*'
s.swift_version = '5.0'
-
- s.script_phase = {
- :name => 'LightweightCharts',
-
- :script => 'LIBRARY=${TEMP_DIR}/lightweight-charts.js
-
-if [ "${CONFIGURATION}" = "Release" ]; then
- curl -o $LIBRARY https://unpkg.com/lightweight-charts@3.6.1/dist/lightweight-charts.standalone.production.js
-else
- curl -o $LIBRARY https://unpkg.com/lightweight-charts@3.6.1/dist/lightweight-charts.standalone.development.js
-fi
-
-cp -f $LIBRARY ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/lightweight-charts.js'
- }
end
diff --git a/LightweightCharts/Assets/.gitkeep b/LightweightCharts/Assets/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/LightweightCharts/Classes/.gitkeep b/LightweightCharts/Classes/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/Package.swift b/Package.swift
new file mode 100644
index 0000000..58756d2
--- /dev/null
+++ b/Package.swift
@@ -0,0 +1,28 @@
+// swift-tools-version:5.5
+// The swift-tools-version declares the minimum version of Swift required to build this package.
+
+import PackageDescription
+
+let package = Package(
+ name: "LightweightCharts",
+ platforms: [
+ .iOS(.v10)
+ ],
+ products: [
+ .library(
+ name: "LightweightCharts",
+ targets: ["LightweightCharts"]),
+ ],
+ dependencies: [],
+ targets: [
+ .target(
+ name: "LightweightCharts",
+ dependencies: [],
+ exclude: ["Extensions/Bundle+Resources.swift"],
+ resources: [
+ .process("Assets/content-setup.js"),
+ .process("Assets/lightweight-charts.js"),
+ .process("Assets/wrapper_functions.js")
+ ])
+ ]
+)
diff --git a/Sources/LightweightCharts/.gitignore b/Sources/LightweightCharts/.gitignore
new file mode 100644
index 0000000..bb460e7
--- /dev/null
+++ b/Sources/LightweightCharts/.gitignore
@@ -0,0 +1,7 @@
+.DS_Store
+/.build
+/Packages
+/*.xcodeproj
+xcuserdata/
+DerivedData/
+.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
diff --git a/LightweightCharts/Assets/content-setup.js b/Sources/LightweightCharts/Assets/content-setup.js
similarity index 100%
rename from LightweightCharts/Assets/content-setup.js
rename to Sources/LightweightCharts/Assets/content-setup.js
diff --git a/Sources/LightweightCharts/Assets/lightweight-charts.js b/Sources/LightweightCharts/Assets/lightweight-charts.js
new file mode 100644
index 0000000..298f64b
--- /dev/null
+++ b/Sources/LightweightCharts/Assets/lightweight-charts.js
@@ -0,0 +1,7 @@
+/*!
+ * @license
+ * TradingView Lightweight Charts v3.6.1
+ * Copyright (c) 2020 TradingView, Inc.
+ * Licensed under Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(){"use strict";var t,i;function n(t,i){var n,h=((n={})[0]=[],n[1]=[t.lineWidth,t.lineWidth],n[2]=[2*t.lineWidth,2*t.lineWidth],n[3]=[6*t.lineWidth,6*t.lineWidth],n[4]=[t.lineWidth,4*t.lineWidth],n)[i];t.setLineDash(h)}function h(t,i,n,h){t.beginPath();var s=t.lineWidth%2?.5:0;t.moveTo(n,i+s),t.lineTo(h,i+s),t.stroke()}!function(t){t[t.Simple=0]="Simple",t[t.WithSteps=1]="WithSteps"}(t||(t={})),function(t){t[t.Solid=0]="Solid",t[t.Dotted=1]="Dotted",t[t.Dashed=2]="Dashed",t[t.LargeDashed=3]="LargeDashed",t[t.SparseDotted=4]="SparseDotted"}(i||(i={}));var s=function(t,i){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])})(t,i)};function r(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=t}s(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var e=function(){return(e=Object.assign||function(t){for(var i,n=1,h=arguments.length;n=i.from;--s){var r=n.m[s];t.moveTo(r.p,r.g),t.arc(r.p,r.g,h,0,2*Math.PI)}t.fill()};t.fillStyle=n.k,h(n.N+2),t.fillStyle=n.S,h(n.N)}},i}(g);function k(){return{m:[{p:0,g:0,C:0,D:0}],S:"",k:"",N:0,M:null}}var x={from:0,to:1},N=function(){function t(t,i){this.T=new p,this.A=[],this.L=[],this.B=!0,this.O=t,this.F=i,this.T.i(this.A)}return t.prototype.V=function(t){var i=this.O.P();i.length!==this.A.length&&(this.L=i.map(k),this.A=this.L.map((function(t){var i=new y;return i._(t),i})),this.T.i(this.A)),this.B=!0},t.prototype.R=function(t,i,n){return this.B&&(this.I(t),this.B=!1),this.T},t.prototype.I=function(t){var i=this,n=this.O.P(),h=this.F.W(),s=this.O.j();n.forEach((function(n,r){var e,u=i.L[r],a=n.U(h);if(null!==a&&n.q()){var o=l(n.H());u.S=a.Y,u.N=a.N,u.m[0].D=a.D,u.m[0].g=n.$().K(a.D,o.X),u.k=null!==(e=a.Z)&&void 0!==e?e:i.O.J(u.m[0].g/t),u.m[0].C=h,u.m[0].p=s.G(h),u.M=x}else u.M=null}))},t}(),S=function(){function t(t){this.tt=t}return t.prototype.h=function(t,i,s,r){if(null!==this.tt){var e=this.tt.it.q,u=this.tt.nt.q;if(e||u){t.save();var a=Math.round(this.tt.p*i),o=Math.round(this.tt.g*i),l=Math.ceil(this.tt.ht*i),f=Math.ceil(this.tt.st*i);t.lineCap="butt",e&&a>=0&&(t.lineWidth=Math.floor(this.tt.it.rt*i),t.strokeStyle=this.tt.it.et,t.fillStyle=this.tt.it.et,n(t,this.tt.it.ut),function(t,i,n,h){t.beginPath();var s=t.lineWidth%2?.5:0;t.moveTo(i+s,n),t.lineTo(i+s,h),t.stroke()}(t,a,0,f)),u&&o>=0&&(t.lineWidth=Math.floor(this.tt.nt.rt*i),t.strokeStyle=this.tt.nt.et,t.fillStyle=this.tt.nt.et,n(t,this.tt.nt.ut),h(t,o,0,l)),t.restore()}}},t}(),C=function(){function t(t){this.B=!0,this.at={it:{rt:1,ut:0,et:"",q:!1},nt:{rt:1,ut:0,et:"",q:!1},ht:0,st:0,p:0,g:0},this.ot=new S(this.at),this.lt=t}return t.prototype.V=function(){this.B=!0},t.prototype.R=function(t,i){return this.B&&(this.I(),this.B=!1),this.ot},t.prototype.I=function(){var t=this.lt.q(),i=l(this.lt.ft()),n=i.vt().ct().crosshair,h=this.at;h.nt.q=t&&this.lt._t(i),h.it.q=t&&this.lt.dt(),h.nt.rt=n.horzLine.width,h.nt.ut=n.horzLine.style,h.nt.et=n.horzLine.color,h.it.rt=n.vertLine.width,h.it.ut=n.vertLine.style,h.it.et=n.vertLine.color,h.ht=i.wt(),h.st=i.Mt(),h.p=this.lt.bt(),h.g=this.lt.gt()},t}(),D={khaki:"#f0e68c",azure:"#f0ffff",aliceblue:"#f0f8ff",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",gray:"#808080",green:"#008000",honeydew:"#f0fff0",floralwhite:"#fffaf0",lightblue:"#add8e6",lightcoral:"#f08080",lemonchiffon:"#fffacd",hotpink:"#ff69b4",lightyellow:"#ffffe0",greenyellow:"#adff2f",lightgoldenrodyellow:"#fafad2",limegreen:"#32cd32",linen:"#faf0e6",lightcyan:"#e0ffff",magenta:"#f0f",maroon:"#800000",olive:"#808000",orange:"#ffa500",oldlace:"#fdf5e6",mediumblue:"#0000cd",transparent:"#0000",lime:"#0f0",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",midnightblue:"#191970",orchid:"#da70d6",mediumorchid:"#ba55d3",mediumturquoise:"#48d1cc",orangered:"#ff4500",royalblue:"#4169e1",powderblue:"#b0e0e6",red:"#f00",coral:"#ff7f50",turquoise:"#40e0d0",white:"#fff",whitesmoke:"#f5f5f5",wheat:"#f5deb3",teal:"#008080",steelblue:"#4682b4",bisque:"#ffe4c4",aquamarine:"#7fffd4",aqua:"#0ff",sienna:"#a0522d",silver:"#c0c0c0",springgreen:"#00ff7f",antiquewhite:"#faebd7",burlywood:"#deb887",brown:"#a52a2a",beige:"#f5f5dc",chocolate:"#d2691e",chartreuse:"#7fff00",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cadetblue:"#5f9ea0",tomato:"#ff6347",fuchsia:"#f0f",blue:"#00f",salmon:"#fa8072",blanchedalmond:"#ffebcd",slateblue:"#6a5acd",slategray:"#708090",thistle:"#d8bfd8",tan:"#d2b48c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",blueviolet:"#8a2be2",black:"#000",darkmagenta:"#8b008b",darkslateblue:"#483d8b",darkkhaki:"#bdb76b",darkorchid:"#9932cc",darkorange:"#ff8c00",darkgreen:"#006400",darkred:"#8b0000",dodgerblue:"#1e90ff",darkslategray:"#2f4f4f",dimgray:"#696969",deepskyblue:"#00bfff",firebrick:"#b22222",forestgreen:"#228b22",indigo:"#4b0082",ivory:"#fffff0",lavenderblush:"#fff0f5",feldspar:"#d19275",indianred:"#cd5c5c",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightskyblue:"#87cefa",lightslategray:"#789",lightslateblue:"#8470ff",snow:"#fffafa",lightseagreen:"#20b2aa",lightsalmon:"#ffa07a",darksalmon:"#e9967a",darkviolet:"#9400d3",mediumpurple:"#9370d8",mediumaquamarine:"#66cdaa",skyblue:"#87ceeb",lavender:"#e6e6fa",lightsteelblue:"#b0c4de",mediumvioletred:"#c71585",mintcream:"#f5fffa",navajowhite:"#ffdead",navy:"#000080",olivedrab:"#6b8e23",palevioletred:"#d87093",violetred:"#d02090",yellow:"#ff0",yellowgreen:"#9acd32",lawngreen:"#7cfc00",pink:"#ffc0cb",paleturquoise:"#afeeee",palegoldenrod:"#eee8aa",darkolivegreen:"#556b2f",darkseagreen:"#8fbc8f",darkturquoise:"#00ced1",peachpuff:"#ffdab9",deeppink:"#ff1493",violet:"#ee82ee",palegreen:"#98fb98",mediumseagreen:"#3cb371",peru:"#cd853f",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",purple:"#800080",seagreen:"#2e8b57",seashell:"#fff5ee",papayawhip:"#ffefd5",mediumslateblue:"#7b68ee",plum:"#dda0dd",mediumspringgreen:"#00fa9a"};function T(t){return t<0?0:t>255?255:Math.round(t)||0}function A(t){return t<=0||t>0?t<0?0:t>1?1:Math.round(1e4*t)/1e4:0}var L=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,E=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,B=/^rgb\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*\)$/,O=/^rgba\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?[\d]{0,10}(?:\.\d+)?)\s*\)$/;function F(t){var i;if((t=t.toLowerCase())in D&&(t=D[t]),i=O.exec(t)||B.exec(t))return[T(parseInt(i[1],10)),T(parseInt(i[2],10)),T(parseInt(i[3],10)),A(i.length<5?1:parseFloat(i[4]))];if(i=E.exec(t))return[T(parseInt(i[1],16)),T(parseInt(i[2],16)),T(parseInt(i[3],16)),1];if(i=L.exec(t))return[T(17*parseInt(i[1],16)),T(17*parseInt(i[2],16)),T(17*parseInt(i[3],16)),1];throw new Error("Cannot parse color: "+t)}function V(t){var i,n=F(t);return{yt:"rgb("+n[0]+", "+n[1]+", "+n[2]+")",kt:(i=n,.199*i[0]+.687*i[1]+.114*i[2]>160?"black":"white")}}function P(t,i,n,h,s,r){t.fillRect(i+r,n,h-2*r,r),t.fillRect(i+r,n+s-r,h-2*r,r),t.fillRect(i,n,r,s),t.fillRect(i+h-r,n,r,s)}function z(t,i,n){t.save(),t.scale(i,i),n(),t.restore()}function R(t,i,n,h,s,r){t.save(),t.globalCompositeOperation="copy",t.fillStyle=r,t.fillRect(i,n,h,s),t.restore()}function I(t,i,n,h,s,r,e){t.save(),t.globalCompositeOperation="copy";var u=t.createLinearGradient(0,0,0,s);u.addColorStop(0,r),u.addColorStop(1,e),t.fillStyle=u,t.fillRect(i,n,h,s),t.restore()}var W,j=function(){function t(t,i){this._(t,i)}return t.prototype._=function(t,i){this.tt=t,this.xt=i},t.prototype.h=function(t,i,n,h,s,r){if(this.tt.q){t.font=i.Nt;var e=this.tt.St||!this.tt.Ct?i.Dt:0,u=i.Tt,a=i.At,o=i.Lt,l=i.Et,f=i.Bt,c=this.tt.Ot,v=Math.ceil(n.Ft(t,c)),_=i.Vt,d=i.Pt+a+o,w=Math.ceil(.5*d),M=u+v+l+f+e,b=this.xt.zt;this.xt.Rt&&(b=this.xt.Rt);var m,p,g=(b=Math.round(b))-w,y=g+d,k="right"===s,x=k?h:0,N=Math.ceil(h*r),S=x;if(t.fillStyle=this.xt.yt,t.lineWidth=1,t.lineCap="butt",c){k?(m=x-e,p=(S=x-M)+f):(S=x+M,m=x+e,p=x+u+e+l);var C=Math.max(1,Math.floor(r)),D=Math.max(1,Math.floor(u*r)),T=k?N:0,A=Math.round(g*r),L=Math.round(S*r),E=Math.round(b*r)-Math.floor(.5*r),B=E+C+(E-A),O=Math.round(m*r);t.save(),t.beginPath(),t.moveTo(T,A),t.lineTo(L,A),t.lineTo(L,B),t.lineTo(T,B),t.fill(),t.fillStyle=this.tt.Z,t.fillRect(k?N-D:0,A,D,B-A),this.tt.St&&(t.fillStyle=this.xt.et,t.fillRect(T,E,O-T,C)),t.textAlign="left",t.fillStyle=this.xt.et,z(t,r,(function(){t.fillText(c,p,y-o-_)})),t.restore()}}},t.prototype.Mt=function(t,i){return this.tt.q?t.Pt+t.At+t.Lt:0},t}(),U=function(){function t(t){this.It={zt:0,et:"#FFF",yt:"#000"},this.Wt={Ot:"",q:!1,St:!0,Ct:!1,Z:""},this.jt={Ot:"",q:!1,St:!1,Ct:!0,Z:""},this.B=!0,this.Ut=new(t||j)(this.Wt,this.It),this.qt=new(t||j)(this.jt,this.It)}return t.prototype.Ot=function(){return this.Wt.Ot},t.prototype.zt=function(){return this.Ht(),this.It.zt},t.prototype.V=function(){this.B=!0},t.prototype.Mt=function(t,i){return void 0===i&&(i=!1),Math.max(this.Ut.Mt(t,i),this.qt.Mt(t,i))},t.prototype.Yt=function(){return this.It.Rt||0},t.prototype.Kt=function(t){this.It.Rt=t},t.prototype.$t=function(){return this.Ht(),this.Wt.q||this.jt.q},t.prototype.Xt=function(){return this.Ht(),this.Wt.q},t.prototype.R=function(t){return this.Ht(),this.Wt.St=this.Wt.St&&t.ct().drawTicks,this.jt.St=this.jt.St&&t.ct().drawTicks,this.Ut._(this.Wt,this.It),this.qt._(this.jt,this.It),this.Ut},t.prototype.Zt=function(){return this.Ht(),this.Ut._(this.Wt,this.It),this.qt._(this.jt,this.It),this.qt},t.prototype.Ht=function(){this.B&&(this.Wt.St=!0,this.jt.St=!1,this.Jt(this.Wt,this.jt,this.It))},t}(),q=function(t){function i(i,n,h){var s=t.call(this)||this;return s.lt=i,s.Gt=n,s.Qt=h,s}return r(i,t),i.prototype.Jt=function(t,i,n){t.q=!1;var h=this.lt.ct().horzLine;if(h.labelVisible){var s=this.Gt.H();if(this.lt.q()&&!this.Gt.ti()&&null!==s){var r=V(h.labelBackgroundColor);n.yt=r.yt,n.et=r.kt;var e=this.Qt(this.Gt);n.zt=e.zt,t.Ot=this.Gt.ii(e.D,s),t.q=!0}}},i}(U),H=/[1-9]/g,Y=function(){function t(){this.tt=null}return t.prototype._=function(t){this.tt=t},t.prototype.h=function(t,i,n){var h=this;if(null!==this.tt&&!1!==this.tt.q&&0!==this.tt.Ot.length){t.font=i.Nt;var s=Math.round(i.ni.Ft(t,this.tt.Ot,H));if(!(s<=0)){t.save();var r=i.hi,e=s+2*r,u=e/2,a=this.tt.wt,o=this.tt.zt,f=Math.floor(o-u)+.5;f<0?(o+=Math.abs(0-f),f=Math.floor(o-u)+.5):f+e>a&&(o-=Math.abs(a-(f+e)),f=Math.floor(o-u)+.5);var c=f+e,v=0+i.Tt+i.At+i.Pt+i.Lt;t.fillStyle=this.tt.yt;var _=Math.round(f*n),d=Math.round(0*n),w=Math.round(c*n),M=Math.round(v*n);t.fillRect(_,d,w-_,M-d);var b=Math.round(this.tt.zt*n),m=d,p=Math.round((m+i.Tt+i.Dt)*n);t.fillStyle=this.tt.et;var g=Math.max(1,Math.floor(n)),y=Math.floor(.5*n);t.fillRect(b-y,m,g,p-m);var k=v-i.Vt-i.Lt;t.textAlign="left",t.fillStyle=this.tt.et,z(t,n,(function(){t.fillText(l(h.tt).Ot,f+r,k)})),t.restore()}}},t}(),K=function(){function t(t,i,n){this.B=!0,this.ot=new Y,this.at={q:!1,yt:"#4c525e",et:"white",Ot:"",wt:0,zt:NaN},this.F=t,this.si=i,this.Qt=n}return t.prototype.V=function(){this.B=!0},t.prototype.R=function(){return this.B&&(this.I(),this.B=!1),this.ot._(this.at),this.ot},t.prototype.I=function(){var t=this.at;t.q=!1;var i=this.F.ct().vertLine;if(i.labelVisible){var n=this.si.j();if(!n.ti()){var h=n.ri(this.F.W());t.wt=n.wt();var s=this.Qt();if(s.C){t.zt=s.zt,t.Ot=n.ei(l(h)),t.q=!0;var r=V(i.labelBackgroundColor);t.yt=r.yt,t.et=r.kt}}}},t}(),$=function(){function t(){this.ui=null,this.ai=0}return t.prototype.oi=function(){return this.ai},t.prototype.li=function(t){this.ai=t},t.prototype.$=function(){return this.ui},t.prototype.fi=function(t){this.ui=t},t.prototype.ci=function(t,i){return[]},t.prototype.vi=function(t){return[]},t.prototype._i=function(){return[]},t.prototype.q=function(){return!0},t}();!function(t){t[t.Normal=0]="Normal",t[t.Magnet=1]="Magnet"}(W||(W={}));var X=function(t){function i(i,n){var h=t.call(this)||this;h.di=null,h.wi=NaN,h.Mi=0,h.bi=!0,h.mi=new Map,h.pi=!1,h.gi=NaN,h.yi=NaN,h.ki=NaN,h.xi=NaN,h.si=i,h.Ni=n,h.Si=new N(i,h);var s,r;h.Ci=(s=function(){return h.wi},r=function(){return h.yi},function(t){var i=r(),n=s();if(t===l(h.di).Di())return{D:n,zt:i};var e=l(t.H());return{D:t.Ti(i,e),zt:i}});var e=function(t,i){return function(){return{C:h.si.j().ri(t()),zt:i()}}}((function(){return h.Mi}),(function(){return h.bt()}));return h.Ai=new K(h,i,e),h.Li=new C(h),h}return r(i,t),i.prototype.ct=function(){return this.Ni},i.prototype.Ei=function(t,i){this.ki=t,this.xi=i},i.prototype.Bi=function(){this.ki=NaN,this.xi=NaN},i.prototype.Oi=function(){return this.ki},i.prototype.Fi=function(){return this.xi},i.prototype.Vi=function(t,i,n){this.pi||(this.pi=!0),this.bi=!0,this.Pi(t,i,n)},i.prototype.W=function(){return this.Mi},i.prototype.bt=function(){return this.gi},i.prototype.gt=function(){return this.yi},i.prototype.q=function(){return this.bi},i.prototype.zi=function(){this.bi=!1,this.Ri(),this.wi=NaN,this.gi=NaN,this.yi=NaN,this.di=null,this.Bi()},i.prototype.vi=function(t){return null!==this.di?[this.Li,this.Si]:[]},i.prototype._t=function(t){return t===this.di&&this.Ni.horzLine.visible},i.prototype.dt=function(){return this.Ni.vertLine.visible},i.prototype.ci=function(t,i){this.bi&&this.di===t||this.mi.clear();var n=[];return this.di===t&&n.push(this.Ii(this.mi,i,this.Ci)),n},i.prototype._i=function(){return this.bi?[this.Ai]:[]},i.prototype.ft=function(){return this.di},i.prototype.Wi=function(){this.Li.V(),this.mi.forEach((function(t){return t.V()})),this.Ai.V(),this.Si.V()},i.prototype.ji=function(t){return t&&!t.Di().ti()?t.Di():null},i.prototype.Pi=function(t,i,n){this.Ui(t,i,n)&&this.Wi()},i.prototype.Ui=function(t,i,n){var h=this.gi,s=this.yi,r=this.wi,e=this.Mi,u=this.di,a=this.ji(n);this.Mi=t,this.gi=isNaN(t)?NaN:this.si.j().G(t),this.di=n;var o=null!==a?a.H():null;return null!==a&&null!==o?(this.wi=i,this.yi=a.K(i,o)):(this.wi=NaN,this.yi=NaN),h!==this.gi||s!==this.yi||e!==this.Mi||r!==this.wi||u!==this.di},i.prototype.Ri=function(){var t=this.si.P().map((function(t){return t.Hi().qi()})).filter(b),i=0===t.length?null:Math.max.apply(Math,t);this.Mi=null!==i?i:NaN},i.prototype.Ii=function(t,i,n){var h=t.get(i);return void 0===h&&(h=new q(this,i,n),t.set(i,h)),h},i}($),Z=".";function J(t,i){if(!v(t))return"n/a";if(!_(i))throw new TypeError("invalid length");if(i<0||i>16)throw new TypeError("invalid length");if(0===i)return t.toString();return("0000000000000000"+t.toString()).slice(-i)}var G=function(){function t(t,i){if(i||(i=1),v(t)&&_(t)||(t=100),t<0)throw new TypeError("invalid base");this.Gt=t,this.Yi=i,this.Ki()}return t.prototype.format=function(t){var i=t<0?"−":"";return t=Math.abs(t),i+this.$i(t)},t.prototype.Ki=function(){if(this.Xi=0,this.Gt>0&&this.Yi>0)for(var t=this.Gt;t>1;)t/=10,this.Xi++},t.prototype.$i=function(t){var i=this.Gt/this.Yi,n=Math.floor(t),h="",s=void 0!==this.Xi?this.Xi:NaN;if(i>1){var r=+(Math.round(t*i)-n*i).toFixed(this.Xi);r>=i&&(r-=i,n+=1),h=Z+J(+r.toFixed(this.Xi)*this.Yi,s)}else n=Math.round(n*i)/i,s>0&&(h=Z+J(0,s));return n.toFixed(0)+h},t}(),Q=function(t){function i(i){return void 0===i&&(i=100),t.call(this,i)||this}return r(i,t),i.prototype.format=function(i){return t.prototype.format.call(this,i)+"%"},i}(G),tt=function(){function t(){this.Zi=[]}return t.prototype.Ji=function(t,i,n){var h={Gi:t,Qi:i,tn:!0===n};this.Zi.push(h)},t.prototype.nn=function(t){var i=this.Zi.findIndex((function(i){return t===i.Gi}));i>-1&&this.Zi.splice(i,1)},t.prototype.hn=function(t){this.Zi=this.Zi.filter((function(i){return i.Qi===t}))},t.prototype.sn=function(t,i){var n=u([],this.Zi,!0);this.Zi=this.Zi.filter((function(t){return!t.tn})),n.forEach((function(n){return n.Gi(t,i)}))},t.prototype.rn=function(){return this.Zi.length>0},t.prototype.en=function(){this.Zi=[]},t}(),it=function(){function t(t,i){this.un=t,this.an=i}return t.prototype.on=function(t){return null!==t&&(this.un===t.un&&this.an===t.an)},t.prototype.ln=function(){return new t(this.un,this.an)},t.prototype.fn=function(){return this.un},t.prototype.cn=function(){return this.an},t.prototype.vn=function(){return this.an-this.un},t.prototype.ti=function(){return this.an===this.un||Number.isNaN(this.an)||Number.isNaN(this.un)},t.prototype._n=function(i){return null===i?this:new t(Math.min(this.fn(),i.fn()),Math.max(this.cn(),i.cn()))},t.prototype.dn=function(t){if(v(t)&&0!==this.an-this.un){var i=.5*(this.an+this.un),n=this.an-i,h=this.un-i;n*=t,h*=t,this.an=i+n,this.un=i+h}},t.prototype.wn=function(t){v(t)&&(this.an+=t,this.un+=t)},t.prototype.Mn=function(){return{minValue:this.un,maxValue:this.an}},t.bn=function(i){return null===i?null:new t(i.minValue,i.maxValue)},t}();function nt(t,i,n){return Math.min(Math.max(t,i),n)}function ht(t,i,n){return i-t<=n}function st(t){return t<=0?NaN:Math.log(t)/Math.log(10)}function rt(t){var i=Math.ceil(t);return i%2!=0?i-1:i}function et(t){var i=Math.ceil(t);return i%2==0?i-1:i}function ut(t,i){var n=100*(t-i)/i;return i<0?-n:n}function at(t,i){var n=ut(t.fn(),i),h=ut(t.cn(),i);return new it(n,h)}function ot(t,i){var n=100*(t-i)/i+100;return i<0?-n:n}function lt(t,i){var n=ot(t.fn(),i),h=ot(t.cn(),i);return new it(n,h)}function ft(t){var i=Math.abs(t);if(i<1e-8)return 0;var n=st(i+1e-4)+4;return t<0?-n:n}function ct(t){var i=Math.abs(t);if(i<1e-8)return 0;var n=Math.pow(10,i-4)-1e-4;return t<0?-n:n}function vt(t){if(null===t)return null;var i=ft(t.fn()),n=ft(t.cn());return new it(i,n)}var _t,dt=function(){function t(t,i){if(this.mn=t,this.pn=i,function(t){if(t<0)return!1;for(var i=t;i>1;i/=10)if(i%10!=0)return!1;return!0}(this.mn))this.gn=[2,2.5,2];else{this.gn=[];for(var n=this.mn;1!==n;){if(n%2==0)this.gn.push(2),n/=2;else{if(n%5!=0)throw new Error("unexpected base");this.gn.push(2,2.5),n/=5}if(this.gn.length>100)throw new Error("something wrong with base")}}}return t.prototype.yn=function(t,i,n){for(var h,s,r,e=0===this.mn?0:1/this.mn,u=1e-9,a=Math.pow(10,Math.max(0,Math.ceil(st(t-i)))),o=0,l=this.pn[0];;){var f=ht(a,e,u)&&a>e+u,c=ht(a,n*l,u),v=ht(a,1,u);if(!(f&&c&&v))break;a/=l,l=this.pn[++o%this.pn.length]}if(a<=e+u&&(a=e),a=Math.max(1,a),this.gn.length>0&&(h=a,s=1,r=u,Math.abs(h-s)e+u;)a/=l,l=this.gn[++o%this.gn.length];return a},t}(),wt=function(){function t(t,i,n,h){this.kn=[],this.Gt=t,this.mn=i,this.xn=n,this.Nn=h}return t.prototype.yn=function(t,i){if(t=o?1:-1,v=null,_=0,d=a-(f+=f<0?l:0);d>o;d-=l){var w=this.Nn(d,i,!0);null!==v&&Math.abs(w-v)u||(_1)throw new Error("Invalid top margin - expect value between 0 and 1, given="+i);if(n<0||n>1||i+n>1)throw new Error("Invalid bottom margin - expect value between 0 and 1, given="+n);if(i+n>1)throw new Error("Invalid margins - sum of margins must be less than 1, given="+(i+n));this.ah(),this.Kn=null}},t.prototype.oh=function(){return this.Ni.autoScale},t.prototype.En=function(){return 1===this.Ni.mode},t.prototype.lh=function(){return 2===this.Ni.mode},t.prototype.fh=function(){return 3===this.Ni.mode},t.prototype.uh=function(){return{_h:this.Ni.autoScale,dh:this.Ni.invertScale,uh:this.Ni.mode}},t.prototype.eh=function(t){var i=this.uh(),n=null;void 0!==t._h&&(this.Ni.autoScale=t._h),void 0!==t.uh&&(this.Ni.mode=t.uh,2!==t.uh&&3!==t.uh||(this.Ni.autoScale=!0),this.zn.Rn=!1),1===i.uh&&t.uh!==i.uh&&(!function(t){if(null===t)return!1;var i=ct(t.fn()),n=ct(t.cn());return isFinite(i)&&isFinite(n)}(this.Vn)?this.Ni.autoScale=!0:null!==(n=function(t){if(null===t)return null;var i=ct(t.fn()),n=ct(t.cn());return new it(i,n)}(this.Vn))&&this.wh(n)),1===t.uh&&t.uh!==i.uh&&null!==(n=vt(this.Vn))&&this.wh(n);var h=i.uh!==this.Ni.mode;h&&(2===i.uh||this.lh())&&this.rh(),h&&(3===i.uh||this.fh())&&this.rh(),void 0!==t.dh&&i.dh!==t.dh&&(this.Ni.invertScale=t.dh,this.Mh()),this.qn.sn(i,this.uh())},t.prototype.bh=function(){return this.qn},t.prototype.Pt=function(){return this.Gn.fontSize},t.prototype.Mt=function(){return this.On},t.prototype.mh=function(t){this.On!==t&&(this.On=t,this.ah(),this.Kn=null)},t.prototype.ph=function(){if(this.Fn)return this.Fn;var t=this.Mt()-this.gh()-this.yh();return this.Fn=t,t},t.prototype.kh=function(){return this.xh(),this.Vn},t.prototype.wh=function(t,i){var n=this.Vn;(i||null===n&&null!==t||null!==n&&!n.on(t))&&(this.Kn=null,this.Vn=t)},t.prototype.ti=function(){return this.xh(),0===this.On||!this.Vn||this.Vn.ti()},t.prototype.Nh=function(t){return this.dh()?t:this.Mt()-1-t},t.prototype.K=function(t,i){return this.lh()?t=ut(t,i):this.fh()&&(t=ot(t,i)),this.nh(t,i)},t.prototype.Sh=function(t,i,n){this.xh();for(var h=this.yh(),s=l(this.kh()),r=s.fn(),e=s.cn(),u=this.ph()-1,a=this.dh(),o=u/(e-r),f=void 0===n?0:n.from,c=void 0===n?t.length:n.to,v=this.Ch(),_=f;_= left"),this.Ls=t,this.Es=i}return t.prototype.ss=function(){return this.Ls},t.prototype.rs=function(){return this.Es},t.prototype.Bs=function(){return this.Es-this.Ls+1},t.prototype.Os=function(t){return this.Ls<=t&&t<=this.Es},t.prototype.on=function(t){return this.Ls===t.ss()&&this.Es===t.rs()},t}();function Et(t,i){return null===t||null===i?t===i:t.on(i)}var Bt,Ot=function(){function t(){this.Fs=new Map,this.ks=null}return t.prototype.Vs=function(t){var i=this;this.ks=null,this.Fs.clear(),t.forEach((function(t,n){var h=i.Fs.get(t.Ps);void 0===h&&(h=[],i.Fs.set(t.Ps,h)),h.push({zs:n,C:t.C,Rs:t.Ps})}))},t.prototype.Is=function(t,i){var n=Math.ceil(i/t);return null!==this.ks&&this.ks.Ws===n||(this.ks={Bn:this.js(n),Ws:n}),this.ks.Bn},t.prototype.js=function(t){for(var i=[],n=0,h=Array.from(this.Fs.keys()).sort((function(t,i){return i-t}));n=t&&d-c>=t&&(i.push(_),c=d)}for(;uthis.Xs[this.Xs.length-1].C.Ds)return i?this.Xs.length-1:null;for(var n=0;ni/2?d.Wr=!1:d.Wr=this.Ni.fixLeftEdge&&v.zs<=u||this.Ni.fixRightEdge&&v.zs>=a,o++}}}return this.rr.length=o,this.sr=this.rr,this.rr},t.prototype.jr=function(){this.Qs=!0,this.dr(this.Ni.barSpacing),this.wr(this.Ni.rightOffset)},t.prototype.Ur=function(t){this.Qs=!0,this.$s=t,this.Ar(),this.vr()},t.prototype.qr=function(t,i){var n=this.Or(t),h=this.Pr(),s=h+i*(h/10);this.dr(s),this.Ni.rightBarStaysOnScroll||this.wr(this.Rr()+(n-this.Or(t)))},t.prototype.Wh=function(t){this.Xn&&this.Yh(),null===this.$n&&null===this.hr&&(this.ti()||(this.$n=t,this.Hr()))},t.prototype.jh=function(t){if(null!==this.hr){var i=nt(this.Ks-t,0,this.Ks),n=nt(this.Ks-l(this.$n),0,this.Ks);0!==i&&0!==n&&this.dr(this.hr.Pr*i/n)}},t.prototype.Uh=function(){null!==this.$n&&(this.$n=null,this.Yr())},t.prototype.qh=function(t){null===this.Xn&&null===this.hr&&(this.ti()||(this.Xn=t,this.Hr()))},t.prototype.Hh=function(t){if(null!==this.Xn){var i=(this.Xn-t)/this.Pr();this.er=l(this.hr).Rr+i,this.Qs=!0,this.Ar()}},t.prototype.Yh=function(){null!==this.Xn&&(this.Xn=null,this.Yr())},t.prototype.Kr=function(){this.$r(this.Ni.rightOffset)},t.prototype.$r=function(t,i){var n=this;if(void 0===i&&(i=400),!isFinite(t))throw new RangeError("offset is required and must be finite number");if(!isFinite(i)||i<=0)throw new RangeError("animationDuration (optional) must be finite positive number");var h=this.er,s=performance.now(),r=function(){var e=(performance.now()-s)/i,u=e>=1,a=u?t:h+(t-h)*e;n.wr(a),u||setTimeout(r,20)};r()},t.prototype.V=function(t){this.Qs=!0,this.Xs=t,this.Zs.Vs(t),this.Ar()},t.prototype.Xr=function(){return this.tr},t.prototype.Zr=function(){return this.ir},t.prototype.Jr=function(){return this.nr},t.prototype.Lr=function(){return this.$s||0},t.prototype.Gr=function(t){var i=t.Bs();this.zr(this.Ks/i),this.er=t.rs()-this.Lr(),this.Ar(),this.Qs=!0,this.si.Fr(),this.si.Vr()},t.prototype.Qr=function(){var t=this.kr(),i=this.Nr();null!==t&&null!==i&&this.Gr(new Lt(t,i+this.Ni.rightOffset))},t.prototype.te=function(t){var i=new Lt(t.from,t.to);this.Gr(i)},t.prototype.ei=function(t){return void 0!==this.Qn.timeFormatter?this.Qn.timeFormatter(t.Cs||t.Ds):this.ie.ls(new Date(1e3*t.Ds))},t.prototype.kr=function(){return 0===this.Xs.length?null:0},t.prototype.Nr=function(){return 0===this.Xs.length?null:this.Xs.length-1},t.prototype.ne=function(t){return(this.Ks-1-t)/this.ur},t.prototype.Or=function(t){var i=this.ne(t),n=this.Lr()+this.er-i;return Math.round(1e6*n)/1e6},t.prototype.zr=function(t){var i=this.ur;this.ur=t,this.Tr(),i!==this.ur&&(this.Qs=!0,this.he())},t.prototype.mr=function(){if(this.Qs)if(this.Qs=!1,this.ti())this.se(Ft.Ys());else{var t=this.Lr(),i=this.Ks/this.ur,n=this.er+t,h=new Lt(n-i+1,n);this.se(new Ft(h))}},t.prototype.Tr=function(){var t=this.re();if(this.uri&&(this.ur=i,this.Qs=!0)}},t.prototype.re=function(){return this.Ni.fixLeftEdge&&this.Ni.fixRightEdge&&0!==this.Xs.length?this.Ks/this.Xs.length:this.Ni.minBarSpacing},t.prototype.Ar=function(){var t=this.ee();this.er>t&&(this.er=t,this.Qs=!0);var i=this.ue();null!==i&&this.er=1e-15&&t<1?t.toFixed(this.De).replace(/\.?0+$/,""):String(t)).replace(/(\.[1-9]*)0+$/,(function(t,i){return i}))},t}();function Yt(t,i,n,h){if(0!==i.length){var s=i[h.from].p,r=i[h.from].g;t.moveTo(s,r);for(var e=h.from+1;ethis.v.M.from&&(t.lineTo(this.v.m[this.v.M.to-1].p,this.v.Le),t.lineTo(this.v.m[this.v.M.from].p,this.v.Le));t.closePath();var s=t.createLinearGradient(0,0,0,this.v.Le);s.addColorStop(0,this.v.Be),s.addColorStop(1,this.v.Oe),t.fillStyle=s,t.fill()}},i}(g),$t=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.v=null,i}return r(i,t),i.prototype._=function(t){this.v=t},i.prototype.u=function(t){if(null!==this.v&&0!==this.v.m.length&&null!==this.v.M){if(t.lineCap="butt",t.lineWidth=this.v.rt,n(t,this.v.ut),t.strokeStyle=this.v.S,t.lineJoin="round",t.beginPath(),1===this.v.m.length){var i=this.v.m[0];t.moveTo(i.p-this.v.Ae/2,i.g),t.lineTo(i.p+this.v.Ae/2,i.g)}else Yt(t,this.v.m,this.v.Ee,this.v.M);t.stroke()}},i}(g);function Xt(t,i,n,h,s){void 0===h&&(h=0),void 0===s&&(s=t.length);for(var r=s-h;0>1,u=h+e;n(t[u],i)?(h=u+1,r-=e+1):r=e}return h}function Zt(t,i,n,h,s){void 0===h&&(h=0),void 0===s&&(s=t.length);for(var r=s-h;0>1,u=h+e;n(i,t[u])?r=e:(h=u+1,r-=e+1)}return h}function Jt(t,i){return t.C0&&r=h&&(u=r-1),e>0&&e=2)Math.max(1,Math.floor(i))%2!=this.nu%2&&this.nu--;this.hu=this.tt.ru?Math.min(this.nu,Math.floor(i)):this.nu;for(var s=null,r=this.hu<=this.nu&&this.tt.Pr>=Math.floor(1.5*i),e=this.tt.M.from;ed+M-1&&(p=(g=d+M-1)-f+1),t.fillRect(m,p,l-m,g-p+1)}var y=o+b,k=Math.max(d,Math.round(u.Eh*i)-a),x=k+f-1;x>d+M-1&&(k=(x=d+M-1)-f+1),t.fillRect(c+1,k,y-c,x-k+1)}}}},t.prototype.su=function(t){var i=Math.floor(t);return Math.max(i,Math.floor(function(t,i){return Math.floor(.3*t*i)}(l(this.tt).Pr,t)))},t}(),si=function(t){function i(i,n){return t.call(this,i,n,!1)||this}return r(i,t),i.prototype.Xe=function(t,i,n){i.Er(this.ze,m(this.Re)),t.Dh(this.ze,n,m(this.Re))},i.prototype.uu=function(t,i,n){return{C:t,open:i.X[0],high:i.X[1],low:i.X[2],close:i.X[3],p:NaN,Th:NaN,Ah:NaN,Lh:NaN,Eh:NaN}},i.prototype.qe=function(){var t=this,i=this.Ie.Je();this.ze=this.Ie.Hi().Ge().map((function(n){return t.Qe(n.zs,n,i)}))},i}(ti),ri=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.ot=new hi,i}return r(i,t),i.prototype.R=function(t,i){if(!this.Ie.q())return null;var n=this.Ie.ct();this.Ue();var h={Hi:this.ze,Pr:this.We.j().Pr(),eu:n.openVisible,ru:n.thinBars,M:this.Re};return this.ot._(h),this.ot},i.prototype.Ye=function(){var t=this;this.ze.forEach((function(i){i.et=t.Ie.Je().ou(i.C).au}))},i.prototype.Qe=function(t,i,n){return e(e({},this.uu(t,i,n)),{et:n.ou(t).au})},i}(si),ei=function(){function t(){this.tt=null,this.nu=0}return t.prototype._=function(t){this.tt=t},t.prototype.h=function(t,i,n,h){if(null!==this.tt&&0!==this.tt.Hi.length&&null!==this.tt.M){if(this.nu=function(t,i){if(t>=2.5&&t<=4)return Math.floor(3*i);var n=1-.2*Math.atan(Math.max(4,t)-4)/(.5*Math.PI),h=Math.floor(t*n*i),s=Math.floor(t*i),r=Math.min(h,s);return Math.max(Math.floor(i),r)}(this.tt.Pr,i),this.nu>=2)Math.floor(i)%2!=this.nu%2&&this.nu--;var s=this.tt.Hi;this.tt.lu&&this.fu(t,s,this.tt.M,i),this.tt.cu&&this.vu(t,s,this.tt.M,this.tt.Pr,i);var r=this._u(i);(!this.tt.cu||this.nu>2*r)&&this.du(t,s,this.tt.M,i)}},t.prototype.fu=function(t,i,n,h){if(null!==this.tt){var s="",r=Math.min(Math.floor(h),Math.floor(this.tt.Pr*h));r=Math.max(Math.floor(h),Math.min(r,this.nu));for(var e=Math.floor(.5*r),u=null,a=n.from;a2*e)P(t,l,c,f-l+1,v-c+1,e);else{var _=f-l+1;t.fillRect(l,c,_,v-c+1)}u=f}},t.prototype.du=function(t,i,n,h){if(null!==this.tt)for(var s="",r=this._u(h),e=n.from;eo||t.fillRect(l,a,f-l+1,o-a+1)}},t}(),ui=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.ot=new ei,i}return r(i,t),i.prototype.R=function(t,i){if(!this.Ie.q())return null;var n=this.Ie.ct();this.Ue();var h={Hi:this.ze,Pr:this.We.j().Pr(),lu:n.wickVisible,cu:n.borderVisible,M:this.Re};return this.ot._(h),this.ot},i.prototype.Ye=function(){var t=this;this.ze.forEach((function(i){var n=t.Ie.Je().ou(i.C);i.et=n.au,i.wu=n.Mu,i.Z=n.bu}))},i.prototype.Qe=function(t,i,n){var h=n.ou(t);return e(e({},this.uu(t,i,n)),{et:h.au,wu:h.Mu,Z:h.bu})},i}(si),ai=function(){function t(){this.tt=null,this.mu=[]}return t.prototype._=function(t){this.tt=t,this.mu=[]},t.prototype.h=function(t,i,n,h){if(null!==this.tt&&0!==this.tt.m.length&&null!==this.tt.M){this.mu.length||this.pu(i);for(var s=Math.max(1,Math.floor(i)),r=Math.round(this.tt.gu*i)-Math.floor(s/2),e=r+s,u=this.tt.M.from;ul.ku?l.rs=o.ss-i-1:o.ss=l.rs+i+1))}var f=Math.ceil(this.tt.Pr*t);for(h=this.tt.M.from;h0&&f<4)for(h=this.tt.M.from;hf&&(o.yu>o.ku?o.rs-=1:o.ss+=1)}}else this.mu=[]},t}();function oi(t){return{m:[],Pr:t,gu:NaN,M:null}}function li(t,i,n){return{C:t,D:i,p:NaN,g:NaN,et:n}}var fi=function(t){function i(i,n){var h=t.call(this,i,n,!1)||this;return h.T=new p,h.xu=oi(0),h.ot=new ai,h}return r(i,t),i.prototype.R=function(t,i){return this.Ie.q()?(this.Ue(),this.T):null},i.prototype.qe=function(){var t=this.We.j().Pr();this.xu=oi(t);for(var i=0,n=0,h=this.Ie.ct().color,s=0,r=this.Ie.Hi().Ge();sMath.ceil(this.tt.Mt*i))){var u=Math.ceil(this.tt.wt*i);t.lineCap="butt",t.strokeStyle=this.tt.et,t.lineWidth=Math.floor(this.tt.rt*i),n(t,this.tt.ut),h(t,e,0,u)}}},t}(),bi=function(){function t(t){this.zu={wt:0,Mt:0,g:0,et:"rgba(0, 0, 0, 0)",rt:1,ut:0,q:!1},this.Ru=new Mi,this.B=!0,this.Ie=t,this.We=t.vt(),this.Ru._(this.zu)}return t.prototype.V=function(){this.B=!0},t.prototype.R=function(t,i){return this.Ie.q()?(this.B&&(this.Iu(t,i),this.B=!1),this.Ru):null},t}(),mi=function(t){function i(i){return t.call(this,i)||this}return r(i,t),i.prototype.Iu=function(t,i){this.zu.q=!1;var n=this.Ie.$(),h=n.uh().uh;if(2===h||3===h){var s=this.Ie.ct();if(s.baseLineVisible&&this.Ie.q()){var r=this.Ie.H();null!==r&&(this.zu.q=!0,this.zu.g=n.K(r.X,r.X),this.zu.wt=i,this.zu.Mt=t,this.zu.et=s.baseLineColor,this.zu.rt=s.baseLineWidth,this.zu.ut=s.baseLineStyle)}}},i}(bi),pi=function(){function t(){this.tt=null}return t.prototype._=function(t){this.tt=t},t.prototype.Wu=function(){return this.tt},t.prototype.h=function(t,i,n,h){var s=this.tt;if(null!==s){t.save();var r=Math.max(1,Math.floor(i)),e=r%2/2,u=Math.round(s.ku.x*i)+e,a=s.ku.y*i;t.fillStyle=s.ju,t.beginPath();var o=Math.max(2,1.5*s.Uu)*i;t.arc(u,a,o,0,2*Math.PI,!1),t.fill(),t.fillStyle=s.qu,t.beginPath(),t.arc(u,a,s.N*i,0,2*Math.PI,!1),t.fill(),t.lineWidth=r,t.strokeStyle=s.Hu,t.beginPath(),t.arc(u,a,s.N*i+r/2,0,2*Math.PI,!1),t.stroke(),t.restore()}},t}(),gi=[{Yu:0,Ku:.25,$u:4,Xu:10,Zu:.25,Ju:0,Gu:.4,Qu:.8},{Yu:.25,Ku:.525,$u:10,Xu:14,Zu:0,Ju:0,Gu:.8,Qu:0},{Yu:.525,Ku:1,$u:14,Xu:14,Zu:0,Ju:0,Gu:0,Qu:0}];function yi(t,i,n,h){return function(t,i){if("transparent"===t)return t;var n=F(t),h=n[3];return"rgba("+n[0]+", "+n[1]+", "+n[2]+", "+i*h+")"}(t,n+(h-n)*i)}function ki(t,i){for(var n,h=t%2600/2600,s=0,r=gi;s=e.Yu&&h<=e.Ku){n=e;break}}a(void 0!==n,"Last price animation internal logic error");var u,o,l,f=(h-n.Yu)/(n.Ku-n.Yu);return{qu:yi(i,f,n.Zu,n.Ju),Hu:yi(i,f,n.Gu,n.Qu),N:(u=f,o=n.$u,l=n.Xu,o+(l-o)*u)}}var xi=function(){function t(t){this.ot=new pi,this.B=!0,this.ta=!0,this.ia=performance.now(),this.na=this.ia-1,this.ha=t}return t.prototype.V=function(t){if(this.B=!0,"data"===t&&2===this.ha.ct().lastPriceAnimation){var i=performance.now(),n=this.na-i;if(n>0)return void(n<650&&(this.na+=2600));this.ia=i,this.na=i+2600}},t.prototype.sa=function(){this.ta=!0},t.prototype.q=function(){return 0!==this.ha.ct().lastPriceAnimation},t.prototype.ra=function(){switch(this.ha.ct().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.na}},t.prototype.R=function(t,i){return this.B?(this.I(t,i),this.B=!1,this.ta=!1):this.ta&&(this.ea(),this.ta=!1),this.ot},t.prototype.I=function(t,i){this.ot._(null);var n=this.ha.vt().j(),h=n.br(),s=this.ha.H();if(null!==h&&null!==s){var r=this.ha.ua(!0,!0);if(h.Os(r.zs)){var e={x:n.G(r.zs),y:this.ha.$().K(r.D,s.X)},u=r.et,a=this.ha.ct().lineWidth,o=ki(this.aa(),u);this.ot._({ju:u,Uu:a,qu:o.qu,Hu:o.Hu,N:o.N,ku:e})}}},t.prototype.ea=function(){var t=this.ot.Wu();if(null!==t){var i=ki(this.aa(),t.ju);t.qu=i.qu,t.Hu=i.Hu,t.N=i.N}},t.prototype.aa=function(){return this.ra()?performance.now()-this.ia:2599},t}();function Ni(t,i){return et(Math.min(Math.max(t,12),30)*i)}function Si(t,i){switch(t){case"arrowDown":case"arrowUp":return Ni(i,1);case"circle":return Ni(i,.8);case"square":return Ni(i,.7)}}function Ci(t){return rt(Ni(t,1))}function Di(t){return Math.max(Ni(t,.1),3)}function Ti(t,i,n,h,s){var r=Si("square",n),e=(r-1)/2,u=t-e,a=i-e;return h>=u&&h<=u+r&&s>=a&&s<=a+r}function Ai(t,i,n,h,s){var r=(Si("arrowUp",s)-1)/2,e=(et(s/2)-1)/2;i.beginPath(),t?(i.moveTo(n-r,h),i.lineTo(n,h-r),i.lineTo(n+r,h),i.lineTo(n+e,h),i.lineTo(n+e,h+r),i.lineTo(n-e,h+r),i.lineTo(n-e,h)):(i.moveTo(n-r,h),i.lineTo(n,h+r),i.lineTo(n+r,h),i.lineTo(n+e,h),i.lineTo(n+e,h-r),i.lineTo(n-e,h-r),i.lineTo(n-e,h)),i.fill()}function Li(t,i,n,h,s,r){return Ti(i,n,h,s,r)}var Ei=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.tt=null,i.Au=new _i,i.fe=-1,i.ce="",i.oa="",i}return r(i,t),i.prototype._=function(t){this.tt=t},i.prototype.Lu=function(t,i){this.fe===t&&this.ce===i||(this.fe=t,this.ce=i,this.oa=Wt(t,i),this.Au.Cu())},i.prototype.la=function(t,i){if(null===this.tt||null===this.tt.M)return null;for(var n=this.tt.M.from;n=t&&s<=t+n&&r>=i-e&&r<=i+e}(t.p,t.Ot.g,t.Ot.wt,t.Ot.Mt,i,n))||function(t,i,n){if(0===t.$e)return!1;switch(t.da){case"arrowDown":case"arrowUp":return Li(0,t.p,t.g,t.$e,i,n);case"circle":return function(t,i,n,h,s){var r=2+Si("circle",n)/2,e=t-h,u=i-s;return Math.sqrt(e*e+u*u)<=r}(t.p,t.g,t.$e,i,n);case"square":return Ti(t.p,t.g,t.$e,i,n)}t.da}(t,i,n)}function Fi(t,i,n,h,s,r,e,u,a){var o=v(n)?n:n.close,l=v(n)?n:n.high,f=v(n)?n:n.low,c=v(i.size)?Math.max(i.size,0):1,_=Ci(u.Pr())*c,d=_/2;switch(t.$e=_,i.position){case"inBar":return t.g=e.K(o,a),void(void 0!==t.Ot&&(t.Ot.g=t.g+d+r+.6*s));case"aboveBar":return t.g=e.K(l,a)-d-h.wa,void 0!==t.Ot&&(t.Ot.g=t.g-d-.6*s,h.wa+=1.2*s),void(h.wa+=_+r);case"belowBar":return t.g=e.K(f,a)+d+h.Ma,void 0!==t.Ot&&(t.Ot.g=t.g+d+r+.6*s,h.Ma+=1.2*s),void(h.Ma+=_+r)}i.position}var Vi=function(){function t(t,i){this.B=!0,this.ba=!0,this.ma=!0,this.pa=null,this.ot=new Ei,this.ha=t,this.si=i,this.tt={m:[],M:null}}return t.prototype.V=function(t){this.B=!0,this.ma=!0,"data"===t&&(this.ba=!0)},t.prototype.R=function(t,i,n){if(!this.ha.q())return null;this.B&&this.Ue();var h=this.si.ct().layout;return this.ot.Lu(h.fontSize,h.fontFamily),this.ot._(this.tt),this.ot},t.prototype.ga=function(){if(this.ma){if(this.ha.ya().length>0){var t=this.si.j().Pr(),i=Di(t),n=1.5*Ci(t)+2*i;this.pa={above:n,below:n}}else this.pa=null;this.ma=!1}return this.pa},t.prototype.Ue=function(){var t=this.ha.$(),i=this.si.j(),n=this.ha.ya();this.ba&&(this.tt.m=n.map((function(t){return{C:t.time,p:0,g:0,$e:0,da:t.shape,et:t.color,ca:t.ca,va:t.id,Ot:void 0}})),this.ba=!1);var h=this.si.ct().layout;this.tt.M=null;var s=i.br();if(null!==s){var r=this.ha.H();if(null!==r&&0!==this.tt.m.length){var e=NaN,u=Di(i.Pr()),a={wa:u,Ma:u};this.tt.M=Qt(this.tt.m,s,!0);for(var o=this.tt.M.from;o0&&(f.Ot={_a:l.text,g:0,wt:0,Mt:0});var c=this.ha.ka(l.time);null!==c&&Fi(f,l,c,a,h.fontSize,u,t,i,r.X)}this.B=!1}}},t}(),Pi=function(t){function i(i){return t.call(this,i)||this}return r(i,t),i.prototype.Iu=function(t,i){var n=this.zu;n.q=!1;var h=this.Ie.ct();if(h.priceLineVisible&&this.Ie.q()){var s=this.Ie.ua(0===h.priceLineSource);s.xa||(n.q=!0,n.g=s.zt,n.et=this.Ie.Na(s.et),n.wt=i,n.Mt=t,n.rt=h.priceLineWidth,n.ut=h.priceLineStyle)}},i}(bi),zi=function(t){function i(i){var n=t.call(this)||this;return n.lt=i,n}return r(i,t),i.prototype.Jt=function(t,i,n){t.q=!1,i.q=!1;var h=this.lt;if(h.q()){var s=h.ct(),r=s.lastValueVisible,e=""!==h.Sa(),u=0===s.seriesLastValueMode,a=h.ua(!1);if(!a.xa){r&&(t.Ot=this.Ca(a,r,u),t.q=0!==t.Ot.length),(e||u)&&(i.Ot=this.Da(a,r,e,u),i.q=i.Ot.length>0);var o=h.Na(a.et),l=V(o);n.yt=l.yt,n.et=l.kt,n.zt=a.zt,i.Z=h.vt().J(a.zt/h.$().Mt()),t.Z=o}}},i.prototype.Da=function(t,i,n,h){var s="",r=this.lt.Sa();return n&&0!==r.length&&(s+=r+" "),i&&h&&(s+=this.lt.$().lh()?t.Ta:t.Aa),s.trim()},i.prototype.Ca=function(t,i,n){return i?n?this.lt.$().lh()?t.Aa:t.Ta:t.Ot:""},i}(U),Ri=function(){function t(t,i){this.Vn=t,this.La=i||null}return t.prototype.kh=function(){return this.Vn},t.prototype.es=function(){return this.La},t.prototype.Mn=function(){return null===this.Vn?null:{priceRange:this.Vn.Mn(),margins:this.La||void 0}},t.bn=function(i){return null===i?null:new t(it.bn(i.priceRange),i.margins)},t}(),Ii=function(t){function i(i,n){var h=t.call(this,i)||this;return h.Ea=n,h}return r(i,t),i.prototype.Iu=function(t,i){var n=this.zu;if(n.q=!1,this.Ie.q()){var h=this.Ea.Ba();if(null!==h){var s=this.Ea.ct();n.q=!0,n.g=h,n.et=s.color,n.wt=i,n.Mt=t,n.rt=s.lineWidth,n.ut=s.lineStyle}}},i}(bi),Wi=function(t){function i(i,n){var h=t.call(this)||this;return h.ha=i,h.Ea=n,h}return r(i,t),i.prototype.Jt=function(t,i,n){t.q=!1,i.q=!1;var h=this.Ea.ct(),s=h.axisLabelVisible,r=""!==h.title,e=this.ha;if(s&&e.q()){var u=this.Ea.Ba();if(null!==u){r&&(i.Ot=h.title,i.q=!0),i.Z=e.vt().J(u/e.$().Mt()),t.Ot=e.$().Xh(h.price),t.q=!0;var a=V(h.color);n.yt=a.yt,n.et=a.kt,n.zt=u}}},i}(U),ji=function(){function t(t,i){this.ha=t,this.Ni=i,this.Oa=new Ii(t,this),this.Eu=new Wi(t,this),this.Fa=new wi(this.Eu,t,t.vt())}return t.prototype.sh=function(t){c(this.Ni,t),this.V(),this.ha.vt().Vr()},t.prototype.ct=function(){return this.Ni},t.prototype.vi=function(){return[this.Oa,this.Fa]},t.prototype.Va=function(){return this.Eu},t.prototype.V=function(){this.Oa.V(),this.Eu.V()},t.prototype.Ba=function(){var t=this.ha,i=t.$();if(t.vt().j().ti()||i.ti())return null;var n=t.H();return null===n?null:i.K(this.Ni.price,n.X)},t}(),Ui=function(t){function i(i){var n=t.call(this)||this;return n.si=i,n}return r(i,t),i.prototype.vt=function(){return this.si},i}($),qi={au:"",bu:"",Mu:""},Hi=function(){function t(t){this.ha=t}return t.prototype.ou=function(t,i){var n=this.ha.Pa(),h=this.ha.ct();switch(n){case"Line":return this.za(h);case"Area":return this.Ra(h);case"Bar":return this.Ia(h,t,i);case"Candlestick":return this.Wa(h,t,i);case"Histogram":return this.ja(h,t,i)}throw new Error("Unknown chart style")},t.prototype.Ia=function(t,i,n){var h=e({},qi),s=t.upColor,r=t.downColor,u=s,a=r,o=l(this.Ua(i,n)),c=f(o.X[0])<=f(o.X[3]);return h.au=c?s:r,h.bu=c?u:a,h},t.prototype.Wa=function(t,i,n){var h=e({},qi),s=t.upColor,r=t.downColor,u=t.borderUpColor,a=t.borderDownColor,o=t.wickUpColor,c=t.wickDownColor,v=l(this.Ua(i,n)),_=f(v.X[0])<=f(v.X[3]);return h.au=_?s:r,h.bu=_?u:a,h.Mu=_?o:c,h},t.prototype.Ra=function(t){return e(e({},qi),{au:t.lineColor})},t.prototype.za=function(t){return e(e({},qi),{au:t.color})},t.prototype.ja=function(t,i,n){var h=e({},qi),s=l(this.Ua(i,n));return h.au=void 0!==s.et?s.et:t.color,h},t.prototype.Ua=function(t,i){return void 0!==i?i.X:this.ha.Hi().qa(t)},t}(),Yi=30,Ki=function(){function t(){this.Ha=[],this.Ya=new Map,this.Ka=new Map}return t.prototype.$a=function(){this.Ha=[],this.Ya.clear(),this.Ka.clear()},t.prototype.Xa=function(){return this.$e()>0?this.Ha[this.Ha.length-1]:null},t.prototype.Za=function(){return this.$e()>0?this.Ja(0):null},t.prototype.qi=function(){return this.$e()>0?this.Ja(this.Ha.length-1):null},t.prototype.$e=function(){return this.Ha.length},t.prototype.ti=function(){return 0===this.$e()},t.prototype.Os=function(t){return null!==this.Ga(t,0)},t.prototype.qa=function(t){return this.Qa(t)},t.prototype.Qa=function(t,i){void 0===i&&(i=0);var n=this.Ga(t,i);return null===n?null:e(e({},this.io(n)),{zs:this.Ja(n)})},t.prototype.Ge=function(){return this.Ha},t.prototype.no=function(t,i,n){if(this.ti())return null;for(var h=null,s=0,r=n;sthis.Ha[this.Ha.length-1].zs?this.ro(t):1!==t.length||t[0].zs!==this.Ha[this.Ha.length-1].zs?this.eo(t):this.uo(t[0]))},t.prototype.Ja=function(t){return this.Ha[t].zs},t.prototype.io=function(t){return this.Ha[t]},t.prototype.Ga=function(t,i){var n=this.ao(t);if(null===n&&0!==i)switch(i){case-1:return this.oo(t);case 1:return this.lo(t);default:throw new TypeError("Unknown search mode")}return n},t.prototype.oo=function(t){var i=this.fo(t);return i>0&&(i-=1),i!==this.Ha.length&&this.Ja(i)t}))},t.prototype.vo=function(t,i,n){for(var h=null,s=t;sh.do&&(h.do=r)))}return h},t.prototype.wo=function(t){var i=Math.floor(t.zs/Yi);this.Ya.forEach((function(t){return t.delete(i)}))},t.prototype.so=function(t){a(0!==t.length,"plotRows should not be empty"),this.Ka.clear(),this.Ya.clear(),this.Ha=t.concat(this.Ha)},t.prototype.ro=function(t){a(0!==t.length,"plotRows should not be empty"),this.Ka.clear(),this.Ya.clear(),this.Ha=this.Ha.concat(t)},t.prototype.uo=function(t){a(!this.ti(),"plot list should not be empty"),a(this.Ha[this.Ha.length-1].zs===t.zs,"last row index should match new row index"),this.wo(t),this.Ka.delete(t.zs),this.Ha[this.Ha.length-1]=t},t.prototype.eo=function(t){a(0!==t.length,"plot rows should not be empty"),this.Ka.clear(),this.Ya.clear(),this.Ha=function(t,i){var n=function(t,i){var n=t.length,h=i.length,s=n+h,r=0,e=0;for(;ri[e].zs?e++:(r++,e++,s--);return s}(t,i),h=new Array(n),s=0,r=0,e=t.length,u=i.length,a=0;for(;si[r].zs?(h[a]=i[r],r++):(h[a]=i[r],s++,r++),a++;for(;s=0&&r.zh(t),null!==r&&(r.Ph(),this.pl(r)),this.Yn=null},t.prototype.Vu=function(t){return t===this.ul?"left":t===this.ol?"right":"overlay"},t.prototype.gl=function(){return this.ul},t.prototype.yl=function(){return this.ol},t.prototype.kl=function(t,i){t.Wh(i)},t.prototype.xl=function(t,i){t.jh(i),this.wl()},t.prototype.Nl=function(t){t.Uh()},t.prototype.Sl=function(t,i){t.qh(i)},t.prototype.Cl=function(t,i){t.Hh(i),this.wl()},t.prototype.Dl=function(t){t.Yh()},t.prototype.wl=function(){this.Hn.forEach((function(t){t.Wi()}))},t.prototype.Di=function(){var t=null;return this.si.ct().rightPriceScale.visible&&0!==this.ol.Oh().length?t=this.ol:this.si.ct().leftPriceScale.visible&&0!==this.ul.Oh().length?t=this.ul:0!==this.Hn.length&&(t=this.Hn[0].$()),null===t&&(t=this.ol),t},t.prototype.pl=function(t){null!==t&&t.oh()&&this.Tl(t)},t.prototype.Al=function(t){var i=this.rl.br();t.eh({_h:!0}),null!==i&&t.Qh(i),this.wl()},t.prototype.Ll=function(){this.Tl(this.ul),this.Tl(this.ol)},t.prototype.El=function(){var t=this;this.pl(this.ul),this.pl(this.ol),this.Hn.forEach((function(i){t.Fu(i)&&t.pl(i.$())})),this.wl(),this.si.Vr()},t.prototype.Fh=function(){return null===this.Yn&&(this.Yn=Mt(this.Hn)),this.Yn},t.prototype.Bl=function(){return this.sl},t.prototype.Ol=function(){return this.el},t.prototype.Tl=function(t){var i=t.Gh();if(i&&i.length>0&&!this.rl.ti()){var n=this.rl.br();null!==n&&t.Qh(n)}t.Wi()},t.prototype.bl=function(){var t=this.Fh();if(0===t.length)return{Fl:0,Ml:0};for(var i=0,n=0,h=0;hn&&(n=s))}return{Fl:i,Ml:n}},t.prototype.ml=function(t,i,n){var h=this.cl(i);if(null===h&&(h=this.al(i,this.si.ct().overlayPriceScales)),this.Hn.push(t),!Ut(i)){var s=this.nl.get(i)||[];s.push(t),this.nl.set(i,s)}h.Vh(t),t.fi(h),t.li(n),this.pl(h),this.Yn=null},t.prototype.ll=function(t,i,n){i.uh!==n.uh&&this.Tl(t)},t.prototype.al=function(t,i){var n=e({visible:!0,autoScale:!0},M(i)),h=new yt(t,n,this.si.ct().layout,this.si.ct().localization);return h.mh(this.Mt()),h},t}(),nn=function(t){function i(i){var n=t.call(this)||this;return n.Vl=new Map,n.tt=i,n}return r(i,t),i.prototype.u=function(t){},i.prototype.l=function(t){if(this.tt.q){t.save();for(var i=0,n=0,h=this.tt.Pl;nthis.tt.wt?a.qr=this.tt.wt/s:a.qr=1,i+=a.Rl*a.qr}}var r=0;switch(this.tt.Il){case"top":r=0;break;case"center":r=Math.max((this.tt.Mt-i)/2,0);break;case"bottom":r=Math.max(this.tt.Mt-i,0)}t.fillStyle=this.tt.et;for(var e=0,u=this.tt.Pl;e20&&(this.Yl=null,i=!0),this.rl.Hh(t),this.Fr(),i},t.prototype.Nf=function(){this.rl.Yh(),this.Vr(),this.Yl=null},t.prototype.P=function(){return this.Hl},t.prototype.Df=function(t,i,n){this.F.Ei(t,i);var h=NaN,s=this.rl.Br(t),r=this.rl.br();null!==r&&(s=Math.min(Math.max(r.ss(),s),r.rs()));var e=n.Di(),u=e.H();null!==u&&(h=e.Ti(i,u)),h=this.Ql.Yo(h,s,n),this.F.Vi(s,h,n),this.Io(),this.Xl.sn(this.F.W(),{x:t,y:i})},t.prototype.Tf=function(){this.wf().zi(),this.Io(),this.Xl.sn(null,null)},t.prototype.Ao=function(){var t=this.F.ft();if(null!==t){var i=this.F.Oi(),n=this.F.Fi();this.Df(i,n,t)}this.F.Wi()},t.prototype.Af=function(t,i){var n=this.rl.ri(0);void 0!==i&&this.rl.V(i);var h=this.rl.ri(0),s=this.rl.Lr(),r=this.rl.br();if(null!==r&&null!==n&&null!==h){var e=r.Os(s),u=n.Ds>h.Ds,a=null!==t&&t>s&&!u,o=e&&this.rl.ct().shiftVisibleRangeOnNewBar;if(a&&!o){var l=t-s;this.rl.wr(this.rl.Rr()-l)}}this.rl.Ur(t)},t.prototype.Oo=function(t){null!==t&&t.El()},t.prototype.Ou=function(t){var i=this.ql.find((function(i){return i.Fh().includes(t)}));return void 0===i?null:i},t.prototype.Fr=function(){this.tf.Wi(),this.ql.forEach((function(t){return t.El()})),this.Ao()},t.prototype.en=function(){this.ql.forEach((function(t){return t.en()})),this.ql.length=0,this.Ni.localization.priceFormatter=void 0,this.Ni.localization.timeFormatter=void 0},t.prototype.Lf=function(){return this.Gl},t.prototype.Pu=function(){return this.Gl.ct()},t.prototype.vl=function(){return this.$l},t.prototype.Ef=function(t,i){var n=this.ql[0],h=this.Bf(i,t,n);return this.Hl.push(h),1===this.Hl.length?this.rf():this.Vr(),h},t.prototype.Of=function(t){var i=this.Ou(t),n=this.Hl.indexOf(t);a(-1!==n,"Series not found"),this.Hl.splice(n,1),l(i).zh(t),t.en&&t.en()},t.prototype.Do=function(t,i){var n=l(this.Ou(t));n.zh(t);var h=this.vf(i);if(null===h){var s=t.oi();n.Vh(t,i,s)}else{s=h.ft===n?t.oi():void 0;h.ft.Vh(t,i,s)}},t.prototype.Qr=function(){var t=new qt(2);t.ye(),this.ef(t)},t.prototype.Ff=function(t){var i=new qt(2);i.xe(t),this.ef(i)},t.prototype.Ne=function(){var t=new qt(2);t.Ne(),this.ef(t)},t.prototype.dr=function(t){var i=new qt(2);i.dr(t),this.ef(i)},t.prototype.wr=function(t){var i=new qt(2);i.wr(t),this.ef(i)},t.prototype.Vf=function(){return this.Ni.rightPriceScale.visible?"right":"left"},t.prototype.Pf=function(){return this.sf},t.prototype.zf=function(){return this.nf},t.prototype.J=function(t){var i=this.sf,n=this.nf;if(i===n)return i;if(t=Math.max(0,Math.min(100,Math.round(100*t))),null===this.Zl||this.Zl.Be!==n||this.Zl.Oe!==i)this.Zl={Be:n,Oe:i,Rf:new Map};else{var h=this.Zl.Rf.get(t);if(void 0!==h)return h}var s=function(t,i,n){var h=F(t),s=h[0],r=h[1],e=h[2],u=h[3],a=F(i),o=a[0],l=a[1],f=a[2],c=a[3],v=[T(s+n*(o-s)),T(r+n*(l-r)),T(e+n*(f-e)),A(u+n*(c-u))];return"rgba("+v[0]+", "+v[1]+", "+v[2]+", "+v[3]+")"}(n,i,t/100);return this.Zl.Rf.set(t,s),s},t.prototype.mf=function(t,i){var n=new qt(i);if(null!==t){var h=this.ql.indexOf(t);n.be(h,{me:i})}return n},t.prototype.uf=function(t,i){return void 0===i&&(i=2),this.mf(this.Ou(t),i)},t.prototype.ef=function(t){this.Jl&&this.Jl(t),this.ql.forEach((function(t){return t.Ol().il().V()}))},t.prototype.Bf=function(t,i,n){var h=new Xi(this,t,i),s=void 0!==t.priceScaleId?t.priceScaleId:this.Vf();return n.Vh(h,s),Ut(s)||h.sh(t),h},t.prototype.hf=function(t){var i=this.Ni.layout;return"gradient"===i.background.type?0===t?i.background.topColor:i.background.bottomColor:i.background.color},t}(),en={allowDownsampling:!0};var un=function(){function t(t,i){var n=this;this._resolutionMediaQueryList=null,this._resolutionListener=function(t){return n._onResolutionChanged()},this._canvasConfiguredListeners=[],this.canvas=t,this._canvasSize={width:this.canvas.clientWidth,height:this.canvas.clientHeight},this._options=i,this._configureCanvas(),this._installResolutionListener()}return t.prototype.destroy=function(){this._canvasConfiguredListeners.length=0,this._uninstallResolutionListener(),this.canvas=null},Object.defineProperty(t.prototype,"canvasSize",{get:function(){return{width:this._canvasSize.width,height:this._canvasSize.height}},enumerable:!0,configurable:!0}),t.prototype.resizeCanvas=function(t){this._canvasSize={width:t.width,height:t.height},this._configureCanvas()},Object.defineProperty(t.prototype,"pixelRatio",{get:function(){var t=this.canvas.ownerDocument.defaultView;if(null==t)throw new Error("No window is associated with the canvas");return t.devicePixelRatio>1||this._options.allowDownsampling?t.devicePixelRatio:1},enumerable:!0,configurable:!0}),t.prototype.subscribeCanvasConfigured=function(t){this._canvasConfiguredListeners.push(t)},t.prototype.unsubscribeCanvasConfigured=function(t){this._canvasConfiguredListeners=this._canvasConfiguredListeners.filter((function(i){return i!=t}))},t.prototype._configureCanvas=function(){var t=this.pixelRatio;this.canvas.style.width=this._canvasSize.width+"px",this.canvas.style.height=this._canvasSize.height+"px",this.canvas.width=this._canvasSize.width*t,this.canvas.height=this._canvasSize.height*t,this._emitCanvasConfigured()},t.prototype._emitCanvasConfigured=function(){var t=this;this._canvasConfiguredListeners.forEach((function(i){return i.call(t)}))},t.prototype._installResolutionListener=function(){if(null!==this._resolutionMediaQueryList)throw new Error("Resolution listener is already installed");var t=this.canvas.ownerDocument.defaultView;if(null==t)throw new Error("No window is associated with the canvas");var i=t.devicePixelRatio;this._resolutionMediaQueryList=t.matchMedia("all and (resolution: "+i+"dppx)"),this._resolutionMediaQueryList.addListener(this._resolutionListener)},t.prototype._uninstallResolutionListener=function(){null!==this._resolutionMediaQueryList&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},t.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},t.prototype._onResolutionChanged=function(){this._configureCanvas(),this._reinstallResolutionListener()},t}(),an=function(){function t(t,i){this.ht=t,this.st=i}return t.prototype.on=function(t){return this.ht===t.ht&&this.st===t.st},t}();function on(t){return t.ownerDocument&&t.ownerDocument.defaultView&&t.ownerDocument.defaultView.devicePixelRatio||1}function ln(t){var i=l(t.getContext("2d"));return i.setTransform(1,0,0,1,0,0),i}function fn(t,i){var n=t.createElement("canvas"),h=on(n);return n.style.width=i.ht+"px",n.style.height=i.st+"px",n.width=i.ht*h,n.height=i.st*h,n}function cn(t,i){var n=l(t.ownerDocument).createElement("canvas");t.appendChild(n);var h=function(t,i){return void 0===i&&(i=en),new un(t,i)}(n);return h.resizeCanvas({width:i.ht,height:i.st}),h}function vn(t,i){return t.If-i.If}function _n(t,i,n){var h=(t.If-i.If)/(t.C-i.C);return Math.sign(h)*Math.min(Math.abs(h),n)}var dn=function(){function t(t,i,n,h){this.Wf=null,this.jf=null,this.Uf=null,this.qf=null,this.Hf=null,this.Yf=0,this.Kf=0,this.$f=!1,this.Xf=t,this.Zf=i,this.Jf=n,this.Yi=h}return t.prototype.Gf=function(t,i){if(null!==this.Wf){if(this.Wf.C===i)return void(this.Wf.If=t);if(Math.abs(this.Wf.If-t)50)){var n=0,h=_n(this.Wf,this.jf,this.Zf),s=vn(this.Wf,this.jf),r=[h],e=[s];if(n+=s,null!==this.Uf){var u=_n(this.jf,this.Uf,this.Zf);if(Math.sign(u)===Math.sign(h)){var a=vn(this.jf,this.Uf);if(r.push(u),e.push(a),n+=a,null!==this.qf){var o=_n(this.Uf,this.qf,this.Zf);if(Math.sign(o)===Math.sign(h)){var l=vn(this.Uf,this.qf);r.push(o),e.push(l),n+=l}}}}for(var f,c,v,_=0,d=0;d5;if(e||!i){if(e&&!this.oc&&i){var u=.5*s,a=r>=u&&!this.Ni.Oc,o=u>r&&!this.Ni.Fc;a||o||(this.Mc=!0)}e&&(this.oc=!0,this.lc=!0,i&&this.kc()),this.Mc||(this.Dc(n,this.gc.Vc),i&&kn(t))}}}},t.prototype.Pc=function(t){if(!("button"in t)||0===t.button){var i=this.Cc(t);this.kc(),this.ac=null,this.bc=!1,this.vc&&(this.vc(),this.vc=null),yn(t)&&this.zc(t),this.Dc(i,this.gc.Rc),++this.sc,this.rc&&this.sc>1?(this.Dc(i,this.gc.Ic),this.xc()):this.lc||this.Dc(i,this.gc.Wc),yn(t)&&(kn(t),this.zc(t),0===t.touches.length&&(this.uc=!1))}},t.prototype.kc=function(){null!==this.ec&&(clearTimeout(this.ec),this.ec=null)},t.prototype.jc=function(t){if(!("button"in t)||0===t.button){var i=this.Cc(t);this.lc=!1,this.oc=!1,this.Mc=!1,yn(t)&&this.Nc(t),this.ac={p:i.Ec,g:i.Bc},this.vc&&(this.vc(),this.vc=null);var n=this.Lc.bind(this),h=this.Pc.bind(this),s=this.mc.ownerDocument.documentElement;this.vc=function(){s.removeEventListener("touchmove",n),s.removeEventListener("touchend",h),s.removeEventListener("mousemove",n),s.removeEventListener("mouseup",h)},s.addEventListener("touchmove",n,{passive:!1}),s.addEventListener("touchend",h,{passive:!1}),this.kc(),yn(t)&&1===t.touches.length?this.ec=setTimeout(this.Uc.bind(this,t),240):(s.addEventListener("mousemove",n),s.addEventListener("mouseup",h)),this.bc=!0,this.Dc(i,this.gc.qc),this.rc||(this.sc=0,this.rc=setTimeout(this.xc.bind(this),500))}},t.prototype.yc=function(){var t=this;this.mc.addEventListener("mouseenter",this.Nc.bind(this)),this.mc.addEventListener("touchcancel",this.kc.bind(this));var i=this.mc.ownerDocument,n=function(i){t.gc.Hc&&(i.composed&&t.mc.contains(i.composedPath()[0])||i.target&&t.mc.contains(i.target)||t.gc.Hc())};this.fc=function(){i.removeEventListener("mousedown",n),i.removeEventListener("touchstart",n)},i.addEventListener("mousedown",n),i.addEventListener("touchstart",n,{passive:!0}),this.mc.addEventListener("mouseleave",this.zc.bind(this)),this.mc.addEventListener("touchstart",this.jc.bind(this),{passive:!0}),Mn||this.mc.addEventListener("mousedown",this.jc.bind(this)),this.Yc(),this.mc.addEventListener("touchmove",(function(){}),{passive:!1})},t.prototype.Yc=function(){var t=this;void 0===this.gc.Kc&&void 0===this.gc.$c&&void 0===this.gc.Xc||(this.mc.addEventListener("touchstart",(function(i){return t.Zc(i.touches)}),{passive:!0}),this.mc.addEventListener("touchmove",(function(i){if(2===i.touches.length&&null!==t._c&&void 0!==t.gc.$c){var n=gn(i.touches[0],i.touches[1])/t.dc;t.gc.$c(t._c,n),kn(i)}}),{passive:!1}),this.mc.addEventListener("touchend",(function(i){t.Zc(i.touches)})))},t.prototype.Zc=function(t){1===t.length&&(this.wc=!1),2!==t.length||this.wc||this.uc?this.Jc():this.Gc(t)},t.prototype.Gc=function(t){var i=pn(this.mc);this._c={p:(t[0].clientX-i.left+(t[1].clientX-i.left))/2,g:(t[0].clientY-i.top+(t[1].clientY-i.top))/2},this.dc=gn(t[0],t[1]),void 0!==this.gc.Kc&&this.gc.Kc(),this.kc()},t.prototype.Jc=function(){null!==this._c&&(this._c=null,void 0!==this.gc.Xc&&this.gc.Xc())},t.prototype.zc=function(t){this.cc&&this.cc();var i=this.Cc(t);this.Dc(i,this.gc.Qc)},t.prototype.Uc=function(t){var i=this.Cc(t);this.Dc(i,this.gc.tv),this.lc=!0,this.uc=!0},t.prototype.Dc=function(t,i){i&&i.call(this.gc,t)},t.prototype.Cc=function(t){var i;i="touches"in t&&t.touches.length?t.touches[0]:"changedTouches"in t&&t.changedTouches.length?t.changedTouches[0]:t;var n=pn(this.mc);return{iv:i.clientX,nv:i.clientY,Ec:i.pageX,Bc:i.pageY,hv:i.screenX,sv:i.screenY,rv:i.clientX-n.left,ev:i.clientY-n.top,uv:t.ctrlKey,av:t.altKey,ov:t.shiftKey,lv:t.metaKey,ke:t.type.startsWith("mouse")?"mouse":"touch",fv:t.view}},t}();function pn(t){return t.getBoundingClientRect()||{left:0,top:0}}function gn(t,i){var n=t.clientX-i.clientX,h=t.clientY-i.clientY;return Math.sqrt(n*n+h*h)}function yn(t){return Boolean(t.touches)}function kn(t){t.cancelable&&t.preventDefault()}var xn=function(){function t(t,i,n,h){this.Au=new _i(200),this.fe=0,this.cv="",this.oa="",this.Su=[],this.vv=new Map,this.fe=t,this.cv=i,this.oa=Wt(t,n,h)}return t.prototype.en=function(){this.Au.Cu(),this.Su=[],this.vv.clear()},t.prototype._v=function(t,i,n,h,s){var r=this.dv(t,i);if("left"!==s){var e=on(t.canvas);n-=Math.floor(r.wv*e)}h-=Math.floor(r.Mt/2),t.drawImage(r.Mv,n,h,r.wt,r.Mt)},t.prototype.dv=function(t,i){var n,h=this;if(this.vv.has(i))n=o(this.vv.get(i));else{if(this.Su.length>=200){var s=o(this.Su.shift());this.vv.delete(s)}var r=on(t.canvas),e=Math.ceil(this.fe/4.5),u=Math.round(this.fe/10),a=Math.ceil(this.Au.Ft(t,i)),l=rt(Math.round(a+2*e)),f=rt(this.fe+2*e),c=fn(document,new an(l,f));n={Ot:i,wv:Math.round(Math.max(1,a)),wt:Math.ceil(l*r),Mt:Math.ceil(f*r),Mv:c},0!==a&&(this.Su.push(n.Ot),this.vv.set(n.Ot,n)),z(t=ln(n.Mv),r,(function(){t.font=h.oa,t.fillStyle=h.cv,t.fillText(i,0,f-e-u)}))}return n},t}(),Nn=function(){function t(t,i,n,h){var s=this;this.Gt=null,this.bv=null,this.mv=null,this.pv=!1,this.gv=new _i(50),this.yv=new xn(11,"#000"),this.cv=null,this.oa=null,this.kv=0,this.xv=function(){s.Nv(s.Gl.ct()),s.di.Sv().vt().Vr()},this.Cv=function(){s.di.Sv().vt().Vr()},this.di=t,this.Ni=i,this.Gl=n,this.Dv="left"===h,this.Tv=document.createElement("div"),this.Tv.style.height="100%",this.Tv.style.overflow="hidden",this.Tv.style.width="25px",this.Tv.style.left="0",this.Tv.style.position="relative",this.Av=cn(this.Tv,new an(16,16)),this.Av.subscribeCanvasConfigured(this.xv);var r=this.Av.canvas;r.style.position="absolute",r.style.zIndex="1",r.style.left="0",r.style.top="0",this.Lv=cn(this.Tv,new an(16,16)),this.Lv.subscribeCanvasConfigured(this.Cv);var e=this.Lv.canvas;e.style.position="absolute",e.style.zIndex="2",e.style.left="0",e.style.top="0";var u={qc:this.Ev.bind(this),Vc:this.Bv.bind(this),Hc:this.Ov.bind(this),Rc:this.Fv.bind(this),Ic:this.Vv.bind(this),Tc:this.Pv.bind(this),Qc:this.zv.bind(this)};this.Rv=new mn(this.Lv.canvas,u,{Oc:!1,Fc:!0})}return t.prototype.en=function(){this.Rv.en(),this.Lv.unsubscribeCanvasConfigured(this.Cv),this.Lv.destroy(),this.Av.unsubscribeCanvasConfigured(this.xv),this.Av.destroy(),null!==this.Gt&&this.Gt.Ih().hn(this),this.Gt=null,null!==this.mv&&(clearTimeout(this.mv),this.mv=null),this.yv.en()},t.prototype.Iv=function(){return this.Tv},t.prototype.S=function(){return l(this.Gt).ct().borderColor},t.prototype.Wv=function(){return this.Ni.textColor},t.prototype.Pt=function(){return this.Ni.fontSize},t.prototype.jv=function(){return Wt(this.Pt(),this.Ni.fontFamily)},t.prototype.Uv=function(){var t=this.Gl.ct(),i=this.cv!==t.et,n=this.oa!==t.Nt;return(i||n)&&(this.Nv(t),this.cv=t.et),n&&(this.gv.Cu(),this.oa=t.Nt),t},t.prototype.qv=function(){if(null===this.Gt)return 0;var t=34,i=this.Uv(),n=ln(this.Av.canvas),h=this.Gt.Bn();n.font=this.jv(),h.length>0&&(t=Math.max(this.gv.Ft(n,h[0].An),this.gv.Ft(n,h[h.length-1].An)));for(var s=this.Hv(),r=s.length;r--;){var e=this.gv.Ft(n,s[r].Ot());e>t&&(t=e)}var u=this.Gt.H();if(null!==u&&null!==this.bv){var a=this.Gt.Ti(1,u),o=this.Gt.Ti(this.bv.st-2,u);t=Math.max(t,this.gv.Ft(n,this.Gt.ii(Math.floor(Math.min(a,o))+.11111111111111,u)),this.gv.Ft(n,this.Gt.ii(Math.ceil(Math.max(a,o))-.11111111111111,u)))}var l=Math.ceil(i.Tt+i.Dt+i.Et+i.Bt+t);return l+=l%2},t.prototype.Yv=function(t){if(t.ht<0||t.st<0)throw new Error("Try to set invalid size to PriceAxisWidget "+JSON.stringify(t));null!==this.bv&&this.bv.on(t)||(this.bv=t,this.Av.resizeCanvas({width:t.ht,height:t.st}),this.Lv.resizeCanvas({width:t.ht,height:t.st}),this.Tv.style.width=t.ht+"px",this.Tv.style.height=t.st+"px",this.Tv.style.minWidth=t.ht+"px")},t.prototype.Kv=function(){return l(this.bv).ht},t.prototype.fi=function(t){this.Gt!==t&&(null!==this.Gt&&this.Gt.Ih().hn(this),this.Gt=t,t.Ih().Ji(this.Un.bind(this),this))},t.prototype.$=function(){return this.Gt},t.prototype.Cu=function(){var t=this.di.$v();this.di.Sv().vt().Al(t,l(this.$()))},t.prototype.Xv=function(t){if(null!==this.bv){if(1!==t){var i=ln(this.Av.canvas);this.Zv(),this.Jv(i,this.Av.pixelRatio),this.vu(i,this.Av.pixelRatio),this.Gv(i,this.Av.pixelRatio),this.Qv(i,this.Av.pixelRatio)}var n=ln(this.Lv.canvas),h=this.bv.ht,s=this.bv.st;z(n,this.Lv.pixelRatio,(function(){n.clearRect(0,0,h,s)})),this.t_(n,this.Lv.pixelRatio)}},t.prototype.i_=function(){return this.Av.canvas},t.prototype.Ev=function(t){if(null!==this.Gt&&!this.Gt.ti()&&this.di.Sv().ct().handleScale.axisPressedMouseMove.price){var i=this.di.Sv().vt(),n=this.di.$v();this.pv=!0,i.kl(n,this.Gt,t.ev)}},t.prototype.Bv=function(t){if(null!==this.Gt&&this.di.Sv().ct().handleScale.axisPressedMouseMove.price){var i=this.di.Sv().vt(),n=this.di.$v(),h=this.Gt;i.xl(n,h,t.ev)}},t.prototype.Ov=function(){if(null!==this.Gt&&this.di.Sv().ct().handleScale.axisPressedMouseMove.price){var t=this.di.Sv().vt(),i=this.di.$v(),n=this.Gt;this.pv&&(this.pv=!1,t.Nl(i,n))}},t.prototype.Fv=function(t){if(null!==this.Gt&&this.di.Sv().ct().handleScale.axisPressedMouseMove.price){var i=this.di.Sv().vt(),n=this.di.$v();this.pv=!1,i.Nl(n,this.Gt)}},t.prototype.Vv=function(t){this.di.Sv().ct().handleScale.axisDoubleClickReset&&this.Cu()},t.prototype.Pv=function(t){null!==this.Gt&&(!this.di.Sv().vt().ct().handleScale.axisPressedMouseMove.price||this.Gt.lh()||this.Gt.fh()||this.n_(1))},t.prototype.zv=function(t){this.n_(0)},t.prototype.Hv=function(){var t=this,i=[],n=null===this.Gt?void 0:this.Gt;return function(h){for(var s=0;s0&&(t=s[0].zt())}));var u=i.filter((function(i){return i.zt()<=t})),a=i.filter((function(i){return i.zt()>t}));if(u.sort((function(t,i){return i.zt()-t.zt()})),u.length&&a.length&&a.push(u[0]),a.sort((function(t,i){return t.zt()-i.zt()})),i.forEach((function(t){return t.Kt(t.zt())})),this.Gt.ct().alignLabels){for(var o=1;o(_=v.Yt())-f&&l.Kt(_-f)}for(var c=1;c1&&this.R_(),null!==this.h_&&this.h_.Xv(t),null!==this.s_&&this.s_.Xv(t),1!==t){var i=ln(this.Av.canvas);i.save(),this.Jv(i,this.Av.pixelRatio),this.__&&(this.I_(i,this.Av.pixelRatio),this.W_(i,this.Av.pixelRatio),this.j_(i,this.Av.pixelRatio,Tn)),i.restore()}var n=ln(this.Lv.canvas);n.clearRect(0,0,Math.ceil(this.bv.ht*this.Lv.pixelRatio),Math.ceil(this.bv.st*this.Lv.pixelRatio)),this.j_(n,this.Av.pixelRatio,An),this.U_(n,this.Lv.pixelRatio)}},t.prototype.q_=function(){return this.h_},t.prototype.H_=function(){return this.s_},t.prototype.w_=function(){null!==this.__&&this.__.Bl().hn(this),this.__=null},t.prototype.Jv=function(t,i){var n=this;z(t,i,(function(){var i=n.si(),h=i.zf(),s=i.Pf();h===s?R(t,0,0,n.bv.ht,n.bv.st,s):I(t,0,0,n.bv.ht,n.bv.st,h,s)}))},t.prototype.I_=function(t,i){var n=l(this.__),h=n.Ol().il().R(n.Mt(),n.wt());null!==h&&(t.save(),h.h(t,i,!1),t.restore())},t.prototype.W_=function(t,i){var n=this.si().df();this.Y_(t,i,Tn,Cn,n),this.Y_(t,i,Tn,Dn,n)},t.prototype.U_=function(t,i){this.Y_(t,i,Tn,Dn,this.si().wf())},t.prototype.j_=function(t,i,n){for(var h=l(this.__).Fh(),s=0,r=h;si.Rs?t:i}var On=function(){function t(t){var i=this;this.Q_=null,this.td=null,this.oe=null,this.nd=!1,this.bv=new an(0,0),this.gv=new _i(5),this.xv=function(){return i.d_.vt().Vr()},this.Cv=function(){return i.d_.vt().Vr()},this.d_=t,this.Ni=t.ct().layout,this.hd=document.createElement("tr"),this.sd=document.createElement("td"),this.sd.style.padding="0",this.rd=document.createElement("td"),this.rd.style.padding="0",this.Tv=document.createElement("td"),this.Tv.style.height="25px",this.Tv.style.padding="0",this.ed=document.createElement("div"),this.ed.style.width="100%",this.ed.style.height="100%",this.ed.style.position="relative",this.ed.style.overflow="hidden",this.Tv.appendChild(this.ed),this.Av=cn(this.ed,new an(16,16)),this.Av.subscribeCanvasConfigured(this.xv);var n=this.Av.canvas;n.style.position="absolute",n.style.zIndex="1",n.style.left="0",n.style.top="0",this.Lv=cn(this.ed,new an(16,16)),this.Lv.subscribeCanvasConfigured(this.Cv);var h=this.Lv.canvas;h.style.position="absolute",h.style.zIndex="2",h.style.left="0",h.style.top="0",this.hd.appendChild(this.sd),this.hd.appendChild(this.Tv),this.hd.appendChild(this.rd),this.ud(),this.d_.vt().vl().Ji(this.ud.bind(this),this),this.Rv=new mn(this.Lv.canvas,this,{Oc:!0,Fc:!1})}return t.prototype.en=function(){this.Rv.en(),null!==this.Q_&&this.Q_.en(),null!==this.td&&this.td.en(),this.Lv.unsubscribeCanvasConfigured(this.Cv),this.Lv.destroy(),this.Av.unsubscribeCanvasConfigured(this.xv),this.Av.destroy()},t.prototype.Iv=function(){return this.hd},t.prototype.ad=function(){return this.Q_},t.prototype.od=function(){return this.td},t.prototype.qc=function(t){if(!this.nd){this.nd=!0;var i=this.d_.vt();!i.j().ti()&&this.d_.ct().handleScale.axisPressedMouseMove.time&&i.pf(t.rv)}},t.prototype.Hc=function(){var t=this.d_.vt();!t.j().ti()&&this.nd&&(this.nd=!1,this.d_.ct().handleScale.axisPressedMouseMove.time&&t.Cf())},t.prototype.Vc=function(t){var i=this.d_.vt();!i.j().ti()&&this.d_.ct().handleScale.axisPressedMouseMove.time&&i.Sf(t.rv)},t.prototype.Rc=function(t){this.nd=!1;var i=this.d_.vt();i.j().ti()&&!this.d_.ct().handleScale.axisPressedMouseMove.time||i.Cf()},t.prototype.Ic=function(){this.d_.ct().handleScale.axisDoubleClickReset&&this.d_.vt().Ne()},t.prototype.Tc=function(t){this.d_.vt().ct().handleScale.axisPressedMouseMove.time&&this.n_(1)},t.prototype.Qc=function(t){this.n_(0)},t.prototype.z_=function(){return this.bv},t.prototype.ld=function(t,i,n){this.bv&&this.bv.on(t)||(this.bv=t,this.Av.resizeCanvas({width:t.ht,height:t.st}),this.Lv.resizeCanvas({width:t.ht,height:t.st}),this.Tv.style.width=t.ht+"px",this.Tv.style.height=t.st+"px"),null!==this.Q_&&this.Q_.Yv(new an(i,t.st)),null!==this.td&&this.td.Yv(new an(n,t.st))},t.prototype.fd=function(){var t=this.vd();return Math.ceil(t.Tt+t.Dt+t.Pt+t.At+t.Lt)},t.prototype.V=function(){this.d_.vt().j().Bn()},t.prototype.i_=function(){return this.Av.canvas},t.prototype.Xv=function(t){if(0!==t){if(1!==t){var i=ln(this.Av.canvas);this.Jv(i,this.Av.pixelRatio),this.vu(i,this.Av.pixelRatio),this.Gv(i,this.Av.pixelRatio),null!==this.Q_&&this.Q_.Xv(t),null!==this.td&&this.td.Xv(t)}var n=ln(this.Lv.canvas),h=this.Lv.pixelRatio;n.clearRect(0,0,Math.ceil(this.bv.ht*h),Math.ceil(this.bv.st*h)),this._d([this.d_.vt().wf()],n,h)}},t.prototype.Jv=function(t,i){var n=this;z(t,i,(function(){R(t,0,0,n.bv.ht,n.bv.st,n.d_.vt().Pf())}))},t.prototype.vu=function(t,i){if(this.d_.ct().timeScale.borderVisible){t.save(),t.fillStyle=this.dd();var n=Math.max(1,Math.floor(this.vd().Tt*i));t.fillRect(0,0,Math.ceil(this.bv.ht*i),n),t.restore()}},t.prototype.Gv=function(t,i){var n=this,h=this.d_.vt().j().Bn();if(h&&0!==h.length){var s=h.reduce(Bn,h[0]).Rs;s>30&&s<40&&(s=30),t.save(),t.strokeStyle=this.dd();var r=this.vd(),e=r.Tt+r.Dt+r.At+r.Pt-r.Vt;t.textAlign="center",t.fillStyle=this.dd();var u=Math.floor(this.vd().Tt*i),a=Math.max(1,Math.floor(i)),o=Math.floor(.5*i);if(this.d_.vt().j().ct().borderVisible){t.beginPath();for(var l=Math.round(r.Dt*i),f=h.length;f--;){var c=Math.round(h[f].Tn*i);t.rect(c-o,u,a,l)}t.fill()}t.fillStyle=this.ve(),z(t,i,(function(){t.font=n.wd();for(var i=0,r=h;i=s){u=l.Wr?n.Md(t,l.Tn,l.An):l.Tn;t.fillText(l.An,u,e)}}}))}},t.prototype.Md=function(t,i,n){var h=this.gv.Ft(t,n),s=h/2,r=Math.floor(i-s)+.5;return r<0?i+=Math.abs(0-r):r+h>this.bv.ht&&(i-=Math.abs(this.bv.ht-(r+h))),i},t.prototype._d=function(t,i,n){for(var h=this.vd(),s=0,r=t;s0&&(this.si.Fr(),this.si.Ao(),this.si.Vr()),this.Td.V()}this.Xv(t)},t.prototype.Ce=function(t){var i=this.si.j();switch(t.ke){case 0:i.Qr();break;case 1:i.te(t.X);break;case 2:i.dr(t.X);break;case 3:i.wr(t.X);break;case 4:i.jr()}},t.prototype.Jl=function(t){var i=this;null!==this.kd?this.kd._n(t):this.kd=t,this.xd||(this.xd=!0,this.pd=window.requestAnimationFrame((function(){i.xd=!1,i.pd=0,null!==i.kd&&(i.Od(i.kd),i.kd=null)})))},t.prototype.Id=function(){this.Ld()},t.prototype.Ld=function(){for(var t=this.si._f(),i=t.length,n=this.md.length,h=i;h=0;--s)if(Math.floor(n.getTime()/Hn[s].Kd)!==Math.floor(h.getTime()/Hn[s].Kd))return Hn[s].Rs}return 20}function Kn(t){if(!zt(t))throw new Error("time must be of type BusinessDay");var i=new Date(Date.UTC(t.year,t.month-1,t.day,0,0,0,0));return{Ds:Math.round(i.getTime()/1e3),Cs:t}}function $n(t){if(!Rt(t))throw new Error("time must be of type isUTCTimestamp");return{Ds:t}}function Xn(t){return 0===t.length?null:zt(t[0].time)?Kn:$n}function Zn(t){return Rt(t)?$n(t):zt(t)?Kn(t):Kn(Jn(t))}function Jn(t){var i=new Date(t);if(isNaN(i.getTime()))throw new Error("Invalid date string="+t+", expected format=yyyy-mm-dd");return{day:i.getUTCDate(),month:i.getUTCMonth()+1,year:i.getUTCFullYear()}}function Gn(t){d(t.time)&&(t.time=Jn(t.time))}function Qn(t){return{zs:0,$d:new Map,Rh:t}}var th=function(){function t(){this.Xd=new Map,this.Zd=new Map,this.Jd=new Map,this.Gd=[]}return t.prototype.en=function(){this.Xd.clear(),this.Zd.clear(),this.Jd.clear(),this.Gd=[]},t.prototype.Qd=function(t,i){var n=this;this.Jd.has(t)&&this.Xd.forEach((function(i){return i.$d.delete(t)}));var h=[];if(0!==i.length){!function(t){t.forEach(Gn)}(i);var s=l(Xn(i)),r=Wn(t.Pa());h=i.map((function(i){var h=s(i.time),e=n.Xd.get(h.Ds);void 0===e&&(e=Qn(h),n.Xd.set(h.Ds,e));var u=r(h,e.zs,i);return e.$d.set(t,u),u}))}return this.tw(),this.iw(t,h),this.nw(t)},t.prototype.Of=function(t){return this.Qd(t,[])},t.prototype.hw=function(t,i){Gn(i);var n=l(Xn([i]))(i.time),h=this.Jd.get(t);if(void 0!==h&&n.Dss.zs)return{barsBefore:t.from-r,barsAfter:e-t.to};var u={barsBefore:null===h||h.zs===r?t.from-r:h.zs-r,barsAfter:null===s||s.zs===e?e-t.to:e-s.zs};return null!==h&&null!==s&&(u.from=h.C.Cs||h.C.Ds,u.to=s.C.Cs||s.C.Ds),u},t.prototype.setData=function(t){this.Ie.Pa(),this.lw.cw(this.Ie,t)},t.prototype.update=function(t){this.Ie.Pa(),this.lw.Eo(this.Ie,t)},t.prototype.setMarkers=function(t){var i=t.map((function(t){return e(e({},t),{time:Zn(t.time)})}));this.Ie.Fo(i)},t.prototype.applyOptions=function(t){var i=hh(t);this.Ie.sh(i)},t.prototype.options=function(){return M(this.Ie.ct())},t.prototype.priceScale=function(){return this.fw.priceScale(this.Ie.$().hh())},t.prototype.createPriceLine=function(t){var i=c(M(ih),t),n=this.Ie.Vo(i);return new nh(n)},t.prototype.removePriceLine=function(t){this.Ie.Po(t.ow())},t.prototype.seriesType=function(){return this.Ie.Pa()},t}(),rh=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return r(i,t),i.prototype.applyOptions=function(i){kt(i),t.prototype.applyOptions.call(this,i)},i}(sh),eh={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:"#2B2B43",entireTextOnly:!1,visible:!1,drawTicks:!0,scaleMargins:{bottom:.1,top:.2}},uh={color:"rgba(0, 0, 0, 0)",visible:!1,fontSize:48,fontFamily:It,fontStyle:"",text:"",horzAlign:"center",vertAlign:"center"},ah={width:0,height:0,layout:{background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:11,fontFamily:It},crosshair:{vertLine:{color:"#758696",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#4c525e"},horzLine:{color:"#758696",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#4c525e"},mode:1},grid:{vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},overlayPriceScales:e({},eh),leftPriceScale:e(e({},eh),{visible:!1}),rightPriceScale:e(e({},eh),{visible:!0}),timeScale:{rightOffset:0,barSpacing:6,minBarSpacing:.5,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:"#2B2B43",visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0},watermark:uh,localization:{locale:wn?navigator.language:"",dateFormat:"dd MMM 'yy"},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:!0,mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0}},oh={upColor:"#26a69a",downColor:"#ef5350",wickVisible:!0,borderVisible:!0,borderColor:"#378658",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"#737375",wickUpColor:"#26a69a",wickDownColor:"#ef5350"},lh={upColor:"#26a69a",downColor:"#ef5350",openVisible:!0,thinBars:!0},fh={color:"#2196f3",lineStyle:0,lineWidth:3,lineType:0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBackgroundColor:"",lastPriceAnimation:0},ch={topColor:"rgba( 46, 220, 135, 0.4)",bottomColor:"rgba( 40, 221, 100, 0)",lineColor:"#33D778",lineStyle:0,lineWidth:3,lineType:0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBackgroundColor:"",lastPriceAnimation:0},vh={color:"#26a69a",base:0},_h={title:"",visible:!0,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:"",priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:"#B2B5BE",baseLineStyle:0,priceFormat:{type:"price",precision:2,minMove:.01}},dh=function(){function t(t,i){this._w=t,this.dw=i}return t.prototype.applyOptions=function(t){this._w.vt().cf(this.dw,t)},t.prototype.options=function(){return this.Gt().ct()},t.prototype.width=function(){return Ut(this.dw)?this._w.zd("left"===this.dw?"left":"right"):0},t.prototype.Gt=function(){return l(this._w.vt().vf(this.dw)).$},t}(),wh=function(){function t(t){this.ww=new tt,this.ir=new tt,this.si=t,this.rl().Xr().Ji(this.Mw.bind(this)),this.rl().Zr().Ji(this.bw.bind(this))}return t.prototype.en=function(){this.rl().Xr().hn(this),this.rl().Zr().hn(this),this.ww.en()},t.prototype.scrollPosition=function(){return this.rl().Rr()},t.prototype.scrollToPosition=function(t,i){i?this.rl().$r(t,1e3):this.si.wr(t)},t.prototype.scrollToRealTime=function(){this.rl().Kr()},t.prototype.getVisibleRange=function(){var t,i,n=this.rl().gr();return null===n?null:{from:null!==(t=n.from.Cs)&&void 0!==t?t:n.from.Ds,to:null!==(i=n.to.Cs)&&void 0!==i?i:n.to.Ds}},t.prototype.setVisibleRange=function(t){var i={from:Zn(t.from),to:Zn(t.to)},n=this.rl().Sr(i);this.si.Ff(n)},t.prototype.getVisibleLogicalRange=function(){var t=this.rl().pr();return null===t?null:{from:t.ss(),to:t.rs()}},t.prototype.setVisibleLogicalRange=function(t){a(t.from<=t.to,"The from index cannot be after the to index."),this.si.Ff(t)},t.prototype.resetTimeScale=function(){this.si.Ne()},t.prototype.fitContent=function(){this.si.Qr()},t.prototype.logicalToCoordinate=function(t){var i=this.si.j();return i.ti()?null:i.G(t)},t.prototype.coordinateToLogical=function(t){var i=this.si.j();return i.ti()?null:i.Br(t)},t.prototype.timeToCoordinate=function(t){var i=Zn(t),n=this.si.j(),h=n.Mr(i,!1);return null===h?null:n.G(h)},t.prototype.coordinateToTime=function(t){var i,n=this.si.j(),h=n.Br(t),s=n.ri(h);return null===s?null:null!==(i=s.Cs)&&void 0!==i?i:s.Ds},t.prototype.subscribeVisibleTimeRangeChange=function(t){this.ww.Ji(t)},t.prototype.unsubscribeVisibleTimeRangeChange=function(t){this.ww.nn(t)},t.prototype.subscribeVisibleLogicalRangeChange=function(t){this.ir.Ji(t)},t.prototype.unsubscribeVisibleLogicalRangeChange=function(t){this.ir.nn(t)},t.prototype.applyOptions=function(t){this.rl().sh(t)},t.prototype.options=function(){return M(this.rl().ct())},t.prototype.rl=function(){return this.si.j()},t.prototype.Mw=function(){this.ww.rn()&&this.ww.sn(this.getVisibleRange())},t.prototype.bw=function(){this.ir.rn()&&this.ir.sn(this.getVisibleLogicalRange())},t}();function Mh(t){if(void 0!==t&&"custom"!==t.type){var i=t;void 0!==i.minMove&&void 0===i.precision&&(i.precision=function(t){if(t>=1)return 0;for(var i=0;i<8;i++){var n=Math.round(t);if(Math.abs(n-t)<1e-8)return i;t*=10}return i}(i.minMove))}}function bh(t){return function(t){if(w(t.handleScale)){var i=t.handleScale;t.handleScale={axisDoubleClickReset:i,axisPressedMouseMove:{time:i,price:i},mouseWheel:i,pinch:i}}else if(void 0!==t.handleScale&&w(t.handleScale.axisPressedMouseMove)){var n=t.handleScale.axisPressedMouseMove;t.handleScale.axisPressedMouseMove={time:n,price:n}}var h=t.handleScroll;w(h)&&(t.handleScroll={horzTouchDrag:h,vertTouchDrag:h,mouseWheel:h,pressedMouseMove:h})}(t),function(t){if(t.priceScale){t.leftPriceScale=t.leftPriceScale||{},t.rightPriceScale=t.rightPriceScale||{};var i=t.priceScale.position;delete t.priceScale.position,t.leftPriceScale=c(t.leftPriceScale,t.priceScale),t.rightPriceScale=c(t.rightPriceScale,t.priceScale),"left"===i&&(t.leftPriceScale.visible=!0,t.rightPriceScale.visible=!1),"right"===i&&(t.leftPriceScale.visible=!1,t.rightPriceScale.visible=!0),"none"===i&&(t.leftPriceScale.visible=!1,t.rightPriceScale.visible=!1),t.overlayPriceScales=t.overlayPriceScales||{},void 0!==t.priceScale.invertScale&&(t.overlayPriceScales.invertScale=t.priceScale.invertScale),void 0!==t.priceScale.scaleMargins&&(t.overlayPriceScales.scaleMargins=t.priceScale.scaleMargins)}}(t),function(t){t.layout&&t.layout.backgroundColor&&!t.layout.background&&(t.layout.background={type:"solid",color:t.layout.backgroundColor})}(t),t}var mh=function(){function t(t,i){var n=this;this.mw=new th,this.pw=new Map,this.gw=new Map,this.yw=new tt,this.kw=new tt;var h=void 0===i?M(ah):c(M(ah),bh(i));this._w=new Fn(t,h),this._w.F_().Ji((function(t){n.yw.rn()&&n.yw.sn(n.xw(t()))}),this),this._w.Mf().Ji((function(t){n.kw.rn()&&n.kw.sn(n.xw(t()))}),this);var s=this._w.vt();this.Nw=new wh(s)}return t.prototype.remove=function(){this._w.F_().hn(this),this._w.Mf().hn(this),this.Nw.en(),this._w.en(),this.pw.clear(),this.gw.clear(),this.yw.en(),this.kw.en(),this.mw.en()},t.prototype.resize=function(t,i,n){this._w.Ad(t,i,n)},t.prototype.addAreaSeries=function(t){void 0===t&&(t={}),Mh((t=hh(t)).priceFormat);var i=c(M(_h),ch,t),n=this._w.vt().Ef("Area",i),h=new sh(n,this,this);return this.pw.set(h,n),this.gw.set(n,h),h},t.prototype.addBarSeries=function(t){void 0===t&&(t={}),Mh((t=hh(t)).priceFormat);var i=c(M(_h),lh,t),n=this._w.vt().Ef("Bar",i),h=new sh(n,this,this);return this.pw.set(h,n),this.gw.set(n,h),h},t.prototype.addCandlestickSeries=function(t){void 0===t&&(t={}),kt(t=hh(t)),Mh(t.priceFormat);var i=c(M(_h),oh,t),n=this._w.vt().Ef("Candlestick",i),h=new rh(n,this,this);return this.pw.set(h,n),this.gw.set(n,h),h},t.prototype.addHistogramSeries=function(t){void 0===t&&(t={}),Mh((t=hh(t)).priceFormat);var i=c(M(_h),vh,t),n=this._w.vt().Ef("Histogram",i),h=new sh(n,this,this);return this.pw.set(h,n),this.gw.set(n,h),h},t.prototype.addLineSeries=function(t){void 0===t&&(t={}),Mh((t=hh(t)).priceFormat);var i=c(M(_h),fh,t),n=this._w.vt().Ef("Line",i),h=new sh(n,this,this);return this.pw.set(h,n),this.gw.set(n,h),h},t.prototype.removeSeries=function(t){var i=o(this.pw.get(t)),n=this.mw.Of(i);this._w.vt().Of(i),this.Sw(n),this.pw.delete(t),this.gw.delete(i)},t.prototype.cw=function(t,i){this.Sw(this.mw.Qd(t,i))},t.prototype.Eo=function(t,i){this.Sw(this.mw.hw(t,i))},t.prototype.subscribeClick=function(t){this.yw.Ji(t)},t.prototype.unsubscribeClick=function(t){this.yw.nn(t)},t.prototype.subscribeCrosshairMove=function(t){this.kw.Ji(t)},t.prototype.unsubscribeCrosshairMove=function(t){this.kw.nn(t)},t.prototype.priceScale=function(t){return void 0===t&&(t=this._w.vt().Vf()),new dh(this._w,t)},t.prototype.timeScale=function(){return this.Nw},t.prototype.applyOptions=function(t){this._w.sh(bh(t))},t.prototype.options=function(){return this._w.ct()},t.prototype.takeScreenshot=function(){return this._w.Fd()},t.prototype.Sw=function(t){var i=this._w.vt();i.Af(t.j.Lr,t.j.aw),t.rw.forEach((function(t,i){return i.Eo(t.Wu,t.rf)})),i.Fr()},t.prototype.Cw=function(t){return o(this.gw.get(t))},t.prototype.xw=function(t){var i=this,n=new Map;t.Hd.forEach((function(t,h){n.set(i.Cw(h),t)}));var h=void 0===t.qd?void 0:this.Cw(t.qd);return{time:t.C&&(t.C.Cs||t.C.Ds),point:t.Ud,hoveredSeries:h,hoveredMarkerId:t.Yd,seriesPrices:n}},t}();var ph=Object.freeze({__proto__:null,version:function(){return"3.6.1"},get LineStyle(){return i},get LineType(){return t},get CrosshairMode(){return W},get PriceScaleMode(){return _t},get PriceLineSource(){return mt},get LastPriceAnimationMode(){return bt},get LasPriceAnimationMode(){return bt},get TickMarkType(){return Bt},get ColorType(){return Vt},isBusinessDay:zt,isUTCTimestamp:Rt,createChart:function(t,i){var n;if(d(t)){var h=document.getElementById(t);a(null!==h,"Cannot find element in DOM with id="+t),n=h}else n=t;return new mh(n,i)}});window.LightweightCharts=ph}();
diff --git a/LightweightCharts/Assets/wrapper_functions.js b/Sources/LightweightCharts/Assets/wrapper_functions.js
similarity index 100%
rename from LightweightCharts/Assets/wrapper_functions.js
rename to Sources/LightweightCharts/Assets/wrapper_functions.js
diff --git a/Sources/LightweightCharts/Extensions/Bundle+Resources.swift b/Sources/LightweightCharts/Extensions/Bundle+Resources.swift
new file mode 100644
index 0000000..63baaa3
--- /dev/null
+++ b/Sources/LightweightCharts/Extensions/Bundle+Resources.swift
@@ -0,0 +1,7 @@
+import Foundation
+
+extension Bundle {
+ static var module: Bundle = {
+ Bundle(for: LightweightCharts.self)
+ }()
+}
diff --git a/LightweightCharts/Classes/Extensions/Encodable+JSONString.swift b/Sources/LightweightCharts/Extensions/Encodable+JSONString.swift
similarity index 100%
rename from LightweightCharts/Classes/Extensions/Encodable+JSONString.swift
rename to Sources/LightweightCharts/Extensions/Encodable+JSONString.swift
diff --git a/LightweightCharts/Classes/Extensions/Int+ColorComponent.swift b/Sources/LightweightCharts/Extensions/Int+ColorComponent.swift
similarity index 100%
rename from LightweightCharts/Classes/Extensions/Int+ColorComponent.swift
rename to Sources/LightweightCharts/Extensions/Int+ColorComponent.swift
diff --git a/LightweightCharts/Classes/Extensions/NSRegularExpression+Color.swift b/Sources/LightweightCharts/Extensions/NSRegularExpression+Color.swift
similarity index 100%
rename from LightweightCharts/Classes/Extensions/NSRegularExpression+Color.swift
rename to Sources/LightweightCharts/Extensions/NSRegularExpression+Color.swift
diff --git a/LightweightCharts/Classes/Extensions/String+UniqueString.swift b/Sources/LightweightCharts/Extensions/String+UniqueString.swift
similarity index 100%
rename from LightweightCharts/Classes/Extensions/String+UniqueString.swift
rename to Sources/LightweightCharts/Extensions/String+UniqueString.swift
diff --git a/LightweightCharts/Classes/Extensions/UIColor+ColorComponents.swift b/Sources/LightweightCharts/Extensions/UIColor+ColorComponents.swift
similarity index 95%
rename from LightweightCharts/Classes/Extensions/UIColor+ColorComponents.swift
rename to Sources/LightweightCharts/Extensions/UIColor+ColorComponents.swift
index ce6e75c..cbd41aa 100644
--- a/LightweightCharts/Classes/Extensions/UIColor+ColorComponents.swift
+++ b/Sources/LightweightCharts/Extensions/UIColor+ColorComponents.swift
@@ -1,4 +1,5 @@
import Foundation
+import UIKit
extension UIColor {
diff --git a/LightweightCharts/Classes/Implementations/API/Chart.swift b/Sources/LightweightCharts/Implementations/API/Chart.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/API/Chart.swift
rename to Sources/LightweightCharts/Implementations/API/Chart.swift
diff --git a/LightweightCharts/Classes/Implementations/API/LightweightCharts.swift b/Sources/LightweightCharts/Implementations/API/LightweightCharts.swift
similarity index 98%
rename from LightweightCharts/Classes/Implementations/API/LightweightCharts.swift
rename to Sources/LightweightCharts/Implementations/API/LightweightCharts.swift
index c213c1a..11fada4 100644
--- a/LightweightCharts/Classes/Implementations/API/LightweightCharts.swift
+++ b/Sources/LightweightCharts/Implementations/API/LightweightCharts.swift
@@ -104,9 +104,11 @@ public class LightweightCharts: UIView {
}
private func loadScript(withName fileName: String) throws -> String {
- let bundle = Bundle(for: LightweightCharts.self)
+ let bundle = Bundle.module
let pathForJSRuntime = bundle.path(forResource: fileName, ofType: "js")
- guard let path = pathForJSRuntime else { return "" }
+ guard let path = pathForJSRuntime else {
+ return ""
+ }
return try String(contentsOfFile: path, encoding: .utf8)
}
diff --git a/LightweightCharts/Classes/Implementations/API/PriceFormatter.swift b/Sources/LightweightCharts/Implementations/API/PriceFormatter.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/API/PriceFormatter.swift
rename to Sources/LightweightCharts/Implementations/API/PriceFormatter.swift
diff --git a/LightweightCharts/Classes/Implementations/API/PriceLine.swift b/Sources/LightweightCharts/Implementations/API/PriceLine.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/API/PriceLine.swift
rename to Sources/LightweightCharts/Implementations/API/PriceLine.swift
diff --git a/LightweightCharts/Classes/Implementations/API/PriceScale.swift b/Sources/LightweightCharts/Implementations/API/PriceScale.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/API/PriceScale.swift
rename to Sources/LightweightCharts/Implementations/API/PriceScale.swift
diff --git a/LightweightCharts/Classes/Implementations/API/Series/AreaSeries.swift b/Sources/LightweightCharts/Implementations/API/Series/AreaSeries.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/API/Series/AreaSeries.swift
rename to Sources/LightweightCharts/Implementations/API/Series/AreaSeries.swift
diff --git a/LightweightCharts/Classes/Implementations/API/Series/BarSeries.swift b/Sources/LightweightCharts/Implementations/API/Series/BarSeries.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/API/Series/BarSeries.swift
rename to Sources/LightweightCharts/Implementations/API/Series/BarSeries.swift
diff --git a/LightweightCharts/Classes/Implementations/API/Series/CandlestickSeries.swift b/Sources/LightweightCharts/Implementations/API/Series/CandlestickSeries.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/API/Series/CandlestickSeries.swift
rename to Sources/LightweightCharts/Implementations/API/Series/CandlestickSeries.swift
diff --git a/LightweightCharts/Classes/Implementations/API/Series/HistogramSeries.swift b/Sources/LightweightCharts/Implementations/API/Series/HistogramSeries.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/API/Series/HistogramSeries.swift
rename to Sources/LightweightCharts/Implementations/API/Series/HistogramSeries.swift
diff --git a/LightweightCharts/Classes/Implementations/API/Series/LineSeries.swift b/Sources/LightweightCharts/Implementations/API/Series/LineSeries.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/API/Series/LineSeries.swift
rename to Sources/LightweightCharts/Implementations/API/Series/LineSeries.swift
diff --git a/LightweightCharts/Classes/Implementations/API/Series/SeriesApi+Extension.swift b/Sources/LightweightCharts/Implementations/API/Series/SeriesApi+Extension.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/API/Series/SeriesApi+Extension.swift
rename to Sources/LightweightCharts/Implementations/API/Series/SeriesApi+Extension.swift
diff --git a/LightweightCharts/Classes/Implementations/API/Series/SeriesObject.swift b/Sources/LightweightCharts/Implementations/API/Series/SeriesObject.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/API/Series/SeriesObject.swift
rename to Sources/LightweightCharts/Implementations/API/Series/SeriesObject.swift
diff --git a/LightweightCharts/Classes/Implementations/API/TimeScale.swift b/Sources/LightweightCharts/Implementations/API/TimeScale.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/API/TimeScale.swift
rename to Sources/LightweightCharts/Implementations/API/TimeScale.swift
diff --git a/LightweightCharts/Classes/Implementations/JavaScriptEvaluator.swift b/Sources/LightweightCharts/Implementations/JavaScriptEvaluator.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/JavaScriptEvaluator.swift
rename to Sources/LightweightCharts/Implementations/JavaScriptEvaluator.swift
diff --git a/LightweightCharts/Classes/Implementations/JavaScriptMessageProducer.swift b/Sources/LightweightCharts/Implementations/JavaScriptMessageProducer.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/JavaScriptMessageProducer.swift
rename to Sources/LightweightCharts/Implementations/JavaScriptMessageProducer.swift
diff --git a/LightweightCharts/Classes/Implementations/JavaScriptObject.swift b/Sources/LightweightCharts/Implementations/JavaScriptObject.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/JavaScriptObject.swift
rename to Sources/LightweightCharts/Implementations/JavaScriptObject.swift
diff --git a/LightweightCharts/Classes/Implementations/Subscription/MessageHandler.swift b/Sources/LightweightCharts/Implementations/Subscription/MessageHandler.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/Subscription/MessageHandler.swift
rename to Sources/LightweightCharts/Implementations/Subscription/MessageHandler.swift
diff --git a/LightweightCharts/Classes/Implementations/Subscription/Subscription.swift b/Sources/LightweightCharts/Implementations/Subscription/Subscription.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/Subscription/Subscription.swift
rename to Sources/LightweightCharts/Implementations/Subscription/Subscription.swift
diff --git a/LightweightCharts/Classes/Implementations/SyncScriptEvaluating/JavaScriptMethod.swift b/Sources/LightweightCharts/Implementations/SyncScriptEvaluating/JavaScriptMethod.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/SyncScriptEvaluating/JavaScriptMethod.swift
rename to Sources/LightweightCharts/Implementations/SyncScriptEvaluating/JavaScriptMethod.swift
diff --git a/LightweightCharts/Classes/Implementations/SyncScriptEvaluating/JavaScriptSyncMethod.swift b/Sources/LightweightCharts/Implementations/SyncScriptEvaluating/JavaScriptSyncMethod.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/SyncScriptEvaluating/JavaScriptSyncMethod.swift
rename to Sources/LightweightCharts/Implementations/SyncScriptEvaluating/JavaScriptSyncMethod.swift
diff --git a/LightweightCharts/Classes/Implementations/SyncScriptEvaluating/PromptHandler.swift b/Sources/LightweightCharts/Implementations/SyncScriptEvaluating/PromptHandler.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/SyncScriptEvaluating/PromptHandler.swift
rename to Sources/LightweightCharts/Implementations/SyncScriptEvaluating/PromptHandler.swift
diff --git a/LightweightCharts/Classes/Implementations/WebView.swift b/Sources/LightweightCharts/Implementations/WebView.swift
similarity index 100%
rename from LightweightCharts/Classes/Implementations/WebView.swift
rename to Sources/LightweightCharts/Implementations/WebView.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/AutoscaleInfoProvider.swift b/Sources/LightweightCharts/LightweightChartsModels/AutoscaleInfoProvider.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/AutoscaleInfoProvider.swift
rename to Sources/LightweightCharts/LightweightChartsModels/AutoscaleInfoProvider.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/AxisPressedMouseMoveOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/AxisPressedMouseMoveOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/AxisPressedMouseMoveOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/AxisPressedMouseMoveOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/BarPrice.swift b/Sources/LightweightCharts/LightweightChartsModels/BarPrice.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/BarPrice.swift
rename to Sources/LightweightCharts/LightweightChartsModels/BarPrice.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/BarsInfo.swift b/Sources/LightweightCharts/LightweightChartsModels/BarsInfo.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/BarsInfo.swift
rename to Sources/LightweightCharts/LightweightChartsModels/BarsInfo.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/BusinessDay.swift b/Sources/LightweightCharts/LightweightChartsModels/BusinessDay.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/BusinessDay.swift
rename to Sources/LightweightCharts/LightweightChartsModels/BusinessDay.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/ChartColor.swift b/Sources/LightweightCharts/LightweightChartsModels/ChartColor.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/ChartColor.swift
rename to Sources/LightweightCharts/LightweightChartsModels/ChartColor.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/ColorType.swift b/Sources/LightweightCharts/LightweightChartsModels/ColorType.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/ColorType.swift
rename to Sources/LightweightCharts/LightweightChartsModels/ColorType.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Coordinate.swift b/Sources/LightweightCharts/LightweightChartsModels/Coordinate.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Coordinate.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Coordinate.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Data/SeriesData/BarData.swift b/Sources/LightweightCharts/LightweightChartsModels/Data/SeriesData/BarData.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Data/SeriesData/BarData.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Data/SeriesData/BarData.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Data/SeriesData/HistogramData.swift b/Sources/LightweightCharts/LightweightChartsModels/Data/SeriesData/HistogramData.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Data/SeriesData/HistogramData.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Data/SeriesData/HistogramData.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Data/SeriesData/LineData.swift b/Sources/LightweightCharts/LightweightChartsModels/Data/SeriesData/LineData.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Data/SeriesData/LineData.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Data/SeriesData/LineData.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Data/SeriesData/SeriesData.swift b/Sources/LightweightCharts/LightweightChartsModels/Data/SeriesData/SeriesData.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Data/SeriesData/SeriesData.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Data/SeriesData/SeriesData.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Data/SeriesData/SeriesDataType.swift b/Sources/LightweightCharts/LightweightChartsModels/Data/SeriesData/SeriesDataType.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Data/SeriesData/SeriesDataType.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Data/SeriesData/SeriesDataType.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Data/SeriesData/WhitespaceData.swift b/Sources/LightweightCharts/LightweightChartsModels/Data/SeriesData/WhitespaceData.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Data/SeriesData/WhitespaceData.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Data/SeriesData/WhitespaceData.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/FromToRange.swift b/Sources/LightweightCharts/LightweightChartsModels/FromToRange.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/FromToRange.swift
rename to Sources/LightweightCharts/LightweightChartsModels/FromToRange.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/MouseEventParams.swift b/Sources/LightweightCharts/LightweightChartsModels/MouseEventParams.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/MouseEventParams.swift
rename to Sources/LightweightCharts/LightweightChartsModels/MouseEventParams.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/Basics/LastPriceAnimationMode.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/Basics/LastPriceAnimationMode.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/Basics/LastPriceAnimationMode.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/Basics/LastPriceAnimationMode.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/Basics/LineStyle.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/Basics/LineStyle.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/Basics/LineStyle.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/Basics/LineStyle.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/Basics/LineType.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/Basics/LineType.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/Basics/LineType.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/Basics/LineType.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/Basics/LineWidth.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/Basics/LineWidth.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/Basics/LineWidth.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/Basics/LineWidth.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/Basics/PriceLineOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/Basics/PriceLineOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/Basics/PriceLineOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/Basics/PriceLineOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/Basics/PriceLineSource.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/Basics/PriceLineSource.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/Basics/PriceLineSource.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/Basics/PriceLineSource.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/Basics/PriceScaleOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/Basics/PriceScaleOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/Basics/PriceScaleOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/Basics/PriceScaleOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/Basics/TimeScaleOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/Basics/TimeScaleOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/Basics/TimeScaleOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/Basics/TimeScaleOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/ChartOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/ChartOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/ChartOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/ChartOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/CrosshairLineOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/CrosshairLineOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/CrosshairLineOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/CrosshairLineOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/CrosshairOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/CrosshairOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/CrosshairOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/CrosshairOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/GridLineOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/GridLineOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/GridLineOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/GridLineOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/GridOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/GridOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/GridOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/GridOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/HandleScaleOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/HandleScaleOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/HandleScaleOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/HandleScaleOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/HandleScrollOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/HandleScrollOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/HandleScrollOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/HandleScrollOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/KineticScrollOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/KineticScrollOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/KineticScrollOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/KineticScrollOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/LayoutOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/LayoutOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/LayoutOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/LayoutOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/LocalizationOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/LocalizationOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/LocalizationOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/LocalizationOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/WatermarkOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/WatermarkOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/ChartOptions/WatermarkOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/ChartOptions/WatermarkOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/SeriesOptions/Options/AreaSeriesOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/SeriesOptions/Options/AreaSeriesOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/SeriesOptions/Options/AreaSeriesOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/SeriesOptions/Options/AreaSeriesOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/SeriesOptions/Options/BarSeriesOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/SeriesOptions/Options/BarSeriesOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/SeriesOptions/Options/BarSeriesOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/SeriesOptions/Options/BarSeriesOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/SeriesOptions/Options/CandlestickSeriesOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/SeriesOptions/Options/CandlestickSeriesOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/SeriesOptions/Options/CandlestickSeriesOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/SeriesOptions/Options/CandlestickSeriesOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/SeriesOptions/Options/HistogramSeriesOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/SeriesOptions/Options/HistogramSeriesOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/SeriesOptions/Options/HistogramSeriesOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/SeriesOptions/Options/HistogramSeriesOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/SeriesOptions/Options/LineSeriesOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/SeriesOptions/Options/LineSeriesOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/SeriesOptions/Options/LineSeriesOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/SeriesOptions/Options/LineSeriesOptions.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Options/SeriesOptions/SeriesOptionsCommon.swift b/Sources/LightweightCharts/LightweightChartsModels/Options/SeriesOptions/SeriesOptionsCommon.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Options/SeriesOptions/SeriesOptionsCommon.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Options/SeriesOptions/SeriesOptionsCommon.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Point.swift b/Sources/LightweightCharts/LightweightChartsModels/Point.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Point.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Point.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/PriceFormat.swift b/Sources/LightweightCharts/LightweightChartsModels/PriceFormat.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/PriceFormat.swift
rename to Sources/LightweightCharts/LightweightChartsModels/PriceFormat.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/SeriesMarker/SeriesMarker.swift b/Sources/LightweightCharts/LightweightChartsModels/SeriesMarker/SeriesMarker.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/SeriesMarker/SeriesMarker.swift
rename to Sources/LightweightCharts/LightweightChartsModels/SeriesMarker/SeriesMarker.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/SeriesType.swift b/Sources/LightweightCharts/LightweightChartsModels/SeriesType.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/SeriesType.swift
rename to Sources/LightweightCharts/LightweightChartsModels/SeriesType.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/SurfaceColor.swift b/Sources/LightweightCharts/LightweightChartsModels/SurfaceColor.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/SurfaceColor.swift
rename to Sources/LightweightCharts/LightweightChartsModels/SurfaceColor.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/TickMarkFormatter.swift b/Sources/LightweightCharts/LightweightChartsModels/TickMarkFormatter.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/TickMarkFormatter.swift
rename to Sources/LightweightCharts/LightweightChartsModels/TickMarkFormatter.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/Time.swift b/Sources/LightweightCharts/LightweightChartsModels/Time.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/Time.swift
rename to Sources/LightweightCharts/LightweightChartsModels/Time.swift
diff --git a/LightweightCharts/Classes/LightweightChartsModels/TogglableOptions.swift b/Sources/LightweightCharts/LightweightChartsModels/TogglableOptions.swift
similarity index 100%
rename from LightweightCharts/Classes/LightweightChartsModels/TogglableOptions.swift
rename to Sources/LightweightCharts/LightweightChartsModels/TogglableOptions.swift
diff --git a/LightweightCharts/Classes/Protocols/ChartApi.swift b/Sources/LightweightCharts/Protocols/ChartApi.swift
similarity index 100%
rename from LightweightCharts/Classes/Protocols/ChartApi.swift
rename to Sources/LightweightCharts/Protocols/ChartApi.swift
diff --git a/LightweightCharts/Classes/Protocols/PriceFormatterApi.swift b/Sources/LightweightCharts/Protocols/PriceFormatterApi.swift
similarity index 100%
rename from LightweightCharts/Classes/Protocols/PriceFormatterApi.swift
rename to Sources/LightweightCharts/Protocols/PriceFormatterApi.swift
diff --git a/LightweightCharts/Classes/Protocols/PriceLineApi.swift b/Sources/LightweightCharts/Protocols/PriceLineApi.swift
similarity index 100%
rename from LightweightCharts/Classes/Protocols/PriceLineApi.swift
rename to Sources/LightweightCharts/Protocols/PriceLineApi.swift
diff --git a/LightweightCharts/Classes/Protocols/PriceScaleApi.swift b/Sources/LightweightCharts/Protocols/PriceScaleApi.swift
similarity index 100%
rename from LightweightCharts/Classes/Protocols/PriceScaleApi.swift
rename to Sources/LightweightCharts/Protocols/PriceScaleApi.swift
diff --git a/LightweightCharts/Classes/Protocols/SeriesApi.swift b/Sources/LightweightCharts/Protocols/SeriesApi.swift
similarity index 100%
rename from LightweightCharts/Classes/Protocols/SeriesApi.swift
rename to Sources/LightweightCharts/Protocols/SeriesApi.swift
diff --git a/LightweightCharts/Classes/Protocols/TimeScaleApi.swift b/Sources/LightweightCharts/Protocols/TimeScaleApi.swift
similarity index 100%
rename from LightweightCharts/Classes/Protocols/TimeScaleApi.swift
rename to Sources/LightweightCharts/Protocols/TimeScaleApi.swift